From: "Luca (Email)" Date: 2011-12-29T15:44:34+09:00 Subject: I: embedded ruby event hooks -----Messaggio originale----- Da: Ryan Davis [mailto:ryand-ruby@zenspider.com] Inviato: venerd́ 2 dicembre 2011 04:29 A: ruby-talk ML Oggetto: Re: embedded ruby event hooks On Dec 1, 2011, at 18:55 , Steve Hart wrote: > We have been running ruby for about 7 years as an embedded interpreter > and we are trying to upgrade from 1.8.7 to 1.9.3. One of the things we > do is to add an event hook using rb_add_event_hook for event type > RUBY_EVENT_CALL This allows us to 'know' what ruby method is being > called. > In our function for the hook proc we use the passed in ID value to > tell us the name of the ruby method that is about to run. This works > well in 1.8.7. > > In 1.9.3 the id passed in is always 0. Looking thru the code I can see > that this is marked in insns.def as 'TODO' (insns.def line 875 - > EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); I'm > not sure yet what insns.def is or how it works - but without the > method id our code dies. Chase the code down to the handler and you'll see that they look up the class and id whenever it is 0. -- Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f Sponsor: Capodanno al parco Oltremare Riccione: Pacchetto hotel 3 stelle in centro + ingresso al parco. * Mezza pensione, Internet gratis, animazione per bimbi. Scopri l'offerta! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid981&d)-12