Changeset 101852 in vbox for trunk/src/libs/xpcom18a4/xpcom/build
- Timestamp:
- Nov 6, 2023 11:09:45 AM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/xpcom/build
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/build/nsXPCOM.h
r101846 r101852 171 171 172 172 /** 173 * Public Method to access to the memory manager. See nsIMemory174 *175 * @status FROZEN176 * @param result Interface pointer to the memory manager177 *178 * @return NS_OK for success;179 * other error codes indicate a failure during initialisation.180 *181 */182 extern "C" NS_COM nsresult183 NS_GetMemoryManager(nsIMemory* *result);184 185 /**186 173 * Public Method to create an instance of a nsILocalFile. This function 187 174 * may be called prior to NS_InitXPCOM2. -
trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp
r101846 r101852 48 48 #include "nsBinaryStream.h" 49 49 50 #include "nsMemoryImpl.h"51 50 #include "nsDebugImpl.h" 52 51 #include "nsTraceRefcntImpl.h" … … 124 123 125 124 static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); 126 static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID);127 125 static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); 128 126 … … 326 324 327 325 static const nsModuleComponentInfo components[] = { 328 COMPONENT(MEMORY, nsMemoryImpl::Create),329 326 COMPONENT(DEBUG, nsDebugImpl::Create), 330 327 #define NS_ERRORSERVICE_CLASSNAME NS_ERRORSERVICE_NAME … … 420 417 const int components_length = sizeof(components) / sizeof(components[0]); 421 418 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 437 419 // gDebug will be freed during shutdown. 438 420 static nsIDebug* gDebug = nsnull; … … 500 482 // Establish the main thread here. 501 483 rv = nsIThread::SetMainThread(); 502 if (NS_FAILED(rv)) return rv;503 504 // Startup the memory manager505 rv = nsMemoryImpl::Startup();506 484 if (NS_FAILED(rv)) return rv; 507 485 … … 586 564 } 587 565 } 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;594 566 595 567 rv = compMgr->RegisterService(kComponentManagerCID, NS_STATIC_CAST(nsIComponentManager*, compMgr)); … … 914 886 915 887 EmptyEnumeratorImpl::Shutdown(); 916 nsMemoryImpl::Shutdown();917 NS_IF_RELEASE(gMemory);918 888 919 889 nsThread::Shutdown();
Note:
See TracChangeset
for help on using the changeset viewer.