-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for user allocator #55
Comments
Would like to see this as well. Might mean that you'd need to get rid of using std::vector and use a custom array class. |
I was planning on using the allocator class that you can provide to std::vector, maybe I'll create my own container classes at some point in the future (for now it is not really in the way as it is mostly used for long term storage). |
I have a problem that might be related to this (not sure). I have my own custom allocator where I keep track of memory, but when I am shutting down the app, I got tons of memory leaks from the memory allocated during the call to JPH::RegisterTypes(); |
Can you try #146 and call JPH::Factory::sInstance.Clear()? My guess is that your leak detection code runs before the static destructors are called. I'm not 100% sure that this will fix it as some STL implementations seem to allocate memory even if the map is empty. |
I did some more work on #146 and removed most of the memory allocated by global constructors and made the application responsible for newing/destroying the factory. There are a couple of allocations left by the global constructors, most notably the SphereShape used by Body::sFixedToWorld, but I believe that that should not be an issue for your particular case. |
Merged #183. |
YAY! |
We already discussed it so I know it's on your list, but I'd like to officially ask for adding a "user allocator". The goal would be to allocate all objects (not just the temporary ones) thought this allocator, so that we can accurately track memory usage.
Thanks!
The text was updated successfully, but these errors were encountered: