On 27 June 2013 18:33, Stéphane Ducasse <[email protected]> wrote: > Igor we should document such mistakes > This is important can you add such comments in class comment? >
Well, it is a general rule to never operate with pointers to moveable objects, because objects may change their locations at any moment and you don't control that. A pointer to object can be considered non-moving only if: - there is no allocation(s) of new objects between obtaining the pointer value and using it (like passing to external function) - you not running any smalltalk code/function you call will NOT call back and enter smalltalk code - you cannot be interrupted by something, which would allow the above. in short, anything which may cause GC between point where you got the pointer and point where you going to use it is a recipe for disaster. -- Best regards, Igor Stasenko.
