Improve protocol reference loading.

Now all @protocol references will refer to precisely the same instance,
even across shared libraries.
main
David Chisnall 8 years ago
parent bc726e7564
commit 6c2a61de9b

@ -228,6 +228,17 @@ PUBLIC void __objc_load(struct objc_init *init)
}
registerProtocol((struct objc_protocol*)proto);
}
for (struct objc_protocol **proto = init->proto_ref_begin ; proto < init->proto_ref_end ;
proto++)
{
if (*proto == NULL)
{
continue;
}
struct objc_protocol *p = objc_getProtocol((*proto)->name);
assert(p);
*proto = p;
}
for (Class *cls = init->cls_begin ; cls < init->cls_end ; cls++)
{
if (*cls == NULL)

Loading…
Cancel
Save