Commit Graph

2 Commits

Author SHA1 Message Date
Sergey Sharybin
18937f6fb5 Cycles: Add ifdef switch to use blender's guardedalloc for vector allocation
It's actually a bad level call, but it's inside ifdef block and disabled by
default and only intended to be used for development purposes.

Main idea of this change is to combine statistics coming from Cycles and
Blender during scene synchronization step, to see if further changes are
actually reducing memory footprint.
2015-02-15 02:01:48 +05:00
Sergey Sharybin
a445e49186 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).
2015-02-15 02:01:48 +05:00