Lines Matching defs:copy

310     (*desc->copy)(result, aBlock); // do fixup
329 // Copy, or bump refcount, of a block. If really copying, call the copy helper if present.
355 // Its a stack block. Make a copy.
369 // This allows the copy helper routines to make non-refcounted block copies under GC
376 // if we copy a malloc block to a GC block then we need to clear NEEDS_FREE.
403 // Otherwise we need to copy it and update the stack forwarding pointer
415 struct Block_byref *copy = (struct Block_byref *)_Block_allocator(src->size, false, isWeak);
416 copy->flags = src->flags | _Byref_flag_initial_value; // non-GC one for caller, one for stack
417 copy->forwarding = copy; // patch heap copy to point to itself (skip write-barrier)
418 src->forwarding = copy; // patch stack to point to heap copy
419 copy->size = src->size;
421 copy->isa = &_NSConcreteWeakBlockVariable; // mark isa field so it gets weak scanning
424 // Trust copy helper to copy everything of interest
427 struct Block_byref_2 *copy2 = (struct Block_byref_2 *)(copy+1);
437 (*src2->byref_keep)(copy, src);
441 // This copy includes Block_byref_3, if any.
442 _Block_memmove(copy+1, src+1,
623 In these cases helper functions are synthesized by the compiler for use in Block_copy and Block_release, called the copy and dispose helpers. The copy helper emits a call to the C++ const copy constructor for C++ stack based objects and for the rest calls into the runtime support function _Block_object_assign. The dispose helper has a call to the C++ destructor for case 1 and a call into _Block_object_dispose for the rest.
631 So the Block copy/dispose helpers should only ever generate the four flag values of 3, 7, 8, and 24.
633 When a __block variable is either a C++ object, an Objective-C object, or another Block then the compiler also generates copy/dispose helper functions. Similarly to the Block copy helper, the "__block" copy helper (formerly and still a.k.a. "byref" copy helper) will do a C++ copy constructor (not a const one though!) and the dispose helper will do the destructor. And similarly the helpers will call into the same two support functions with the same values for objects and Blocks with the additional BLOCK_BYREF_CALLER (128) bit of information supplied.
635 So the __block copy/dispose helpers will generate flag values of 3 or 7 for objects and Blocks respectively, with BLOCK_FIELD_IS_WEAK (16) or'ed as appropriate and always 128 or'd in, for the following set of possibilities:
645 // When Blocks or Block_byrefs hold objects then their copy routine helpers use this entry point
653 [^{ object; } copy];
663 [^{ object; } copy];
672 // copy the onstack __block container to the heap
675 [^{ x; } copy];
684 // copy the actual field held in the __block container
687 [^{ object; } copy];
697 // copy the actual field held in the __block container
700 [^{ object; } copy];