Author: theraven
Date: Sun Dec 20 17:59:41 2009
New Revision: 29144

URL: http://svn.gna.org/viewcvs/gnustep?rev=29144&view=rev
Log:
Added call to objc_create_block_classes_as_subclasses_of() in NSObject's +load 
method.  This is called as soon as NSObject is loaded and creates the _NSBlock 
family of classes, which are statically allocated in the runtime but not 
statically initialised.  If you create blocks without linking GNUstep-base, the 
isa pointer in the block will point to a class that has all of its fields set 
to 0.  

Any blocks will have their isa pointer set to the two classes statically 
allocated in libobjc, but these classes can't be used for message lookup (or 
introspection) until after the call.  This means that you can't send messages 
to blocks until after NSObject's +load method has been called.  This shouldn't 
be a problem in most code, but if you use __attribute__((constructor)) instead 
of a +load method then be careful about sending messages to blocks (you can 
still call them as normal). 


Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/NSObject.m


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to