722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
|
static void
addMethod(Class class, SEL selector, IMP implementation,
const char *typeEncoding)
{
struct objc_method_list *methodList;
/* FIXME: We need a way to free this at objc_exit() */
if ((methodList = malloc(sizeof(struct objc_method_list))) == NULL)
OBJC_ERROR("Not enough memory to replace method!");
methodList->next = class->methodList;
methodList->count = 1;
methodList->methods[0].selector.UID = selector->UID;
methodList->methods[0].selector.typeEncoding = typeEncoding;
methodList->methods[0].implementation = implementation;
|
|
|
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
|
static void
addMethod(Class class, SEL selector, IMP implementation,
const char *typeEncoding)
{
struct objc_method_list *methodList;
/* FIXME: We need a way to free this at objc_exit() */
if ((methodList = malloc(sizeof(*methodList))) == NULL)
OBJC_ERROR("Not enough memory to replace method!");
methodList->next = class->methodList;
methodList->count = 1;
methodList->methods[0].selector.UID = selector->UID;
methodList->methods[0].selector.typeEncoding = typeEncoding;
methodList->methods[0].implementation = implementation;
|