[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copy-on-write (was: globals considered harmful)
Re: By efficient, I assume you mean essentially constant-time access.
I suspect (without much hard evidence, I quickly add) that the
NewtonScript interpreter may be using a linked structure (perhaps
akin to the classic LISP a-list?) to represent a frame. This
certainly avoids the need to copy the entire object and update
inbound references, but at the cost of more work in resolving each
frame.slot reference.
Given their emphasis on space over speed, and given the relatively
small amount of RAM, I would expect that the Newton does NOT use a
linked structure to represent the copied-down slots. My guess is that
that they just make a copy that extends the object by the extra slot,
then do a pass over memory to redirect all pointers to the object to
refer to the new copy.
But this is just speculation.
-- John