MemPoolSetSmallBlockSize, MemPoolSetBlockSizeFS, MemPoolSetFloor, MemPoolSetCeiling, MemPoolSetPageSize) can be used with SmartHeap 4 thread-specific pools. All you need to do is reference MemDefaultPool to obtain the current thread's pool. In order to change a setting (such as page size) for all the thread-specific pools, it is necessary to make the API call (e.g. MemPoolSetPageSize(MemDefaultPool, 0x10000) from each thread.
MemDefaultPool is no longer global -- it is now a per-thread value in multi-threaded SmartHeap builds.
MemAllocPtr, etc, or new implemented in terms of MemAllocPtr), so existing code will not be broken and developers still have the option of creating custom memory pools. SmartHeap 4's pool/thread enhancement applies only to malloc/new.
MemRegisterTaskMemRegisterTask or define MemPoolDefaultFlags in SmartHeap 4.0 as in previous SmartHeap versions and on some other platforms. However, if you create your own SmartHeap memory pools, you must still specify MEM_POOL_SERIALIZE in the flags parameter if the pool is referenced in more than one thread. Alternatively you can link your app with a multi-threaded version of the SmartHeap library and the MEM_POOL_SERIALIZE flag will be set automatically.
Knowledge Base
MicroQuill home
HeapAgent | SmartHeap | SwapTuner
HeapAgent free trial | SwapTuner free trial
Prices/ordering