|
|
|
@ -94,8 +94,9 @@ BOOL class_addIvar(Class cls, const char *name, size_t size, uint8_t alignment,
|
|
|
|
|
|
|
|
|
|
|
|
if (offset << alignment != cls->instance_size)
|
|
|
|
if (offset << alignment != cls->instance_size)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
offset = (offset+ 1) << alignment;
|
|
|
|
offset++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
offset <<= alignment;
|
|
|
|
|
|
|
|
|
|
|
|
ivar->offset = offset;
|
|
|
|
ivar->offset = offset;
|
|
|
|
// Increase the instance size to make space for this.
|
|
|
|
// Increase the instance size to make space for this.
|
|
|
|
@ -296,12 +297,9 @@ class_getInstanceVariable(Class cls, const char *name)
|
|
|
|
|
|
|
|
|
|
|
|
if (ivarlist != NULL)
|
|
|
|
if (ivarlist != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (int i = 0; i < ivarlist->count; i++)
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ivarlist->count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Ivar ivar = &ivarlist->ivar_list[i];
|
|
|
|
Ivar ivar = &ivarlist->ivar_list[i];
|
|
|
|
|
|
|
|
|
|
|
|
if (strcmp(ivar->name, name) == 0)
|
|
|
|
if (strcmp(ivar->name, name) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ivar;
|
|
|
|
return ivar;
|
|
|
|
|