/*static*/ nsresult nsMemoryImpl::Create(nsISupports* outer, const nsIID& aIID, void **aResult) { if (NS_WARN_IF(outer)) return NS_ERROR_NO_AGGREGATION; return sGlobalMemory.QueryInterface(aIID, aResult); }
NS_Realloc(void* ptr, PRSize size) { if (size > PR_INT32_MAX) return nsnull; void* result = moz_realloc(ptr, size); if (! result && size != 0) { // Request an asynchronous flush sGlobalMemory.FlushMemory(NS_LITERAL_STRING("alloc-failure").get(), PR_FALSE); } return result; }
nsresult NS_GetMemoryManager(nsIMemory** aResult) { return sGlobalMemory.QueryInterface(NS_GET_IID(nsIMemory), (void**)aResult); }
NS_IMETHODIMP nsMemoryImpl::FlushEvent::Run() { sGlobalMemory.RunFlushers(mReason); return NS_OK; }
/*static*/ nsresult nsMemoryImpl::Create(nsISupports* outer, const nsIID& aIID, void **aResult) { NS_ENSURE_NO_AGGREGATION(outer); return sGlobalMemory.QueryInterface(aIID, aResult); }