- Memory allocated in thread 1 with scalable_malloc.
- Thread 1 terminated.
- Thread 2 started.
- Thread 2 calls scalable_free on data.
- Thread 2 allocates more memory using scalable_malloc.
I have debugged in making sure that mallocThreadShutdownNotification is correctly being called ;)
If a thread was shut down nicely (and not just killed),the memory it had taken should be reused, though not necessarily immediately. Possibly the problem you see might be partially caused by different allocation sizes requested by the first and the second threads, as the TBB allocator separates memory pools (bins) for different sizes.
If you have a test case that exhibits the problem, I would appreciate if you submit it here.