diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-09-30 20:15:27 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-09-30 20:15:27 +0900 |
| commit | 4a55b42984d677895d43ddb1bd89c394c3625009 (patch) | |
| tree | 2eb3ee8bdec3b4ce55adf1de430a78cac8cdec4b /include | |
| parent | 3e3048ddd15ab6e593830f4f63b97b044a529e4a (diff) | |
| download | mruby-4a55b42984d677895d43ddb1bd89c394c3625009.tar.gz mruby-4a55b42984d677895d43ddb1bd89c394c3625009.zip | |
O(1) mrb_sym2name_len(); close #2591
instead of adding sym->name hash table, linear symbol table is added, and reduced name->sym hash table size.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/mruby.h b/include/mruby.h index 480080e8b..2fd0a4af7 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -165,7 +165,9 @@ typedef struct mrb_state { struct alloca_header *mems; mrb_sym symidx; - struct kh_n2s *name2sym; /* symbol table */ + struct kh_n2s *name2sym; /* symbol hash */ + struct symbol_name *symtbl; /* symbol table */ + size_t symcapa; #ifdef ENABLE_DEBUG void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs); |
