Faster Virtual Method Dispatch

Walter Bright newshound at digitalmars.com
Wed Apr 26 13:51:24 PDT 2006


James Dunne wrote:
> Can you provide me a few legitimate examples of when you won't know what 
> to free and when to free it?  I'm having a tough time coming up with 
> examples on my own...

One example that has plagued me in the past is having two distinct tree 
data structures, and it becomes necessary for a node in one tree to 
refer to data in the other.

Or when you have a third data structure, and you need to point to data 
in one or the other or both of the first two trees.

A typical example of that is symbol tables inside the compiler. In the 
DMD front end (which is garbage collected) the data has all kinds of 
cross-connections in it.

I.e. the problem crops up when the data in memory just doesn't fit into 
a strictly heirarcical format.



More information about the Digitalmars-d mailing list