aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
Commit message (Collapse)AuthorAgeFilesLines
* * variable.c: Added documentation about order of `Module#constants`hsbt2016-03-231-0/+3
| | | | | | [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: matched backrefs onlynobu2016-01-141-5/+15
| | | | | | | * variable.c (rb_f_global_variables): add matched back references only, as well as defiend? operator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: $1..$9 in global_variablesnobu2016-01-141-6/+8
| | | | | | | * variable.c (rb_f_global_variables): add $1..$9 only if $~ is set. fix the condition removed at r14014. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* resolve class name earlier and more consistentlynormal2016-01-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | This further avoids class name resolution issues which came about due to relying on hash table ordering before r53376. Pre-caching the class name when it is never used raises memory use, but the overall gain from moving away from st still gives us a small gain. Reverting r53376 and this patch and testing with "valgrind -v ./ruby -rrdoc -eexit" on x86 (32-bit) shows: before: in use at exit: 1,662,239 bytes in 25,286 blocks total heap usage: 49,514 allocs, 24,228 frees, 6,005,561 bytes allocated after, with this change: in use at exit: 1,646,529 bytes in 24,572 blocks total heap usage: 48,891 allocs, 24,319 frees, 6,003,921 bytes allocated * class.c (Init_class_hierarchy): resolve name for rb_cObject ASAP * object.c (rb_mod_const_set): move name resolution to rb_const_set * variable.c (rb_const_set): do class resolution here [ruby-core:72807] [Bug #11977] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_mod_deprecate_constant): [DOC] addedsho-h2016-01-041-0/+7
| | | | | | | documentation for Module#deprecate_constant. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use id_table for constant tablesnormal2015-12-291-82/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | valgrind 3.9.0 on x86-64 reports a minor reduction in memory usage when loading only RubyGems and RDoc by running: ruby -rrdoc -eexit before: HEAP SUMMARY: in use at exit: 2,913,448 bytes in 27,394 blocks total heap usage: 48,362 allocs, 20,968 frees, 9,034,621 bytes alloc after: HEAP SUMMARY: in use at exit: 2,880,056 bytes in 26,712 blocks total heap usage: 47,791 allocs, 21,079 frees, 9,046,507 bytes alloc * class.c (struct clone_const_arg): adjust for id_table (clone_const): ditto (clone_const_i): ditto (rb_mod_init_copy): ditto (rb_singleton_class_clone_and_attach): ditto (rb_include_class_new): ditto (include_modules_at): ditto * constant.h (rb_free_const_table): ditto * gc.c (free_const_entry_i): ditto (rb_free_const_table): ditto (obj_memsize_of): ditto (mark_const_entry_i): ditto (mark_const_tbl): ditto * internal.h (struct rb_classext_struct): ditto * object.c (rb_mod_const_set): resolve class name on assignment * variable.c (const_update): replace with const_tbl_update (const_tbl_update): new function (fc_i): adjust for id_table (find_class_path): ditto (autoload_const_set): st_update => const_tbl_update (rb_const_remove): adjust for id_table (sv_i): ditto (rb_local_constants_i): ditto (rb_local_constants): ditto (rb_mod_const_at): ditto (rb_mod_const_set): ditto (rb_const_lookup): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (struct ivar_update): rename "extended" to "iv_extended"ngoto2015-12-211-6/+6
| | | | | | | | to avoid name conflict with /usr/include/floatingpoint.h on Solaris. [Bug #11853] [ruby-dev:49448] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make local symbols staticnobu2015-12-081-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce rb_autoload_str to replace rb_autoloadnormal2015-12-061-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_autoload_str may be safer by preventing premature GC. It can also be more efficient by passing a pre-frozen string that can be deduped using rb_fstring. Common autoload callers (e.g. rubygems, rdoc) already use string literals as the file argument. There seems to be no reason to expose rb_autoload_str to the public C API since autoload is not performance-critical. Applications may declare autoloads in Ruby code or via rb_funcall; so merely deprecate rb_autoload without exposing rb_autoload_str to new users. Running: valgrind -v ruby -rrdoc -rubygems -e exit shows a minor memory reduction (32-bit userspace) before: in use at exit: 1,600,621 bytes in 28,819 blocks total heap usage: 55,786 allocs, 26,967 frees, 6,693,790 bytes allocated after: in use at exit: 1,599,778 bytes in 28,789 blocks total heap usage: 55,739 allocs, 26,950 frees, 6,692,973 bytes allocated * include/ruby/intern.h (rb_autoload): deprecate * internal.h (rb_autoload_str): declare * load.c (rb_mod_autoload): use rb_autoload_str * variable.c (rb_autoload): become compatibility wrapper (rb_autoload_str): hoisted out from old rb_autoload [ruby-core:71369] [Feature #11664] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove spurious #define for globalsnormal2015-11-291-74/+53
| | | | | | | | | | Removing the indirection helps me with readability, at least. It doesn't seem like there are many other places in the Ruby code where macros are used like this. [ruby-core:71735] [Feature #11749] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_autoload_load): allow recursive callsnormal2015-11-091-0/+3
| | | | | | | | | | * variable.c (rb_autoload_load): allow recursive calls [ruby-core:71345] [Bug #11658] * test/ruby/test_autoload.rb (test_autoload_while_autoloading): new test by: Hiroshi Shirosaki <h.shirosaki@gmail.com> [ruby-core:71390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: suppress a warningnobu2015-11-041-1/+1
| | | | | | | * variable.c (autoload_reset): initialize formally to suppress a warning from container_off_var() by Visual C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove casts for rb_class_ivar_set callersnormal2015-11-021-3/+3
| | | | | | | | | | | | | | Casting any arguments of rb_class_ivar_set to st_data_t is wrong as the function does not take any st_data_t parameters anymore. There's no functional change, as ID, VALUE, and st_data_t are all the same type, but this reduces confusion and improves maintainability for future type changes. * variable.c (find_class_path): remove cast for rb_class_ivar_set (rb_ivar_set): ditto (rb_cvar_set): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_global_tbl): convert to id_tablenormal2015-11-021-19/+19
| | | | | | | | | Mainly this is to reduce casting a tiny amount; and probably nothing depends on the order of globals. Likely no measurable memory usage improvement as globals are not common, but maybe some weird code out there benefits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_source_loc and rb_source_locationnobu2015-10-311-2/+1
| | | | | | | | | * error.c, eval.c, eval_error.c, gc.c, variable.c, vm.c, vm_eval.c, vm_trace.c: use rb_source_loc/rb_source_location instead of combination of rb_sourcefile/rb_sourcefilename and rb_sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_class_ivar_setnobu2015-10-301-4/+4
| | | | | | | * variable.c (rb_class_ivar_set): rename as class specific ivar setter, and st_table is no longer involved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (generic_ivar_remove): return original valuenormal2015-10-301-4/+4
| | | | | | | | | | | | | This fixes a bug introduced in r50678 ("variable.c: use indices for generic ivars") and does not affect any released version of Ruby * variable.c (generic_ivar_remove): adjust type, set valp (rb_obj_remove_instance_variable): simplify call * test/ruby/test_object.rb (test_remove_instance_variable): expand for implementation details git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_st_insert_id_and_value): reduce argsnormal2015-10-301-6/+5
| | | | | | | | | | | | | | Minor simplification; this will hopefully make future patches for switching to id_table easier-to-review. * internal.h (rb_st_insert_id_and_value): update prototype * variable.c (rb_st_insert_id_and_value): reduce args (find_class_path): adjust call for less args (rb_ivar_set): ditto (rb_cvar_set): ditto * class.c (rb_singleton_class_attached): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: reduce heap usage for autoload_data_inormal2015-10-291-30/+31
| | | | | | | | | | | | | | | | | | | | For the loader (first thread which hits autoload, it is wasteful to have extra elements on the stack. For the lifetime of the process, it is wasteful to waste 2 words for every autoload entry. So this makes full use of existing stack overhead while reducing heap overhead for long-lived autoload_data_i structs. * variable.c (struct autoload_state): usable as wait-queue head (struct autoload_data_i): remove 2 words of overhead (autoload_i_mark): remove marking for thread (autoload_reset): adjust for struct changes (rb_autoload): ditto (rb_autoloading_value): ditto (rb_autoload_load): ditto (const_update): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: additional locking around autoloadnormal2015-10-281-20/+83
| | | | | | | | | | | | [ruby-core:70075] [ruby-core:71239] [Bug #11384] Note: this open-coding locking method may go into rb_mutex/rb_thread_shield types. It is smaller and simpler and based on the wait queue implementation of the Linux kernel. When/if we get rid of GVL, native mutexes may be used as-is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: receiver in NameErrornobu2015-10-281-1/+1
| | | | | | | | * error.c (rb_name_err_new): store the receiver directly. * error.c (name_err_receiver): return directly stored receiver. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NameError#receiver of uninitialized constantnobu2015-10-281-73/+65
| | | | | | | | | * error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fail if frozennobu2015-09-161-0/+1
| | | | | | | * variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: wrap long linesnormal2015-08-041-11/+22
| | | | | | Make code easier to read and hunt for bugs with my tiny terminal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: Module#deprecate_constantnobu2015-07-301-4/+21
| | | | | | | | * variable.c (rb_const_get_0): warn deprecated constant reference. * variable.c (rb_mod_deprecate_constant): mark constants to be warned as deprecated. [Feature #11398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove FL_ABLE check for generic ivarsnormal2015-06-241-2/+2
| | | | | | | | | | Missed this in r50758. * variable.c (generic_ivar_set): remove FL_ABLE check (gen_ivar_copy): ditto [ruby-core:69715] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: remove generic ivar support for special constantsnormal2015-06-031-47/+16
| | | | | | | | | | | | | | | | | | Special constants are all frozen since [Feature #8923] and cannot support ivars. Remove some unused code we had for supporting them. * variable.c (special_generic_ivar): remove flag (givar_i, rb_mark_generic_ivar_tbl): remove functions (rb_free_generic_ivar, rb_ivar_lookup, rb_ivar_delete, generic_ivar_set, rb_ivar_set, rb_ivar_defined, rb_copy_generic_ivar, rb_ivar_foreach, rb_ivar_count, rb_obj_remove_instance_variable): adjust for lack of ivar support in special constants * test/ruby/test_variable.rb: test ivars for special consts * internal.h: remove rb_mark_generic_ivar_tbl decl * gc.c (gc_mark_roots): remove rb_mark_generic_ivar_tbl call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: avoid compatibility table with generic ivarsnormal2015-05-301-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This recovers and improves performance of Marshal.dump/load on Time objects compared to when we implemented generic ivars entirely using st_table. This also recovers some performance on other generic ivar objects, but does not bring bring Marshal.dump/load performance up to previous speeds. benchmark results: minimum results in each 10 measurements. Execution time (sec) name trunk geniv after marshal_dump_flo 0.343 0.334 0.335 marshal_dump_load_geniv 0.487 0.527 0.495 marshal_dump_load_time 1.262 1.401 1.257 Speedup ratio: compare with the result of `trunk' (greater is better) name geniv after marshal_dump_flo 1.026 1.023 marshal_dump_load_geniv 0.925 0.985 marshal_dump_load_time 0.901 1.004 * include/ruby/intern.h (rb_generic_ivar_table): deprecate * internal.h (rb_attr_delete): declare * marshal.c (has_ivars): use rb_ivar_foreach (w_ivar): ditto (w_object): update for new interface * time.c (time_mload): use rb_attr_delete * variable.c (generic_ivar_delete): implement (rb_ivar_delete): ditto (rb_attr_delete): ditto [ruby-core:69323] [Feature #11170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: use indices for generic ivarsnormal2015-05-291-125/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces memory overhead of ivars for common types such as T_DATA the same way T_OBJECT does it. For 9992 accepted clients on an OpenSSL server, this reduces memory from 77160K to 69248K with the script in https://bugs.ruby-lang.org/issues/11170 * variable.c (static int special_generic_ivar): move (rb_generic_ivar_table): rewrite for compatibility (gen_ivtbl_bytes): new function (generic_ivar_get): update to use ivar index (generic_ivar_update): ditto (generic_ivar_set): ditto (generic_ivar_defined): ditto (generic_ivar_remove): ditto (rb_mark_generic_ivar): ditto (givar_i): ditto (rb_free_generic_ivar): ditto (rb_mark_generic_ivar_tbl): ditto (rb_generic_ivar_memsize): ditto (rb_copy_generic_ivar): ditto (rb_ivar_set): ditto (rb_ivar_foreach): ditto (rb_ivar_count): ditto (givar_mark_i): remove (gen_ivtbl_mark): new function (gen_ivar_each): ditto (iv_index_tbl_extend): update for struct ivar_update (iv_index_tbl_newsize): ditto [ruby-core:69323] [Feature #11170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: extract common functions for generic ivar indicesnormal2015-05-291-20/+43
| | | | | | | | | | * variable.c (iv_index_tbl_make): extract from rb_ivar_set (iv_index_tbl_extend): ditto (iv_index_tbl_newsize): ditto (rb_ivar_set): use extracted functions [ruby-core:69323] (Part 1) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: generic_iv_tbl is unavoidablenormal2015-05-211-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even miniruby creates one generic ivar (plain "ruby" creates 9), so there's no point in lazily allocating the table. I dumped generic ivar counts with the following trivial patch: --- a/variable.c +++ b/variable.c @@ -24,6 +24,10 @@ static void check_before_mod_set(VALUE, ID, VALUE, const char *); static void setup_const_entry(rb_const_entry_t *, VALUE, VALUE, rb_const_flag_t); static int const_update(st_data_t *, st_data_t *, st_data_t, int); static st_table *generic_iv_tbl; +__attribute__((destructor)) static void count_genivar(void) +{ + fprintf(stderr, "genivars: %zu\n", (size_t)generic_iv_tbl->num_entries); +} void Init_var_tables(void) * variable.c (Init_var_tables): init generic_iv_tbl (rb_generic_ivar_table, generic_ivar_get, generic_ivar_set, generic_ivar_defined, generic_ivar_remove, rb_mark_generic_ivar, givar_i, rb_mark_generic_ivar_tbl, rb_free_generic_ivar, rb_copy_generic_ivar, rb_ivar_foreach, rb_ivar_count): remove checks for uninitialize generic_iv_tbl [ruby-core:69155] [Feature #11146] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* allocate structs with wrappernobu2015-05-161-2/+1
| | | | | | | | | | | | | | * parse.y (rb_parser_new, ripper_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. * variable.c (rb_autoload): ditto. * ext/digest/digest.c (rb_digest_base_alloc): ditto. * ext/strscan/strscan.c (strscan_s_allocate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c: Change autoload to call `require` through Ruby rathertenderlove2015-05-141-1/+1
| | | | | | | | | | than directly calling `rb_require_safe`. This allows things like RubyGems to intercept file loading done though `autoload`. [Feature #11140] * test/ruby/test_autoload.rb: Test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: no intermediate IDsnobu2015-05-131-2/+2
| | | | | | | * variable.c (rb_set_class_path_string, rb_set_class_path): get rid of creating intermediate IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: const_updatenobu2015-04-131-12/+36
| | | | | | | | | | | | * variable.c (autoload_delete): no longer delete const entry itself. * variable.c (autoload_const_set, rb_const_set): update const entry instead of adding after removal. * variable.c (const_update): extract from rb_const_set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: setup_const_entrynobu2015-04-131-4/+12
| | | | | | | * variable.c (setup_const_entry): extract rb_const_entry_t setup from rb_const_set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: ensurenobu2015-04-131-6/+11
| | | | | | | * variable.c (rb_autoload_load): prefer rb_ensure than rb_protect for rollback. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: escape erred namenobu2015-03-221-2/+2
| | | | | | | | * variable.c (rb_path_to_class): escape erred name. as precision delimits the formatted result only, not region of an argument string, need to make a substring for the particular region. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h, node.h: move a definition of `struct rb_global_entry'ko12015-03-121-1/+0
| | | | | | | | | | and related functions from node.h to internal.h. * variable.c: remove unused include pragma. * common.mk: remove unused dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_search_class_pathnobu2015-02-281-17/+47
| | | | | | | | | * variable.c (rb_tmp_class_path): defer making temporary class path string. * variable.c (rb_search_class_path): search class path or return Qnil or Qfalse if unnamed, not creating a temporary path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: preserve name encoding of subclassnobu2015-02-281-7/+5
| | | | | | | * variable.c (rb_tmp_class_path): preserve name encoding of an anonymous instance of module/class subclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r45487nobu2015-02-061-1/+0
| | | | | | | | | * variable.c (rb_alias_variable): IDs are always immportal now, no pin down is needed. * vm_method.c (rb_method_entry_make): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: ignore mortal classidnobu2015-02-061-2/+3
| | | | | | * variable.c (classname): ignore classid if it is a mortal symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use 0 for reservednobu2014-12-011-2/+2
| | | | | | | use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of inadvertent ID creationnobu2014-11-211-13/+12
| | | | | | | | | * object.c (rb_mod_const_get, rb_mod_const_defined): ditto. * variable.c (rb_const_missing, rb_mod_const_missing): call const_missing without new ID to get rid of inadvertent ID creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Include ruby.h and ruby/encoding.h to beakr2014-11-151-3/+1
| | | | | | | | includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c, vm_insnhelper.c: improve performancenobu2014-10-191-1/+2
| | | | | | | | | * variable.c (rb_ivar_get), vm_insnhelper.c (vm_getivar): improve instance variable retrieval performance by checking ruby_verbose before call of rb_warning and evaluation of its argument. [ruby-core:65786] [Feature #10396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: use st_updatenobu2014-10-081-9/+23
| | | | | | | * variable.c (generic_ivar_set): use st_update to insert object which does not have generic instance variables yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: use st_updatenobu2014-10-081-6/+10
| | | | | | | * variable.c (sv_i, cv_i): use st_update to insert non-existing entries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constant.h: constant visibilitiesnobu2014-10-081-3/+3
| | | | | | | * constant.h (RB_CONST_PRIVATE_P, RB_CONST_PUBLIC_P): macros to predicate constant visibilities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e