From: Kent Dahl Date: 2001-12-08T23:37:04+09:00 Subject: [ruby-talk:27932] Re: Statically linked extensions and deferred initialization. Kent Dahl wrote: > Not a finished solution yet, but I have something that does seem to > work. It hasn't been tested much, .... and today it crashes like mad ... > + int rb_static_ext_require( VALUE string ) > + { > + VALUE ext; > + rb_static_ext_entry *p; > + > + ext = rb_hash_aref( rb_static_ext_hash, string ); This call dies way down in the do_hash method, with the wierd value of \a in the string, whenever I require recursively. (I noticed that \a == 7 == T_STRING but I'm not sure what to make of it.) That is, if I require 'socket.so' require 'rubyfltk.so' all is nice. But, if I require 'fltk.rb', which in turn require 'rubyfltk.so', it blows up on me. My code is called in rb_f_require: > else if (strcmp(".so", ext) == 0 || strcmp(".o", ext) == 0) { > + resultcode = rb_static_ext_require( fname ); > + if( resultcode >= 0 ){ > + return ( resultcode ? Qtrue : Qfalse ); > + } > + > fname = rb_str_new(RSTRING(fname)->ptr, ext-RSTRING(fname)->ptr); > #ifdef DLEXT2 > tmp = fname; Any hints are very welcome. -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/