for(i=0; i<size; i++)
attributes[i] = null_instance;
+ Instance_incr_ref(null_instance);
return attributes;
`}
var id = mproperty.intro_mclassdef.mclass.vtable.id
- # TODO : ugly hack
- recv.attributes[mproperty] = value
-
# Replace the old value of mproperty in recv
write_attribute_ph(recv.internal_attributes, recv.vtable.internal_vtable,
recv.vtable.mask, id, mproperty.offset, value)
int absolute_offset = *(pointer + 1);
((Instance *)instance)[absolute_offset + offset] = value;
+ Instance_incr_ref(value);
`}
end
total_size += 2;
}
- // Add the size of the perfect hashtable
- total_size += mask+1;
+ // Add the size of the perfect hashtable (mask +1)
+ // Add one because we start to fill the vtable at position 1 (0 is the init position)
+ total_size += mask+2;
long unsigned int* vtable = malloc(sizeof(long unsigned int)*total_size);
// Initialisation to the first position of the virtual table (ie : Object)
return vtable;
`}
-end
\ No newline at end of file
+end