-
Notifications
You must be signed in to change notification settings - Fork 8
Dealing with isa
Nat! edited this page Feb 25, 2017
·
1 revision
Historically isa
was part of the object structure and it was an easy way to get at the class of an object. This doesn't work in mulle-objc, because isa
is outside the structure for regular objects or doesn't even exist for tagged pointers.
For backwards compatibility isa
can be defined as a shortcut for calling _mulle_objc_object_get_isa( self)
.
This doesn't enable changing isa
on the fly of course. To enable isa
compile with -DMULLE_OBJC_ISA_HACK
.
#ifdef MULLE_OBJC_ISA_HACK
# define isa ((Class) _mulle_objc_object_get_isa( self))
#endif
This will lead to problem when isa
is used a normal identifier as in:
struct my_struct
{
int isa;
}
or
void *isa( void *p)
This belongs to MulleObjC really.