Differences From Artifact [79dd5a258d]:
- File src/runtime/property.m — part of check-in [d07c56a8bb] at 2017-04-02 01:06:35 on branch trunk — Add OF_CONSTRUCTOR() / OF_DESTRUCTOR() (user: js, size: 3265) [annotate] [blame] [check-ins using]
To Artifact [f610db3f7e]:
- File
src/runtime/property.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 3277) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
39 40 41 42 43 44 45 | } #endif id objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) { if (atomic) { | | | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | } #endif id objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) { if (atomic) { id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); @try { return [[*ptr retain] autorelease]; } @finally { OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); } #else return [[*ptr retain] autorelease]; #endif } return *(id *)(void *)((char *)self + offset); } void objc_setProperty(id self, SEL _cmd, ptrdiff_t offset, id value, BOOL atomic, signed char copy) { if (atomic) { id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); @try { #endif id old = *ptr; |
︙ | ︙ | |||
92 93 94 95 96 97 98 | OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); } #endif return; } | | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); } #endif return; } id *ptr = (id *)(void *)((char *)self + offset); id old = *ptr; switch (copy) { case 0: *ptr = [value retain]; break; case 2: |
︙ | ︙ |