Re: 64bit support
- Posted by DerekParnell (admin) Mar 03, 2009
- 1051 views
Well, if a sequence is resized, the sequence changes so copy-on-write ensures that there is only one reference to the new sequence anyway.
From the point of view of the Euphoria code, you are right. But at the lower level, the run time engine (and translated code) can make a number of optimizations if it can safely assume double indirection. Basically, we can store the sequence reference in a temporary variable, and later use that variable knowing that any calls that might have been made to internal functions, have not invalidated it's reference. If we did not do that, we would be required to update every stored reference (in scope) after calling any internal function because we do not know what that function does to the active sequence.