aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
Commit message (Collapse)AuthorAgeFilesLines
* numeric.c: rb_int2strnobu2016-03-261-0/+1
| | | | | | | * numeric.c (rb_int2str): conversion function to String for generic Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: rb_int_roundnobu2016-03-261-0/+1
| | | | | | | * numeric.c (rb_int_round): rounding function for generic Integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: basic arithmeticnobu2016-03-261-0/+6
| | | | | | | * numeric.c (rb_int_{uminus,plus,minus,mul,idiv,modulo}): basic arithmetic functions for generic Integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: format in Stringnobu2016-03-231-4/+4
| | | | | | | | | | | | * strftime.c (rb_strftime_with_timespec): append formatted results to the given string with expanding, and also deal with NUL chars. * strftime.c (rb_strftime, rb_strftime_timespec): return formatted string, not the length put in the given buffer. * time.c (rb_strftime_alloc): no longer needs to retry with reallocating buffers. * time.c (time_strftime): no longer needs to split by NUL chars. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_fix_divmod_fix): like r54213, use FIX2NUM only ifnaruse2016-03-211-14/+21
| | | | | | | x == FIXNUM_MIN && y == -1. This must be a rare case and it is expected compiler to handle well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: fix no-DLONG casenobu2016-03-211-3/+3
| | | | | | | * internal.h (rb_fix_mul_fix): multiply converted values, not object VALUEs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix r54203's typo (no DLONG case)naruse2016-03-201-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_int128t2big): declare only when HAVE_INT128_T.usa2016-03-201-2/+1
| | | | | | | fixed a compile error with VC++ introduced at r54203. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (DLONG): defined if long is 32bit (and LONG_LONG is 64bit;naruse2016-03-201-0/+28
| | | | | | | | | | | | | | | | but LONG_LONG is always defined as 64bit), or there's int128_t. * internal.h (DL2NUM): defined if DLONG is defined. * internal.h (rb_fix_mul_fix): defined for `Fixnum * Fixnum`. * insns.def (opt_mul): use rb_fix_mul_fix(). * numeric.c (fix_mul): ditto. * time.c (mul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_big_odd_p, rb_big_even_p): move tomrkn2016-03-191-0/+2
| | | | | | | | internal.h so that they are exported only for ruby itself. * internal.h (rb_big_odd_p, rb_big_even_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SyntaxError message at iseq compilenobu2016-03-191-0/+2
| | | | | | | | | | | | * iseq.c (rb_iseq_compile_with_option): make the parser in mild error. * load.c (rb_load_internal0): ditto. * parse.y (yycompile0): return the error message within the error to be raised. [Feature #11951] * parse.y (parser_compile_error): accumulate error messages in the error_buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_big_hash): Move to internal.h.mrkn2016-03-181-0/+1
| | | | | | * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_max, rb_ary_min): implement Array#max and min withmame2016-03-171-0/+1
| | | | | | | | | | arguments. replace super call with rb_nmin_run. * enum.c (nmin_run): exported (as rb_nmin_run). * internal.h: added a prototype for rb_nmin_run. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_max, rb_ary_min): Array#max and Array#min added.mame2016-03-171-0/+7
| | | | | | | | | | | | | | | [Feature #12172] * internal.h (OPTIMIZED_CMP): moved from enum.c so that array.c can use it. * test/ruby/test_array.rb (test_max, test_min): tests for Array#max and Array#min. * test/ruby/test_enum.rb (test_max, test_min): revised a bit to test Enumerable#max and #min explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.c: struct cmp_opt_data added for refactoring out a datamame2016-03-171-4/+9
| | | | | | | | | | structure for CMP_OPTIMIZABLE * array.c (struct ary_sort_data): use struct cmp_opt_data. * enum.c (struct min_t, max_t, min_max_t): use struct cmp_opt_data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_inject): Implement the specialized code for sum ofakr2016-03-171-0/+1
| | | | | | | | | | | | integers including Bignums. * internal.h (rb_fix_plus): Declared to be usable from enum_inject. * numeric.c (rb_fix_plus): Defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: private rb_gc_mark_global_tblnobu2016-03-151-1/+1
| | | | | | | * internal.h (rb_gc_mark_global_tbl): should be private, but was accidentally exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * intern.h (rb_divmod): assume compilers `/` and `%` comply C99naruse2016-03-081-0/+41
| | | | | | | | | | | | | | | | | | | | | | and reduce branching. If a compiler doesn't comply, add #ifdefs. * intern.h (rb_div): added for Ruby's behavior. * intern.h (rb_mod): added for Ruby's behavior. * insns.def (opt_div): use rb_div. * insns.def (opt_mod): use rb_mod. * numeric.c (fixdivmod): removed. * numeric.c (fix_divide): use rb_div. * numeric.c (fix_mod): use rb_mod. * numeric.c (fix_divmod): use rb_divmod. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: functions for class internalsnobu2016-03-071-0/+4
| | | | | | | * internal.h: move function declarations for class internals from include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole_event.c: use rb_write_error_strnobu2016-03-071-1/+1
| | | | | | | | | * ext/win32ole/win32ole_event.c (rescue_callback): use rb_write_error_str instead of rb_write_error, to respect the encoding and prevent the message from GC. * internal.h (rb_write_error_str): export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: shortcut macrosnobu2016-02-221-0/+2
| | | | | | | * internal.h (RRATIONAL_SET_{NUM,DEN}): shortcut macros for internal only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c: micro optimizationnobu2016-02-151-0/+1
| | | | | | | | * bignum.c (rb_big_uminus, bigsub_int): use BIGNUM_NEGATE. * internal.h (BIGNUM_NEGATE): simplify negation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fstring_enc_newnobu2016-02-041-0/+14
| | | | | | | | * string.c (rb_fstring_enc_new, rb_fstring_enc_cstr): functions to make fstring with encoding. * re.c (rb_reg_initialize): make fstring without copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: matched backrefs onlynobu2016-01-141-0/+2
| | | | | | | * 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
* * enum.c (enum_minmax): optimize object comparison inshugo2016-01-071-0/+16
| | | | | | Enumerable#minmax. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use id_table for constant tablesnormal2015-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* preserve source file name encodingnobu2015-12-241-0/+2
| | | | | | | | * compile.c (append_compile_error), parse.y (compile_error): preserve encoding of source file name in exceptions. * error.c (rb_compile_error_str, rb_compile_bug_str): add. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: do not expose internal singleton classnobu2015-12-221-0/+1
| | | | | | | | | * gc.c (internal_object_p): should not expose singleton classes without a metaclass. based on patches by ko1 and shugo. [Bug #11740] * class.c (rb_singleton_class_object_p): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: rehash cdhashnobu2015-12-111-0/+1
| | | | | | | | * compile.c (iseq_compile_each, ibf_load_object_hash): rehash case-dispatch hash to reduce collisions. http://d.hatena.ne.jp/ku-ma-me/20151210 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * introduce new ISeq binary format serializer/de-serializerko12015-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and a pre-compilation/runtime loader sample. [Feature #11788] * iseq.c: add new methods: * RubyVM::InstructionSequence#to_binary_format(extra_data = nil) * RubyVM::InstructionSequence.from_binary_format(binary) * RubyVM::InstructionSequence.from_binary_format_extra_data(binary) * compile.c: implement body of this new feature. * load.c (rb_load_internal0), iseq.c (rb_iseq_load_iseq): call RubyVM::InstructionSequence.load_iseq(fname) with loading script name if this method is defined. We can return any ISeq object as a result value. Otherwise loading will be continue as usual. This interface is not matured and is not extensible. So that we don't guarantee the future compatibility of this method. Basically, you should'nt use this method. * iseq.h: move ISEQ_MAJOR/MINOR_VERSION (and some definitions) from iseq.c. * encoding.c (rb_data_is_encoding), internal.h: added. * vm_core.h: add several supports for lazy load. * add USE_LAZY_LOAD macro to specify enable or disable of this feature. * add several fields to rb_iseq_t. * introduce new macro rb_iseq_check(). * insns.def: some check for lazy loading feature. * vm_insnhelper.c: ditto. * proc.c: ditto. * vm.c: ditto. * test/lib/iseq_loader_checker.rb: enabled iff suitable environment variables are provided. * test/runner.rb: enable lib/iseq_loader_checker.rb. * sample/iseq_loader.rb: add sample compiler and loader. $ ruby sample/iseq_loader.rb [dir] will compile all ruby scripts in [dir]. With default setting, this compile creates *.rb.yarb files in same directory of target .rb scripts. $ ruby -r sample/iseq_loader.rb [app] will run with enable to load compiled binary data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce rb_autoload_str to replace rb_autoloadnormal2015-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* encoding.c: defer finding encodingnobu2015-12-021-0/+1
| | | | | | | | | | | | | * encoding.c (enc_m_loader): defer finding encoding object not to be infected by marshal source. [ruby-core:71793] [Bug #11760] * marshal.c (r_object0): enable compatible loader on USERDEF class. the loader function is called with the class itself, instead of an allocated object, and the loaded data. * marshal.c (compat_allocator_table): intialize compat_allocator_tbl on demand. * object.c (rb_undefined_alloc): extract from rb_obj_alloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c: rb_sym_internnobu2015-11-301-1/+20
| | | | | | | * symbol.c (rb_sym_intern): rename from rb_cstr_intern and add variants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.c: remove ruby_engine_namenobu2015-11-291-1/+1
| | | | | | | | | | | | | * ruby.c (load_file_internal, ruby_process_options): share ruby_engine instead of literal strings. * version.c (Init_version): remove internal `ruby_engine_name`, but set the VM program name in addition to the global constant. * vm_backtrace.c (location_to_str, oldbt_init): use th eVM program name always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: export rb_gc_for_fdnobu2015-11-241-1/+1
| | | | | | | * internal.h (rb_gc_for_fd): move to export, as referred by ext/socket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_gc_for_fd for more callersnormal2015-11-231-0/+1
| | | | | | | | | | | | | | | | * dir.c (dir_initialize): use rb_gc_for_fd for ENOMEM * ext/socket/init.c (rsock_socket): ditto * ext/socket/socket.c (rsock_socketpair): ditto * internal.h (rb_gc_for_fd): prototype * io.c (rb_gc_for_fd): remove static [ruby-core:71623] [Feature #11727] Manpages for opendir(2), socket(2), and socketpair(3posix) describe ENOMEM as a possible error for each of these; handle it consistently with our existing wrappers for open(2)/pipe(2) etc... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: release GVL for ffi_callnormal2015-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some external functions I wish to call may take a long time and unnecessarily block other threads. This may lead to performance regressions for fast functions as releasing/acquiring the GVL is not cheap, but can improve performance for long-running functions in multi-threaded applications. This also means we must reacquire the GVL when calling Ruby-defined callbacks for Fiddle::Closure, meaning we must detect whether the current thread has the GVL by exporting ruby_thread_has_gvl_p in internal.h * ext/fiddle/function.c (struct nogvl_ffi_call_args): new struct for GVL release (nogvl_ffi_call): new function (function_call): adjust for GVL release [ruby-core:71642] [Feature #11607] * ext/fiddle/closure.c (struct callback_args): new struct for GVL acquire (with_gvl_callback): adjusted original callback function (callback): wrapper for conditional GVL acquire * ext/fiddle/depend: add dependencies * ext/fiddle/extconf.rb: include top_srcdir for internal.h * internal.h (ruby_thread_has_gvl_p): expose for fiddle * vm_core.h (ruby_thread_has_gvl_p): moved to internal.h * test/fiddle/test_function.rb (test_nogvl_poll): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* struct.c: dignobu2015-11-161-0/+1
| | | | | | | | * object.c (rb_obj_dig): dig in nested structs too. * struct.c (rb_struct_dig): new method Struct#dig. [Feature #11688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c: nil value is validnobu2015-11-111-0/+1
| | | | | | | | * sprintf.c (rb_str_format): look up the key, then get default value and raise KeyError if the returned value is nil. [ruby-dev:49338] [Ruby trunk - Bug #11677] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: cfunc_proc_tnobu2015-11-101-0/+2
| | | | | | | | | * proc.c (cfunc_proc_t): add room for me. * proc.c (cfunc_proc_new): generalise for cfunc proc without env. * proc.c (rb_func_proc_new, rb_func_lambda_new): new functions to make proc/lambda without env from cfunc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: rb_check_funcall_defaultnobu2015-11-091-0/+1
| | | | | | | | | * vm_eval.c (rb_check_funcall_default): split from rb_check_funcall to return the given fallback value. * object.c (rb_obj_dig): use rb_check_funcall_default so that tail call optimization will be possible. [Feature #11643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dignobu2015-11-091-0/+2
| | | | | | | | | * array.c (rb_ary_dig): new method Array#dig. * hash.c (rb_hash_dig): new method Hash#dig. * object.c (rb_obj_dig): dig in nested arrays/hashes. [Feature #11643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c: rb_cstr_internnobu2015-11-081-0/+5
| | | | | | | | * symbol.c (rb_cstr_intern): new function to make Symbol object like as rb_str_intern() but from pointer to the name, its length and its encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: RUBY_DTRACE_HOOKnobu2015-10-311-2/+4
| | | | | | | | | | | * internal.h (RUBY_DTRACE_HOOK): extract from RUBY_DTRACE_CREATE_HOOK for other type hooks. * gc.c (RUBY_DTRACE_GC_HOOK): ditto. * parse.y (RUBY_DTRACE_PARSE_HOOK): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_class_ivar_setnobu2015-10-301-2/+1
| | | | | | | * 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 (rb_st_insert_id_and_value): reduce argsnormal2015-10-301-1/+1
| | | | | | | | | | | | | | 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
* * encoding.c (rb_enc_check_str): add for performance.ko12015-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | This function only accept T_STRING (and T_REGEXP). This patch improves performance of a tiny_segmenter benchmark (num=2) 2.54sec -> 2.42sec on my machine. https://github.com/chezou/TinySegmenter.jl/blob/master/benchmark/benchmark.rb * encoding.c: add ENC_DEBUG and ENC_ASSERT() macros. * internal.h: add a decl. of rb_enc_check_str(). * string.c (rb_str_plus): use rb_enc_check_str(). * string.c (rb_str_subpat_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: export rb_wb_(un)protected_newobj_of()ko12015-10-291-3/+3
| | | | | | | | | because some extensions include internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: introduce rb_wb_unprotected_newobj_of() andko12015-10-291-0/+12
| | | | | | | | | | | | | | | | rb_wb_protected_newobj_of(), pass the WB_PROTECTED information explicitly. * internal.h: use introduced functions by NEWOBJ_OF(). `flag' is immediate value, so that C compilers can solve them at compile time. * include/ruby/ruby.h: add a commnent about that. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RUBY_DTRACE_CREATE_HOOKnobu2015-10-291-0/+12
| | | | | | | | | | * internal.h (RUBY_DTRACE_CREATE_HOOK): macro to call hook at object creation. * vm.c (rb_source_location, rb_source_loc): retrieve source path and line number at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e