correct own recent commit, malloc_usable_size() isn't valid for mmap()'d memory.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 28 Aug 2013 22:12:40 +0000 (22:12 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 28 Aug 2013 22:12:40 +0000 (22:12 +0000)
intern/guardedalloc/intern/mallocn.c

index 4cc821ccce0902641701217cc9c2f6cdbf99d5db..19e6e880b6a0f441ced4489b50c829db44eb47da 100644 (file)
@@ -649,8 +649,10 @@ void MEM_printmemlist_stats(void)
                pb++;
 
 #ifdef HAVE_MALLOC_H
-               mem_in_use_slop += (sizeof(MemHead) + sizeof(MemTail) +
-                                   malloc_usable_size((void *)membl)) - membl->len;
+               if (!membl->mmap) {
+                       mem_in_use_slop += (sizeof(MemHead) + sizeof(MemTail) +
+                                           malloc_usable_size((void *)membl)) - membl->len;
+               }
 #endif
 
                if (membl->next)