* Yukihiro Matsumoto <matz / ruby-lang.org>:
> Hi,
>
> In message "Class.allocate callback"
>     on 04/03/19, Anders Engstr=F6m <aengstrom / gnejs.net> 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 happen=
s
>|- 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.

Thanks for the reply. I can understand this decision - it makes sense.
It would be nice if this behaviour was documented though :)

Coming from the Java world I would say that Ruby is flexible enough,
even without callback-on-allocate. And - coming from the Java world it's
absolutely wonderful to ask a question in a ng and get a reply from the
actual author of the language in < 24 hours :)

(I wonder if James Gosling frequents comp.lang.java... ;)

//Anders

--=20
/**=20
 * Anders Engstr=F6m, aengstrom / gnejs.net
 * -------------------------------------
 * Your mind is like an umbrella.=20
 * It doesn't work unless you open it.
 *    /Frank Zappa
 */