[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02305] Re: [Q]: _id2ref broken?

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-31 17:45:16 UTC
List: ruby-talk #2305
Hi,

In message "[ruby-talk:02262] [Q]: _id2ref broken?"
    on 00/03/30, Clemens Hintze <c.hintze@gmx.net> writes:

|Up to Ruby-1.2 it should have worked, here the code of _id2ref has
|contained a piece of:
|
|    :
|    if (RANY(ptr)->as.free.flag == 0) {
|	IndexError("0x%x is recycled object", ptr);
|    }
|    :
|
|But since Ruby-1.3.x the code was changed to:
|
|    :
|    if (BUILTIN_TYPE(ptr) == 0) {
|        rb_raise(rb_eIndexError, "0x%x is recycled object", ptr);
|    }
|    :

These codes are basicly doing same thing.  The real difference is not
there. but in gc_sweep().  It is for safety.

Listen, Clemens, exporting a reference from _id2name in finalizer is
really really dangerous in current implementation.  So I prohibited.
Your trial (calling `finalize' method of unreferenced object) is
taking exactly this risk.  Java-like two phase GC may solve this
problem but I'm sure it would be performance penalty.

							matz.

In This Thread