mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Convert rb_class_cc_entries.entries
in a flexible array member
`rb_class_cc_entries` is little more than a `len` and `capa`. Hence embedding the entries doesn't cost much extra copying and saves a bit of memory and some pointer chasing. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
This commit is contained in:
parent
c6dd3cefa1
commit
bc789ca804
3 changed files with 31 additions and 36 deletions
|
@ -585,9 +585,15 @@ struct rb_class_cc_entries {
|
|||
unsigned int argc;
|
||||
unsigned int flag;
|
||||
const struct rb_callcache *cc;
|
||||
} *entries;
|
||||
} entries[FLEX_ARY_LEN];
|
||||
};
|
||||
|
||||
static inline size_t
|
||||
vm_ccs_alloc_size(size_t capa)
|
||||
{
|
||||
return offsetof(struct rb_class_cc_entries, entries) + (sizeof(struct rb_class_cc_entries_entry) * capa);
|
||||
}
|
||||
|
||||
#if VM_CHECK_MODE > 0
|
||||
|
||||
const rb_callable_method_entry_t *rb_vm_lookup_overloaded_cme(const rb_callable_method_entry_t *cme);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue