[Vm-dev] Re: Is SmallInteger a really too dangerous class?
Mariano Martinez Peck
marianopeck at gmail.com
Mon Dec 13 21:06:47 UTC 2010
sorry, it should be
SmallInteger class >> initialize
self addInstVarName: 'Zaraza'.
Notice I want to add a class variable to SmallIneteger, not instVar.
Cheers
mariano
On Mon, Dec 13, 2010 at 9:16 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:
> Hi folks. Sorry for the cross-post, I am not sure if it is image or vm
> problem.
>
> If I implement this:
>
> SmallInteger >> initialize
> self addInstVarName: 'Zaraza'.
>
> I have the error: 'SmallInteger cannot be changed'
>
> This is because SmallInteger is in the ClassBuilder >> tooDangerousClasses
> and the error is in ClassBuilder >> name: className inEnvironment: env
> subclassOf: newSuper type: type instanceVariableNames: instVarString
> classVariableNames: classVarString poolDictionaries: poolString category:
> category unsafe: unsafe
>
> Now....since this is Smalltalk, I can just comment something, continue, or
> any other kind of hack so that I can add class variables to SmallInetger.
> For my CompiledMethod proxies stuff, I am using SmallIntegers and I have
> some crashes (one is due to a corrupt heap and Eliot said something about
> sizes)...I wonder if this is related to this...So the question is: is
> really SMallInteger a too dangerous class so that it cannot be changed? not
> even adding a class variable??? does the VM assume that the class
> SmallInetger has a fixed size? if true, where?
>
> Thanks in advance
>
> Mariano
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101213/340bcc0b/attachment.htm
More information about the Vm-dev
mailing list