Overview
| Comment: | Clean up blocks a little |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | new-naming-convention |
| Files: | files | file ages | folders |
| SHA3-256: |
03ea273cb3391b4b2a10b5549f5e6e82 |
| User & Date: | js on 2021-04-17 15:20:09 |
| Other Links: | branch diff | manifest | tags |
Context
|
2021-04-17
| ||
| 15:45 | of_tlskey_t -> OFTLSKey (check-in: cc3a4a7b43 user: js tags: new-naming-convention) | |
| 15:20 | Clean up blocks a little (check-in: 03ea273cb3 user: js tags: new-naming-convention) | |
| 15:04 | of_sandbox_unveil_path_t -> OFSandboxUnveilPath (check-in: a85797b5e9 user: js tags: new-naming-convention) | |
Changes
Modified src/Makefile from [45115139e9] to [7982a7e4c7].
| ︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - | OFKernelEventObserver.h \ OFKeyValueCoding.h \ OFLocking.h \ OFMessagePackRepresentation.h \ OFSerialization.h \ OFTLSSocket.h \ ObjFW.h \ |
| ︙ |
Modified src/OFBlock.h from [f6b4954bd3] to [b2fc8f8283].
| ︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - | * 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. */ #import "OFObject.h" |
| ︙ | |||
36 37 38 39 40 41 42 43 44 | 34 35 36 37 38 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
OF_SUBCLASSING_RESTRICTED
@interface OFGlobalBlock: OFBlock
@end
OF_SUBCLASSING_RESTRICTED
@interface OFMallocBlock: OFBlock
@end
#ifdef __cplusplus
extern "C" {
#endif
extern void *_Block_copy(const void *);
extern void _Block_release(const void *);
# if defined(OF_WINDOWS) && \
(defined(OF_NO_SHARED) || defined(OF_COMPILING_OBJFW))
/*
* Clang has implicit declarations for these, but they are dllimport. When
* compiling ObjFW itself or using it as a static library, these need to be
* dllexport. Interestingly, this still works when using it as a shared library.
*/
extern __declspec(dllexport) struct objc_class _NSConcreteStackBlock;
extern __declspec(dllexport) struct objc_class _NSConcreteGlobalBlock;
extern __declspec(dllexport) void _Block_object_assign(void *, const void *,
const int);
extern __declspec(dllexport) void _Block_object_dispose(const void *,
const int);
# endif
#ifdef __cplusplus
}
#endif
#ifndef Block_copy
# define Block_copy(...) \
((__typeof__(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
#endif
#ifndef Block_release
# define Block_release(...) _Block_release((const void *)(__VA_ARGS__))
#endif
OF_ASSUME_NONNULL_END
|
Modified src/OFBlock.m from [678cbad32a] to [2e686f4654].
| ︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - - + + + + + + + + + + + + + + + - + | #ifdef OF_HAVE_ATOMIC_OPS # import "atomic.h" #endif #ifdef OF_HAVE_THREADS # import "mutex.h" #endif |
| ︙ | |||
72 73 74 75 76 77 78 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + - + - + |
static struct objc_class _NSConcreteStackBlock_metaclass = {
Nil, Nil, "OFStackBlock", 8, OBJC_CLASS_INFO_METACLASS,
sizeof(_NSConcreteStackBlock_metaclass), NULL, NULL
};
struct objc_class _NSConcreteStackBlock = {
&_NSConcreteStackBlock_metaclass, (Class)(void *)"OFBlock",
|
| ︙ | |||
159 160 161 162 163 164 165 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - + - + |
static of_spinlock_t blockSpinlocks[NUM_SPINLOCKS];
static of_spinlock_t byrefSpinlocks[NUM_SPINLOCKS];
#endif
void *
_Block_copy(const void *block_)
{
|
| ︙ | |||
199 200 201 202 203 204 205 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + |
return block;
}
void
_Block_release(const void *block_)
{
|
| ︙ | |||
240 241 242 243 244 245 246 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - + - - + + |
OF_BLOCK_FIELD_IS_OBJECT | OF_BLOCK_FIELD_IS_BYREF);
if (src_ == NULL)
return;
switch (flags) {
case OF_BLOCK_FIELD_IS_BLOCK:
|
| ︙ | |||
325 326 327 328 329 330 331 | 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | - + | _Block_release(object_); break; case OF_BLOCK_FIELD_IS_OBJECT: if (!(flags_ & OF_BLOCK_BYREF_CALLER)) [(id)object_ release]; break; case OF_BLOCK_FIELD_IS_BYREF:; |
| ︙ | |||
459 460 461 462 463 464 465 | 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | - + |
return self;
}
- (unsigned int)retainCount
{
if ([self isMemberOfClass: (Class)&_NSConcreteMallocBlock])
|
| ︙ |
Modified src/OFObject.h from [36c6bafde9] to [0d9484cf9e].
| ︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - | #endif #include <stddef.h> #include <stdint.h> #include <stdbool.h> #include <limits.h> |
| ︙ | |||
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 | 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | + + | extern uint32_t of_random32(void); extern uint64_t of_random64(void); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END #include "OFBlock.h" #ifdef __OBJC__ # import "OFObject+KeyValueCoding.h" # import "OFObject+Serialization.h" #endif #endif |
Deleted src/block.h version [1fa9cdbfc6].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|