SDL uses internal C functions for memory management.
I use SDL library in my C++ code project and use C++ functions (new, new[], delete, delete[], std::vector::push_back() and etc) for appliction-level dynamycally created objects.
Sometimes I need to create objects in different threads.
Is it thread-safe memory management technique when SDL uses own C functions and I use C++ functions?
This is fixed in 2.0.9 now. Tested and working well. I’ve even messed around with garbage collection (freeing up unused game resources, for example) while SDL calls the custom malloc() and it works as expected.
Please note that if you put a chunk counter in, you will get some small chunks (about 2 to 8) leaked by SDL at exit. Sam’s aware and it may or may not be fixed in next release. It’s not a major issue.