From fb0f74dfda96af36771d2d13be062845db993566 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Tue, 10 Jan 2006 20:39:35 +0000 Subject: [PATCH] fixes bug 322908 "ASSERTION: NS_Alloc of size 0: 'size'" r=bsmedberg git-svn-id: svn://10.0.0.236/trunk@187256 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/base/nsMemoryImpl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mozilla/xpcom/base/nsMemoryImpl.cpp b/mozilla/xpcom/base/nsMemoryImpl.cpp index 9c8d6c80fac..36c2ad191a2 100644 --- a/mozilla/xpcom/base/nsMemoryImpl.cpp +++ b/mozilla/xpcom/base/nsMemoryImpl.cpp @@ -332,8 +332,6 @@ nsMemoryImpl::sFlushEvent; XPCOM_API(void*) NS_Alloc(PRSize size) { - NS_ASSERTION(size, "NS_Alloc of size 0"); - void* result = MALLOC1(size); if (! result) { // Request an asynchronous flush @@ -345,9 +343,8 @@ NS_Alloc(PRSize size) XPCOM_API(void*) NS_Realloc(void* ptr, PRSize size) { - NS_ASSERTION(size, "NS_Realloc of size 0"); void* result = REALLOC1(ptr, size); - if (! result) { + if (! result && size != 0) { // Request an asynchronous flush sGlobalMemory.FlushMemory(NS_LITERAL_STRING("alloc-failure").get(), PR_FALSE); }