Example #1
0
/*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);
}
Example #2
0
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;
}
Example #3
0
nsresult
NS_GetMemoryManager(nsIMemory** aResult)
{
  return sGlobalMemory.QueryInterface(NS_GET_IID(nsIMemory), (void**)aResult);
}
Example #4
0
NS_IMETHODIMP
nsMemoryImpl::FlushEvent::Run()
{
  sGlobalMemory.RunFlushers(mReason);
  return NS_OK;
}
Example #5
0
/*static*/ nsresult
nsMemoryImpl::Create(nsISupports* outer, const nsIID& aIID, void **aResult)
{
    NS_ENSURE_NO_AGGREGATION(outer);
    return sGlobalMemory.QueryInterface(aIID, aResult);
}