Arrays / collections with literal syntax - fixed size?
bryce at kampjes.demon.co.uk
bryce at kampjes.demon.co.uk
Mon Jan 7 20:30:19 UTC 2008
Lukas Renggli writes:
> > Now I was under the impression, that a context had a copy of a compiled
> > method with copies of the literals, so that you could only modify the
> > copies but not the literals in the compiled method. But it seems not to
> > be that way:
>
> This would turn a simple message send to be incredibly expensive.
>
> > This is evil! :)
>
> I want an immutability flag in the object-header!
It may be better to implement immutability inside the image using
immutable sub-classes and similar tricks to the write barriers for OO
DBs.
Doing so would allow the implementation to be optimised by all
optimisations that help for sends in general. Adding a immutability
flag would add another thing to check on every instance variable
write. Squeak's write barrier is expensive enough as it is.
Bryce
More information about the Squeak-dev
mailing list
|