aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-14 18:43:11 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-14 18:43:11 +0000
commit3b4e68cfab987575662d3b6fcc593306255773bf (patch)
treec5890b1f3e6ed65691e455f01c6958793ade4b18 /iseq.c
parent005ee0e45533e6b11722103418ebee9d3bba4a5d (diff)
downloadruby-3b4e68cfab987575662d3b6fcc593306255773bf.tar.gz
* iseq.h (struct iseq_compile_data): use struct rb_id_table
instead of st_table. * iseq.c (prepare_iseq_build): don't allocate ivar_cache_table until it has at least one element. * iseq.c (compile_data_free): free ivar_cache_table only if it is allocated. * compile.c (get_ivar_ic_value): allocate if the table is not allocated yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/iseq.c b/iseq.c
index 2a4d58e611..28d35eb328 100644
--- a/iseq.c
+++ b/iseq.c
@@ -21,6 +21,7 @@
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
+#include "id_table.h"
#include "insns.inc"
#include "insns_info.inc"
@@ -58,8 +59,9 @@ compile_data_free(struct iseq_compile_data *compile_data)
ruby_xfree(cur);
cur = next;
}
- st_free_table(compile_data->ivar_cache_table);
-
+ if (compile_data->ivar_cache_table) {
+ rb_id_table_free(compile_data->ivar_cache_table);
+ }
ruby_xfree(compile_data);
}
}
@@ -300,7 +302,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
ISEQ_COMPILE_DATA(iseq)->option = option;
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1;
- ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = st_init_numtable();
+ ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = NULL;
if (option->coverage_enabled) {
VALUE coverages = rb_get_coverages();