Differences From Artifact [1881ae5509]:
- File src/OFObject.m — part of check-in [bce7bbddf4] at 2010-05-05 17:21:55 on branch trunk — Rename method replacement methods - the old names were too long. (user: js, size: 15698) [annotate] [blame] [check-ins using] [more...]
To Artifact [85afaae721]:
- File
src/OFObject.m
— part of check-in
[3c5eb0ddb6]
at
2010-07-08 09:44:44
on branch trunk
— Cache OFAutoreleasePool class.
This improves performance with the GNU runtime, where looking up a class
is quite expensive. (user: js, size: 15778) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /* Hopefully no arch needs more than 16 bytes padding */ #define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15) #define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN)) static struct { Class isa; } alloc_failed_exception; size_t of_pagesize; #ifdef NEED_OBJC_SYNC_INIT extern BOOL objc_sync_init(); #endif | > | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | /* Hopefully no arch needs more than 16 bytes padding */ #define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + 15) & ~15) #define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN)) static struct { Class isa; } alloc_failed_exception; static Class autoreleasepool = Nil; size_t of_pagesize; #ifdef NEED_OBJC_SYNC_INIT extern BOOL objc_sync_init(); #endif |
︙ | ︙ | |||
123 124 125 126 127 128 129 130 131 132 133 134 135 136 | GetSystemInfo(&si); of_pagesize = si.dwPageSize; #endif } + (void)initialize { } + alloc { OFObject *instance; size_t isize = class_getInstanceSize(self); | > | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | GetSystemInfo(&si); of_pagesize = si.dwPageSize; #endif } + (void)initialize { autoreleasepool = [OFAutoreleasePool class]; } + alloc { OFObject *instance; size_t isize = class_getInstanceSize(self); |
︙ | ︙ | |||
607 608 609 610 611 612 613 | if (!c) [self dealloc]; #endif } - autorelease { | | | 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | if (!c) [self dealloc]; #endif } - autorelease { [autoreleasepool addObjectToTopmostPool: self]; return self; } - (void)dealloc { void **iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size; |
︙ | ︙ |