summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-02-06 22:01:45 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-02-12 17:30:34 +0900
commit06ba5905f019ca1a8d8e498fe6dce7a94702c9ad (patch)
treeca7dacf0eee23b1256cda2fad2e7b69a975af47a /include/mruby.h
parent3a95bf0ddb2ce9c15655afc14073669bf4968c12 (diff)
downloadmruby-06ba5905f019ca1a8d8e498fe6dce7a94702c9ad.tar.gz
mruby-06ba5905f019ca1a8d8e498fe6dce7a94702c9ad.zip
Implement inline packed symbols.
Small symbols with all alphanumeric characters (<5) are packed in 32bit symbol integer a la base64. This means those small symbols are not listed in `Symbol.all_symbols`.
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 2f2d98677..e9fd08102 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -242,6 +242,9 @@ typedef struct mrb_state {
struct symbol_name *symtbl; /* symbol table */
mrb_sym symhash[256];
size_t symcapa;
+#ifndef MRB_ENABLE_SYMBOLL_ALL
+ char symbuf[8]; /* buffer for small symbol names */
+#endif
#ifdef MRB_ENABLE_DEBUG_HOOK
void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);