3 ms·
The weakIvarLayout field seems to do exactly what you're saying for ivars, though there is no equivalent for blocks. (Whether you can [safely] do it anyway dep
by comex 14y ago
The weakIvarLayout field seems to do exactly what you're saying for ivars, though there is no equivalent for blocks. (Whether you can [safely] do it anyway depends, I suppose, on whether you're willing to inspect machine code; it's not that hard, though the suggestion does nothing to disprove your claim of hackish minimalism.)
- flatline3 14y agoUnfortunately, as I recall, the meaning of weakIvarLayout is different depending on whether the code is compiled for ARC, non-ARC, or non-ARC GC/GC-optional. Unfortunately I don't remember the specifics off-hand. Also, yes, runtime machine code inspection is a ... possibility ... :) It's not that 'hard', but it's certainly harder than clean metadata, and it means maintaining individual introspection code for all supported architectures.