[Bf-codereview] MovieCache implementation (issue 5283049)

g.ulairi at gmail.com g.ulairi at gmail.com
Sat Oct 15 18:43:33 CEST 2011


Reviewers: bf-codereview_blender.org,

Description:
Implementation of cache for general movie-related areas such as
sequencer and clip editor (in the future)

Some changes in limiter were necessary:
- Limiter counted mapped memory twice when was checking how many memory
is used.
- It was using "global" memory usage not memory usage by cached
elements. It will cause big problems when there's large mesh or plenty
of undo steps are in memory nothing would be cached in sequencer.
- To solve this problem introduced "callback" to measure cached element
size. It could be not very accurate in general, but it works well for
image buffers. And if this callback isn't set old-school memory usage
check would be used.
- The whole cache used to get freed when memory limit exceeded, now
it'll drop only as much elements as necessary to reduce memory usage.

Seqcache is switched to use this new cache code.

Please review this at http://codereview.appspot.com/5283049/

Affected files:
   intern/memutil/MEM_CacheLimiter.h
   intern/memutil/MEM_CacheLimiterC-Api.h
   intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
   source/blender/blenkernel/BKE_moviecache.h
   source/blender/blenkernel/BKE_sequencer.h
   source/blender/blenkernel/CMakeLists.txt
   source/blender/blenkernel/intern/blender.c
   source/blender/blenkernel/intern/moviecache.c
   source/blender/blenkernel/intern/seqcache.c
   source/blender/imbuf/intern/allocimbuf.c




More information about the Bf-codereview mailing list