summaryrefslogtreecommitdiff
path: root/symbol.c
AgeCommit message (Collapse)Author
2014-09-19symbol.c: fix dynamic attrset IDnobu
* 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
2014-09-08symbol.c (rb_intern_cstr_without_pindown): check dsymbol on returnnormal
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
2014-08-30internal.h: WARN_UNUSED_RESULTnobu
* 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
2014-08-30symbol.c (rb_sym2id): do not return garbage objectnormal
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
2014-08-16string.c: rb_setup_fake_strnobu
* 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
2014-08-15* string.c (setup_fake_str): fake strings should not set class byko1
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
2014-08-04symbol.c: move macrosnobu
* 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
2014-07-27symbol.c: wrap global_symbols tablesnobu
* symbol.c (register_symid_direct, unregister_sym): extract to wrap global_symbols tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-27symbol.c: return the results directlynobu
* 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
2014-07-25symbol.c (dsymbol_check): remove unneeded semi-colonnormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-11symbol.c: remove dependency on parse.hnobu
* 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
2014-07-09* symbol.c: remove rb_gc_mark_symbols().ko1
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
2014-07-09symbol.c, symbol.h: split from parse.ynobu
* 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