From: matz@... (Yukihiro Matsumoto) Date: 2004-03-19T14:08:54+09:00 Subject: Re: Class.allocate callback Hi, In message "Class.allocate callback" on 04/03/19, Anders Engström writes: |I want to get a callback whenever an object is created in the vm. To do |this I have overridden 'Class.new', and it works as long as objects are |created through Object.new. But - I also want to get callbacks when |objects are created during unmarshalling of serialized data.. I thought |that I could override Class.allocate to get a callback when this happens |- but I never get the callback. | |Is this a bug? Not really a bug. Hooking every instance allocation might too slow for the current implementation. Sometimes I have to choose performance over flexibility. Marshal.load takes optional second argument, which is a proc called for each unmarshalled object. matz.