On Thu, 1 Aug 2002, Melvin Smith wrote:

> Jerome Vouillon writes:
> >On Wed, Jul 31, 2002 at 11:22:56PM -0400, Melvin Smith wrote:
> >> And they need to be COW, as closures have access to their
> >> own copies of lexicals.  I asked Jonathan to reuse the stack code
> >> I had already written because it was using the same semantics
> >> with COW as control and user stacks.
> >
> >I'm confused here.  In Jonathan's code, the stack is COW, not the
> >scratchpads.  If instead of using stacks you make each scratchpad
> >contains a pointer to its parent, there is no need to copy anything:
> >several scratchpads can then share the same parent.
>
> 1) Our stacks are being reworked to be tree-based, so multiple children
>    can point to the same parent.

COW is a win when you may be able to avoid copying large amounts of data.
In a world of 4-character indents and 80-column editor windows, I'm not
sure the extra machinery of COW is a win -- an immediate copy of a stack 3
or 4 deep will be fast, and won't take much memory.

/s

Reply via email to