Archived

This topic is now archived and is closed to further replies.

gimp

Source for a Memory Manager?

Recommended Posts

gimp    142
I was thinking that it would be good practice creating a class that''ll ''new'' things for me. That way it can keep pointers to the memory locations and on app shutdown I can get it to free all ram at once (as it could just cycle through it''s list). Could anyone recommend some source that does this or in the even that I''m totally off track tell me what I''m doing wrong with my idea''s Thanks gimp

Share this post


Link to post
Share on other sites
Qoy    127
Well, it sounds to me like that would mean saving list data with each object allocated on the heap.. And that sounds kind of ineffecient. Unless you mean keeping an array of pointers (void pointers I guess), but that would limit the number of objects you could have allocated.

Could you go a little more deeply into your idea? I don''t really think it''s that much trouble to manage the memory without a class, as long as you manage everything within its subsystem.

Share this post


Link to post
Share on other sites
gimp    142
Actually all I wanted to do was keep the pointers to ram in a std::list. Then to delete all ram all I have to do is step throught the list free''s the pointers and pop''ing the entries. So, when I call my ''New'' it returns the pointer to the ram as normal but inside it keep the pointers, and check the new''ed ram for validity before passing out the pointers.

Share this post


Link to post
Share on other sites