[Bf-blender-cvs] [6298632] master: Guardedalloc: Don't use aligned blocks to calculate memory sloppyness

Sergey Sharybin noreply at git.blender.org
Mon Apr 20 16:24:52 CEST 2015


Commit: 6298632bfa00b90198bd76b82aa249985530e4fa
Author: Sergey Sharybin
Date:   Mon Apr 20 19:23:25 2015 +0500
Branches: master
https://developer.blender.org/rB6298632bfa00b90198bd76b82aa249985530e4fa

Guardedalloc: Don't use aligned blocks to calculate memory sloppyness

Aligned memory is allocated with memalign() and malloc_usable_size() can't be
used to measure this block.

===================================================================

M	intern/guardedalloc/intern/mallocn_guarded_impl.c

===================================================================

diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c
index bdcace2..88d6f35 100644
--- a/intern/guardedalloc/intern/mallocn_guarded_impl.c
+++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c
@@ -711,7 +711,7 @@ void MEM_guarded_printmemlist_stats(void)
 		totpb++;
 		pb++;
 
-		if (!membl->mmap) {
+		if (!membl->mmap && membl->alignment == 0) {
 			mem_in_use_slop += (sizeof(MemHead) + sizeof(MemTail) +
 			                    malloc_usable_size((void *)membl)) - membl->len;
 		}




More information about the Bf-blender-cvs mailing list