[Vm-dev] Re: Is SmallInteger a really too dangerous class?

Mariano Martinez Peck marianopeck at gmail.com
Tue Dec 14 19:41:12 UTC 2010


On Mon, Dec 13, 2010 at 11:48 PM, Bert Freudenberg <bert at freudenbergs.de>wrote:

>
>
> On 13.12.2010, at 13:06, Mariano Martinez Peck wrote:
>
> sorry, it should be
>
> SmallInteger class >> initialize
>     self addInstVarName: 'Zaraza'.
>
> Notice I want to add a class variable to SmallIneteger, not instVar.
>
>
>
> This is not really a VM question. Class variables are held in a dictionary.
> The VM knows nothing about this.
>
>
Ok, perfect. I asked because once I was doing some proxies for Classes and I
realized that the VM automatically access the offset of the Class instVar
like methodDict, etc.
I thought that maybe at some place the same could happen with SmallInteger
class.

Thanks

Mariano


> You add class variables simply by adding them to the class pool:
>
> SmallInteger ensureClassPool.
> SmallInteger classPool at: #Zaraza put: 42.
>
> - Bert -
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101214/eaac39d5/attachment-0001.htm


More information about the Vm-dev mailing list