Jump to content
  • entries
    437
  • comments
    1000
  • views
    337164

Garbage Collection

Sign in to follow this  
evolutional

105 views

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  


2 Comments


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.

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!