Jump to content
  • Advertisement
  • entries
  • comments
  • views

Garbage Collection

Sign in to follow this  


I've decided to add a incremental tracing garbage collector to my otherwise unnamed 'scripting' framework. All objects are allocated in a TMemoryPool object, so I'll need to have a way to return them to the pool. I was looking at the GM framework and I like the way they've implemented their garbage collector. I think I'm going to model it in a similar way.

The idea is that there's no reference counting, the GC will look through a few allocated objects on each frame and dtermine whether thay can be reached or not. If they can't, they're sectioned off in a 'white' list and work continues. When everything has been scanned, the GC enters a cleanup phase which destructs the objects and hence returns them back to their specified memory pools.

I'm really liking the freelist/MemoryPool approach, so much so it's going to wing its way into Manta-X soon - that is, when I'm done with this current project.
Sign in to follow this  


Recommended Comments

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!