RE: NamedNodeMap

Allen, Michael B (RSCH) writes:
 > I don't think Memory Management would be an issue. In your
 > destroyNode function you remove the list of NodeLists and if it's
 > not NULL remove the entry from each . Then free the node per usual.

 > I'm not really sure what you mean by object lifetime issues
 > though. Do you mean their liftimes would be so short that all the
 > extra machinery becomes silly? I agree, but I see no alternative.

  I don't know that it would be a problem for you (I vaguely recall
you said you were working in C or C++), but it could be a problem for
garbage-collected system.  Circular references were considered a huge
problem in older versions of Python because it used only reference
counting for GC, and even today the cycle detector is optional (it
*does* have a performance penalty, as all "real" GC systems do).
With non-refcount GC, there can be a lack of temporal proximity
between an object becoming garbage and being collected; unless you
collect frequently (higher overhead), you can accumulate an enormous
amount of garbage very quickly if you use a lot of temporary objects.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations

Received on Wednesday, 11 July 2001 17:30:26 UTC