Lines Matching refs:aBlock
180 static void _Block_do_nothing(const void *aBlock) { }
286 struct Block_layout *aBlock;
294 aBlock = (struct Block_layout *)arg;
295 if (aBlock->flags & BLOCK_NEEDS_FREE) {
297 latching_incr_int(&aBlock->flags);
298 return aBlock;
300 else if (aBlock->flags & BLOCK_IS_GC) {
302 if (wantsOne && ((latching_incr_int(&aBlock->flags) & BLOCK_REFCOUNT_MASK) == 1)) {
304 _Block_setHasRefcount(aBlock, true);
306 return aBlock;
308 else if (aBlock->flags & BLOCK_IS_GLOBAL) {
309 return aBlock;
314 struct Block_layout *result = malloc(aBlock->descriptor->size);
316 memmove(result, aBlock, aBlock->descriptor->size); // bitcopy first
322 //printf("calling block copy helper %p(%p, %p)...\n", aBlock->descriptor->copy, result, aBlock);
323 (*aBlock->descriptor->copy)(result, aBlock); // do fixup
330 unsigned long int flags = aBlock->flags;
332 struct Block_layout *result = _Block_allocator(aBlock->descriptor->size, wantsOne, hasCTOR);
334 memmove(result, aBlock, aBlock->descriptor->size); // bitcopy first
345 (*aBlock->descriptor->copy)(result, aBlock); // do fixup
460 struct Block_layout *aBlock = (struct Block_layout *)arg;
462 if (!aBlock) return;
463 newCount = latching_decr_int(&aBlock->flags) & BLOCK_REFCOUNT_MASK;
466 if (aBlock->flags & BLOCK_IS_GC) {
470 _Block_setHasRefcount(aBlock, false);
472 else if (aBlock->flags & BLOCK_NEEDS_FREE) {
473 if (aBlock->flags & BLOCK_HAS_COPY_DISPOSE)(*aBlock->descriptor->dispose)(aBlock);
474 _Block_deallocator(aBlock);
476 else if (aBlock->flags & BLOCK_IS_GLOBAL) {
480 printf("Block_release called upon a stack Block: %p, ignored\n", (void *)aBlock);
488 struct Block_layout *aBlock;
490 aBlock = (struct Block_layout *)arg;
491 if (aBlock->flags & BLOCK_IS_GC) {
492 // assert(aBlock->Block_flags & BLOCK_HAS_CTOR);
495 _Block_release(aBlock);
507 void *_Block_copy_collectable(const void *aBlock) {
508 return _Block_copy_internal(aBlock, 0);