Differences From Artifact [dfafb38c1f]:
- File
src/OFObject.m
— part of check-in
[627511b032]
at
2020-11-14 12:23:55
on branch trunk
— Rename of_malloc and of_calloc
The new names should be more accurate. (user: js, size: 27697) [annotate] [blame] [check-ins using] [more...]
To Artifact [d5d0a02ee8]:
- File
src/OFObject.m
— part of check-in
[5b37fbeb82]
at
2020-12-20 21:26:08
on branch trunk
— Return error instead of using errno for threading
errno is problematic for Amiga libraries and is also not thread-safe on
some systems, even though it should. (user: js, size: 27721) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
307 308 309 310 311 312 313 | allocFailedException.isa = [OFAllocFailedException class]; @throw (id)&allocFailedException; } ((struct pre_ivar *)instance)->retainCount = 1; #if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS) | | | | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | allocFailedException.isa = [OFAllocFailedException class]; @throw (id)&allocFailedException; } ((struct pre_ivar *)instance)->retainCount = 1; #if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS) if OF_UNLIKELY (of_spinlock_new( &((struct pre_ivar *)instance)->retainCountSpinlock) != 0) { free(instance); @throw [OFInitializationFailedException exceptionWithClass: class]; } #endif instance = (OFObject *)(void *)((char *)instance + PRE_IVARS_ALIGN); |
︙ | ︙ | |||
1117 1118 1119 1120 1121 1122 1123 | Forbid(); # endif PRE_IVARS->retainCount++; # ifndef OF_AMIGAOS_M68K Permit(); # endif #else | | | | 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | Forbid(); # endif PRE_IVARS->retainCount++; # ifndef OF_AMIGAOS_M68K Permit(); # endif #else OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock) == 0); PRE_IVARS->retainCount++; OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock) == 0); #endif return self; } - (unsigned int)retainCount { |
︙ | ︙ | |||
1153 1154 1155 1156 1157 1158 1159 | Permit(); if (retainCount == 0) [self dealloc]; #else int retainCount; | | | | 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | Permit(); if (retainCount == 0) [self dealloc]; #else int retainCount; OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock) == 0); retainCount = --PRE_IVARS->retainCount; OF_ENSURE(of_spinlock_unlock(&PRE_IVARS->retainCountSpinlock) == 0); if (retainCount == 0) [self dealloc]; #endif } - (instancetype)autorelease |
︙ | ︙ |