From: Lyle Johnson Date: 2006-06-02T06:30:49+09:00 Subject: Re: How can I pin a Ruby object in memory? On 6/1/06, John Lam wrote: > I have some data that I'm storing in a T_DATA VALUE. Is the data > that's stored there part of the GC heap - IOW can it move in memory? > If so, is there a way to pin it so that it doesn't move while I'm > using it? Not sure if I understand the question. A Data object has a pointer (RDATA(obj)->data) to some block of memory that you've allocated, and no, Ruby's GC process isn't going to assign some new value to that pointer. If you're asking whether Ruby will move the address of the Data object itself: I'm guessing that that's possible.