Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-02-14 16:03:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-15 00:01:48 +0300
commita445e491860c0853c398dbb4662c4c21cdb3696d (patch)
tree3198f8c7a72aea367f792015ee12140d36762fe3 /intern/cycles/util/CMakeLists.txt
parent01067fe51c4f3df06fa6e8744da2344253201ec6 (diff)
Cycles: Implement guarded allocator for STL classes
The commit implements a guarded allocator which can be used by STL classes such as vectors, maps and so on. This allocator will keep track of current and peak memory usage which then can be queried. New code for allocator is only active when building Cycles with debug flag (WITH_CYCLES_DEBUG) and doesn't distort regular builds too much. Additionally now we're using own subclass of std::vector which allows us to implement shrink_to_fit() method which would ensure capacity of the vector is as big as it should be (without this making vector smaller will still use all previous memory allocated).
Diffstat (limited to 'intern/cycles/util/CMakeLists.txt')
-rw-r--r--intern/cycles/util/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt
index e0a0921f88d..bfe46ce6f67 100644
--- a/intern/cycles/util/CMakeLists.txt
+++ b/intern/cycles/util/CMakeLists.txt
@@ -74,6 +74,11 @@ set(SRC_HEADERS
util_xml.h
)
+if(WITH_CYCLES_DEBUG)
+ list(APPEND SRC util_guarded_allocator.cpp)
+ list(APPEND SRC_HEADERS util_guarded_allocator.h)
+endif()
+
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})