From 1ac57ccbc8b162ffcbede477683d3d53afa209cd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 28 Aug 2013 22:12:40 +0000 Subject: correct own recent commit, malloc_usable_size() isn't valid for mmap()'d memory. --- intern/guardedalloc/intern/mallocn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 4cc821ccce0..19e6e880b6a 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -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) -- cgit v1.2.3