* symbol.c (global_symbols): make ids two-dimensional array of
strings and symbols, for write-barrier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (rb_enc_symname_type): allow junk-base attrset ID
unless the stem is not an attrset name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (rb_str_dynamic_intern): check if the stem ID of
attrset ID is already registered as a static ID.
[ruby-dev:48559] [Bug #10259]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This is not a complete fix for bug 10206, but seems to reduce
that crash and also looks correct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h (WARN_UNUSED_RESULT): warn unused result by gcc 3.4
or later.
* symbol.c: declare some functions with WARN_UNUSED_RESULT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The dynamic sym passed to rb_sym2id may be a garbage object
(as accounted for by dsymbol_check). This fixes an occasional
segfault in "make test-all" for me.
No need to backport, this is from the new symbol GC feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_setup_fake_str): setup fake string from C pointer,
length, and encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RBASIC_SET_CLASS() because it insert write barriers to fake
(non-RVALUE) structure.
It can cause unexpected behaviour.
Ruby 2.1 also have a same problem (setup_fake_str() in parse.y).
* symbol.c (setup_fake_str): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (SYMBOL_PINNED, SYMBOL_PINNED_P, ID_DYNAMIC_SYM_P),
(STATIC_SYM2ID, STATIC_ID2SYM): move from symbol.h as these
macros are used only in symbol.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (lookup_str_id, lookup_str_sym, lookup_id_str): return
the result ID, Symbol, and string directly instead of returning
via a pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (op_tbl): remove non-regular symbols.
* symbol.c (global_symbols): start from the next of the preserved
ID.
* symbol.c: (rb_id2str): op_tbl does not exceed tLAST_OP_ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fstrings refered by static symbols and pinned dynamic symbols
are registerd by rb_gc_register_mark_object().
frstring refered by dynamic symbols (not pinned symbols)
are refered from global_symbols.dsymbol_fstr_hash (Hash object).
Note that fstrings refered from dynamic symbols must live loger
than symbol objects themselves because rb_gc_free_dsymbol() uses
fstring to remove from symbol tables.
This is why we can not mark fstrings from dynamic symbols.
This technique reduces root objects for GC marking.
* gc.c (gc_mark_roots): ditto.
* internal.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c, symbol.h: Symbol class implementation and internals,
split from parse.y.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e