summaryrefslogtreecommitdiff
path: root/symbol.c
AgeCommit message (Collapse)Author
2015-07-07symbol.c: preserve encodingnobu
* symbol.c (rb_check_id, rb_check_symbol): preserve encoding of the given name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* load.c: removed unused header file "node.h".ko1
* method.h: ditto. * symbol.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04symbol.c: make dsym_fstrs an identity hashnobu
* symbol.c (Init_sym): make dsym_fstrs a hash compared by identity as the keys are unique fstrings, to get rid of running hash and compare methods and causing new object allocation during garbage collection phase. [ruby-dev:48891] [Bug #10933] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-01symbol.c: fix memory leak from global fstr hashnormal
* symbol.c (rb_gc_free_dsymbol): delete from global fstr hash * test/ruby/test_symbol.rb (test_symbol_fstr_leak): test for bug [ruby-core:67268] [Bug #10686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24* hash.c (rb_hash_delete): return Qnil if there are no correspondingko1
entry. [Bug #10623] * hash.c (rb_hash_delete_entry): try delete and return Qundef if there are no corresponding entry. * internal.h: add rb_hash_delete_entry()'s declaration. * symbol.c: use rb_hash_delete_entry(). * thread.c: use rb_hash_delete_entry(). * ext/-test-/hash/delete.c: use rb_hash_delete_entry(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-17symbol.c: symbol type predicate functionsnobu
* symbol.h (is_{local,global,instance,attrset,const,class,junk}_sym): fix ID type names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27id.h.tmpl: ANDOP and OROPnobu
* template/id.h.tmpl (token_op_ids): define && and || for ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27parse.y: optimize IDs in rippernobu
* parse.y: optimize ripper_intern calls, ::, **, -@, +@, <=>, >=, <=, ==, ===, !=, =~, !~, <<, >>, and call. * parse.y: use initialized IDs, warn and warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27symbol.h: optimize ID2SYMnobu
* symbol.h (rb_id2sym): optimize for predefined IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-17symbol.c (register_sym): debug codenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14symbol.c: ids arraynobu
* 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
2014-10-14symbol.c: immortal IDsnobu
* symbol.c (global_symbols): make IDs immortal always, instead of treating dynamic symbols as IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14symbol.c: rename rb_str_dynamic_internnobu
* iseq.c, marshal.c, string.c: use rb_str_intern instead of rb_str_dynamic_intern. * symbol.c (rb_str_intern): rename rb_str_dynamic_intern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-06symbol.c: junk-base attrsetnobu
* 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
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