Differences From Artifact [ef2b5b53fe]:
- File src/OFObject.m — part of check-in [c34d45798b] at 2012-08-04 08:29:06 on branch trunk — Replace a few init methods with constructors. (user: js, size: 21507) [annotate] [blame] [check-ins using]
To Artifact [b19596ca32]:
- File
src/OFObject.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 21277) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
27 28 29 30 31 32 33 | #include <assert.h> #ifdef __QNX__ # include <sys/syspage.h> #endif #import "OFObject.h" | < > | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #include <assert.h> #ifdef __QNX__ # include <sys/syspage.h> #endif #import "OFObject.h" #import "OFAllocFailedException.h" #import "OFEnumerationMutationException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFMemoryNotPartOfObjectException.h" #import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" #if defined(OF_APPLE_RUNTIME) && __OBJC2__ # import <objc/objc-exception.h> #elif defined(OF_OBJFW_RUNTIME) # import "runtime.h" #endif |
︙ | ︙ | |||
82 83 84 85 86 87 88 | #define PRE_MEM_ALIGN ((sizeof(struct pre_mem) + \ (__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1)) #define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN)) static struct { Class isa; } alloc_failed_exception; | < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | #define PRE_MEM_ALIGN ((sizeof(struct pre_mem) + \ (__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1)) #define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN)) static struct { Class isa; } alloc_failed_exception; static SEL cxx_construct = NULL; static SEL cxx_destruct = NULL; size_t of_pagesize; size_t of_num_cpus; |
︙ | ︙ | |||
809 810 811 812 813 814 815 | if (--PRE_IVAR->retainCount == 0) [self dealloc]; #endif } - autorelease { | < < < < < < | < | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 | if (--PRE_IVAR->retainCount == 0) [self dealloc]; #endif } - autorelease { return _objc_rootAutorelease(self); } - self { return self; } |
︙ | ︙ |