diff options
| author | Tomasz Dąbrowski <[email protected]> | 2016-11-16 17:43:55 +0100 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-17 17:19:49 +0900 |
| commit | 4cca8bac6bbdab02eba11e6527f793f2e9a5e75d (patch) | |
| tree | 6b08ca177e1ebeaa0be3d87a993b27fbe58f795e /src/object.c | |
| parent | 784e07f902790dd13d33460d7365a2f0aee85727 (diff) | |
| download | mruby-4cca8bac6bbdab02eba11e6527f793f2e9a5e75d.tar.gz mruby-4cca8bac6bbdab02eba11e6527f793f2e9a5e75d.zip | |
inline structures data type for mruby (MRB_TT_INLINE) (fix #3237)
Inline structures have no instance variables, no finalizer, and offer as much space as possible in RBASIC object. This means 24 bytes on 64-bit platforms and 12 bytes on 32-bit platforms.
mruby-inline-struct gem is only provided for testing.
Diffstat (limited to 'src/object.c')
| -rw-r--r-- | src/object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c index bb1a4ebc4..af66d93d0 100644 --- a/src/object.c +++ b/src/object.c @@ -348,7 +348,7 @@ mrb_check_convert_type(mrb_state *mrb, mrb_value val, enum mrb_vtype type, const { mrb_value v; - if (mrb_type(val) == type && type != MRB_TT_DATA) return val; + if (mrb_type(val) == type && type != MRB_TT_DATA && type != MRB_TT_INLINE) return val; v = convert_type(mrb, val, tname, method, FALSE); if (mrb_nil_p(v) || mrb_type(v) != type) return mrb_nil_value(); return v; @@ -390,7 +390,7 @@ mrb_check_type(mrb_state *mrb, mrb_value x, enum mrb_vtype t) enum mrb_vtype xt; xt = mrb_type(x); - if ((xt != t) || (xt == MRB_TT_DATA)) { + if ((xt != t) || (xt == MRB_TT_DATA) || (xt == MRB_TT_INLINE)) { while (type->type < MRB_TT_MAXDEFINE) { if (type->type == t) { const char *etype; |
