VirtualBox

Ignore:
Timestamp:
Nov 6, 2023 11:09:45 AM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Get rid of nsMemoryImpl.{cpp,h} and nsIMemory and repalce it with direct calls to RTMem* APIs, bugref:10545

Location:
trunk/src/libs/xpcom18a4/xpcom/build
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/build/nsXPCOM.h

    r101846 r101852  
    171171
    172172/**
    173  * Public Method to access to the memory manager.  See nsIMemory
    174  *
    175  * @status FROZEN
    176  * @param result Interface pointer to the memory manager
    177  *
    178  * @return NS_OK for success;
    179  *         other error codes indicate a failure during initialisation.
    180  *
    181  */
    182 extern "C" NS_COM nsresult
    183 NS_GetMemoryManager(nsIMemory* *result);
    184 
    185 /**
    186173 * Public Method to create an instance of a nsILocalFile.  This function
    187174 * may be called prior to NS_InitXPCOM2. 
  • trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp

    r101846 r101852  
    4848#include "nsBinaryStream.h"
    4949
    50 #include "nsMemoryImpl.h"
    5150#include "nsDebugImpl.h"
    5251#include "nsTraceRefcntImpl.h"
     
    124123
    125124static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
    126 static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID);
    127125static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
    128126
     
    326324
    327325static const nsModuleComponentInfo components[] = {
    328     COMPONENT(MEMORY, nsMemoryImpl::Create),
    329326    COMPONENT(DEBUG,  nsDebugImpl::Create),
    330327#define NS_ERRORSERVICE_CLASSNAME NS_ERRORSERVICE_NAME
     
    420417const int components_length = sizeof(components) / sizeof(components[0]);
    421418
    422 // gMemory will be freed during shutdown.
    423 static nsIMemory* gMemory = nsnull;
    424 nsresult NS_COM NS_GetMemoryManager(nsIMemory* *result)
    425 {
    426     nsresult rv = NS_OK;
    427     if (!gMemory)
    428     {
    429         rv = nsMemoryImpl::Create(nsnull,
    430                                   NS_GET_IID(nsIMemory),
    431                                   (void**)&gMemory);
    432     }
    433     NS_IF_ADDREF(*result = gMemory);
    434     return rv;
    435 }
    436 
    437419// gDebug will be freed during shutdown.
    438420static nsIDebug* gDebug = nsnull;
     
    500482    // Establish the main thread here.
    501483    rv = nsIThread::SetMainThread();
    502     if (NS_FAILED(rv)) return rv;
    503 
    504     // Startup the memory manager
    505     rv = nsMemoryImpl::Startup();
    506484    if (NS_FAILED(rv)) return rv;
    507485
     
    586564        }
    587565    }
    588 
    589     nsCOMPtr<nsIMemory> memory;
    590     NS_GetMemoryManager(getter_AddRefs(memory));
    591     // dougt - these calls will be moved into a new interface when nsIComponentManager is frozen.
    592     rv = compMgr->RegisterService(kMemoryCID, memory);
    593     if (NS_FAILED(rv)) return rv;
    594566
    595567    rv = compMgr->RegisterService(kComponentManagerCID, NS_STATIC_CAST(nsIComponentManager*, compMgr));
     
    914886
    915887    EmptyEnumeratorImpl::Shutdown();
    916     nsMemoryImpl::Shutdown();
    917     NS_IF_RELEASE(gMemory);
    918888
    919889    nsThread::Shutdown();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette