From: Nobuyoshi Nakada Date: 2011-09-16T10:16:06+09:00 Subject: [ruby-core:39568] Re: [Ruby 1.9 - Bug #5193] ruby_thread_data_type linker errors fixed with RUBY_EXTERN Hi, At Fri, 16 Sep 2011 02:03:39 +0900, Charlie Savage wrote in [ruby-core:39564]: > > The reason for _id2ref is that threads are stored in > > debug contexts as object IDs, and reversed when accessing > > with checking if it's alive at same time. I have no > > idea why such roundabout way is used, and guess this > > could be simpler. > > Could this be to avoid holding a reference to a thread > object, and thus not allowing it to be GCed? No, it keeps thread objects. But I'm not sure if allowing GC is necessary. Seems a thread object will be removed from the table by check_thread_contexts() if the thread has terminated. Isn't it enough? If it is really critical, you would be possible to remove dead threads and mark living ones only. > If rb_vm_make_env_object() and rb_vm_get_sourceline() are > exported, would that solve the need for compiling against > vm_core.h? I'm uncertain of "the need". You mean that you won't need the header to compile ruby-debug? -- Nobu Nakada