diff options
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal.h b/internal.h index b680c8c79b..3baee61ee3 100644 --- a/internal.h +++ b/internal.h @@ -698,14 +698,18 @@ extern void ruby_init_setproctitle(int argc, char *argv[]); #define RSTRUCT_EMBED_LEN_MAX RSTRUCT_EMBED_LEN_MAX #define RSTRUCT_EMBED_LEN_MASK RSTRUCT_EMBED_LEN_MASK #define RSTRUCT_EMBED_LEN_SHIFT RSTRUCT_EMBED_LEN_SHIFT + enum { RSTRUCT_EMBED_LEN_MAX = 3, RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1), RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1), + RSTRUCT_TRANSIENT_FLAG = FL_USER3, RSTRUCT_ENUM_END }; +#define RSTRUCT_TRANSIENT_P(st) FL_TEST_RAW((obj), RSTRUCT_TRANSIENT_FLAG) + struct RStruct { struct RBasic basic; union { @@ -746,6 +750,13 @@ rb_struct_const_ptr(VALUE st) RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr); } +static inline const VALUE * +rb_struct_const_heap_ptr(VALUE st) +{ + /* TODO: check embed on debug mode */ + return RSTRUCT(st)->as.heap.ptr; +} + /* class.c */ struct rb_deprecated_classext_struct { |