Hi, the new object structure in 1.9 embeds some ivars into objects for faster access:
#define ROBJECT_EMBED_LEN_MAX 3
struct RObject {
struct RBasic basic;
union {
struct {
long numiv;
VALUE *ivptr;
struct st_table *iv_index_tbl;
} heap;
VALUE ary[ROBJECT_EMBED_LEN_MAX];
} as;
};
My question is are the first 3 ivars always embedded? or are they only embedded if the number of ivars is <=3 ?
I've tried reading the source but find it next to incomprehensible.
Thanks