From: Aredridel Date: 2006-06-12T05:37:12+09:00 Subject: Re: Validity of local VALUEs --=-/Ipj0iOyE/q8G+QNyLYy Content-Type: text/plain Content-Transfer-Encoding: quoted-printable [snip] > I would expect this to crash, but it doesn't. Looking at the object > counts returned by ObjectSpace.each_object, I can see that several gc > cycles are taking place. However, an_object is still valid by the end > of the function. Is this working "by chance"? From the observation > that I don't have 100000 array objects in the ObjectSpace after > calling rb_ary_new 100000 times, I gather that VALUEs do not remain > valid until the end of the function without being bound somewhere. > However, my calls to an_object are still returning the correct value. They are indeed bound somewhere: the stack. The Garbage Collector scans the C stack (somewhat conservatively) for objects to mark as used. Aria --=-/Ipj0iOyE/q8G+QNyLYy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBEjH7ztP09exA3hooRAmX6AJ9U8IcDxcb6LVwlmaruPfrwa8hGlwCgjlQP bERSMrLF+63bsKJCZt5MeTo= =DLmF -----END PGP SIGNATURE----- --=-/Ipj0iOyE/q8G+QNyLYy--