- struct BlockDescriptor1 {
- unsigned long int reserved;
- unsigned long int size;
- };
-
- struct BlockDescriptor2 {
- void (*copy_helper)(void *dst, void *src);
- void (*dispose_helper)(void *src);
- };
-
- struct BlockDescriptor3 {
- const char *signature;
- const char *layout;
- };
-
- struct BlockLiteral {
- Class isa;
- int flags;
- int reserved;
- void (*invoke)(void *, ...);
- void *descriptor;
- } *literal = reinterpret_cast<BlockLiteral *>(self);
-
- enum {
- BLOCK_DEALLOCATING = 0x0001,
- BLOCK_REFCOUNT_MASK = 0xfffe,
- BLOCK_NEEDS_FREE = 1 << 24,
- BLOCK_HAS_COPY_DISPOSE = 1 << 25,
- BLOCK_HAS_CTOR = 1 << 26,
- BLOCK_IS_GC = 1 << 27,
- BLOCK_IS_GLOBAL = 1 << 28,
- BLOCK_HAS_STRET = 1 << 29,
- BLOCK_HAS_SIGNATURE = 1 << 30,
- };