From: nobu.nokada@... Date: 2004-02-06T11:01:18+09:00 Subject: Re: Is there any way to mark an object as "always in use" (specifically, in a C extension)? Hi, At Fri, 6 Feb 2004 10:29:43 +0900, Harry Ohlsen wrote in [ruby-talk:91665]: > So, I guess my questions are: > (1) is this likely to be what was really going wrong, or did > adding the rb_gc_mark() calls fix the problem by pure luck > and it's waiting to bite me again, further down the track; Seems correct. > (2) is there some way I can mark all of those objects as > always being in use, so that they'll never be considered for > garbage collection; You may want to use rb_gc_register_address()? > and more importantly (3) is there a better way to do achieve > this? Is it the single big hash in process, but not per instance, right? 2 ways: 1. rb_gc_register_address(), 2. make the hash a hidden instance variable of any class, if exists. -- Nobu Nakada