From 27f9e70795e500cb934395bf17446533b8e41f76 Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 8 Sep 2014 19:38:22 +0000 Subject: vm_core.h (rb_env_t): use flexible array * vm_core.h (rb_env_t): use flexible array This reduces allocations and speeds up the lambda calculus fizzbuzz (bm_app_lc_fizzbuzz.rb) benchmark [ruby-core:64858] * proc.c (get_local_variable_ptr): deconst to adjust for flex array * vm.c (env_mark, env_free, env_memsize): remove check for env->env * vm.c (env_alloc): single allocation for flex array * vm.c (vm_make_env_each): adjust env_alloc call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 1afa1b2914..939fd87d9d 100644 --- a/vm_core.h +++ b/vm_core.h @@ -753,11 +753,11 @@ typedef struct { GetCoreDataFromValue((obj), rb_env_t, (ptr)) typedef struct { - VALUE *env; int env_size; int local_size; VALUE prev_envval; /* for GC mark */ rb_block_t block; + VALUE env[1]; /* flexible array */ } rb_env_t; extern const rb_data_type_t ruby_binding_data_type; -- cgit v1.2.3