Differences From Artifact [d2cf97ab35]:
- File
src/objc_properties.m
— part of check-in
[d989794cc2]
at
2012-03-21 17:33:21
on branch trunk
— objc_setProperty(): Use a signed char for copy.
No more abusing a poor BOOL... (user: js, size: 2434) [annotate] [blame] [check-ins using] [more...]
To Artifact [343585f1c5]:
- File src/objc_properties.m — part of check-in [08f1d13520] at 2012-03-23 12:42:05 on branch runtime — Add objc_{get,set}PropertyStruct() for GCC >= 4.6. (user: js, size: 3268) [annotate] [blame] [check-ins using]
- File src/runtime/property.m — part of check-in [adbce6d8f4] at 2012-03-23 12:59:32 on branch runtime — Move objc_{properties,sync} to runtime. (user: js, size: 3268) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <assert.h> #import "OFObject.h" #ifdef OF_THREADS # import "threading.h" # define NUM_SPINLOCKS 8 /* needs to be a power of 2 */ | > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <string.h> #include <assert.h> #import "OFObject.h" #ifdef OF_THREADS # import "threading.h" # define NUM_SPINLOCKS 8 /* needs to be a power of 2 */ |
︙ | ︙ | |||
116 117 118 119 120 121 122 | break; default: *ptr = [value copy]; } [old release]; } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | break; default: *ptr = [value copy]; } [old release]; } /* The following methods are only required for GCC >= 4.6 */ void objc_getPropertyStruct(void *dest, const void *src, ptrdiff_t size, BOOL atomic, BOOL strong) { if (atomic) { #ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(src); assert(of_spinlock_lock(&spinlocks[hash])); #endif memcpy(dest, src, size); #ifdef OF_THREADS assert(of_spinlock_unlock(&spinlocks[hash])); #endif return; } memcpy(dest, src, size); } void objc_setPropertyStruct(void *dest, const void *src, ptrdiff_t size, BOOL atomic, BOOL strong) { if (atomic) { #ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(src); assert(of_spinlock_lock(&spinlocks[hash])); #endif memcpy(dest, src, size); #ifdef OF_THREADS assert(of_spinlock_unlock(&spinlocks[hash])); #endif return; } memcpy(dest, src, size); } |