The version in the CVS contains Copy-on-write indirect stacks. Until now,
the stacks were allocated dynamically with enough size given to them, and
then they were all cached into the stacks collection.
This was a bit wasty because stacks that were not modified also had to be
looked up. So, I implemented the following scheme:
1. I keep a vector of bits, one for each stack.
2. When a state is duplicated, this vector is set to zeros.
3. When the user wishes to modify a stack, he calls a special macro that
copies it to a temporary buffer, and marks its bit as 1.
4. When the state is cached, it leaves the stacks whose flags are zero
alone, and looks up the stacks whose flags are set.
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish shlomif_at_vipe.technion.ac.il
Home Page:
http://t2.technion.ac.il/~shlomif/
Home E-mail: shlomif_at_iglu.org.il
He who re-invents the wheel, understands much better how a wheel works.
Received on Tue Jun 11 2002 - 04:22:30 IDT