Jump to content
  • Advertisement
Sign in to follow this  
CTar

Memory problems

This topic is 4709 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quite a while ago I created a thread because my library was throwing an exception, it threw the exception because I had a STL container which for some reason got created in one DLL and destroyed in another DLL, never really figured out the cause, but two things solved the problem: 1) Changing the runtime (MSVC) to Multithreaded DLL. 2) Making an STL allocator calling Win32 functions instead of std::allocator. Now I'm starting to have some problems with my approach, first if I use my Win32Allocator I can't also supply a specialised allocator. I might be able to do some template stuff to make it possible to specify another allocator, but my biggest problem is one I just discovered. When using other libraries this exception gets thrown aswell (for example in the Loki singleton), I don't know what to do I could edit the Loki source, but that would be a very bad approach for two reasons: 1) This is probably not allowed in the license (I use more than one library so there is a good chance at least one forbid me to change the source). 2) Users would have to replace their Loki (or whatever library I change) implementation with mine. I don't want to force the user to use a specific runtime, but it might be necessary if I find no other alternatives. So have anyone overcome this problem? If so, how?

Share this post


Link to post
Share on other sites
Advertisement
Did you create the DLL files yourself or are they the loki stuff?
If you have created them, maybe you can use a container other than a STL one, like creating your own and modifying it to work within their DLL scopes. I hope this will help.

Share this post


Link to post
Share on other sites
Quote:
Original post by Last Attacker
Did you create the DLL files yourself or are they the loki stuff?
If you have created them, maybe you can use a container other than a STL one, like creating your own and modifying it to work within their DLL scopes. I hope this will help.


If yoy by DLL files mean the files using the Loki library (my game engine), then yes I created them myself. If you mean the Loki DLL then I'm using the static library, but I could re-compile, the problem is that if I change Loki code then I would need all my users to get my custom-Loki code and this is a general problem so it also happens with other libraries, which means that I can't do it since some licenses say I can't edit the source code. Also I don't want to use other containers than the STL ones.

I'm beginning to wonder if I should just change the runtime, what is the difference between the multithreaded runtime and the multithreaded dll runtime?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!