27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
if (class == Nil) {
if (outCount != NULL)
*outCount = 0;
return NULL;
}
objc_global_mutex_lock();
count = (class->ivars != NULL ? class->ivars->count : 0);
if (count == 0) {
if (outCount != NULL)
*outCount = 0;
objc_global_mutex_unlock();
return NULL;
}
if ((ivars = malloc((count + 1) * sizeof(Ivar))) == NULL)
OBJC_ERROR("Not enough memory to copy ivars");
for (unsigned int i = 0; i < count; i++)
ivars[i] = &class->ivars->ivars[i];
ivars[count] = NULL;
if (outCount != NULL)
*outCount = count;
objc_global_mutex_unlock();
return ivars;
}
const char *
ivar_getName(Ivar ivar)
{
|
|
|
|
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
if (class == Nil) {
if (outCount != NULL)
*outCount = 0;
return NULL;
}
objc_globalMutex_lock();
count = (class->ivars != NULL ? class->ivars->count : 0);
if (count == 0) {
if (outCount != NULL)
*outCount = 0;
objc_globalMutex_unlock();
return NULL;
}
if ((ivars = malloc((count + 1) * sizeof(Ivar))) == NULL)
OBJC_ERROR("Not enough memory to copy ivars");
for (unsigned int i = 0; i < count; i++)
ivars[i] = &class->ivars->ivars[i];
ivars[count] = NULL;
if (outCount != NULL)
*outCount = count;
objc_globalMutex_unlock();
return ivars;
}
const char *
ivar_getName(Ivar ivar)
{
|