Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Memory Management

Sign in to follow this  


I waited a couple of days to post as I hadn't done much work on the engine and didn't want to waste server space otherwise.

What have I been working on? As the title states: Memory Management. About a year ago a buddy of mine and I developed our own memory management of sorts. It was based on the Enginuity's algorithm although we didn't like the typicial system of splitting up the reference counting and the smart pointer. We also didn't like how the smart pointer was limited to the base Object type. So we made our own twist where we could use this for anything from integers to custom classes.

It probably has a ton of holes in it, but it's always fun to know you made something that wasn't directly out of a text book! It's also highly likely that it has been done before and people stay away from it for a reason :).

Anyway, I lost the code for it when my laptop hd crashed so I finally got ahold of him and he sent the old code over to me.

After dusting off the file, I made a few optimizations to it and also added a basic garbage collector. I ran various tests against it and it proved memory-leak free (according to crtdbg anyway!).

The code is still a little messy since I haven't implemented a Logger yet and tons of debug messages inhabit it's contents. When I get it cleaned up, I'll post some code examples of it if anyone seems interested.

As for the Logger, I plan to implement something based on this article:


It appears to be a very clean solution and I'm pretty psyched to see the results. Talk about sounding like a nerd. Nonetheless, it will be highly benificial.

Regarding the basic structure of the engine: I have decided to stick with my original design of accessing handles although I will most likely take a more polymorphic approach instead. This probably means nothing to you readers, but it will show itself in time.

Thanks for looking!
Sign in to follow this  

1 Comment

Recommended Comments

Actually, I'm glad to hear that you didn't use the stock memory manager system from Enginuity, because I hate it. The whole IMMObject thing looks OK on the surface, but it doesn't support multiple inheritance or stack objects O_O It'd be OK if you were creating some kind of Java-like based on C++ but that's not what it was supposed to be...

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!