From b3abb691daa86e8336a3e2e426e2b2621651896b Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 12 Aug 2015 12:16:29 +0000 Subject: hoist out rb_call_info_kw_arg_bytes to inline function * vm_core.h (rb_call_info_kw_arg_bytes): extract from compile.c * compile.c (iseq_build_callinfo_from_hash): use above function This will be use for implementing iseq_memsize git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index a032daa2ad..67458372c0 100644 --- a/vm_core.h +++ b/vm_core.h @@ -180,6 +180,12 @@ typedef struct rb_call_info_kw_arg_struct { VALUE keywords[1]; } rb_call_info_kw_arg_t; +static inline size_t +rb_call_info_kw_arg_bytes(int keyword_len) +{ + return sizeof(rb_call_info_kw_arg_t) + sizeof(VALUE) * (keyword_len - 1); +} + enum method_missing_reason { MISSING_NOENTRY = 0x00, MISSING_PRIVATE = 0x01, -- cgit v1.2.3