[Bf-blender-cvs] [9fc2c37] master: Guardedalloc: Reset peak memory should set peak to currently allocated memory

Sergey Sharybin noreply at git.blender.org
Thu Feb 19 09:14:51 CET 2015


Commit: 9fc2c3732878288bb3a69e163a702d6e46ad95ef
Author: Sergey Sharybin
Date:   Thu Feb 19 13:14:06 2015 +0500
Branches: master
https://developer.blender.org/rB9fc2c3732878288bb3a69e163a702d6e46ad95ef

Guardedalloc: Reset peak memory should set peak to currently allocated memory

Otherwise statistics could be really funny looking.

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

M	intern/guardedalloc/intern/mallocn_guarded_impl.c
M	intern/guardedalloc/intern/mallocn_lockfree_impl.c

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

diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c
index 9a50342..bdcace2 100644
--- a/intern/guardedalloc/intern/mallocn_guarded_impl.c
+++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c
@@ -1148,7 +1148,7 @@ size_t MEM_guarded_get_peak_memory(void)
 void MEM_guarded_reset_peak_memory(void)
 {
 	mem_lock_thread();
-	peak_mem = 0;
+	peak_mem = mem_in_use;
 	mem_unlock_thread();
 }
 
diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c
index b5f3d1b..a80d67c 100644
--- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c
+++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c
@@ -478,7 +478,7 @@ unsigned int MEM_lockfree_get_memory_blocks_in_use(void)
 /* dummy */
 void MEM_lockfree_reset_peak_memory(void)
 {
-	peak_mem = 0;
+	peak_mem = mem_in_use;
 }
 
 size_t MEM_lockfree_get_peak_memory(void)




More information about the Bf-blender-cvs mailing list