MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Garbage collection and mutable data structures

Hi MathGroup,

This snippet of code is giving me headaches:

$HistoryLength = 0;
NewCell[i_] := Module[{c}, CellVal[c] ^= i; c]
NewCell /@ Range[10^5];

It occurred while trying to build mutable data structures by using
upvalues. I can't understand why the temporary variable c is not freed
since I don't keep any reference to it.
Have I missed something in the reference counting scheme ?

Thanks in advance,

  • Prev by Date: Re: "Assuming"
  • Next by Date: Re: Part or Partition or Split or Extract or ...... ????
  • Previous by thread: Re: Pythonika - Difficulties to install
  • Next by thread: Re: Garbage collection and mutable data structures