mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add comment wrt getivar and allocators
This commit is contained in:
parent
be91995a5e
commit
e2e70f69f3
1 changed files with 3 additions and 0 deletions
|
@ -636,6 +636,9 @@ gen_getinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx)
|
|||
}
|
||||
|
||||
// If the class uses the default allocator, instances should all be T_OBJECT
|
||||
// NOTE: This assumes nobody changes the allocator of the class after allocation.
|
||||
// Eventually, we can encode whether an object is T_OBJECT or not
|
||||
// inside object shapes.
|
||||
if (rb_get_alloc_func(ic->entry->class_value) != rb_class_allocate_instance)
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue