下面的代码片段取自 Apple 的 ObjC 运行时 (libobjc) 源代码。我想知道这到底是什么意思。(不是很谷歌,抱歉)
// HACK -- the use of these functions must be after the @implementation
id bypass_msgSend_retain(NSObject *obj) asm("-[NSObject retain]");
void bypass_msgSend_release(NSObject *obj) asm("-[NSObject release]");
id bypass_msgSend_autorelease(NSObject *obj) asm("-[NSObject autorelease]");
更新:
这是对 bypass_msgSend_release() 的调用生成的内容:
movl -4(%ebp), %eax
movl %eax, (%esp)
calll "-[NSObject release]"