From 4bd40372769e9ebf078dadb0442366176e8990e6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 10 Oct 2013 11:58:01 +0000 Subject: Lock-free memory allocator Release builds will now use lock-free allocator by default without any internal locks happening. MemHead is also reduces to as minimum as it's possible. It still need to be size_t stored in a MemHead in order to make us keep track on memory we're requesting from the system, not memory which system is allocating. This is probably also faster than using a malloc's usable size function. Lock-free guarded allocator will say you whether all the blocks were freed, but wouldn't give you a list of unfreed blocks list. To have such a list use a --debug or --debug-memory command line arguments. Debug builds does have the same behavior as release builds. This is so tools like valgrind are not screwed up by guarded allocator as they're currently are. -- svn merge -r59941:59942 -r60072:60073 -r60093:60094 \ -r60095:60096 ^/branches/soc-2013-depsgraph_mt --- intern/guardedalloc/CMakeLists.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'intern/guardedalloc/CMakeLists.txt') diff --git a/intern/guardedalloc/CMakeLists.txt b/intern/guardedalloc/CMakeLists.txt index 1e140c5b674..b7a59da7813 100644 --- a/intern/guardedalloc/CMakeLists.txt +++ b/intern/guardedalloc/CMakeLists.txt @@ -34,11 +34,11 @@ set(INC_SYS set(SRC ./intern/mallocn.c + ./intern/mallocn_guarded_impl.c + ./intern/mallocn_lockfree_impl.c MEM_guardedalloc.h - - # include here since its a header-only - ../atomic/atomic_ops.h + ./intern/mallocn_intern.h ) if(WIN32 AND NOT UNIX) @@ -49,12 +49,6 @@ if(WIN32 AND NOT UNIX) ) endif() -if (WITH_GUARDEDALLOC) - add_definitions(-DWITH_GUARDEDALLOC) -else() - message(WARNING "Disabling GuardedAlloc is experemental, use at own risk!") -endif() - blender_add_lib(bf_intern_guardedalloc "${SRC}" "${INC}" "${INC_SYS}") # Override C++ alloc, optional. -- cgit v1.2.3