|
From: strk <st...@ke...> - 2004-04-01 08:31:24
|
Thinking about Ming garbage collector: My transparent wrapper is good, if improved, as a general memory debugger, but its far too generic to be a good garbage collector. A garbage collector for Ming should only take care of objects exposed to the user trhough its API. In this way the overhead associated with it would be reduced and we can use compiler checks to detect bugs. Users will allocate: SWFMovie SWFMovieClip SWFShape SWFAction SWFText SWFSound SWFVideo ... ? For each of these classes we could keep a linked list of existing instances, and augment the structures to store a link to the node rapresenting that instance. The destructors would remove an instance node from the list, and the constructors would add one. The garbage collector would then call a specific destructor for each of the nodes left in the list. I think this would be the neater implementation. We can progressively start with each of the objects. What do you think ? --strk; |