Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -41,10 +41,18 @@ { /// The class of the object Class isa; } +/** + * This code is executed once when the class is loaded into the runtime. + * + * Derived classes can overide this to execute their own code when the class is + * loaded. + */ ++ (void)load; + /** * This code is executed once when a method of the class is called for the first * time. * * Derived classes can override this to execute their own code on Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -46,19 +46,23 @@ #ifdef NEED_OBJC_SYNC_INIT extern BOOL objc_sync_init(); #endif @implementation OFObject -+ (void)initialize ++ (void)load { #ifdef NEED_OBJC_SYNC_INIT if (!objc_sync_init()) { fputs("Runtime error: objc_sync_init() failed!\n", stderr); abort(); } #endif } + ++ (void)initialize +{ +} + alloc { OFObject *instance; #ifdef __objc_INCLUDE_GNU