[Pharo-project] About a object life

2012-11-03 Thread Edgar J. De Cleene
Folks: I wish know how old a object is. Any have code for this ? Thanks in advance Edgar

Re: [Pharo-project] About a object life

2012-11-04 Thread Max Leske
Only for new objects? If so, you could add an instance variable to Object and store a timestamp. On 03.11.2012, at 15:26, Edgar J. De Cleene wrote: > Folks: > > I wish know how old a object is. > > Any have code for this ? > > Thanks in advance > > Edgar

Re: [Pharo-project] About a object life

2012-11-04 Thread Mariano Martinez Peck
On Sun, Nov 4, 2012 at 2:45 PM, Max Leske wrote: > Only for new objects? If so, you could add an instance variable to Object > and store a timestamp. > > Well, kind of ;) Because if you do that, your image will crash. This is because the VM directly accesses (by offset) certain instVars of certa

Re: [Pharo-project] About a object life

2012-11-04 Thread Max Leske
ups :) On 04.11.2012, at 15:04, Mariano Martinez Peck wrote: > > > > On Sun, Nov 4, 2012 at 2:45 PM, Max Leske wrote: > Only for new objects? If so, you could add an instance variable to Object and > store a timestamp. > > > Well, kind of ;) Because if you do that, your image will crash

Re: [Pharo-project] About a object life

2012-11-04 Thread Craig Latta
Hi Edgar-- Do you really want to know how old an object is, or just whether it's older than some other object? If you don't care about degrading the identity hash distribution, you could steal a few bits from the object header for a counter. -C -- Craig Latta www.netjam.org/resume +31 6

Re: [Pharo-project] About a object life

2012-11-04 Thread Edgar J. De Cleene
On 11/4/12 4:33 PM, "Craig Latta" wrote: > > Hi Edgar-- > > Do you really want to know how old an object is, or just whether > it's older than some other object? If you don't care about degrading the > identity hash distribution, you could steal a few bits from the object > header for a