* string.c (rb_str_conv_enc_opts): allocate and hide wrapper before
creating converter to be wrapped, to get rid of potential memory
leak by failure on the allocation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_conv_enc_opts): convert with one converter, instead
of re-creating converters for each buffer expansion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Raises an IndexError if Regexp match is out of range.
Github fixes#243 Patch by Dmtiriy Budnik
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
when a separator is passed. The patch is from yoshidam (Yoshida
Masato).
[Bug #7646] [ruby-dev:46827]
* test/ruby/test_string.rb: a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Module#refine activates all refinements defined in that module
only in a given block.
* string.c (sym_to_proc, sym_call): don't use refinements.
* test/ruby/test_refinement.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_cmp_m): try to compare with to_str result if
possible before calling <=> method. [ruby-core:49279] [Bug #7342]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_cmp_m): use rb_check_funcall instead of respond_to
and call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_str_enumerate_lines): Dummy initialization of ary has been
replaced with UNINITIALIZED_VAR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_str_enumerate_lines): suppress "may be used uninitialized in
this function" warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_each_line, rb_str_lines): String#lines now
returns an array instead of an enumerator. Passing a block is
deprecated but still supported for backwards compatibility.
Based on the patch by yhara. [Feature #6670]
* string.c (rb_str_each_char, rb_str_chars): Ditto for
String#chars.
* string.c (rb_str_each_codepoint, rb_str_codepoints): Ditto for
String#codepoints.
* string.c (rb_str_each_byte, rb_str_bytes): Ditto for
String#bytes.
* NEWS: Add notes for the above changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
* compile.c (rb_insns_name): allowing DTrace probes to access
instruction sequence name.
* Makefile.in: translate probes.d file to appropriate header file.
* common.mk: declare dependencies on the DTrace header.
* configure.in: add a test for existence of DTrace.
* eval.c (setup_exception): add a probe for when an exception is
raised.
* gc.c: Add DTrace probes for mark begin and end, and sweep begin and
end.
* hash.c (empty_hash_alloc): Add a probe for hash allocation.
* insns.def: Add probes for function entry and return.
* internal.h: function declaration for compile.c change.
* load.c (rb_f_load): add probes for `load` entry and exit, require
entry and exit, and wrapping search_required for load path search.
* object.c (rb_obj_alloc): added a probe for general object creation.
* parse.y (yycompile0): added a probe around parse and compile phase.
* string.c (empty_str_alloc, str_new): DTrace probes for string
allocation.
* test/dtrace/*: tests for DTrace probes.
* vm.c (vm_invoke_proc): add probes for function return on exception
raise, hash create, and instruction sequence execution.
* vm_core.h: add probe declarations for function entry and exit.
* vm_dump.c: add probes header file.
* vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
function entry and return.
* vm_exec.c: expose instruction number to instruction name function.
* vm_insnshelper.c: add function entry and exit probes for cfunc
methods.
* vm_insnhelper.h: vm usage information is always collected, so
uncomment the functions.
12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org>
* configure.in (isinf, isnan): isinf() and isnan() are macros on
DragonFly which cannot be found by AC_REPLACE_FUNCS(). This
workaround enforces the fact that they exist on DragonFly.
12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
vm_insnhelper.c (vm_search_method): revert r37616 because it's too
slow. [ruby-dev:46477]
* test/ruby/test_refinement.rb (test_inline_method_cache): skip
the test until the bug is fixed efficiently.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
should close over the current refinements.
[ruby-dev:46345] [Bug #7261]
* vm_eval.c (rb_call0, rb_search_method_entry,
rb_funcall_passing_block_with_refinements): add a new argument
`refinements' for the above changes.
* test/ruby/test_refinement.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Clarify behavior for captured strings and local variable assignment
Patch by Marcus Stollsteimer [ruby-dev:47668] [Bug #7062]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c, vm_insnhelper.c, vm_method.c: use RB_TYPE_P() and
BUILTIN_TYPE() if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
replacement operation. Minor cleanup of markup. [Bug #6719]
* string.c (rb_str_sub_bang): Minor wording change for clarity, minor
cleanup of markup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_new_frozen): since the result object should have
same tainted/untrusted bits with the original object, return new
object if the shared object unmatch. [ruby-core:39745][Bug #5374]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
index positioning. [Bug #6680]
* array.c (rb_ary_aset): ditto. Reordered sentences for clarity.
* string.c (rb_str_aref_m): Added a description of the behavior of
index positioning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
starting index is an index into the array or string. Updated
examples to show behavior of indexes at the end of an array or
string. Based on patch by Marcus Stollsteimer. [Bug #6680]
* array.c (rb_ary_aset): ditto.
* string.c (rb_str_aref): ditto. Also added descriptive argument
names to call-seq section.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_subpos): split from rb_str_substr. returns
adjusted position for substring.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_symname_p): new function that checks if the string
is valid as a symbol name. split from sym_inspect().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to match other String method examples. [ruby-trunk - Bug #6553]
* string.c (rb_str_end_with): Updated end_with? to use code markup
instead of italic.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the condition 'ptr_a8 && str_cr != ENC_CODERANGE_7BIT' means not
unknown, str is also ASCII-8BIT because str_encindex == ptr_encindex,
and nont (str_cr == ENC_CODERANGE_UNKNOWN) and
str_cr != ENC_CODERANGE_7BIT means str_cr is valid because ASCII-8BIT
can't be broken. [ruby-dev:45688] [Bug #6509]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ONIGERR_INVALID_CODE_POINT_VALUE if the code is invalid.
* enc/shift_jis.c (tr_next): increment character until the code
is a valid character. [ruby-dev:45652] [Bug #6450]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e