summaryrefslogtreecommitdiff
path: root/tool/test/webrick/test_httpstatus.rb
blob: fd0570d5c663a7c15f22725e72ba70b162ae5c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: false
require "test/unit"
require "webrick"

class TestWEBrickHTTPStatus < Test::Unit::TestCase
  def test_info?
    assert WEBrick::HTTPStatus.info?(100)
    refute WEBrick::HTTPStatus.info?(200)
  end

  def test_success?
    assert WEBrick::HTTPStatus.success?(200)
    refute WEBrick::HTTPStatus.success?(300)
  end

  def test_redirect?
    assert WEBrick::HTTPStatus.redirect?(300)
    refute WEBrick::HTTPStatus.redirect?(400)
  end

  def test_error?
    assert WEBrick::HTTPStatus.error?(400)
    refute WEBrick::HTTPStatus.error?(600)
  end

  def test_client_error?
    assert WEBrick::HTTPStatus.client_error?(400)
    refute WEBrick::HTTPStatus.client_error?(500)
  end

  def test_server_error?
    assert WEBrick::HTTPStatus.server_error?(500)
    refute WEBrick::HTTPStatus.server_error?(600)
  end
end
p;id2=6b24178534c6c321134246d864c1bdde55800fa5'>.gitignore58
-rw-r--r--.travis.yml50
-rw-r--r--BSDL2
-rw-r--r--CONTRIBUTING.md4
-rw-r--r--ChangeLog26004
-rw-r--r--KNOWNBUGS.rb6
-rw-r--r--LEGAL123
-rw-r--r--Makefile.in222
-rw-r--r--NEWS784
-rw-r--r--README153
-rw-r--r--README.EXT1465
-rw-r--r--README.EXT.ja1588
-rw-r--r--README.ja192
-rw-r--r--README.ja.md171
-rw-r--r--README.md164
-rw-r--r--aclocal.m446
-rw-r--r--addr2line.c887
-rw-r--r--addr2line.h2
-rw-r--r--array.c1774
-rw-r--r--bcc32/Makefile.sub617
-rw-r--r--bcc32/README.bcc32130
-rwxr-xr-xbcc32/configure.bat163
-rwxr-xr-xbcc32/mkexports.rb26
-rw-r--r--bcc32/setup.mak179
-rw-r--r--benchmark/bm_app_aobench.rb291
-rw-r--r--benchmark/bm_app_lc_fizzbuzz.rb52
-rw-r--r--benchmark/bm_array_shift.rb14
-rw-r--r--benchmark/bm_hash_aref_dsym.rb4
-rw-r--r--benchmark/bm_hash_aref_dsym_long.rb21
-rw-r--r--benchmark/bm_hash_aref_fix.rb4
-rw-r--r--benchmark/bm_hash_aref_flo.rb4
-rw-r--r--benchmark/bm_hash_aref_miss.rb5
-rw-r--r--benchmark/bm_hash_aref_str.rb4
-rw-r--r--benchmark/bm_hash_aref_sym.rb9
-rw-r--r--benchmark/bm_hash_aref_sym_long.rb13
-rw-r--r--benchmark/bm_hash_flatten.rb9
-rw-r--r--benchmark/bm_hash_ident_flo.rb4
-rw-r--r--benchmark/bm_hash_ident_num.rb4
-rw-r--r--benchmark/bm_hash_ident_obj.rb4
-rw-r--r--benchmark/bm_hash_ident_str.rb4
-rw-r--r--benchmark/bm_hash_ident_sym.rb4
-rw-r--r--benchmark/bm_hash_keys.rb9
-rw-r--r--benchmark/bm_hash_shift.rb10
-rw-r--r--benchmark/bm_hash_shift_u16.rb10
-rw-r--r--benchmark/bm_hash_shift_u24.rb10
-rw-r--r--benchmark/bm_hash_shift_u32.rb10
-rw-r--r--benchmark/bm_hash_to_proc.rb9
-rw-r--r--benchmark/bm_hash_values.rb9
-rw-r--r--benchmark/bm_io_nonblock_noex.rb22
-rw-r--r--benchmark/bm_io_nonblock_noex2.rb21
-rw-r--r--benchmark/bm_marshal_dump_flo.rb2
-rw-r--r--benchmark/bm_marshal_dump_load_geniv.rb10
-rw-r--r--benchmark/bm_marshal_dump_load_time.rb1
-rw-r--r--benchmark/bm_require.rb7
-rw-r--r--benchmark/bm_require_thread.rb15
-rw-r--r--benchmark/bm_securerandom.rb5
-rw-r--r--benchmark/bm_so_binary_trees.rb9
-rw-r--r--benchmark/bm_so_meteor_contest.rb14
-rw-r--r--benchmark/bm_vm1_gc_short_lived.rb10
-rw-r--r--benchmark/bm_vm1_gc_short_with_complex_long.rb27
-rw-r--r--benchmark/bm_vm1_gc_short_with_long.rb13
-rw-r--r--benchmark/bm_vm1_gc_short_with_symbol.rb15
-rw-r--r--benchmark/bm_vm1_gc_wb_ary.rb12
-rw-r--r--benchmark/bm_vm1_gc_wb_ary_promoted.rb14
-rw-r--r--benchmark/bm_vm1_gc_wb_obj.rb15
-rw-r--r--benchmark/bm_vm1_gc_wb_obj_promoted.rb17
-rw-r--r--benchmark/bm_vm2_case_lit.rb19
-rw-r--r--benchmark/bm_vm2_newlambda.rb5
-rw-r--r--benchmark/bm_vm2_string_literal.rb5
-rw-r--r--benchmark/bm_vm2_struct_big_aref_hi.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_aref_lo.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_aset.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_href_hi.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_href_lo.rb7
-rw-r--r--benchmark/bm_vm2_struct_big_hset.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aref.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aset.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_href.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_hset.rb7
-rwxr-xr-x[-rw-r--r--]benchmark/bm_vm3_gc.rb1
-rw-r--r--benchmark/bm_vm_symbol_block_pass.rb13
-rw-r--r--benchmark/bm_vm_thread_close.rb6
-rw-r--r--benchmark/bm_vm_thread_pipe.rb2
-rw-r--r--benchmark/bm_vm_thread_queue.rb18
-rw-r--r--benchmark/driver.rb121
-rw-r--r--benchmark/gc/aobench.rb1
-rw-r--r--benchmark/gc/binary_trees.rb1
-rw-r--r--benchmark/gc/gcbench.rb56
-rw-r--r--benchmark/gc/hash1.rb11
-rw-r--r--benchmark/gc/hash2.rb7
-rw-r--r--benchmark/gc/null.rb1
-rw-r--r--benchmark/gc/pentomino.rb1
-rw-r--r--benchmark/gc/rdoc.rb13
-rw-r--r--benchmark/gc/redblack.rb366
-rw-r--r--benchmark/gc/ring.rb29
-rw-r--r--benchmark/prepare_require.rb25
-rw-r--r--benchmark/prepare_require_thread.rb2
-rw-r--r--benchmark/prepare_so_k_nucleotide.rb2
-rw-r--r--benchmark/prepare_so_reverse_complement.rb2
-rw-r--r--bignum.c7284
-rwxr-xr-xbin/erb34
-rwxr-xr-xbin/irb11
-rwxr-xr-xbin/rake37
-rwxr-xr-xbin/testrb3
-rwxr-xr-xbootstraptest/runner.rb71
-rw-r--r--bootstraptest/test_autoload.rb40
-rw-r--r--bootstraptest/test_block.rb14
-rw-r--r--bootstraptest/test_class.rb10
-rw-r--r--bootstraptest/test_fork.rb30
-rw-r--r--bootstraptest/test_io.rb14
-rw-r--r--bootstraptest/test_literal.rb7
-rw-r--r--bootstraptest/test_literal_suffix.rb54
-rw-r--r--bootstraptest/test_method.rb80
-rw-r--r--bootstraptest/test_string.rb3
-rw-r--r--bootstraptest/test_syntax.rb2
-rw-r--r--bootstraptest/test_thread.rb74
-rw-r--r--ccan/build_assert/build_assert.h40
-rw-r--r--ccan/check_type/check_type.h63
-rw-r--r--ccan/container_of/container_of.h142
-rw-r--r--ccan/licenses/BSD-MIT17
-rw-r--r--ccan/licenses/CC028
-rw-r--r--ccan/list/list.h773
-rw-r--r--ccan/str/str.h16
-rw-r--r--class.c908
-rw-r--r--common.mk2140
-rw-r--r--compar.c52
-rw-r--r--compile.c5296
-rw-r--r--complex.c380
-rw-r--r--configure.in2473
-rw-r--r--constant.h24
-rw-r--r--cont.c762
-rw-r--r--coverage/README17
-rw-r--r--cygwin/GNUmakefile.in16
-rw-r--r--debug.c58
-rw-r--r--defs/default_gems5
-rw-r--r--defs/gmake.mk78
-rw-r--r--defs/id.def91
-rw-r--r--defs/keywords6
-rw-r--r--defs/known_errors.def3
-rw-r--r--defs/lex.c.src6
-rw-r--r--defs/opt_operand.def2
-rw-r--r--dir.c1135
-rw-r--r--dln.c159
-rw-r--r--dln.h19
-rw-r--r--dln_find.c61
-rw-r--r--dmyenc.c10
-rw-r--r--dmyencoding.c2
-rw-r--r--dmyext.c5
-rw-r--r--dmyversion.c2
-rw-r--r--doc/ChangeLog-0.06_to_0.521147
-rw-r--r--doc/ChangeLog-0.50_to_0.60462
-rw-r--r--doc/ChangeLog-0.60_to_1.13955
-rw-r--r--doc/ChangeLog-1.8.0158
-rw-r--r--doc/ChangeLog-1.9.344
-rw-r--r--doc/ChangeLog-2.0.024015
-rw-r--r--doc/ChangeLog-2.1.018060
-rw-r--r--doc/ChangeLog-2.2.012157
-rw-r--r--doc/ChangeLog-YARV188
-rw-r--r--doc/NEWS-1.8.725
-rw-r--r--doc/NEWS-1.9.131
-rw-r--r--doc/NEWS-1.9.247
-rw-r--r--doc/NEWS-1.9.352
-rw-r--r--doc/NEWS-2.0.0531
-rw-r--r--doc/NEWS-2.1.0376
-rw-r--r--doc/NEWS-2.2.0361
-rw-r--r--doc/contributing.rdoc468
-rw-r--r--doc/contributors.rdoc778
-rw-r--r--doc/dtrace_probes.rdoc178
-rw-r--r--doc/etc.rd.ja4
-rw-r--r--doc/extension.ja.rdoc1799
-rw-r--r--doc/extension.rdoc1829
-rw-r--r--doc/forwardable.rd.ja6
-rw-r--r--doc/globals.rdoc21
-rw-r--r--doc/irb/irb-tools.rd.ja10
-rw-r--r--doc/irb/irb.rd.ja52
-rw-r--r--doc/keywords.rdoc158
-rw-r--r--doc/maintainers.rdoc320
-rw-r--r--doc/marshal.rdoc313
-rw-r--r--doc/pty/README84
-rw-r--r--doc/pty/README.expect22
-rw-r--r--doc/pty/README.ja2
-rw-r--r--doc/rake/CHANGES440
-rw-r--r--doc/rake/README196
-rw-r--r--doc/rake/command_line_usage.rdoc169
-rw-r--r--doc/rake/example/Rakefile138
-rw-r--r--doc/rake/example/Rakefile235
-rw-r--r--doc/rake/example/a.c6
-rw-r--r--doc/rake/example/b.c6
-rw-r--r--doc/rake/example/main.c11
-rw-r--r--doc/rake/glossary.rdoc51
-rw-r--r--doc/rake/jamis.rb591
-rw-r--r--doc/rake/proto_rake.rdoc127
-rw-r--r--doc/rake/rakefile.rdoc557
-rw-r--r--doc/rake/rational.rdoc151
-rw-r--r--doc/rake/release_notes/rake-0.8.7.rdoc55
-rw-r--r--doc/rake/release_notes/rake-0.9.0.rdoc112
-rw-r--r--doc/rake/release_notes/rake-0.9.1.rdoc52
-rw-r--r--doc/rake/release_notes/rake-0.9.2.2.rdoc55
-rw-r--r--doc/rake/release_notes/rake-0.9.2.rdoc49
-rw-r--r--doc/rake/release_notes/rake-0.9.3.rdoc102
-rw-r--r--doc/rake/release_notes/rake-0.9.4.rdoc110
-rw-r--r--doc/rake/release_notes/rake-0.9.5.rdoc114
-rw-r--r--doc/rake/release_notes/rake-0.9.6.rdoc127
-rw-r--r--doc/re.rdoc653
-rw-r--r--doc/regexp.rdoc691
-rw-r--r--doc/rubygems/ChangeLog5689
-rw-r--r--doc/rubygems/History.txt852
-rw-r--r--doc/rubygems/LICENSE.txt53
-rw-r--r--doc/rubygems/README41
-rw-r--r--doc/security.rdoc152
-rw-r--r--doc/shell.rd.ja8
-rw-r--r--doc/standard_library.rdoc115
-rw-r--r--doc/syntax.rdoc27
-rw-r--r--doc/syntax/assignment.rdoc454
-rw-r--r--doc/syntax/calling_methods.rdoc352
-rw-r--r--doc/syntax/control_expressions.rdoc499
-rw-r--r--doc/syntax/exceptions.rdoc24
-rw-r--r--doc/syntax/literals.rdoc97
-rw-r--r--doc/syntax/methods.rdoc268
-rw-r--r--doc/syntax/miscellaneous.rdoc106
-rw-r--r--doc/syntax/modules_and_classes.rdoc20
-rw-r--r--doc/syntax/precedence.rdoc60
-rw-r--r--doc/syntax/refinements.rdoc262
-rw-r--r--enc/Makefile.in7
-rw-r--r--enc/ascii.c6
-rw-r--r--enc/big5.c6
-rw-r--r--enc/depend469
-rw-r--r--enc/ebcdic.h11
-rw-r--r--enc/encdb.c11
-rw-r--r--enc/encinit.c.erb17
-rw-r--r--enc/euc_jp.c57
-rw-r--r--enc/iso_2022_jp.h2
-rw-r--r--enc/iso_8859_1.c12
-rw-r--r--enc/iso_8859_10.c4
-rw-r--r--enc/iso_8859_13.c8
-rw-r--r--enc/iso_8859_14.c4
-rw-r--r--enc/iso_8859_15.c4
-rw-r--r--enc/iso_8859_16.c4
-rw-r--r--enc/iso_8859_2.c12
-rw-r--r--enc/iso_8859_3.c4
-rw-r--r--enc/iso_8859_4.c5
-rw-r--r--enc/iso_8859_5.c4
-rw-r--r--enc/iso_8859_7.c4
-rw-r--r--enc/iso_8859_9.c4
-rw-r--r--enc/jis/props.h227
-rw-r--r--enc/jis/props.h.blt227
-rw-r--r--enc/jis/props.kwd52
-rw-r--r--enc/jis/props.src52
-rw-r--r--enc/koi8_r.c4
-rw-r--r--enc/koi8_u.c4
-rwxr-xr-xenc/make_encmake.rb25
-rw-r--r--enc/prelude.rb8
-rw-r--r--enc/shift_jis.c49
-rw-r--r--enc/trans/JIS/JISX0201-KANA%UCS.src51
-rw-r--r--enc/trans/JIS/JISX0208@1990%UCS.src54
-rw-r--r--enc/trans/JIS/JISX0212%UCS.src62
-rw-r--r--enc/trans/JIS/UCS%JISX0201-KANA.src52
-rw-r--r--enc/trans/JIS/UCS%JISX0208@1990.src53
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src61
-rw-r--r--enc/trans/ebcdic.trans278
-rw-r--r--enc/trans/escape.trans6
-rw-r--r--enc/trans/euckr-tbl.rb2
-rw-r--r--enc/trans/gb18030.trans8
-rw-r--r--enc/trans/japanese_euc.trans4
-rw-r--r--enc/trans/utf8_mac-tbl.rb23655
-rw-r--r--enc/trans/utf8_mac.trans157
-rw-r--r--enc/unicode.c193
-rwxr-xr-xenc/unicode/case-folding.rb196
-rw-r--r--enc/unicode/casefold.h8460
-rw-r--r--enc/unicode/name2ctype.h11629
-rw-r--r--enc/unicode/name2ctype.h.blt9915
-rw-r--r--enc/us_ascii.c12
-rw-r--r--enc/utf_16_32.h4
-rw-r--r--enc/utf_16be.c6
-rw-r--r--enc/utf_16le.c6
-rw-r--r--enc/utf_7.h2
-rw-r--r--enc/utf_8.c31
-rw-r--r--enc/windows_1250.c220
-rw-r--r--enc/windows_1251.c4
-rw-r--r--enc/windows_1252.c211
-rw-r--r--encindex.h67
-rw-r--r--encoding.c480
-rw-r--r--enum.c1485
-rw-r--r--enumerator.c791
-rw-r--r--error.c711
-rw-r--r--eval.c690
-rw-r--r--eval_error.c154
-rw-r--r--eval_intern.h205
-rw-r--r--eval_jump.c63
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/bignum/big2str.c53
-rw-r--r--ext/-test-/bignum/bigzero.c26
-rw-r--r--ext/-test-/bignum/depend102
-rw-r--r--ext/-test-/bignum/div.c35
-rw-r--r--ext/-test-/bignum/extconf.rb8
-rw-r--r--ext/-test-/bignum/init.c11
-rw-r--r--ext/-test-/bignum/intpack.c87
-rw-r--r--ext/-test-/bignum/mul.c65
-rw-r--r--ext/-test-/bignum/str2big.c38
-rw-r--r--ext/-test-/bug-3571/bug.c2
-rw-r--r--ext/-test-/bug-3571/extconf.rb1
-rw-r--r--ext/-test-/bug-3662/bug.c16
-rw-r--r--ext/-test-/bug-3662/extconf.rb1
-rw-r--r--ext/-test-/bug-5832/extconf.rb1
-rw-r--r--ext/-test-/bug_reporter/bug_reporter.c24
-rw-r--r--ext/-test-/bug_reporter/extconf.rb2
-rw-r--r--ext/-test-/class/class2name.c14
-rw-r--r--ext/-test-/class/extconf.rb8
-rw-r--r--ext/-test-/class/init.c11
-rw-r--r--ext/-test-/debug/depend32
-rw-r--r--ext/-test-/debug/extconf.rb7
-rw-r--r--ext/-test-/debug/init.c11
-rw-r--r--ext/-test-/debug/inspector.c32
-rw-r--r--ext/-test-/debug/profile_frames.c43
-rw-r--r--ext/-test-/dln/empty/empty.c4
-rw-r--r--ext/-test-/dln/empty/extconf.rb2
-rw-r--r--ext/-test-/exception/dataerror.c31
-rw-r--r--ext/-test-/exception/depend43
-rw-r--r--ext/-test-/exception/ensured.c25
-rw-r--r--ext/-test-/exception/extconf.rb1
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/file/depend36
-rw-r--r--ext/-test-/file/extconf.rb23
-rw-r--r--ext/-test-/file/fs.c108
-rw-r--r--ext/-test-/file/init.c11
-rw-r--r--ext/-test-/file/stat.c27
-rw-r--r--ext/-test-/float/depend3
-rw-r--r--ext/-test-/float/extconf.rb8
-rw-r--r--ext/-test-/float/init.c11
-rw-r--r--ext/-test-/float/nextafter.c36
-rw-r--r--ext/-test-/funcall/extconf.rb1
-rw-r--r--ext/-test-/gvl/call_without_gvl/call_without_gvl.c34
-rw-r--r--ext/-test-/gvl/call_without_gvl/extconf.rb2
-rw-r--r--ext/-test-/hash/delete.c16
-rw-r--r--ext/-test-/hash/extconf.rb8
-rw-r--r--ext/-test-/hash/init.c11
-rw-r--r--ext/-test-/iseq_load/extconf.rb2
-rw-r--r--ext/-test-/iseq_load/iseq_load.c21
-rw-r--r--ext/-test-/iter/break.c15
-rw-r--r--ext/-test-/iter/extconf.rb9
-rw-r--r--ext/-test-/iter/init.c11
-rw-r--r--ext/-test-/iter/yield.c16
-rw-r--r--ext/-test-/load/dot.dot/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/extconf.rb1
-rw-r--r--ext/-test-/marshal/internal_ivar/extconf.rb2
-rw-r--r--ext/-test-/marshal/internal_ivar/internal_ivar.c39
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/marshal/usr/usrmarshal.c21
-rw-r--r--ext/-test-/method/arity.c22
-rw-r--r--ext/-test-/method/extconf.rb7
-rw-r--r--ext/-test-/method/init.c11
-rw-r--r--ext/-test-/notimplement/bug.c16
-rw-r--r--ext/-test-/notimplement/extconf.rb2
-rw-r--r--ext/-test-/num2int/depend1
-rw-r--r--ext/-test-/num2int/extconf.rb1
-rw-r--r--ext/-test-/num2int/num2int.c130
-rw-r--r--ext/-test-/old_thread_select/depend2
-rw-r--r--ext/-test-/old_thread_select/extconf.rb4
-rw-r--r--ext/-test-/old_thread_select/old_thread_select.c75
-rw-r--r--ext/-test-/path_to_class/extconf.rb1
-rw-r--r--ext/-test-/popen_deadlock/extconf.rb5
-rw-r--r--ext/-test-/popen_deadlock/infinite_loop_dlsym.c50
-rw-r--r--ext/-test-/postponed_job/depend1
-rw-r--r--ext/-test-/postponed_job/extconf.rb2
-rw-r--r--ext/-test-/postponed_job/postponed_job.c53
-rw-r--r--ext/-test-/printf/depend3
-rw-r--r--ext/-test-/printf/extconf.rb1
-rw-r--r--ext/-test-/printf/printf.c88
-rw-r--r--ext/-test-/proc/extconf.rb8
-rw-r--r--ext/-test-/proc/init.c11
-rw-r--r--ext/-test-/proc/receiver.c21
-rw-r--r--ext/-test-/proc/super.c27
-rw-r--r--ext/-test-/rational/depend20
-rw-r--r--ext/-test-/rational/extconf.rb8
-rw-r--r--ext/-test-/rational/rat.c37
-rw-r--r--ext/-test-/recursion/extconf.rb3
-rw-r--r--ext/-test-/recursion/recursion.c28
-rw-r--r--ext/-test-/st/foreach/extconf.rb2
-rw-r--r--ext/-test-/st/foreach/foreach.c175
-rw-r--r--ext/-test-/st/numhash/extconf.rb1
-rw-r--r--ext/-test-/st/numhash/numhash.c34
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/string/coderange.c21
-rw-r--r--ext/-test-/string/cstr.c111
-rw-r--r--ext/-test-/string/depend115
-rw-r--r--ext/-test-/string/enc_associate.c8
-rw-r--r--ext/-test-/string/extconf.rb4
-rw-r--r--ext/-test-/string/fstring.c15
-rw-r--r--ext/-test-/string/nofree.c13
-rw-r--r--ext/-test-/string/normalize.c17
-rw-r--r--ext/-test-/struct/duplicate.c24
-rw-r--r--ext/-test-/struct/extconf.rb8
-rw-r--r--ext/-test-/struct/init.c11
-rw-r--r--ext/-test-/struct/member.c18
-rw-r--r--ext/-test-/symbol/extconf.rb4
-rw-r--r--ext/-test-/symbol/init.c14
-rw-r--r--ext/-test-/symbol/intern.c14
-rw-r--r--ext/-test-/symbol/type.c78
-rw-r--r--ext/-test-/time/extconf.rb8
-rw-r--r--ext/-test-/time/init.c11
-rw-r--r--ext/-test-/time/new.c34
-rw-r--r--ext/-test-/tracepoint/depend22
-rw-r--r--ext/-test-/tracepoint/extconf.rb2
-rw-r--r--ext/-test-/tracepoint/gc_hook.c80
-rw-r--r--ext/-test-/tracepoint/tracepoint.c96
-rw-r--r--ext/-test-/typeddata/extconf.rb1
-rw-r--r--ext/-test-/vm/at_exit.c44
-rw-r--r--ext/-test-/vm/extconf.rb1
-rw-r--r--ext/-test-/wait_for_single_fd/depend16
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb1
-rw-r--r--ext/-test-/win32/console/attribute.c56
-rw-r--r--ext/-test-/win32/console/depend1
-rw-r--r--ext/-test-/win32/console/extconf.rb9
-rw-r--r--ext/-test-/win32/console/init.c11
-rw-r--r--ext/-test-/win32/dln/depend9
-rw-r--r--ext/-test-/win32/dln/extconf.rb41
-rw-r--r--ext/-test-/win32/dln/libdlntest.c2
-rw-r--r--ext/-test-/win32/fd_setsize/depend3
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb1
-rw-r--r--ext/.document8
-rw-r--r--ext/Setup24
-rw-r--r--ext/Setup.atheos3
-rw-r--r--ext/Setup.emx31
-rw-r--r--ext/Setup.nacl7
-rw-r--r--ext/Setup.nt4
-rw-r--r--ext/bigdecimal/README60
-rw-r--r--ext/bigdecimal/bigdecimal.c4050
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec11
-rw-r--r--ext/bigdecimal/bigdecimal.h67
-rw-r--r--ext/bigdecimal/depend14
-rw-r--r--ext/bigdecimal/extconf.rb5
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb4
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb91
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb4
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb37
-rw-r--r--ext/bigdecimal/sample/linear.rb22
-rw-r--r--ext/bigdecimal/sample/nlsolve.rb24
-rw-r--r--ext/bigdecimal/sample/pi.rb1
-rw-r--r--ext/cgi/escape/escape.c105
-rw-r--r--ext/cgi/escape/extconf.rb3
-rw-r--r--ext/continuation/continuation.c5
-rw-r--r--ext/continuation/extconf.rb1
-rw-r--r--ext/coverage/coverage.c44
-rw-r--r--ext/coverage/depend41
-rw-r--r--ext/coverage/extconf.rb2
-rw-r--r--ext/curses/curses.c4329
-rw-r--r--ext/curses/depend1
-rw-r--r--ext/curses/extconf.rb116
-rw-r--r--ext/curses/hello.rb30
-rw-r--r--ext/curses/mouse.rb53
-rw-r--r--ext/curses/rain.rb76
-rw-r--r--ext/curses/view.rb91
-rw-r--r--ext/curses/view2.rb149
-rw-r--r--ext/date/date_core.c728
-rw-r--r--ext/date/date_parse.c44
-rw-r--r--ext/date/date_strftime.c13
-rw-r--r--ext/date/date_strptime.c18
-rw-r--r--ext/date/depend52
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--ext/date/lib/date.rb18
-rw-r--r--ext/date/lib/date/format.rb1
-rw-r--r--ext/dbm/dbm.c76
-rw-r--r--ext/dbm/depend1
-rw-r--r--ext/dbm/extconf.rb36
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c36
-rw-r--r--ext/digest/bubblebabble/depend16
-rw-r--r--ext/digest/bubblebabble/extconf.rb2
-rw-r--r--ext/digest/depend15
-rw-r--r--ext/digest/digest.c104
-rw-r--r--ext/digest/digest.h25
-rw-r--r--ext/digest/digest_conf.rb30
-rw-r--r--ext/digest/extconf.rb1
-rw-r--r--ext/digest/lib/digest.rb35
-rw-r--r--ext/digest/lib/digest/hmac.rb302
-rw-r--r--ext/digest/md5/depend22
-rw-r--r--ext/digest/md5/extconf.rb15
-rw-r--r--ext/digest/md5/md5.c12
-rw-r--r--ext/digest/md5/md5.h6
-rw-r--r--ext/digest/md5/md5cc.h12
-rw-r--r--ext/digest/md5/md5init.c15
-rw-r--r--ext/digest/md5/md5ossl.c9
-rw-r--r--ext/digest/md5/md5ossl.h4
-rw-r--r--ext/digest/rmd160/depend34
-rw-r--r--ext/digest/rmd160/extconf.rb14
-rw-r--r--ext/digest/rmd160/rmd160.c6
-rw-r--r--ext/digest/rmd160/rmd160.h6
-rw-r--r--ext/digest/rmd160/rmd160init.c13
-rw-r--r--ext/digest/rmd160/rmd160ossl.c8
-rw-r--r--ext/digest/rmd160/rmd160ossl.h3
-rw-r--r--ext/digest/sha1/depend34
-rw-r--r--ext/digest/sha1/extconf.rb14
-rw-r--r--ext/digest/sha1/sha1.c6
-rw-r--r--ext/digest/sha1/sha1.h6
-rw-r--r--ext/digest/sha1/sha1cc.h14
-rw-r--r--ext/digest/sha1/sha1init.c15
-rw-r--r--ext/digest/sha1/sha1ossl.c10
-rw-r--r--ext/digest/sha1/sha1ossl.h4
-rw-r--r--ext/digest/sha2/depend34
-rw-r--r--ext/digest/sha2/extconf.rb20
-rw-r--r--ext/digest/sha2/lib/sha2.rb1
-rw-r--r--ext/digest/sha2/sha2.c37
-rw-r--r--ext/digest/sha2/sha2.h30
-rw-r--r--ext/digest/sha2/sha2cc.h31
-rw-r--r--ext/digest/sha2/sha2init.c13
-rw-r--r--ext/digest/sha2/sha2ossl.c13
-rw-r--r--ext/digest/sha2/sha2ossl.h16
-rw-r--r--ext/dl/callback/depend15
-rw-r--r--ext/dl/callback/extconf.rb14
-rw-r--r--ext/dl/callback/mkcallback.rb242
-rw-r--r--ext/dl/cfunc.c675
-rw-r--r--ext/dl/cptr.c673
-rw-r--r--ext/dl/depend7
-rw-r--r--ext/dl/dl.c573
-rw-r--r--ext/dl/dl.h217
-rw-r--r--ext/dl/extconf.rb43
-rw-r--r--ext/dl/handle.c430
-rw-r--r--ext/dl/lib/dl.rb15
-rw-r--r--ext/dl/lib/dl/callback.rb112
-rw-r--r--ext/dl/lib/dl/cparser.rb156
-rw-r--r--ext/dl/lib/dl/func.rb248
-rw-r--r--ext/dl/lib/dl/import.rb268
-rw-r--r--ext/dl/lib/dl/pack.rb128
-rw-r--r--ext/dl/lib/dl/stack.rb116
-rw-r--r--ext/dl/lib/dl/struct.rb236
-rw-r--r--ext/dl/lib/dl/types.rb71
-rw-r--r--ext/dl/lib/dl/value.rb114
-rw-r--r--ext/dl/win32/extconf.rb3
-rw-r--r--ext/dl/win32/lib/Win32API.rb31
-rw-r--r--ext/dl/win32/lib/win32/registry.rb845
-rw-r--r--ext/dl/win32/lib/win32/resolv.rb379
-rw-r--r--ext/dl/win32/lib/win32/sspi.rb330
-rw-r--r--ext/etc/depend10
-rw-r--r--ext/etc/etc.c556
-rw-r--r--ext/etc/extconf.rb60
-rw-r--r--ext/etc/mkconstants.rb332
-rwxr-xr-xext/extmk.rb180
-rw-r--r--ext/fcntl/depend1
-rw-r--r--ext/fcntl/extconf.rb1
-rw-r--r--ext/fcntl/fcntl.c190
-rw-r--r--ext/fiber/extconf.rb1
-rw-r--r--ext/fiddle/closure.c121
-rw-r--r--ext/fiddle/closure.h2
-rw-r--r--ext/fiddle/conversions.h4
-rw-r--r--ext/fiddle/depend57
-rw-r--r--ext/fiddle/extconf.rb146
-rw-r--r--ext/fiddle/extlibs2
-rw-r--r--ext/fiddle/fiddle.c10
-rw-r--r--ext/fiddle/fiddle.h5
-rw-r--r--ext/fiddle/function.c160
-rw-r--r--ext/fiddle/function.h2
-rw-r--r--ext/fiddle/handle.c40
-rw-r--r--ext/fiddle/lib/fiddle.rb10
-rw-r--r--ext/fiddle/lib/fiddle/closure.rb1
-rw-r--r--ext/fiddle/lib/fiddle/cparser.rb158
-rw-r--r--ext/fiddle/lib/fiddle/function.rb1
-rw-r--r--ext/fiddle/lib/fiddle/import.rb5
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb1
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb1
-rw-r--r--ext/fiddle/lib/fiddle/types.rb1
-rw-r--r--ext/fiddle/lib/fiddle/value.rb1
-rw-r--r--ext/fiddle/pointer.c21
-rw-r--r--ext/fiddle/win32/extconf.rb3
-rwxr-xr-xext/fiddle/win32/fficonfig.h29
-rw-r--r--ext/fiddle/win32/lib/win32/registry.rb845
-rw-r--r--ext/fiddle/win32/lib/win32/resolv.rb379
-rw-r--r--ext/fiddle/win32/libffi-3.2.1-mswin.patch191
-rwxr-xr-xext/fiddle/win32/libffi-config.rb48
-rwxr-xr-xext/fiddle/win32/libffi.mk.tmpl96
-rw-r--r--ext/gdbm/depend1
-rw-r--r--ext/gdbm/extconf.rb12
-rw-r--r--ext/gdbm/gdbm.c56
-rwxr-xr-xext/io/console/buildgem.sh5
-rw-r--r--ext/io/console/console.c331
-rw-r--r--ext/io/console/depend25
-rw-r--r--ext/io/console/extconf.rb17
-rw-r--r--ext/io/console/io-console.gemspec13
-rw-r--r--ext/io/console/lib/console/size.rb3
-rw-r--r--ext/io/console/win32_vk.chksum1
-rw-r--r--ext/io/console/win32_vk.inc1400
-rw-r--r--ext/io/console/win32_vk.list166
-rw-r--r--ext/io/nonblock/depend4
-rw-r--r--ext/io/nonblock/extconf.rb1
-rw-r--r--ext/io/nonblock/nonblock.c46
-rw-r--r--ext/io/wait/depend4
-rw-r--r--ext/io/wait/extconf.rb1
-rw-r--r--ext/io/wait/wait.c92
-rw-r--r--ext/json/extconf.rb1
-rw-r--r--ext/json/fbuffer/fbuffer.h19
-rw-r--r--ext/json/generator/depend20
-rw-r--r--ext/json/generator/extconf.rb1
-rw-r--r--ext/json/generator/generator.c153
-rw-r--r--ext/json/generator/generator.h37
-rw-r--r--ext/json/json.gemspec7
-rw-r--r--ext/json/lib/json.rb5
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb8
-rw-r--r--ext/json/lib/json/add/complex.rb7
-rw-r--r--ext/json/lib/json/add/core.rb1
-rw-r--r--ext/json/lib/json/add/date.rb2
-rw-r--r--ext/json/lib/json/add/date_time.rb2
-rw-r--r--ext/json/lib/json/add/exception.rb2
-rw-r--r--ext/json/lib/json/add/ostruct.rb2
-rw-r--r--ext/json/lib/json/add/range.rb2
-rw-r--r--ext/json/lib/json/add/rational.rb6
-rw-r--r--ext/json/lib/json/add/regexp.rb2
-rw-r--r--ext/json/lib/json/add/struct.rb2
-rw-r--r--ext/json/lib/json/add/symbol.rb2
-rw-r--r--ext/json/lib/json/add/time.rb4
-rw-r--r--ext/json/lib/json/common.rb41
-rw-r--r--ext/json/lib/json/ext.rb1
-rw-r--r--ext/json/lib/json/generic_object.rb40
-rw-r--r--ext/json/lib/json/version.rb3
-rw-r--r--ext/json/parser/depend19
-rw-r--r--ext/json/parser/extconf.rb3
-rw-r--r--ext/json/parser/parser.c368
-rw-r--r--ext/json/parser/parser.h23
-rw-r--r--ext/json/parser/parser.rl140
-rw-r--r--ext/json/parser/prereq.mk3
-rw-r--r--ext/mathn/complex/extconf.rb1
-rw-r--r--ext/mathn/rational/extconf.rb1
-rw-r--r--ext/nkf/depend26
-rw-r--r--ext/nkf/extconf.rb1
-rw-r--r--ext/nkf/lib/kconv.rb1
-rw-r--r--ext/nkf/nkf-utf8/nkf.c45
-rw-r--r--ext/nkf/nkf-utf8/nkf.h4
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c3
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h3
-rw-r--r--ext/nkf/nkf.c2
-rw-r--r--ext/objspace/depend69
-rw-r--r--ext/objspace/extconf.rb2
-rw-r--r--ext/objspace/object_tracing.c492
-rw-r--r--ext/objspace/objspace.c649
-rw-r--r--ext/objspace/objspace.h20
-rw-r--r--ext/objspace/objspace_dump.c479
-rw-r--r--ext/openssl/depend1091
-rw-r--r--ext/openssl/deprecation.rb1
-rw-r--r--ext/openssl/extconf.rb20
-rw-r--r--ext/openssl/lib/openssl.rb9
-rw-r--r--ext/openssl/lib/openssl/bn.rb22
-rw-r--r--ext/openssl/lib/openssl/buffering.rb46
-rw-r--r--ext/openssl/lib/openssl/cipher.rb10
-rw-r--r--ext/openssl/lib/openssl/config.rb172
-rw-r--r--ext/openssl/lib/openssl/digest.rb40
-rw-r--r--ext/openssl/lib/openssl/pkey.rb37
-rw-r--r--ext/openssl/lib/openssl/ssl.rb297
-rw-r--r--ext/openssl/lib/openssl/x509.rb32
-rw-r--r--ext/openssl/openssl_missing.c22
-rw-r--r--ext/openssl/openssl_missing.h13
-rw-r--r--ext/openssl/ossl.c221
-rw-r--r--ext/openssl/ossl.h26
-rw-r--r--ext/openssl/ossl_asn1.c82
-rw-r--r--ext/openssl/ossl_asn1.h3
-rw-r--r--ext/openssl/ossl_bio.c8
-rw-r--r--ext/openssl/ossl_bio.h4
-rw-r--r--ext/openssl/ossl_bn.c472
-rw-r--r--ext/openssl/ossl_bn.h4
-rw-r--r--ext/openssl/ossl_cipher.c93
-rw-r--r--ext/openssl/ossl_cipher.h4
-rw-r--r--ext/openssl/ossl_config.c25
-rw-r--r--ext/openssl/ossl_config.h5
-rw-r--r--ext/openssl/ossl_digest.c31
-rw-r--r--ext/openssl/ossl_digest.h4
-rw-r--r--ext/openssl/ossl_engine.c213
-rw-r--r--ext/openssl/ossl_engine.h3
-rw-r--r--ext/openssl/ossl_hmac.c123
-rw-r--r--ext/openssl/ossl_hmac.h3
-rw-r--r--ext/openssl/ossl_ns_spki.c32
-rw-r--r--ext/openssl/ossl_ns_spki.h4
-rw-r--r--ext/openssl/ossl_ocsp.c639
-rw-r--r--ext/openssl/ossl_ocsp.h3
-rw-r--r--ext/openssl/ossl_pkcs12.c40
-rw-r--r--ext/openssl/ossl_pkcs12.h4
-rw-r--r--ext/openssl/ossl_pkcs5.c3
-rw-r--r--ext/openssl/ossl_pkcs7.c127
-rw-r--r--ext/openssl/ossl_pkcs7.h4
-rw-r--r--ext/openssl/ossl_pkey.c41
-rw-r--r--ext/openssl/ossl_pkey.h14
-rw-r--r--ext/openssl/ossl_pkey_dh.c92
-rw-r--r--ext/openssl/ossl_pkey_dsa.c26
-rw-r--r--ext/openssl/ossl_pkey_ec.c84
-rw-r--r--ext/openssl/ossl_pkey_rsa.c37
-rw-r--r--ext/openssl/ossl_rand.c108
-rw-r--r--ext/openssl/ossl_rand.h4
-rw-r--r--ext/openssl/ossl_ssl.c734
-rw-r--r--ext/openssl/ossl_ssl.h14
-rw-r--r--ext/openssl/ossl_ssl_session.c37
-rw-r--r--ext/openssl/ossl_version.h3
-rw-r--r--ext/openssl/ossl_x509.c6
-rw-r--r--ext/openssl/ossl_x509.h5
-rw-r--r--ext/openssl/ossl_x509attr.c57
-rw-r--r--ext/openssl/ossl_x509cert.c82
-rw-r--r--ext/openssl/ossl_x509crl.c52
-rw-r--r--ext/openssl/ossl_x509ext.c112
-rw-r--r--ext/openssl/ossl_x509name.c42
-rw-r--r--ext/openssl/ossl_x509req.c44
-rw-r--r--ext/openssl/ossl_x509revoked.c44
-rw-r--r--ext/openssl/ossl_x509store.c74
-rw-r--r--ext/openssl/ruby_missing.h3
-rw-r--r--ext/pathname/depend3
-rw-r--r--ext/pathname/extconf.rb2
-rw-r--r--ext/pathname/lib/pathname.rb48
-rw-r--r--ext/pathname/pathname.c92
-rw-r--r--ext/psych/depend3
-rw-r--r--ext/psych/extconf.rb1
-rw-r--r--ext/psych/lib/psych.rb285
-rw-r--r--ext/psych/lib/psych/class_loader.rb102
-rw-r--r--ext/psych/lib/psych/coder.rb1
-rw-r--r--ext/psych/lib/psych/core_ext.rb1
-rw-r--r--ext/psych/lib/psych/deprecated.rb4
-rw-r--r--ext/psych/lib/psych/exception.rb14
-rw-r--r--ext/psych/lib/psych/handler.rb1
-rw-r--r--ext/psych/lib/psych/handlers/document_stream.rb1
-rw-r--r--ext/psych/lib/psych/handlers/recorder.rb1
-rw-r--r--ext/psych/lib/psych/json/ruby_events.rb1
-rw-r--r--ext/psych/lib/psych/json/stream.rb2
-rw-r--r--ext/psych/lib/psych/json/tree_builder.rb1
-rw-r--r--ext/psych/lib/psych/json/yaml_events.rb1
-rw-r--r--ext/psych/lib/psych/nodes.rb1
-rw-r--r--ext/psych/lib/psych/nodes/alias.rb1
-rw-r--r--ext/psych/lib/psych/nodes/document.rb1
-rw-r--r--ext/psych/lib/psych/nodes/mapping.rb1
-rw-r--r--ext/psych/lib/psych/nodes/node.rb5
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb1
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb3
-rw-r--r--ext/psych/lib/psych/nodes/stream.rb1
-rw-r--r--ext/psych/lib/psych/omap.rb1
-rw-r--r--ext/psych/lib/psych/parser.rb1
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb38
-rw-r--r--ext/psych/lib/psych/set.rb1
-rw-r--r--ext/psych/lib/psych/stream.rb2
-rw-r--r--ext/psych/lib/psych/streaming.rb16
-rw-r--r--ext/psych/lib/psych/syntax_error.rb8
-rw-r--r--ext/psych/lib/psych/tree_builder.rb1
-rw-r--r--ext/psych/lib/psych/versions.rb4
-rw-r--r--ext/psych/lib/psych/visitors.rb1
-rw-r--r--ext/psych/lib/psych/visitors/depth_first.rb1
-rw-r--r--ext/psych/lib/psych/visitors/emitter.rb1
-rw-r--r--ext/psych/lib/psych/visitors/json_tree.rb8
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb196
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb1
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb291
-rw-r--r--ext/psych/lib/psych/y.rb3
-rw-r--r--ext/psych/lib/psych_jars.rb6
-rw-r--r--ext/psych/psych.c2
-rw-r--r--ext/psych/psych.gemspec37
-rw-r--r--ext/psych/psych_emitter.c90
-rw-r--r--ext/psych/psych_emitter.h2
-rw-r--r--ext/psych/psych_parser.c28
-rw-r--r--ext/psych/psych_parser.h2
-rw-r--r--ext/psych/psych_to_ruby.c4
-rw-r--r--ext/psych/yaml/api.c55
-rw-r--r--ext/psych/yaml/config.h9
-rw-r--r--ext/psych/yaml/emitter.c2
-rw-r--r--ext/psych/yaml/loader.c37
-rw-r--r--ext/psych/yaml/parser.c12
-rw-r--r--ext/psych/yaml/reader.c4
-rw-r--r--ext/psych/yaml/scanner.c82
-rw-r--r--ext/psych/yaml/yaml.h4
-rw-r--r--ext/psych/yaml/yaml_private.h27
-rw-r--r--ext/pty/depend18
-rw-r--r--ext/pty/extconf.rb1
-rw-r--r--ext/pty/lib/expect.rb25
-rw-r--r--ext/pty/pty.c196
-rw-r--r--ext/racc/cparse/README3
-rw-r--r--ext/racc/cparse/cparse.c108
-rw-r--r--ext/racc/cparse/depend1
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/rbconfig/sizeof/depend17
-rw-r--r--ext/rbconfig/sizeof/extconf.rb36
-rw-r--r--ext/readline/README.ja51
-rw-r--r--ext/readline/depend18
-rw-r--r--ext/readline/extconf.rb17
-rw-r--r--ext/readline/readline.c853
-rw-r--r--ext/ripper/depend40
-rw-r--r--ext/ripper/eventids2.c517
-rw-r--r--ext/ripper/extconf.rb1
-rw-r--r--ext/ripper/lib/ripper.rb1
-rw-r--r--ext/ripper/lib/ripper/core.rb22
-rw-r--r--ext/ripper/lib/ripper/filter.rb1
-rw-r--r--ext/ripper/lib/ripper/lexer.rb47
-rw-r--r--ext/ripper/lib/ripper/sexp.rb98
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb1
-rwxr-xr-xext/ripper/tools/generate.rb34
-rwxr-xr-xext/ripper/tools/preproc.rb1
-rwxr-xr-xext/ripper/tools/strip.rb1
-rw-r--r--ext/sdbm/_sdbm.c21
-rw-r--r--ext/sdbm/depend21
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c96
-rw-r--r--ext/socket/.document1
-rw-r--r--ext/socket/ancdata.c384
-rw-r--r--ext/socket/basicsocket.c160
-rw-r--r--ext/socket/constants.c4
-rw-r--r--ext/socket/depend308
-rw-r--r--ext/socket/extconf.rb793
-rw-r--r--ext/socket/getaddrinfo.c25
-rw-r--r--ext/socket/getnameinfo.c35
-rw-r--r--ext/socket/ifaddr.c459
-rw-r--r--ext/socket/init.c487
-rw-r--r--ext/socket/ipsocket.c85
-rw-r--r--ext/socket/lib/socket.rb644
-rw-r--r--ext/socket/mkconstants.rb154
-rw-r--r--ext/socket/option.c592
-rw-r--r--ext/socket/raddrinfo.c640
-rw-r--r--ext/socket/rubysocket.h305
-rw-r--r--ext/socket/socket.c818
-rw-r--r--ext/socket/sockport.h86
-rw-r--r--ext/socket/sockssocket.c3
-rw-r--r--ext/socket/tcpserver.c67
-rw-r--r--ext/socket/tcpsocket.c10
-rw-r--r--ext/socket/udpsocket.c191
-rw-r--r--ext/socket/unixserver.c47
-rw-r--r--ext/socket/unixsocket.c80
-rw-r--r--ext/stringio/depend7
-rw-r--r--ext/stringio/extconf.rb1
-rw-r--r--ext/stringio/stringio.c260
-rw-r--r--ext/strscan/depend19
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c155
-rw-r--r--ext/syslog/depend14
-rw-r--r--ext/syslog/extconf.rb1
-rw-r--r--ext/syslog/lib/syslog/logger.rb29
-rw-r--r--ext/syslog/syslog.c19
-rw-r--r--ext/thread/extconf.rb4
-rw-r--r--ext/thread/thread.c6
-rw-r--r--ext/tk/ChangeLog.tkextlib2
-rw-r--r--ext/tk/MANUAL_tcltklib.eng36
-rw-r--r--ext/tk/MANUAL_tcltklib.eucj584
-rw-r--r--ext/tk/MANUAL_tcltklib.ja578
-rw-r--r--ext/tk/README.1st2
-rw-r--r--ext/tk/README.ActiveTcl2
-rw-r--r--ext/tk/README.macosx-aqua2
-rw-r--r--ext/tk/README.tcltklib18
-rw-r--r--ext/tk/extconf.rb164
-rw-r--r--ext/tk/lib/README2
-rw-r--r--ext/tk/lib/multi-tk.rb35
-rw-r--r--ext/tk/lib/remote-tk.rb9
-rw-r--r--ext/tk/lib/tcltk.rb5
-rw-r--r--ext/tk/lib/tk.rb51
-rw-r--r--ext/tk/lib/tk/after.rb1
-rw-r--r--ext/tk/lib/tk/autoload.rb3
-rw-r--r--ext/tk/lib/tk/bgerror.rb1
-rw-r--r--ext/tk/lib/tk/bindtag.rb1
-rw-r--r--ext/tk/lib/tk/busy.rb1
-rw-r--r--ext/tk/lib/tk/button.rb1
-rw-r--r--ext/tk/lib/tk/canvas.rb12
-rw-r--r--ext/tk/lib/tk/canvastag.rb1
-rw-r--r--ext/tk/lib/tk/checkbutton.rb1
-rw-r--r--ext/tk/lib/tk/clipboard.rb1
-rw-r--r--ext/tk/lib/tk/clock.rb1
-rw-r--r--ext/tk/lib/tk/composite.rb1
-rw-r--r--ext/tk/lib/tk/console.rb1
-rw-r--r--ext/tk/lib/tk/dialog.rb1
-rw-r--r--ext/tk/lib/tk/encodedstr.rb1
-rw-r--r--ext/tk/lib/tk/entry.rb1
-rw-r--r--ext/tk/lib/tk/event.rb1
-rw-r--r--ext/tk/lib/tk/font.rb1
-rw-r--r--ext/tk/lib/tk/fontchooser.rb7
-rw-r--r--ext/tk/lib/tk/frame.rb1
-rw-r--r--ext/tk/lib/tk/grid.rb1
-rw-r--r--ext/tk/lib/tk/image.rb3
-rw-r--r--ext/tk/lib/tk/itemconfig.rb2
-rw-r--r--ext/tk/lib/tk/itemfont.rb1
-rw-r--r--ext/tk/lib/tk/kinput.rb1
-rw-r--r--ext/tk/lib/tk/label.rb1
-rw-r--r--ext/tk/lib/tk/labelframe.rb1
-rw-r--r--ext/tk/lib/tk/listbox.rb1
-rw-r--r--ext/tk/lib/tk/macpkg.rb1
-rw-r--r--ext/tk/lib/tk/menu.rb1
-rw-r--r--ext/tk/lib/tk/menubar.rb3
-rw-r--r--ext/tk/lib/tk/menuspec.rb1
-rw-r--r--ext/tk/lib/tk/message.rb1
-rw-r--r--ext/tk/lib/tk/mngfocus.rb1
-rw-r--r--ext/tk/lib/tk/msgcat.rb42
-rw-r--r--ext/tk/lib/tk/namespace.rb8
-rw-r--r--ext/tk/lib/tk/optiondb.rb7
-rw-r--r--ext/tk/lib/tk/optionobj.rb1
-rw-r--r--ext/tk/lib/tk/pack.rb1
-rw-r--r--ext/tk/lib/tk/package.rb1
-rw-r--r--ext/tk/lib/tk/palette.rb1
-rw-r--r--ext/tk/lib/tk/panedwindow.rb1
-rw-r--r--ext/tk/lib/tk/place.rb1
-rw-r--r--ext/tk/lib/tk/radiobutton.rb1
-rw-r--r--ext/tk/lib/tk/root.rb1
-rw-r--r--ext/tk/lib/tk/scale.rb1
-rw-r--r--ext/tk/lib/tk/scrollable.rb1
-rw-r--r--ext/tk/lib/tk/scrollbar.rb1
-rw-r--r--ext/tk/lib/tk/scrollbox.rb1
-rw-r--r--ext/tk/lib/tk/selection.rb1
-rw-r--r--ext/tk/lib/tk/spinbox.rb1
-rw-r--r--ext/tk/lib/tk/tagfont.rb1
-rw-r--r--ext/tk/lib/tk/text.rb3
-rw-r--r--ext/tk/lib/tk/textimage.rb1
-rw-r--r--ext/tk/lib/tk/textmark.rb1
-rw-r--r--ext/tk/lib/tk/texttag.rb1
-rw-r--r--ext/tk/lib/tk/textwindow.rb1
-rw-r--r--ext/tk/lib/tk/timer.rb5
-rw-r--r--ext/tk/lib/tk/tk_mac.rb159
-rw-r--r--ext/tk/lib/tk/toplevel.rb1
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb1
-rw-r--r--ext/tk/lib/tk/txtwin_abst.rb1
-rw-r--r--ext/tk/lib/tk/validation.rb1
-rw-r--r--ext/tk/lib/tk/variable.rb4
-rw-r--r--ext/tk/lib/tk/virtevent.rb1
-rw-r--r--ext/tk/lib/tk/winfo.rb1
-rw-r--r--ext/tk/lib/tk/winpkg.rb1
-rw-r--r--ext/tk/lib/tk/wm.rb1
-rw-r--r--ext/tk/lib/tk/xim.rb1
-rw-r--r--ext/tk/lib/tkafter.rb1
-rw-r--r--ext/tk/lib/tkbgerror.rb1
-rw-r--r--ext/tk/lib/tkcanvas.rb1
-rw-r--r--ext/tk/lib/tkclass.rb1
-rw-r--r--ext/tk/lib/tkconsole.rb1
-rw-r--r--ext/tk/lib/tkdialog.rb1
-rw-r--r--ext/tk/lib/tkentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb1
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS17
-rw-r--r--ext/tk/lib/tkextlib/blt.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/cutbuffer.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/eps.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/spline.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/button.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/checkbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/frame.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/label.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/radiobutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/scrollbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/toplevel.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb5
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/win_printer.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/bitmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dragsite.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dropsite.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dynamichelp.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb1
-rw-r--r--ext/tk/lib/tkextlib/bwidget/widget.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb1
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb1
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb3
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb1
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb3
-rw-r--r--ext/tk/lib/tkextlib/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/calendar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/chatwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/crosshair.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ctext.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/history.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/khim.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/menuentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ntext.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/panelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb7
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/style.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb3
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb3
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb1
-rw-r--r--ext/tk/lib/tkextlib/tcllib/validator.rb66
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tclx/tclx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb5
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb31
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/shape.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb3
-rw-r--r--ext/tk/lib/tkextlib/tkHTML.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/bmp.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/dted.rb34
-rw-r--r--ext/tk/lib/tkextlib/tkimg/gif.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ico.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/jpeg.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pcx.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pixmap.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/png.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ppm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ps.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/raw.rb34
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sgi.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sun.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tga.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tiff.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/window.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xbm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xpm.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb3
-rw-r--r--ext/tk/lib/tkextlib/tktrans.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/tktrans/tktrans.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/trofs/trofs.rb1
-rw-r--r--ext/tk/lib/tkextlib/version.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb1
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb1
-rw-r--r--ext/tk/lib/tkfont.rb1
-rw-r--r--ext/tk/lib/tkmacpkg.rb1
-rw-r--r--ext/tk/lib/tkmenubar.rb1
-rw-r--r--ext/tk/lib/tkmngfocus.rb1
-rw-r--r--ext/tk/lib/tkpalette.rb1
-rw-r--r--ext/tk/lib/tkscrollbox.rb1
-rw-r--r--ext/tk/lib/tktext.rb1
-rw-r--r--ext/tk/lib/tkvirtevent.rb1
-rw-r--r--ext/tk/lib/tkwinpkg.rb1
-rw-r--r--ext/tk/old-README.tcltklib.eucj (renamed from ext/tk/old-README.tcltklib.ja)0
-rw-r--r--ext/tk/old-extconf.rb1
-rw-r--r--ext/tk/sample/24hr_clock.rb1
-rw-r--r--ext/tk/sample/binding_sample.rb1
-rw-r--r--ext/tk/sample/bindtag_sample.rb1
-rw-r--r--ext/tk/sample/binstr_usage.rb1
-rw-r--r--ext/tk/sample/btn_with_frame.rb1
-rw-r--r--ext/tk/sample/cd_timer.rb1
-rw-r--r--ext/tk/sample/cmd_res_test.rb1
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb1
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb1
-rw-r--r--ext/tk/sample/demos-en/arrow.rb1
-rw-r--r--ext/tk/sample/demos-en/bind.rb1
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb1
-rw-r--r--ext/tk/sample/demos-en/button.rb1
-rw-r--r--ext/tk/sample/demos-en/check.rb1
-rw-r--r--ext/tk/sample/demos-en/check2.rb1
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb1
-rw-r--r--ext/tk/sample/demos-en/colors.rb1
-rw-r--r--ext/tk/sample/demos-en/combo.rb3
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb1
-rw-r--r--ext/tk/sample/demos-en/ctext.rb1
-rw-r--r--ext/tk/sample/demos-en/dialog1.rb1
-rw-r--r--ext/tk/sample/demos-en/dialog2.rb1
-rw-r--r--ext/tk/sample/demos-en/entry1.rb1
-rw-r--r--ext/tk/sample/demos-en/entry2.rb1
-rw-r--r--ext/tk/sample/demos-en/entry3.rb1
-rw-r--r--ext/tk/sample/demos-en/filebox.rb1
-rw-r--r--ext/tk/sample/demos-en/floor.rb1
-rw-r--r--ext/tk/sample/demos-en/floor2.rb1
-rw-r--r--ext/tk/sample/demos-en/form.rb1
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb1
-rw-r--r--ext/tk/sample/demos-en/hscale.rb1
-rw-r--r--ext/tk/sample/demos-en/icon.rb1
-rw-r--r--ext/tk/sample/demos-en/image1.rb1
-rw-r--r--ext/tk/sample/demos-en/image2.rb1
-rw-r--r--ext/tk/sample/demos-en/image3.rb1
-rw-r--r--ext/tk/sample/demos-en/items.rb1
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb1
-rw-r--r--ext/tk/sample/demos-en/label.rb1
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb1
-rw-r--r--ext/tk/sample/demos-en/mclist.rb1
-rw-r--r--ext/tk/sample/demos-en/menu.rb1
-rw-r--r--ext/tk/sample/demos-en/menu84.rb1
-rw-r--r--ext/tk/sample/demos-en/menubu.rb1
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb1
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb1
-rw-r--r--ext/tk/sample/demos-en/paned1.rb1
-rw-r--r--ext/tk/sample/demos-en/paned2.rb1
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb1
-rw-r--r--ext/tk/sample/demos-en/plot.rb1
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb1
-rw-r--r--ext/tk/sample/demos-en/radio.rb1
-rw-r--r--ext/tk/sample/demos-en/radio2.rb1
-rw-r--r--ext/tk/sample/demos-en/radio3.rb1
-rw-r--r--ext/tk/sample/demos-en/rolodex2
-rw-r--r--ext/tk/sample/demos-en/ruler.rb1
-rw-r--r--ext/tk/sample/demos-en/sayings.rb1
-rw-r--r--ext/tk/sample/demos-en/search.rb1
-rw-r--r--ext/tk/sample/demos-en/spin.rb1
-rw-r--r--ext/tk/sample/demos-en/states.rb1
-rw-r--r--ext/tk/sample/demos-en/style.rb1
-rw-r--r--ext/tk/sample/demos-en/text.rb3
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb1
-rw-r--r--ext/tk/sample/demos-en/tkencoding.rb1
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb1
-rw-r--r--ext/tk/sample/demos-en/tree.rb3
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb1
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb1
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb1
-rw-r--r--ext/tk/sample/demos-en/twind.rb1
-rw-r--r--ext/tk/sample/demos-en/twind2.rb1
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb1
-rw-r--r--ext/tk/sample/demos-en/vscale.rb1
-rw-r--r--ext/tk/sample/demos-en/widget6
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb1
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb1
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb1
-rw-r--r--ext/tk/sample/demos-jp/bind.rb1
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb1
-rw-r--r--ext/tk/sample/demos-jp/button.rb1
-rw-r--r--ext/tk/sample/demos-jp/check.rb1
-rw-r--r--ext/tk/sample/demos-jp/check2.rb1
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb1
-rw-r--r--ext/tk/sample/demos-jp/colors.rb1
-rw-r--r--ext/tk/sample/demos-jp/combo.rb1
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb1
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb1
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb1
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb1
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb1
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb1
-rw-r--r--ext/tk/sample/demos-jp/floor.rb1
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb1
-rw-r--r--ext/tk/sample/demos-jp/form.rb1
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb1
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb1
-rw-r--r--ext/tk/sample/demos-jp/icon.rb1
-rw-r--r--ext/tk/sample/demos-jp/image1.rb1
-rw-r--r--ext/tk/sample/demos-jp/image2.rb1
-rw-r--r--ext/tk/sample/demos-jp/image3.rb1
-rw-r--r--ext/tk/sample/demos-jp/items.rb1
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb1
-rw-r--r--ext/tk/sample/demos-jp/label.rb1
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb1
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb1
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb1
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb1
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb1
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb1
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb1
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb1
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb1
-rw-r--r--ext/tk/sample/demos-jp/plot.rb1
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb1
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb1
-rw-r--r--ext/tk/sample/demos-jp/rolodex2
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb1
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb1
-rw-r--r--ext/tk/sample/demos-jp/search.rb1
-rw-r--r--ext/tk/sample/demos-jp/spin.rb1
-rw-r--r--ext/tk/sample/demos-jp/states.rb1
-rw-r--r--ext/tk/sample/demos-jp/style.rb1
-rw-r--r--ext/tk/sample/demos-jp/text.rb1
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb1
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb1
-rw-r--r--ext/tk/sample/demos-jp/tree.rb3
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb1
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb1
-rw-r--r--ext/tk/sample/demos-jp/twind.rb1
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb1
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb1
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb1
-rw-r--r--ext/tk/sample/demos-jp/widget6
-rw-r--r--ext/tk/sample/editable_listbox.rb1
-rw-r--r--ext/tk/sample/encstr_usage.rb1
-rw-r--r--ext/tk/sample/figmemo_sample.rb5
-rw-r--r--ext/tk/sample/irbtk.rb1
-rw-r--r--ext/tk/sample/menubar1.rb3
-rw-r--r--ext/tk/sample/menubar2.rb5
-rw-r--r--ext/tk/sample/menubar3.rb3
-rw-r--r--ext/tk/sample/msgs_tk/README2
-rw-r--r--ext/tk/sample/multi-ip_sample.rb1
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb1
-rw-r--r--ext/tk/sample/optobj_sample.rb1
-rw-r--r--ext/tk/sample/propagate.rb1
-rw-r--r--ext/tk/sample/remote-ip_sample.rb1
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb1
-rw-r--r--[-rwxr-xr-x]ext/tk/sample/safe-tk.rb4
-rw-r--r--ext/tk/sample/scrollframe.rb3
-rw-r--r--ext/tk/sample/tcltklib/lines1.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines2.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines3.rb1
-rw-r--r--ext/tk/sample/tcltklib/lines4.rb1
-rw-r--r--ext/tk/sample/tcltklib/safeTk.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb1
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb1
-rw-r--r--ext/tk/sample/tkalignbox.rb1
-rw-r--r--ext/tk/sample/tkballoonhelp.rb1
-rw-r--r--ext/tk/sample/tkbiff.rb1
-rw-r--r--ext/tk/sample/tkbrowse.rb1
-rw-r--r--ext/tk/sample/tkcombobox.rb1
-rw-r--r--ext/tk/sample/tkdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb3
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/blt/scripts/stipples.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb1
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt12
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb1
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt24
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb3
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb3
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb1
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt8
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb1
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb1
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/index.html2
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb1
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb3
-rw-r--r--ext/tk/sample/tkextlib/tkimg/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt4
-rw-r--r--ext/tk/sample/tkextlib/tktable/basic.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb1
-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb1
-rw-r--r--ext/tk/sample/tkextlib/treectrl/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt4
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb1
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb1
-rw-r--r--ext/tk/sample/tkfrom.rb1
-rw-r--r--ext/tk/sample/tkhello.rb1
-rw-r--r--ext/tk/sample/tkline.rb1
-rw-r--r--ext/tk/sample/tkmenubutton.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb1
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb1
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb1
-rw-r--r--ext/tk/sample/tkmultilistbox.rb1
-rw-r--r--ext/tk/sample/tkmultilistframe.rb1
-rw-r--r--[-rwxr-xr-x]ext/tk/sample/tkoptdb-safeTk.rb3
-rw-r--r--ext/tk/sample/tkoptdb.rb1
-rw-r--r--ext/tk/sample/tkrttimer.rb1
-rw-r--r--ext/tk/sample/tksleep_sample.rb1
-rw-r--r--ext/tk/sample/tktextframe.rb3
-rw-r--r--ext/tk/sample/tktextio.rb3
-rw-r--r--ext/tk/sample/tktimer.rb1
-rw-r--r--ext/tk/sample/tktimer2.rb1
-rw-r--r--ext/tk/sample/tktimer3.rb1
-rw-r--r--ext/tk/sample/tktree.rb1
-rw-r--r--ext/tk/sample/ttk_wrapper.rb1
-rw-r--r--ext/tk/stubs.c36
-rw-r--r--ext/tk/stubs.h10
-rw-r--r--ext/tk/tcltklib.c581
-rw-r--r--ext/tk/tkutil/extconf.rb12
-rw-r--r--ext/tk/tkutil/tkutil.c525
-rw-r--r--ext/win32/extconf.rb4
-rw-r--r--ext/win32/lib/Win32API.rb38
-rw-r--r--ext/win32/lib/win32/importer.rb9
-rw-r--r--ext/win32/lib/win32/registry.rb911
-rw-r--r--ext/win32/lib/win32/resolv.rb379
-rw-r--r--ext/win32/lib/win32/sspi.rb331
-rw-r--r--ext/win32ole/depend13
-rw-r--r--ext/win32ole/extconf.rb12
-rw-r--r--ext/win32ole/lib/win32ole.rb22
-rw-r--r--ext/win32ole/lib/win32ole/property.rb1
-rw-r--r--ext/win32ole/sample/excel1.rb6
-rw-r--r--ext/win32ole/sample/excel2.rb11
-rw-r--r--ext/win32ole/sample/excel3.rb8
-rw-r--r--ext/win32ole/sample/ie.rb1
-rw-r--r--ext/win32ole/sample/ieconst.rb1
-rw-r--r--ext/win32ole/sample/ienavi.rb1
-rw-r--r--ext/win32ole/sample/ienavi2.rb1
-rw-r--r--ext/win32ole/sample/oledirs.rb1
-rw-r--r--ext/win32ole/sample/olegen.rb9
-rw-r--r--ext/win32ole/sample/xml.rb1
-rw-r--r--ext/win32ole/win32ole.c6415
-rw-r--r--ext/win32ole/win32ole.h155
-rw-r--r--ext/win32ole/win32ole_error.c83
-rw-r--r--ext/win32ole/win32ole_error.h8
-rw-r--r--ext/win32ole/win32ole_event.c1278
-rw-r--r--ext/win32ole/win32ole_event.h6
-rw-r--r--ext/win32ole/win32ole_method.c950
-rw-r--r--ext/win32ole/win32ole_method.h16
-rw-r--r--ext/win32ole/win32ole_param.c438
-rw-r--r--ext/win32ole/win32ole_param.h8
-rw-r--r--ext/win32ole/win32ole_record.c604
-rw-r--r--ext/win32ole/win32ole_record.h10
-rw-r--r--ext/win32ole/win32ole_type.c915
-rw-r--r--ext/win32ole/win32ole_type.h8
-rw-r--r--ext/win32ole/win32ole_typelib.c844
-rw-r--r--ext/win32ole/win32ole_typelib.h11
-rw-r--r--ext/win32ole/win32ole_variable.c380
-rw-r--r--ext/win32ole/win32ole_variable.h8
-rw-r--r--ext/win32ole/win32ole_variant.c732
-rw-r--r--ext/win32ole/win32ole_variant.h9
-rw-r--r--ext/win32ole/win32ole_variant_m.c149
-rw-r--r--ext/win32ole/win32ole_variant_m.h7
-rw-r--r--ext/zlib/depend5
-rw-r--r--ext/zlib/extconf.rb4
-rw-r--r--ext/zlib/zlib.c256
-rw-r--r--file.c1219
-rw-r--r--gc.c8210
-rw-r--r--gc.h30
-rw-r--r--gem_prelude.rb8
-rw-r--r--gems/bundled_gems6
-rw-r--r--golf_prelude.rb37
-rw-r--r--goruby.c8
-rw-r--r--hash.c1622
-rw-r--r--id_table.c1583
-rw-r--r--id_table.h30
-rw-r--r--include/ruby/backward/classext.h4
-rw-r--r--include/ruby/backward/rubyio.h2
-rw-r--r--include/ruby/backward/rubysig.h15
-rw-r--r--include/ruby/backward/st.h2
-rw-r--r--include/ruby/backward/util.h2
-rw-r--r--include/ruby/debug.h36
-rw-r--r--include/ruby/defines.h173
-rw-r--r--include/ruby/encoding.h247
-rw-r--r--include/ruby/intern.h353
-rw-r--r--include/ruby/io.h82
-rw-r--r--include/ruby/missing.h71
-rw-r--r--include/ruby/oniguruma.h62
-rw-r--r--include/ruby/re.h9
-rw-r--r--include/ruby/regex.h8
-rw-r--r--include/ruby/ruby.h1452
-rw-r--r--include/ruby/st.h46
-rw-r--r--include/ruby/thread.h8
-rw-r--r--include/ruby/thread_native.h56
-rw-r--r--include/ruby/util.h23
-rw-r--r--include/ruby/version.h12
-rw-r--r--include/ruby/vm.h8
-rw-r--r--include/ruby/win32.h217
-rw-r--r--inits.c6
-rw-r--r--insns.def604
-rw-r--r--internal.h1126
-rw-r--r--io.c2301
-rw-r--r--iseq.c1573
-rw-r--r--iseq.h167
-rw-r--r--lex.c.blt197
-rw-r--r--lib/English.rb47
-rw-r--r--lib/README93
-rwxr-xr-x[-rw-r--r--]lib/abbrev.rb100
-rw-r--r--lib/base64.rb24
-rw-r--r--lib/benchmark.rb134
-rw-r--r--lib/cgi.rb26
-rw-r--r--lib/cgi/cookie.rb118
-rw-r--r--lib/cgi/core.rb69
-rw-r--r--lib/cgi/html.rb298
-rw-r--r--lib/cgi/session.rb37
-rw-r--r--lib/cgi/session/pstore.rb14
-rw-r--r--lib/cgi/util.rb64
-rw-r--r--lib/cmath.rb263
-rw-r--r--lib/complex.rb28
-rw-r--r--lib/csv.rb318
-rw-r--r--lib/debug.rb56
-rw-r--r--lib/delegate.rb125
-rw-r--r--lib/drb.rb1
-rw-r--r--lib/drb/acl.rb21
-rw-r--r--lib/drb/drb.rb172
-rw-r--r--lib/drb/eq.rb3
-rw-r--r--lib/drb/extserv.rb29
-rw-r--r--lib/drb/extservm.rb3
-rw-r--r--lib/drb/gw.rb43
-rw-r--r--lib/drb/invokemethod.rb3
-rw-r--r--lib/drb/observer.rb4
-rw-r--r--lib/drb/ssl.rb168
-rw-r--r--lib/drb/timeridconv.rb55
-rw-r--r--lib/drb/unix.rb14
-rw-r--r--lib/e2mmap.rb27
-rw-r--r--lib/erb.rb57
-rw-r--r--lib/fileutils.rb682
-rw-r--r--lib/find.rb48
-rw-r--r--lib/forwardable.rb63
-rw-r--r--lib/getoptlong.rb5
-rw-r--r--lib/gserver.rb309
-rw-r--r--lib/ipaddr.rb281
-rw-r--r--lib/irb.rb98
-rw-r--r--lib/irb/cmd/chws.rb7
-rw-r--r--lib/irb/cmd/fork.rb30
-rw-r--r--lib/irb/cmd/help.rb1
-rw-r--r--lib/irb/cmd/load.rb49
-rw-r--r--lib/irb/cmd/nop.rb12
-rw-r--r--lib/irb/cmd/pushws.rb11
-rw-r--r--lib/irb/cmd/subirb.rb9
-rw-r--r--lib/irb/completion.rb305
-rw-r--r--lib/irb/context.rb192
-rw-r--r--lib/irb/ext/change-ws.rb35
-rw-r--r--lib/irb/ext/history.rb59
-rw-r--r--lib/irb/ext/loader.rb119
-rw-r--r--lib/irb/ext/math-mode.rb9
-rw-r--r--lib/irb/ext/multi-irb.rb176
-rw-r--r--lib/irb/ext/save-history.rb69
-rw-r--r--lib/irb/ext/tracer.rb27
-rw-r--r--lib/irb/ext/use-loader.rb29
-rw-r--r--lib/irb/ext/workspaces.rb27
-rw-r--r--lib/irb/extend-command.rb219
-rw-r--r--lib/irb/frame.rb5
-rw-r--r--lib/irb/help.rb19
-rw-r--r--lib/irb/init.rb213
-rw-r--r--lib/irb/input-method.rb37
-rw-r--r--lib/irb/inspector.rb17
-rw-r--r--lib/irb/lc/.document4
-rw-r--r--lib/irb/lc/error.rb1
-rw-r--r--lib/irb/lc/help-message26
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb1
-rw-r--r--lib/irb/lc/ja/error.rb1
-rw-r--r--lib/irb/lc/ja/help-message20
-rw-r--r--lib/irb/locale.rb72
-rw-r--r--lib/irb/magic-file.rb1
-rw-r--r--lib/irb/notifier.rb83
-rw-r--r--lib/irb/output-method.rb7
-rw-r--r--lib/irb/ruby-lex.rb704
-rw-r--r--lib/irb/ruby-token.rb30
-rw-r--r--lib/irb/slex.rb262
-rw-r--r--lib/irb/src_encoding.rb1
-rw-r--r--lib/irb/version.rb1
-rw-r--r--lib/irb/workspace.rb115
-rw-r--r--lib/irb/ws-for-case-2.rb1
-rw-r--r--lib/irb/xmp.rb39
-rw-r--r--lib/logger.rb375
-rw-r--r--lib/mathn.rb152
-rw-r--r--lib/matrix.rb357
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb231
-rw-r--r--lib/matrix/lup_decomposition.rb11
-rw-r--r--lib/minitest/README.txt394
-rw-r--r--lib/minitest/autorun.rb19
-rw-r--r--lib/minitest/benchmark.rb380
-rw-r--r--lib/minitest/hell.rb16
-rw-r--r--lib/minitest/mock.rb200
-rw-r--r--lib/minitest/parallel_each.rb36
-rw-r--r--lib/minitest/pride.rb119
-rw-r--r--lib/minitest/spec.rb541
-rw-r--r--lib/minitest/unit.rb1477
-rw-r--r--lib/mkmf.rb544
-rw-r--r--lib/monitor.rb3
-rw-r--r--lib/mutex_m.rb59
-rw-r--r--lib/net/ftp.rb473
-rw-r--r--lib/net/http.rb122
-rw-r--r--lib/net/http/backward.rb1
-rw-r--r--lib/net/http/exceptions.rb1
-rw-r--r--lib/net/http/generic_request.rb89
-rw-r--r--lib/net/http/header.rb15
-rw-r--r--lib/net/http/proxy_delta.rb1
-rw-r--r--lib/net/http/request.rb1
-rw-r--r--lib/net/http/requests.rb3
-rw-r--r--lib/net/http/response.rb26
-rw-r--r--lib/net/http/responses.rb11
-rw-r--r--lib/net/https.rb3
-rw-r--r--lib/net/imap.rb598
-rw-r--r--lib/net/pop.rb21
-rw-r--r--lib/net/protocol.rb38
-rw-r--r--lib/net/smtp.rb49
-rw-r--r--lib/net/telnet.rb763
-rw-r--r--lib/observer.rb18
-rw-r--r--lib/open-uri.rb77
-rw-r--r--lib/open3.rb249
-rw-r--r--lib/optionparser.rb2
-rw-r--r--lib/optparse.rb395
-rw-r--r--lib/optparse/ac.rb1
-rw-r--r--lib/optparse/date.rb1
-rw-r--r--lib/optparse/shellwords.rb1
-rw-r--r--lib/optparse/time.rb1
-rw-r--r--lib/optparse/uri.rb1
-rw-r--r--lib/optparse/version.rb3
-rw-r--r--lib/ostruct.rb68
-rw-r--r--lib/pp.rb152
-rw-r--r--lib/prettyprint.rb231
-rw-r--r--lib/prime.rb231
-rw-r--r--lib/profile.rb1
-rw-r--r--lib/profiler.rb52
-rw-r--r--lib/pstore.rb25
-rw-r--r--lib/racc/parser.rb252
-rw-r--r--lib/racc/rdoc/grammar.en.rdoc219
-rw-r--r--lib/rake.rb71
-rw-r--r--lib/rake/alt_system.rb109
-rw-r--r--lib/rake/application.rb702
-rw-r--r--lib/rake/backtrace.rb18
-rw-r--r--lib/rake/classic_namespace.rb11
-rw-r--r--lib/rake/clean.rb32
-rw-r--r--lib/rake/cloneable.rb16
-rw-r--r--lib/rake/contrib/compositepublisher.rb21
-rw-r--r--lib/rake/contrib/ftptools.rb151
-rw-r--r--lib/rake/contrib/publisher.rb73
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb16
-rw-r--r--lib/rake/contrib/sshpublisher.rb50
-rw-r--r--lib/rake/contrib/sys.rb192
-rw-r--r--lib/rake/default_loader.rb10
-rw-r--r--lib/rake/dsl_definition.rb182
-rw-r--r--lib/rake/early_time.rb18
-rw-r--r--lib/rake/ext/core.rb27
-rw-r--r--lib/rake/ext/module.rb39
-rw-r--r--lib/rake/ext/string.rb168
-rw-r--r--lib/rake/ext/time.rb15
-rw-r--r--lib/rake/file_creation_task.rb24
-rw-r--r--lib/rake/file_list.rb410
-rw-r--r--lib/rake/file_task.rb47
-rw-r--r--lib/rake/file_utils.rb114
-rw-r--r--lib/rake/file_utils_ext.rb146
-rw-r--r--lib/rake/gempackagetask.rb15
-rw-r--r--lib/rake/invocation_chain.rb51
-rw-r--r--lib/rake/invocation_exception_mixin.rb16
-rw-r--r--lib/rake/lib/project.rake21
-rw-r--r--lib/rake/loaders/makefile.rb40
-rw-r--r--lib/rake/multi_task.rb13
-rw-r--r--lib/rake/name_space.rb25
-rw-r--r--lib/rake/packagetask.rb185
-rw-r--r--lib/rake/pathmap.rb1
-rw-r--r--lib/rake/phony.rb15
-rw-r--r--lib/rake/private_reader.rb20
-rw-r--r--lib/rake/promise.rb99
-rw-r--r--lib/rake/pseudo_status.rb24
-rw-r--r--lib/rake/rake_module.rb37
-rw-r--r--lib/rake/rake_test_loader.rb22
-rw-r--r--lib/rake/rdoctask.rb234
-rw-r--r--lib/rake/ruby182_test_unit_fix.rb25
-rw-r--r--lib/rake/rule_recursion_overflow_error.rb20
-rw-r--r--lib/rake/runtest.rb22
-rw-r--r--lib/rake/task.rb350
-rw-r--r--lib/rake/task_argument_error.rb7
-rw-r--r--lib/rake/task_arguments.rb78
-rw-r--r--lib/rake/task_manager.rb307
-rw-r--r--lib/rake/tasklib.rb22
-rw-r--r--lib/rake/testtask.rb198
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb155
-rw-r--r--lib/rake/trace_output.rb19
-rw-r--r--lib/rake/version.rb13
-rw-r--r--lib/rake/win32.rb55
-rw-r--r--lib/rational.rb23
-rw-r--r--lib/rbconfig/datadir.rb1
-rw-r--r--lib/rbconfig/obsolete.rb38
-rw-r--r--lib/rdoc.rb12
-rw-r--r--lib/rdoc/alias.rb1
-rw-r--r--lib/rdoc/anon_class.rb1
-rw-r--r--lib/rdoc/any_method.rb65
-rw-r--r--lib/rdoc/attr.rb3
-rw-r--r--lib/rdoc/class_module.rb34
-rw-r--r--lib/rdoc/code_object.rb129
-rw-r--r--lib/rdoc/code_objects.rb1
-rw-r--r--lib/rdoc/comment.rb4
-rw-r--r--lib/rdoc/constant.rb11
-rw-r--r--lib/rdoc/context.rb34
-rw-r--r--lib/rdoc/context/section.rb1
-rw-r--r--lib/rdoc/cross_reference.rb3
-rw-r--r--lib/rdoc/encoding.rb5
-rw-r--r--lib/rdoc/erb_partial.rb1
-rw-r--r--lib/rdoc/erbio.rb1
-rw-r--r--lib/rdoc/extend.rb117
-rw-r--r--lib/rdoc/generator.rb2
-rw-r--r--lib/rdoc/generator/darkfish.rb81
-rw-r--r--lib/rdoc/generator/json_index.rb50
-rw-r--r--lib/rdoc/generator/markup.rb1
-rw-r--r--lib/rdoc/generator/pot.rb98
-rw-r--r--lib/rdoc/generator/pot/message_extractor.rb68
-rw-r--r--lib/rdoc/generator/pot/po.rb84
-rw-r--r--lib/rdoc/generator/pot/po_entry.rb141
-rw-r--r--lib/rdoc/generator/ri.rb1
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml8
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml21
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml6
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml8
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml14
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml13
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml77
-rw-r--r--lib/rdoc/generator/template/darkfish/css/fonts.css167
-rw-r--r--lib/rdoc/generator/template/darkfish/css/rdoc.css590
-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttfbin94668 -> 0 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttfbin94196 -> 0 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttfbin96184 -> 0 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttfbin95316 -> 0 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttfbin71200 -> 0 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttfbin71692 -> 0 bytes-rwxr-xr-x[-rw-r--r--]lib/rdoc/generator/template/darkfish/images/add.pngbin733 -> 733 bytes-rwxr-xr-x[-rw-r--r--]lib/rdoc/generator/template/darkfish/images/arrow_up.pngbin372 -> 372 bytes-rwxr-xr-x[-rw-r--r--]lib/rdoc/generator/template/darkfish/images/delete.pngbin715 -> 715 bytes-rwxr-xr-x[-rw-r--r--]lib/rdoc/generator/template/darkfish/images/tag_blue.pngbin1880 -> 1880 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/index.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js74
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js22
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js25
-rw-r--r--lib/rdoc/generator/template/darkfish/page.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/rdoc.css595
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_root.rhtml38
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml31
-rw-r--r--lib/rdoc/generator/template/json_index/.document1
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js4
-rw-r--r--lib/rdoc/ghost_method.rb1
-rw-r--r--lib/rdoc/i18n.rb10
-rw-r--r--lib/rdoc/i18n/locale.rb102
-rw-r--r--lib/rdoc/i18n/text.rb126
-rw-r--r--lib/rdoc/include.rb119
-rw-r--r--lib/rdoc/known_classes.rb3
-rw-r--r--lib/rdoc/markdown.rb2346
-rw-r--r--lib/rdoc/markdown/entities.rb1
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb28
-rw-r--r--lib/rdoc/markup.rb30
-rw-r--r--lib/rdoc/markup/attr_changer.rb1
-rw-r--r--lib/rdoc/markup/attr_span.rb1
-rw-r--r--lib/rdoc/markup/attribute_manager.rb8
-rw-r--r--lib/rdoc/markup/attributes.rb1
-rw-r--r--lib/rdoc/markup/blank_line.rb1
-rw-r--r--lib/rdoc/markup/block_quote.rb1
-rw-r--r--lib/rdoc/markup/document.rb1
-rw-r--r--lib/rdoc/markup/formatter.rb7
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb1
-rw-r--r--lib/rdoc/markup/hard_break.rb1
-rw-r--r--lib/rdoc/markup/heading.rb14
-rw-r--r--lib/rdoc/markup/include.rb1
-rw-r--r--lib/rdoc/markup/indented_paragraph.rb1
-rw-r--r--lib/rdoc/markup/inline.rb1
-rw-r--r--lib/rdoc/markup/list.rb1
-rw-r--r--lib/rdoc/markup/list_item.rb1
-rw-r--r--lib/rdoc/markup/paragraph.rb1
-rw-r--r--lib/rdoc/markup/parser.rb14
-rw-r--r--lib/rdoc/markup/pre_process.rb3
-rw-r--r--lib/rdoc/markup/raw.rb1
-rw-r--r--lib/rdoc/markup/rule.rb1
-rw-r--r--lib/rdoc/markup/special.rb1
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb1
-rw-r--r--lib/rdoc/markup/to_ansi.rb1
-rw-r--r--lib/rdoc/markup/to_bs.rb1
-rw-r--r--lib/rdoc/markup/to_html.rb115
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb4
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb1
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb3
-rw-r--r--lib/rdoc/markup/to_label.rb3
-rw-r--r--lib/rdoc/markup/to_markdown.rb13
-rw-r--r--lib/rdoc/markup/to_rdoc.rb1
-rw-r--r--lib/rdoc/markup/to_table_of_contents.rb1
-rw-r--r--lib/rdoc/markup/to_test.rb1
-rw-r--r--lib/rdoc/markup/to_tt_only.rb1
-rw-r--r--lib/rdoc/markup/verbatim.rb3
-rw-r--r--lib/rdoc/meta_method.rb1
-rw-r--r--lib/rdoc/method_attr.rb29
-rw-r--r--lib/rdoc/mixin.rb121
-rw-r--r--lib/rdoc/normal_class.rb5
-rw-r--r--lib/rdoc/normal_module.rb5
-rw-r--r--lib/rdoc/options.rb141
-rw-r--r--lib/rdoc/parser.rb18
-rw-r--r--lib/rdoc/parser/c.rb75
-rw-r--r--lib/rdoc/parser/changelog.rb11
-rw-r--r--lib/rdoc/parser/markdown.rb1
-rw-r--r--lib/rdoc/parser/rd.rb1
-rw-r--r--lib/rdoc/parser/ruby.rb1170
-rw-r--r--lib/rdoc/parser/ruby_tools.rb1
-rw-r--r--lib/rdoc/parser/simple.rb1
-rw-r--r--lib/rdoc/parser/text.rb1
-rw-r--r--lib/rdoc/rd.rb1
-rw-r--r--lib/rdoc/rd/block_parser.rb7
-rw-r--r--lib/rdoc/rd/inline.rb1
-rw-r--r--lib/rdoc/rd/inline_parser.rb3
-rw-r--r--lib/rdoc/rdoc.gemspec7
-rw-r--r--lib/rdoc/rdoc.rb24
-rw-r--r--lib/rdoc/require.rb1
-rw-r--r--lib/rdoc/ri.rb1
-rw-r--r--lib/rdoc/ri/driver.rb282
-rw-r--r--lib/rdoc/ri/formatter.rb1
-rw-r--r--lib/rdoc/ri/paths.rb13
-rw-r--r--lib/rdoc/ri/store.rb1
-rw-r--r--lib/rdoc/ri/task.rb72
-rw-r--r--lib/rdoc/ruby_lex.rb236
-rw-r--r--lib/rdoc/ruby_token.rb96
-rw-r--r--lib/rdoc/rubygems_hook.rb20
-rw-r--r--lib/rdoc/servlet.rb77
-rw-r--r--lib/rdoc/single_class.rb5
-rw-r--r--lib/rdoc/stats.rb114
-rw-r--r--lib/rdoc/stats/normal.rb34
-rw-r--r--lib/rdoc/stats/quiet.rb1
-rw-r--r--lib/rdoc/stats/verbose.rb1
-rw-r--r--lib/rdoc/store.rb19
-rw-r--r--lib/rdoc/task.rb3
-rw-r--r--lib/rdoc/test_case.rb40
-rw-r--r--lib/rdoc/text.rb21
-rw-r--r--lib/rdoc/token_stream.rb3
-rw-r--r--lib/rdoc/tom_doc.rb33
-rw-r--r--lib/rdoc/top_level.rb8
-rw-r--r--lib/resolv-replace.rb4
-rw-r--r--lib/resolv.rb562
-rw-r--r--lib/rexml/attlistdecl.rb3
-rw-r--r--lib/rexml/attribute.rb12
-rw-r--r--lib/rexml/cdata.rb1
-rw-r--r--lib/rexml/child.rb1
-rw-r--r--lib/rexml/comment.rb2
-rw-r--r--lib/rexml/doctype.rb1
-rw-r--r--lib/rexml/document.rb41
-rw-r--r--lib/rexml/dtd/attlistdecl.rb1
-rw-r--r--lib/rexml/dtd/dtd.rb6
-rw-r--r--lib/rexml/dtd/elementdecl.rb5
-rw-r--r--lib/rexml/dtd/entitydecl.rb1
-rw-r--r--lib/rexml/dtd/notationdecl.rb1
-rw-r--r--lib/rexml/element.rb16
-rw-r--r--lib/rexml/encoding.rb1
-rw-r--r--lib/rexml/entity.rb10
-rw-r--r--lib/rexml/formatters/default.rb1
-rw-r--r--lib/rexml/formatters/pretty.rb3
-rw-r--r--lib/rexml/formatters/transitive.rb1
-rw-r--r--lib/rexml/functions.rb3
-rw-r--r--lib/rexml/instruction.rb1
-rw-r--r--lib/rexml/light/node.rb1
-rw-r--r--lib/rexml/namespace.rb1
-rw-r--r--lib/rexml/node.rb1
-rw-r--r--lib/rexml/output.rb1
-rw-r--r--lib/rexml/parent.rb3
-rw-r--r--lib/rexml/parseexception.rb1
-rw-r--r--lib/rexml/parsers/baseparser.rb29
-rw-r--r--lib/rexml/parsers/lightparser.rb1
-rw-r--r--lib/rexml/parsers/pullparser.rb1
-rw-r--r--lib/rexml/parsers/sax2parser.rb32
-rw-r--r--lib/rexml/parsers/streamparser.rb7
-rw-r--r--lib/rexml/parsers/treeparser.rb7
-rw-r--r--lib/rexml/parsers/ultralightparser.rb3
-rw-r--r--lib/rexml/parsers/xpathparser.rb44
-rw-r--r--lib/rexml/quickpath.rb1
-rw-r--r--lib/rexml/rexml.rb1
-rw-r--r--lib/rexml/sax2listener.rb17
-rw-r--r--lib/rexml/security.rb28
-rw-r--r--lib/rexml/source.rb7
-rw-r--r--lib/rexml/streamlistener.rb15
-rw-r--r--lib/rexml/syncenumerator.rb1
-rw-r--r--lib/rexml/text.rb60
-rw-r--r--lib/rexml/undefinednamespaceexception.rb1
-rw-r--r--lib/rexml/validation/relaxng.rb22
-rw-r--r--lib/rexml/validation/validation.rb13
-rw-r--r--lib/rexml/validation/validationexception.rb1
-rw-r--r--lib/rexml/xmldecl.rb1
-rw-r--r--lib/rexml/xmltokens.rb77
-rw-r--r--lib/rexml/xpath.rb1
-rw-r--r--lib/rexml/xpath_parser.rb109
-rw-r--r--lib/rinda/rinda.rb51
-rw-r--r--lib/rinda/ring.rb304
-rw-r--r--lib/rinda/tuplespace.rb8
-rw-r--r--lib/rss.rb1
-rw-r--r--lib/rss/0.9.rb34
-rw-r--r--lib/rss/1.0.rb33
-rw-r--r--lib/rss/2.0.rb32
-rw-r--r--lib/rss/atom.rb84
-rw-r--r--lib/rss/content.rb3
-rw-r--r--lib/rss/content/1.0.rb1
-rw-r--r--lib/rss/content/2.0.rb1
-rw-r--r--lib/rss/converter.rb1
-rw-r--r--lib/rss/dublincore.rb3
-rw-r--r--lib/rss/dublincore/1.0.rb1
-rw-r--r--lib/rss/dublincore/2.0.rb1
-rw-r--r--lib/rss/dublincore/atom.rb1
-rw-r--r--lib/rss/image.rb5
-rw-r--r--lib/rss/itunes.rb3
-rw-r--r--lib/rss/maker.rb27
-rw-r--r--lib/rss/maker/0.9.rb1
-rw-r--r--lib/rss/maker/1.0.rb1
-rw-r--r--lib/rss/maker/2.0.rb1
-rw-r--r--lib/rss/maker/atom.rb1
-rw-r--r--lib/rss/maker/base.rb3
-rw-r--r--lib/rss/maker/content.rb1
-rw-r--r--lib/rss/maker/dublincore.rb1
-rw-r--r--lib/rss/maker/entry.rb1
-rw-r--r--lib/rss/maker/feed.rb1
-rw-r--r--lib/rss/maker/image.rb1
-rw-r--r--lib/rss/maker/itunes.rb1
-rw-r--r--lib/rss/maker/slash.rb1
-rw-r--r--lib/rss/maker/syndication.rb1
-rw-r--r--lib/rss/maker/taxonomy.rb1
-rw-r--r--lib/rss/maker/trackback.rb1
-rw-r--r--lib/rss/parser.rb3
-rw-r--r--lib/rss/rexmlparser.rb6
-rw-r--r--lib/rss/rss.rb71
-rw-r--r--lib/rss/slash.rb3
-rw-r--r--lib/rss/syndication.rb6
-rw-r--r--lib/rss/taxonomy.rb5
-rw-r--r--lib/rss/trackback.rb5
-rw-r--r--lib/rss/utils.rb93
-rw-r--r--lib/rss/xml-stylesheet.rb1
-rw-r--r--lib/rss/xml.rb1
-rw-r--r--lib/rss/xmlparser.rb4
-rw-r--r--lib/rss/xmlscanner.rb1
-rw-r--r--lib/rubygems.rb463
-rw-r--r--lib/rubygems/LICENSE.txt54
-rw-r--r--lib/rubygems/available_set.rb204
-rw-r--r--lib/rubygems/basic_specification.rb328
-rw-r--r--lib/rubygems/command.rb14
-rw-r--r--lib/rubygems/command_manager.rb81
-rw-r--r--lib/rubygems/commands/build_command.rb24
-rw-r--r--lib/rubygems/commands/cert_command.rb109
-rw-r--r--lib/rubygems/commands/check_command.rb8
-rw-r--r--lib/rubygems/commands/cleanup_command.rb19
-rw-r--r--lib/rubygems/commands/contents_command.rb186
-rw-r--r--lib/rubygems/commands/dependency_command.rb183
-rw-r--r--lib/rubygems/commands/environment_command.rb139
-rw-r--r--lib/rubygems/commands/fetch_command.rb17
-rw-r--r--lib/rubygems/commands/generate_index_command.rb3
-rw-r--r--lib/rubygems/commands/help_command.rb324
-rw-r--r--lib/rubygems/commands/install_command.rb242
-rw-r--r--lib/rubygems/commands/list_command.rb28
-rw-r--r--lib/rubygems/commands/lock_command.rb1
-rw-r--r--lib/rubygems/commands/mirror_command.rb31
-rw-r--r--lib/rubygems/commands/open_command.rb77
-rw-r--r--lib/rubygems/commands/outdated_command.rb22
-rw-r--r--lib/rubygems/commands/owner_command.rb22
-rw-r--r--lib/rubygems/commands/pristine_command.rb91
-rw-r--r--lib/rubygems/commands/push_command.rb50
-rw-r--r--lib/rubygems/commands/query_command.rb101
-rw-r--r--lib/rubygems/commands/rdoc_command.rb9
-rw-r--r--lib/rubygems/commands/search_command.rb32
-rw-r--r--lib/rubygems/commands/server_command.rb1
-rw-r--r--lib/rubygems/commands/setup_command.rb111
-rw-r--r--lib/rubygems/commands/sources_command.rb199
-rw-r--r--lib/rubygems/commands/specification_command.rb21
-rw-r--r--lib/rubygems/commands/stale_command.rb11
-rw-r--r--lib/rubygems/commands/uninstall_command.rb60
-rw-r--r--lib/rubygems/commands/unpack_command.rb21
-rw-r--r--lib/rubygems/commands/update_command.rb220
-rw-r--r--lib/rubygems/commands/which_command.rb25
-rw-r--r--lib/rubygems/commands/yank_command.rb57
-rw-r--r--lib/rubygems/compatibility.rb17
-rw-r--r--lib/rubygems/config_file.rb134
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb25
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb31
-rw-r--r--lib/rubygems/defaults.rb97
-rw-r--r--lib/rubygems/dependency.rb75
-rw-r--r--lib/rubygems/dependency_installer.rb463
-rw-r--r--lib/rubygems/dependency_list.rb12
-rw-r--r--lib/rubygems/dependency_resolver.rb562
-rw-r--r--lib/rubygems/deprecate.rb3
-rw-r--r--lib/rubygems/doctor.rb29
-rw-r--r--lib/rubygems/errors.rb62
-rw-r--r--lib/rubygems/exceptions.rb165
-rw-r--r--lib/rubygems/ext.rb4
-rw-r--r--lib/rubygems/ext/build_error.rb7
-rw-r--r--lib/rubygems/ext/builder.rb197
-rw-r--r--lib/rubygems/ext/cmake_builder.rb5
-rw-r--r--lib/rubygems/ext/configure_builder.rb5
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb86
-rw-r--r--lib/rubygems/ext/rake_builder.rb8
-rw-r--r--lib/rubygems/gem_runner.rb27
-rw-r--r--lib/rubygems/gemcutter_utilities.rb129
-rw-r--r--lib/rubygems/indexer.rb122
-rw-r--r--lib/rubygems/install_default_message.rb13
-rw-r--r--lib/rubygems/install_message.rb1
-rw-r--r--lib/rubygems/install_update_options.rb26
-rw-r--r--lib/rubygems/installer.rb340
-rw-r--r--lib/rubygems/installer_test_case.rb12
-rw-r--r--lib/rubygems/local_remote_options.rb7
-rw-r--r--lib/rubygems/mock_gem_ui.rb1
-rw-r--r--lib/rubygems/name_tuple.rb30
-rw-r--r--lib/rubygems/package.rb177
-rw-r--r--lib/rubygems/package/digest_io.rb1
-rw-r--r--lib/rubygems/package/file_source.rb34
-rw-r--r--lib/rubygems/package/io_source.rb46
-rw-r--r--lib/rubygems/package/old.rb63
-rw-r--r--lib/rubygems/package/source.rb4
-rw-r--r--lib/rubygems/package/tar_header.rb4
-rw-r--r--lib/rubygems/package/tar_reader.rb2
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb11
-rw-r--r--lib/rubygems/package/tar_test_case.rb32
-rw-r--r--lib/rubygems/package/tar_writer.rb80
-rw-r--r--lib/rubygems/package_task.rb8
-rw-r--r--lib/rubygems/path_support.rb37
-rw-r--r--lib/rubygems/platform.rb29
-rw-r--r--lib/rubygems/psych_additions.rb7
-rw-r--r--lib/rubygems/psych_tree.rb5
-rw-r--r--lib/rubygems/rdoc.rb22
-rw-r--r--lib/rubygems/remote_fetcher.rb379
-rw-r--r--lib/rubygems/request.rb248
-rw-r--r--lib/rubygems/request/connection_pools.rb88
-rw-r--r--lib/rubygems/request/http_pool.rb48
-rw-r--r--lib/rubygems/request/https_pool.rb11
-rw-r--r--lib/rubygems/request_set.rb478
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb849
-rw-r--r--lib/rubygems/request_set/lockfile.rb238
-rw-r--r--lib/rubygems/request_set/lockfile/parser.rb354
-rw-r--r--lib/rubygems/request_set/lockfile/tokenizer.rb112
-rw-r--r--lib/rubygems/requirement.rb111
-rw-r--r--lib/rubygems/resolver.rb292
-rw-r--r--lib/rubygems/resolver/activation_request.rb186
-rw-r--r--lib/rubygems/resolver/api_set.rb126
-rw-r--r--lib/rubygems/resolver/api_specification.rb86
-rw-r--r--lib/rubygems/resolver/best_set.rb79
-rw-r--r--lib/rubygems/resolver/composed_set.rb67
-rw-r--r--lib/rubygems/resolver/conflict.rb160
-rw-r--r--lib/rubygems/resolver/current_set.rb14
-rw-r--r--lib/rubygems/resolver/dependency_request.rb120
-rw-r--r--lib/rubygems/resolver/git_set.rb123
-rw-r--r--lib/rubygems/resolver/git_specification.rb59
-rw-r--r--lib/rubygems/resolver/index_set.rb81
-rw-r--r--lib/rubygems/resolver/index_specification.rb70
-rw-r--r--lib/rubygems/resolver/installed_specification.rb59
-rw-r--r--lib/rubygems/resolver/installer_set.rb225
-rw-r--r--lib/rubygems/resolver/local_specification.rb42
-rw-r--r--lib/rubygems/resolver/lock_set.rb83
-rw-r--r--lib/rubygems/resolver/lock_specification.rb88
-rw-r--r--lib/rubygems/resolver/molinillo.rb2
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo.rb10
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb287
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb75
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb5
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb100
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb64
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb436
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb45
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/state.rb52
-rw-r--r--lib/rubygems/resolver/requirement_list.rb82
-rw-r--r--lib/rubygems/resolver/set.rb57
-rw-r--r--lib/rubygems/resolver/source_set.rb48
-rw-r--r--lib/rubygems/resolver/spec_specification.rb57
-rw-r--r--lib/rubygems/resolver/specification.rb111
-rw-r--r--lib/rubygems/resolver/stats.rb45
-rw-r--r--lib/rubygems/resolver/vendor_set.rb88
-rw-r--r--lib/rubygems/resolver/vendor_specification.rb25
-rw-r--r--lib/rubygems/security.rb56
-rw-r--r--lib/rubygems/security/policies.rb1
-rw-r--r--lib/rubygems/security/policy.rb110
-rw-r--r--lib/rubygems/security/signer.rb37
-rw-r--r--lib/rubygems/security/trust_dir.rb19
-rw-r--r--lib/rubygems/server.rb62
-rw-r--r--lib/rubygems/source.rb147
-rw-r--r--lib/rubygems/source/git.rb241
-rw-r--r--lib/rubygems/source/installed.rb41
-rw-r--r--lib/rubygems/source/local.rb130
-rw-r--r--lib/rubygems/source/lock.rb49
-rw-r--r--lib/rubygems/source/specific_file.rb73
-rw-r--r--lib/rubygems/source/vendor.rb28
-rw-r--r--lib/rubygems/source_list.rb87
-rw-r--r--lib/rubygems/source_local.rb92
-rw-r--r--lib/rubygems/source_specific_file.rb29
-rw-r--r--lib/rubygems/spec_fetcher.rb79
-rw-r--r--lib/rubygems/specification.rb1226
-rw-r--r--lib/rubygems/ssl_certs/.document1
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem25
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem118
-rw-r--r--lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem14
-rw-r--r--lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem23
-rw-r--r--lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem90
-rw-r--r--lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem28
-rw-r--r--lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem20
-rw-r--r--lib/rubygems/ssl_certs/GlobalSignRootCA.pem21
-rw-r--r--lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem57
-rw-r--r--lib/rubygems/ssl_certs/ca-bundle.pem3366
-rw-r--r--lib/rubygems/stub_specification.rb215
-rw-r--r--lib/rubygems/syck_hack.rb7
-rw-r--r--lib/rubygems/test_case.rb739
-rw-r--r--lib/rubygems/test_utilities.rb210
-rw-r--r--lib/rubygems/text.rb24
-rw-r--r--lib/rubygems/uninstaller.rb63
-rw-r--r--lib/rubygems/uri_formatter.rb50
-rw-r--r--lib/rubygems/user_interaction.rb292
-rw-r--r--lib/rubygems/util.rb135
-rw-r--r--lib/rubygems/util/licenses.rb343
-rw-r--r--lib/rubygems/util/list.rb37
-rw-r--r--lib/rubygems/validator.rb9
-rw-r--r--lib/rubygems/version.rb108
-rw-r--r--lib/rubygems/version_option.rb11
-rw-r--r--lib/scanf.rb17
-rw-r--r--lib/securerandom.rb289
-rw-r--r--lib/set.rb197
-rw-r--r--lib/shell.rb50
-rw-r--r--lib/shell/builtin-command.rb15
-rw-r--r--lib/shell/command-processor.rb13
-rw-r--r--lib/shell/error.rb1
-rw-r--r--lib/shell/filter.rb3
-rw-r--r--lib/shell/process-controller.rb10
-rw-r--r--lib/shell/system-command.rb2
-rw-r--r--lib/shell/version.rb1
-rw-r--r--lib/shellwords.rb34
-rw-r--r--lib/singleton.rb1
-rw-r--r--lib/sync.rb3
-rw-r--r--lib/tempfile.rb160
-rw-r--r--lib/test/unit.rb859
-rw-r--r--lib/test/unit/assertions.rb324
-rw-r--r--lib/test/unit/parallel.rb182
-rw-r--r--lib/test/unit/test-unit.gemspec14
-rw-r--r--lib/test/unit/testcase.rb34
-rw-r--r--lib/thread.rb363
-rw-r--r--lib/thwait.rb7
-rw-r--r--lib/time.rb134
-rw-r--r--lib/timeout.rb79
-rw-r--r--lib/tmpdir.rb46
-rw-r--r--lib/tracer.rb53
-rw-r--r--lib/tsort.rb250
-rw-r--r--lib/ubygems.rb1
-rw-r--r--lib/un.rb41
-rw-r--r--lib/unicode_normalize.rb79
-rw-r--r--lib/unicode_normalize/normalize.rb161
-rw-r--r--lib/unicode_normalize/tables.rb1160
-rw-r--r--lib/uri.rb3
-rw-r--r--lib/uri/common.rb876
-rw-r--r--lib/uri/ftp.rb43
-rw-r--r--lib/uri/generic.rb315
-rw-r--r--lib/uri/http.rb17
-rw-r--r--lib/uri/https.rb1
-rw-r--r--lib/uri/ldap.rb1
-rw-r--r--lib/uri/ldaps.rb1
-rw-r--r--lib/uri/mailto.rb144
-rw-r--r--lib/uri/rfc2396_parser.rb544
-rw-r--r--lib/uri/rfc3986_parser.rb125
-rw-r--r--lib/weakref.rb24
-rw-r--r--lib/webrick.rb5
-rw-r--r--lib/webrick/accesslog.rb10
-rw-r--r--lib/webrick/cgi.rb53
-rw-r--r--lib/webrick/compat.rb3
-rw-r--r--lib/webrick/config.rb33
-rw-r--r--lib/webrick/cookie.rb72
-rw-r--r--lib/webrick/htmlutils.rb6
-rw-r--r--lib/webrick/httpauth.rb1
-rw-r--r--lib/webrick/httpauth/authenticator.rb21
-rw-r--r--lib/webrick/httpauth/basicauth.rb6
-rw-r--r--lib/webrick/httpauth/digestauth.rb30
-rw-r--r--lib/webrick/httpauth/htdigest.rb10
-rw-r--r--lib/webrick/httpauth/htgroup.rb1
-rw-r--r--lib/webrick/httpauth/htpasswd.rb10
-rw-r--r--lib/webrick/httpauth/userdb.rb1
-rw-r--r--lib/webrick/httpproxy.rb33
-rw-r--r--lib/webrick/httprequest.rb154
-rw-r--r--lib/webrick/httpresponse.rb93
-rw-r--r--lib/webrick/https.rb25
-rw-r--r--lib/webrick/httpserver.rb24
-rw-r--r--lib/webrick/httpservlet.rb1
-rw-r--r--lib/webrick/httpservlet/abstract.rb1
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb1
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb24
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb3
-rw-r--r--lib/webrick/httpservlet/filehandler.rb120
-rw-r--r--lib/webrick/httpservlet/prochandler.rb14
-rw-r--r--lib/webrick/httpstatus.rb5
-rw-r--r--lib/webrick/httputils.rb142
-rw-r--r--lib/webrick/httpversion.rb29
-rw-r--r--lib/webrick/log.rb24
-rw-r--r--lib/webrick/server.rb187
-rw-r--r--lib/webrick/ssl.rb76
-rw-r--r--lib/webrick/utils.rb135
-rw-r--r--lib/webrick/version.rb5
-rw-r--r--lib/xmlrpc.rb19
-rw-r--r--lib/xmlrpc/base64.rb1
-rw-r--r--lib/xmlrpc/client.rb65
-rw-r--r--lib/xmlrpc/config.rb4
-rw-r--r--lib/xmlrpc/create.rb1
-rw-r--r--lib/xmlrpc/datetime.rb3
-rw-r--r--lib/xmlrpc/httpserver.rb173
-rw-r--r--lib/xmlrpc/marshal.rb1
-rw-r--r--lib/xmlrpc/parser.rb35
-rw-r--r--lib/xmlrpc/server.rb7
-rw-r--r--lib/xmlrpc/utils.rb1
-rw-r--r--lib/yaml.rb78
-rw-r--r--lib/yaml/dbm.rb78
-rw-r--r--lib/yaml/store.rb1
-rw-r--r--load.c501
-rw-r--r--loadpath.c92
-rw-r--r--localeinit.c112
-rw-r--r--man/erb.12
-rw-r--r--man/goruby.12
-rw-r--r--man/irb.16
-rw-r--r--man/rake.1169
-rw-r--r--man/ri.15
-rw-r--r--man/ruby.1183
-rw-r--r--marshal.c829
-rw-r--r--math.c625
-rw-r--r--method.h199
-rw-r--r--miniinit.c49
-rw-r--r--misc/README2
-rw-r--r--misc/inf-ruby.el2
-rw-r--r--misc/rdoc-mode.el42
-rw-r--r--misc/ruby-additional.el217
-rw-r--r--misc/ruby-electric.el679
-rw-r--r--misc/ruby-mode.el162
-rw-r--r--misc/ruby-style.el1
-rw-r--r--missing/crypt.c93
-rw-r--r--missing/explicit_bzero.c88
-rw-r--r--missing/file.h2
-rw-r--r--missing/flock.c4
-rw-r--r--missing/isnan.c15
-rw-r--r--missing/lgamma_r.c2
-rw-r--r--missing/nextafter.c77
-rw-r--r--missing/os2.c138
-rw-r--r--missing/setproctitle.c7
-rw-r--r--nacl/GNUmakefile.in49
-rw-r--r--nacl/README.nacl25
-rw-r--r--nacl/ioctl.h7
-rw-r--r--[-rwxr-xr-x]nacl/nacl-config.rb16
-rw-r--r--nacl/package.rb6
-rw-r--r--nacl/pepper_main.c248
-rw-r--r--node.c343
-rw-r--r--node.h73
-rw-r--r--numeric.c1988
-rw-r--r--object.c1369
-rw-r--r--pack.c987
-rw-r--r--parse.y4960
-rw-r--r--prelude.rb125
-rw-r--r--probes.d228
-rw-r--r--probes_helper.h70
-rw-r--r--proc.c1603
-rw-r--r--process.c3156
-rw-r--r--random.c838
-rw-r--r--range.c575
-rw-r--r--rational.c549
-rw-r--r--re.c340
-rw-r--r--regcomp.c329
-rw-r--r--regenc.c76
-rw-r--r--regenc.h37
-rw-r--r--regerror.c24
-rw-r--r--regexec.c835
-rw-r--r--regint.h137
-rw-r--r--regparse.c563
-rw-r--r--regparse.h18
-rw-r--r--ruby.c706
-rw-r--r--ruby_atomic.h136
-rw-r--r--safe.c49
-rw-r--r--sample/benchmark.rb19
-rw-r--r--sample/cal.rb10
-rw-r--r--sample/cgi-session-pstore.rb11
-rw-r--r--sample/coverage.rb2
-rw-r--r--sample/delegate.rb31
-rw-r--r--sample/drb/README.ja.rdoc59
-rw-r--r--sample/drb/README.rd56
-rw-r--r--sample/drb/README.rd.ja59
-rw-r--r--sample/drb/README.rdoc56
-rw-r--r--sample/drb/acl.rb15
-rw-r--r--sample/drb/dbiff.rb22
-rw-r--r--sample/drb/dchats.rb20
-rw-r--r--sample/drb/dlogd.rb4
-rw-r--r--sample/drb/gw_cu.rb2
-rw-r--r--sample/drb/http0.rb60
-rw-r--r--sample/drb/http0serv.rb106
-rw-r--r--sample/drb/old_tuplespace.rb74
-rw-r--r--sample/drb/ring_place.rb6
-rw-r--r--sample/drb/simpletuple.rb8
-rw-r--r--sample/dualstack-fetch.rb2
-rw-r--r--sample/dualstack-httpd.rb32
-rw-r--r--sample/exyacc.rb26
-rw-r--r--sample/fib.awk8
-rw-r--r--sample/fib.pl4
-rw-r--r--sample/fib.scm4
-rw-r--r--sample/freq.rb2
-rw-r--r--sample/from.rb38
-rw-r--r--sample/iseq_loader.rb243
-rw-r--r--sample/list.rb2
-rw-r--r--sample/logger/app.rb2
-rw-r--r--sample/mkproto.rb22
-rw-r--r--sample/net-imap.rb167
-rw-r--r--sample/observ.rb8
-rw-r--r--sample/occur.pl8
-rw-r--r--sample/occur.rb2
-rw-r--r--sample/occur2.rb2
-rw-r--r--sample/open3.rb12
-rw-r--r--sample/openssl/c_rehash.rb38
-rw-r--r--sample/openssl/certstore.rb52
-rw-r--r--sample/openssl/crlstore.rb32
-rwxr-xr-xsample/optparse/opttest.rb70
-rw-r--r--sample/pstore.rb19
-rw-r--r--sample/pty/expect_sample.rb2
-rw-r--r--sample/rcs.awk54
-rw-r--r--sample/rinda-ring.rb22
-rw-r--r--sample/simple-bench.rb140
-rw-r--r--sample/tempfile.rb8
-rwxr-xr-xsample/test.rb63
-rw-r--r--sample/timeout.rb2
-rw-r--r--sample/trick2013/README.md15
-rw-r--r--sample/trick2013/kinaba/authors.markdown3
-rw-r--r--sample/trick2013/kinaba/entry.rb1
-rw-r--r--sample/trick2013/kinaba/remarks.markdown37
-rw-r--r--sample/trick2013/mame/authors.markdown3
-rw-r--r--sample/trick2013/mame/entry.rb97
-rw-r--r--sample/trick2013/mame/music-box.mp4bin580724 -> 0 bytes-rw-r--r--sample/trick2013/mame/remarks.markdown47
-rw-r--r--sample/trick2013/shinh/authors.markdown2
-rw-r--r--sample/trick2013/shinh/entry.rb10
-rw-r--r--sample/trick2013/shinh/remarks.markdown4
-rw-r--r--sample/trick2013/yhara/authors.markdown3
-rw-r--r--sample/trick2013/yhara/entry.rb28
-rw-r--r--sample/trick2013/yhara/remarks.en.markdown23
-rw-r--r--sample/trick2013/yhara/remarks.markdown24
-rw-r--r--sample/trick2015/README.md16
-rw-r--r--sample/trick2015/eregon/authors.markdown3
-rw-r--r--sample/trick2015/eregon/entry.rb16
-rw-r--r--sample/trick2015/eregon/remarks.markdown70
-rw-r--r--sample/trick2015/kinaba/authors.markdown4
-rw-r--r--sample/trick2015/kinaba/entry.rb150
-rw-r--r--sample/trick2015/kinaba/remarks.markdown85
-rw-r--r--sample/trick2015/ksk_1/authors.markdown3
-rw-r--r--sample/trick2015/ksk_1/entry.rb1
-rw-r--r--sample/trick2015/ksk_1/remarks.markdown120
-rw-r--r--sample/trick2015/ksk_2/abnormal.cnf6
-rw-r--r--sample/trick2015/ksk_2/authors.markdown3
-rw-r--r--sample/trick2015/ksk_2/entry.rb1
-rw-r--r--sample/trick2015/ksk_2/quinn.cnf21
-rw-r--r--sample/trick2015/ksk_2/remarks.markdown204
-rw-r--r--sample/trick2015/ksk_2/sample.cnf9
-rw-r--r--sample/trick2015/ksk_2/uf20-01.cnf99
-rw-r--r--sample/trick2015/ksk_2/unsat.cnf11
-rw-r--r--sample/trick2015/monae/authors.markdown1
-rw-r--r--sample/trick2015/monae/entry.rb26
-rw-r--r--sample/trick2015/monae/remarks.markdown25
-rw-r--r--sample/trojan.rb2
-rw-r--r--sample/weakref.rb9
-rw-r--r--signal.c543
-rw-r--r--siphash.c7
-rw-r--r--sparc.c11
-rw-r--r--spec/default.mspec11
-rw-r--r--sprintf.c531
-rw-r--r--st.c643
-rw-r--r--strftime.c3
-rw-r--r--string.c3815
-rw-r--r--struct.c919
-rw-r--r--symbian/README.SYMBIAN93
-rw-r--r--symbian/configure.bat123
-rw-r--r--symbian/missing-aeabi.c18
-rw-r--r--symbian/missing-pips.c65
-rw-r--r--symbian/pre-build83
-rw-r--r--symbian/setup440
-rw-r--r--symbol.c1134
-rw-r--r--symbol.h108
-rw-r--r--template/Doxyfile.tmpl2
-rw-r--r--template/GNUmakefile.in6
-rw-r--r--template/encdb.h.tmpl14
-rw-r--r--template/fake.rb.in77
-rw-r--r--template/id.c.tmpl16
-rw-r--r--template/id.h.tmpl81
-rw-r--r--template/insns.inc.tmpl2
-rw-r--r--template/insns_info.inc.tmpl2
-rw-r--r--template/known_errors.inc.tmpl2
-rw-r--r--template/minsns.inc.tmpl2
-rw-r--r--template/opt_sc.inc.tmpl2
-rw-r--r--template/optinsn.inc.tmpl2
-rw-r--r--template/optunifs.inc.tmpl2
-rw-r--r--template/prelude.c.tmpl195
-rw-r--r--template/ruby-runner.c.in37
-rw-r--r--template/ruby.pc.in36
-rw-r--r--template/sizes.c.tmpl32
-rw-r--r--template/unicode_norm_gen.tmpl222
-rw-r--r--template/verconf.h.tmpl63
-rw-r--r--template/vm.inc.tmpl2
-rw-r--r--template/yarvarch.ja14
-rw-r--r--test/-ext-/array/test_resize.rb1
-rw-r--r--test/-ext-/bignum/test_big2str.rb30
-rw-r--r--test/-ext-/bignum/test_bigzero.rb14
-rw-r--r--test/-ext-/bignum/test_div.rb29
-rw-r--r--test/-ext-/bignum/test_mul.rb138
-rw-r--r--test/-ext-/bignum/test_pack.rb399
-rw-r--r--test/-ext-/bignum/test_str2big.rb38
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb24
-rw-r--r--test/-ext-/class/test_class2name.rb19
-rw-r--r--test/-ext-/debug/test_debug.rb59
-rw-r--r--test/-ext-/debug/test_profile_frames.rb122
-rw-r--r--test/-ext-/exception/test_data_error.rb14
-rw-r--r--test/-ext-/exception/test_enc_raise.rb1
-rw-r--r--test/-ext-/exception/test_ensured.rb32
-rw-r--r--test/-ext-/file/test_stat.rb15
-rw-r--r--test/-ext-/float/test_nextafter.rb65
-rw-r--r--test/-ext-/funcall/test_passing_block.rb1
-rw-r--r--test/-ext-/gvl/test_last_thread.rb23
-rw-r--r--test/-ext-/hash/test_delete.rb20
-rw-r--r--test/-ext-/iseq_load/test_iseq_load.rb117
-rw-r--r--test/-ext-/iter/test_iter_break.rb13
-rw-r--r--test/-ext-/iter/test_yield_block.rb22
-rw-r--r--test/-ext-/load/test_dot_dot.rb1
-rw-r--r--test/-ext-/marshal/test_internal_ivar.rb20
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb5
-rw-r--r--test/-ext-/method/test_arity.rb38
-rw-r--r--test/-ext-/num2int/test_num2int.rb375
-rw-r--r--test/-ext-/old_thread_select/test_old_thread_select.rb100
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb1
-rw-r--r--test/-ext-/popen_deadlock/test_popen_deadlock.rb36
-rw-r--r--test/-ext-/postponed_job/test_postponed_job.rb29
-rw-r--r--test/-ext-/proc/test_bmethod.rb38
-rw-r--r--test/-ext-/rational/test_rat.rb32
-rw-r--r--test/-ext-/st/test_foreach.rb16
-rw-r--r--test/-ext-/st/test_numhash.rb1
-rw-r--r--test/-ext-/st/test_update.rb1
-rw-r--r--test/-ext-/string/test_coderange.rb60
-rw-r--r--test/-ext-/string/test_cstr.rb143
-rw-r--r--test/-ext-/string/test_ellipsize.rb5
-rw-r--r--test/-ext-/string/test_enc_associate.rb14
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb3
-rw-r--r--test/-ext-/string/test_fstring.rb65
-rw-r--r--test/-ext-/string/test_modify_expand.rb17
-rw-r--r--test/-ext-/string/test_nofree.rb13
-rw-r--r--test/-ext-/string/test_normalize.rb110
-rw-r--r--test/-ext-/string/test_qsort.rb3
-rw-r--r--test/-ext-/string/test_set_len.rb3
-rw-r--r--test/-ext-/struct/test_duplicate.rb22
-rw-r--r--test/-ext-/struct/test_member.rb16
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb374
-rw-r--r--test/-ext-/symbol/test_type.rb143
-rw-r--r--test/-ext-/test_bug-3571.rb2
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb1
-rw-r--r--test/-ext-/test_notimplement.rb15
-rw-r--r--test/-ext-/test_printf.rb160
-rw-r--r--test/-ext-/test_recursion.rb36
-rw-r--r--test/-ext-/time/test_new.rb44
-rw-r--r--test/-ext-/tracepoint/test_tracepoint.rb80
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb19
-rw-r--r--test/-ext-/vm/test_at_exit.rb19
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb3
-rw-r--r--test/-ext-/win32/test_console_attr.rb44
-rw-r--r--test/-ext-/win32/test_dln.rb24
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb2
-rw-r--r--test/base64/test_base64.rb15
-rw-r--r--test/benchmark/test_benchmark.rb137
-rw-r--r--test/bigdecimal/test_bigdecimal.rb240
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb14
-rw-r--r--test/bigdecimal/test_bigmath.rb18
-rw-r--r--test/bigdecimal/testbase.rb1
-rw-r--r--test/cgi/test_cgi_cookie.rb20
-rw-r--r--test/cgi/test_cgi_core.rb136
-rw-r--r--test/cgi/test_cgi_header.rb19
-rw-r--r--test/cgi/test_cgi_modruby.rb11
-rw-r--r--test/cgi/test_cgi_multipart.rb78
-rw-r--r--test/cgi/test_cgi_session.rb47
-rw-r--r--test/cgi/test_cgi_tag_helper.rb29
-rw-r--r--test/cgi/test_cgi_util.rb99
-rw-r--r--test/cgi/update_env.rb9
-rw-r--r--test/colors3
-rw-r--r--test/coverage/test_coverage.rb63
-rw-r--r--test/csv/base.rb3
-rwxr-xr-xtest/csv/test_csv_parsing.rb1
-rwxr-xr-xtest/csv/test_csv_writing.rb1
-rwxr-xr-xtest/csv/test_data_converters.rb5
-rwxr-xr-xtest/csv/test_encodings.rb39
-rwxr-xr-xtest/csv/test_features.rb102
-rwxr-xr-xtest/csv/test_headers.rb35
-rwxr-xr-xtest/csv/test_interface.rb38
-rwxr-xr-xtest/csv/test_row.rb55
-rwxr-xr-xtest/csv/test_serialization.rb158
-rwxr-xr-xtest/csv/test_table.rb28
-rw-r--r--test/csv/ts_all.rb2
-rw-r--r--test/date/test_date.rb13
-rw-r--r--test/date/test_date_arith.rb31
-rw-r--r--test/date/test_date_attr.rb10
-rw-r--r--test/date/test_date_base.rb1
-rw-r--r--test/date/test_date_compat.rb1
-rw-r--r--test/date/test_date_conv.rb1
-rw-r--r--test/date/test_date_marshal.rb1
-rw-r--r--test/date/test_date_new.rb1
-rw-r--r--test/date/test_date_parse.rb29
-rw-r--r--test/date/test_date_strftime.rb9
-rw-r--r--test/date/test_date_strptime.rb23
-rw-r--r--test/date/test_switch_hitter.rb56
-rw-r--r--test/dbm/test_dbm.rb28
-rw-r--r--test/digest/digest/foo.rb11
-rwxr-xr-x[-rw-r--r--]test/digest/test_digest.rb123
-rw-r--r--test/digest/test_digest_extend.rb5
-rw-r--r--test/digest/test_digest_hmac.rb2
-rw-r--r--test/dl/test_base.rb131
-rw-r--r--test/dl/test_c_struct_entry.rb55
-rw-r--r--test/dl/test_c_union_entity.rb31
-rw-r--r--test/dl/test_callback.rb72
-rw-r--r--test/dl/test_cfunc.rb80
-rw-r--r--test/dl/test_cparser.rb33
-rw-r--r--test/dl/test_cptr.rb222
-rw-r--r--test/dl/test_dl2.rb167
-rw-r--r--test/dl/test_func.rb184
-rw-r--r--test/dl/test_handle.rb187
-rw-r--r--test/dl/test_import.rb165
-rw-r--r--test/dl/test_win32.rb54
-rw-r--r--test/drb/drbtest.rb121
-rw-r--r--test/drb/ignore_test_drb.rb20
-rw-r--r--test/drb/test_acl.rb5
-rw-r--r--test/drb/test_drb.rb72
-rw-r--r--test/drb/test_drbssl.rb25
-rw-r--r--test/drb/test_drbunix.rb24
-rw-r--r--test/drb/ut_array.rb4
-rw-r--r--test/drb/ut_array_drbssl.rb14
-rw-r--r--test/drb/ut_array_drbunix.rb2
-rw-r--r--test/drb/ut_drb.rb9
-rw-r--r--test/drb/ut_drb_drbssl.rb14
-rw-r--r--test/drb/ut_drb_drbunix.rb4
-rw-r--r--test/drb/ut_eq.rb9
-rw-r--r--test/drb/ut_eval.rb8
-rw-r--r--test/drb/ut_large.rb8
-rw-r--r--test/drb/ut_port.rb2
-rw-r--r--test/drb/ut_safe1.rb2
-rw-r--r--test/drb/ut_timerholder.rb75
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb39
-rw-r--r--test/dtrace/test_array_create.rb3
-rw-r--r--test/dtrace/test_cmethod.rb3
-rw-r--r--test/dtrace/test_function_entry.rb3
-rw-r--r--test/dtrace/test_gc.rb3
-rw-r--r--test/dtrace/test_hash_create.rb3
-rw-r--r--test/dtrace/test_load.rb3
-rw-r--r--test/dtrace/test_method_cache.rb29
-rw-r--r--test/dtrace/test_object_create_start.rb3
-rw-r--r--test/dtrace/test_raise.rb3
-rw-r--r--test/dtrace/test_require.rb3
-rw-r--r--test/dtrace/test_singleton_function.rb3
-rw-r--r--test/dtrace/test_string.rb3
-rw-r--r--test/erb/test_erb.rb33
-rw-r--r--test/erb/test_erb_command.rb12
-rw-r--r--test/erb/test_erb_m17n.rb3
-rw-r--r--test/etc/test_etc.rb71
-rw-r--r--test/excludes/TestException.rb9
-rw-r--r--test/excludes/TestIO_Console.rb2
-rw-r--r--test/excludes/TestISeq.rb1
-rw-r--r--test/excludes/TestThread.rb2
-rw-r--r--test/fiddle/helper.rb20
-rw-r--r--test/fiddle/test_c_struct_entry.rb11
-rw-r--r--test/fiddle/test_c_union_entity.rb10
-rw-r--r--test/fiddle/test_closure.rb1
-rw-r--r--test/fiddle/test_cparser.rb188
-rw-r--r--test/fiddle/test_fiddle.rb1
-rw-r--r--test/fiddle/test_func.rb18
-rw-r--r--test/fiddle/test_function.rb40
-rw-r--r--test/fiddle/test_handle.rb118
-rw-r--r--test/fiddle/test_import.rb20
-rw-r--r--test/fiddle/test_pointer.rb21
-rw-r--r--test/fileutils/clobber.rb1
-rw-r--r--test/fileutils/fileasserts.rb42
-rw-r--r--test/fileutils/test_dryrun.rb22
-rw-r--r--test/fileutils/test_fileutils.rb598
-rw-r--r--test/fileutils/test_nowrite.rb22
-rw-r--r--test/fileutils/test_verbose.rb20
-rw-r--r--test/fileutils/visibility_tests.rb42
-rw-r--r--test/gdbm/test_gdbm.rb122
-rw-r--r--test/inlinetest.rb55
-rw-r--r--test/io/console/test_io_console.rb148
-rw-r--r--test/io/nonblock/test_flush.rb17
-rw-r--r--test/io/wait/test_io_wait.rb25
-rw-r--r--test/irb/test_completion.rb2
-rw-r--r--test/irb/test_option.rb2
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb14
-rw-r--r--test/json/fixtures/fail18.json2
-rw-r--r--test/json/setup_variant.rb1
-rwxr-xr-xtest/json/test_json.rb128
-rwxr-xr-x[-rw-r--r--]test/json/test_json_addition.rb59
-rw-r--r--test/json/test_json_encoding.rb5
-rwxr-xr-x[-rw-r--r--]test/json/test_json_fixtures.rb5
-rwxr-xr-x[-rw-r--r--]test/json/test_json_generate.rb169
-rw-r--r--test/json/test_json_generic_object.rb59
-rw-r--r--test/json/test_json_string_matching.rb10
-rwxr-xr-x[-rw-r--r--]test/json/test_json_unicode.rb3
-rw-r--r--test/lib/envutil.rb267
-rw-r--r--test/lib/find_executable.rb22
-rw-r--r--test/lib/iseq_loader_checker.rb75
-rw-r--r--test/lib/leakchecker.rb201
-rw-r--r--test/lib/memory_status.rb140
-rw-r--r--test/lib/minitest/README.txt457
-rw-r--r--test/lib/minitest/autorun.rb14
-rw-r--r--test/lib/minitest/benchmark.rb418
-rw-r--r--test/lib/minitest/mock.rb196
-rw-r--r--test/lib/minitest/unit.rb1402
-rw-r--r--test/lib/profile_test_all.rb91
-rw-r--r--test/lib/test/unit.rb1025
-rw-r--r--test/lib/test/unit/assertions.rb844
-rw-r--r--test/lib/test/unit/parallel.rb191
-rw-r--r--test/lib/test/unit/testcase.rb36
-rw-r--r--test/lib/tracepointchecker.rb119
-rw-r--r--test/lib/with_different_ofs.rb18
-rw-r--r--test/lib/zombie_hunter.rb9
-rw-r--r--test/logger/test_logdevice.rb655
-rw-r--r--test/logger/test_logger.rb344
-rw-r--r--test/logger/test_severity.rb16
-rw-r--r--test/matrix/test_matrix.rb194
-rw-r--r--test/matrix/test_vector.rb71
-rw-r--r--test/minitest/metametameta.rb9
-rw-r--r--test/minitest/test_minitest_benchmark.rb22
-rw-r--r--test/minitest/test_minitest_mock.rb77
-rw-r--r--test/minitest/test_minitest_spec.rb738
-rw-r--r--test/minitest/test_minitest_unit.rb469
-rw-r--r--test/misc/test_ruby_mode.rb6
-rw-r--r--test/mkmf/base.rb29
-rw-r--r--test/mkmf/test_config.rb17
-rw-r--r--test/mkmf/test_constant.rb38
-rw-r--r--test/mkmf/test_convertible.rb1
-rw-r--r--test/mkmf/test_find_executable.rb1
-rw-r--r--test/mkmf/test_flags.rb22
-rw-r--r--test/mkmf/test_framework.rb43
-rw-r--r--test/mkmf/test_have_func.rb1
-rw-r--r--test/mkmf/test_have_library.rb11
-rw-r--r--test/mkmf/test_have_macro.rb9
-rw-r--r--test/mkmf/test_libs.rb87
-rw-r--r--test/mkmf/test_signedness.rb1
-rw-r--r--test/mkmf/test_sizeof.rb1
-rw-r--r--test/monitor/test_monitor.rb158
-rw-r--r--test/net/ftp/test_buffered_socket.rb42
-rw-r--r--test/net/ftp/test_ftp.rb924
-rw-r--r--test/net/ftp/test_mlsx_entry.rb98
-rw-r--r--test/net/http/test_buffered_io.rb1
-rw-r--r--test/net/http/test_http.rb286
-rw-r--r--test/net/http/test_http_request.rb23
-rw-r--r--test/net/http/test_httpheader.rb9
-rw-r--r--test/net/http/test_httpresponse.rb167
-rw-r--r--test/net/http/test_httpresponses.rb1
-rw-r--r--test/net/http/test_https.rb47
-rw-r--r--test/net/http/test_https_proxy.rb32
-rw-r--r--test/net/http/utils.rb26
-rw-r--r--test/net/imap/Makefile15
-rw-r--r--test/net/imap/cacert.pem84
-rw-r--r--test/net/imap/server.crt65
-rw-r--r--test/net/imap/test_imap.rb475
-rw-r--r--test/net/imap/test_imap_response_parser.rb121
-rw-r--r--test/net/pop/test_pop.rb31
-rw-r--r--test/net/protocol/test_protocol.rb10
-rw-r--r--test/net/smtp/test_response.rb5
-rw-r--r--test/net/smtp/test_smtp.rb43
-rw-r--r--test/net/smtp/test_ssl_socket.rb7
-rw-r--r--test/nkf/test_kconv.rb1
-rw-r--r--test/nkf/test_nkf.rb1
-rw-r--r--test/objspace/test_objspace.rb293
-rw-r--r--test/open-uri/test_open-uri.rb221
-rw-r--r--test/open-uri/test_ssl.rb144
-rw-r--r--test/openssl/ssl_server.rb81
-rw-r--r--test/openssl/test_asn1.rb13
-rw-r--r--test/openssl/test_bn.rb54
-rw-r--r--test/openssl/test_buffering.rb5
-rw-r--r--test/openssl/test_cipher.rb19
-rw-r--r--test/openssl/test_config.rb33
-rw-r--r--test/openssl/test_digest.rb20
-rw-r--r--test/openssl/test_engine.rb3
-rw-r--r--test/openssl/test_fips.rb3
-rw-r--r--test/openssl/test_hmac.rb12
-rw-r--r--test/openssl/test_ns_spki.rb3
-rw-r--r--test/openssl/test_ocsp.rb3
-rw-r--r--test/openssl/test_pair.rb359
-rw-r--r--test/openssl/test_partial_record_read.rb35
-rw-r--r--test/openssl/test_pkcs12.rb11
-rw-r--r--test/openssl/test_pkcs5.rb3
-rw-r--r--test/openssl/test_pkcs7.rb144
-rw-r--r--test/openssl/test_pkey_dh.rb26
-rw-r--r--test/openssl/test_pkey_dsa.rb3
-rw-r--r--test/openssl/test_pkey_ec.rb35
-rw-r--r--test/openssl/test_pkey_rsa.rb33
-rw-r--r--test/openssl/test_random.rb17
-rw-r--r--test/openssl/test_ssl.rb715
-rw-r--r--test/openssl/test_ssl_session.rb128
-rw-r--r--test/openssl/test_x509cert.rb38
-rw-r--r--test/openssl/test_x509crl.rb4
-rw-r--r--test/openssl/test_x509ext.rb27
-rw-r--r--test/openssl/test_x509name.rb3
-rw-r--r--test/openssl/test_x509req.rb33
-rw-r--r--test/openssl/test_x509store.rb7
-rw-r--r--test/openssl/utils.rb129
-rw-r--r--test/optparse/test_acceptable.rb196
-rw-r--r--test/optparse/test_autoconf.rb1
-rw-r--r--test/optparse/test_bash_completion.rb1
-rw-r--r--test/optparse/test_cclass.rb18
-rw-r--r--test/optparse/test_getopts.rb1
-rw-r--r--test/optparse/test_noarg.rb1
-rw-r--r--test/optparse/test_optarg.rb1
-rw-r--r--test/optparse/test_optparse.rb4
-rw-r--r--test/optparse/test_placearg.rb1
-rw-r--r--test/optparse/test_reqarg.rb1
-rw-r--r--test/optparse/test_summary.rb1
-rw-r--r--test/optparse/test_zsh_completion.rb1
-rw-r--r--test/ostruct/test_ostruct.rb73
-rw-r--r--test/pathname/test_pathname.rb138
-rw-r--r--test/profile_test_all.rb52
-rw-r--r--test/psych/handlers/test_recorder.rb1
-rw-r--r--test/psych/helper.rb70
-rw-r--r--test/psych/json/test_stream.rb3
-rw-r--r--test/psych/nodes/test_enumerable.rb1
-rw-r--r--test/psych/test_alias_and_anchor.rb3
-rw-r--r--test/psych/test_array.rb3
-rw-r--r--test/psych/test_boolean.rb3
-rw-r--r--test/psych/test_class.rb3
-rw-r--r--test/psych/test_coder.rb29
-rw-r--r--test/psych/test_date_time.rb24
-rw-r--r--test/psych/test_deprecated.rb9
-rw-r--r--test/psych/test_document.rb3
-rw-r--r--test/psych/test_emitter.rb24
-rw-r--r--test/psych/test_encoding.rb131
-rw-r--r--test/psych/test_engine_manager.rb47
-rw-r--r--test/psych/test_exception.rb47
-rw-r--r--test/psych/test_hash.rb53
-rw-r--r--test/psych/test_json_tree.rb5
-rw-r--r--test/psych/test_marshalable.rb55
-rw-r--r--test/psych/test_merge_keys.rb102
-rw-r--r--test/psych/test_nil.rb3
-rw-r--r--test/psych/test_null.rb3
-rw-r--r--test/psych/test_numeric.rb7
-rw-r--r--test/psych/test_object.rb3
-rw-r--r--test/psych/test_object_references.rb7
-rw-r--r--test/psych/test_omap.rb3
-rw-r--r--test/psych/test_parser.rb3
-rw-r--r--test/psych/test_psych.rb48
-rw-r--r--test/psych/test_safe_load.rb98
-rw-r--r--test/psych/test_scalar.rb3
-rw-r--r--test/psych/test_scalar_scanner.rb5
-rw-r--r--test/psych/test_serialize_subclasses.rb3
-rw-r--r--test/psych/test_set.rb3
-rw-r--r--test/psych/test_stream.rb3
-rw-r--r--test/psych/test_string.rb140
-rw-r--r--test/psych/test_struct.rb3
-rw-r--r--test/psych/test_symbol.rb11
-rw-r--r--test/psych/test_tainted.rb17
-rw-r--r--test/psych/test_to_yaml_properties.rb5
-rw-r--r--test/psych/test_tree_builder.rb3
-rw-r--r--test/psych/test_yaml.rb21
-rw-r--r--test/psych/test_yamldbm.rb8
-rw-r--r--test/psych/test_yamlstore.rb5
-rw-r--r--test/psych/visitors/test_depth_first.rb1
-rw-r--r--test/psych/visitors/test_emitter.rb1
-rw-r--r--test/psych/visitors/test_to_ruby.rb32
-rw-r--r--test/psych/visitors/test_yaml_tree.rb11
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb562
-rw-r--r--test/rake/test_private_reader.rb42
-rw-r--r--test/rake/test_rake.rb40
-rw-r--r--test/rake/test_rake_application.rb531
-rw-r--r--test/rake/test_rake_application_options.rb460
-rw-r--r--test/rake/test_rake_backtrace.rb89
-rw-r--r--test/rake/test_rake_clean.rb14
-rw-r--r--test/rake/test_rake_definitions.rb80
-rw-r--r--test/rake/test_rake_directory_task.rb57
-rw-r--r--test/rake/test_rake_dsl.rb77
-rw-r--r--test/rake/test_rake_early_time.rb31
-rw-r--r--test/rake/test_rake_extension.rb59
-rw-r--r--test/rake/test_rake_file_creation_task.rb56
-rw-r--r--test/rake/test_rake_file_list.rb628
-rw-r--r--test/rake/test_rake_file_list_path_map.rb8
-rw-r--r--test/rake/test_rake_file_task.rb122
-rw-r--r--test/rake/test_rake_file_utils.rb305
-rw-r--r--test/rake/test_rake_ftp_file.rb59
-rw-r--r--test/rake/test_rake_functional.rb496
-rw-r--r--test/rake/test_rake_invocation_chain.rb52
-rw-r--r--test/rake/test_rake_makefile_loader.rb44
-rw-r--r--test/rake/test_rake_multi_task.rb59
-rw-r--r--test/rake/test_rake_name_space.rb43
-rw-r--r--test/rake/test_rake_package_task.rb79
-rw-r--r--test/rake/test_rake_path_map.rb157
-rw-r--r--test/rake/test_rake_path_map_explode.rb34
-rw-r--r--test/rake/test_rake_path_map_partial.rb18
-rw-r--r--test/rake/test_rake_pseudo_status.rb21
-rw-r--r--test/rake/test_rake_rake_test_loader.rb21
-rw-r--r--test/rake/test_rake_rdoc_task.rb83
-rw-r--r--test/rake/test_rake_reduce_compat.rb65
-rw-r--r--test/rake/test_rake_require.rb40
-rw-r--r--test/rake/test_rake_rules.rb327
-rw-r--r--test/rake/test_rake_task.rb316
-rw-r--r--test/rake/test_rake_task_argument_parsing.rb103
-rw-r--r--test/rake/test_rake_task_arguments.rb88
-rw-r--r--test/rake/test_rake_task_lib.rb9
-rw-r--r--test/rake/test_rake_task_manager.rb157
-rw-r--r--test/rake/test_rake_task_manager_argument_resolution.rb36
-rw-r--r--test/rake/test_rake_task_with_arguments.rb181
-rw-r--r--test/rake/test_rake_test_task.rb120
-rw-r--r--test/rake/test_rake_thread_pool.rb123
-rw-r--r--test/rake/test_rake_top_level_functions.rb111
-rw-r--r--test/rake/test_rake_win32.rb72
-rw-r--r--test/rake/test_sys.rb20
-rw-r--r--test/rake/test_thread_history_display.rb91
-rw-r--r--test/rake/test_trace_output.rb43
-rw-r--r--test/rdoc/test.ja.large.rdoc3
-rw-r--r--test/rdoc/test_attribute_manager.rb120
-rw-r--r--test/rdoc/test_rdoc_alias.rb1
-rw-r--r--test/rdoc/test_rdoc_any_method.rb156
-rw-r--r--test/rdoc/test_rdoc_attr.rb5
-rw-r--r--test/rdoc/test_rdoc_class_module.rb80
-rw-r--r--test/rdoc/test_rdoc_code_object.rb150
-rw-r--r--test/rdoc/test_rdoc_comment.rb1
-rw-r--r--test/rdoc/test_rdoc_constant.rb35
-rw-r--r--test/rdoc/test_rdoc_context.rb20
-rw-r--r--test/rdoc/test_rdoc_context_section.rb8
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb8
-rw-r--r--test/rdoc/test_rdoc_encoding.rb24
-rw-r--r--test/rdoc/test_rdoc_extend.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb91
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb72
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot.rb92
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po.rb52
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po_entry.rb140
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb9
-rw-r--r--test/rdoc/test_rdoc_i18n_locale.rb74
-rw-r--r--test/rdoc/test_rdoc_i18n_text.rb124
-rw-r--r--test/rdoc/test_rdoc_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markdown.rb28
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb8
-rw-r--r--test/rdoc/test_rdoc_markup.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb128
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb8
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb33
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb12
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb8
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb21
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb8
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb156
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb8
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb24
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb9
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb7
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb1
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb41
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb14
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb6
-rw-r--r--test/rdoc/test_rdoc_options.rb168
-rw-r--r--test/rdoc/test_rdoc_parser.rb43
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb198
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb10
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb10
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb372
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb3
-rw-r--r--test/rdoc/test_rdoc_rd.rb1
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb13
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb1
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb2
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb73
-rw-r--r--test/rdoc/test_rdoc_require.rb1
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb32
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb1
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb149
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb1
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb6
-rw-r--r--test/rdoc/test_rdoc_servlet.rb128
-rw-r--r--test/rdoc/test_rdoc_single_class.rb19
-rw-r--r--test/rdoc/test_rdoc_stats.rb358
-rw-r--r--test/rdoc/test_rdoc_store.rb78
-rw-r--r--test/rdoc/test_rdoc_task.rb58
-rw-r--r--test/rdoc/test_rdoc_text.rb78
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb1
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb61
-rw-r--r--test/rdoc/test_rdoc_top_level.rb19
-rw-r--r--test/rdoc/xref_data.rb1
-rw-r--r--test/rdoc/xref_test_case.rb3
-rw-r--r--test/readline/test_readline.rb233
-rw-r--r--test/readline/test_readline_history.rb36
-rw-r--r--test/resolv/test_addr.rb14
-rw-r--r--test/resolv/test_dns.rb205
-rw-r--r--test/resolv/test_resource.rb22
-rw-r--r--test/rexml/data/ticket_110_utf16.xml (renamed from test/rexml/data/utf16.xml)bin207464 -> 207464 bytes-rw-r--r--test/rexml/data/tutorial.xml2
-rw-r--r--test/rexml/listener.rb95
-rw-r--r--test/rexml/parse/test_document_type_declaration.rb50
-rw-r--r--test/rexml/parse/test_notation_declaration.rb100
-rw-r--r--test/rexml/parser/test_sax2.rb203
-rw-r--r--test/rexml/parser/test_tree.rb43
-rw-r--r--test/rexml/parser/test_ultra_light.rb70
-rw-r--r--test/rexml/rexml_test_utils.rb2
-rw-r--r--test/rexml/test_attributes.rb341
-rw-r--r--test/rexml/test_attributes_mixin.rb52
-rw-r--r--test/rexml/test_changing_encoding.rb69
-rw-r--r--test/rexml/test_comment.rb3
-rw-r--r--test/rexml/test_contrib.rb882
-rw-r--r--test/rexml/test_core.rb2464
-rw-r--r--test/rexml/test_doctype.rb194
-rw-r--r--test/rexml/test_document.rb475
-rw-r--r--test/rexml/test_elements.rb197
-rw-r--r--test/rexml/test_encoding.rb164
-rw-r--r--test/rexml/test_encoding_2.rb59
-rw-r--r--test/rexml/test_entity.rb309
-rw-r--r--test/rexml/test_functions.rb402
-rw-r--r--test/rexml/test_functions_number.rb53
-rw-r--r--test/rexml/test_jaxen.rb212
-rw-r--r--test/rexml/test_light.rb173
-rw-r--r--test/rexml/test_lightparser.rb20
-rw-r--r--test/rexml/test_listener.rb208
-rw-r--r--test/rexml/test_martin_fowler.rb41
-rw-r--r--test/rexml/test_namespace.rb57
-rw-r--r--test/rexml/test_notationdecl_mixin.rb58
-rw-r--r--test/rexml/test_notationdecl_parsetest.rb23
-rw-r--r--test/rexml/test_order.rb177
-rw-r--r--test/rexml/test_preceding_sibling.rb57
-rw-r--r--test/rexml/test_pullparser.rb161
-rw-r--r--test/rexml/test_rexml_issuezilla.rb23
-rw-r--r--test/rexml/test_sax.rb486
-rw-r--r--test/rexml/test_stream.rb190
-rw-r--r--test/rexml/test_text.rb22
-rw-r--r--test/rexml/test_ticket_80.rb47
-rw-r--r--test/rexml/test_validation_rng.rb617
-rw-r--r--test/rexml/test_xml_declaration.rb44
-rw-r--r--test/rexml/test_xpath.rb1079
-rw-r--r--test/rexml/test_xpath_attribute_query.rb89
-rw-r--r--test/rexml/test_xpath_msw.rb38
-rw-r--r--test/rexml/test_xpath_pred.rb80
-rw-r--r--test/rexml/test_xpathtext.rb72
-rw-r--r--test/rexml/xpath/test_attribute.rb30
-rw-r--r--test/rexml/xpath/test_axis_preceding_sibling.rb40
-rw-r--r--test/rexml/xpath/test_base.rb1090
-rw-r--r--test/rexml/xpath/test_node.rb43
-rw-r--r--test/rexml/xpath/test_predicate.rb83
-rw-r--r--test/rexml/xpath/test_text.rb75
-rw-r--r--test/rinda/test_rinda.rb372
-rw-r--r--test/rinda/test_tuplebag.rb1
-rw-r--r--test/ripper/dummyparser.rb9
-rw-r--r--test/ripper/test_files.rb62
-rw-r--r--test/ripper/test_filter.rb3
-rw-r--r--test/ripper/test_parser_events.rb234
-rw-r--r--test/ripper/test_ripper.rb34
-rw-r--r--test/ripper/test_scanner_events.rb103
-rw-r--r--test/ripper/test_sexp.rb85
-rw-r--r--test/rss/rss-assertions.rb5
-rw-r--r--test/rss/rss-testcase.rb3
-rw-r--r--test/rss/test_1.0.rb3
-rw-r--r--test/rss/test_2.0.rb3
-rw-r--r--test/rss/test_accessor.rb3
-rw-r--r--test/rss/test_atom.rb3
-rw-r--r--test/rss/test_content.rb3
-rw-r--r--test/rss/test_dublincore.rb3
-rw-r--r--test/rss/test_image.rb3
-rw-r--r--test/rss/test_inherit.rb3
-rw-r--r--test/rss/test_itunes.rb3
-rw-r--r--test/rss/test_maker_0.9.rb3
-rw-r--r--test/rss/test_maker_1.0.rb3
-rw-r--r--test/rss/test_maker_2.0.rb3
-rw-r--r--test/rss/test_maker_atom_entry.rb3
-rw-r--r--test/rss/test_maker_atom_feed.rb3
-rw-r--r--test/rss/test_maker_content.rb3
-rw-r--r--test/rss/test_maker_dc.rb3
-rw-r--r--test/rss/test_maker_image.rb3
-rw-r--r--test/rss/test_maker_itunes.rb7
-rw-r--r--test/rss/test_maker_slash.rb3
-rw-r--r--test/rss/test_maker_sy.rb3
-rw-r--r--test/rss/test_maker_taxo.rb3
-rw-r--r--test/rss/test_maker_trackback.rb3
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb3
-rw-r--r--test/rss/test_parser.rb13
-rw-r--r--test/rss/test_parser_1.0.rb3
-rw-r--r--test/rss/test_parser_2.0.rb3
-rw-r--r--test/rss/test_parser_atom_entry.rb3
-rw-r--r--test/rss/test_parser_atom_feed.rb3
-rw-r--r--test/rss/test_setup_maker_0.9.rb3
-rw-r--r--test/rss/test_setup_maker_1.0.rb3
-rw-r--r--test/rss/test_setup_maker_2.0.rb3
-rw-r--r--test/rss/test_setup_maker_atom_entry.rb3
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb3
-rw-r--r--test/rss/test_setup_maker_itunes.rb4
-rw-r--r--test/rss/test_setup_maker_slash.rb3
-rw-r--r--test/rss/test_slash.rb3
-rw-r--r--test/rss/test_syndication.rb3
-rw-r--r--test/rss/test_taxonomy.rb3
-rw-r--r--test/rss/test_to_s.rb9
-rw-r--r--test/rss/test_trackback.rb3
-rw-r--r--test/rss/test_version.rb3
-rw-r--r--test/rss/test_xml-stylesheet.rb3
-rw-r--r--test/ruby/allpairs.rb2
-rw-r--r--test/ruby/beginmainend.rb5
-rw-r--r--test/ruby/bug-11928.rb14
-rw-r--r--test/ruby/enc/test_big5.rb1
-rw-r--r--test/ruby/enc/test_cp949.rb1
-rw-r--r--test/ruby/enc/test_emoji.rb7
-rw-r--r--test/ruby/enc/test_euc_jp.rb1
-rw-r--r--test/ruby/enc/test_euc_kr.rb9
-rw-r--r--test/ruby/enc/test_euc_tw.rb1
-rw-r--r--test/ruby/enc/test_gb18030.rb1
-rw-r--r--test/ruby/enc/test_gbk.rb1
-rw-r--r--test/ruby/enc/test_iso_8859.rb1
-rw-r--r--test/ruby/enc/test_koi8.rb1
-rw-r--r--test/ruby/enc/test_shift_jis.rb1
-rw-r--r--test/ruby/enc/test_utf16.rb9
-rw-r--r--test/ruby/enc/test_utf32.rb1
-rw-r--r--test/ruby/enc/test_windows_1251.rb1
-rw-r--r--test/ruby/enc/test_windows_1252.rb26
-rw-r--r--test/ruby/endblockwarn_rb12
-rw-r--r--test/ruby/envutil.rb354
-rw-r--r--test/ruby/lbtest.rb3
-rw-r--r--test/ruby/marshaltestlib.rb103
-rw-r--r--test/ruby/memory_status.rb114
-rw-r--r--test/ruby/sentence.rb1
-rw-r--r--test/ruby/test_alias.rb94
-rw-r--r--test/ruby/test_argf.rb125
-rw-r--r--test/ruby/test_arity.rb47
-rw-r--r--test/ruby/test_array.rb558
-rw-r--r--test/ruby/test_assignment.rb74
-rw-r--r--test/ruby/test_autoload.rb259
-rw-r--r--test/ruby/test_backtrace.rb185
-rw-r--r--test/ruby/test_basicinstructions.rb16
-rw-r--r--test/ruby/test_beginendblock.rb191
-rw-r--r--test/ruby/test_bignum.rb55
-rw-r--r--test/ruby/test_call.rb74
-rw-r--r--test/ruby/test_case.rb42
-rw-r--r--test/ruby/test_class.rb263
-rw-r--r--test/ruby/test_clone.rb1
-rw-r--r--test/ruby/test_comparable.rb31
-rw-r--r--test/ruby/test_complex.rb459
-rw-r--r--test/ruby/test_complex2.rb1
-rw-r--r--test/ruby/test_complexrational.rb13
-rw-r--r--test/ruby/test_condition.rb1
-rw-r--r--test/ruby/test_const.rb20
-rw-r--r--test/ruby/test_continuation.rb4
-rw-r--r--test/ruby/test_defined.rb68
-rw-r--r--test/ruby/test_dir.rb167
-rw-r--r--test/ruby/test_dir_m17n.rb304
-rw-r--r--test/ruby/test_econv.rb37
-rw-r--r--test/ruby/test_encoding.rb29
-rw-r--r--test/ruby/test_enum.rb447
-rw-r--r--test/ruby/test_enumerator.rb99
-rw-r--r--test/ruby/test_env.rb134
-rw-r--r--test/ruby/test_eval.rb85
-rw-r--r--test/ruby/test_exception.rb509
-rw-r--r--test/ruby/test_extlibs.rb87
-rw-r--r--test/ruby/test_fiber.rb82
-rw-r--r--test/ruby/test_file.rb315
-rw-r--r--test/ruby/test_file_exhaustive.rb1231
-rw-r--r--test/ruby/test_fixnum.rb111
-rw-r--r--test/ruby/test_flip.rb31
-rw-r--r--test/ruby/test_float.rb170
-rw-r--r--test/ruby/test_fnmatch.rb180
-rw-r--r--test/ruby/test_gc.rb278
-rw-r--r--test/ruby/test_hash.rb661
-rw-r--r--test/ruby/test_ifunless.rb1
-rw-r--r--test/ruby/test_integer.rb55
-rw-r--r--test/ruby/test_integer_comb.rb18
-rw-r--r--test/ruby/test_io.rb1296
-rw-r--r--test/ruby/test_io_m17n.rb290
-rw-r--r--test/ruby/test_iseq.rb154
-rw-r--r--test/ruby/test_iterator.rb1
-rw-r--r--test/ruby/test_keyword.rb331
-rw-r--r--test/ruby/test_lambda.rb91
-rw-r--r--test/ruby/test_lazy_enumerator.rb204
-rw-r--r--test/ruby/test_literal.rb73
-rw-r--r--test/ruby/test_m17n.rb378
-rw-r--r--test/ruby/test_m17n_comb.rb324
-rw-r--r--test/ruby/test_marshal.rb315
-rw-r--r--test/ruby/test_math.rb175
-rw-r--r--test/ruby/test_metaclass.rb1
-rw-r--r--test/ruby/test_method.rb507
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb3
-rw-r--r--test/ruby/test_module.rb919
-rw-r--r--test/ruby/test_not.rb1
-rw-r--r--test/ruby/test_notimp.rb27
-rw-r--r--test/ruby/test_numeric.rb324
-rw-r--r--test/ruby/test_object.rb344
-rw-r--r--test/ruby/test_objectspace.rb131
-rw-r--r--test/ruby/test_optimization.rb378
-rw-r--r--test/ruby/test_pack.rb143
-rw-r--r--test/ruby/test_parse.rb107
-rw-r--r--test/ruby/test_path.rb4
-rw-r--r--test/ruby/test_pipe.rb14
-rw-r--r--test/ruby/test_primitive.rb5
-rw-r--r--test/ruby/test_proc.rb201
-rw-r--r--test/ruby/test_process.rb1025
-rw-r--r--test/ruby/test_rand.rb58
-rw-r--r--test/ruby/test_range.rb271
-rw-r--r--test/ruby/test_rational.rb410
-rw-r--r--test/ruby/test_rational2.rb1
-rw-r--r--test/ruby/test_readpartial.rb9
-rw-r--r--test/ruby/test_refinement.rb894
-rw-r--r--test/ruby/test_regexp.rb251
-rw-r--r--test/ruby/test_require.rb564
-rw-r--r--test/ruby/test_rubyoptions.rb515
-rw-r--r--test/ruby/test_rubyvm.rb18
-rw-r--r--test/ruby/test_settracefunc.rb645
-rw-r--r--test/ruby/test_signal.rb194
-rw-r--r--test/ruby/test_sleep.rb10
-rw-r--r--test/ruby/test_sprintf.rb120
-rw-r--r--test/ruby/test_sprintf_comb.rb47
-rw-r--r--test/ruby/test_string.rb375
-rw-r--r--test/ruby/test_stringchar.rb9
-rw-r--r--test/ruby/test_struct.rb281
-rw-r--r--test/ruby/test_super.rb220
-rw-r--r--test/ruby/test_symbol.rb251
-rw-r--r--test/ruby/test_syntax.rb508
-rw-r--r--test/ruby/test_system.rb64
-rw-r--r--test/ruby/test_thread.rb411
-rw-r--r--test/ruby/test_threadgroup.rb11
-rw-r--r--test/ruby/test_time.rb180
-rw-r--r--test/ruby/test_time_tz.rb174
-rw-r--r--test/ruby/test_trace.rb1
-rw-r--r--test/ruby/test_transcode.rb217
-rw-r--r--test/ruby/test_undef.rb1
-rw-r--r--test/ruby/test_unicode_escape.rb4
-rw-r--r--test/ruby/test_variable.rb62
-rw-r--r--test/ruby/test_weakmap.rb134
-rw-r--r--test/ruby/test_whileuntil.rb10
-rw-r--r--test/ruby/test_yield.rb61
-rw-r--r--test/ruby/ut_eof.rb5
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/bogussources.rb1
-rw-r--r--test/rubygems/ca_cert.pem23
-rw-r--r--test/rubygems/client.pem49
-rw-r--r--test/rubygems/encrypted_private_key.pem30
-rw-r--r--test/rubygems/fake_certlib/openssl.rb1
-rw-r--r--test/rubygems/fix_openssl_warnings.rb1
-rw-r--r--test/rubygems/foo/discover.rb1
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/insure_session.rb43
-rw-r--r--test/rubygems/invalid_client.pem49
-rw-r--r--test/rubygems/plugin/exception/rubygems_plugin.rb1
-rw-r--r--test/rubygems/plugin/load/rubygems_plugin.rb1
-rw-r--r--test/rubygems/plugin/standarderror/rubygems_plugin.rb1
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb1
-rw-r--r--test/rubygems/rubygems_plugin.rb1
-rw-r--r--test/rubygems/sff/discover.rb1
-rw-r--r--test/rubygems/simple_gem.rb3
-rw-r--r--test/rubygems/specifications/bar-0.0.2.gemspec9
-rw-r--r--test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspecbin269 -> 0 bytes-rw-r--r--test/rubygems/test_bundled_ca.rb59
-rw-r--r--test/rubygems/test_config.rb12
-rw-r--r--test/rubygems/test_deprecate.rb1
-rw-r--r--test/rubygems/test_gem.rb1163
-rw-r--r--test/rubygems/test_gem_available_set.rb26
-rw-r--r--test/rubygems/test_gem_command.rb56
-rw-r--r--test/rubygems/test_gem_command_manager.rb45
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb15
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb184
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb49
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb88
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb65
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb14
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb100
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb20
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb694
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb7
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb14
-rw-r--r--test/rubygems/test_gem_commands_open_command.rb53
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb19
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb62
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb253
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb142
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb433
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb13
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb5
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb109
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb104
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb72
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb7
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb106
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb55
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb366
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb27
-rw-r--r--test/rubygems/test_gem_config_file.rb211
-rw-r--r--test/rubygems/test_gem_dependency.rb147
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb526
-rw-r--r--test/rubygems/test_gem_dependency_list.rb35
-rw-r--r--test/rubygems/test_gem_dependency_resolution_error.rb29
-rw-r--r--test/rubygems/test_gem_dependency_resolver.rb327
-rw-r--r--test/rubygems/test_gem_doctor.rb3
-rw-r--r--test/rubygems/test_gem_ext_builder.rb341
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb19
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb29
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb161
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb5
-rw-r--r--test/rubygems/test_gem_gem_runner.rb31
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb73
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb62
-rw-r--r--test/rubygems/test_gem_indexer.rb24
-rw-r--r--test/rubygems/test_gem_install_update_options.rb56
-rw-r--r--test/rubygems/test_gem_installer.rb570
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb16
-rw-r--r--test/rubygems/test_gem_name_tuple.rb30
-rw-r--r--test/rubygems/test_gem_package.rb371
-rw-r--r--test/rubygems/test_gem_package_old.rb53
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb17
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb30
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb33
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb163
-rw-r--r--test/rubygems/test_gem_package_task.rb33
-rw-r--r--test/rubygems/test_gem_path_support.rb18
-rw-r--r--test/rubygems/test_gem_platform.rb36
-rw-r--r--test/rubygems/test_gem_rdoc.rb3
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb657
-rw-r--r--test/rubygems/test_gem_request.rb363
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb130
-rw-r--r--test/rubygems/test_gem_request_set.rb543
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb831
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb470
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_parser.rb549
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_tokenizer.rb306
-rw-r--r--test/rubygems/test_gem_requirement.rb65
-rw-r--r--test/rubygems/test_gem_resolver.rb715
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb74
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb209
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb145
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb138
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb46
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb88
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb85
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb190
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb114
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb90
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb90
-rw-r--r--test/rubygems/test_gem_resolver_installed_specification.rb50
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb258
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb46
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb64
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb100
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb21
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb65
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb84
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb84
-rw-r--r--test/rubygems/test_gem_security.rb61
-rw-r--r--test/rubygems/test_gem_security_policy.rb233
-rw-r--r--test/rubygems/test_gem_security_signer.rb37
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb9
-rw-r--r--test/rubygems/test_gem_server.rb184
-rw-r--r--test/rubygems/test_gem_silent_ui.rb6
-rw-r--r--test/rubygems/test_gem_source.rb180
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb20
-rw-r--r--test/rubygems/test_gem_source_git.rb309
-rw-r--r--test/rubygems/test_gem_source_installed.rb37
-rw-r--r--test/rubygems/test_gem_source_list.rb27
-rw-r--r--test/rubygems/test_gem_source_local.rb38
-rw-r--r--test/rubygems/test_gem_source_lock.rb115
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb45
-rw-r--r--test/rubygems/test_gem_source_vendor.rb32
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb193
-rw-r--r--test/rubygems/test_gem_specification.rb1812
-rw-r--r--test/rubygems/test_gem_stream_ui.rb13
-rw-r--r--test/rubygems/test_gem_stub_specification.rb217
-rw-r--r--test/rubygems/test_gem_text.rb19
-rw-r--r--test/rubygems/test_gem_uninstaller.rb90
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb33
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb29
-rw-r--r--test/rubygems/test_gem_util.rb40
-rw-r--r--test/rubygems/test_gem_validator.rb10
-rw-r--r--test/rubygems/test_gem_version.rb46
-rw-r--r--test/rubygems/test_gem_version_option.rb65
-rw-r--r--test/rubygems/test_kernel.rb31
-rw-r--r--test/rubygems/test_require.rb370
-rw-r--r--test/runner.rb36
-rw-r--r--test/scanf/test_scanf.rb39
-rw-r--r--test/scanf/test_scanfblocks.rb1
-rw-r--r--test/scanf/test_scanfio.rb1
-rw-r--r--test/sdbm/test_sdbm.rb69
-rw-r--r--test/shell/test_command_processor.rb69
-rw-r--r--test/socket/test_addrinfo.rb26
-rw-r--r--test/socket/test_ancdata.rb2
-rw-r--r--test/socket/test_basicsocket.rb89
-rw-r--r--test/socket/test_nonblock.rb133
-rw-r--r--test/socket/test_socket.rb211
-rw-r--r--test/socket/test_sockopt.rb47
-rw-r--r--test/socket/test_tcp.rb99
-rw-r--r--test/socket/test_udp.rb62
-rw-r--r--test/socket/test_unix.rb334
-rw-r--r--test/stringio/test_stringio.rb146
-rw-r--r--test/strscan/test_stringscanner.rb16
-rw-r--r--test/syslog/test_syslog_logger.rb103
-rw-r--r--test/test_abbrev.rb1
-rw-r--r--test/test_cmath.rb68
-rw-r--r--test/test_curses.rb12
-rw-r--r--test/test_delegate.rb105
-rw-r--r--test/test_find.rb90
-rw-r--r--test/test_forwardable.rb248
-rw-r--r--test/test_ipaddr.rb277
-rw-r--r--test/test_mathn.rb114
-rw-r--r--test/test_mutex_m.rb1
-rw-r--r--test/test_observer.rb66
-rw-r--r--test/test_open3.rb47
-rw-r--r--test/test_pp.rb58
-rw-r--r--test/test_prettyprint.rb14
-rw-r--r--test/test_prime.rb121
-rw-r--r--test/test_pstore.rb22
-rw-r--r--test/test_pty.rb45
-rw-r--r--test/test_rbconfig.rb54
-rw-r--r--test/test_securerandom.rb30
-rw-r--r--test/test_set.rb290
-rw-r--r--test/test_shellwords.rb73
-rw-r--r--test/test_singleton.rb13
-rw-r--r--test/test_syslog.rb113
-rw-r--r--test/test_tempfile.rb75
-rw-r--r--test/test_time.rb302
-rw-r--r--test/test_timeout.rb94
-rw-r--r--test/test_tmpdir.rb26
-rw-r--r--test/test_tracer.rb13
-rw-r--r--test/test_tsort.rb71
-rw-r--r--test/test_unicode_normalize.rb185
-rw-r--r--test/test_weakref.rb38
-rw-r--r--test/test_win32api.rb24
-rw-r--r--test/testunit/test4test_hideskip.rb3
-rw-r--r--test/testunit/test4test_redefinition.rb3
-rw-r--r--test/testunit/test4test_sorting.rb3
-rw-r--r--test/testunit/test_assertion.rb1
-rw-r--r--test/testunit/test_hideskip.rb30
-rw-r--r--test/testunit/test_parallel.rb47
-rw-r--r--test/testunit/test_rake_integration.rb35
-rw-r--r--test/testunit/test_redefinition.rb15
-rw-r--r--test/testunit/test_sorting.rb15
-rw-r--r--test/testunit/tests_for_parallel/ptest_first.rb1
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb9
-rw-r--r--test/testunit/tests_for_parallel/ptest_second.rb1
-rw-r--r--test/testunit/tests_for_parallel/ptest_third.rb1
-rw-r--r--test/testunit/tests_for_parallel/runner.rb4
-rw-r--r--test/thread/test_cv.rb42
-rw-r--r--test/thread/test_queue.rb442
-rw-r--r--test/thread/test_sync.rb7
-rw-r--r--test/uri/test_common.rb119
-rw-r--r--test/uri/test_ftp.rb1
-rw-r--r--test/uri/test_generic.rb110
-rw-r--r--test/uri/test_http.rb1
-rw-r--r--test/uri/test_ldap.rb1
-rw-r--r--test/uri/test_mailto.rb18
-rw-r--r--test/uri/test_parser.rb7
-rw-r--r--test/webrick/test_cgi.rb47
-rw-r--r--test/webrick/test_cookie.rb1
-rw-r--r--test/webrick/test_do_not_reverse_lookup.rb71
-rw-r--r--test/webrick/test_filehandler.rb72
-rw-r--r--test/webrick/test_htmlutils.rb21
-rw-r--r--test/webrick/test_httpauth.rb202
-rw-r--r--test/webrick/test_httpproxy.rb9
-rw-r--r--test/webrick/test_httprequest.rb3
-rw-r--r--test/webrick/test_httpresponse.rb101
-rw-r--r--test/webrick/test_httpserver.rb100
-rw-r--r--test/webrick/test_httputils.rb5
-rw-r--r--test/webrick/test_httpversion.rb1
-rw-r--r--test/webrick/test_server.rb112
-rw-r--r--test/webrick/test_utils.rb91
-rw-r--r--test/webrick/utils.rb62
-rw-r--r--test/webrick/webrick.cgi6
-rw-r--r--test/webrick/webrick_long_filename.cgi2
-rw-r--r--test/win32ole/err_in_callback.rb1
-rw-r--r--test/win32ole/test_err_in_callback.rb32
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb1
-rw-r--r--test/win32ole/test_nil2vtempty.rb1
-rw-r--r--test/win32ole/test_ole_methods.rb1
-rw-r--r--test/win32ole/test_propertyputref.rb1
-rw-r--r--test/win32ole/test_thread.rb26
-rw-r--r--test/win32ole/test_win32ole.rb55
-rw-r--r--test/win32ole/test_win32ole_event.rb169
-rw-r--r--test/win32ole/test_win32ole_method.rb9
-rw-r--r--test/win32ole/test_win32ole_param.rb1
-rw-r--r--test/win32ole/test_win32ole_record.rb213
-rw-r--r--test/win32ole/test_win32ole_type.rb1
-rw-r--r--test/win32ole/test_win32ole_typelib.rb3
-rw-r--r--test/win32ole/test_win32ole_variable.rb1
-rw-r--r--test/win32ole/test_win32ole_variant.rb118
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb1
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb3
-rw-r--r--test/win32ole/test_word.rb18
-rw-r--r--test/with_different_ofs.rb17
-rw-r--r--test/xmlrpc/test_client.rb42
-rw-r--r--test/xmlrpc/test_cookie.rb27
-rw-r--r--test/xmlrpc/test_datetime.rb3
-rw-r--r--test/xmlrpc/test_features.rb7
-rw-r--r--test/xmlrpc/test_marshal.rb3
-rw-r--r--test/xmlrpc/test_parser.rb3
-rw-r--r--test/xmlrpc/test_webrick_server.rb44
-rw-r--r--test/xmlrpc/webrick_testing.rb58
-rw-r--r--test/zlib/test_zlib.rb763
-rw-r--r--thread.c2350
-rw-r--r--thread_pthread.c969
-rw-r--r--thread_pthread.h22
-rw-r--r--thread_sync.c1313
-rw-r--r--thread_win32.c133
-rw-r--r--thread_win32.h11
-rw-r--r--time.c625
-rw-r--r--timev.h41
-rwxr-xr-xtool/bisect.sh42
-rwxr-xr-xtool/change_maker.rb4
-rwxr-xr-xtool/checksum.rb72
-rw-r--r--tool/compile_prelude.rb198
-rwxr-xr-xtool/config.guess1522
-rwxr-xr-xtool/config.sub1771
-rw-r--r--tool/downloader.rb200
-rwxr-xr-xtool/enc-unicode.rb115
-rwxr-xr-xtool/expand-config.rb33
-rwxr-xr-xtool/extlibs.rb143
-rw-r--r--tool/fake.rb64
-rwxr-xr-xtool/file2lastrev.rb166
-rwxr-xr-xtool/gem-unpack.rb15
-rwxr-xr-xtool/gen_dummy_probes.rb15
-rwxr-xr-xtool/gen_ruby_tapset.rb105
-rw-r--r--tool/generic_erb.rb25
-rwxr-xr-xtool/ifchange47
-rwxr-xr-xtool/instruction.rb27
-rwxr-xr-xtool/make-snapshot253
-rw-r--r--tool/make_hgraph.rb95
-rwxr-xr-xtool/mdoc2man.rb8
-rwxr-xr-xtool/merger.rb125
-rw-r--r--tool/mk_call_iseq_optimized.rb72
-rwxr-xr-xtool/mkconfig.rb101
-rwxr-xr-xtool/mkrunnable.rb98
-rw-r--r--tool/probes_to_wiki.rb16
-rwxr-xr-xtool/rbinstall.rb313
-rwxr-xr-xtool/rbuninstall.rb67
-rwxr-xr-xtool/redmine-backporter.rb583
-rwxr-xr-xtool/release.sh38
-rwxr-xr-xtool/rubytest.rb3
-rwxr-xr-xtool/runruby.rb15
-rwxr-xr-xtool/strip-rdoc.rb1
-rw-r--r--tool/transcode-tblgen.rb158
-rwxr-xr-xtool/update-deps702
-rw-r--r--tool/vcs.rb356
-rw-r--r--tool/vpath.rb14
-rwxr-xr-xtool/ytab.sed26
-rw-r--r--transcode.c227
-rw-r--r--transcode_data.h38
-rw-r--r--util.c145
-rw-r--r--variable.c1565
-rw-r--r--version.c95
-rw-r--r--version.h24
-rw-r--r--vm.c2080
-rw-r--r--vm_args.c828
-rw-r--r--vm_backtrace.c483
-rw-r--r--vm_core.h836
-rw-r--r--vm_debug.h8
-rw-r--r--vm_dump.c551
-rw-r--r--vm_eval.c1238
-rw-r--r--vm_exec.c33
-rw-r--r--vm_exec.h19
-rw-r--r--vm_insnhelper.c2639
-rw-r--r--vm_insnhelper.h147
-rw-r--r--vm_method.c1623
-rw-r--r--vm_opts.h15
-rw-r--r--vm_trace.c526
-rw-r--r--vsnprintf.c119
-rw-r--r--win32/Makefile.sub260
-rw-r--r--win32/README.win328
-rwxr-xr-xwin32/configure.bat111
-rw-r--r--win32/dir.h15
-rw-r--r--win32/file.c457
-rw-r--r--win32/file.h45
-rwxr-xr-xwin32/ifchange.bat24
-rwxr-xr-xwin32/mkexports.rb6
-rwxr-xr-xwin32/resource.rb2
-rwxr-xr-xwin32/rm.bat4
-rwxr-xr-xwin32/rmall.bat6
-rwxr-xr-xwin32/rmdirs.bat1
-rw-r--r--win32/rtname.cmd35
-rw-r--r--win32/setup.mak165
-rw-r--r--win32/stub.c24
-rw-r--r--win32/win32.c2444
3572 files changed, 168436 insertions, 345410 deletions
diff --git a/.document b/.document
index fb27ba325d..f955928c89 100644
--- a/.document
+++ b/.document
@@ -10,9 +10,12 @@
prelude.rb
# the lib/ directory (which has its own .document file)
+
lib
+
# and some of the ext/ directory (which has its own .document file)
+
ext
# rdoc files
@@ -20,7 +23,9 @@ ChangeLog
NEWS
-README.md
-README.ja.md
+README
+README.EXT
+README.EXT.ja
+README.ja
doc
diff --git a/.gdbinit b/.gdbinit
index 03c2b653cb..b67115b6a2 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,34 +1,80 @@
-define hook-run
- set $color_type = 0
- set $color_highlite = 0
- set $color_end = 0
-end
-
-define ruby_gdb_init
- if !$color_type
- set $color_type = "\033[31m"
- end
- if !$color_highlite
- set $color_highlite = "\033[36m"
- end
- if !$color_end
- set $color_end = "\033[m"
- end
+define rp
if ruby_dummy_gdb_enums.special_consts
end
-end
-
-# set prompt \033[36m(gdb)\033[m\040
-
-define rp
- ruby_gdb_init
if (VALUE)($arg0) & RUBY_FIXNUM_FLAG
printf "FIXNUM: %ld\n", (long)($arg0) >> 1
else
if ((VALUE)($arg0) & ~(~(VALUE)0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
set $id = (($arg0) >> RUBY_SPECIAL_SHIFT)
- printf "%sSYMBOL%s: ", $color_type, $color_end
- rp_id $id
+ if $id == '!' || $id == '+' || $id == '-' || $id == '*' || $id == '/' || $id == '%' || $id == '<' || $id == '>' || $id == '`'
+ printf "SYMBOL(:%c)\n", $id
+ else
+ if $id == idDot2
+ echo SYMBOL(:..)\n
+ else
+ if $id == idDot3
+ echo SYMBOL(:...)\n
+ else
+ if $id == idUPlus
+ echo SYMBOL(:+@)\n
+ else
+ if $id == idUMinus
+ echo SYMBOL(:-@)\n
+ else
+ if $id == idPow
+ echo SYMBOL(:**)\n
+ else
+ if $id == idCmp
+ echo SYMBOL(:<=>)\n
+ else
+ if $id == idLTLT
+ echo SYMBOL(:<<)\n
+ else
+ if $id == idLE
+ echo SYMBOL(:<=)\n
+ else
+ if $id == idGE
+ echo SYMBOL(:>=)\n
+ else
+ if $id == idEq
+ echo SYMBOL(:==)\n
+ else
+ if $id == idEqq
+ echo SYMBOL(:===)\n
+ else
+ if $id == idNeq
+ echo SYMBOL(:!=)\n
+ else
+ if $id == idEqTilde
+ echo SYMBOL(:=~)\n
+ else
+ if $id == idNeqTilde
+ echo SYMBOL(:!~)\n
+ else
+ if $id == idAREF
+ echo SYMBOL(:[])\n
+ else
+ if $id == idASET
+ echo SYMBOL(:[]=)\n
+ else
+ printf "SYMBOL(%ld)\n", $id
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
else
if ($arg0) == RUBY_Qfalse
echo false\n
@@ -44,51 +90,80 @@ define rp
else
if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK
if ((VALUE)($arg0) & RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
- printf "%sFLONUM%s: %g\n", $color_type, $color_end, (double)rb_float_value($arg0)
+ printf "FLONUM: %g\n", (double)rb_float_value($arg0)
else
echo immediate\n
end
else
set $flags = ((struct RBasic*)($arg0))->flags
- if ($flags & RUBY_FL_PROMOTED) == RUBY_FL_PROMOTED
- printf "[PROMOTED] "
- end
if ($flags & RUBY_T_MASK) == RUBY_T_NONE
- printf "%sT_NONE%s: ", $color_type, $color_end
+ printf "T_NONE: "
print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_NIL
- printf "%sT_NIL%s: ", $color_type, $color_end
+ printf "T_NIL: "
print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
- printf "%sT_OBJECT%s: ", $color_type, $color_end
+ printf "T_OBJECT: "
print (struct RObject *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
- printf "%sT_CLASS%s%s: ", $color_type, ($flags & RUBY_FL_SINGLETON) ? "*" : "", $color_end
+ printf "T_CLASS%s: ", ($flags & RUBY_FL_SINGLETON) ? "*" : ""
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
- printf "%sT_ICLASS%s: ", $color_type, $color_end
+ printf "T_ICLASS: "
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
- printf "%sT_MODULE%s: ", $color_type, $color_end
+ printf "T_MODULE: "
rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
- printf "%sT_FLOAT%s: %.16g ", $color_type, $color_end, (((struct RFloat*)($arg0))->float_value)
+ printf "T_FLOAT: %.16g ", (((struct RFloat*)($arg0))->float_value)
print (struct RFloat *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_STRING
- printf "%sT_STRING%s: ", $color_type, $color_end
- rp_string $arg0 $flags
+ printf "T_STRING: "
+ set print address off
+ output (char *)(($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)($arg0))->as.heap.ptr : \
+ ((struct RString*)($arg0))->as.ary)
+ set print address on
+ printf " bytesize:%ld ", ($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)($arg0))->as.heap.len : \
+ (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ if !($flags & RUBY_FL_USER1)
+ printf "(embed) "
+ else
+ if ($flags & RUBY_FL_USER2)
+ printf "(shared) "
+ end
+ if ($flags & RUBY_FL_USER3)
+ printf "(assoc) "
+ end
+ end
+ printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == 0
+ printf "coderange:unknown "
+ else
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT
+ printf "coderange:7bit "
+ else
+ if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID
+ printf "coderange:valid "
+ else
+ printf "coderange:broken "
+ end
+ end
+ end
+ print (struct RString *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_REGEXP
set $regsrc = ((struct RRegexp*)($arg0))->src
set $rsflags = ((struct RBasic*)$regsrc)->flags
- printf "%sT_REGEXP%s: ", $color_type, $color_end
+ printf "T_REGEXP: "
set print address off
output (char *)(($rsflags & RUBY_FL_USER1) ? \
((struct RString*)$regsrc)->as.heap.ptr : \
@@ -112,7 +187,7 @@ define rp
if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY
if ($flags & RUBY_FL_USER1)
set $len = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
- printf "%sT_ARRAY%s: len=%ld ", $color_type, $color_end, $len
+ printf "T_ARRAY: len=%ld ", $len
printf "(embed) "
if ($len == 0)
printf "{(empty)} "
@@ -122,7 +197,7 @@ define rp
end
else
set $len = ((struct RArray*)($arg0))->as.heap.len
- printf "%sT_ARRAY%s: len=%ld ", $color_type, $color_end, $len
+ printf "T_ARRAY: len=%ld ", $len
if ($flags & RUBY_FL_USER2)
printf "(shared) shared="
output/x ((struct RArray*)($arg0))->as.heap.aux.shared
@@ -140,18 +215,18 @@ define rp
print (struct RArray *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM
- printf "%sT_FIXNUM%s: ", $color_type, $color_end
+ printf "T_FIXNUM: "
print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_HASH
- printf "%sT_HASH%s: ", $color_type, $color_end,
+ printf "T_HASH: ",
if ((struct RHash *)($arg0))->ntbl
printf "len=%ld ", ((struct RHash *)($arg0))->ntbl->num_entries
end
print (struct RHash *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
- printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, \
+ printf "T_STRUCT: len=%ld ", \
(($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
((struct RStruct *)($arg0))->as.heap.len)
@@ -161,7 +236,7 @@ define rp
((struct RStruct *)($arg0))->as.heap.ptr)
else
if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
- printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \
+ printf "T_BIGNUM: sign=%d len=%ld ", \
(($flags & RUBY_FL_USER1) != 0), \
(($flags & RUBY_FL_USER2) ? \
($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
@@ -175,93 +250,59 @@ define rp
((struct RBignum*)($arg0))->as.heap.digits)
else
if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
- printf "%sT_RATIONAL%s: ", $color_type, $color_end
+ printf "T_RATIONAL: "
print (struct RRational *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX
- printf "%sT_COMPLEX%s: ", $color_type, $color_end
+ printf "T_COMPLEX: "
print (struct RComplex *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_FILE
- printf "%sT_FILE%s: ", $color_type, $color_end
+ printf "T_FILE: "
print (struct RFile *)($arg0)
output *((struct RFile *)($arg0))->fptr
printf "\n"
else
if ($flags & RUBY_T_MASK) == RUBY_T_TRUE
- printf "%sT_TRUE%s: ", $color_type, $color_end
+ printf "T_TRUE: "
print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_FALSE
- printf "%sT_FALSE%s: ", $color_type, $color_end
+ printf "T_FALSE: "
print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_DATA
if ((struct RTypedData *)($arg0))->typed_flag == 1
- printf "%sT_DATA%s(%s): ", $color_type, $color_end, ((struct RTypedData *)($arg0))->type->wrap_struct_name
+ printf "T_DATA(%s): ", ((struct RTypedData *)($arg0))->type->wrap_struct_name
print (struct RTypedData *)($arg0)
else
- printf "%sT_DATA%s: ", $color_type, $color_end
+ printf "T_DATA: "
print (struct RData *)($arg0)
end
else
if ($flags & RUBY_T_MASK) == RUBY_T_MATCH
- printf "%sT_MATCH%s: ", $color_type, $color_end
+ printf "T_MATCH: "
print (struct RMatch *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
- printf "%sT_SYMBOL%s: ", $color_type, $color_end
- print (struct RSymbol *)($arg0)
- set $id_type = ((struct RSymbol *)($arg0))->id & RUBY_ID_SCOPE_MASK
- if $id_type == RUBY_ID_LOCAL
- printf "l"
- else
- if $id_type == RUBY_ID_INSTANCE
- printf "i"
- else
- if $id_type == RUBY_ID_GLOBAL
- printf "G"
- else
- if $id_type == RUBY_ID_ATTRSET
- printf "a"
- else
- if $id_type == RUBY_ID_CONST
- printf "C"
- else
- if $id_type == RUBY_ID_CLASS
- printf "c"
- else
- printf "j"
- end
- end
- end
- end
- end
- end
- set $id_fstr = ((struct RSymbol *)($arg0))->fstr
- rp_string $id_fstr
+ printf "T_SYMBOL: "
+ print (struct RBasic *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
- printf "%sT_UNDEF%s: ", $color_type, $color_end
+ printf "T_UNDEF: "
print (struct RBasic *)($arg0)
else
- if ($flags & RUBY_T_MASK) == RUBY_T_IMEMO
- printf "%sT_IMEMO%s(", $color_type, $color_end
- output (enum imemo_type)(($flags>>RUBY_FL_USHIFT)&imemo_mask)
- printf "): "
- rp_imemo $arg0
- else
if ($flags & RUBY_T_MASK) == RUBY_T_NODE
- printf "%sT_NODE%s(", $color_type, $color_end
+ printf "T_NODE("
output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
printf "): "
print *(NODE *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_ZOMBIE
- printf "%sT_ZOMBIE%s: ", $color_type, $color_end
+ printf "T_ZOMBIE: "
print (struct RData *)($arg0)
else
- printf "%sunknown%s: ", $color_type, $color_end
+ printf "unknown: "
print (struct RBasic *)($arg0)
end
end
@@ -295,171 +336,17 @@ define rp
end
end
end
- end
end
document rp
Print a Ruby's VALUE.
end
-define rp_id
- set $id = (ID)$arg0
- if $id == '!' || $id == '+' || $id == '-' || $id == '*' || $id == '/' || $id == '%' || $id == '<' || $id == '>' || $id == '`'
- printf "(:%c)\n", $id
- else
- if $id == idDot2
- printf "(:..)\n"
- else
- if $id == idDot3
- printf "(:...)\n"
- else
- if $id == idUPlus
- printf "(:+@)\n"
- else
- if $id == idUMinus
- printf "(:-@)\n"
- else
- if $id == idPow
- printf "(:**)\n"
- else
- if $id == idCmp
- printf "(:<=>)\n"
- else
- if $id == idLTLT
- printf "(:<<)\n"
- else
- if $id == idLE
- printf "(:<=)\n"
- else
- if $id == idGE
- printf "(:>=)\n"
- else
- if $id == idEq
- printf "(:==)\n"
- else
- if $id == idEqq
- printf "(:===)\n"
- else
- if $id == idNeq
- printf "(:!=)\n"
- else
- if $id == idEqTilde
- printf "(:=~)\n"
- else
- if $id == idNeqTilde
- printf "(:!~)\n"
- else
- if $id == idAREF
- printf "(:[])\n"
- else
- if $id == idASET
- printf "(:[]=)\n"
- else
- if $id <= tLAST_OP_ID
- printf "O"
- else
- set $id_type = $id & RUBY_ID_SCOPE_MASK
- if $id_type == RUBY_ID_LOCAL
- printf "l"
- else
- if $id_type == RUBY_ID_INSTANCE
- printf "i"
- else
- if $id_type == RUBY_ID_GLOBAL
- printf "G"
- else
- if $id_type == RUBY_ID_ATTRSET
- printf "a"
- else
- if $id_type == RUBY_ID_CONST
- printf "C"
- else
- if $id_type == RUBY_ID_CLASS
- printf "c"
- else
- printf "j"
- end
- end
- end
- end
- end
- end
- end
- printf "(%ld): ", $id
- set $str = lookup_id_str($id)
- if $str
- rp_string $str
- else
- echo undef\n
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
-end
-document rp_id
- Print an ID.
-end
-
-define rp_string
- set $flags = ((struct RBasic*)($arg0))->flags
- set print address off
- output (char *)(($flags & RUBY_FL_USER1) ? \
- ((struct RString*)($arg0))->as.heap.ptr : \
- ((struct RString*)($arg0))->as.ary)
- set print address on
- printf " bytesize:%ld ", ($flags & RUBY_FL_USER1) ? \
- ((struct RString*)($arg0))->as.heap.len : \
- (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
- if !($flags & RUBY_FL_USER1)
- printf "(embed) "
- else
- if ($flags & RUBY_FL_USER2)
- printf "(shared) "
- end
- if ($flags & RUBY_FL_USER3)
- printf "(assoc) "
- end
- end
- printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
- if ($flags & RUBY_ENC_CODERANGE_MASK) == 0
- printf "coderange:unknown "
- else
- if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_7BIT
- printf "coderange:7bit "
- else
- if ($flags & RUBY_ENC_CODERANGE_MASK) == RUBY_ENC_CODERANGE_VALID
- printf "coderange:valid "
- else
- printf "coderange:broken "
- end
- end
- end
- print (struct RString *)($arg0)
-end
-document rp_string
- Print the content of a String.
-end
-
define rp_class
printf "(struct RClass *) %p", (void*)$arg0
- if ((struct RClass *)($arg0))->ptr.origin_ != $arg0
- printf " -> %p", ((struct RClass *)($arg0))->ptr.origin_
+ if ((struct RClass *)($arg0))->ptr.origin != $arg0
+ printf " -> %p", ((struct RClass *)($arg0))->ptr.origin
end
printf "\n"
- rb_classname $arg0
print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
end
@@ -467,40 +354,6 @@ document rp_class
Print the content of a Class/Module.
end
-define rp_imemo
- set $flags = (((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & imemo_mask
- if $flags == imemo_cref
- printf "(rb_cref_t *) %p\n", (void*)$arg0
- print *(rb_cref_t *)$arg0
- else
- if $flags == imemo_svar
- printf "(struct vm_svar *) %p\n", (void*)$arg0
- print *(struct vm_svar *)$arg0
- else
- if $flags == imemo_throw_data
- printf "(struct vm_throw_data *) %p\n", (void*)$arg0
- print *(struct vm_throw_data *)$arg0
- else
- if $flags == imemo_ifunc
- printf "(struct vm_ifunc *) %p\n", (void*)$arg0
- print *(struct vm_ifunc *)$arg0
- else
- if $flags == imemo_memo
- printf "(struct MEMO *) %p\n", (void*)$arg0
- print *(struct MEMO *)$arg0
- else
- printf "(struct RIMemo *) %p\n", (void*)$arg0
- print *(struct RIMemo *)$arg0
- end
- end
- end
- end
- end
-end
-document rp_imemo
- Print the content of a memo
-end
-
define nd_type
print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
end
@@ -525,266 +378,260 @@ end
# Print members of ruby node.
define nd_head
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_alen
- printf "%su2.argc%s: ", $color_highlite, $color_end
+ printf "u2.argc: "
p ($arg0).u2.argc
end
define nd_next
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_cond
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_body
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_else
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_orig
- printf "%su3.value%s: ", $color_highlite, $color_end
+ printf "u3.value: "
rp ($arg0).u3.value
end
define nd_resq
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_ensr
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_1st
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_2nd
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_stts
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_entry
- printf "%su3.entry%s: ", $color_highlite, $color_end
+ printf "u3.entry: "
p ($arg0).u3.entry
end
define nd_vid
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_cflag
- printf "%su2.id%s: ", $color_highlite, $color_end
+ printf "u2.id: "
p ($arg0).u2.id
end
define nd_cval
- printf "%su3.value%s: ", $color_highlite, $color_end
+ printf "u3.value: "
rp ($arg0).u3.value
end
define nd_cnt
- printf "%su3.cnt%s: ", $color_highlite, $color_end
+ printf "u3.cnt: "
p ($arg0).u3.cnt
end
define nd_tbl
- printf "%su1.tbl%s: ", $color_highlite, $color_end
+ printf "u1.tbl: "
p ($arg0).u1.tbl
end
define nd_var
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_ibdy
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_iter
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_value
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_aid
- printf "%su3.id%s: ", $color_highlite, $color_end
+ printf "u3.id: "
p ($arg0).u3.id
end
define nd_lit
- printf "%su1.value%s: ", $color_highlite, $color_end
+ printf "u1.value: "
rp ($arg0).u1.value
end
define nd_frml
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_rest
- printf "%su2.argc%s: ", $color_highlite, $color_end
+ printf "u2.argc: "
p ($arg0).u2.argc
end
define nd_opt
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_recv
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_mid
- printf "%su2.id%s: ", $color_highlite, $color_end
+ printf "u2.id: "
p ($arg0).u2.id
end
define nd_args
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_noex
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_defn
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_old
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_new
- printf "%su2.id%s: ", $color_highlite, $color_end
+ printf "u2.id: "
p ($arg0).u2.id
end
define nd_cfnc
- printf "%su1.cfunc%s: ", $color_highlite, $color_end
+ printf "u1.cfunc: "
p ($arg0).u1.cfunc
end
define nd_argc
- printf "%su2.argc%s: ", $color_highlite, $color_end
+ printf "u2.argc: "
p ($arg0).u2.argc
end
define nd_cname
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_super
- printf "%su3.node%s: ", $color_highlite, $color_end
+ printf "u3.node: "
rp ($arg0).u3.node
end
define nd_modl
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_clss
- printf "%su1.value%s: ", $color_highlite, $color_end
+ printf "u1.value: "
rp ($arg0).u1.value
end
define nd_beg
- printf "%su1.node%s: ", $color_highlite, $color_end
+ printf "u1.node: "
rp ($arg0).u1.node
end
define nd_end
- printf "%su2.node%s: ", $color_highlite, $color_end
+ printf "u2.node: "
rp ($arg0).u2.node
end
define nd_state
- printf "%su3.state%s: ", $color_highlite, $color_end
+ printf "u3.state: "
p ($arg0).u3.state
end
define nd_rval
- printf "%su2.value%s: ", $color_highlite, $color_end
+ printf "u2.value: "
rp ($arg0).u2.value
end
define nd_nth
- printf "%su2.argc%s: ", $color_highlite, $color_end
+ printf "u2.argc: "
p ($arg0).u2.argc
end
define nd_tag
- printf "%su1.id%s: ", $color_highlite, $color_end
+ printf "u1.id: "
p ($arg0).u1.id
end
define nd_tval
- printf "%su2.value%s: ", $color_highlite, $color_end
+ printf "u2.value: "
rp ($arg0).u2.value
end
-define nd_tree
- set $buf = (struct RString *)rb_str_buf_new(0)
- call dump_node((VALUE)($buf), rb_str_new(0, 0), 0, ($arg0))
- printf "%s\n", $buf->as.heap.ptr
-end
-
define rb_p
call rb_p($arg0)
end
@@ -806,7 +653,7 @@ define rb_numtable_entry
end
end
else
- set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[st_numhash($rb_numtable_id) % $rb_numtable_tbl->num_bins]
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
while $rb_numtable_p
if $rb_numtable_p->key == $rb_numtable_id
set $rb_numtable_key = $rb_numtable_p->key
@@ -820,9 +667,12 @@ define rb_numtable_entry
end
define rb_id2name
- ruby_gdb_init
- printf "%sID%s: ", $color_type, $color_end
- rp_id $arg0
+ rb_numtable_entry global_symbols.id_str (ID)$arg0
+ if $rb_numtable_rec
+ rp $rb_numtable_rec
+ else
+ echo undef\n
+ end
end
document rb_id2name
Print the name of id
@@ -833,10 +683,10 @@ define rb_method_entry
set $rb_method_entry_id = (ID)$arg1
set $rb_method_entry_me = (rb_method_entry_t *)0
while !$rb_method_entry_me && $rb_method_entry_klass
- rb_numtable_entry $rb_method_entry_klass->m_tbl_wrapper->tbl $rb_method_entry_id
+ rb_numtable_entry $rb_method_entry_klass->m_tbl $rb_method_entry_id
set $rb_method_entry_me = (rb_method_entry_t *)$rb_numtable_rec
if !$rb_method_entry_me
- set $rb_method_entry_klass = (struct RClass *)RCLASS_SUPER($rb_method_entry_klass)
+ set $rb_method_entry_klass = (struct RClass *)$rb_method_entry_klass->ptr->super
end
end
if $rb_method_entry_me
@@ -851,21 +701,16 @@ document rb_method_entry
end
define rb_classname
- # up to 128bit int
- set $rb_classname_permanent = "0123456789ABCDEF"
- set $rb_classname = classname($arg0, $rb_classname_permanent)
- if $rb_classname != RUBY_Qnil
- rp $rb_classname
- else
- echo anonymous class/module\n
- end
+ call classname($arg0)
+ rb_p $
+ print *(struct RClass*)($arg0)
end
define rb_ancestors
set $rb_ancestors_module = $arg0
while $rb_ancestors_module
- rp_class $rb_ancestors_module
- set $rb_ancestors_module = RCLASS_SUPER($rb_ancestors_module)
+ rp $rb_ancestors_module
+ set $rb_ancestors_module = ((struct RClass *)($rb_ancestors_module))->ptr.super
end
end
document rb_ancestors
@@ -877,7 +722,7 @@ define rb_backtrace
end
define iseq
- if ruby_dummy_gdb_enums.special_consts
+ if dummy_gdb_enums.special_consts
end
if ($arg0)->type == ISEQ_ELEMENT_NONE
echo [none]\n
@@ -910,16 +755,23 @@ end
define rb_ps_vm
print $ps_vm = (rb_vm_t*)$arg0
- set $ps_thread_ln = $ps_vm->living_threads.n.next
- set $ps_thread_ln_last = $ps_vm->living_threads.n.prev
- while 1
- set $ps_thread_th = (rb_thread_t *)$ps_thread_ln
- set $ps_thread = (VALUE)($ps_thread_th->self)
- rb_ps_thread $ps_thread
- if $ps_thread_ln == $ps_thread_ln_last
- loop_break
+ set $ps_threads = (st_table*)$ps_vm->living_threads
+ if $ps_threads->entries_packed
+ set $ps_threads_i = 0
+ while $ps_threads_i < $ps_threads->num_entries
+ set $ps_threads_key = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].key
+ set $ps_threads_val = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].val
+ rb_ps_thread $ps_threads_key $ps_threads_val
+ set $ps_threads_i = $ps_threads_i + 1
+ end
+ else
+ set $ps_threads_ptr = (st_table_entry*)$ps_threads->head
+ while $ps_threads_ptr
+ set $ps_threads_key = (st_data_t)$ps_threads_ptr->key
+ set $ps_threads_val = (st_data_t)$ps_threads_ptr->record
+ rb_ps_thread $ps_threads_key $ps_threads_val
+ set $ps_threads_ptr = (st_table_entry*)$ps_threads_ptr->fore
end
- set $ps_thread_ln = $ps_thread_ln->next
end
end
document rb_ps_vm
@@ -928,9 +780,8 @@ end
define rb_ps_thread
set $ps_thread = (struct RTypedData*)$arg0
- set $ps_thread_th = (rb_thread_t*)$ps_thread->data
- printf "* #<Thread:%p rb_thread_t:%p native_thread:%p>\n", \
- $ps_thread, $ps_thread_th, $ps_thread_th->thread_id
+ set $ps_thread_id = $arg1
+ print $ps_thread_th = (rb_thread_t*)$ps_thread->data
end
# Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
@@ -949,18 +800,3 @@ define SDR
call rb_vmdebug_stack_dump_raw_current()
end
-define rbi
- if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_LABEL
- p *(LABEL*)$arg0
- else
- if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_INSN
- p *(INSN*)$arg0
- else
- if ((LINK_ELEMENT*)$arg0)->type == ISEQ_ELEMENT_ADJUST
- p *(ADJUST*)$arg0
- else
- print *$arg0
- end
- end
- end
-end
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index d9785fad00..0000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,5 +0,0 @@
-*.gemspec diff=ruby
-*.rb diff=ruby
-bin/* diff=ruby
-tool/update-deps diff=ruby
-tool/make-snapshot diff=ruby
diff --git a/.gitignore b/.gitignore
index 80c12594dd..5808bf1082 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
*-*-*.def
-*-*-*.exp
-*-*-*.lib
*.a
*.bak
*.dSYM
@@ -10,13 +8,10 @@
*.inc
*.log
*.o
-*.obj
*.orig
-*.pdb
*.rej
*.sav
*.swp
-*.yarb
*~
.*-*
.*.list
@@ -28,27 +23,19 @@
.ppack
.svn
Makefile
-Makefile.old
-cygruby*.def
extconf.h
y.output
y.tab.c
# /
-/*-fake.rb
-/*.dll
-/*.exe
-/*.res
/*.pc
-/*.rc
/*_prelude.c
/COPYING.LIB
-/ChangeLog-*
+/ChangeLog-1.8.0
/ChangeLog.pre-alpha
/ChangeLog.pre1_1
/Doxyfile
/GNUmakefile
-/GNUmakefile.old
/README.atheos
/README.fat-patch
/README.v6
@@ -57,7 +44,6 @@ y.tab.c
/autom4te*.cache
/automake
/beos
-/bmlog-*
/breakpoints.gdb
/config.cache
/config.h
@@ -65,13 +51,6 @@ y.tab.c
/config.status
/config.status.lineno
/configure
-/coverage/simplecov
-/coverage/simplecov-html
-/coverage/doclie
-/coverage/.last_run.json
-/coverage/.resultset.json*
-/coverage/assets
-/coverage/index.html
/doc/capi
/enc.mk
/encdb.h
@@ -102,56 +81,28 @@ y.tab.c
/riscos
/rubicon
/ruby
-/ruby-runner
-/ruby-runner.c
/ruby-man.rd.gz
-/sizes.c
/test.rb
/tmp
/transdb.h
/uncommon.mk
/verconf.h
-/verconf.mk
/web
/yasmdata.rb
# /benchmark/
/benchmark/bmx_*.rb
-/benchmark/fasta.output.*
-/benchmark/wc.input
-
-/enc/*.def
-/enc/*.exp
-/enc/*.lib
-/enc/unicode/data
# /enc/trans/
/enc/trans/*.c
-/enc/trans/*.def
-/enc/trans/*.exp
-/enc/trans/*.lib
-/enc/trans/.time
# /ext/
/ext/extinit.c
-# /ext/-test-/win32/dln/
-/ext/-test-/win32/dln/dlntest.exp
-/ext/-test-/win32/dln/dlntest.lib
-
# /ext/dl/callback/
/ext/dl/callback/callback-*.c
/ext/dl/callback/callback.c
-# /ext/etc/
-/ext/etc/constdefs.h
-
-# /ext/fiddle/
-/ext/fiddle/libffi-*
-
-# /ext/rbconfig/
-/ext/rbconfig/sizeof/sizes.c
-
# /ext/ripper/
/ext/ripper/eventids1.c
/ext/ripper/eventids2table.c
@@ -167,17 +118,10 @@ y.tab.c
# /ext/tk/
/ext/tk/config_list
-# /gems
-/gems/*.gem
-
# /spec/
/spec/mspec
/spec/rubyspec
-# /tool/
-/tool/config.guess
-/tool/config.sub
-
# /win32/
/win32/*.ico
/win32/.time
diff --git a/.travis.yml b/.travis.yml
index f87ffd3483..db25c9eb08 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,56 +18,37 @@
# Language specification.
language: c
-sudo: false
# Compilers. Several compilers are provided in Travis, so we try them all.
# The value set here is visible via $CC environment variable.
compiler:
- gcc
-
-os:
- - linux
+ - clang
# Dependencies. Some header files are missing in a Travis' worker VM, so we
# have to install them. The "1.9.1" here is OK. It is the most adopted
# version string for Debian/Ubuntu, and no dependencies have been changed so
# far since the 1.9.1 release.
before_install:
- - "CONFIG_FLAG="
- - "JOBS='-j 4'"
+ - "sudo apt-get -qq update"
+ - "sudo apt-get -qq install $CC" # upgrade if any
+install: "sudo apt-get -qq build-dep ruby1.9.1 2>/dev/null"
# Script is where the test runs. Note we just do "make test", not other tests
# like test-all, test-rubyspec. This is because they take too much time,
# enough for Travis to shut down the VM as being stalled.
before_script:
- - "uname -a"
- - "uname -r"
- - "rm -fr .ext autom4te.cache"
- - "echo $TERM"
- - "make -f common.mk BASERUBY=ruby MAKEDIRS='mkdir -p' srcdir=. update-config_files"
- "autoconf"
- - "mkdir config_1st config_2nd"
- - "./configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG"
- - "cp -pr config.status .ext/include config_1st"
- - "make reconfig"
- - "cp -pr config.status .ext/include config_2nd"
- - "diff -ru config_1st config_2nd"
- - "make after-update BASERUBY=ruby"
- - "make -s $JOBS"
- - "make update-rubyspec"
-script:
- - "make test TESTOPTS=--color=never"
- - "make test-all TESTOPTS='-q -j3 --color=never --job-status=normal'"
- - "make test-rubyspec MSPECOPT=-fm"
+ - "./configure --with-gcc=$CC"
+ - "make -sj encs"
+ - "make -sj exts"
+script: "make test OPTS=-v"
# Branch matrix. Not all branches are Travis-ready so we limit branches here.
branches:
only:
- trunk
- - ruby_2_0_0
- - ruby_2_1
- - ruby_2_2
- - ruby_2_3
+ - ruby_1_9_3
# We want to be notified when something happens.
notifications:
@@ -76,21 +57,10 @@ notifications:
- "irc.freenode.org#ruby-core"
- "irc.freenode.org#ruby-ja"
on_success: change # [always|never|change] # default: always
- on_failure: always # [always|never|change] # default: always
+ on_failure: change # [always|never|change] # default: always
template:
- "%{message} by @%{author}: See %{build_url}"
- # Update ruby-head installed on Travis CI so other projects can test against it.
- webhooks:
- urls:
- - "https://rubies.travis-ci.org/rebuild/ruby-head"
- on_success: always
- on_failure: never
-
- email:
- - ko1c-failure@atdot.net
- - shibata.hiroshi@gmail.com
-
# Local Variables:
# mode: YAML
# coding: utf-8-unix
diff --git a/BSDL b/BSDL
index a009caefea..82725534fa 100644
--- a/BSDL
+++ b/BSDL
@@ -1,4 +1,4 @@
-Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
+Copyright (C) 1993-2010 Yukihiro Matsumoto. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index ffdf2dd4b8..0000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Please see the [official issue tracker] and wiki [HowToContribute].
-
-[official issue tracker]: https://bugs.ruby-lang.org
-[HowToContribute]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute
diff --git a/ChangeLog b/ChangeLog
index afde8df352..ef2bfb6531 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13710 +1,22470 @@
-Tue Nov 15 03:14:02 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 7 21:40:36 2013 Shugo Maeda <shugo@ruby-lang.org>
- * ext/-test/file/fs.c (get_atime_p): Updating of file access times
- is enabled or not.
+ * vm_method.c (Init_eval_method): main.public and main.private
+ should be private.
-Tue Nov 15 03:14:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (Init_Proc): main.define_method should be private.
- * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case.
- [ruby-core:77943] [Bug #12903]
+ * test/ruby/test_module.rb: related test.
-Tue Nov 15 03:09:39 2016 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jan 7 20:48:47 2013 Shugo Maeda <shugo@ruby-lang.org>
- * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast,
- test_make_socket_ipv6_multicast_hops): skip if IPv6 multicast
- address is not available.
+ * eval.c (Init_eval): main.include should be private.
+ [ruby-core:51293] [Bug #7670]
-Tue Nov 15 02:49:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_module.rb (test_top_include_is_private): a new test
+ for the above change.
- * vm_eval.c (vm_call0_body): follow the original class, not to
- loop the prepended module. [ruby-core:77784] [Bug #12876]
+Mon Jan 7 20:29:50 2013 Shugo Maeda <shugo@ruby-lang.org>
-Tue Nov 15 02:45:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * NEWS: remove description about `require "refinement"'.
- * lib/net/http.rb (transport_request): other than HTTPContinue
- in 1xx (HTTPInformation) also needs to continue. [Bug #12890]
+Mon Jan 7 20:15:49 2013 Shugo Maeda <shugo@ruby-lang.org>
-Sat Nov 12 01:05:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * eval.c (Init_eval): enable Refinements by default.
+ [ruby-core:51286] [Bug #7667]
- * object.c: Improve documentation for Float conversion.
- [ruby-core:71661][Bug #11736][ci skip]
+ * eval.c (rb_mod_refine, top_using): show a warning when
+ Module#refine or main.using is called at the first time.
-Sat Nov 12 00:50:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/refinement/*: removed the extension library "refinement".
- * proc.c (mnew_internal): follow the original class, not to loop
- the prepended module. [ruby-core:77591] [Bug #12832]
+ * test/ruby/test_refinement.rb: fix for the above changes.
-Sat Nov 12 00:46:50 2016 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jan 7 17:34:22 2013 Koichi Sasada <ko1@atdot.net>
- * cont.c (cont_new): disable optimization if clang's version is
- 3.8.0. [ruby-core:77894] [Bug #12893]
+ * include/ruby/ruby.h (RUBY_EVENT_SPECIFIED_LINE): make it special.
+ This flag is not contained by RUBY_EVENT_TRACEPOINT_ALL.
+ This event is experimental one. It is possible to remove/rename
+ flag name after 2.0.1.
-Sat Nov 12 00:27:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (get_event_id): return :line if SPECIFIED_LINE was
+ occurred. `:specified_line' never been returned.
- * compile.c (iseq_peephole_optimize): enable tail call
- optimization inside a conditional block.
+Mon Jan 7 15:42:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 5 11:53:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (f_kwrest): allow bare kwrest_mark as valid syntax. its
+ semantics is still undefined. [Bug #7662] [ruby-core:51269]
- * io.c (copy_stream_body): use IO to write to copy to duplex IO.
- http://twitter.com/knu/status/786505317974585344
+Mon Jan 7 15:31:58 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 5 11:49:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (f_kwrest): reject duplicated kwrest argument name.
- * sprintf.c (rb_str_format): format exact number more exactly.
+Mon Jan 7 15:24:10 2013 Koichi Sasada <ko1@atdot.net>
-Sat Nov 5 11:45:32 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): pop tag before
+ JUMP_TAG() if frame is `finish' frame.
+ Without this patch, there is an inconsistency between control
+ frame stack and tags stack.
+ [Bug #7668]
- * ext/openssl/ossl.c (Init_openssl): register an ex_data index for
- X509_STORE and X509_STORE_CTX respectively. Since they don't share
- the ex_data index registry, we can't use the same index.
- (ossl_verify_cb): use the the correct index.
+ * test/ruby/test_settracefunc.rb: add a test for above.
- * ext/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto.
+Mon Jan 7 15:21:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto.
- (ossl_x509stctx_verify): ditto.
+ * Makefile.in, common.mk (fake, yes-fake, no-make): these dependecies
+ are not platform dependent.
- * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations
- of ossl_store_{ctx_,}ex_verify_cb_idx.
+ * win32/Makefile.sub ($(arch)-fake.rb): workaround.
- * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and
- X509_STORE_get_ex_data.
+Mon Jan 7 12:09:24 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/openssl_missing.h: implement X509_STORE_get_ex_data,
- X509_STORE_set_ex_data and X509_STORE_get_ex_new_index as macros.
+ * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args):
+ set keyrest hash after making rest array, so that the last element
+ will not be overwritten. [ruby-core:51278] [Bug #7665]
-Sat Nov 5 11:35:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 7 09:37:24 2013 Koichi Sasada <ko1@atdot.net>
- * thread.c (rb_thread_pending_interrupt_p): no pending interrupt
- before initialization.
+ * NEWS: add a NEWS entry about RubyVM.
- * thread.c (thread_raise_m, rb_thread_kill): uninitialized thread
- cannot interrupt. [ruby-core:72732] [Bug #11959]
+Sun Jan 6 19:06:57 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Sat Nov 5 11:16:58 2016 Kenta Murata <mrkn@mrkn.jp>
+ * win32/Makefile.sub: Fix build with VC.
+ Patch by Charlie Savage. Fixes [ruby-core:51261]
- * ext/bigdecimal/bigdecimal.c: Import changes from ruby/bigdecimal
- repository.
+Sun Jan 6 18:43:48 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Tue Oct 18 02:58:22 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * bootstraptest/test_io.rb: add a test for [ruby-dev:46834].
- * eval_intern.h (TH_PUSH_TAG): Initialize struct rb_vm_tag::tag with
- Qundef rather than 0 which is equal to Qfalse. Since Kernel#throw(obj)
- searches a tag with rb_vm_tag::tag == obj, throw(false) can
- accidentally find an unrelated tag which is not created by
- Kernel#catch. [ruby-core:77229] [Bug #12743]
+ * io.c (rb_cloexec_fcntl_dupfd) Use an emulation with dup(2) when
+ fcntl(2) and/or F_DUPFD is unavailable.
+ Suggested by akr.
- * test/ruby/test_exception.rb (test_throw_false): Add a test case for
- this.
+ * configure.in (HAVE_FCNTL): NativeClient does not provide fcntl(2).
-Tue Oct 18 02:24:29 2016 Aurelien Jacobs <aurel@gnuage.org>
+Sun Jan 6 11:11:26 2013 Eric Hodel <drbrain@segment7.net>
- * lib/logger.rb (Logger::Period#next_rotate_time): fix monthly log
- rotate when DST is applied during a month of 31 days.
- [Fix GH-1458]
+ * doc/syntax/modules_and_classes.rdoc: Fixed typo.
-Wed Oct 12 22:31:09 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Jan 6 05:35:18 2013 Eric Hodel <drbrain@segment7.net>
- * tool/downloader.rb: Removed verification of gem certification.
- Because signed gem is not working on rubygems ecosystem.
- * tool/gem-unpack.rb: ditto.
+ * doc/syntax/modules_and_classes.rdoc: Added singleton classes
+ documentation.
-Fri Oct 7 02:48:06 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Sun Jan 6 02:22:00 2013 Zachary Scott <zachary@zacharyscott.net>
- * lib/rubygems/ssl_certs/GlobalSignRootCA.pem: add for RugyGems.org.
+ * lib/webrick/httpservlet/abstract.rb (WEBrick::HTTPServlet): Typo in
+ example. Patch by shlensky [Fixes #232 on github]
-Mon Sep 26 23:51:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 5 21:15:10 2013 NARUSE, Yui <naruse@ruby-lang.org>
- * variable.c (rb_const_search): raise with the actual class/module
- name which defines the private constant.
+ * lib/net/http/generic_request.rb:
+ Amazon ECA API and GTE/1.3 disallow requests whose host has port
+ number if its port number equals to default port number of the
+ scheme. [Bug #7650]
-Mon Sep 26 23:34:09 2016 Kazuki Yamaguchi <k@rhe.jp>
+Sat Jan 5 13:58:59 2013 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_pkcs12.c (ossl_pkcs12_initialize): pop errors
- leaked by PKCS12_parse(). This is a bug in OpenSSL, which exists
- in the versions before the version 1.0.0t, 1.0.1p, 1.0.2d.
+ * doc/syntax/modules_and_classes.rdoc: Improved description of methods
+ on a module or class as suggested by Tobias Buhlmann
-Mon Sep 26 23:10:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jan 5 13:38:07 2013 Masaki Matsushita <glass.saga@gmail.com>
- * vm_dump.c (backtrace): use rip in the saved context for the case
- the SIGSEGV is received when the process is in userland.
- Note that ip in the stack should be used if the signal is received
- when it is in kernel (when it is calling syscall) [Bug #12711]
+ * string.c (rb_str_enumerate_lines): fix invalid byte sequence error
+ when a separator is passed. The patch is from yoshidam (Yoshida
+ Masato).
+ [Bug #7646] [ruby-dev:46827]
-Mon Sep 26 20:23:32 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * test/ruby/test_string.rb: a test for above.
- * gems/bundled_gems: update minitest to 5.8.5.
+Sat Jan 5 12:25:42 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/downloader.rb: revert workarounds.
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err):
+ check stdout and stderr both.
- * tool/gem-unpack.rb: ditto.
+Sat Jan 5 10:21:54 2013 Eric Hodel <drbrain@segment7.net>
-Mon Sep 26 07:26:44 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * doc/syntax/modules_and_classes.rdoc: Added documentation of syntax
+ for Modules and Classes.
+ * doc/syntax/methods.rdoc: Moved some text to the Modules and
+ Classes syntax document.
- * tool/gem-unpack.rb: don't set security policy.
- workaround for certificate expiration of minitest-5.8.3.gem.
+Sat Jan 5 08:38:27 2013 Eric Hodel <drbrain@segment7.net>
-Mon Sep 26 06:33:16 2016 Aaron Patterson <tenderlove@ruby-lang.org>
+ * doc/syntax/methods.rdoc: Added return values and scope sections,
+ slightly modified from the original patch. Fixes #227 from github by
+ Dave Brown.
- * lib/uri/generic.rb (def check_password): don't include bad password
- in URI exception output
+Sat Jan 5 08:21:41 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/uri/test_generic.rb (def test_set_component): test for behavior
+ * io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
+ * io.c (rb_maygvl_fd_fix_cloexec): ditto.
-Mon Sep 26 06:20:58 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Sat Jan 5 07:54:59 2013 Eric Hodel <drbrain@segment7.net>
- * tool/downloader.rb: comment out gem package verification.
- workaround for certificate expiration of minitest-5.8.3.gem.
+ * lib/rubygems/commands/cleanup_command.rb: Clean all possible gems
+ using multiple passes. Fixes RubyGems bug #422. Refactored for
+ maintainability.
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
-Sun Sep 25 16:37:22 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jan 5 05:04:39 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the
- fd is associated to non-disk device. if call fsync and/or fdatasync
- with such fds, it causes Errno::EBADF exception and the behavior is
- incompatible with ruby 2.1 and earlier unintentionally introduced.
+ * gc.c (vm_xrealloc): add a few comment why we avoid realloc(ptr,0).
-Sun Sep 25 15:09:04 2016 Kazuki Tsujimoto <kazuki@callcc.net>
+Fri Jan 4 20:17:06 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * array.c (flatten): use rb_obj_class instead of rb_class_of
- because rb_class_of may return a singleton class.
- [ruby-dev:49781] [Bug #12738]
+ * Makefile.in (RBCONFIG): Moved from common.mk in order to use the
+ variable in Makefile.in.
-Sun Sep 25 15:07:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/Makefile.sub (RBCONFIG): Ditto.
- * man/irb.1: remove useless -width option.
- [ruby-dev:49767] [Bug #12692]
+Fri Jan 4 19:45:50 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Tue Aug 30 05:24:33 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * common.mk (run, parse): Use BTESTRUBY instead of MINIRUBY to handle
+ cross-compiling cases, e.g. NativeClient.
- * ext/openssl/ossl_x509ext.c: additional fix memory leak.
- [ruby-core:76922] [Bug #12680]
+Fri Jan 4 17:58:16 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * text/openssl/test_x509ext.rb: test for above.
+ * common.mk (yes-btest): btest depends on also $(arch)-fake.rb and
+ rbconfig.rb on building for NativeClient.
-Sun Aug 28 00:26:58 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * Makefile.in (fake): Avoid generating $(arch)-fake.rb unless cross
+ compiling.
- * vm_method.c: revert r55869. it breaks Integer#days with
- ActiveSupport-4.1.x. [ruby-core:76949] [Bug #12353]
+ * configure.in (CROSS_COMPILING): New substitution.
- * test/ruby/test_marshal.rb: ditto.
+Fri Jan 4 16:26:45 2013 Eric Hodel <drbrain@segment7.net>
-Sat Aug 27 03:51:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/doctor.rb: Process directories in order in case the
+ filesystem doesn't. [ruby-trunk - Bug #7618]
- * id_table.c (hash_table_extend): should not shrink the table than
- the previous capacity. [ruby-core:76534] [Bug #12614]
+ Process specifications before other directories in case of bugs.
+ * test/rubygems/test_gem_doctor.rb: Test for above.
-Sat Aug 27 03:37:49 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * lib/rubygems.rb: Updated version.
- * ext/openssl/ossl_config.c: fix memory leak.
- [ruby-core:76922] [Bug #12680]
+ * test/rubygems/test_require.rb: Fixed double require of
+ benchmark.rb. RubyGems bug #420.
- * ext/openssl/ossl_ocsp.c: ditto.
+ * test/rubygems/test_gem_commands_check_command.rb: Fixed unused
+ variable warnings.
+ * test/rubygems/test_gem_commands_query_command.rb: ditto
+ * test/rubygems/test_gem_installer.rb: ditto
- * ext/openssl/ossl_pkcs12.c: ditto.
+Fri Jan 4 15:05:25 2013 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_pkcs7.c: ditto.
+ * lib/rdoc/cross_reference.rb: Fixed matching of C#=== or #===. RDoc
+ bug #164
+ * test/rdoc/test_rdoc_cross_reference.rb: Test for above.
- * ext/openssl/ossl_pkey_ec.c: ditto.
+ * lib/rdoc/parser/changelog.rb: Fixed parsing of dates. RDoc bug #165
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
- * ext/openssl/ossl_x509.h: ditto.
+ * lib/rdoc/parser.rb: Fixed parsing multibyte files with incomplete
+ characters at byte 1024. [ruby-trunk - Bug #6393]
+ Fixed handling of -E. [ruby-trunk - Bug #6392]
+ * test/rdoc/test_rdoc_options.rb: Test for above.
+ * test/rdoc/test_rdoc_parser.rb: ditto.
+ * test/rdoc/test_rdoc_parser_c.rb: ditto.
+ * test/rdoc/test_rdoc_parser_changelog.rb: ditto.
+ * test/rdoc/test_rdoc_parser_markdown.rb: ditto.
+ * test/rdoc/test_rdoc_parser_rd.rb: ditto.
+ * test/rdoc/test_rdoc_rdoc.rb: ditto.
- * ext/openssl/ossl_x509attr.c: ditto.
+ * lib/rdoc/tom_doc.rb: Fixed parsing of [] in TomDoc arguments list.
+ RDoc bug #167
+ * test/rdoc/test_rdoc_tom_doc.rb: Test for above.
- * ext/openssl/ossl_x509crl.c: ditto.
+ * lib/rdoc.rb: Update version.
- * ext/openssl/ossl_x509ext.c: ditto.
+Fri Jan 4 11:51:00 2013 Zachary Scott <zachary@zacharyscott.net>
- * ext/openssl/ossl_x509req.c: ditto.
+ * lib/forwardable.rb: Fix rdoc parameters for ::def_single_delegator.
+ Patch by Vladimir Andrijevik [Github Fixes #230]
- * ext/openssl/ossl_x509revoked.c: ditto.
+Fri Jan 4 00:35:11 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Thu Aug 25 00:19:24 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ Fix failures on btest for NativeClient.
+ * bootstraptest/runner.rb (nacl?): New method to distinguish NaCl
+ cross build.
- * lib/rubygems/specification.rb: `coding` is affect only first line except
- shebang.
- * lib/rubygems/package.rb, lib/rubygems/package/*: ditto.
+ * bootstraptest/test_io.rb: Skip unsupported operations.
-Thu Aug 25 00:19:24 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * bootstraptest/test_literal.rb: ditto.
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
- It supports to enable frozen string literal and add `--norc` option for
- disable to `.gemrc` configuration.
- See 2.5.2 release notes for other fixes and enhancements.
- https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3
+Fri Jan 4 00:29:40 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Aug 24 23:54:40 2016 Charles Oliver Nutter <headius@headius.com>
+ * io.c (rb_cloexec_fcntl_dupfd): Fix failures in
+ bootstrap_test/test_io.rb. NativeClient does not support F_DUPFD
+ but supports dup2(2).
- * test/ruby/test_array.rb: split out the test for no stack error
- on large input for test_permutation, test_repeated_permutation,
- and test_repeated_combination, and make them all timeout:30.
+Thu Jan 3 17:46:50 2013 Kouhei Sutou <kou@cozmixng.org>
-Tue Aug 23 03:22:34 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * lib/rexml/element.rb (REXML::Elements#add): Remove too much
+ "elements" in document. Sorry...
- * test/fiddle/test_pointer.rb (test_to_str, test_to_s, test_aref_aset):
- Attempt to use independent strings for destructive tests that
- directly modify values on memory by using Fiddle::Pointer.
- [Bug #12537] [ruby-dev:49700]
+Thu Jan 3 17:42:32 2013 Kouhei Sutou <kou@cozmixng.org>
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * lib/rexml/element.rb (REXML::Elements#each): Add missing
+ "elements" in document. [ruby-talk:402713]
+ Reported by Wesley Rishel. Thanks!!!
- * string.c (str_buf_cat): Fix capa size for embed string.
- Fix bug in r55547. [Bug #12536]
+Thu Jan 3 15:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * ext/psych/lib/psych.rb (Psych.load): Return value of
+ Psych::SyntaxError.message should be same as example.
+ Patch by Ippei Obayashi [ruby-core:51193] [Bug #7636]
- * string.c (rb_str_change_terminator_length): New function to change
- termlen and resize heap for the terminator. This is split from
- rb_str_fill_terminator (str_fill_term) because filling terminator
- and changing terminator length are different things. [Bug #12536]
+Thu Jan 3 14:58:00 2013 Zachary Scott <zachary@zacharyscott.net>
- * internal.h: declaration for rb_str_change_terminator_length.
+ * lib/forwardable.rb (SingleForwardable): Fix example in overview
+ Patch by Vladimir Andrijevik [Github Fixes #231]
- * string.c (str_fill_term): Simplify only to zero-fill the terminator.
- For non-shared strings, it assumes that (capa + termlen) bytes of
- heap is allocated. This partially reverts r55557.
+Thu Jan 3 14:32:47 2013 Yuki Yugui Sonoda <yugui@yugui.jp>
- * encoding.c (rb_enc_associate_index): rb_str_change_terminator_length
- is used, and it should be called whenever the termlen is changed.
+ * configure.in (OBJCOPY): Fixes build error for NativeClient.
+ Avoid disabling OBJCOPY for NativeClient.
- * string.c (str_capacity): New static function to return capacity
- of a string with the given termlen, because the termlen may
- sometimes be different from TERM_LEN(str) especially during
- changing termlen or filling terminator with specific termlen.
+ * thread_pthread.c (rb_reserved_fd_p): USE_SLEEPY_TIMER_THREAD is
+ always defined. Fixes compilation error for NativeClient.
- * string.c (rb_str_capacity): Use str_capacity.
+Wed Jan 02 03:09:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * ext/zlib/zlib.c (Zlib::GzipReader): Fix typo by zed_0xff
+ [Fixes Github #229]
- * string.c: Partially reverts r55547 and r55555.
- ChangeLog about the reverted changes are also deleted in this file.
- [Bug #12536] [ruby-dev:49699] [ruby-dev:49702]
+Wed Jan 02 02:29:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * hash.c (rb_hash_update): Revert documentation from r38672
+ See: https://github.com/ruby/ruby/pull/228#issuecomment-11791013
- * string.c (str_fill_term): When termlen increases, re-allocation
- of memory for termlen should always be needed.
- In this fix, if possible, decrease capa instead of realloc.
- [Bug #12536] [ruby-dev:49699]
+Wed Jan 02 02:16:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * hash.c (rb_hash_update): Documentation for Hash#merge and shallow
+ copies Patch by Yorick Peterse [Fixes Github #228]
- * string.c: Specify termlen as far as possible.
- Additional fix for [Bug #12536] [ruby-dev:49699].
+Mon Dec 31 15:10:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * string.c (str_new_static): Specify termlen from the given encoding
- when creating a new String object is needed.
+ * vm_backtrace.c: Add documentation for Kernel#caller_locations,
+ Kernel#caller, and Thread::Backtrace::Location
- * string.c (rb_tainted_str_new_with_enc): New function to create a
- tainted String object with the given encoding. This means that
- the termlen is correctly specified. Currently static function.
- The function name might be renamed to rb_tainted_enc_str_new
- or rb_enc_tainted_str_new.
+Mon Dec 31 13:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * string.c (rb_external_str_new_with_enc): Use encoding by using the
- above rb_tainted_str_new_with_enc().
+ * test/ruby/test_backtrace.rb: Add test for r37957 [Feature #7434]
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+Sun Dec 30 23:33:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_subseq, str_substr): When RSTRING_EMBED_LEN_MAX
- is used, TERM_LEN(str) should be considered with it because
- embedded strings are also processed by TERM_FILL.
- Additional fix for [Bug #12536] [ruby-dev:49699].
+ * parse.y (simple_re_meta): escaped closing parenthesis has different
+ meaning. [Bug #7610] [ruby-core:51088]
-Tue Aug 23 03:14:22 2016 Naohisa Goto <ngotogenome@gmail.com>
+Sun Dec 30 12:09:47 2012 Charlie Somerville <charlie@charliesomerville.com>
- * string.c: Fix memory corruptions when using UTF-16/32 strings.
- [Bug #12536] [ruby-dev:49699]
+ * configure.in: use 4 argument form of AC_CHECK_HEADERS to force
+ autoconf to use compiler's result
- * string.c (rb_str_new_with_class): Use TERM_LEN of the "obj".
+Sun Dec 30 10:58:04 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * string.c (rb_str_plus, rb_str_justify): Use str_new0 which is aware
- of termlen.
+ * test/ruby/test_keyword.rb: add a test for passing hash
+ as a last argument. [ruby-dev:46712] [Bug #7529]
- * string.c (str_shared_replace): Copy +termlen bytes instead of +1.
+Sun Dec 30 10:51:29 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * string.c (rb_str_times): termlen should not be included in capa.
+ * vm_insnhelper.c: set keyword hash on Proc/block calls.
+ [ruby-core:51172] [Bug #7630]
- * string.c (RESIZE_CAPA_TERM): When using RSTRING_EMBED_LEN_MAX,
- termlen should be counted with it because embedded strings are
- also processed by TERM_FILL.
+ * test/ruby/test_keyword.rb: add tests for above.
- * string.c (rb_str_capacity, str_shared_replace, str_buf_cat): ditto.
+Sat Dec 29 21:57:11 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * string.c (rb_str_drop_bytes, rb_str_setbyte, str_byte_substr): ditto.
+ * lib/irb/completion.rb: treat rightly completion for symbol on irb
+ [Bug #7632].
-Thu Aug 18 23:43:33 2016 Eric Wong <e@80x24.org>
+Sat Dec 29 21:51:30 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal):
- avoid undefined behavior
- * test/openssl/test_pair.rb (test_write_zero): new test
- [ruby-core:76751] [Bug #12660]
+ * ext/curses/curses.c (window_cury, window_curx, window_maxy,
+ window_maxx, window_begy, window_begx): use RB_UNUSED_VAR()
+ to suppress unused-but-set-variable warnings.
-Thu Aug 18 23:18:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 29 16:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/socket/option.c, ext/socket/rubysocket.h (inet_ntop): share
- the fallback definition. [ruby-core:76646] [Bug #12645]
+ * iseq.c (RubyVM::InstructionSequence): rdoc formatting
-Thu Aug 18 23:07:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 29 15:28:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * vm.c (vm_set_main_stack): remove unnecessary check. toplevel
- binding must be initialized. [Bug #12611] (N1)
+ * iseq.c (RubyVM::InstructionSequence): Add rdoc for new iseq features
+ added from r38085, this includes ::of, #path, #absolute_path,
+ #label, #base_label, #first_lineno, and #inspect
- * win32/win32.c (w32_symlink): fix return type. [Bug #12611] (N3)
+Sat Dec 29 14:06:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * string.c (rb_str_split_m): simplify the condition.
- [Bug #12611](N4)
+ * iseq.c (rb_iseq_line_trace_all, rb_iseq_line_trace_specify): Add
+ rdoc for experimental C level api of iseq, from r38076
-Thu Aug 18 23:06:20 2016 Kouhei Sutou <kou@cozmixng.org>
+Sat Dec 29 11:37:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/attribute.rb (REXML::Attribute#to_string): Fix wrong
- entry reference name of double quote.
- [Bug #12609][ruby-core:76509]
- Patch by Joseph Marrero. Thanks!!!
+ * object.c (rb_obj_clone): attach clone to its singleton class during
+ cloning singleton class so that singleton_method_added will be called
+ on it. based on the patch by shiba (satoshi shiba)[Bug #5283] in
+ [ruby-dev:44477]. [Bug #5283]
-Thu Aug 18 23:04:59 2016 Naohisa Goto <ngotogenome@gmail.com>
+Sat Dec 29 10:10:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_wait_for_single_fd): Clean up fds.revents every time
- before calling ppoll(2). [Bug #12575] [ruby-dev:49725]
+ * configure.in (crt_externs.h): use standard macro AC_CHECK_HEADERS.
-Thu Aug 18 22:52:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Dec 28 23:12:44 2012 Charlie Somerville <charlie@charliesomerville.com>
- * vm_args.c (setup_parameters_complex): don't raise ArgumentError
- if an array is given for instance_exec with optional argument.
- [ruby-core:76300] [Bug #12568]
- https://github.com/rails/rails/pull/25699
+ * configure.in: check for the whether crt_externs.h is present when compiling
+ for darwin (this header is missing in the iOS SDK)
+ * eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if
+ not defined, include missing/crt_externs.h instead
+ * hash.c: ditto
+ * missing/setproctitle.c: ditto
+ * missing/crt_externs.h: declare _NSGetEnviron() function and define environ
+ for iOS
-Tue Aug 16 12:27:48 2016 Koichi Sasada <ko1@atdot.net>
+Fri Dec 28 21:40:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * gc.c (gc_mark_roots): should mark the VM object itself to mark
- singleton class of the VM object.
- Before this patch, we only set mark bit for the VM object and
- invoke mark function separately.
- [Bug #12583]
+ * lib/irb/context.rb: IRB::Context#new: Check from JobManager
+ inside IRB namespace [Bug #7628]. Thanks rafaelfranca for bug
+ report and its patch.
- * test/ruby/test_gc.rb: add a test.
+Fri Dec 28 17:06:17 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Aug 16 12:01:35 2016 Naohisa Goto <ngotogenome@gmail.com>
+ * misc/ruby-electric.el (ruby-electric-curlies): Automatically
+ indent closing curly brackets when
+ ruby-electric-newline-before-closing-bracket is true.
- * ext/digest/md5/md5ossl.h: Remove excess semicolons.
- Suppress warning on Solaris with Oracle Solaris Studio 12.
- [ruby-dev:49692] [Bug #12524]
+Fri Dec 28 11:50:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/digest/md5/md5cc.h: ditto.
- * ext/digest/sha1/sha1cc.h: ditto.
- * ext/digest/sha1/sha1ossl.h: ditto.
- * ext/digest/sha2/sha2cc.h: ditto.
- * ext/digest/sha2/sha2ossl.h: ditto.
+ * vm_insnhelper.c (vm_yield_setup_block_args): pass single argument to
+ single optional parameter unchanged without splatting. [Bug #7621]
+ [ruby-dev:46801]
-Tue Aug 16 11:51:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 28 11:17:47 2012 Shugo Maeda <shugo@ruby-lang.org>
- * compile.c (ADD_TRACE): ignore trace instruction on non-positive
- line.
+ * proc.c (method_eq): fix the documentation to refer to owner.
+ [ruby-core:51105] [Bug #7613]
- * parse.y (coverage): get rid of ArgumentError when the starting
- line number is not positive. [ruby-core:76141] [Bug #12517]
+ * test/ruby/test_method.rb (test_alias_onwer): new test to confirm
+ that `a == b' returns false if owners of a and b are different.
-Tue Aug 16 11:51:52 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Fri Dec 28 07:07:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/coverage/test_coverage.rb: ignored test when enabled to coverage.
- It lead to crash with `make test-all`.
+ * def/id.def: use split(/^/) instead of String#lines to support
+ Ruby 1.8.5 as BASERUBY.
-Tue Aug 16 11:46:07 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 27 21:56:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
- only if the URI has path-rootless, not path-empty.
- [ruby-core:76055] [Bug #12498]
- patched by Chris Heisterkamp <cheister@squareup.com>
+ * variable.c (rb_mod_remove_const): fix segv caused by r38558.
-Tue Aug 16 04:57:28 2016 Shugo Maeda <shugo@ruby-lang.org>
+Tue Dec 28 01:13:48 2012 James Edward Gray II <james@graysoftinc.com>
- * lib/net/http/generic_request.rb (write_header): A Request-Line must
- not contain CR or LF.
+ * lib/csv.rb: Added more Hash methods to CSV::Row.
-Tue Aug 16 04:54:12 2016 Shugo Maeda <shugo@ruby-lang.org>
+Thu Dec 27 23:27:15 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * lib/net/ftp.rb (putline): raise an ArgumentError when
- CR or LF is included in a line.
+ * lib/irb/ruby-lex.rb: make lex_state to EXPR_END when next token
+ is an operator after SYMBEG [Bug #6378].
-Tue Aug 16 04:38:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 27 21:30:21 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/date/date_strftime.c (date_strftime_with_tmx): reject too
- large precision to get rid of buffer overflow.
- reported by Guido Vranken <guido AT guidovranken.nl>.
+ * lib/irb/ruby-lex.rb: allow to handle recursive heredocs on
+ irb[Bug #5648].
-Tue Aug 16 04:28:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 27 20:45:29 2012 Masaki Matsushita <glass.saga@gmail.com>
- * file.c (append_fspath): normalize directory name to be appended
- on OS X. [ruby-core:75957] [Ruby trunk Bug#12483]
- https://github.com/rails/rails/issues/25303#issuecomment-224834804
+ * ext/stringio/stringio.c (strio_getline): fix not to raise TypeError
+ when limit is nil.
+ [Bug #7232] [ruby-core:48531]
-Tue Aug 16 04:16:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/stringio/test_stringio.rb: a test for above.
- * regcomp.c (noname_disable_map): don't optimize out group 0
- Ruby's Regexp doesn't allow normal numbered groups if the regexp
- has named groups. On such case it optimizes out related NT_ENCLOSE.
- But even on the case it can use \g<0>.
- This fix not to remove NT_ENCLOSE whose regnum is 0.
- [ruby-core:75828] [Bug #12454]
+Thu Dec 27 21:08:23 2012 Charlie Somerville <charlie@charliesomerville.com>
-Tue Aug 16 04:06:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (VM_DEFINECLASS_TYPE): explicit cast to enum type to avoid 64->32
+ shorten warning
- * missing/crypt.c: fix size macros to use configured values
- for platforms long is larger than 32bit.
- [ruby-core:75792] [Bug #12446]
+Thu Dec 27 20:11:29 2012 Masaki Matsushita <glass.saga@gmail.com>
-Tue Aug 16 04:03:25 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * ext/stringio/stringio.c (strio_ungetc): raise IOError instead of RuntimeError
+ if the string is frozen.
+ [Bug #7231] [ruby-core:48530]
- * ext/openssl/ossl_bn.c (try_convert_to_bnptr): Extracted from
- GetBNPtr(). This doesn't raise exception but returns NULL on error.
- (GetBNPtr): Raise TypeError if conversion fails.
- (ossl_bn_eq): Implement BN#==.
- (ossl_bn_eql): #eql? should not raise TypeError even if the argument
- is not compatible with BN.
- (ossl_bn_hash): Implement BN#hash.
+ * ext/stringio/stringio.c (strio_ungetbyte): ditto.
- * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash.
+ * test/stringio/test_stringio.rb: a test for above.
- * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash
+Wed Dec 26 23:55:18 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Tue Aug 16 03:51:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/irb/context.rb: fix IRB::Inspector#keys_with_inspector [Bug #7598]
- * transcode.c (str_transcode0): scrub in the given encoding when
- the source encoding is given, not in the encoding of the
- receiver. [ruby-core:75732] [Bug #12431]
+Wed Dec 26 23:26:15 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Tue Aug 16 03:41:21 2016 Kazuki Yamaguchi <k@rhe.jp>
+ * lib/irb/context.rb: IRB::Context#use_readline= has been obsolete
+ [Bug #6339].
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_compute_key): Check that the DH
- has 'p' (the prime) before calling DH_size(). We can create a DH with
- no parameter but DH_size() does not check and dereferences NULL.
- [ruby-core:75720] [Bug #12428]
+Wed Dec 26 21:32:46 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does
- not check dsa->q.
+ * lib/irb/context.rb: make a correct prompt from
+ IRB.conf[:IRB_NAME] on irb [Bug #6338]. Patched by sho-h.
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
- ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
- ossl_rsa_private_decrypt): Ditto. RSA_size() does not check rsa->n.
+Wed Dec 26 21:09:19 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Tue Aug 16 03:10:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/irb/ext/math-mode.rb: make not able to change math-mode
+ after irb starting [Bug #6302]. Patched by sho-h.
- * transcode.c (enc_arg, str_transcode_enc_args, econv_args):
- remove volatile, and add GC guards in callers.
- [ruby-core:75664] [Bug #12411]
+Wed Dec 26 12:52:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Tue Aug 16 02:45:52 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/irb/init.rb: change default debug level for
+ irb[ruby-dev:46805], [Bug #6301].
- * ext/psych/*, test/psych/*: Update psych 2.1.0
- This version fixed [Bug #11988][ruby-core:72850]
+Wed Dec 26 11:54:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Aug 12 04:15:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: enable -fPIE when checking -pie for fixing
+ OpenBSD build error. Patch by George Koehler. Thank you!
+ [Bug #7606] [ruby-core:51082]
- * common.mk (build-ext), ext/extmk.rb: use variable EXTENCS
- different than ENCOBJS, to get rid of circular dependency.
- build libencs when linking encodings statically.
- [ruby-core:75618] [Bug #12401]
+Wed Dec 26 07:31:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 12 04:04:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_enc_cr_str_copy_for_substr): empty string is always
+ valid or 7bit.
- * process.c (rb_execarg_commandline): build command line string
- from argument vector in rb_execarg.
- [ruby-core:75611] [Bug #12398]
+ * string.c (rb_str_enumerate_lines, rb_str_chop): reduce duplicated
+ code.
-Fri Aug 12 03:30:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_enumerate_chars): prevent shared copy from GC.
- * variable.c (rb_local_constants_i): exclude private constants
- when excluding inherited constants too. [Bug #12345]
+Wed Dec 26 01:31:16 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
-Fri Aug 12 03:00:05 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/irb/init.rb, lib/irb/context.rb: fix conf.debug_level=
+ [Bug #6301] and fix irb command option: -- irb_debug_level for irb.
- * lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342]
+Wed Dec 26 00:59:18 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * test/drb/ut_timerholder.rb: ditto.
+ * lib/irb/ruby-lex.rb: improve RubyLex performance for large files
+ [Bug #5202]. Patch by ryanmelt.
-Fri Aug 12 02:46:37 2016 Kazuki Yamaguchi <k@rhe.jp>
+Tue Dec 25 22:21:06 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * ext/openssl/ossl_ssl.c (ossl_ssl_stop): Don't free the SSL struct
- here. Since some methods such as SSLSocket#connect releases GVL,
- there is a chance of use after free if we free the SSL from another
- thread. SSLSocket#stop was documented as "prepares it for another
- connection" so this is a slightly incompatible change. However when
- this sentence was added (r30090, Add toplevel documentation for
- OpenSSL, 2010-12-06), it didn't actually. The current behavior is
- from r40304 (Correct shutdown behavior w.r.t GC., 2013-04-15).
- [ruby-core:74978] [Bug #12292]
+ * lib/irb/output-method.rb: raise right exception when
+ IRB::OutputMethod#print don't defined [Bug #6657].
- * ext/openssl/lib/openssl/ssl.rb (sysclose): Update doc.
+Tue Dec 25 22:06:33 2012 Koichi Sasada <ko1@atdot.net>
- * test/openssl/test_ssl.rb: Test this.
+ * vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame):
+ pop a frame before JUMP_TAG() if exception occurred.
+ This change fix bug of Ruby 1.9.
+ [ruby-core:51128] [ruby-trunk - Bug #7624]
-Thu Aug 11 01:30:29 2016 Marcus Stollsteimer <sto.mar@web.de>
+ * vm_core.h (EXEC_EVENT_HOOK_AND_POP_FRAME): add to use
+ `rb_threadptr_exec_event_hooks_and_pop_frame()'.
- * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
- class description. [ci skip][Bug #12255][ruby-core:74835]
+ * vm.c (vm_exec): use EXEC_EVENT_HOOK_AND_POP_FRAME() while
+ exception handling. While exception handling, if an exception
+ is raised in hooks, need to pop current frame and raise this
+ raised exception by hook.
-Thu Aug 11 01:09:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add a test.
- * pack.c (pack_pack): use union instead of bare variable to ease
- optimizations and avoid assigning x87 floating point number.
- [ruby-core:74496] [Bug #12209]
+Tue Dec 25 21:08:53 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * pack.c (pack_unpack): ditto.
+ * lib/irb/init.rb, lib/irb/lc/ja/error.rb, lib/irb/lc/error.rb:
+ raise exception when illegal RC_NAME_GENERATOR defined [Bug #6455].
-Tue Aug 2 01:34:12 2016 Eric Wong <e@80x24.org>
+Tue Dec 25 19:22:17 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
- * lib/webrick/httpservlet/cgihandler.rb (do_GET): delete HTTP_PROXY
- * test/webrick/test_cgi.rb (test_cgi_env): new test
- * test/webrick/webrick.cgi (do_GET): new endpoint to dump env
- [ruby-core:76511] [Bug #12610]
+ * lib/irb/workspace.rb: define method to private on top-level irb
+ [Bug #5776]. Patch by davidbalbert.
-Tue Aug 2 01:33:11 2016 Shugo Maeda <shugo@ruby-lang.org>
+Tue Dec 25 19:09:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_refinement.rb: skip
- test_prepend_after_refine_wb_miss on ARM or MIPS.
- [ruby-core:76031] [Bug #12491]
+ * bignum.c, include/ruby/intern.h (rb_big_eql): exported.
-Sat Jul 30 12:23:29 2016 Shugo Maeda <shugo@ruby-lang.org>
+ * thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on
+ LLP64. see also r38493 and r38548.
+ reported by Heesob Park at [ruby-core:51083] [Bug #7607], and patched
+ by shirosaki at [ruby-core:51095]
- * vm_args.c (vm_caller_setup_arg_block): disable symbol block
- argument optimization when tail call optimization is enabled,
- in order to avoid SEGV. [ruby-core:76288] [Bug #12565]
+Tue Dec 25 18:53:35 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jul 30 12:10:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h, eval_intern.h (CHECK_STACK_OVERFLOW): move
+ CHECK_STACK_OVERFLOW() to vm_core.h and rename to
+ CHECK_VM_STACK_OVERFLOW().
+ This change is only move and rename.
- * proc.c (passed_block): convert passed block symbol to proc.
- based on the patch by Daisuke Sato in [ruby-dev:49695].
- [Bug #12531]
+ * tool/instruction.rb: catch up above changes.
-Sat Jul 30 10:58:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c, vm_insnhelper.c: ditto.
- * vm_insnhelper.c (vm_throw_start): check if the iseq is symbol
- proc, class definition should not be a symbol proc.
- [ruby-core:75856] [Bug #12462]
+ * vm_insnhelper.c (vm_stackoverflow): add a function to unify
+ raising vm stackoverflow exception.
-Mon Jul 11 22:35:00 2016 Kenta Murata <mrkn@mrkn.jp>
+Tue Dec 25 16:16:54 2012 Koichi Sasada <ko1@atdot.net>
- * bignum.c (rb_big_hash): make it public function to be available in
- other source files, and remove documentation comment for Bignum#hash.
+ * vm_core.h (RUBY_VM_THREAD_VM_STACK_SIZE): change default
+ VM stack size (128 KB or 256 KB -> 512 KB or 1024 KB).
+ This re-sizing corrects smaller value introduced at r38478.
+ Newer value is same VM stack size of Ruby 1.9.
+ [ruby-dev:46797] [ruby-trunk - Bug #7603]
- * bignum.c (Bignum#hash): remove its definition because it is unified
- with Object#hash.
+Tue Dec 25 13:38:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h (rb_big_hash): add a prototype declaration.
+ * error.c (compile_err_append, compile_warn_print, warn_print): use
+ rb_write_error_str() instead of writing to rb_stderr directly.
- * hash.c (any_hash): treat Bignum values directly.
+ * io.c (rb_write_error_str): a stopgap measure not to unblock GVL.
+ warning from require seems to still have race condition errors.
-Sat Jul 2 04:00:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 25 00:59:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (tr_trans): consider terminator length and fix heap
- overflow. reported by Guido Vranken <guido AT guidovranken.nl>.
+ * node.h (NODE_OP_CDECL), compile.c (iseq_compile_each),
+ parse.y (stmt, arg): allow scoped constant op-assignment.
+ [ruby-core:40154] [Bug #5449]
-Sat Jul 2 03:33:28 2016 Shugo Maeda <shugo@ruby-lang.org>
+Mon Dec 24 04:56:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm.c (invoke_bmethod, invoke_block_from_c_0): revert r52104
- partially to avoid "self has wrong type to call super in this
- context" errors.
- [ruby-core:72724] [Bug #11954]
+ * lib/net/http/generic_request.rb (Net::HTTPGenericRequest):
+ set content-length to zero on empty post requests
+ by Gregory Ostermayr <gregory.ostermayr@gmail.com>
+ https://github.com/ruby/ruby/pull/201 fix GH-201
-Mon Jun 20 02:38:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 19:09:16 2012 Koichi Sasada <ko1@atdot.net>
- * lib/optparse.rb (OptionParser::Completion.candidate): get rid of
- nil as key names. [ruby-core:75773] [Bug #12438]
+ * thread.c: rename methods:
+ from Thread.async_interrupt_timing to Thread.handle_interrupt,
+ from Thread.async_interrupted? to Thread.pending_interrupt?.
+ Also rename option from `defer' to `never'.
+ [ruby-core:51074] [ruby-trunk - Feature #6762]
- * lib/optparse.rb (OptionParser#make_switch): char class option
- cannot be NoArgument, default to RequiredArgument.
+ * vm_core.c, thread.c: rename functions and data structure
+ `async_errinfo' to `pending_interrupt'.
-Mon Jun 20 02:25:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c: add global variables sym_immediate, sym_on_blocking and
+ sym_never.
- * re.c (unescape_nonascii): scan hex up to only 3 characters.
- [Bug #12420] [Bug #12423]
+ * cont.c, process.c, vm.c, signal.c: ditto.
-Mon Jun 20 02:25:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/sync.rb, lib/thread.rb: catch up this renaming.
- * regparse.c (fetch_token_in_cc): raise error if given octal escaped
- character is too big. [Bug #12420] [Bug #12423]
+ * test/ruby/test_thread.rb: ditto.
-Sun Jun 19 04:29:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 17:57:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/missing.h (isfinite): move from numeric.c.
+ * lib/profiler.rb (Profiler__::PROFILE_PROC, print_profile): store
+ profile data per threads for concurrent-execution.
+ [ruby-core:22046] [Bug #1152]
-Sun Jun 19 04:29:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/profiler.rb (Profiler__::Wrapper): support calling singleton
+ methods of an instance of BasicObject.
- * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
- cygwin. [Bug #12417][ruby-core:75691]
+ * lib/profiler.rb (Profiler__::PROFILE_PROC): use TracePoint.
-Sun Jun 19 04:29:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 23 16:13:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always
- exist. fixed build error on Windows introduced at r55123.
+ * lib/erb.rb: typos for ERB::new link
-Sun Jun 19 04:29:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 16:06:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider
- non-finite float values not to raise FloatDomainError.
- [ruby-core:75682] [Bug #12414]
+ * lib/erb.rb: Document ERB::new trim_mode '-' for lines ending in -%>
+ [ruby-core:51084] [Bug #7608]
-Thu Jun 16 00:42:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 15:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * string.c (rb_str_modify_expand): check integer overflow.
- [ruby-core:75592] [Bug #12390]
+ * lib/irb/ruby-lex.rb: Add handling for %i and %I quoting to irb
+ Patch by flori [ruby-core:49550] [Bug #7392] [Github Issue #157]
-Thu Jun 16 00:29:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 23 15:05:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even
- in the class context. [ruby-core:75505] [Bug #12382]
+ * vm_eval.c (rb_check_funcall_with_hook): rb_check_funcall with hook
+ which is called before calling method_missing or target method.
-Tue Jun 14 03:49:28 2016 Eric Wong <e@80x24.org>
+ * marshal.c (w_object, r_object0): use rb_check_funcall_with_hook
+ instead of respond_to? and call.
- * dir.c (dir_close): update RDoc for 2.3 #close change
- [ruby-core:75679] [Bug #12413]
+Sun Dec 23 14:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Tue Jun 14 03:47:29 2016 Eric Wong <e@80x24.org>
+ * re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added example
+ [ruby-dev:46746] [Bug #7571]
- * proc.c: fix RDoc of Proc#===/call/yield/[]
- [Bug #12332]
+Sun Dec 23 14:35:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 14 03:34:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (BLOCKING_REGION): if fail_if_interrupted is false ignore
+ the result of blocking_region_begin(), since it always is true in
+ that case. suppress "uninitialized" warnings.
- * variable.c (rb_local_constants_i): exclude hidden constants.
- [ruby-core:75575] [Bug #12389]
+Sun Dec 23 09:34:07 2012 Eric Hodel <drbrain@segment7.net>
-Tue Jun 14 03:25:14 2016 Benoit Daloze <eregontp@gmail.com>
+ * lib/rubygems/commands/check_command.rb: Added --doctor and --dry-run
+ options to clean up after failed uninstallation.
+ * test/rubygems/test_gem_commands_check_command.rb: Test for above.
- * insns.def (defineclass): Also raise an error when redeclaring the
- superclass of a class as Object and it has another superclass.
- [Bug #12367] [ruby-core:75446]
+ * lib/rubygems/commands/push_command.rb: Allow pushes from RubyGems
+ 2.0.0.preview3
- * test/ruby/test_class.rb: test for above.
+ * lib/rubygems/commands/update_command.rb: Use Gem.ruby_version
-Tue Jun 14 03:15:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/dependency.rb: Update style.
- * process.c (rb_exec_getargs): honor the expected argument types
- over the conversion method. the basic language functionality
- should be robust. [ruby-core:75388] [Bug #12355]
+ * lib/rubygems/installer.rb: Ensure installed gem specifications will
+ be useable. Refactor.
+ * test/rubygems/test_gem_installer.rb: ditto.
-Tue Jun 14 03:02:38 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rubygems/validator.rb: Fixed bug with unreadable files.
- * win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements new
- truncate alternative which accepts UTF-8 path.
+ * lib/rubygems.rb: Fixed broken methods.
+ * test/rubygems/test_gem.rb: Test for above.
- * file.c (truncate): use above function.
- [Bug #12340]
+ * test/rubygems/test_gem_commands_push_command.rb: Fixed overridden
+ Gem.latest_rubygems_version
-Tue Jun 14 02:58:41 2016 Marcus Stollsteimer <sto.mar@web.de>
+Sun Dec 23 01:52:01 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/date/date_core.c (Init_date_core): [DOC] Convert DateTime
- documentation to RDoc from Markdown.
- [ruby-core:75136] [Bug #12311]
+ * io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints):
+ Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF.
+ [Feature #6670]
-Sun Jun 12 02:36:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars)
+ (strio_codepoints): Deprecate
+ StringIO#{lines,bytes,chars,codepoints}. [Feature #6670]
- * regcomp.c (compile_length_tree): return error code immediately
- if compile_length_tree raised error [Bug #12418]
+ * ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes):
+ Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670]
-Sun Jun 12 02:27:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 23 01:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * thread.c (recursive_list_access): a object id may be a Bignum. so,
- the list must be a objhash, instead of a identhash.
- this fixes many test errors on mswin64 CI.
+ * lib/optparse.rb: Documentation for OptionParser to remove 'shadowed
+ outer local variable' from example and make obvious ARGV with
+ non-option arguments.
+ Patch by Marcus Stollsteimer [ruby-core:47460] [Bug #6997]
-Sun Jun 12 01:59:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 23 00:08:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * parse.y (new_if_gen): set newline flag to NODE_IF to trace all
- if/elsif statements. [ruby-core:67720] [Bug #10763]
+ * include/ruby/intern.h: add the prototype declaration of
+ rb_num_coerce_bit.
-Sun May 15 02:33:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (rb_num_coerce_bit): the new coerce function for bitwise
+ binary operation.
- * lib/mkmf.rb (pkg_config): use xsystem consistently to set up
- library path environment variable as well as latter pkg-config
- calls. [ruby-dev:49619] [Bug #12379]
+ * bignum.c (rb_big_and): use coerce to convert the argument, which isn't
+ a Fixnum nor a Bignum, to the corresponding Integer object so that
+ bitwise operations can support Integer-mimic objects.
+ [Bug #1792] [ruby-core:39491]
-Fri May 6 02:30:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big_or): ditto.
- * lib/optparse.rb: [DOC] fix example code. base on the code by
- Semyon Gaivoronskiy in [ruby-core:75224]. [Bug #12323]
+ * bignum.c (rb_big_xor): ditto.
-Fri May 6 02:28:31 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * numeric.c (bit_coerce): ditto.
- * ext/win32ole/win32ole.c (ole_vstr2wc, ole_variant2val): fix blank
- string conversion.
- [Bug #11880]
- Thanks Akio Tajima for the patch!
+ * numeric.c (fix_and): ditto.
-Fri May 6 02:24:13 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * numeric.c (fix_or): ditto.
- * bignum.c: [DOC] Update result of 123456789 ** -2.
- [ruby-dev:49606] [Bug #12339]
+ * numeric.c (fix_xor): ditto.
-Wed May 4 02:38:08 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+ * test/ruby/test_integer.rb: add tests for the above changes.
- * internal.h (RCOMPLEX_SET_IMAG): undef RCOMPLEX_SET_IMAG
- instead of duplicated undef RCOMPLEX_SET_REAL.
+ * test/ruby/test_bignum.rb: ditto.
-Wed May 4 02:38:08 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+Sun Dec 23 00:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * complex.c (rb_complex_set_imag): Fix to properly set imag
- of complex.
+ * internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and
+ IDs. [Bug #7574] [ruby-dev:46749]
-Tue Apr 26 23:34:45 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * string.c (rb_str_quote_unprintable): ditto.
- * version.h: Bump versionto 2.3.2.
+Sat Dec 22 23:59:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 26 02:58:51 2016 Marcus Stollsteimer <sto.mar@web.de>
+ * error.c (rb_compile_error, rb_compile_warn, rb_compile_warning),
+ (rb_warn, rb_warning): support PRIsVALUE.
- * doc/extension.rdoc: Improvements to english grammers.
- [Bug #12246][ruby-core:74792][ci skip]
+Sat Dec 22 22:04:58 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Apr 26 02:58:51 2016 craft4coder <yooobuntu@163.com>
+ * cont.c (rb_fiber_start): unify conditions.
- * doc/extension.rdoc: [DOC] `nul` should be uppercase.
- change 'nul' => 'NUL'. [Fix GH-1172]
+Sat Dec 22 21:47:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Apr 26 02:54:57 2016 Marcus Stollsteimer <sto.mar@web.de>
+ * io.c (rb_io_wait_writable): use rb_thread_check_ints() instead
+ of rb_thread_fd_writable().
+ * io.c (rb_io_wait_readable): ditto.
- * encoding.c: Fix return value of `Encoding::ISO8859_1.name`
- [Bug #12313][ruby-core:75147][ci skip]
- * ext/bigdecimal/bigdecimal.c: Fix code sample of `BigDecimal.new`
+Sat Dec 22 20:31:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 25 02:29:07 2016 Rei Odaira <Rei.Odaira@gmail.com>
+ * object.c (rb_mod_const_get): symbol cannot be nested constant name.
- * configure.in: add missing -lm for AIX.
+Sat Dec 22 19:26:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 25 02:29:07 2016 Rei Odaira <Rei.Odaira@gmail.com>
+ * object.c (rb_mod_const_get): check more strictly. [ruby-dev:46748]
+ [Bug #7573]
- * configure.in: don't use the system-provided round(3) on AIX.
- In AIX, round(0.49999999999999994) returns 1.0.
- Use round() in numeric.c instead.
+Wed Dec 19 02:34:48 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sun Apr 24 03:05:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_fiber_start): in case of jump with TAG_FATAL,
+ enqueue error into async_errinfo_queue, because you cannot call
+ TH_TAG_JUMP() in this function. [ruby-dev:45218] [Bug #5993]
- * ruby.c: cygwin does not use w32_cmdvector, command line can be
- other than UTF-8. [ruby-dev:49519] [Bug #12184]
+ * thread.c (rb_threadptr_execute_interrupts): now INT2FIX(TAG_FATAL)
+ can be popped from async_errinfo_queue.
-Sat Apr 23 01:01:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_make_jump_tag_but_local_jump): revert r38441.
+ rb_vm_make_jump_tag_but_local_jump() shouldn't return exception
+ in case of state == TAG_FATAL.
- * eval_jump.c (exec_end_procs_chain): restore previous error info
- for each end procs. [ruby-core:75038] [Bug #12302]
+ * test/ruby/test_fiber.rb (test_exit_in_fiber): fix a test to illuminate
+ Thread.exit should terminate current Thread.
-Sat Apr 23 00:51:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 22 13:15:08 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * compile.c (new_label_body): initialize bit fields, since
- compile_data_alloc does not clear the memory. [Bug #12082]
+ * gc.c (obj_id_to_ref): add a macro to treat Bignum object id.
+ This follows the change r38493.
-Sat Apr 23 00:51:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (id2ref): fix for working fine with Bignum object id on x64
+ Windows.
+ * gc.c (wmap_finalize): ditto.
- * compile.c (iseq_optimize): disable tail call optimization in
- rescued, rescue, and ensure blocks.
- [ruby-core:73871] [Bug #12082]
+Sat Dec 22 11:30:21 2012 Masaki Matsushita <glass.saga@gmail.com>
-Sat Apr 23 00:33:04 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * struct.c (make_struct): remove junk ID check to allow members who
+ have junk name like "foo\000".
+ * test/ruby/test_struct.rb: Test for above.
+ [Bug #7575] [ruby-dev:46750]
- * ext/nkf/nkf-utf8/nkf.c (mime_putc): fix typo.
- [Bug #12202] [ruby-core:74802]
+Sat Dec 22 05:34:54 2012 Eric Hodel <drbrain@segment7.net>
-Sat Apr 23 00:33:04 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/http.rb: Requests may be created with a URI which sets the
+ Host header. Responses contain the requested URI for easier redirect
+ following. [ruby-trunk - Feature #6482]
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * NEWS (net/http): Updated for above.
+ * test/net/http/test_http.rb: Tests for above.
+ * test/net/http/test_http.rb: ditto.
+ * test/net/http/test_httpresponse.rb: ditto.
- * ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
- patched by Anton Sivakov [Bug #12201] [Bug #12202]
+Sat Dec 22 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Apr 23 00:29:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/irb/slex.rb(#match): Typo, should be D_DETAIL
+ [ruby-core:51071] [Bug#7600]
- * lib/securerandom.rb (gen_random): to avoid blocking on Windows.
- On Windows OpenSSL RAND_bytes (underlying implementation is
- RAND_poll in crypto/rand/rand_win.c) may be blocked at
- NetStatisticsGet.
- https://wiki.openssl.org/index.php/Random_Numbers#Windows_Issues
- Instead of this, use Random.raw_seed directly (whose implementation
- CryptGenRandom is one of the source of
- entropy of RAND_poll on Windows).
- https://wiki.openssl.org/index.php/Random_Numbers
- Note: CryptGenRandom function is PRNG and doesn't check its entropy,
- so it won't block. [Bug #12139]
- https://msdn.microsoft.com/ja-jp/library/windows/desktop/aa379942.aspx
- https://tools.ietf.org/html/rfc4086#section-7.1.3
- https://eprint.iacr.org/2007/419.pdf
- http://www.cs.huji.ac.il/~dolev/pubs/thesis/msc-thesis-leo.pdf
+Sat Dec 22 02:29:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Apr 23 00:25:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/irb/input-method.rb, lib/irb.rb: Typo in
+ InputMethod#readable_atfer_eof? to #readable_after_eof?
+ [ruby-core:51069] [Bug #7599]
- * miniinit.c (Init_enc): add some common aliases of built-in
- encodings. [ruby-core:72481] [Bug #11872]
+Sat Dec 22 02:19:38 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Apr 23 00:13:50 2016 sorah (Shota Fukumori) <her@sorah.jp>
+ * vm_dump.c (rb_vm_bugreport): revert r38533.
+ * addr2line.c (fill_lines): add ELF sanity check.
+ [Bug #7597] [ruby-dev:46786]
- * lib/forwardable.rb: Convert given accessors to String.
+Sat Dec 22 02:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
- r53381 changed to accept only Symbol or String for accessors, but
- there are several rubygems that pass classes (e.g. Array,
- Hash, ...) as accessors. Prior r53381, it was accepted because Class#to_s
- returns its class name. After r53381 given accessors are checked
- with define_method, but it accepts only Symbol or String, otherwise
- raises TypeError.
+ * lib/irb/inspector.rb, lib/irb/context.rb: Move IRB::INSPECTORS and
+ class methods to IRB::Inspector [ruby-core:51067][Bug #7598]
- def_delegator Foo, :some_method
+Sat Dec 22 00:28:46 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- This change is to revert unexpected incompatibility. But this behavior
- may change in the future.
+ * object.c (rb_obj_hash): shouldn't assume object_id can be long.
+ based on a patch by Heesob Park at [ruby-core:51060].
+ cf. [Backport #7454]
-Sat Apr 23 00:02:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 21 23:15:25 2012 Kouhei Sutou <kou@cozmixng.org>
- * configure.in: check if succeeded in creating config.h.
+ * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
+ CPtr -> Pointer.
+ * test/fiddle/test_c_struct_entry.rb
+ (Fiddle::TestCStructEntity#test_aref_pointer):
+ Added the test for the above.
- * tool/ifchange: ignore failures when TEST_COLORS unmatched. just
- use the default value if expected name is not contained in it.
- [ruby-core:75046] [Bug #12303]
+Fri Dec 21 23:12:05 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Apr 22 23:47:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
+ CPtr -> Pointer.
+ * test/fiddle/test_c_struct_entry.rb
+ (Fiddle::TestCStructEntity#test_aref_pointer_array):
+ Added the test for the above.
- * doc/regexp.rdoc (comments): [DOC] terminators cannot appear in
- comments. [ruby-core:74838] [Bug #12256]
+Fri Dec 21 22:43:36 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Apr 22 23:44:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof):
+ CPtr -> Pointer.
+ * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
+ Added the test for the above.
- * extension.rdoc, extension.ja.rdoc: [DOC] Fix some errors.
- Renamed files, wrong method names or argument types; the example
- GetDBM macro is now updated to the current version of the actual
- code. patch by Marcus Stollsteimer in [ruby-core:74690].
- [Bug #12228]
+Fri Dec 21 22:34:17 2012 Koichi Sasada <ko1@atdot.net>
-Fri Apr 22 23:32:19 2016 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_iseq.rb: disable a test which checks features
+ removed at r38532.
- * test/ruby/test_time_tz.rb: Tests depends on Europe/Moscow removed
- to avoid test failures due to the tzdata change.
- https://github.com/eggert/tz/commit/8ee11a301cf173afb0c76e0315b9f9ec8ebb9d95
- Found by naruse.
+Fri Dec 21 22:02:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()
+ and renamed from rb_w32_readdir_with_enc().
+ [ruby-core:24864] [Feature #1927]
- * configure.in (rb_cv_lgamma_r_m0): fix the condition for
- lgamma_r(-0.0). [Bug #12249]
+ * dir.c (READDIR): follow above change.
-Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 21 21:12:54 2012 Masaya Tarui <tarui@ruby-lang.org>
- * configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)
- returns negative infinity. [Bug #12249]
+ * vm_dump.c (rb_vm_bugreport): commentout addr2line call temporarily
+ in order to avoid segv. anyone can fix addr2line?
+ [Bug #7597] [ruby-dev:46786]
- * math.c (ruby_lgamma_r): define by the configured result.
+Fri Dec 21 20:38:28 2012 Koichi Sasada <ko1@atdot.net>
-Tue Apr 19 02:32:50 2016 cremno phobia <cremno@mail.ru>
+ * iseq.c (Init_ISeq): remove definition of the following methods:
+ ISeq#line_trace_all and ISeq#line_trace_specify because they are
+ half baked.
+ C APIs are remained as experimental. These functions will be
+ renamed, removed their parameters may be changed.
+ You can use these methods by C exts. Please give us your comments.
- * math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
- since msvcrt does not provide it.
+Fri Dec 21 20:21:04 2012 Koichi Sasada <ko1@atdot.net>
- * missing/lgamma_r.c (lgamma_r): fix lgamma(-0.0).
- [ruby-core:74823] [Bug #12249]
+ * vm_trace.c (tracepoint_new): add code to support specified thread.
+ But not tested and this feature is not supported officially.
-Tue Apr 19 02:32:50 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Dec 21 19:37:15 2012 Koichi Sasada <ko1@atdot.net>
- * math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
- cf. [Bug #12249]
+ * ruby.c (process_options): need to acquire env from TOPLEVEL_BINDING
+ each time.
+ `bind->env' may update after `eval()'.
+ [Bug #7536]
-Tue Apr 19 02:32:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 21 18:46:50 2012 Koichi Sasada <ko1@atdot.net>
- * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
- [ruby-core:74817] [Bug #12249]
+ * include/ruby/debug.h, vm_core.h: define rb_trace_arg_t at
+ include/ruby/debug.h (move from vm_core.h).
-Tue Apr 19 01:53:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 21 17:48:15 2012 Koichi Sasada <ko1@atdot.net>
- * defs/keywords (alias, undef): symbol literals are allowed.
+ * vm_core.h, vm_trace.c: fix multi-threading bug for tracing.
+ Move `trace_arg' from rb_tp_t::trace_arg to rb_thread_t::trace_arg.
+ `trace_arg' may changed by multiple threads.
+ rb_thread_t::trace_arg can represent rb_thread_t::trace_running
+ (null or non-null) and rb_thread_t::trace_running is removed.
+ After that, `rb_tp_t' is not needed to check tracing or not
+ (A running thread knows tracing or not). This is why I remove
+ tp_attr_check_active() and make new function get_trace_arg().
- * parse.y (parse_percent): should parse symbol literals for alias
- and undef. [ruby-dev:47681] [Bug #8851]
+ And this modification disable to work the following code:
+ TracePoint.trace{|tp|
+ Thread.new{p tp.event} # access `tp' from other threads.
+ }
+ I believe nobody mix threads at trace procedure.
+ This is current limitation.
+ [Bug #7590]
-Mon Apr 18 18:05:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (fiber_switch, rb_cont_call): use rb_thread_t::trace_arg
+ instead of rb_thread_t::trace_running.
- * struct.c (struct_make_members_list, rb_struct_s_def): member
- names should be unique. [ruby-core:74971] [Bug #12291]
+ * test/ruby/test_settracefunc.rb: add a multi-threading test.
- * struct.c (struct_make_members_list): extract making member name
- list from char* va_list, with creating symbols without
- intermediate IDs.
+Fri Dec 21 16:38:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 18 17:54:40 2016 Joe Swatosh <joe.swatosh@gmail.com>
+ * template/id.h.tmpl (ID2ATTRSET): compile time constant macro for
+ ID_ATTRSET.
- * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix
- API names. [ruby-core:74863] [Bug #12264]
+ * defs/id.def (KeywordError): check duplication.
-Mon Apr 18 17:27:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * defs/id.def: support for other scope IDs,
+ ID_{INSTANCE,GLOBAL,CONST,CLASS}.
- * compile.c (iseq_peephole_optimize): should not replace the
- current target INSN, not to follow the replaced dangling link in
- the caller. [ruby-core:74993] [Bug #11816]
+Fri Dec 21 14:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Mon Apr 18 17:18:25 2016 cremno phobia <cremno@mail.ru>
+ * lib/irb.rb, lib/irb/*: Documentation for IRB
- * cont.c (fiber_initialize_machine_stack_context): fix wrong
- _MSC_VER check, should be decimal but not hexadecimal.
- [ruby-core:74936] [Bug #12279]
+Fri Dec 21 11:31:02 2012 Eric Hodel <drbrain@segment7.net>
-Mon Apr 18 17:18:25 2016 cremno phobia <cremno@mail.ru>
+ * lib/rake/*: Updated to rake 0.9.6
+ * doc/rake/*: ditto
+ * test/rake/*: ditto
- * cont.c (fiber_initialize_machine_stack_context): fix wrong
- _MSC_VER check, should be decimal but not hexadecimal.
- [ruby-core:74936] [Bug #12279]
+Fri Dec 21 08:56:34 2012 Masaya Tarui <tarui@ruby-lang.org>
-Mon Apr 18 17:08:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (rb_suppress_tracing): remove unused variable 'vm_tracing'
- * vm_core.h (rb_vm_struct): make at_exit a single linked list but
- not RArray, not to mark the registered functions by the write
- barrier. based on the patches by Evan Phoenix.
- [ruby-core:73908] [Bug #12095]
+Fri Dec 21 01:01:45 2012 Masaya Tarui <tarui@ruby-lang.org>
-Mon Apr 18 16:56:31 2016 Benoit Daloze <eregontp@gmail.com>
+ * lib/irb/completion.rb (CompletionProc): support completion of
+ instance variables. [ruby-dev:46710] [Bug #7520]
- * thread.c (update_coverage): Do not track coverage in loaded files
- after Coverage.result. Avoids out-of-bounds access. [Bug #12237]
+Thu Dec 20 20:58:25 2012 Masaya Tarui <tarui@ruby-lang.org>
- * ext/coverage/coverage.c (coverage_clear_result_i): document.
+ * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running
+ counter. And if tracing is already true, vm_trace_running ops is
+ skipped to control overflow.
-Mon Apr 18 16:33:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 18:29:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
- of DateTime. [ruby-core:74729] [Bug #12233]
+ * include/ruby/ruby.h (RTEST, NIL_P): make bare expressions without
+ outermost parentheses.
-Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 17:29:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM):
- * add missing parentheses and remove double quotes.
- * rename to get rid of recursive references.
- * as --excludes-dir option is for a path name, its argument
- should be converted.
- [ruby-dev:49526] [Bug #12199]
+ * NEWS: fix the description for Refinements.
-Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 16:53:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
- long option.
+ * vm_core.h (rb_vm_defineclass_type_t),
+ compile.c (iseq_compile_each), insns.def (defineclass): change the
+ meaning of the third operand of defineclass as follows:
+ lower 3bits: the type of the defineclass
+ 0 = class, 1 = singleton class, 2 = module
+ 4th bit: a flag represents whether the defineclass is scoped
+ 0 = not scoped (e.g., class Foo)
+ 1 = scoped (e.g., class Bar::Baz)
+ 5th bit: a flag represents whether the superclass is specified
+ 0 = not specified (e.g., class Foo)
+ 1 = specified (e.g., class Bar < Foo)
+ If the superclass is specified and is not a class, a TypeError
+ should be raised. [ruby-dev:46747] [Bug #7572]
- * cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL): suppress path name
- conversions by msys2. [ruby-dev:49525] [Bug #12199]
+ * test/ruby/test_class.rb: related test.
-Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 16:52:37 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/lib/test/unit.rb (Options#non_options): make regexp name
- options prefixed with "!" negative filters.
+ * NEWS: announce AEAD encryption support in the OpenSSL extension.
- * common.mk (TEST_EXCLUDES): use negative filter to exclude memory
- leak tests. -x option excludes test files, not test methods.
+Thu Dec 20 16:40:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Apr 17 04:30:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (nonspecial_obj_id): VALUE is not compatible with Fixnum on
+ LLP64 platform, such as 64bit Windows.
+ reported by Heesob Park at [ruby-core:50255] [Bug #7454], and the
+ fix is suggested by akr.
- * parse.y (parse_ident): allow keyword arguments just after a
- method where the same name local variable is defined.
- [ruby-core:73816] [Bug#12073]
+Thu Dec 20 16:39:04 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
-Sun Apr 17 04:20:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_cipher.c: fix errors for installations that do not
+ feature Authenticated Encryption.
+ * ext/openssl/extconf.rb: detect presence of EVP_CTRL_GCM_GET_TAG to
+ determine whether Authenticated Encryption can be used.
+ [Feature #6980] [ruby-core:47426]
- * eval.c (setup_exception): set the cause only if it is explicitly
- given or not set yet. [Bug #12068]
+Thu Dec 20 15:55:46 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
-Sat Apr 16 00:56:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl.c: do not use FIPS_mode_set if not available.
+ * test/openssl/utils.rb: revise comment about setting FIPS mode to
+ false.
+ * test/openssl/test_fips.rb: remove tests that cause errors on
+ ruby-ci.
+ [Feature #6946] [ruby-core:47345]
- * thread.c (rb_thread_setname): defer setting native thread name
- set in initialize until the native thread is created.
- [ruby-core:74963] [Bug #12290]
+Thu Dec 20 15:22:59 2012 Eric Hodel <drbrain@segment7.net>
-Fri Apr 15 21:10:00 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/rdoc/parser/ruby.rb: Ignore methods defined on constants to
+ prevent modules with the names of constants from appearing in the
+ documentation.
+ * test/rdoc/test_rdoc_parser_ruby.rb: Test for the above.
- * lib/irb/ext/save-history.rb: Fix NoMethodError when method is not defined.
+Thu Dec 20 15:00:33 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
-Fri Apr 15 14:52:06 2016 Elliot Winkler <elliot.winkler@gmail.com>
+ * ext/openssl/ossl_cipher.c: add support for Authenticated Encryption
+ with Associated Data (AEAD) for OpenSSL versions that support the
+ GCM encryption mode. It's the only mode supported for now by OpenSSL
+ itself. Add Cipher#authenticated? to detect whether a chosen mode
+ does support Authenticated Encryption.
+ * test/openssl/test_cipher.rb: add tests for Authenticated Encryption.
+ [Feature #6980] [ruby-core:47426] Thank you, Stephen Touset for
+ providing a patch!
- * lib/forwardable.rb (def_instance_delegator) fix delegating to
- 'args' and 'block', clashing with local variables in generated
- methods. [ruby-core:72579] [Bug #11916]
+Thu Dec 20 12:56:53 2012 Eric Hodel <drbrain@segment7.net>
- * lib/forwardable.rb (def_single_delegator): ditto.
+ * lib/rdoc/markup/to_html.rb (class RDoc): Added current heading and
+ top links to headings.
+ * lib/rdoc/generator/template/darkfish/rdoc.css: ditto
+ * test/rdoc/test_rdoc_generator_markup.rb: Test for above
+ * test/rdoc/test_rdoc_markup_to_html.rb: ditto
-Fri Apr 15 14:27:48 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/rdoc/test_rdoc_comment.rb: Removed trailing whitespace.
- * lib/irb/ext/save-history.rb: suppress warning: method redefined;
- discarding old save_history=.
+Thu Dec 20 11:05:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 12 16:15:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/envutil.rb (assert_valid_syntax): move from
+ test_syntax.rb.
- * configure.in: improve ICC (Intel C Compiler) support.
+ * test/ruby/envutil.rb (assert_normal_exit): validate syntax before
+ running because this assertion passes even if the code fails by
+ SyntaxError.
- * configure.in (CXX): The name of icc's c++ compiler is `icpc`.
+Thu Dec 20 10:29:58 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * configure.in (warnings): Add `-diag-disable=2259` to suppress
- noisy warnings: "non-pointer conversion from "..." to "..." may
- lose significant bits".
+ * test/openssl/test_pkey_dh.rb: revert special treatment of
+ FIPS-capable installations since FIPS mode is now disabled for the
+ tests.
- * configure.in (optflags): Add `-fp-model precise` like -fno-fast-math.
+Thu Dec 20 10:23:12 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * lib/mkmf.rb: icc supports -Werror=division-by-zero
- and -Werror=deprecated-declarations, but doesn't support
- -Wdivision-by-zero and -Wdeprecated-declarations.
+ * ext/openssl/ossl.c: add OpenSSL.fips_mode= to allow enabling FIPS
+ mode manually.
+ * test/openssl/utils.rb: turn off FIPS mode for tests. This prevents
+ OpenSSL installations with FIPS mode enabled by default from raising
+ FIPS-related errors during the tests.
+ * test/openssl/test_fips.rb: add tests for FIPS-capable OpenSSL
+ installations.
+ [Feature #6946] [ruby-core:47345]
-Tue Apr 12 14:29:01 2016 Kazuki Yamaguchi <k@rhe.jp>
+Thu Dec 20 06:59:52 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/extconf.rb: check SSL_CTX_set_next_proto_select_cb
- function rather than OPENSSL_NPN_NEGOTIATED macro. it exists
- even if it is disabled by OpenSSL configuration.
- [ruby-core:74384] [Bug #12182]
+ * vm.c: support variable VM/Machine stack sizes.
+ Specified by the following environment variables:
+ - RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
+ default: 128KB (32bit CPU) or 256KB (64bit CPU).
+ - RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
+ creation. default: 512KB or 1024KB.
+ - RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
+ default: 64KB or 128KB.
+ - RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
+ creation. default: 256KB or 256KB.
+ This values are specified at launched timing. You can not change
+ these values at running time.
+ Environ variables are only *hints* because:
+ - They are aligned to 4KB.
+ - They have minimum values (depend on OSs).
+ - Machine stack settings are ignored by some OSs.
+ Default values especially fiber stack sizes are increased.
+ This change affect Fiber's behavior:
+ (1) You can run more complex program on a Fiber.
+ (2) You can not make many (thousands) Fibers because of
+ lack of address space (on 32bit CPU).
+ If (2) bothers you,
+ (a) Use 64bit CPU with big memory, or
+ (b) Specify RUBY_FIBER_(VM|MACHINE)_STACK_SIZE correctly.
+ You need to choose correct stack size carefully. These values
+ are completely rely on systems (OS/compiler and so on).
+ [Feature #4614], [Bug #7212]
- * ext/openssl/ossl_ssl.c: update #ifdef(s) as above.
+ * vm_core.h (rb_vm_t::default_params): add to record above settings.
- * test/openssl/test_ssl.rb: skip NPN tests if NPN is disabled.
+ * vm.c (RubyVM::DEFAULT_PARAMS): add new constant to see
+ above setting.
-Tue Apr 12 14:27:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.c: support RUBY_THREAD_MACHINE_STACK_SIZE.
- * lib/uri/http.rb (URI::HTTP#initialize): [DOC] fix example,
- missing mandatory arguments. [ruby-core:74540] [Bug #12215]
+ * cont.c: support RUBY_FIBER_(VM|MACHINE)_STACK_SIZE.
-Thu Apr 7 01:07:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fiber.rb: add tests for above.
- * sprintf.c (rb_str_format): fix buffer overflow, length must be
- greater than precision. reported by William Bowling <will AT
- wbowling.info>.
+ * test/ruby/test_thread.rb: ditto.
-Wed Apr 6 00:33:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 06:25:44 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems/security.rb (DIGEST_ALGORITHM, KEY_ALGORITHM):
- should check same name as the used constants.
- [ruby-core:72674] [Bug #11940]
+ * test/ruby/test_fiber.rb: remove a strange single quote character.
+ With this character, this script exits by SyntaxError.
-Mon Apr 4 00:31:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 20 01:03:00 2012 Zachary Scott <zachary@zacharyscott>
- * compile.c (compile_massign_lhs): when index ends with splat,
- append rhs value to it like POSTARG, since VM_CALL_ARGS_SPLAT
- splats the last argument only. [ruby-core:72777] [Bug #11970]
+ * ext/.document: Add missing ext modules to .document
+ Patch by Ryunosuke SATO [Fixes Github #224]
-Sat Apr 2 02:07:29 2016 Seiei Miyagi <hanachin@gmail.com>
+Wed Dec 19 23:52:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
- Ripper.lex error in dedenting squiggly heredoc. heredoc tree is
- also an array of Elem in the outer tree. [Fix GH-1234]
+ * ruby.c (load_file_internal): use original C string as the filename
+ for parser.
+ reported by whiteleaf at [ruby-list:49085] [ruby-dev:46738]
+ [Bug #7562]
-Wed Mar 30 02:28:13 2016 Eric Wong <e@80x24.org>
+Wed Dec 19 23:36:12 2012 Naohisa Goto <ngotogenome@gmail.com>
- * thread_pthread.c (setup_communication_pipe): delay setting owner
- (rb_thread_create_timer_thread): until thread creation succeeds
- [ruby-core:72590] [Bug #11922]
+ * marshal.c (marshal_dump, marshal_load): fix SEGV during make rdoc
+ and test failure in TestMarshal#test_gc and test_context_switch
+ on SPARC Solaris 10 compiled with Oracle Solaris Studio 12.3.
+ [Bug #7591] [ruby-dev:46772]
-Wed Mar 30 02:20:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 19 19:34:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * localeinit.c (rb_locale_charmap_index): fix prototype.
- patched by Andreas Schwab [Bug #12218]
+ * object.c (rb_mod_const_get): nul byte is invalid as constant name.
-Wed Mar 30 02:20:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 19 17:54:18 2012 Masaya Tarui <tarui@ruby-lang.org>
- * thread_pthread.c (reserve_stack): fix reserving position where
- the stack growing bottom to top. [Bug #12118]
+ * vm_trace.c (rb_threadptr_exec_event_hooks): get rid of race
+ condition. [Bug #7589] [ruby-dev:46763]
-Wed Mar 30 02:17:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 19 16:30:28 2012 Eric Hodel <drbrain@segment7.net>
- * win32/file.c (rb_readlink): drop garbage after the substitute
- name, as rb_w32_read_reparse_point returns the expected buffer
- size but "\??\" prefix is dropped from the result.
+ * doc/syntax/literals.rdoc: Added 0d decimal format. Thanks Nobu!
- * win32/win32.c (w32_readlink): ditto, including NUL-terminator.
+Wed Dec 19 16:19:36 2012 Eric Hodel <drbrain@segment7.net>
-Wed Mar 30 02:17:33 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * doc/syntax/methods.rdoc: Fixed typo. Thanks to Josh Susser.
- * win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
- mount point should be treated as directory, not symlink.
- [ruby-core:72483] [Bug #11874]
+Wed Dec 19 16:18:22 2012 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (rb_w32_read_reparse_point): check the reparse point is
- a volume mount point or not.
+ * lib/rubygems/commands/query_command.rb: Refactored to improve
+ maintainability.
+ * test/rubygems/test_gem_commands_query_command.rb: Note default gems
+ in gem list details.
- * win32/file.c (rb_readlink): follow above change (but this pass won't
- be used).
+ * lib/rubygems/uninstaller.rb: Detect all gems for uninstallation.
+ This allows duplicate installs of default gems to be removed.
+ * lib/rubygems/specification.rb: Allow use of ::each_spec.
+ * lib/rubygems/test_case.rb: Added install_default_gems.
+ * test/rubygems/test_gem_commands_uninstall_command.rb: Moved test
+ down to the uninstaller tests.
+ * test/rubygems/test_gem_uninstaller.rb: Test for uninstallation of
+ default gems and duplicate default gems.
-Wed Mar 30 01:32:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Wed Dec 19 15:23:50 2012 Eric Hodel <drbrain@segment7.net>
- * test/-ext-/time/test_new.rb (test_timespec_new): change a gmtoff
- test to a better one that does not depend on whether the current
- time is in summer time or not.
+ * doc/syntax/methods.rdoc: Add () around keyword arguments example for
+ consistency. Thanks to Josh Susser.
-Wed Mar 30 01:32:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Wed Dec 19 01:51:24 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * test/-ext-/time/test_new.rb (test_timespec_new): Time#gmtoff values
- are the same only when both or neither of the Time objects are in
- summer time (daylight-saving time).
+ * vm.c (rb_vm_jump_tag_but_local_jump): remove unnecessary 2nd
+ argument.
-Wed Mar 30 01:30:54 2016 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * load.c (rb_load_internal): ditto.
- * lib/rubygems/test_case.rb: Fix test on Windows for inconsistent temp path.
- https://github.com/rubygems/rubygems/pull/1554
- [Bug #12193][ruby-core:74431]
+ * eval_intern.h (rb_vm_jump_tag_but_local_jump): ditto.
-Wed Mar 30 01:25:46 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Dec 18 18:57:58 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * string.c (str_new_frozen): if the given string is embeddedable
- but not embedded, embed a new copied string. [Bug #11946]
+ * io.c (rb_io_wait_writable): don't use rb_thread_wait_fd()
+ because it is for waiting until io readable.
-Wed Mar 30 01:23:57 2016 Marcus Stollsteimer <sto.mar@web.de>
+ * io.c (rb_io_wait_writable): always use rb_thread_fd_writable()
+ instead of bare rb_wait_for_single_fd(). we shouldn't ignore
+ return value.
+ * io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd().
- * doc/extension.ja.rdoc: Fix RDoc markup in doc/extension*.rdoc.
- [ci skip][Bug #12143][ruby-core:74143]
- * doc/extension.rdoc: ditto.
+Tue Dec 18 18:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Mar 30 01:00:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_wait_fd_rw): fix infinite loop bug.
+ rb_wait_for_single_fd() never return positive number.
- * proc.c (proc_binding): proc from symbol can not make a binding.
- [ruby-core:74100] [Bug #12137]
+Tue Dec 18 17:24:40 2012 Eric Hodel <drbrain@segment7.net>
-Wed Mar 30 00:54:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/encoding.rb: Do not remove #! line from document when
+ setting encoding. This allows ruby executables to be parsed as ruby
+ files.
+ * test/rdoc/test_rdoc_encoding.rb: Test for above.
- * include/ruby/win32.h (O_SHARE_DELETE): change to fit Fixnum
- limit. [ruby-core:74285] [Bug #12171]
+ * lib/rdoc/parser.rb: Set the parser file name of ruby executables
+ correctly.
+ * test/rdoc/test_rdoc_parser.rb: Test for above.
-Wed Mar 30 00:52:47 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Tue Dec 18 16:46:15 2012 Eric Hodel <drbrain@segment7.net>
- * test/net/imap/test_imap.rb (test_idle_timeout): Because of the
- timeout specified in "imap.idle(0.2)", there is no gurantee that
- the server thread has done all the work before the client thread
- performs the assertions. It depends on the thread scheduling.
- Add checks to avoid false positives (on AIX, particularly).
+ * doc/syntax/literals.rdoc: Used simplified heredoc example that
+ doesn't include method definition. Added heredoc with backticks.
-Wed Mar 30 00:41:42 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Tue Dec 18 16:38:51 2012 Eric Hodel <drbrain@segment7.net>
- * test/socket/test_socket.rb (test_udp_recvmsg_truncation):
- AIX does not set the MSG_TRUNC flag for a message partially read
- by recvmsg(2) with the MSG_PEEK flag set.
+ * lib/rdoc/store.rb: Work around RDoc stores from older versions of
+ RDoc.
+ * test/rdoc/test_rdoc_store.rb: Test for above.
-Wed Mar 30 00:00:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 16:31:20 2012 Eric Hodel <drbrain@segment7.net>
- * doc/extension.rdoc, doc/extension.ja.rdoc: add editor local
- variables, with commenting out by :enddoc: directives which are
- just ignored unless code object mode. [Bug #12111]
+ * lib/rdoc/ruby_lex.rb: Return a TkHEREDOC instead of a TkSTRING when
+ the heredoc identifier is followed by a line-end. This allows proper
+ display of some HEREDOCs in source view.
+ * lib/rdoc/ruby_token.rb: Added TkHEREDOC
+ * test/rdoc/test_rdoc_ruby_lex.rb: Test for above.
-Wed Mar 30 00:00:47 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Dec 18 09:45:14 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * doc/extension.ja.rdoc: removed rendering error caused by editor specific
- configuration on http://docs.ruby-lang.org/en/trunk/extension_rdoc.html .
- [Bug #12111][ruby-core:73990]
+ * vm.c (rb_vm_make_jump_tag_but_local_jump): take care of the case
+ TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). [ruby-core:50917]
+ [Bug #7570]
-Tue Mar 29 23:54:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above.
- * object.c (rb_mod_const_get): make error message at uninterned
- string consistent with symbols. [ruby-dev:49498] [Bug #12089]
+ * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto.
-Tue Mar 29 23:45:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 13:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * dir.c (push_pattern, push_glob): deal with read paths as UTF-8
- to stat later, on Windows as well as OS X.
- [ruby-core:73868] [Bug #12081]
+ * vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc for
+ TracePoint#defined_class
-Tue Mar 29 23:36:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 12:15:59 2012 Eric Hodel <drbrain@segment7.net>
- * ext/extmk.rb: add cygwin case, nothing excluded.
- [ruby-core:73806] [Bug#12071]
+ * lib/rubygems/specification.rb: Fixed ruby output of requirements
+ with multiple version specifiers.
+ * test/rubygems/test_gem_ext_cmake_builder.rb: Only look for specific
+ lines in cmake output. Should fix [ruby-trunk - Bug #7579]
-Tue Mar 29 23:10:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 11:45:26 2012 Eric Hodel <drbrain@segment7.net>
- * iseq.c (rb_iseq_mark): mark parent iseq to prevent dynamically
- generated iseq by eval from GC. [ruby-core:72620] [Bug #11928]
+ * doc/syntax/literals.rdoc: Added 0o octal integers.
-Tue Mar 29 22:56:44 2016 Eric Wong <e@80x24.org>
+Tue Dec 18 12:28:52 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
- * test/resolv/test_dns.rb (test_ipv6_create): test for above
- [Bug #11910] [ruby-core:72559]
+ * test/openssl/test_ssl.rb: Use :TLSv1_2_client explicitly in
+ test_tls_v1_2 to prevent upstream bug.
+ [Bug #7197] [ruby-dev:46240]
-Tue Mar 29 22:31:48 2016 Shugo Maeda <shugo@ruby-lang.org>
+Tue Dec 18 11:52:34 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * range.c (range_eqq): revert r11113 because rb_call_super() is
- called in range_include() and thus r11113 doesn't work when the
- receiver Range object consists of non linear objects such as Date
- objects.
- [ruby-core:72908] [Bug #12003]
+ * ext/openssl/lib/ssl.rb: Enable insertion of empty fragments as a
+ countermeasure for the BEAST attack by default. The default options
+ of OpenSSL::SSL:SSLContext are now:
+ OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
+ [Bug #5353] [ruby-core:39673]
-Tue Mar 29 22:26:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Adapt tests to new SSLContext default.
- * vm_eval.c (rb_check_funcall_with_hook): also should call the
- given hook before returning Qundef when overridden respond_to?
- method returned false. [ruby-core:73556] [Bug #12030]
+ * NEWS: Announce the new default.
-Tue Mar 29 22:08:36 2016 Kazuki Yamaguchi <k@rhe.jp>
+Tue Dec 18 06:36:12 2012 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_peephole_optimize): don't apply tailcall
- optimization to send/invokesuper instructions with blockiseq.
- This is a follow-up to the changes in r51903; blockiseq is now
- the third operand of send/invokesuper instructions.
- [ruby-core:73413] [Bug #12018]
+ * method.h: remove `VM_METHOD_TYPE_CFUNC_FRAMELESS' method type.
+ This method type is for optimized CFUNC such as Fixnum#+ and so on.
+ This feature is half-baked and no way to use them.
+ [Background]
+ Now, VM has opt_plus instructions to optimize `+' methods for
+ some Classes (such as Fixnum, Float (flonum)). We call this
+ type of instructions as `specialized instructions'.
+ This simple technique improve simple program dramatically.
+ However, we can make specialized instructions for only several
+ types (classes) and selectors (method names) because a large
+ instruction will be slow. In other words, this technique has no
+ extensibility.
+ To overcome this problem, VM_METHOD_TYPE_CFUNC_FRAMELESS was
+ introduced (r37198). This type is a variant of CFUNC, but called
+ their functions directly without building a method frame.
+ Any CFUNC method can be defined as frameless methods if a method
+ is not needed to make method frame. Frameless methods are faster
+ as specialized instructions (a bit slower, but no need to care).
+ No problem described at
+ http://charlie.bz/blog/why-do-singleton-methods-make-ruby-slow
+ because this technique doesn't see class, but see method body
+ itself. Alias is also no problem.
+ [Problem]
+ However, we can't set frameless method type for polymorphic methods
+ such as Array#[]. Necessity for method frame depends on which
+ parameter type. For example, Fixnum#+ needs method frame if
+ coerce is needed. Current VM_METHOD_TYPE_CFUNC_FRAMELESS is not
+ flexible and need more tuning to introduce it.
+ Expected behavior of frameless method type may be:
+ result = optimized_cfunc(params); /* call optimized cfunc */
+ if (result == Qundef) { result = normal_cfunc(); }
+ This is why I say this feature is half-baked.
+ We need to learn primitive method in Smalltalk more.
+ (I heard this name at RubyConf Taiwan this month. Thanks!)
+ [Conclusion]
+ I remove this feature and consider again.
+ This feature goes to next minor (2.1?).
+ Nobody may use this feature and there is no compatibility issue.
+
+ * proc.c (rb_method_entry_arity): ditto.
-Tue Mar 29 21:22:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
- * parse.y (xstring): reset heredoc indent after dedenting,
- so that following string literal would not be dedented.
- [ruby-core:72857] [Bug #11990]
+Tue Dec 18 04:58:22 2012 Koichi Sasada <ko1@atdot.net>
-Tue Mar 29 21:22:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_trace.c (fill_id_and_klass): TracePoint#defined_class returns
+ singleton class. `set_trace_func' passed attached class (which is
+ attached/modified by singleton class) by 6th block parameter if it
+ is singleton class. Previous behavior follows this spec.
+ However, this method named `defined_class' should return singleton
+ class directly because singleton methods are defined in singleton
+ class. There are no compatible issue because TracePoint is introduced
+ after 2.0.
+ But compatibility with `set_trace_func' is broken. This means that
+ you can not replace all `set_trace_func' code with TracePoint
+ without consideration of this behavior.
+ [Bug #7554]
- * parse.y (string1): reset heredoc indent fore each string leteral
- so that concatenated string would not be dedented.
- [ruby-core:72857] [Bug #11990]
+ * test/ruby/test_settracefunc.rb: change a test to catch up
+ an above change.
-Tue Mar 29 21:18:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 03:03:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * parse.y (parser_here_document): update indent for each line in
- indented here document with single-quotes.
- [ruby-core:72479] [Bug #11871]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: speed up node mapping so
+ common cases are evaluated first. Thanks Kevin Menard!
-Tue Mar 29 21:03:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 18 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * symbol.h (is_attrset_id): ASET is an attrset ID. fix
- unexpected safe call instead of an ordinary ASET.
+ * lib/optparse.rb: Remove 'developer documentation' section from rdoc
+ Patch by Marcus Stollsteimer [ruby-core:50526][Bug #7504]
-Tue Mar 29 21:01:07 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Dec 18 02:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
- operator. [ci skip][fix GH-1182] Patch by @dougo
+ * lib/matrix.rb (#lup): typo in example [ruby-core:50946][Bug #7582]
-Tue Mar 29 18:49:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 17 18:03:34 2012 Charlie Somerville <charlie@charliesomerville.com>
- * lib/ostruct.rb (freeze): define deferred accessors before
- freezing to get rid of an error when just reading frozen
- OpenStruct.
+ * class.c (rewrite_cref_stack, clone_method): rewrite a method's cref
+ stack when cloning into a new class to allow lexical const lookup to
+ work as expected [ruby-core:47834] [Bug #7107]
+ * test/ruby/test_class.rb (class TestClass): related test
-Tue Mar 29 18:49:54 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Mon Dec 17 13:56:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid
- redefinition [#11901]
+ * io.c (io_flush_buffer_sync2): avoid to return 0. because
+ rb_thread_call_without_gvl2 uses 0 internally.
+ * io.c (io_flush_buffer_async2): adapt the above.
-Tue Mar 29 17:54:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 17 12:05:32 2012 Eric Hodel <drbrain@segment7.net>
- * lib/ostruct.rb (OpenStruct): make respond_to? working on
- just-allocated objects for workaround of Psych.
- [ruby-core:72501] [Bug #11884]
+ * doc/syntax/methods.rdoc: Added a description of singleton methods.
-Tue Mar 29 17:04:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 17 11:35:57 2012 Eric Hodel <drbrain@segment7.net>
- * vm_eval.c (rb_f_catch): [DOC] fix malformed RDoc syntax, "+...+"
- cannot enclose non-identifier characters.
- a patch by Sebastian S in [ruby-core:74278]. [Bug#12170]
+ * doc/.document: Added doc/syntax
-Tue Mar 29 17:03:28 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Mon Dec 17 11:25:32 2012 Eric Hodel <drbrain@segment7.net>
- * test/-ext-/float/test_nextafter.rb: In AIX,
- nextafter(+0.0,-0.0)=+0.0, and nextafter(-0.0,+0.0)=-0.0,
- but they should return -0.0 and +0.0, respectively. This is
- a known bug in nextafter(3) on AIX, so skip related tests.
+ * doc/syntax.rdoc: Added syntax guide table of contents
+ * doc/syntax/exceptions.rdoc: Syntax guide for exceptions
+ * doc/syntax/literals.rdoc: Syntax guide for literals
+ * doc/syntax/methods.rdoc: Syntax guide for methods
-Tue Mar 29 16:54:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 17 07:59:40 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (enc_succ_alnum_char): try to skip an invalid character
- gap between GREEK CAPITAL RHO and SIGMA.
- [ruby-core:74478] [Bug #12204]
+ * lib/rubygems.rb: Updated VERSION
-Tue Mar 29 16:45:58 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
+ * test/rubygems/test_gem_installer.rb: Fixed ambiguous first argument
+ warning.
- * parse.y (parse_numvar): NTH_REF must be less than a half of
- INT_MAX, as it is left-shifted to be ORed with back-ref flag.
- [ruby-core:74444] [Bug#12192] [Fix GH-1296]
+ * test/rubygems/test_gem_rdoc.rb: RDoc generation depends on installed
+ version of RDoc.
-Tue Mar 29 16:44:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Dec 16 02:04:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * enc/trans/JIS: update Unicode's notice. [Bug #11844]
+ * signal.c (rb_sigaltstack_size): cast sysconf() return value
+ explicitly. Fix compile error on Mac OS X.
-Tue Mar 29 16:41:27 2016 Eric Hodel <drbrain@segment7.net>
+Sun Dec 16 00:39:43 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * marshal.c (r_object0): raise ArgumentError when linking to undefined
- object.
+ * cont.c (rb_fiber_start): don't enqueue Qnil to async_errinfo_queue.
+ rb_vm_make_jump_tag_but_local_jump() could return Qnil (ex. when
+ finished by Thread.exit). [ruby-dev:45218] [Bug #5993]
-Tue Mar 29 16:41:27 2016 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_fiber.rb (test_exit_in_fiber): add test for it.
- * marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
+Sat Dec 15 23:56:51 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Mar 29 16:40:48 2016 Eric Wong <e@80x24.org>
+ * ext/fiddle/pointer.c (rb_fiddle_ptr2cptr): fix error message
+ forgotten to be changed from DL to Fiddle.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): document as MT-unsafe
- [ruby-core:73803] [Bug #12069]
+Sat Dec 15 23:14:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 16:29:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * signal.c (default_handler): remove rb_register_sigaltstack()
+ call. sigaltstack was already registered when creating threads.
- * insns.def (opt_mod): show its method name on ZeroDivisionError.
- [Bug #12158]
+Sat Dec 15 23:08:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 16:25:27 2016 Anthony Dmitriyev <antstorm@gmail.com>
+ * signal.c (rb_sigaltstack_size): new. calculate stack size for
+ sigsegv handler. enlarge value when x86 or x86_64 on Linux.
+ Linux has very small MINSIGSTKSZ size (2048 bytes) and
+ our sigsegv routine need 5KiB at least. [Bug #7141]
+ * internal.h: add declaration of rb_sigaltstack_size().
+ * vm_core.h: remove ALT_STACK_SIZE definition.
- * net/ftp.rb: add NullSocket#closed? to fix closing not opened
- connection. [Fix GH-1232]
+ * signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with
+ rb_sigaltstack_size();
+ * gc.c (Init_heap): ditto.
+ * vm.c (th_init): ditto.
-Tue Mar 29 16:12:08 2016 Koichi ITO <koic.ito@gmail.com>
+Sat Dec 15 18:24:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * variable.c: Added documentation about order of `Module#constants`
- [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301]
+ * rational.c (f_round_common): should check overflow.
-Tue Mar 29 16:02:26 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Sat Dec 15 18:00:00 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_process.rb (test_execopts_gid): Skip a test
- that is known to fail on AIX. AIX allows setgid to
- a supplementary group, but Ruby does not allow the "-e"
- option when setgid'ed, so the test does not work as intended.
+ * rational.c (float_rationalize): reduced.
-Tue Mar 29 15:58:18 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Sat Dec 15 14:18:44 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/socket/test_addrinfo.rb (test_ipv6_address_predicates):
- IN6_IS_ADDR_V4COMPAT and IN6_IS_ADDR_V4MAPPED are broken
- on AIX, so skip related tests.
+ * io.c (finish_writeconv): uses rb_write_internal2 if
+ fptr->write_lock have.
-Tue Mar 29 15:31:06 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Sat Dec 15 13:57:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/rinda/test_rinda.rb (test_make_socket_ipv4_multicast):
- The fifth argument to getsockopt(2) should be modified to
- indicate the actual size of the value on return,
- but not in AIX. This is a know bug. Skip related tests.
- * test/rinda/test_rinda.rb (test_ring_server_ipv4_multicast):
- ditto.
- * test/rinda/test_rinda.rb (test_make_socket_unicast): ditto.
- * test/socket/test_basicsocket.rb (test_getsockopt): ditto.
- * test/socket/test_sockopt.rb (test_bool): ditto.
+ * thread.c (rb_mutex_owned_p): remove static.
+ * io.c (io_flush_buffer): don't hold mutex if already have.
+ Now recursive lock may occur when following scenario.
+ fptr_finalize -> finish_writeconv_sync -> finish_writeconv
+ -> io_fflush.
-Tue Mar 29 15:27:14 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Sat Dec 15 13:38:30 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine):
- Skip two tests on AIX because zconf.h in zlib does not correctly
- recognize _LARGE_FILES in AIX. The problem was already reported
- to zlib, and skip these tests until it is fixed.
+ * io.c (io_flush_buffer): uses io_flush_buffer_async2 instead of
+ io_flush_buffer_async.
+ * io.c (io_flush_buffer_async2): new helper function for
+ io_flush_buffer. It uses rb_thread_call_without_gvl2() instead
+ of rb_thread_io_blocking_region.
+ * io.c (io_flush_buffer_sync2): new helper function for
+ io_flush_buffer_async2.
-Tue Mar 29 15:10:31 2016 Rei Odaira <Rei.Odaira@gmail.com>
+Sat Dec 15 13:04:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * thread_pthread.c (getstack): __pi_stacksize returned by
- pthread_getthrds_np() is wrong on AIX. Use
- __pi_stackend - __pi_stackaddr instead.
+ * io.c (internal_write_func2): new helper function for rb_write_internal2().
+ * io.c (rb_write_internal2): new function. it uses
+ rb_thread_call_without_gvl2() instead of rb_thread_io_blocking_region().
+ * io.c (rb_binwrite_string): uses rb_write_internal2 instead of
+ rb_write_internal. [Bug #7134]
-Tue Mar 29 15:10:05 2016 Alex Boyd <alex@opengroove.org>
+Sat Dec 15 12:55:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/irb.rb: avoid to needless truncation when using back_trace_limit option.
- [fix GH-1205][ruby-core:72773][Bug #11969]
+ * io.c (rb_io_wait_writable): add to call rb_thread_wait_fd()
+ likes rb_io_wait_readable.
-Tue Mar 29 15:05:16 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Sat Dec 15 11:54:50 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb: fix method name typo.
- [ruby-core:72513] [Bug #11893] The patch provided by Akira Matsuda.
+ * io.c (rb_io_wait_writable): don't call rb_thread_fd_writable()
+ when EINTR. EINTR mean signal interrupt was happen. We don't
+ need any wait.
+Sat Dec 15 11:53:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 15:05:02 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * thread.c (rb_thread_wait_fd_rw): remove silly rb_thread_alone()
+ check.
- * ext/tk/lib/tkextlib/tcllib/toolbar.rb: fix method name typo.
- [ruby-core:72511] [Bug #11891] The patch provided by Akira Matsuda.
+Sat Dec 15 10:22:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_polling): revert but deprecate.
-Tue Mar 29 15:04:42 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * include/ruby/intern.h (rb_thread_polling): deprecate.
- * ext/tk/lib/tkextlib/blt/tree.rb: fix method name typo.
- [ruby-core:72510] [Bug #11890] The patch provided by Akira Matsuda.
+Sat Dec 15 08:37:01 2012 Masaya Tarui <tarui@ruby-lang.org>
+ * test/rubygems/test_gem_ext_cmake_builder.rb (test_self_build):
+ get rid of false positive.
-Tue Mar 29 15:04:19 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Sat Dec 15 08:05:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tk/menubar.rb: fix a typo in font name. [ruby-core:72505]
- [Bug #11886] The patch provided by Akira Matsuda.
+ * test/ruby/test_thread.rb (test_uninitialized, test_backtrace,
+ test_thread_timer_and_interrupt, test_thread_join_in_trap,
+ test_thread_join_current, test_thread_join_main_thread,
+ test_main_thread_status_at_exit, test_thread_status_in_trap,
+ test_thread_status_raise_after_kill, test_mutex_owned,
+ test_mutex_owned2): move these tests from TestThreadGroup class
+ to TestThread because they are not thread group tests.
- * ext/tk/sample/*.rb: ditto.
+ * test/ruby/test_thread.rb (test_thread_status_raise_after_kill):
+ add t.join.
-Tue Mar 29 15:03:03 2016 Kenta Murata <mrkn@mrkn.jp>
+ * test/ruby/test_threadgroup.rb: new file. moved ThreadGroup test
+ from test_thread.rb.
- * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
- and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++.
- [ruby-core:72736] [Bug #11962]
+Sat Dec 15 08:02:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 14:58:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_thread.rb (TestThread::Thread::new.): remove
+ th.abort_on_exception change. Test template shouldn't change
+ global flag. It prevent to test a normal case.
- * ext/socket/option.c (inspect_tcpi_msec): more accurate condition
- for TCPI msec member inspection function.
- [ruby-core:74388] [Bug #12185]
+Sat Dec 15 06:15:14 2012 Eric Hodel <drbrain@segment7.net>
-Tue Mar 29 14:53:58 2016 Naotoshi Seo <sonots@gmail.com>
+ * configure.in (HAVE_GCC_ATOMIC_BUILTINS): Set -march=i486 to enable
+ __sync_val_compare_and_swap. Patch by KOSAKI Motohiro.
+ [ruby-trunk - Bug #7485]
- * lib/logger.rb: Remove block from Logger.add as it's not needed
- patch provided by Daniel Lobato Garcia [fix GH-1240] [Bug #12054]
+Sat Dec 15 03:42:34 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Mar 29 14:52:20 2016 Zachary Scott <zzak@ruby-lang.org>
+ * ext/.document: add fiddle/pointer.c, fiddle/handle.c, and
+ fiddle/win32/lib as documentation.
- * re.c: Remove deprecated kcode argument from Regexp.new and compile
- patch provided by Dylan Pulliam [Bug #11495]
+Sat Dec 15 03:06:40 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 14:44:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_file_flock): use rb_thread_wait_for() instead of
+ rb_thread_polling(). When getting EAGAIN, we need to wait a
+ while even if no multi threading.
+ * thread.c (sleep_for_polling, rb_thread_polling) removed.
- * ext/socket/socket.c (sock_gethostname): support unlimited size
- hostname.
+Sat Dec 15 00:03:31 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Mar 29 14:35:06 2016 Kouhei Sutou <kou@cozmixng.org>
+ * signal.c (rb_f_kill): remove rb_thread_polling() because this
+ has no good effect and makes meaningless 100ms delay. 1)
+ when sending signal to another process, waiting has just silly.
+ 2) when sending signal to current process, 100ms is often not
+ enough time to wait. It depend on kernel behavior. And,
+ rb_thread_polling() doesn't make sense anyway. When rb_thread_alone()
+ is true, it doesn't wait at all and Process.kill() users don't
+ expect threading changes Process.kill() behavior. [Bug #7560]
- * lib/xmlrpc/client.rb: Support SSL options in async methods of
- XMLRPC::Client.
- [Bug #11489]
- Reported by Aleksandar Kostadinov. Thanks!!!
+Fri Dec 14 17:10:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 29 14:22:57 2016 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (parser_params): parser_tokline to track the line number at
+ which token started. [ruby-dev:46737] [Bug #7559]
- * marshal.c (r_object0): honor Marshal.load post proc
- value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org>
- https://github.com/ruby/ruby/pull/1204 fix GH-1204
+ * parse.y (fcall): operation with starting line number.
-Tue Mar 29 14:18:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * parse.y (command, primary, method_call): point method name line.
- * .travis.yml: removed commented-out code.
+ * parse.y (gettable_gen): return token line for __LINE__.
-Tue Mar 29 14:18:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Fri Dec 14 16:56:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * .travis.yml: removed osx code. follow up with r53517
+ * vm_insnhelper.c (vm_call_super_method): remove volatile introduced
+ in r38365.
-Tue Mar 29 14:12:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): use __forceinline to prevent
+ VC++ to make vm_call_general and vm_call_super_method as the same
+ method. Thanks, Heesob Park. [Bug #7556] [ruby-core:50867]
- * ext/socket/option.c (sockopt_bool): relax boolean size to be one
- too not only sizeof(int). Winsock getsockopt() returns a single
- byte as a boolean socket option. [ruby-core:72730] [Bug #11958]
+Fri Dec 14 14:59:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 29 14:12:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ take file and line by using caller_locations if not given.
- * ext/socket/option.c (check_size): extract a macro to check
- binary data size, with a consistent message.
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ count assertions in separated tests.
- * ext/socket/option.c (sockopt_byte): fix error message,
- sizeof(int) differs from sizeof(unsigned char) in general.
+Fri Dec 14 14:16:42 2012 Eric Hodel <drbrain@segment7.net>
-Tue Mar 29 14:01:14 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rdoc/rubygems_hook.rb: Fixed generation of documentation.
+ Disabled rdoc generation by default to match RubyGems defaults.
+ Reduced diff with RubyGems::RDoc.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Tests for the above.
+ * test/rubygems/test_gem_rdoc.rb: ditto.
- * process.c (rb_execarg_parent_start1): need to convert the encoding to
- ospath's one.
+ * lib/rdoc/store.rb: Removed useless variable assignment
-Tue Mar 29 14:01:14 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Dec 14 13:58:40 2012 Eric Hodel <drbrain@segment7.net>
- * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
- reported by naruse via twitter.
+ * lib/rubygems/commands/rdoc_command.rb: When overwriting
+ documentation, remove existing documentation first.
- * process.c (rb_execarg_addopt): need to convert the encoding to
- ospath's one.
+ * lib/rubygems/server.rb: Fixed documentation links.
+ * test/rubygems/test_gem_server.rb: Test for the above.
-Tue Mar 29 13:56:36 2016 Eric Wong <e@80x24.org>
+ * lib/rubygems/rdoc.rb: Reduced diff with RDoc::RubyGemsHook
+ * test/rubygems/test_gem_rdoc.rb: ditto
- * ext/stringio/stringio.c (strio_binmode): implement to set encoding
- * test/stringio/test_stringio.rb (test_binmode): new test
- [ruby-core:72699] [Bug #11945]
+Fri Dec 14 04:08:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 29 13:50:30 2016 Eric Wong <e@80x24.org>
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately):
+ added to execute given test source on separate process,
+ catch its resulted exception and raise it on main process.
- * io.c (io_getpartial): remove unused kwarg from template
- * test/ruby/test_io.rb (test_readpartial_bad_args): new
- [Bug #11885]
+Fri Dec 14 07:43:44 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Mar 29 13:41:03 2016 Tadashi Saito <tad.a.digger@gmail.com>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: quote strings that begin
+ with non-word characters. Thanks Alex Tambellini!
+ * test/psych/test_yaml.rb: appropriate test case
- * compile.c, cont.c, doc, man: fix common misspelling.
- [ruby-core:72466] [Bug #11870]
+Thu Dec 13 23:14:17 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Mar 29 13:31:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_super_method): a workaround for the
+ failure of TestRefinement#test_refine_recursion in Windows.
+ See [ruby-core:50871] for details.
- * parse.y (regexp): set_yylval_num sets u1, should use nd_tag
- instead of nd_state. [ruby-core:72638] [Bug #11932]
+Thu Dec 13 23:10:52 Charlie Somerville <charlie@charliesomerville.com>
-Tue Mar 29 13:31:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (Init_Object): use rb_mod_init_copy for Class#initialize_copy
+ * class.c (rb_class_init_copy): rename to class_init_copy_check, performs type
+ checks on arguments to prevent reinitialization of initialized class
+ [ruby-core:50869] [Bug #7557]
+ * class.c (rb_mod_init_copy): use class_init_copy_check if receiver is T_CLASS
+ * test/ruby/test_class.rb (class TestClass): related test
- * parse.y (set_yylval_num): should be used as nd_state, set to u3.
- [ruby-core:72638] [Bug #11932]
+Thu Dec 13 16:53:10 2012 Eric Hodel <drbrain@segment7.net>
-Tue Mar 29 13:26:15 2016 Joseph Tibbertsma <josephtibbertsma@gmail.com>
+ * lib/rdoc/class_module.rb: Fixed duplicate comments for classes and
+ modules from C.
+ * test/rdoc/test_rdoc_class_module.rb: Test for the above.
- * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
- [Fix GH-1221]
+ * lib/rdoc/parser/c.rb: Reload C variable names to allow proper
+ updates of an ri store for C files.
+ * lib/rdoc/rdoc.rb: ditto.
+ * lib/rdoc/store.rb: ditto.
+ * test/rdoc/test_rdoc_parser_c.rb: Test for the above.
+ * test/rdoc/test_rdoc_store.rb: ditto.
-Thu Jan 21 16:39:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 13 14:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * Makefile.in (update-rubyspec): fix r53208 like r53451.
+ * lib/irb*: merge doc from doc/irb/ird.rd and improve overall
+ documentation of IRB
+ * doc/irb/irb.rd: remove stale documentation
-Fri Jan 15 00:05:57 2016 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 13 14:10:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/uri/generic.rb (URI::Generic#to_s): change encoding to
- UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
- https://github.com/ruby/ruby/pull/1188 fix GH-1188
+ * marshal.c (r_entry0): don't taint classes and modules because
+ Marshal.load just returns the dumped classes and modules.
+ [Bug #7325] [ruby-core:49198]
-Tue Jan 12 17:23:39 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_marshal.rb: related test.
- * process.c (rb_execarg_parent_start1): need to convert the encoding to
- ospath's one.
+Thu Dec 13 14:10:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jan 12 17:23:39 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_require.rb (TestRequire#test_loaded_features_encoding):
+ need to check compatibility, not equality of encodings.
- * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
- reported by naruse via twitter.
+Thu Dec 13 14:02:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (rb_execarg_addopt): need to convert the encoding to
- ospath's one.
+ * file.c (rb_file_join): check encoding compatibility before joining
+ strings.
-Tue Jan 12 15:21:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 13 13:06:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/missing.h (explicit_bzero_by_memset_s): remove
- inline implementation by memset_s, which needs a macro before
- including headers and can cause problems in extension libraries
- by the order of the macro and headers.
+ * proc.c (umethod_bind): allow another form of method transplanting
+ from a module via UnboundMethod. [ruby-core:34267][Feature #4254]
-Thu Dec 24 23:01:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 13 12:07:25 2012 Shugo Maeda <shugo@ruby-lang.org>
- * NEWS: added entry for CGI.escapeHTML optimization.
+ * include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress
+ warnings for unused variables.
-Thu Dec 24 18:43:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to
+ suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6.
- * error.c (rb_compile_error_with_enc, rb_compile_error),
- (rb_compile_bug): deprecate internal functions.
+Thu Dec 13 11:22:33 2012 Koichi Sasada <ko1@atdot.net>
- * parse.y (parser_yyerror): construct exception message with
- source code and caret.
+ * method.h: remove "VM_METHOD_TYPE__MAX" from rb_method_type_t.
+ rb_method_type_t is not a number and "_MAX" causes misunderstanding.
-Thu Dec 24 17:25:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (rb_method_entry_arity): ditto.
- * compile.c (append_compile_error), parse.y (compile_error):
- preserve encoding of source file name in exceptions.
+ * vm_eval.c (vm_call0_body): ditto.
- * error.c (rb_compile_error_str, rb_compile_bug_str): add.
+ * vm_insnhelper.c (vm_call_method): ditto.
-Thu Dec 24 16:17:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 12 21:40:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (fake.rb): $(arch)-fake.rb must depend on miniruby because
- it may depend on miniruby.
+ * lib/tmpdir.rb (Dir::Tmpname#create): deal with a prefix name which
+ starts with tilde as a plain name, not expanding as home directory.
+ [ruby-core:50793] [Bug #7547]
-Thu Dec 24 16:13:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 12 19:48:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * common.mk (ripper.c): r50045 wrongly replace $(PWD) with ../..
- It is the top of build directory, not topsrcdir.
+ * ext/json: merge JSON 1.7.5.
+ fix tests and other fixes.
-Thu Dec 24 15:02:42 2015 sorah (Shota Fukumori) <her@sorah.jp>
+Wed Dec 12 18:30:29 2012 Shugo Maeda <shugo@ruby-lang.org>
- * tool/vcs.rb (IO.popen): Refactor. Avoid assigning in condition.
+ * class.c (rb_prepend_module): move refined methods from the origin
+ of a class to the class, because refinements should have priority
+ over prepended modules.
-Thu Dec 24 15:01:38 2015 sorah (Shota Fukumori) <her@sorah.jp>
+ * test/ruby/test_refinement.rb: related test.
- * tool/file2lastrev.rb: Fix ArgumentError to work on Ruby 1.8.7.
+Wed Dec 12 18:27:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 24 14:44:08 2015 sorah (Shota Fukumori) <her@sorah.jp>
+ * time.c (zone_str): lookup or insert by using st_update() at once.
- * tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not
- supported on IO.popen
+Wed Dec 12 15:30:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/vcs.rb (IO.popen): Fix NoMethodError. I guess r49705 was not
- tested... :/
+ * configure.in: add -fno-omit-frame-pointer if libexecinfo is used.
+ At least on FreeBSD ruby will crash on getting C backtrace
+ when it is compiled with other than -O0.
-Thu Dec 24 14:57:03 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_dump.c: enable backtrace on FreeBSD even if with optimizations.
- * NEWS: rename
- "Implementation changes" section to
- "Supported platform changes" section.
+Wed Dec 12 16:08:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * NEWS: add "Implementation improvements" and add several entries.
+ * test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
+ use File::NULL for portability if possible.
- * NEWS: add NEWS entries by Eric Wong. [ruby-core:72450]
+Wed Dec 12 16:07:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 24 00:26:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * method.h (rb_method_flag_t): name a magic number for NOEX_SAFE and
+ NOEX_WITH as NOEX_SAFE_SHIFT_OFFSET.
- * ext/io/console/extconf.rb: fix gem build failure on Windows.
- only win32_vk.inc is included in the gem and no dependencies for
- the header, so that gperf will not be mandatory.
- [ruby-core:72453] [Bug #11866]
+ * method.h (rb_method_type_t, method_optimized_type): C89 forbids a
+ comma after the last element in enum.
- * ext/io/console/io-console.gemspec: include depend file and
- win32_vk header.
+ * proc.c (rb_method_entry_arity), vm_eval.c (vm_call0_body),
+ vm_insnhelper.c (vm_call_method): add VM_METHOD_TYPE__MAX case.
-Wed Dec 23 23:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 12 14:16:35 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_readwrite_syserr_fail): works with the given errno than
- thread local errno.
+ * lib/rdoc/class_module.rb: Added RDoc::ClassModule#documented? which
+ checks comment_location. Hide RDoc::ClassModule#comment=.
+ * test/rdoc/test_rdoc_class_module.rb: Test for above.
-Wed Dec 23 17:57:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml:
+ Fix display of the table of contents in the sidebar.
- * file.c, io.c, util.c: prefer rb_syserr_fail with saved errno
- over setting errno then call rb_sys_fail, not to be clobbered
- potentially and to reduce thread local errno accesses.
+ * lib/rdoc/generator/template/darkfish/table_of_contents.rhtml:
+ Use #comment_location when displaying classes or modules.
-Wed Dec 23 11:58:52 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+ * test/rdoc/test_rdoc_store.rb: Use comment_location.
- * string.c: Fix document. Default value of the first
- argument of `String#split` is not `$;` but `nil`.
- When `nil` is passed as first argument, `$;` is used.
- [ci skip] [Bug #11729] [ruby-dev:49378]
+Wed Dec 12 13:40:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 23 07:15:17 2015 Eric Wong <e@80x24.org>
+ * vm_insnhelper.c (vm_getivar): no uninitialized instance variables
+ warnings for non-object if attr method.
- * ext/socket/init.c (rsock_init_sock): reject reserved FDs
- [ruby-core:72445] [Bug #11862]
+Wed Dec 12 06:43:37 2012 Benoit Daloze <eregontp@gmail.com>
-Wed Dec 23 02:59:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (rb_iseq_parameters): fix limit for optional arguments.
- * configure.in (__STDC_WANT_LIB_EXT1__): necessary to use memset_s
- in strict C99 mode.
+ * test/ruby/test_keyword.rb: tests for above.
-Wed Dec 23 02:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (struct rb_iseq_struct): update documentation
+ with keyword arguments. [Bug #7540] [ruby-core:50735]
- * regexec.c (match_at): move direct threaded VM code to get rid of
- mixed declarations and code, and enable it only for gcc since it
- depends on a gcc extension.
+Wed Dec 12 03:45:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 23 02:23:19 2015 Yuki Nishijima <mail@yukinishijima.net>
+ * vm.c (vm_exec): pass exceptions while handling an exception.
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0
+ * vm_trace.c (rb_threadptr_exec_event_hooks): propagate exceptions.
+ revert r38293 partially.
- * NEWS: Add news about the did_you_mean gem
+Wed Dec 12 03:09:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 23 02:18:57 2015 Jake Worth <jakeworth82@gmail.com>
+ * sample/test.rb (Progress#initialize): add --verbose option and show
+ messages in one line unless --verbose is given.
- * doc/contributing.rdoc: [DOC] remove an extra word "here".
- [Fix GH-1169]
+Wed Dec 12 01:47:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Dec 23 01:58:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_using_refinement): make the method table of an iclass
+ for a refinement that of the refinement, not that of the origin of
+ the refinement, which is set by rb_include_class_new(). This
+ change is needed to make module prepend into a refinement work
+ properly.
- * regexec.c (USE_DIRECT_THREADED_VM): enable direct threaded VM by
- the default.
+ * test/ruby/test_refinement.rb: related test.
-Tue Dec 22 22:15:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 12 01:05:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (internal_object_p): should not expose singleton classes
- without a metaclass. based on patches by ko1 and shugo.
- [Bug #11740]
+ * tool/make-snapshot: add --disable-rubygem to both MINIRUBY and RUBY.
+ On making miniprelude.c, it seems use MINIRUBY. this fixes #7541
+ but rubygems also needs to be fixed for older rubies.
- * class.c (rb_singleton_class_object_p): added.
+Wed Dec 12 00:32:11 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Dec 22 22:15:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/dl/test_func.rb (test_name_with_block, test_bind, test_qsort1):
+ call unbind to release the callback closure because maximum number
+ of callbacks is limited to DL::MAX_CALLBACK (== 5) with pure DL
+ without Fiddle.
- * ext/io/console/io-console.gemspec: bump up to 0.4.4.
+Wed Dec 12 00:13:34 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Dec 22 22:11:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dl/lib/dl/func.rb (DL::Function#unbind, #bound?): suppress
+ NoMethodError when Fiddle is available. [ruby-core:50756] [Bug #7543]
+ * test/dl/test_func.rb (test_bound*, test_unbind*): tests for the above.
- * NEWS: Added news entry of Psych 2.0.17
+Tue Dec 11 19:38:37 2012 Naohisa Goto <ngotogenome@gmail.com>
-Tue Dec 22 22:09:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/fiddle/function.c (Fiddle::Function.new): new keyword argument
+ :name to set the name attribute.
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ set function name by using the :name keyword argument.
+ Re-fixes r38243. [ruby-core:50566]
+ * test/fiddle/test_function.rb (test_name): test for the :name keyword
+ argument and Fiddle::Function#name.
- * NEWS: Added news entry of RDoc 4.2.1
+Tue Dec 11 16:57:33 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 22 21:20:00 2015 Kenta Murata <mrkn@mrkn.jp>
+ * common.mk: Added --pages-dir to rdoc creation. Now doc/ items show
+ up at top-level.
+ * .document: Moved doc/* entries to doc/.document
+ * doc/.document: ditto
- * ext/bigdecimal/bigdecimal.gemspec: bump version to 1.2.8.
+Tue Dec 11 16:44:37 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 22 21:08:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/rdoc/options.rb: Added --page-dir option for moving pages in
+ doc/ to the top-level.
+ * lib/rdoc/rdoc.rb: ditto.
+ * test/rdoc/test_rdoc_options.rb: Test for the above.
+ * test/rdoc/test_rdoc_rdoc.rb: ditto.
- * lib/rdoc.rb: bump version to 4.2.1. It contains following fixes.
- https://github.com/rdoc/rdoc/pull/340
- https://github.com/rdoc/rdoc/pull/341
- https://github.com/rdoc/rdoc/pull/367
- https://github.com/rdoc/rdoc/pull/368
- * lib/rdoc/*: ditto.
- * test/rdoc/*: ditto.
+Tue Dec 11 15:24:05 2012 Eric Hodel <drbrain@segment7.net>
-Tue Dec 22 20:25:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb: Hide private methods from RDoc.
- * ext/psych/lib/psych.rb: bump version to 2.0.17
- * ext/psych/psych.gemspec: ditto.
+Tue Dec 11 15:11:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 22 20:14:47 2015 Koichi Sasada <ko1@atdot.net>
+ * tool/make-snapshot (BASERUBY): add --disable-gem to avoid load gems.
+ [Bug #7541] [ruby-core:50736]
- * vm_insnhelper.c: move vm_callee_setup_block_arg() (and related
- functions) to the latter location.
- This moving recovers performance a little.
- [Bug #11829]
+Tue Dec 11 12:00:19 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 22 15:21:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/win32/extconf.rb: Fix typo
+ by Santiago Pastorino <santiago@wyeworks.com>
+ https://github.com/ruby/ruby/pull/221 fix GH-221
- * string.c (str_compat_and_valid): as scrub does nothing for dummy
- encoding string now, incompatible encoding is not a matter.
+Tue Dec 11 01:53:37 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Tue Dec 22 14:31:28 2015 Toru Iwase <tietew@tietew.net>
+ * lib/matrix: alias {row|column}_size to {row|column}_count and use
+ the latter.
+ [Bug #7369] [ruby-core:49409]
- * ext/cgi/escape/escape.c (optimized_escape_html): CGI.escapeHTML
- should return unfrozen new string.
- [ruby-core:72426] [Bug #11858]
+Tue Dec 11 00:26:58 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Dec 22 05:39:58 2015 Takashi Kokubun <takashikkbn@gmail.com>
+ * fix the behavior when a module is included into a refinement.
+ This change is a little tricky, so it might be better to prohibit
+ module inclusion to refinements.
- * ext/cgi/escape/escape.c (preserve_original_state): Preserve
- original state for tainted and frozen. [Fix GH-1166]
- [ruby-dev:49451] [Bug #11855]
+ * include/ruby/ruby.h (RMODULE_INCLUDED_INTO_REFINEMENT): new flag
+ to represent that a module (iclass) is included into a refinement.
-Tue Dec 22 03:57:20 2015 Eric Wong <e@80x24.org>
+ * class.c (include_modules_at): set RMODULE_INCLUDED_INTO_REFINEMENT
+ if klass is a refinement.
- * ext/socket/init.c (rsock_init_sock): check FD after validating
- * test/socket/test_basicsocket.rb (test_for_fd): new
- [ruby-core:72418] [Bug #11854]
+ * eval.c (rb_mod_refine): set the superclass of a refinement to the
+ refined class for super.
-Mon Dec 21 21:29:45 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * eval.c (rb_using_refinement): skip the above superclass (the
+ refined class) when creating iclasses for refinements. Otherwise,
+ `using Refinement1; using Refinement2' creates iclasses:
+ <Refinement2> -> <RefinedClass> -> <Refinement1> -> RefinedClass,
+ where <Module> is an iclass for Module, so RefinedClass is
+ searched before Refinement1. The correct iclasses should be
+ <Refinement2> -> <Refinement1> -> RefinedClass.
- * variable.c (struct ivar_update): rename "extended" to "iv_extended"
- to avoid name conflict with /usr/include/floatingpoint.h on
- Solaris. [Bug #11853] [ruby-dev:49448]
+ * vm_insnhelper.c (vm_search_normal_superclass): if klass is an
+ iclass for a refinement, use the refinement's superclass instead
+ of the iclass's superclass. Otherwise, multiple refinements are
+ searched by super. For example, if a refinement Refinement2
+ includes a module M (i.e., Refinement2 -> <M> -> RefinedClass,
+ and if refinements iclasses are <Refinement2> -> <M>' ->
+ <Refinement1> -> RefinedClass, then super in <Refinement2> should
+ use Refinement2's superclass <M> instead of <Refinement2>'s
+ superclass <M>'.
-Mon Dec 21 12:15:32 2015 Kimura Wataru <kimuraw@i.nifty.jp>
+ * vm_insnhelper.c (vm_search_super_method): do not raise a
+ NotImplementError if current_defined_class is a module included
+ into a refinement. Because of the change of
+ vm_search_normal_superclass(), the receiver might not be an
+ instance of the module('s iclass).
- * test/ruby/test_io.rb: handled rlimit value same as r52277
- [Bug #11852][ruby-dev:49446]
+ * test/ruby/test_refinement.rb: related test.
-Mon Dec 21 10:21:22 2015 Ilya Vassilevsky <vassilevsky@gmail.com>
+Mon Dec 10 18:35:25 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/net/http.rb (open_timeout): update default value in RDoc
- [ruby-core:72413]
+ * vm_method.c (rb_method_entry_without_refinements): use
+ rb_resolve_refined_method() to search superclasses if
+ me->def->orig_me is 0. This change fixes make test-all
+ TESTS="json ruby/test_refinement.rb".
-Mon Dec 21 10:18:46 2015 Kazuki Yamaguchi <k@rhe.jp>
+ * test/ruby/test_refinement.rb: related test.
- * vm_backtrace.c (rb_profile_frames): ignore ifunc frames as it
- did before. [ruby-core:72409] [Bug #11851]
+Mon Dec 10 17:59:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 21 09:33:17 2015 Karol Bucek <kares@users.noreply.github.com>
+ * ext/fiddle/win32/*: library ports from DL to Fiddle.
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket): fix
- NotImplementedError typo. [Fix GH-1165]
+ * ext/dl/win32/extconf.rb: check fiddle. often case dl compiled prior
+ to fiddle, so this change is no meaning. in most cases, simply
+ fiddle/win32 overwrite dl/win32.
-Sun Dec 20 20:54:51 2015 Takashi Kokubun <takashikkbn@gmail.com>
+Mon Dec 10 15:23:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * cgi/escape/escape.c: Optimize CGI.escapeHTML for
- ASCII-compatible encodings. [Fix GH-1164]
+ * vm_trace.c (rb_threadptr_exec_event_hooks): exceptions in event
+ hooks should not propagate outside.
-Sun Dec 20 15:36:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Dec 10 15:11:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/erb.rb: revert r53123. It breaks compatibility like thor and
- rspec-rails.
- We should try with Ruby 2.4 or 3.0.
- [Bug #11842][ruby-core:72374]
- * lib/rdoc/erb_partial.rb: ditto.
- * template/verconf.h.tmpl: ditto.
+ * compile.c (iseq_compile_each): count flip-flop state in local iseq
+ not in each iseqs, so that the keys can be other than hidden
+ strings. [ruby-core:47253] [Bug #6899]
-Sun Dec 20 11:43:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (lep_svar_get, lep_svar_set, vm_getspecial): store
+ flip-flop states in an array instead of a hash.
- * parse.y (parser_yylex): allow here documents in labeled
- argument. [ruby-core:72396] [Bug #11849]
+ * iseq.c (set_relation): main iseq also can has local scope.
-Sun Dec 20 11:14:11 2015 Koichi Sasada <ko1@atdot.net>
+Mon Dec 10 10:36:12 2012 Narihiro Nakamura <authornari@gmail.com>
- * proc.c (rb_mod_define_method): should check Symbol or not.
- [Bug #11850]
+ * lib/irb/magic-file.rb: set a encoding, which is detected from
+ the file to read, to the internal encoding.
+ [Bug #4281][ruby-dev:43036]
- * test/ruby/test_method.rb: add a test.
+Mon Dec 10 09:40:19 2012 Eric Hodel <drbrain@segment7.net>
-Sun Dec 20 11:01:57 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/rubygems/ext/cmake_builder.rb: Added a builder for cmake.
+ * lib/rubygems/ext.rb: ditto.
+ * lib/rubygems/installer.rb: ditto.
+ * test/rubygems/test_gem_ext_cmake_builder.rb: Test for above.
- * proc.c (rb_mod_define_method): fix notation.
+Mon Dec 10 09:13:08 2012 Eric Hodel <drbrain@segment7.net>
-Sun Dec 20 10:54:15 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/rubygems/package.rb: Omit directories when packaging gems like
+ RubyGems 1.8.x
+ * test/rubygems/test_gem_package.rb: Test for above.
- * proc.c (proc_new): fix notation.
+Sun Dec 9 17:36:59 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sun Dec 20 00:29:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_opt_send): Kernel#send should not use
+ refinements.
- * proc.c (rb_proc_get_iseq): proc made from symbol does not have
- iseq. fix infinite loop. [ruby-core:72381] [Bug #11845]
+ * proc.c (mnew): Kernel#method, Kernel#public_method,
+ Module#instance_method, and Module#public_instance_method should
+ not use refinements.
-Sat Dec 19 20:06:10 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * vm_method.c (rb_method_boundp): Kernel#respond_to? should not use
+ refinements.
- * enc/windows_1250.c: Should not use C++ style comments (C99 feature).
- [Bug #11843]
+ * test/ruby/test_refinement.rb: related test.
-Sat Dec 19 17:17:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 9 06:19:04 2012 Eric Hodel <drbrain@segment7.net>
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
- use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by
- LeakChecker#find_threads, instead of ::Thread to get rid of
- thread leak checker. since this TimeoutHandler is resident
- during tests because of Singleton, it waits for the next timeout
- if it has any schedules. in the case of nested timeouts, inner
- timeout does not cancel outer timeouts and then those schedules
- still remain.
+ * lib/rdoc/markdown/entities.rb: Added documentation.
-Sat Dec 19 14:28:01 2015 Jake Worth <jakeworth82@gmail.com>
+ * lib/rdoc/parser/ruby.rb: Updated style
- * ext/zlib/zlib.c (Init_zlib): [DOC] Fix double-word typo and
- grammatical error. [Fix GH-1162]
+ * lib/rdoc/ruby_lex.rb: Parse characters up to \u{FFFFF}
+ * test/rdoc/test_rdoc_ruby_lex.rb: Test for above.
-Sat Dec 19 14:23:59 2015 Jake Worth <jakeworth82@gmail.com>
+Sat Dec 8 22:38:35 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/csv.rb (CSV#initialize): [DOC] Fix double-word typo.
- [Fix GH-1161]
+ * eval.c (rb_mod_refine): don't override Module#include. It's
+ unnecessary now because refinements are activated only in refine
+ blocks.
-Sat Dec 19 10:33:33 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+Sat Dec 8 22:33:26 2012 Shugo Maeda <shugo@ruby-lang.org>
- * enc/iso_8859_2.c, enc/windows_1250.c: separate Windows-1250
- from ISO-8859-2 to fix 0x80..0x9e range (from Kimihito Matsui)
+ * eval.c: remove Module#refinements.
-Fri Dec 18 21:26:54 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * test/ruby/test_refinement.rb: remove tests for Module#refinements.
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): To prevent
- potential deadlocks, Queue is used to tell update of @timeout_info
- instead of sleep and wakeup. [Bug #11742] [ruby-dev:49387]
+Sat Dec 8 13:17:55 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Dec 18 17:24:09 2015 Koichi Sasada <ko1@atdot.net>
+ * eval.c (top_using): raise a RuntimeError if using is called in a
+ module definition or a method definition.
- * compile.c (ibf_load_object_string): use fstring if frozen string.
+ * test/ruby/test_refinement.rb: related test.
-Fri Dec 18 16:54:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 8 15:01:35 2012 Eric Hodel <drbrain@segment7.net>
- * ext/stringio/stringio.c (strio_set_encoding): add StringIO's own
- encoding and separate it from the buffer string to override the
- encoding of string when reading. [ruby-core:72189] [Bug #11827]
- note that setting the encoding of its buffer string directly
- without StringIO#set_encoding may cause unpredictable behavior.
+ * lib/rubygems/commands/cleanup_command.rb: Skip default gems when
+ cleaning up.
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
-Fri Dec 18 16:50:35 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/rubygems/commands/query_command.rb: Fixed listing remote gems.
- * compile.c (ibf_load_setup): check tainted string argument.
+ * lib/rubygems/dependency_installer.rb: Ignore non-files when looking
+ for local gems.
+ * test/rubygems/test_gem_dependency_installer.rb: Test for above.
-Fri Dec 18 16:12:13 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/rubygems/uninstaller.rb: The user must confirm uninstalling gems
+ that have dependencies.
+ * test/rubygems/test_gem_uninstaller.rb: Test for above.
- * vm_core.h: define USE_LAZY_LOAD if it is not defined.
+ * lib/rubygems.rb (module Gem): Updated version.
-Fri Dec 18 15:40:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rubygems/*.pem: Updated to run in FIPS mode.
+ * test/rubygems/test_gem_security.rb: ditto.
+ * test/rubygems/test_gem_security_signer.rb: ditto.
- * ext/stringio/stringio.c (strio_unget_bytes): extract from
- strio_ungetbyte to share with strio_ungetc.
+Sat Dec 8 12:34:01 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Dec 18 12:39:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_normal_superclass): super in a
+ refinement always uses the refined class as its superclass.
- * doc/syntax/*.rdoc: separated modifier at sentence.
- [ci skip][fix GH-1121] Patch by @clandry94
+ * test/ruby/test_refinement.rb: related test.
-Fri Dec 18 12:09:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 8 11:59:59 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/stringio/stringio.c (strio_ungetbyte): pad with \000 when
- the current position is after the end.
+ * eval.c (rb_mod_refine): raise an ArgumentError if a given
+ block is of a Proc object.
-Fri Dec 18 11:24:48 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): store refined methods in inline
+ cache to improve performance. It's safe now because blocks cannot
+ be yielded with different refinements in the new specification.
- * vm_method.c (rb_method_entry_make, check_override_opt_method):
- should check whether a newly created method overrides an optimize
- method in case the method is defined in a prepended module of a
- built-in class.
- [ruby-core:72226] [Bug #11836]
+ * test/ruby/test_refinement.rb: related test.
-Fri Dec 18 11:09:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Dec 8 11:17:53 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm.c (vm_exec): call RUBY_DTRACE_CMETHOD_RETURN_HOOK instead of
- RUBY_DTRACE_METHOD_RETURN_HOOK.
+ * eval.c (rb_mod_refine), vm_eval.c (rb_yield_refine_block):
+ Module#refine activates all refinements defined in that module
+ only in a given block.
-Fri Dec 18 10:24:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * string.c (sym_to_proc, sym_call): don't use refinements.
- * lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
- [fix GH-1127] Patch by @koic
+ * test/ruby/test_refinement.rb: related test.
-Fri Dec 18 09:44:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Dec 8 09:24:42 2012 Eric Hodel <drbrain@segment7.net>
- * ext/pty/pty.c: fix double words typo.
- [ci skip][fix GH-1157] Patch by @jwworth
+ * ext/openssl/ossl_x509name.c: Completed documentation for
+ OpenSSL::X509::Name.
-Fri Dec 18 09:42:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Dec 8 07:57:12 2012 Koichi Sasada <ko1@atdot.net>
- * ext/nkf/nkf-utf8/utf8tbl.c: fix a typo.
- [ci skip][fix GH-1159] Patch by @akshay-vishnoi
- * ext/nkf/nkf-utf8/utf8tbl.h: ditto.
+ * ext/objspace/objspace.c (iow_size): return size of internal object
+ for ObjectSpace.memsize_of().
-Fri Dec 18 07:39:01 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/objspace/test_objspace.rb: add a test.
- * vm.c (rb_vm_check_redefinition_opt_method): should check the real
- class instead of the origin iclass.
- [ruby-core:72188] [Bug #11826]
+Tue Dec 08 02:39:23 2012 James Edward Gray II <james@graysoftinc.com>
-Thu Dec 17 22:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/csv.rb: A fix for row comparison by Stephen Wattam. [Bug #7528]
- * vm_args.c (vm_caller_setup_arg_block): remove code for ifunc
- because it was made unnecessary by r52138.
+Sat Dec 8 01:27:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 17 16:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): no need to
+ check all reports.
- * proc.c (rb_block_arity): should not call GetProcPtr() for symbols.
- [ruby-core:72205] [Bug #11830]
+Sat Dec 8 00:10:34 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Dec 17 14:16:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (yield_under, eval_under): do not activate refinements
+ of the receiver in module_eval and instance_eval.
- * string.c (rb_str_scrub): the result should be infected by the
- original string.
+ * eval.c (ruby_Init_refinement): undef Class#refine.
-Thu Dec 17 13:35:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (ruby_Init_refinement): remove Module#using.
- * transcode.c (rb_econv_substr_append, econv_primitive_convert):
- the result should be infected by the original string.
+ * eval.c (ruby_Init_refinement): main.using should be private.
-Thu Dec 17 09:46:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_mod_refine): the argument of Module#refine should not
+ be a module.
- * re.c (reg_names_iter): should consider encoding of regexp.
- [ruby-core:72185] [Bug #11825]
+ * insns.def (defineclass): do not activate refinements in a class or
+ module.
-Thu Dec 17 03:52:10 2015 Koichi Sasada <ko1@atdot.net>
+Fri Dec 7 23:42:11 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm.c (vm_make_env_each): should not compare with Qfalse and FALSE.
- Pointed at http://d.hatena.ne.jp/nagachika/20151216/ruby_trunk_changes_53128_53163
+ * ext/refinement/refinement.c: include ruby/ruby.h instead of the
+ declaration of rb_warn().
-Thu Dec 17 03:15:25 2015 Koichi Sasada <ko1@atdot.net>
+Fri Dec 7 16:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * vm_insnhelper.c (vm_call_method_each_type): should not set fastpath
- with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods.
+ * doc/etc.rd: Removed stale documentation file
+ * ext/etc/etc.c: Merged documentation from doc/etc.rd and updated
+ rdoc, added documentation for Etc::Passwd and Etc::Group
- Normally, we can not use keyword arguments for this kind of methods,
- (obj.foo = 1), but we can set alias names for them.
- [Bug #11657]
+Fri Dec 7 16:00:57 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_keyword.rb: add a test for this fix.
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): no need to
+ retry skipped test. this fix makes 40% faster the whole test-all
+ with -j5 on Windows.
-Wed Dec 16 20:32:43 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Fri Dec 7 14:22:29 2012 Eric Hodel <drbrain@segment7.net>
- * ext/fiddle/handle.c: check tainted string arguments.
- Patch provided by tenderlove and nobu.
+ * lib/rdoc/markup/to_joined_paragraph.rb: Completed documentation
+ * lib/rdoc/parser/c.rb: ditto
+ * lib/rdoc/parser/changelog.rb: ditto
+ * lib/rdoc/servlet.rb: ditto
+ * lib/rdoc/store.rb: ditto
- * test/fiddle/test_handle.rb (class TestHandle): add test for above.
+ * lib/rdoc/store.rb: Improved HTML error page. Completed
+ documentation
+ * lib/rdoc/parser/ruby.rb: Fixed bug attaching a comment to A::B = 42
+ * test/rdoc/test_rdoc_parser_ruby.rb: Test for above
-Wed Dec 16 19:30:56 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/rdoc/test_rdoc_comment.rb: Removed garbage
- * vm.c (vm_make_proc_from_block): should convert a Symbol to a Proc.
- [ruby-core:72083] [Bug #11811]
+Fri Dec 7 14:03:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 16 16:17:34 2015 Eric Wong <e@80x24.org>
+ * lib/timeout.rb (Timeout#timeout): since async_interrupt_timing
+ re-raises a deferred exception, replace the timeout exception with
+ Timeout::Error after it. [Bug #7503]
- * test/ruby/test_io.rb: fix spelling errors
+Fri Dec 7 13:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Wed Dec 16 16:04:49 2015 Eric Wong <e@80x24.org>
+ * doc/forwardable.rd: Remove stale documentation file
+ * lib/forwardable.rb: Merge documentation from doc/forwardable.rd
- * NEWS: note IO#advise change [ruby-core:72168]
+Fri Dec 7 09:47:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Dec 16 15:35:13 2015 Koichi Sasada <ko1@atdot.net>
+ * time.c (time_mdump): dump timezone string to private instance variable
+ on marshaling.
- * vm.c: fix mark miss for proc given as passed block.
- [Bug #11750]
+ * time.c (time_mload): load timezone string from private instance
+ variable named 'zone'.
- * vm.c (vm_make_proc_from_block): should return a Proc object
- if block is given. Previous implementation returns
- a Proc object only when corresponding Proc object is not
- available.
+Fri Dec 7 01:15:07 2012 Naohisa Goto <ngotogenome@gmail.com>
- * vm.c (vm_make_env_each): ditto.
+ * ext/fiddle/lib/fiddle/function.rb (Fiddle::Function#name): new
+ attribute needed to switch Win32::Registry from DL to Fiddle.
- * test/ruby/test_proc.rb: add a test for this bug.
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ set function name to the returned Fiddle::Function object.
-Wed Dec 16 12:24:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Fri Dec 7 00:11:44 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test_struct.rb: Test that initialize is overridable [#11708]
+ * test/ruby/test_refinement.rb: fix some tests to use neither
+ Module#using nor Module#module_eval.
-Wed Dec 16 10:49:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 6 23:27:50 2012 Shugo Maeda <shugo@ruby-lang.org>
- * parse.y (block_command, block_call): fix `&.` calls after
- block_call. [Feature #11537]
+ * eval.c (ruby_Init_refinement): a new function to enable
+ Refinements with a warning "Refinements are experimental...".
-Wed Dec 16 00:53:45 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * ext/refinement/refinement.c, ext/refinement/extconf.rb: a new
+ extension library to enable Refinements.
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquire
- TimeoutMutex only when accessing @timeout_info for avoiding
- potential deadlock. [Bug #11742] [ruby-dev:49387]
+Thu Dec 6 18:23:05 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Dec 16 00:39:27 2015 Jake Worth <jakeworth82@gmail.com>
+ * revised r37993 to avoid SEGV/ILL in tests. In r37993, a method
+ entry with VM_METHOD_TYPE_REFINED holds only the original method
+ definition, so ci->me is set to a method entry allocated in the
+ stack, and it causes SEGV/ILL. In this commit, a method entry
+ with VM_METHOD_TYPE_REFINED holds the whole original method entry.
+ Furthermore, rb_thread_mark() is changed to mark cfp->klass to
+ avoid GC for iclasses created by copy_refinement_iclass().
- * doc/extension.rdoc: [DOC] fix double-word typo. [Fix GH-1153]
+ * vm_method.c (rb_method_entry_make): add a method entry with
+ VM_METHOD_TYPE_REFINED to the class refined by the refinement if
+ the target module is a refinement. When a method entry with
+ VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
+ the same name is searched in refinements. If such a method is
+ found, the method is invoked. Otherwise, the original method in
+ the refined class (rb_method_definition_t::body.orig_me) is
+ invoked. This change is made to simplify the normal method lookup
+ and to improve the performance of normal method calls.
-Wed Dec 16 00:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * vm_method.c (EXPR1, search_method, rb_method_entry),
+ vm_eval.c (rb_call0, rb_search_method_entry): do not use
+ refinements for method lookup.
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
- TimeoutMutex should be acquired when accessing @timeout_info.
- To avoid deadlock, interrupt() calls are delayed.
- Due to the mutex, it is safe to treat ary without ary.dup.
- [Bug #11742] [ruby-dev:49387]
+ * vm_insnhelper.c (vm_call_method): search methods in refinements if
+ ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
+ super (i.e., ci->call == vm_call_super_method), skip the same
+ method entry as the current method to avoid infinite call of the
+ same method.
-Tue Dec 15 23:13:10 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * class.c (include_modules_at): add a refined method entry for each
+ method defined in a module included in a refinement.
- * gc.c: Delete excess semicolon after RUBY_ALIAS_FUNCTION().
- Suppress "syntax error: empty declaration" warnings by
- Oracle Solaris Studio 12.x on Solaris. [Bug #11821]
+ * class.c (rb_prepend_module): set an empty table to
+ RCLASS_M_TBL(klass) to add refined method entries, because
+ refinements should have priority over prepended modules.
- * hash.c: ditto, after NOINSERT_UPDATE_CALLBACK().
+ * proc.c (mnew): use rb_method_entry_with_refinements() to get
+ a refined method.
-Tue Dec 15 18:04:04 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * vm.c (rb_thread_mark): mark cfp->klass for iclasses created by
+ copy_refinement_iclass().
- * NEWS: added news about EBCDIC encoding
+ * vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass.
-Tue Dec 15 17:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
+ the test because it should pass successfully.
- * enc/ebcdic.h, enc/trans/ebcdic.trans,
- test/ruby/test_transcode.rb: Fixed encoding name
- to the correct one in the IANA registry (IBM037)
- and added an alias (ebcdic-cp-us)
+ * test/ruby/test_refinement.rb (test_redefine_refined_method): new
+ test for the case a refined method is redefined.
-Tue Dec 15 16:19:26 2015 Takashi Kokubun <takashikkbn@gmail.com>
+Thu Dec 6 17:29:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/erb.rb: Render erb with array buffer for function call optimization.
- [fix GH-1143]
- * lib/rdoc/erb_partial.rb: ditto.
- * template/verconf.h.tmpl: ditto.
+ * parse.y (parser_here_document): flush string content between new
+ line and :string_embexpr. [ruby-core:48703] [Bug #7255]
-Tue Dec 15 13:50:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 6 16:35:21 2012 Eric Hodel <drbrain@segment7.net>
- * string.c (rb_str_oct): [DOC] mention radix indicators.
- [ruby-core:71310] [Bug #11648]
+ * test/rake/helper.rb: Load envutil correctly. Removed useless rescue
+ for signal propagation tests
+ * lib/rake/file_utils.rb: Prefer the built ruby.
+ * test/rake/test_rake_functional.rb: ditto
-Tue Dec 15 12:20:30 2015 Takashi Kokubun <takashikkbn@gmail.com>
+Thu Dec 6 15:20:34 2012 Eric Hodel <drbrain@segment7.net>
- * lib/erb.rb: Simplify regexp to optimize erb scanner.
- [fix GH-1144]
+ * lib/rdoc/context.rb: Don't warn for duplicate methods while loading.
+ * test/rdoc/test_rdoc_context.rb: Test for above.
-Tue Dec 15 11:56:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 6 14:26:22 2012 Eric Hodel <drbrain@segment7.net>
- * lib/uri/common.rb: make code block for rdoc.
- [ci skip][fix GH-1152] Patch by @Tonkpils
+ * lib/rubygems/command_manager.rb: Removed string concatenation
+ syntax. [Bug #6265]
+ * lib/rubygems/commands/install_command.rb: ditto
+ * lib/rubygems/commands/uninstall_command.rb: ditto
+ * lib/rubygems/indexer.rb: ditto
+ * lib/rubygems/security/policy.rb: ditto
+ * lib/rubygems/security.rb: ditto
+ * lib/rubygems/uninstaller.rb: ditto
+ * test/rubygems/test_gem_commands_cert_command.rb: ditto
+ * test/rubygems/test_gem_package.rb: ditto
+ * test/rubygems/test_gem_security.rb: ditto
+ * test/rubygems/test_gem_security_policy.rb: ditto
-Tue Dec 15 11:55:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 6 14:10:08 2012 Eric Hodel <drbrain@segment7.net>
- * ext/zlib/zlib.c: fix a typo.
- [ci skip][fix GH-1149] Patch by @crismali
+ * lib/rubygems/package.rb: Set rubygems_version before validation.
+ Fixes issue with bundler.
+ * test/rubygems/test_gem_package.rb: Test for above.
-Tue Dec 15 09:14:14 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * lib/rubygems/remote_fetcher.rb: Only update the cache when we have
+ permission. [ruby-trunk - Bug #7509]
+ * lib/rubygems/source.rb (class Gem): ditto
+ * test/rubygems/test_gem_remote_fetcher.rb: Test for above.
+ * lib/rubygems/test_utilities.rb: ditto
- * tool/transcode_tablegen.rb: detailed documentation
- for transcode_tblgen function [ci skip]
+ * lib/rubygems/specification.rb: Derive base_dir properly for default
+ gems. [ruby-trunk - Bug #7496]
+ * test/rubygems/test_gem_specification.rb: Test for above.
-Mon Dec 14 22:11:11 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * lib/rubygems.rb: Untaint Dir.pwd when searching for gemdeps files
+ for operation under $SAFE=1
- * enc/ebcdic.h: new dummy encoding EBCDIC-US
- * enc/trans/ebcdic.trans: transcodings between EBCDIC-US
- and iso-8859-1 [with code from Andrea Ribuoli]
- * test/ruby/test_transcode.rb: tests for above
- * tool/transcode_tablegen.rb: additional argument for
- method transcode_tblgen
+Thu Dec 06 12:07:11 2012 Koichi Sasada <ko1@atdot.net>
-Mon Dec 14 17:04:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm_trace.c: TracePoint#enable should not cause an error
+ when it is already enabled. TracePoint#disable is too.
+ [ruby-core:50561] [ruby-trunk - Bug #7513]
- * ext/socket/lib/socket.rb: use safe navigation operator.
- [fix GH-1142] Patch by @mlarraz
- * lib/drb/extservm.rb: ditto.
- * lib/net/http.rb: ditto.
- * lib/net/http/response.rb: ditto.
- * lib/scanf.rb: ditto.
- * lib/uri/generic.rb: ditto.
+ * test/ruby/test_settracefunc.rb: add tests.
+
+Thu Dec 6 07:19:58 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc*: Improved display of ChangeLog files as HTML.
+ * test/rdoc*: Test for above.
+
+Thu Dec 6 04:34:19 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_uninterruptible): helper function for providing
+ temporary async_interrupt_timing(Object => :defer)
+
+ * io.c (rb_f_p): use rb_uninterruptible.
+ * io.c (rb_f_p_internal): helper function for rb_f_p().
+ * io.c (struct rb_f_p_arg): new struct for rb_f_p_internal.
+
+ * test/ruby/test_thread.rb (test_async_interrupt_and_p): test for
+ the above.
+
+Thu Dec 6 04:27:10 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_binwrite): check interrupt before io issue.
+ * test/ruby/test_thread.rb (test_async_interrupt_and_io):
+ test for the above.
+
+Thu Dec 6 01:10:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_method_call_status): use Qundef as no self instead of
+ the current self.
+
+ * vm_eval.c (send_internal): public_send does not consider how it is
+ called, as mentioned in r14173. patched by charliesome (Charlie
+ Somerville). [ruby-core:50489] [Bug #7499]
+
+Wed Dec 5 23:50:23 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (getrusage_time): uses clock_gettime() with
+ CLOCK_PROCESS_CPUTIME_ID when available, which provides a 1ns
+ precision on linux. [ruby-core:50495] [Bug #7500]
+ patched by Aman Gupta.
+
+Wed Dec 5 22:46:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_vm_make_proc): save the proc made from the given block so
+ that it will not get collected. [ruby-core:50545] [Bug #7507]
+
+Wed Dec 5 22:13:57 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used,
+ @ptr should be updated. This fixes SEGV raised in DL::Function#call
+ after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708]
+
+ * test/dl/test_func.rb (test_bind): test for the above
+
+Wed Dec 5 18:53:00 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * thread.c (rb_thread_s_async_interrupt_timing): have to check ints
+ before jumping out.
+ * test/ruby/test_thread.rb (test_async_interrupt_with_return): add test
+ rescue has to catch a queued async exception at the time of return.
+ * test/ruby/test_thread.rb (test_async_interrupt_with_break): add test
+ rescue has to catch a queued async exception at the time of break.
+
+Wed Dec 5 16:54:28 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/memory_status.rb: suppress warning.
+ A patch from NAKAMURA Usaku.
+
+Wed Dec 5 16:06:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parser/changelog.rb: Parse more ChangeLog file variations.
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
+
+Wed Dec 5 12:17:11 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#initialize, DL::Function#bind):
+ ABI should be set by using CFunc#calltype even when Fiddle is used.
+ When Fiddle is used and a block is given, name should not be ignored.
+ [ruby-core:50562] [Bug #7514]
+
+ * ext/dl/lib/dl/import.rb (DL::Importer#bind_function): should respect
+ abi and name when Fiddle is used.
+
+ * test/dl/test_func.rb (test_name_with_block): test for "name" method
+ with giving a block.
+
+Wed Dec 5 11:55:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/shell.rd, doc/shell.rd.ja: Removed stale doc files
+ * lib/shell.rb, lib/shell/*: Merge and updates docs from doc/shell.rd*
+
+Wed Dec 5 11:42:38 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_settracefunc.rb: disable trace.
+
+Wed Dec 5 11:37:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#macro_defined?): use clearly different
+ strings from conflict markers.
+
+Wed Dec 5 04:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/README: Add rdoc modeline directive and formatting libs
+
+Wed Dec 5 04:04:02 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * test/ruby/test_thread.rb (test_async_interrupt_blocking): bugfix
+ about deferred check
+
+Wed Dec 5 03:35:37 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): check async queue everytime.
+ * thread.c (sleep_forever): check RUBY_VM_CHECK_INTS_BLOCKING first.
+ * thread.c (sleep_timeval): ditto.
+ * test/ruby/test_thread.rb (test_async_interrupt_blocking): add a test
+ exceptions are correctly deferred and raised on :on_blocking context.
+
+Wed Dec 5 02:36:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk, defs/id.def, template/id.c.tmpl: generate id.c as well as id.h.
+
+Wed Dec 5 00:56:21 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_owned_p): new method that return current
+ thread have the target mutex or not. [Feature #7505] [ruby-dev:46697]
+ * test/ruby/test_thread.rb (test_mutex_owned, test_mutex_owned2):
+ test for the above.
+ * NEWS: new for the above.
+
+Wed Dec 5 00:05:47 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/erb.rb (make_compiler, add_put_cmd, add_insert_cmd): extract
+ methods.
+
+Tue Dec 4 18:21:04 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/ruby/memory_status.rb (Memory): use fiddle/types if available.
+
+ * test/ruby/memory_status.rb (Memory::Win32): :stdcall is needed on
+ x86 WIN32. This commit partly reverts r38054.
+
+Tue Dec 4 18:05:58 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/fiddle/lib/fiddle/types.rb: copied from ext/dl/lib/dl/types.rb
+ and modified for Fiddle, needed for migration from DL to Fiddle.
+
+Tue Dec 4 17:57:09 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/fiddle/lib/fiddle/import.rb (import_function, bind_function):
+ should respect call_type for migration from DL to Fiddle.
+ [Bug #7484] [ruby-core:50405]
+
+Tue Dec 4 16:54:00 2012 Eric Hodel <drbrain@segment7.net>
+
+ * .document: Added ChangeLog and doc/ChangeLog-* as documentation
+
+Tue Dec 4 16:47:46 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parser/changelog.rb: Added a ChangeLog parser to RDoc.
+ * lib/rdoc/parser.rb: ditto
+ * test/rdoc/test_rdoc_parser_changelog.rb: Test for above.
+
+Tue Dec 4 16:23:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (path2class, path2module): use PRIsVALUE.
+
+ * marshal.c (w_object, marshal_dump, marshal_load): use
+ rb_check_funcall if possible.
+
+ * marshal.c (w_object, marshal_dump, r_object0, marshal_load): use
+ RB_GC_GUARD() (directly or indirectly) instead of volatile.
+
+ * variable.c (rb_path_to_class): prevent the argument from GC.
+
+Tue Dec 04 13:55:07 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_opts.h: enable optimization - operand unification.
+ Operand unification technique enable to combine
+ an instruction and specific operands and make new
+ instruction.
+
+ * defs/opt_operand.def: add several configuration
+ of operand unification.
+
+ * insns.def: use `int' instead to suppress warning.
+
+Mon Dec 3 17:58:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y: replace parser->enc with current_enc.
+
+Tue Dec 4 08:33:46 2012 Eric Hodel <drbrain@segment7.net>
+
+ * README.EXT: Converted to RDoc format
+ * README.EXT.ja: ditto
+
+Tue Dec 4 08:32:10 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/ri/driver.rb: Fixed ri page display for files with
+ extensions.
+ * test/rdoc/test_rdoc_ri_driver.rb: Test for above
+
+Tue Dec 4 04:11:50 2012 Eric Hodel <drbrain@segment7.net>
+
+ * .document: Add NEWS for `ri ruby:NEWS`
+ * NEWS: Set format as rdoc
+ * doc/NEWS-1.8.7: ditto
+ * doc/NEWS-1.9.1: ditto
+ * doc/NEWS-1.9.2: ditto
+ * doc/NEWS-1.9.3: ditto
+
+Mon Dec 3 20:37:22 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.c: check VM_COLLECT_USAGE_DETAILS.
+
+Mon Dec 3 20:28:02 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_specialized_instruction):
+ change condition of using `opt_send_simple'.
+ More method invocations can be simple.
+
+Mon Dec 3 20:03:38 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_objectspace.rb: skip RuntimeError
+ which says a message "can't modify frozen File".
+ Is that correct behavior?
+
+Mon Dec 03 20:00:19 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.c: vm_analysis_insn should be static.
+
+Mon Dec 3 19:10:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (Init_Random), rational.c (Init_Rational): make marshal
+ methods private. [Feature #6539]
+
+Mon Dec 3 18:29:27 2012 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.h: iseq_catch_table_entry::catch_type should be
+ Fixnum because they are pushed into Array in a compiler.
+ [Bug #7502]
+
+ * test/ruby/test_objectspace.rb: add a test of this issue.
+
+Mon Dec 3 18:25:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/id.h.tmpl (preserved_ids): "empty?" is not an attribute name.
+
+Mon Dec 3 16:23:09 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (vm_backtrace_to_ary): check negative size (2nd arg).
+
+Mon Dec 3 15:50:33 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): Unbreak by
+ fixing a typo, s/set/setq/.
+
+Mon Dec 3 14:14:19 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): joke shouldn't use id.h defined ids.
+
+ * id.c (Init_id): ditto.
+
+ * common.mk: fix dependency.
+
+Mon Dec 3 12:43:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-block-end-re, ruby-delimiter)
+ (ruby-mode-syntax-table, ruby-parse-partial, ruby-beginning-of-indent):
+ merge from Emacs.
+
+ * misc/ruby-mode.el (ruby-calculate-indent): fix indentation of
+ argument lines in parentheses. [Bug #5140]
+
+Mon Dec 3 07:52:41 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parser.rb: Improved modeline support. Patch by nobu.
+ * test/rdoc/test_rdoc_parser.rb: Test for above.
+
+Sun Dec 3 00:06:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new): stop checking string
+ taintness. [Bug #5508] [ruby-core:40510]
+
+Sun Dec 2 19:26:47 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * thread.c (RB_GC_SAVE_MACHINE_CONTEXT, rb_gc_save_machine_context):
+ extract rb_gc_save_machine_context to RB_GC_SAVE_MACHINE_CONTEXT.
+ NOTE: machine_regs and machine_stack_end must be set in current scope.
+
+Sun Dec 2 18:46:24 2012 Koichi Sasada <ko1@atdot.net>
+
+ * array.c, enum.c, insns.def, io.c, numeric.c, parse.y, process.c,
+ range.c: use prepared IDs.
+ A patch from charliesome (Charlie Somerville).
+ [Bug #7495]
+
+ * common.mk: add dependency to id.h.
+
+ * common.mk: replace ID_H_INCLUDES with id.h.
+
+Sun Dec 2 16:48:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/weakref.rb (rdoc): Clean up usage, add example,
+ note ArgumentError on WeakRef.new
+
+Sun Dec 2 16:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * gc.c (WeakMap): Add doc for internal reference, use lib/weakref.rb
+
+Sun Dec 2 07:24:23 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/parser.rb: Parse files with a -*- rdoc -*- modeline
+ * test/rdoc/test_rdoc_parser.rb: Test for above
+
+Sun Dec 2 06:02:00 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * gc.h (SET_MACHINE_STACK_END): add volatile for preventing
+ harmful optimization. [ruby-dev:46665] [Bug #7468]
+
+Sun Dec 2 05:01:58 2012 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (rb_iseq_line_trace_each): iterate `line' event only.
+
+ * test/ruby/test_iseq.rb: add a test for this change.
+
+Sun Dec 2 02:46:04 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: add TracePoint#inspect.
+
+ * test/ruby/test_settracefunc.rb: add a test for this change.
+
+Sat Dec 1 21:18:19 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_backtrace.rb: add a test for
+ Thread::Backtrace::Location#inspect.
+ BTW, tests for `caller_locations' are not enough.
+ Any volunteers are welcome.
+
+Sat Dec 1 21:06:58 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (location_inspect_m): add
+ Thread::Backtrace::Location#inspect.
+ It same as loc_obj.to_s.inspect.
+
+Sat Dec 1 19:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_puts): recurse for the argument itself, not converted
+ array elements. [ruby-core:42444] [Bug #5986]
+
+Sat Dec 1 19:01:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object, r_object0): call private marshal methods.
+ [Feature #6539]
+
+Sat Dec 1 18:52:22 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/cleanup_command.rb: Fix cleanup command for
+ multiple gems. [ruby-trunk - #7481] by Kouhei Sutou
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
+ * lib/rubygems.rb: Autoload Gem::Source to prevent test failures
+
+Sat Dec 1 18:17:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * complex.c (Init_Complex), time.c (Init_Time): make marshal methods
+ private. [Feature #6539]
+
+ * object.c (Init_Object): make remove_instance_variable public.
+ [Feature #6539]
+
+ * id.c (Init_id), template/id.h.tmpl: add initialize_{copy,clone,dup}
+ and respond_to_missing?.
+
+ * vm_method.c (rb_method_entry_make): make above methods private.
+ [Feature #6539]
+
+Sat Dec 1 16:40:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_thread.rb: move ConditionVariable related test
+ into test/thread/test_cv.rb.
+ * test/thread/test_cv.rb: new file.
+ * test/thread/test_cv.rb (test_condvar_empty_signal): new tests.
+ * test/thread/test_cv.rb (test_condvar_empty_broadcast): ditto.
+
+Sat Dec 1 15:14:25 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_thread.rb (test_cv_wait_deadlock): enable
+ cv deadlock test.
+
+Sat Dec 1 14:23:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (ConditionVariable): use hash instead of array for
+ @waiters.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): remove
+ a test because @waiters no longer have a chance to duplicated. Now it's
+ a hash.
+
+Sat Dec 1 17:16:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-electric.el (ruby-electric-curlies): use kill-region
+ instead of interactive command delete-backward-char.
+
+Sat Dec 1 17:12:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/inf-ruby.el (inferior-ruby-mode): fix the
+ compilation-shell-minor-mode configuration. a patch by
+ j2petkov (Jean-Christophe Petkovich) in [ruby-core:46518].
+ [Bug #6742]
+
+Sat Dec 1 15:05:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): use NAMLEN() to tell the length of d_name
+ instead of strlen(), which can access beyond the boundary.
+
+Sat Dec 1 13:48:13 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/specification.rb: Don't add default gems to $LOAD_PATH
+ as they are already there.
+
+Sat Dec 1 12:22:17 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * re-added r38053 that is reverted by r38061. Problems by r38053
+ are resolved by r38096. r38096 removed GEM_SKIP configuration.
+
+ The below is ChangeLog of r38053:
+
+ * defs/default_gems: Add base directory column.
+
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
+
+Sat Dec 1 11:09:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * variable.c (rb_class_path_no_cache): add a function to get the class
+ path without caching the computed path. Some classes are frozen, and
+ will raise an exception without this.
+
+ * probes.d (cmethod-entry, cmethod-return): separate cmethods from
+ regular methods to match set trace func.
+
+ * probes_helper.h: refactor macros. Fix probes to avoid calling
+ #inspect when profiling.
+
+ * insns.def: update for use with new macros.
+
+ * vm_eval.c: ditto
+
+ * vm_insnhelper.c: ditto
+
+ * test/dtrace/test_singleton_function.rb: fix test for new output.
+
+ * test/dtrace/test_cmethod.rb: test the cmethod probes.
+
+Sat Dec 1 09:44:16 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/rdoc/test_rdoc_options.rb: Windows drive letters are
+ case-insensitive.
+
+Sat Dec 1 09:42:13 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Search for gem deps file up the directory tree.
+ * test/rubygems/test_gem.rb: Test for above.
+
+Sat Dec 1 09:33:32 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/runner.rb: Set GEM_HOME, GEM_PATH and GEM_SKIP to empty set.
+ With default_gem support in RubyGems GEM_SKIP prevents loading of
+ built-in gems.
+
+Sat Dec 1 07:16:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * compile.c (ADD_CATCH_ENTRY): add a cast to fix SEGV with x64 mingw
+ on Windows 8. Without cast, 0 might be non zero value at higher bits
+ in rb_ary_new3().
+ [ruby-core:50258] [Bug #7456]
+
+Sat Dec 1 04:07:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (parser.utf8): remove unused property.
+
+ * parse.y (UTF8_ENC): remove unused macro.
+
+ * parse.y (parser_tokadd_utf8): use rb_utf8_encoding() directly.
+
+Sat Dec 1 03:49:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/sync.rb (Sync_m#sync_synchronize): add Thread.async_interrupt_timing
+ for protecting from async interrupt.
+ * lib/sync.rb (Sync_m#sync_lock): ditto.
+
+Sat Dec 1 03:38:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (ConditionVariable#broadcast): s/RuntimeError/StandardError/
+ * lib/thread.rb (ConditionVariable#signal): ditto.
+
+Sat Dec 1 03:29:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (SizedQueue#pop): rewrite by using ConditionVariable.
+ * lib/thread.rb (SizedQueue#push): ditto.
+ * lib/thread.rb (SizedQueue#max): ditto.
+ * lib/thread.rb (Queue#pop): ditto.
+ * lib/thread.rb (Queue#push): ditto.
+
+ * lib/thread.rb (SizedQueue#num_waiting): adopt the above changes.
+ * lib/thread.rb (SizedQueue#initialize): ditto.
+ * lib/thread.rb (Queue#num_waiting): ditto.
+ * lib/thread.rb (Queue#initialize): ditto.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): ditto.
+
+Sat Dec 1 03:45:47 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (Thread.async_interrupt_timing): fix RDoc.
+ :never is not used any more.
+
+Sat Dec 1 02:56:19 2012 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c: add RubyVM::InstructionSequence (ISeq) inspection methods.
+ * ISeq#path returns path of this ISeq written.
+ * ISeq#absolute_path returns absolute path.
+ * ISeq#label returns label (method name and so on).
+ * ISeq#base_label returns base label (see Thread::Backtrace::Location).
+ * ISeq#first_lineno returns first line number of this ISeq.
+ * ISeq.of(obj) returns ISeq object which obj (Proc or Method)
+ is contains.
+
+ * test/ruby/test_iseq.rb: add tests.
+
+Sat Dec 1 02:58:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * include/ruby/ruby.h (rb_event_flag_t): Maintain integer precision
+ for clang error (VALUE aka unsigned long vs unsigned int)
+
+Sat Dec 1 02:53:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/rubygems/test_gem_dependency_installer.rb: Use Gem.read_binary
+ instead of File.binread for ruby 1.8 compatibility in the rubygems
+ source repository. Updates r38075
+
+Sat Dec 1 02:33:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_interrupt_mask, async_interrupt_timing_func):
+ merge into them into rb_thread_s_async_interrupt_timing.
+ * thread.c (rb_thread_s_async_interrupt_timing): ditto.
+
+Sat Dec 1 02:11:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_interrupt_mask): add argument check.
+ * thread.c (async_interrupt_timing_arg_check_i): helper function
+ for the above.
+ * test/ruby/test_thread.rb (test_async_interrupt_timing_invalid_argument):
+ test for the above.
+
+Sat Dec 1 01:19:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (ConditionVariable#broadcast): protect from
+ async interrupt by using Thread.async_interrupt_timing.
+ * lib/thread.rb (ConditionVariable#signal): ditto.
+ * lib/thread.rb (ConditionVariable#wait): ditto.
+
+Sat Dec 1 02:04:23 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err):
+ raise if assert_in_out_err misused.
+
+Sat Dec 1 02:08:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rdoc/test_rdoc_rubygems_hook.rb
+ (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existence
+ of the file(directory) before touch it. 2. remove test
+ file(directory) after the test. see [ruby-core:50388].
+
+Sat Dec 1 01:51:06 2012 Koichi Sasada <ko1@atdot.net>
+
+ [EXPERIMENTAL]
+ * iseq.c: add following two methods.
+ * ISeq#line_trace_all returns all line traces (line numbers)
+ * ISeq#line_trace_specify(pos, set) set `pos'th line event to
+ specified_line event (if set is true).
+ These features are introduced for debuggers (mainly to make
+ breakpoint).
+
+ * iseq.h: add decl. of C APIs.
+
+ * test/ruby/test_iseq.rb: add tests.
+
+ * vm_trace.c: add `specified_line' event.
+
+ * include/ruby/ruby.h: ditto.
+
+Sat Dec 1 01:49:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_dependency_installer.rb: gems are of course
+ binary files, so use a binary reading method when reading it.
+ see [ruby-core:50388].
+
+Sat Dec 1 01:21:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/command.rb (Gem::Command#get_all_gem_names_and_versions):
+ who assumes that the pathname of a gem never contains ':' ?
+ yes, on Unixen pathnames can contain ':', and on Windows they almost
+ certainly contain ':'. see [ruby-core:50388].
+
+ * lib/rubygems/requirement.rb (Gem::Requirement::PATTERN_RAW): extract
+ the regexp to match the version specifier from PATTERN to use in
+ above method.
+
+Sat Dec 1 00:48:19 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/fiddle/extconf.rb, ext/fiddle/function.c
+ (Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an
+ enumeration. [ruby-core:50398] [Bug #7483]
+
+Sat Dec 1 00:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_other_non_gem):
+ on Windows, rubygems always generate a wrapper .bat file when
+ installing a file into bin, so testing no-overwrite a wrapper file
+ and a non-wrapper file is nonsense. see [ruby-core:50388].
+
+Fri Nov 30 23:39:58 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_default_bin_dir):
+ if the executable to be overwritten was generated by rubygems, the
+ error message differs from the only copied one's.
+ see [ruby-core:50388].
+
+Fri Nov 30 23:27:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_ext_ext_conf_builder.rb
+ (TestGemExtExtConfBuilder::test_class_make): reading with binary mode
+ of course introduce \r on Windows. see [ruby-core:50388].
+
+Fri Nov 30 23:11:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/specification.rb
+ (Gem::Specification.validate_permissions): don't check executability
+ of the source on Windows. they will be wrapped to .bat files when
+ installing. see [ruby-core:50388].
+
+Fri Nov 30 22:44:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (rb_vm_struct): add thread_destruct_lock field.
+ * thread.c (Init_Thread): ditto.
+ * thread.c (rb_vm_gvl_destroy): ditto.
+
+ * thread.c (thread_start_func_2): make sure vm->running_thread
+ don't point to dead thread.
+ * thread.c (timer_thread_function): close a race against thread
+ destruction. [Bug #4911][ruby-dev:43859]
+
+ * vm_core.h (rb_thread_set_current): reset running time of
+ current thread instead of previous thread. We no longer
+ assume previous running thread still live.
+
+Fri Nov 30 21:57:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * revert r38053 because it causes too many test failures.
+ if you've already installed r38053 or later, remove the installed
+ lib/ruby/gems/2.0.0 directory and reinstall this revision or later.
+
+Fri Nov 30 21:07:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit/parallel.rb (Test::Unit::Worker.run): wrap LoadError
+ because it's Gem::LoadError sometimes. see [Bug #6882]
+
+Fri Nov 30 20:47:44 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c: TracePoint#self returns invoking/exiting thread object
+ at thread_begin/end event.
+
+ * test/ruby/test_settracefunc.rb: fix test.
+
+Fri Nov 30 19:55:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/memory_status.rb (Memory::Win32): use fiddle instead of dl,
+ but I doubt fiddle is not compatible with dl. (if you are interested,
+ see the diff.) [ruby-core:50194] [Bug #7443]
+
+Fri Nov 30 19:37:44 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * defs/default_gems: Add base directory column.
+
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
+
+Fri Nov 30 19:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_trace.c:
+ tracepoint_attr_return_value (TracePoint#return_value):
+ include `:b_return` for method doc
+ tracepoint_enable_m, tracepoint_disable_m (#enable/#disable):
+ don't have block argument, document block scope
+
+Fri Nov 30 18:52:56 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (tracepoint_disable_m, tracepoint_enable_m):
+ fix block parameter.
+ No argument should be given to a block which is passed
+ to TracePoint#enable (and disable).
+
+Fri Nov 30 18:23:26 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c: rename Thread.control_interrupt
+ to Thread.async_interrupt_timing.
+ The option name `:never' is also changed to `:defer'.
+ [ruby-core:50375] [ruby-trunk - Feature #6762]
+
+ * thread.c: remove Thread.check_interrupt.
+ This method is difficult to understand by name.
+
+ * thread.c: add Thread.async_interrupted?.
+ This method check any deferred async interrupts.
+
+ * test/ruby/test_thread.rb: change tests for above.
+
+Fri Nov 30 18:24:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_trace.c: Documentation for TracePoint API
+ [ruby-core:47243] [Feature #6895]
+
+Fri Nov 30 17:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_cmp_m): try to compare with to_str result if
+ possible before calling <=> method. [ruby-core:49279] [Bug #7342]
+
+ * string.c (rb_str_cmp_m): use rb_check_funcall instead of respond_to
+ and call.
+
+ * string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always.
+
+Fri Nov 30 16:19:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv
+ handler. based on a patch by charliesome (Charlie Somerville)
+ [ruby-core:49573] [Bug #7402]
+
+Fri Nov 30 16:05:44 2012 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Added RubyGems 2.0.0
+
+Fri Nov 30 15:24:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): fix false usage of local variable, it cannot
+ appear in fname state [ruby-core:49659] [Bug #7408]
+
+Fri Nov 30 15:20:12 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/package.rb: Load YAML for building gems.
+ * test/rubygems/test_gem_commands_contents_command.rb: Sort expected
+ output of default gem contents. Re-fixes r38004 and r38005.
+
+Fri Nov 30 15:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * vm_trace.c (set_trace_func): Formatting of params and events
+
+Fri Nov 30 14:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/net/http.rb: Net::HTTP::Patch to list of HTTP Request Classes
+ Patch by Ryunosuke SATO [Fixes #217 on github]
+
+Fri Nov 30 14:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/cgi.rb: CGI example for HTML generation
+ Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465]
+
+Fri Nov 30 13:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * time.c: Documentation improvements, grammar and formatting
+ Patch by Bernd Homuth [ruby-core:49203] [Bug #7326]
+
+Fri Nov 30 13:48:33 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Set version to 4.0.0.preview2
+ * lib/rubygems.rb: Set version to 2.0.0.preview2
+
+Fri Nov 30 13:11:53 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/setup_command.rb: Remove old files on install
+ of RubyGems. (not by rbinstall.rb).
+ * test/rubygems/test_gem_commands_setup_command.rb: Test for above.
+
+Fri Nov 30 12:47:59 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/abbrev.rb (Abbrev#abbrev): A fixed string prefix pattern
+ should only match the beginning of each word, not the beginning
+ of every line in it.
+
+ * lib/abbrev.rb (Abbrev#abbrev): Stop using a regexp that causes a
+ false warning. [Bug #7471]
+
+Fri Nov 30 12:30:55 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/test_abbrev.rb: Add tests for lib/abbrev.rb.
+
+Fri Nov 30 12:27:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/spec_fetcher.rb: Allow prerelease spec fetching to fail
+ for bundler.
+ * test/rubygems/test_gem_spec_fetcher.rb: Test for above.
+
+Fri Nov 30 12:20:53 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake/backtrace.rb: Removed duplication in
+ Rake::Backtrace::SUPPRESSED_PATHS
+ * test/rake/test_rake_backtrace.rb: Skip tests when tmpdir is in the
+ suppressed pattern.
+
+Fri Nov 30 11:07:45 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * revert r37993 to avoid SEGV in tests.
+
+Fri Nov 30 10:38:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/ri/driver.rb: Relaxed matching for pages to be more
+ user-friendly.
+ * test/rdoc/test_rdoc_ri_driver.rb: Test for above.
+
+Fri Nov 30 09:50:16 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/markdown.rb: Fixed warnings with -w
+
+Fri Nov 30 09:38:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (RB_GC_GUARD_PTR): add note.
+
+ * vm_backtrace.c (backtrace_to_str_ary): use RB_GC_GUARD() instead of
+ RB_GC_GUARD_PTR() which has no effect.
+ (backtrace_to_location_ary): ditto.
+ (vm_backtrace_to_ary): ditto.
+
+Fri Nov 30 09:22:52 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/contents_command.rb: Sort output from command.
+ Replaces r38004, r38005
+ * test/rubygems/test_gem_commands_contents_command.rb: ditto.
+
+ * lib/rubygems/defaults.rb: Use Gem.path_separator for jruby support.
+ * lib/rubygems/path_support.rb: ditto
+
+Fri Nov 30 08:34:03 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/generator/darkfish.rb: Silenced warning
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
+
+ * lib/rdoc/markup/parser.rb: Use byteslice when available for
+ performance
+ * test/rdoc/test_rdoc_markup_parser.rb: Test for above
+ * lib/rdoc/test_case.rb: ditto
+
+ * lib/rdoc/parser/ruby.rb: Fixed bug parsing yield({})
+ * test/rdoc/test_rdoc_parser_ruby.rb (end):
+
+ * lib/rdoc/rubygems_hook.rb: Skip default gems. Display generator
+ name properly.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Test for above
+
+ * lib/rdoc/servlet.rb: Fixed typo.
+
+Fri Nov 30 08:09:56 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c : remove a unused function.
+
+Fri Nov 30 07:46:42 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (rb_objspace_call_finalizer): finalize_deferred may free up
+ a object which is reachable from a part after this function,
+ e.g. ruby_vm_destruct(). [ruby-dev:46647] [Bug #7452]
+
+ * test/ruby/test_gc.rb (test_finalizing_main_thread): add a test
+ for above.
+
+Fri Nov 30 07:43:44 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_interrupted): avoid warning of
+ implicit conversion.
+
+ * thread.c (rb_threadptr_execute_interrupts): ditto.
+
+Fri Nov 30 07:34:28 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: add GC guards.
+
+Fri Nov 30 07:21:33 2012 Koichi Sasada <ko1@atdot.net>
+
+ [EXPERIMENTAL: NEED DISCUSS]
+ * vm_trace.c: add events
+ * :thread_begin - hook at thread beginning.
+ * :thread_end - hook at thread ending.
+ * :b_call - hook at block enter.
+ * :b_return - hook at block leave.
+ This change slow down block invocation.
+ Please try and give us feedback until 2.0 code freeze.
+
+ * include/ruby/ruby.h: ditto.
+
+ * compile.c (rb_iseq_compile_node): ditto.
+
+ * insns.def: ditto.
+
+ * thread.c: ditto.
+
+ * vm.c: ditto.
+
+ * include/ruby/debug.h: add a comment.
+
+ * test/ruby/test_settracefunc.rb: add a tests.
+
+Fri Nov 30 06:56:30 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * test/minitest/*: Imported minitest 4.3.2 (r8027)
+
+Fri Nov 30 04:16:29 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake/*: Updated to rake 0.9.5
+ * test/rake/*: ditto.
+ * NEWS: ditto.
+
+Fri Nov 30 02:53:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * vm.c: add a return hook when a method raises an exception.
+
+ * probes_helper.h: look up klass and method if none are provided.
+
+ * eval.c: update macro usage.
+
+ * vm_eval.c: ditto.
+
+ * vm_insnhelper.c: ditto.
+
+ * test/dtrace/test_function_entry.rb: test for change.
+
+Fri Nov 30 02:27:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * compile.c (compile_array_): refix r37991 remove assertion:
+ it is true only if type == COMPILE_ARRAY_TYPE_HASH.
+ [ruby-dev:46658] [Bug #7466]
+
+ * vm.c (m_core_hash_from_ary): add assertion instead of above.
+
+ * vm.c (m_core_hash_merge_ary): ditto.
+
+Thu Nov 29 19:15:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (compile_array_): hash elements must be paired even for
+ literal elements. [ruby-dev:46658] [Bug #7466]
+
+Thu Nov 29 22:39:35 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/openssl/ossl_ssl.c (ssl_npn_encode_protocol_i): fix byte order
+ issue on big-endian architecture [ruby-core:50292] [Bug #7463]
+
+Thu Nov 29 22:23:31 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * test/openssl/test_cipher.rb (test_ctr_if_exists): add CTR mode test
+ if underlying OpenSSL supports it. See #4408
+
+Thu Nov 29 21:42:16 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_method.c (rb_method_entry_make): add a method entry with
+ VM_METHOD_TYPE_REFINED to the class refined by the refinement if
+ the target module is a refinement. When a method entry with
+ VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
+ the same name is searched in refinements. If such a method is
+ found, the method is invoked. Otherwise, the original method in
+ the refined class (rb_method_definition_t::body.orig_def) is
+ invoked. This change is made to simplify the normal method lookup
+ and to improve the performance of normal method calls.
+
+ * vm_method.c (EXPR1, search_method, rb_method_entry),
+ vm_eval.c (rb_call0, rb_search_method_entry): do not use
+ refinements for method lookup.
+
+ * vm_insnhelper.c (vm_call_method): search methods in refinements if
+ ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
+ super (i.e., ci->call == vm_call_super_method), skip the same
+ method entry as the current method to avoid infinite call of the
+ same method.
+
+ * class.c (include_modules_at): add a refined method entry for each
+ method defined in a module included in a refinement.
+
+ * class.c (rb_prepend_module): set an empty table to
+ RCLASS_M_TBL(klass) to add refined method entries, because
+ refinements should have priority over prepended modules.
+
+ * proc.c (mnew): use rb_method_entry_with_refinements() to get
+ a refined method.
+
+ * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
+ the test because it should pass successfully.
+
+ * test/ruby/test_refinement.rb (test_redefine_refined_method): new
+ test for the case a refined method is redefined.
+
+Thu Nov 29 17:45:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_const_set): show namespace in warning messages.
+ [Feature #7190]
+
+Thu Nov 29 17:31:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems.rb (Gem.load_yaml): return if Kernel#gem is not defined
+ yet. This causes crash if test-all requires libraries in a certain
+ order. A simple reproducible code is
+ ruby --disable-gem -e'require"yaml";require"minitest/autorun"'
+
+Thu Nov 29 17:19:26 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/tracer.rb: Updated to match removal of custom_require from
+ RubyGems.
+ * test/test_tracer.rb: ditto. Improved failure message if the test
+ fails
+
+Thu Nov 29 17:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * gc.c: Documentation for GC, GC::Profiler, ObjectSpace, and
+ ObjectSpace::WeakMap [ruby-core:50245] [Bug #7449]
+
+Thu Nov 29 17:12:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/generic_erb.rb, tool/id2token.rb: add --path-separator option
+ for mingw where make and built ruby live in different world.
+
+ * tool/vpath.rb: extract from tool/instruction.rb.
+
+Thu Nov 29 17:11:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/io/wait/test_io_wait.rb (TestIOWait#fill_pipe):
+ Errno::EWOULDBLOCK may not be the same as Errno::EAGAIN. patch by
+ phasis68 (Heesob Park) at [ruby-core:49894]. [Bug #7420]
+
+Thu Nov 29 17:03:38 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/test_case.rb: Determine path to certificates to avoid
+ build-dir problems.
+ * test/rubygems/test_gem_security_signer.rb: Use predetermined paths
+ to avoid build-dir problems.
+
+Thu Nov 29 16:18:14 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/test_case.rb: Disable loading of keys and certificates
+ outside rubygems or ruby tests as the files are not available (or
+ necessary).
+
+Thu Nov 29 16:14:41 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() for
+ int variable.
-Mon Dec 14 17:03:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Nov 29 15:59:55 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h: add rb_debug_inspector_* APIs.
+
+ * vm_backtrace.c: ditto.
+
+ * common.mk: add dependency from vm_backtrace.o to
+ include/ruby/debug.h.
+
+ * proc.c (rb_binding_new_with_cfp): constify.
+
+ * vm.c (rb_vm_get_ruby_level_next_cfp): constify.
+
+ * vm_core.h, vm_trace.c: move decls.
+
+Thu Nov 29 15:56:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rdoc/test_case.rb (RDoc::TestCase#verbose_capture_io):
+ defined for asserts of warnings.
+
+ * test/rdoc: use verbose_capture_io on asserts of warnings.
+ they failed when tests was run with RUBYOPT=-W0.
+
+Thu Nov 29 15:53:38 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/psych/extconf.rb: added --enable-bundled-libyaml option. this
+ enforces using bundled libyaml.
+
+Thu Nov 29 15:51:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems*: Updated to RubyGems 2.0
+ * test/rubygems*: ditto.
+
+ * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
+
+ * tool/change_maker.rb: Allow invalid UTF-8 characters in source
+ files.
+
+Thu Nov 29 15:38:14 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h: provide rb_tracearg_*() APIs,
+ instead of rb_tracepoint_attr_*().
+ These APIs are for debuggers/profilers.
+ They will be explained in another docs sometime.
+
+ * vm_trace.c: ditto.
+
+Thu Nov 29 15:10:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/minitest/test_minitest_unit.rb: restore orig_verbose only
+ if it is set. This broke rdoc's tests.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121129T050102Z.diff.html.gz
+
+Thu Nov 29 14:56:30 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_tracepoint_attr_method_id):
+ rename TracePoint#id to TracePoint#method_id.
+
+ * include/ruby/debug.h: ditto.
+
+ * test/ruby/test_settracefunc.rb: ditto,
+
+Thu Nov 29 14:49:10 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_tracepoint_attr_defined_class):
+ rename TracePoint#klass to TracePoint#defined_class.
+ [ruby-core:50187] Re: [ruby-trunk - Feature #6895]
+
+ * include/ruby/debug.h: ditto.
- * bootstraptest/runner.rb: use safe navigation operator.
- [fix GH-1142] Patch by @mlarraz
- * test/openssl/test_pair.rb: ditto.
- * test/ruby/test_econv.rb: ditto.
* test/ruby/test_settracefunc.rb: ditto.
- * test/thread/test_queue.rb: ditto.
-Mon Dec 14 14:33:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Nov 29 14:27:57 2012 Koichi Sasada <ko1@atdot.net>
- * lib/xmlrpc.rb: added documentation for parser details.
- [ci skip][fix GH-1124] Patch by @jrafanie
+ * gc.c (gc_stat): prepare Symbol objects at first time
+ to make it fast.
-Mon Dec 14 11:46:52 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Nov 29 14:02:15 2012 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_stat): GC.stat supports new information
+ * total_allocated_object: total allocated object number.
+ * total_freed_object: total freed object number.
+ Above two numbers are only accumulated and they will
+ overflow (return to 0). Please use them as a hint.
+
+Thu Nov 29 12:13:54 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 4.3.2 (r8026)
+ * test/minitest/*: ditto
+
+Thu Nov 29 11:06:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_start_func_2): remove unused code. When
+ th->safe_level == 4, th->errinfo never be thrown. So, to
+ create new exception makes no sense.
+
+Thu Nov 29 10:29:53 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: same as a last patch.
+
+Thu Nov 29 10:24:25 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: use `long' for return values of `NUM2LONG()'.
+
+Thu Nov 29 09:52:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (do_select): suppress warning (uninitialized value warning)
+ with UNINITIALIZED_VAR().
+
+Thu Nov 29 09:36:09 2012 Koichi Sasada <ko1@atdot.net>
+
+ * eval.c (ruby_cleanup): delay THREAD_KILLED timing.
+ It should be located just before rb_thread_terminate_all().
+
+Thu Nov 29 09:10:17 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (vm_backtrace_to_ary): support range argument
+ like Array#[].
+ [ruby-core:50092] [ruby-trunk - Feature #7434]
+ Test and document is not available. Please help us.
+
+Thu Nov 29 06:46:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_start_func_2): small cleanups.
+
+Thu Nov 29 06:37:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_start_func_2): remove unused code.
+ this function never be used for main thread.
+
+Thu Nov 29 06:27:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_start_func_2): remove unused code.
+ errinfo = th->errinfo; and errinfo = rb_errinfo(); are
+ the same.
+
+Thu Nov 29 05:26:32 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary.
+
+ * vm_backtrace.c (rb_backtrace_to_str_ary): use `backtrace_to_str_ary()'.
+
+ * vm_backtrace.c (backtrace_to_frame_ary): rename to
+ backtrace_to_location_ary.
+
+Thu Nov 29 05:19:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * probes.d: Change function-entry probe to method-entry.
+ * insns.def: ditto
+ * probes_helper.h: ditto
+ * test/dtrace/test_function_entry.rb: ditto
+ * test/dtrace/test_singleton_function.rb: ditto
+ * vm.c: ditto
+ * vm_eval.c: ditto
+ * vm_insnhelper.c: ditto
+
+Thu Nov 29 04:45:17 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: rename Class name from
+ ::RubyVM::Backtrace and ::RubyVM::Backtrace::Location
+ to ::Thread::Backtrace and ::Thread::Backtrace::Location.
+
+Wed Nov 28 23:52:02 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * NEWS (Thread) remove incompatible changes about trap.
+
+Wed Nov 28 23:39:01 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_mutex_sleep): fix to allow spurious wakeup.
+ [ruby-dev:46654] [ruby-trunk - Bug #7455]
+
+ * NEWS: write about spurious wakeup.
+
+Wed Nov 28 22:57:23 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread_win32.c: catch up latest change of BLOCKING_REGION.
+
+Wed Nov 28 22:54:21 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_call_method): fix undefined behavior.
+ Should not access scope local variable from outer scope.
+
+Wed Nov 28 22:20:55 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): change test for
+ thread status in trap. now can accept Thread#join and Thread#value in trap.
+
+Wed Nov 28 21:58:47 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/thread.h (rb_thread_call_without_gvl2): change
+ meaning of function.
+ This function is called with same parameters of
+ `rb_thread_call_without_gvl()'.
+ However, if interrupts are detected, then return immediately.
+
+ * thread.c: implement `rb_thread_call_without_gvl2()'.
+
+Wed Nov 28 21:31:21 2012 Masaya Tarui <tarui@ruby-lang.org>
+
+ * thread.c (thread_join_sleep): check spurious wakeup by itself for
+ corresponding status change in trap context.
+ * vm_core.h (struct rb_thread_struct): add rb_thread_list_t and use as join_list for
+ reentry by trap context.
+ * thread.c (thread_start_func_2): ditto.
+ * thread.c (remove_from_join_list): ditto.
+ * thread.c (rb_thread_atfork): ditto.
+ * thread.c (thread_join): ditto. & remove trap handler check.
+ * thread.c (sleep_forever): add argument : spurious_check.
+ * thread.c (sleep_timeval): ditto.
+ * thread.c (rb_thread_sleep_forever): set spurious_check.
+ * thread.c (rb_thread_sleep_deadly): ditto.
+ * thread.c (sleep_for_polling): ditto.
+ * thread.c (rb_thread_wait_for): ditto.
+ * thread.c (sleep_wait_for_interrupt): bypass spurious_check.
+
+Wed Nov 28 21:23:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_indicator): constify.
+
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_block_scalar_hints):
+ ditto.
+
+ * ext/psych/extconf.rb: mingw32 also needs macros for win32, not
+ only mswin32.
+
+ * ext/psych/extconf.rb: compile sources in the source directory
+ without copying by using VPATH.
+
+Wed Nov 28 21:18:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(*VPATH*) for
+ each VPATH elements.
+
+Wed Nov 28 16:40:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (enum rb_thread_status): remove THREAD_TO_KILL
+ * vm_core.h (struct rb_thread_struct): add to_kill field
+ * thread.c (terminate_i): convert THREAD_TO_KILL to to_kill.
+ * thread.c (rb_threadptr_to_kill): ditto.
+ * thread.c (rb_thread_kill): ditto.
+ * thread.c (rb_thread_wakeup_alive): ditto.
+ * thread.c (thread_list_i): ditto.
+ * thread.c (static const char): ditto.
+ * thread.c (thread_status_name): ditto.
+ * thread.c (rb_thread_status): ditto.
+ * thread.c (rb_thread_inspect): ditto.
+ * vm_backtrace.c (thread_backtrace_to_ary): ditto.
+
+ * thread.c (rb_threadptr_execute_interrupts): fix thread status
+ overwritten issue. [Bug #7450] [ruby-core:50249]
+
+ * test/ruby/test_thread.rb (test_hread_status_raise_after_kill):
+ test for the above.
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): test for
+ thread status in trap.
+ * test/ruby/test_thread.rb (test_status_and_stop_p): remove
+ Thread.control_interrupt unsafe test. Thread#kill no longer
+ changes thread status. Instead of, Thread#kill receiver changes
+ their own status when receiving kill signal.
+
+Wed Nov 28 16:21:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (struct rb_mutex_struct): add allow_trap field.
+ * internal.h (rb_mutex_allow_trap): added.
+ * thread.c (rb_mutex_lock, rb_mutex_unlock): check mutex->allow_trap.
+ * thread.c (mutex_sleep): remove trap check because it uses
+ rb_mutex_lock and rb_mutex_unlock internally.
+ * thread.c (rb_mutex_allow_trap): new helper function for the above.
+
+ * io.c (io_binwrite): mark fptr->write_lock as writable in trap.
+
+ * test/ruby/test_signal.rb (test_trap_puts): test for the above.
+
+Wed Nov 28 16:59:12 2012 Koichi Sasada <ko1@atdot.net>
+
+ * proc.c: remove Proc#== and Proc#eql?.
+ Proc objects compared with their object ids.
+ [Bug #4559]
+
+ * test/ruby/test_proc.rb: remove related test.
+
+Wed Nov 28 16:41:04 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/servlet.rb: Add support for serving documentation from a
+ subdirectory.
+ * lib/rdoc/generator/darkfish.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: Test for above
+ * test/rdoc/test_rdoc_servlet.rb: ditto
+
+Wed Nov 28 15:37:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix r37294: run only on i[3-6]86-linux.
+
+Wed Nov 28 15:31:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (FMODE_SYNCWRITE): removed unused macro.
+
+Wed Nov 28 15:19:25 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: revert r37911, r37906 and r37904 which break build
+ with non-gcc and/or non-IA32 compilers, e.g. Solaris Studio,
+ Fujitsu C Compiler. [ruby-dev:46646] [Bug #7451]
+
+Wed Nov 28 14:50:55 2012 Koichi Sasada <ko1@atdot.net>
+
+ * ext/psych/extconf.rb: copy sources into build directory,
+ not into srcdir.
+
+Wed Nov 28 14:34:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock): moved trap context check from
+ rb_mutex_trylock because try_lock have no change to make
+ a deadlock.
+ * thread.c (rb_mutex_trylock): ditto.
+ * NEWS: news for the above.
+
+Wed Nov 28 13:39:54 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_s_new): uses main_thread->status instead of
+ th->inhibit_thread_creation for preventing thread creation.
+ * vm_core.h (rb_vm_struct): remove inhibit_thread_creation field.
+ * thread.c (rb_thread_terminate_all): ditto.
+
+Wed Nov 28 13:27:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/extconf.rb: use embedded libyaml if no system libyaml is
+ found. [ruby-core:49463]
+ * ext/psych/lib/psych.rb: updating to psych 2.0.0
+ * ext/psych/lib/psych/deprecated.rb: updated docs
+ * ext/psych/psych.gemspec: updated to psych 2.0.0
+ * ext/psych/psych.h: fixing header file include for rename
+ * ext/psych/psych_emitter.c: renamed to avoid libyaml conflict.
+ * ext/psych/psych_emitter.h: ditto
+ * ext/psych/psych_parser.c: ditto
+ * ext/psych/psych_parser.h: ditto
+ * ext/psych/psych_to_ruby.c: ditto
+ * ext/psych/psych_to_ruby.h: ditto
+ * ext/psych/psych_yaml_tree.c: ditto
+ * ext/psych/psych_yaml_tree.h: ditto
+ * ext/psych/yaml/LICENSE: embedding libyaml 0.1.4
+ * ext/psych/yaml/api.c: ditto
+ * ext/psych/yaml/config.h: ditto
+ * ext/psych/yaml/dumper.c: ditto
+ * ext/psych/yaml/emitter.c: ditto
+ * ext/psych/yaml/loader.c: ditto
+ * ext/psych/yaml/parser.c: ditto
+ * ext/psych/yaml/reader.c: ditto
+ * ext/psych/yaml/scanner.c: ditto
+ * ext/psych/yaml/writer.c: ditto
+ * ext/psych/yaml/yaml.h: ditto
+ * ext/psych/yaml/yaml_private.h: ditto
+
+Wed Nov 28 12:54:59 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join): A trap handler check was moved from
+ thread_join_m because Thread#value should be raised an exception
+ too.
+ * thread.c (thread_join_m): remove trap handler check.
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): add test
+ for thread#value.
+ * NEWS: documentation fix for the above.
+
+Wed Nov 28 11:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/lib/fiddle/import.rb: ditto
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/pack.rb: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: ditto
+ * ext/fiddle/lib/fiddle/function.rb: ditto
+
+Wed Nov 28 09:15:51 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * ext/strscan/strscan.c: Added #charpos for multibyte string position.
+ * test/strscan/test_stringscanner.rb: ditto
+
+Wed Nov 28 09:00:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/fiddle.c: adding alignment constants for compatibility
+ with DL.
+ * ext/fiddle/fiddle.h: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: importing the C parser for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/import.rb: importing the import DSL for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/pack.rb: importing structure pack for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: importing struct DSL for DL backwards
+ compatibility.
+ * test/dl/test_c_struct_entry.rb: importing tests
+ * test/dl/test_c_union_entity.rb: ditto
+ * test/dl/test_cparser.rb: ditto
+ * test/dl/test_import.rb: ditto
+ * test/fiddle/test_c_struct_entry.rb: ditto
+ * test/fiddle/test_c_union_entity.rb: ditto
+ * test/fiddle/test_cparser.rb: ditto
+ * test/fiddle/test_import.rb: ditto
+
+Wed Nov 28 08:56:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * doc/globals.rdoc: Add documentation file for magic globals
+ [ruby-core:29048] [Bug #3022]
+
+Wed Nov 28 08:55:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * .document: Add README's to be included with docs
+
+Wed Nov 28 08:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/dl/lib/dl.rb: Deprecation notice for DL
+
+Wed Nov 28 08:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/pointer.c: ditto
+ * ext/fiddle/function.c: ditto
+ * ext/fiddle/lib/fiddle.rb: ditto
+ * ext/fiddle/fiddle.c: ditto
+ * ext/fiddle/handle.c: ditto
+
+Wed Nov 28 04:53:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
+ to Fiddle::Handle.
+ * ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
+ DL::Pointer to Fiddle::Pointer.
+ * test/fiddle/test_func.rb: relevant tests
+ * test/fiddle/test_handle.rb: ditto
+ * test/fiddle/test_pointer.rb: ditto
+ * ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
+ * ext/fiddle/extconf.rb: check for dlfcn.h
+ * ext/fiddle/fiddle.c: add constants for sizeof() things
+ * ext/fiddle/fiddle.h: include dlfcn.h
+ * ext/fiddle/function.c: expose a C function for creating new
+ Fiddle::Function objects.
+ * ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
+ * ext/fiddle/lib/fiddle/function.rb: read the pointer from the
+ function for dl backwards compat.
+ * test/dl/test_callback.rb: check the addresses of the pointers rather
+ than their types.
+ * test/fiddle/helper.rb: remove dependency on dl
+ * test/fiddle/test_closure.rb: ditto
+ * test/fiddle/test_fiddle.rb: ditto
+
+Wed Nov 28 03:03:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (opt-dir): don't use non portable flag -E of sed.
+
+Wed Nov 28 02:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs
+ -march=$target_cpu on at least linux gcc 4.1.
+ patched by KOSAKI Motohiro
+
+Tue Nov 27 22:03:09 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): Dummy initialization of ary has been
+ replaced with UNINITIALIZED_VAR().
+
+Tue Nov 27 21:29:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (bigdivrem): optimize the way to retry calculation of
+ bigdivrem so that the calculation is started from the point where
+ the last interruption was occurred.
+
+ * bignum.c (bigdivrem1): ditto.
+
+ * test/ruby/test_bignum.rb: add a test case for rb_bigdivrem in the
+ case that an interruption is occurred during bigdivrem1 is running.
+
+Tue Nov 27 19:56:43 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (rb_vm_make_env_object): make Proc object if Env is possible
+ to point block.
+ [ruby-core:41038] [ruby-trunk - Bug #5634]
+
+ * vm.c (rb_vm_make_proc): No need to make Proc object here.
+
+ * bootstraptest/test_proc.rb: add tests.
+
+Tue Nov 27 18:51:06 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ruby_atomic.h (ATOMIC_CAS): added for Solaris and other platforms.
+ * ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from
+ NEED_RUBY_ATOMIC_EXCHANGE.
+ * signal.c (ruby_atomic_compare_and_swap): naive, non-atomic
+ compare-and-swap implementation only used for platforms without
+ valid support for atomic operations.
+
+Tue Nov 27 17:43:46 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/*: Added --root option for building documentation outside
+ the source directory.
+ * test/rdoc/*: ditto
+ * common.mk (rdoc): Added --root to rdoc rule
+
+Tue Nov 27 16:24:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/rdoc/test_rdoc_ri_paths.rb: Fixed duplicate path bug which
+ caused windows failures.
+
+Tue Nov 27 16:06:00 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/rdoc/test_rdoc_generator_darkfish.rb: Updated tests for windows
+ * test/rdoc/test_rdoc_options.rb: ditto
+ * test/rdoc/test_rdoc_parser.rb: ditto
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
+ * test/rdoc/test_rdoc_ri_driver.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: ditto
+
+Tue Nov 27 15:13:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * common.mk (rdoc): Set --debug for rdoc generation in case of bugs
+
+Tue Nov 27 14:56:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/rubygems_hook.rb: Updated for (upcoming) RubyGems 2
+ import.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: ditto
+
+Tue Nov 27 13:59:29 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * NEWS: add improvements of the garbage collector.
+
+Tue Nov 27 13:27:46 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc*: Updated to RDoc 4.0 (pre-release)
+ * bin/rdoc: ditto
+ * test/rdoc*: ditto
+ * NEWS: Updated with RDoc 4.0 information
+
+Tue Nov 27 12:17:11 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_terminate_all): retry broadcast only when
+ an exception is raised.
+
+Tue Nov 27 12:02:25 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_terminate_all): broadcast terminate event
+ not only an interrupt exception but any exceptions.
+
+Tue Nov 27 10:55:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * eval.c (ruby_cleanup): set thread status to THREAD_KILLED
+ for preventing thr.raise.
+ * test/ruby/test_thread.rb (test_main_thread_status_at_exit):
+ test for the above.
+
+Tue Nov 27 10:31:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): suppress a warning.
+
+Tue Nov 27 09:29:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a main thread.
+ * test/ruby/test_thread.rb (test_thread_join_main_thread):
+ test for the above.
+ * NEWS: news for the above.
+
+Tue Nov 27 09:24:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a current thread.
+ * test/ruby/test_thread.rb (test_thread_join_current):
+ test for the above.
+ * NEWS: news for the above.
+
+Tue Nov 27 09:59:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): close mkmf.log for each libraries so that
+ failure messages are not mixed.
+
+Tue Nov 27 09:58:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/*/extconf.rb, ext/openssl/extconf.rb: get git rid of
+ post-1.8 feature require_relative for cross compilation.
+ [ruby-core:50160] [Bug #7439]
+
+Tue Nov 27 09:17:59 2012 Koichi Sasada <ko1@atdot.net>
+
+ * NEWS: add TracePoint.
+
+Tue Nov 27 08:16:03 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: rename TracePoint#file and TracePoint#line
+ to TracePoint#path and TracePoint#lineno respectively.
+ They are consistent to RubyVM::Backtrace::Location.
+
+ * include/ruby/debug.h: ditto.
+
+ * vm_core.h: ditto.
+
+ * test/ruby/test_settracefunc.rb: ditto.
+
+Tue Nov 27 08:04:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): broadcast eTerminateSignal
+ again when Ctrl-C was pressed. [Feature #1952] [ruby-dev:39107]
+
+Tue Nov 27 07:58:03 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: add members to rb_trace_arg_t:
+ * `klass_solved' represents klass and id is checked.
+ * `line' represents line calculated from cfp.
+ * `file' represents line calculated from cfp.
+
+ * vm_trace.c: fix to use above data structures.
+ No need to calculate klass and id, line and file
+ pairs for each trace points.
+
+Tue Nov 27 07:47:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): add RUBY_VM_CHECK_INTS_BLOCKING().
+ Otherwise the loop in this function behave as busy loop because
+ native_sleep() return immediately when RUBY_VM_INTERRUPTED() is true.
+
+Tue Nov 27 04:12:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake): git rid of post-1.8 features for cross
+ compilation. [ruby-core:50160] [Bug #7439]
+
+Tue Nov 27 00:13:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_trylock, rb_mutex_unlock, mutex_sleep):
+ raises ThreadError if called from trap handler as Thread#join.
+ * NEWS: news for the above.
+
+Mon Nov 26 23:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * NEWS: update for Thread#join incompatible change.
+
+Mon Nov 26 22:44:24 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_terminate_all): use native_sleep() instead
+ of rb_thread_schedule(). Otherwise, it consume 100% cpu meaninglessly.
+ [Bug #5368] [ruby-dev:44546]
+ * thread.c (thread_start_func_2): last sub-thread wakes up main thread.
+
+Mon Nov 26 21:16:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT)
+ (RUBY_VM_SET_FINALIZER_INTERRUPT, RUBY_VM_SET_TRAP_INTERRUPT)
+ (RUBY_VM_INTERRUPTED): use enum symbol instead of immediate value.
+ * thread.c (thread_join_m, rb_threadptr_execute_interrupts): ditto.
+ * signal.c (signal_exec): ditto.
+
+Mon Nov 26 20:23:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join_m): use th->interrupt_mask instead of
+ th->in_trap.
+
+ * vm_core.h (struct rb_thread_struct): remove in_trap member.
+ * signal.c (signal_exec): ditto.
+ * thread.c (thread_create_core): ditto.
+ * thread.c (Init_Thread): ditto.
+
+Mon Nov 26 20:23:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
+ binary, shouldn't pass via text mode. use base64 encoded data.
+
+Mon Nov 26 19:45:18 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.
+
+ * vm_core.h (struct rb_thread_struct): add interrupt_mask member.
+ * thread.c (thread_create_core, Init_Thread): initialize
+ th->thread_mask.
+
+ * vm_core.h (RUBY_VM_INTERRUPTED_ANY): new macro for avoiding
+ bare th->interrupt_flag.
+ * vm_core.h (RUBY_VM_INTERRUPTED, RUBY_VM_INTERRUPTED): check
+ th->interrupt_mask.
+ * thread.c (set_unblock_function, rb_thread_schedule): replace
+ th->interrupt_flag with RUBY_VM_INTERRUPTED_ANY()
+
+ * signal.c (signal_exec): set up thread->interrupt_mask for
+ preventing recursive trap handler.
+ * vm_core.h (RUBY_VM_CHECK_INTS, RUBY_VM_CHECK_INTS_BLOCKING): ditto.
+
+ * thread.c (rb_threadptr_execute_interrupts):
+ don't process interrupt if it is masked.
+ [Bug #6009] [ruby-core:42524]
+
+Mon Nov 26 19:43:42 2012 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (make_compile_option_value): add trace_instruction option.
+ a patch by davidbalbert (David Albert).
+ [Bug #6786]
+
+Mon Nov 26 19:10:53 2012 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/test_thread.rb: try to `join' each 100
+ threads.
+ This benchmark seems consuming long time on travis-ci
+ several times (and make `failure').
+
+Mon Nov 26 18:22:56 2012 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: specify label `built-ruby'.
+
+ * benchmark/driver.rb: quote path.
+
+Mon Nov 26 18:26:28 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (signal_exec): add volatile to make sure setjmp safe.
+
+Mon Nov 26 18:19:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (signal_exec): suppress "warning: variable 'signum'
+ might be clobbered by 'longjmp' or 'vfork'" warning.
+
+Mon Nov 26 18:15:47 2012 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/driver.rb: accept multiple `-e'.
+ You don't need to use `;' separation character.
+ [ruby-core:50139] [ruby-trunk - Bug #7380]
+
+Mon Nov 26 17:10:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): suppress "may be used uninitialized in
+ this function" warning.
+
+Mon Nov 26 17:00:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (rb_thread_struct): added 'in_trap' member for marking
+ running trap handler.
+ * signal.c (signal_exec): turn on in_trap when running trap.
+ * thread.c (Init_Thread, thread_create_core): initialize in_trap
+ when creating new threads.
+ * thread.c (thread_join_m): raise ThreadError when running trap
+ handler.Bug [#6416][ruby-core:44956]
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): new test
+ for the above.
+
+Mon Nov 26 16:36:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (argf_each_codepoint): add missing ARGF#codepoints [Bug #7438]
+
+Mon Nov 26 15:50:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * bignum.c (bigdivrem): restart calculation when bigdivrem1 was
+ interrupted by signal. Otherwise, ruby script may see a garbage
+ value.
+
+Mon Nov 26 15:33:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * bignum.c (big_div_struct): added volatile to 'stop' member.
+ Otherwise, "if (bds->stop)" check in bigdivrem1 don't read
+ memory and ignore interrupt.
+ * bignum.c (bigdivrem, rb_big_stop): ditto.
+
+Mon Nov 26 12:11:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (DLNOBJ): missing in r37821.
+
+Mon Nov 26 10:50:19 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_process.rb (test_setsid): added a few wait for
+ preventing that Process.getsid(io.pid) makes Errno::ESRCH.
+
+Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * array.c (ary_resize_smaller): new function to resize array.
+
+ * array.c (rb_ary_delete): refactoring to extract a function.
+
+ * array.c (rb_ary_delete_same): refactoring.
+ It renames function, reduces duplicated code and removes unused
+ code.
+
+ * gc.c (wmap_final_func): follow the above change.
+
+ * internal.h (rb_ary_delete_same): ditto.
+
+Sun Nov 25 22:27:33 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * array.c: fixes for the updated documentation in r35858:
+ Typos and #take/#drop accept to take/drop 0 elements.
+
+Sun Nov 25 19:43:29 2012 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * NEWS: add a news about iconv.
+
+Sun Nov 25 03:49:23 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb, test/test_set.rb: Move tests embedded in lib/set.rb
+ to test/test_set.rb.
+
+Sun Nov 25 03:44:50 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * 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.
+
+Sun Nov 25 02:07:37 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning)
+ (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb,
+ test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb,
+ test/ruby/test_regexp.rb, test/ruby/test_syntax.rb:
+ assert_warn() and assert_warning() are reversed.
+
+Sat Nov 24 21:08:50 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * gc.c (wmap_final_func): rename variables to clarify the meaning.
+ In wmap2obj the key is WeakRef and the value is referenced object.
+ In obj2wmap the key is referenced object and the value is an array
+ of WeakRef.
+
+ * gc.c (wmap_finalize): ditto.
+ [ruby-core:49044] [Bug #7304]
+
+Sat Nov 24 21:01:55 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * array.c (rb_ary_delete_same_obj): new function for WeakRef.
+ This deletes same objects as item argument in the array.
+
+ * internal.h (rb_ary_delete_same_obj): add a declaration.
+
+ * gc.c (wmap_final_func): remove WeakRef object reference from the
+ array. rb_ary_delete() is not usable because it uses rb_equal() to
+ compare object references.
+
+ * gc.c (wmap_finalize): remove recycled object references from weak
+ map hash properly. How to get object reference from object id was
+ wrong. st_delete() doesn't work properly if key and value arguments
+ are same. The key of obj2wmap is referenced object and the value of
+ obj2wmap is WeakRef array.
+
+ * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the
+ definition.
+
+ * test/test_weakref.rb
+ (TestWeakRef#test_not_reference_different_object,
+ TestWeakRef#test_weakref_finalize): add tests for above.
+ [ruby-core:49044] [Bug #7304]
+
+Sat Nov 24 19:44:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c (unicode_iconv_combine): returning flags are
+ nkf_char.
+
+Sat Nov 24 19:29:18 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/ruby/test_rubyoptions.rb (test_usage, test_usage_long):
+ reduced, renamed.
+
+Sat Nov 24 13:10:14 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c (rb_tracepoint_attr_raised_exception): should not check
+ value before event checking.
+
+ * vm_trace.c (rb_tracepoint_attr_return_value): ditto.
+
+ * test/ruby/test_settracefunc.rb: add tests for TracePoint#return_value
+ and TracePoint#raised_exception.
+
+Sat Nov 24 12:47:27 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_process.rb (TestProcess#test_setsid): "./ruby-trunk"
+ doesn't work on all environments. EnvUtil.rubybin would be suitable.
+
+Sat Nov 24 12:28:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * array.c (rb_ary_aref): fix Segmentation fault at TestArray#test_aref
+ on x64 mingw. Variable argument of rb_scan_args() should be a pointer
+ (VALUE *), but 0 of variable argument seems not equal to null pointer
+ on x64 mingw.
+
+Sat Nov 24 11:47:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_getsid): adds new method for getting session id.
+ Contributed from fumiyas (Fumiyasu SATOH). Thank you!
+ [Feature #6757] [ruby-dev:45977]
+ * configure.in: adds getsid check.
+ * test/ruby/test_process.rb (TestProcess#test_setsid): new test
+ for the above.
+ * NEWS: news for the above.
+
+Sat Nov 24 10:59:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_create_core): don't use th->thread_id before
+ initialized.
+
+Sat Nov 24 00:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (proc_options, process_options, ruby_process_options): take
+ care of the case argc is 0, and check if argv has NULL.
+ [ruby-core:49889] [Bug #7423]
+
+Sat Nov 24 00:00:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (--disable-dln): option to disable dynamic linking
+ feature. [ruby-core:37676] [Feature #4946]
+
+Fri Nov 23 23:44:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#pkg_config): strip all white spaces for
+ mingw64+MSYS pkg-config which erroneously emits extra newlines.
+ [ruby-core:47998] [Bug #7163]
+
+Fri Nov 23 17:31:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (usage): wrap description lines if options are too long.
+
+Fri Nov 23 11:13:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): refine
+ assertion.
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): now
+ --help option is for modern terminals.
+
+Fri Nov 23 10:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/socket/ipsocket.c (IPSocket#peeraddr): Fix example
+ [ruby-core:46429] [Bug #6732]
+
+Fri Nov 23 02:40:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/cgi/core.rb: Documentation for CGI#header alias
+ Based on a patch by Marcus Stollsteimer
+ [ruby-core:49585] [Bug #7405]
+
+Thu Nov 22 23:48:10 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (is_swept_object): extract from is_dead_object().
+
+ * gc.c (rb_gcdebug_print_obj_condition): add the function for debug.
+ This function shows some conditions of given object (e.g.,
+ marked, in heap, swept).
+
+ * gc.c (rb_gcdebug_sentinel): add the function for debug.
+ This function allow check to inadvertently free up an object.
+
+Thu Nov 22 23:45:18 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * array.c (rb_ary_shared_with_p): fix cache validity check.
+ If #pop or #shift has been called against $: or $", the array will
+ be still shared with the snapshot. We check array length for cache
+ validity.
+ [ruby-core:49518] [Bug #7383]
+
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_with_array_pop,
+ TestRequire#test_require_with_array_shift): add tests for above.
+
+Thu Nov 22 21:48:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk, win32/Makefile.sub (probes.dmyh): now be made in current
+ (=build) directory if build from the repository.
+
+Thu Nov 22 21:34:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/ruby/test_rubyoptions.rb: added a test.
+
+Thu Nov 22 20:32:07 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (string_to_c_strict, string_to_c): check NUL.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
+
+Thu Nov 22 20:21:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * Makefile.in (.dmyh.h): removed $(VPATH). GNU make don't
+ recognize suffix rule with VPATH.
+
+Thu Nov 22 18:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk, Makefile.in, win32/Makefile.sub (.dmyh.h): nmake merges
+ explicit rules for same target, but not merges explicit rules and
+ implicit rules -- always explicit rules win. So, need to add an
+ explicit rule for probes.h. [Bug #7421] [ruby-core:49839]
+
+Thu Nov 22 18:01:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (probes.o): add -C to ignore #include in probes.d.
+
+ * probes.d: include vm_opts.h instead of vm_core.h.
+
+ * vm_opts.h (VM_COLLECT_USAGE_DETAILS): move definition from vm_core.h.
+
+Thu Nov 22 17:45:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8: Merge b0a6577a521d1bba5e19853f95d5c4b9be1072b5.
+ Support JIS X 0213 and some bugfixes.
+
+Thu Nov 22 17:39:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * tool/gen_dummy_probes.rb: don't change #include, #if and #endif
+ lines. [Bug #7370]
+
+Thu Nov 22 16:58:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * Makefile.in: run preprocessor when making probe.h
+ * probes.d: define probe insn and insn__operand only when
+ VM_COLLECT_USAGE_DETAILS is 1. [Bug #7370]
+
+Thu Nov 22 16:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm.c: Don't define vm_collect_usage_operand() and
+ static void vm_collect_usage_insn() when disabling
+ VM_COLLECT_USAGE_DETAILS. (refix r37796)
+
+Thu Nov 22 15:26:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_insnhelper.h: partly revert r37631 (DTrace support).
+ "vm usage information is always collected, so uncomment the
+ functions." causes performance impact. [Bug #7370]
+ Off course this revert disables related probes.
+
+Thu Nov 22 14:14:36 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * re.c (rb_memsearch_ss): Apply performance improvement to short
+ byte array search for platforms without memmem(3).
+ [Feature #6311] [ruby-dev:45530]
+
+Thu Nov 22 12:52:19 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/ruby/test_string.rb (TestString#test_index): Add some
+ corner cases to tests for String#index, which might fail if ruby
+ directly used a buggy memmem(3) implementation.
+
+Thu Nov 22 08:06:42 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * test/ruby/test_gc.rb (test_profiler_clear): fix wrong method
+ calls [Bug #7419] [ruby-core:49828].
+
+Thu Nov 22 02:22:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * NEWS: edited (order etc).
+
+Wed Nov 21 22:52:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/wait/wait.c (io_wait_readable): add alias wait_readable.
+
+ * ext/io/wait/wait.c (io_wait_writable): this is easier to use than
+ IO.select for a single IO object and is immune to the
+ limitations/inefficiency of select() on platforms where poll/ppoll
+ is available. patched by Eric Wong. [Feature #4646]
+
+Wed Nov 21 22:27:52 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (garbage_collect): remove a duplicative probe.
+
+Wed Nov 21 22:08:48 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (gc_profile_clear): realloc profile records if its size is
+ higher than the threshold, GC_PROFILE_RECORD_DEFAULT_SIZE * 2.
+
+Wed Nov 21 21:53:29 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (nucomp_to_c): added.
+
+Wed Nov 21 21:35:38 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * include/ruby/util.h: removed extra semicolon in definition of
+ macro.
+ * compile.c: ditto.
+ * cont.c: ditto.
+ * math.c: ditto.
+ * node.c: ditto.
+ * parse.y: ditto.
+
+Wed Nov 21 18:46:37 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * rational.c (read_digits): due to a bit tighter rb_cstr_to_inum().
+
+Wed Nov 21 16:13:37 2012 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_so_nsieve_bits.rb: add an encoding pragma because
+ this benchmark using strings (literals) as binary sequence.
+ Now, they are UTF-8 strings. [ruby-dev:46578]
+
+Wed Nov 21 00:57:43 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (Init_File): null device definition uses rb_define_const
+ instead of rb_file_const.
+
+Wed Nov 21 00:28:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use RbConfig to get
+ libc's directory. Patched by Vit Ondruch [ruby-core:49763] [Bug #7312]
+
+Tue Nov 20 23:28:26 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * marshal.c: add marshal readahead. marshalized Array, Hash and Struct
+ have size at least number of its elements, marshal readahead will
+ read the certain readable length and buffer when it needs more bytes.
+ marshal readahead prevents many calls to IO#getbyte and IO#read,
+ then it enables performance improvement.
+ [ruby-dev:45637] [Feature #6440]
+
+Tue Nov 20 22:35:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (.d.h): replace char * to const char * because somehow
+ current dtrace removes const of function declaration in probes.d.
+
+Tue Nov 20 21:41:04 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/debug.h: introduced.
+ Debugging/profiling features will be located.
+
+ * vm_trace.c: expose C-level TracePoint APIs.
+ Note that they are experimental.
+
+ * vm_trace.c, include/ruby/debug.h: rename `rb_hook_flag_t'
+ to `rb_event_hook_flag_t'.
+ Macro names `RUBY_HOOK_FLAG_*' are also renamed to
+ `RUBY_EVENT_HOOK_FLAG_*'.
+
+ * debug.h, vm_debug.h: rename debug.h to vm_debug.h.
+
+ * common.mk: ditto.
+
+ * debug.c, main.c, vm_core.h: ditto.
+
+Tue Nov 20 21:12:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (RUBY_DTRACE_AVAILABLE): only check dtrace availability.
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): restore.
+
+Tue Nov 20 21:22:44 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
+ IShellDispatch6 bundled in Windows 8. Thanks to phasis68 (Heesob
+ Park). [ruby-core:49580][Bug #7403]
+
+Tue Nov 20 21:06:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: some improvements.
+ * rational.c: ditto.
+
+Tue Nov 20 21:01:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (incs): BSD make cannot deal with non-prefixed dependency
+ and prefixed target.
+
+Tue Nov 20 20:10:23 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * array.c (rb_ary_bsearch): fix rdoc bug (O(n log n) -> O(log n)).
+ Patch by Charlie Somerville. [ruby-core:49661] [Bug #7409]
+
+ * range.c (range_bsearch): ditto.
+
+Tue Nov 20 19:02:44 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: rename and add TracePoint APIs.
+ (1) TracePoint.new(...){...} creates a new trace point
+ but does not make it enable.
+ (2) TracePoint.trace(...){...} creates a new trace point
+ and enable it (same as old behavior).
+ (3) TracePoint#enable make it enable (renamed from TracePoint#retrace).
+ If block given, when enable only in block.
+ (4) TracePoint#disable make it disable (renamed from TracePoint#untrace).
+ If block given, when disable only in block.
+ (5) TracePoint#enabled? returns this trace is enable or not.
+ [Feature #6895]
+
+ * test/ruby/test_settracefunc.rb: add tests.
+
+Tue Nov 20 18:35:05 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: add two methods:
+ (1) TracePoint#return_value which returns return
+ value on the :return and :c_return event.
+ (2) TracePoint#raised_exception which returns raised exception
+ value on the :raise event.
+ Each methods raise RuntimeError if it is called at unsupported
+ event.
+ Please review and give us feedback until next preview
+ release (Dec/2012) of Ruby 2.0.0.
+ [Feature #6895]
+
+ * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c:
+ ditto.
+
+ * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from
+ vm_trace.c to vm_core.h.
+ Caller fills rb_trace_arg_t and pass the pointer of this variable.
+
+ * test/ruby/test_settracefunc.rb: fix tests to test this change.
+
+Tue Nov 20 17:31:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix dtrace didn't work on darwin.
+
+ * configure.in (RUBY_DTRACE_AVAILABLE): unify RUBY_DTRACE_POSTPROCESS
+ and RUBY_DTRACE_BSD_BROKEN.
+
+Tue Nov 20 15:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * file.c (File.extname): Documentation for extname on dotfiles and
+ files ending with a dot. Also, added example for this.
+ [ruby-core:47852] [Bug #7112]
+
+Tue Nov 20 14:19:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signame): fix windows
+ test failure. Process.kill on windows can't send a signal to
+ another process.
+
+Tue Nov 20 13:58:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (Init_IO): moved all rb_file_const() into file.c.
+ * file.c (Init_File): replace with rb_file_const() with
+ rb_define_const() because RDoc don't care rb_file_const.
+ [Bug #5530]
+
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ruby.c (usage_msg): Fix typo [ruby-core:49205] [Bug #7327]
+
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * file.c (File::NULL): Document File::NULL constant
+ [ruby-core:49384] [Bug #7365]
+
+Tue Nov 20 12:05:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): Windows 8 fixed one of a bug of console
+ API.
+ based on the patch by Heesob Park at [ruby-core:49479] [Bug #7379]
+
+Tue Nov 20 11:14:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (--enable-dtrace): always call RUBY_DTRACE_BSD_BROKEN
+ for portability.
+ As the note, FreeBSD 8 has DTrace as the optional
+ feature (it is enabled by the build option), but doesn't have USDT.
+ FreeBSD 9 has USDT but they are still optional. FreeBSD 10 will
+ enable them by default.
+ The variable $rb_cv_prog_dtrace_g is "yes" only on FreeBSD 9 with
+ optional DTrace or FreeBSD 10. If it is "no", you cannot know
+ whether it doesn't need -G or DTrace is disabled. (by checking
+ error code, you can know)
+
+Mon Nov 19 22:55:48 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in (--enable-dtrace): change help message
+
+Tue Nov 20 11:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/tracer.rb (Tracer.trace_func): printf to stdout
+ Patch by Michal Fojtik [ruby-core:45219] [Bug #6490]
+
+Mon Nov 19 21:24:18 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_dump.c: not to include probes.h because the code does not depend
+ on it.
+ * common.mk (vm_dump.$(OBJEXT)): remove dependency on probes.h
+
+Tue Nov 20 10:14:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_s_check_interrupt): removed redundant
+ GET_THREAD().
+
+Tue Nov 20 10:12:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_async_errinfo_active_p): added a small
+ comment.
+
+Tue Nov 20 10:05:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_blocking_region_end): replaced GET_THREAD()
+ with ruby_thread_from_native(). We don't have GVL here.
+
+Tue Nov 20 09:56:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_execute_interrupts) removed.
+ * thread.c (rb_threadptr_execute_interrupts_common) renamed to
+ rb_threadptr_execute_interrupts. I.e. unified
+ rb_threadptr_execute_interrupts and rb_threadptr_execute_interrupts_common.
+ * thread.c (rb_thread_schedule, rb_thread_execute_interrupts) s/_common//.
+
+Tue Nov 20 09:48:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (rb_get_next_signal): removed pointless signal
+ disabling. pthread_sigmask() only changes current thread
+ mask.
+
+Tue Nov 20 09:36:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (install_sighandler): added comments why we need
+ rb_disable_interrupt().
+
+Tue Nov 20 09:31:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): removed
+ USE_TRAP_MASK.
+ * signal.c (trap_arg, trap_ensure): removed.
+ * signal.c (trap, sig_trap): removed pointless signal disabling.
+ We don't need it because we no longer run trap handler on signal
+ handler context.
+
+Tue Nov 20 09:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * prelude.rb: Moved Mutex#synchronize to
+ * thread.c (rb_mutex_synchronize_m): here. [Bug #4266]
+
+Tue Nov 20 08:36:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sig_signame): implements Signal.signame method
+ [Feature #5613]
+ * test/ruby/test_signal.rb (test_signame): adds test for above
+ * NEWS: add an item about above
+
+Mon Nov 19 16:30:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (rb_struct_each_pair): yield associated pairs so that
+ an unsplat argument can get both, for consistency with Hash,
+ OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
+
+Mon Nov 19 16:17:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBS): libelf is need on only FreeBSD.
+
+Mon Nov 19 16:08:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (RUBYLIB): purelib option in runruby.rb is deprecated
+ since r28841, so set to an empty list to get rid of a bogus path in
+ child processes, which caused an insecure operation exception in
+ test/ruby/test_encoding.rb:test_unsafe.
+
+Mon Nov 19 15:40:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (script): add OPTS=-v, requested by @_ko1.
+
+Mon Nov 19 15:09:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix didn't enable_dtrace=yes on auto.
+
+ * configure.in: see enable_dtrace for adding libelf on FreeBSD.
+
+ * common.mk: VPATH is not needed.
+
+Mon Nov 19 14:55:51 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c: add `Thread#backtrace_locations' method.
+ This method is similar to `caller_locations' method for
+ specific method.
+ And fix to accept `level' and `n' parameters for `Thread#backtrace'
+ and `Thread#backtrace_locations'.
+ `caller' (and `caller_locations') do not return `caller' method
+ frame.
+ However, `Thread#backtrace' (and `Thread#backtrace_locations')
+ return `Thread#backtrace' method frame itself
+ if `Thread.current.backtrace' was called.
+
+ * vm_backtrace.c: ditto.
+
+ * internal.h: ditto.
+
+ * test/ruby/test_backtrace.rb: add tests.
+
+Mon Nov 19 14:54:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * Makefile.in, common.mk (probes.h): moved to common.mk and changed to
+ see $(srcdir).
+
+ * common.mk (probes.dmyh): now created it on $(srcdir) always.
+
+ * win32/Makefile.sub (.SUFFIXES): removed common suffix.
+
+Mon Nov 19 10:00:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (.SUFFIX): bsdmake needs .SUFFIX is defined before use.
+
+ * common.mk: fix path of probes.dmyh.
+
+ * common.mk (vm_dump.o): depend probes.h.
+
+ * configure.in: FreeBSD's USDT requires libelf.
+
+Mon Nov 19 01:11:59 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_core.h, probes_helper.h (RUBY_DTRACE_FUNC_ENTRY_HOOK,
+ RUBY_DTRACE_FUNC_RETURN_HOOK): move from vm_core.h to new file
+ probes_helper.h for narrowing dependency to probes.h.
+ * common.mk (VM_CORE_H_INCLUDES): remove dependency to probes.h.
+ * common.mk (vm.$(OBJEXT)): add dependency to probes_helper.h.
+ * vm.c, vm_insnhelper.c: include probes_helper.h.
+
+Sun Nov 18 16:33:00 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
+ based on r26235 by Yugui. On Solaris 10, low optimization level
+ may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
+ SolarisStudio 12.3 cc.
+
+ * configure.in (--enable-dtrace): new option to enable/disable
+ DTrace support. By default, trying to enable if dtrace command
+ is found on the system. It is disabled when cross compiling.
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
+ the dtrace on the system needs postprocessing with "dtrace -G".
+ The postprocessing is needed on Solaris 10 and other platforms.
+
+ * configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
+ the dtrace supports USDT.
+
+ * configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
+
+ * configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
+
+ * configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
+ DTrace probe object generated by postprocessing with "dtrace -G".
+
+ * Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
+ generated by the postprocessing. New file probes.stamp is for
+ rebuilding related objects that may be modified by "dtrace -G".
+
+ * configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
+ macro for DTrace static library hacks.
+
+ * configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
+
+ * Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
+ rule for DTrace static library hacks.
+
+ * common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
+
+Sun Nov 18 09:31:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): mathn compliant.
+ * rational.c (read_num): ditto.
+
+Sun Nov 18 02:50:12 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): correct logic around wildcard
+ characters detection and ensure wide-chars are used as pattern.
+ [ruby-core:49451] [Bug #7374]
+
+Sun Nov 18 02:02:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): modified handling of polar form.
+
+Sun Nov 18 00:50:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): fixed handling of polar form.
+
+Sun Nov 18 00:14:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (string_to_c_strict, string_to_c): rewrote without regexp.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
+
+Sat Nov 17 23:53:05 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (make_patterns): should not accept extra sign.
+
+Sat Nov 17 21:45:12 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): skip expansion for all wildcard
+ characters.
+ [ruby-core:49451] [Bug #7374]
+
+ * test/ruby/test_file_exhaustive.rb: add more assertions to test.
+
+Sat Nov 17 12:14:50 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: use literal YAML style
+ when emitting multi-line strings. Thanks @atambo
+
+ * test/psych/test_yaml.rb: test for change.
+
+Sat Nov 17 12:03:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: avoid raising exceptions when
+ parsing Floats and Integers. Thanks riffraff [ruby-core:44426]
+ * test/psych/test_numeric.rb: associated test
+
+Sat Nov 17 11:34:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * st.c (st_update): pass the key in st_table so that we can free
+ memory of the key in st_table when deleting.
+ [ruby-core:49220] [Bug #7330]
+
+ * test/-ext-/st/test_update.rb
+ (Bug::StTable#test_pass_objects_in_st_table): add a test.
+
+Sat Nov 17 11:26:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/core_ext.rb: move Kernel#y so that it can
+ manually be required as 'psych/y'.
+
+ * ext/psych/lib/psych/y.rb: ditto
+
+Sat Nov 17 08:13:48 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/abbrev.rb: fix r37113. Correct examples, fix style
+ and show explicit dependency (require 'abbrev').
+
+Sat Nov 17 07:35:15 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): skip automatic path expansion
+ when wildcard character is used. [ruby-core:49451] [Bug #7374]
+
+ * test/ruby/test_file_exhaustive.rb: add a test for above.
+
+Sat Nov 17 00:50:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * marshal.c (w_object): add flonum to arg->data to keep reference index
+ consistency. [ruby-core:49323] [Bug #7348]
+
+ * test/ruby/test_marshal.rb: add a test for above.
+
+Sat Nov 17 00:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (incs): dist files need probes.dmyh.
+
+ * common.mk (probes.dmyh): depends on generator script.
+
+ * Makefile.in, common.mk, configure.in, win32/Makefile.sub (probes.h):
+ select generating with dtrace or copying dummy file by suffix rules.
+
+Fri Nov 16 19:24:10 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_call_without_gvl2): change the parameter of
+ `func' from `int *skip_interrupt' to `VALUE *flags'.
+ If (flags & RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS) is not zero,
+ then skip checking interrupt.
+ [ruby-core:46547]
+
+ * include/ruby/thread.h: ditto.
+
+Fri Nov 16 18:59:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (no-dtrace-probes.h): dmyprobes.h is in srcdir.
+
+ * common.mk (dmyprobes.h): ditto.
+
+Fri Nov 16 17:57:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (probes.h): split build commands for dtrace-available
+ and unavailable platforms.
+
+ * Makefile.in (incs): probes.h is a platform dependent file, so it
+ cannot be a part of prereq target. move it to all-incs.
+
+ * configure.in (DTRACE): move after AC_PROG_CC since cross_compiling
+ is set in it.
+
+ * configure.in (DTRACE): ignore non-prefixed version if
+ cross-compiling.
+
+ * Makefile.in, win32/Makefile.sub (probes.h): fix copying dmyprobes.h
+ path when outplace-build.
+
+Fri Nov 16 15:27:36 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/net/pop.rb (POP3.certs): fix typo in comment.
+ patch from no6v (Nobuhiro IMAI) <nov@yo.rim.or.jp>.
+ [ruby-dev:46519] [Bug #7355]
+
+Fri Nov 16 12:36:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rake/helper.rb (Rake::TestCase#setup): revert r37669.
+ @orig_PWD should be the original pwd.
+
+ * test/rake/test_*.rb: don't use @orig_PWD to load libraries.
+ It should be specified with relative path from the file.
+
+Fri Nov 16 10:22:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be
+ Dir.pwd when the build directory is different from source directory.
+
+Fri Nov 16 09:41:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rake/version.rb: workaround fix to build. see #7366
+ [ruby-dev:46522]
+
+Fri Nov 16 07:23:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake*: Updated to rake 0.9.4
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for
+ a list of changes in 0.9.4.
+
+ * test/rake*: ditto
+
+ * NEWS: ditto
+
+Fri Nov 16 06:58:52 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake*: Updated to rake 0.9.3. See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_3_rdoc.html for
+ a list of changes in 0.9.3.
+
+ * test/rake*: ditto
+
+ * bin/rake: ditto
+
+ * NEWS: ditto
+
+Thu Nov 15 22:39:32 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * range.c (range_bsearch): fix some bugs: a documentation bug, a wrong
+ condition, missed break in switch/case, and workaround for GCC
+ optimization. See [ruby-core:49364] in detail. A great patch from
+ Heesob Park. [Bug #7352] [Feature #4766]
+
+ * array.c (rb_ary_bsearch): fix similar bug (missed break).
+
+ * test/ruby/test_range.rb: add two test cases for above.
+
+Thu Nov 15 22:41:57 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.h (GENTRY): GENTRY should be pointer size.
+ A patch by yoshidam (Yoshida Masato) [Bug #7332].
+
+Thu Nov 15 13:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * man/erb.1: Fix grammar and copyright dates
+ * man/goruby.1: ditto
+ * man/irb.1: ditto
+ * man/rake.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ Patch by Arthur Gunn
+ [Fixes Github #210]
+
+Thu Nov 15 11:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * man/ruby.1: Grammar edits for man page
+ Based on a patch by Michael Endsley [Fixes Github #183]
+
+Thu Nov 15 00:47:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * array.c (rb_ary_bsearch): add Array#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
+
+ * test/ruby/test_array.rb: add a test for above.
+
+ * range.c (range_bsearch): add Range#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
+
+ * test/ruby/test_range.rb: add a test for above
+
+ * NEWS: added the two new methods.
+
+Wed Nov 14 13:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/fileutils.rb (chmod): Add "X" to modes, convert format to table
+ [ruby-core:48965] [Bug #7288]
+
+Wed Nov 14 11:51:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/csv.rb (init_comments): Document private method #init_comments.
+ Based on a patch from Vincent Batts [ruby-core:49172] [Bug #7319]
+
+Wed Nov 14 00:54:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * Makefile.in (probes.h): create from probes.d
+
+Tue Nov 13 18:44:01 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_call_cfunc_with_frame): don't use ci after
+ EXEC_EVENT_HOOK because ci can be overridden.
+
+ * vm_eval.c: ditto.
+
+ * method.h: change invoker's parameters types.
+
+ * vm_method.c (call_cfunc_invoker_func): ditto.
+
+Tue Nov 13 18:01:54 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_mod_using): raise an ArgumentError if cyclic using is
+ detected. based on the patch by Charlie Somerville.
+ [ruby-core:49092] Bug #7308
+
+ * test/ruby/test_refinement.rb: related test.
+
+Tue Nov 13 17:40:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (vm_insnhelper.c): this target is useless and causes
+ ruby always need rebuild.
+
+Tue Nov 13 17:35:49 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (insn_data_to_s_detail): remove debug lines.
+
+Tue Nov 13 17:28:47 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_caller_setup_args): save and restore
+ ci->argc and ci->blockptr before and after method invocations
+ because these method dispatches can override call_info.
+
+ * bootstraptest/test_method.rb: add tests for this fix.
+
+Tue Nov 13 16:38:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (dmyprobes.h): always create for make dist.
+
+ * Makefile.in (probes.h): create or copy dmyprobes.h
+
+ * win32/Makefile.sub: only do copy dmyprobes.h.
+
+Tue Nov 13 15:37:21 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (.SUFFIX): .SUFFIX is needed here for .d.h on bsd make.
+
+Tue Nov 13 15:34:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk Makefile.in win32/Makefile.sub (.d.h): it's not common.
+
+Tue Nov 13 12:27:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: disable dtrace because it doesn't work on FreeBSD.
+
+ * common.mk (clean-local): rm probes.h.
+
+ * common.mk (parse.o): depend $(PROBES_H_INCLUDES).
+
+ * common.mk (.d.h): moved from Makefile.in and use BASERUBY.
+
+ * tool/gen_dummy_probes.rb: reimplemented with ruby because sed is not
+ available on Windows Microsoft VC++ environment.
+
+Tue Nov 13 12:30:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/README.win32: added mention about build directory. currently
+ we can not build ruby in win32 directory. this problem is reported
+ by Masahiro Kitajima <katonbo@katontech.com>.
+
+Tue Nov 13 11:03:47 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * re.c (rb_memsearch_ss): performance improvement by using memmem(3) if
+ possible. [ruby-dev:45530] [Feature #6311]
+
+ * configure.in: check existence of memmem(3) and that it is not broken.
+
+Tue Nov 13 06:50:02 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * probes.d: add DTrace probe declarations. [ruby-core:27448]
+
+ * 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_insnhelper.c: add function entry and exit probes for cfunc
+ methods.
+
+ * vm_insnhelper.h: vm usage information is always collected, so
+ uncomment the functions.
+
+Mon Nov 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.
+
+Mon Nov 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.
+
+Mon Nov 12 14:28:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/mkexports.rb (each_export): skip garbage generated by VS2012's
+ nmake.
+ reported and patched by Yoshida Masato at [Bug #7333] [ruby-dev:46484]
+
+Sun Nov 11 18:58:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_date_{parse,strptime}.rb: changed the format of
+ some extra messages.
+
+Sun Nov 11 18:41:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c (date__parse): revised the tight parser
+ (about handling of apostrophes).
+
+Sun Nov 11 15:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_s_create): just warn for wrong elements now.
+ [ruby-dev:46440] [Bug #7300]
+
+ * hash.c (rb_hash_s_create): refine error messages.
+
+ * error.c (rb_builtin_class_name): share for above.
+
+Sun Nov 11 15:12:18 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (top_using): remove Kernel#using, and add main.using instead.
+
+ * test/ruby/test_refinement.rb: related test.
+
+Sun Nov 11 13:41:01 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_using_refinement, rb_mod_using, f_using): clear method
+ cache only when using is called explicitly.
+
+ * test/ruby/test_refinement.rb: related test.
+
+Sun Nov 11 12:56:34 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/pstore.rb (PStore): fix not to replace ThreadError raised in
+ #transaction block with PStore::Error.
+ [ruby-core:39238] [Bug #5269]
+
+Sun Nov 11 11:36:19 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
+ add a new field for inline method cache.
+
+ * vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
+ not to confuse inline method cache when module_eval is used with
+ refinements.
+
+ * test/ruby/test_refinement.rb: related test.
+
+Sun Nov 11 08:45:45 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * ruby.c: removed a comma before "before"
+
+Sat Nov 10 23:02:31 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: move immutable fields from struct heaps_slot and struct
+ sorted_heaps_slot into struct heaps_header.
+ Based on a patch from Sokolov Yura [Feature #6199][ruby-core:43592]
+
+Sat Nov 10 19:28:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: modified doc.
+ * rational.c: ditto.
+
+Sat Nov 10 18:20:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c: edited about era.
+
+Sat Nov 10 12:13:41 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * tool/rbinstall.rb: Don't install *.gemspec under lib/.
+ [ruby-core:48966] [Bug #7289]
+ Reported by Vit Ondruch. Thanks!!!
+
+Sat Nov 10 00:49:26 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ruby_atomic.h: renamed from atomic.h to avoid header file name
+ conflict on Solaris 10. [ruby-dev:46414] [Bug #7287]
+
+ * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from
+ atomic.h to ruby_atomic.h.
+
+Sat Nov 10 00:46:57 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * atomic.h: Revert r37491 which is a temporary workaround.
+
+Sat Nov 10 00:33:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * siphash.h: check configure macros before include newer headers.
+
+Fri Nov 9 23:33:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/erb.rb (ERB#run, ERB#result): eval under isolated bindings for
+ safe concurrent use. [ruby-core:47638] [Bug #7046]
+
+Fri Nov 9 23:05:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN.
+
+ * siphash.c (sip_init_state): use union to suppress warnings by gcc
+ 4.7.
+
+Fri Nov 9 19:40:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_splice): fix r37583 doesn't consider the case when
+ beg > array length.
+
+Fri Nov 9 16:11:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (rb_memhash): use siphash.
+
+Fri Nov 9 16:08:46 2012 Sokolov Yura funny-falcon <funny.falcon@gmail.com>
+
+ * array.c: speedup Array#unshift by using space in shared array.
+ [Feature #6638]
+ - when array owns its shared array (ARY_SHARED_NUM == 1), and there
+ is enough space then try unshift values directly into shared
+ array.
+ - when resulting array is big (~>64 items) then make it shared with
+ enough room for future #unshifts, and then insert into shared
+ array.
+
+ * array.c (rb_ary_splice): use shared array in rb_ary_slice.
+ [Feature #6638]
+ - use ary_ensure_room_for_push when rb_ary_slice used to add at the
+ end of array, cause rb_ary_concat use rb_ary_slice.
+
+ * array.c (ary_ensure_room_for_push): make array really suitable for
+ queue. [Feature #6638]
+ when array is shared (which happens after Array#shift), and
+ ARY_SHARED_NUM == 1 (which is very often when array used as queue),
+ then make rb_ary_push push directly into shared array.
+
+ * array.c (rb_ary_modify): steal shared array's container when
+ ARY_SHARED_NUM == 1. [Feature #6638]
+ - Do not allocate new memory in rb_ary_modify when ARY_SHARED_NUM == 1
+ and length almost same.
+ - Store ARY_CAPA instead of RARRAY_LEN in ary_make_shared, to make
+ it useful.
+ - Fix rb_ary_sort_bang accordantly.
+
+Fri Nov 9 16:00:00 2012 Zachary Scott <zzak@zacharyscott.net>
+
+ * ext/bigdecimal/bigdecimal.c: Documentation for BigDecimal
+ Based on a patch from Vincent Batts [ruby-core:49047] [Bug #7305]
+
+Fri Nov 9 15:25:42 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/shellwords.rb (Shellwords#shellescape): Add back my original
+ real world example with some enhancement.
+
+ * lib/shellwords.rb (Shellwords#shelljoin): Undo part of the
+ previous rdoc change. This new example using a string-only
+ array was not in line with the description.
+
+Fri Nov 9 12:58:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_crypt): crypt(3) may return NULL.
+ Latest glibc (2.16?) crypt(3) actually returns NULL. [Bug #7312]
+
+Fri Nov 9 12:07:06 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * include/ruby/ruby.h (alloca), eval_intern.h (alloca), gc.c
+ (alloca): Make alloca() globally available by moving the
+ ultimate ifdef's to ruby/ruby.h. Gcc hides its builtin alloca()
+ when compiling with -ansi, and linking thus fails on platforms
+ that lack their own alloca() implementation in libc, which
+ include OpenBSD and some ports of NetBSD. We use alloca()
+ everywhere including from within third party C extensions, so
+ alloca() must be made globally available. [Bug #7307]
+
+ * addr2line.c (alloca): Replace the alloca() part with the
+ ultimate ifdef's. [Bug #7307]
+
+Fri Nov 9 09:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * io.c (IO#new):
+ Fix indentation from r37444
+ [ruby-core:48052] [Bug #7179]
+
+Fri Nov 9 07:36:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (bigmul0): enable big_mul_toom3.
+ [ruby-core:48552] [Bug #7242]
+
+ * bignum.c (bigmul1_toom3): fix incorrect calculation.
+ the patch is made by Heesob Park.
+ [ruby-core:48552] [Bug #7242]
+
+Fri Nov 9 05:33:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (bigmul0): disable big_mul_toom3 temporarily.
+ [ruby-core:48552] [Bug #7242]
+
+ * test/ruby/test_bignum.rb (test_mul_large_numbers):
+ add a test for bigmul1_toom3 suggested in [Bug #7242].
+
+Thu Nov 8 21:57:59 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * re.c (rb_memsearch): performance improvement by using memchr().
+ [ruby-dev:45397] [Feature #6173]
+
+Thu Nov 8 19:02:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278]
+
+Thu Nov 8 11:32:11 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * configure.in (--with-opt-dir): Avoid nesting of double quotes
+ inside backquotes, since some traditional shells like PD KSH
+ (which OpenBSD's /bin/sh bases on) fail to parse them.
+
+Thu Nov 8 09:34:00 2012 Kenta Murata <mrkn@cookpad.com>
+
+ * numeric.c: Add a caution that the results of the comparing
+ operations of two NaNs are undefined.
+ [#1720] [ruby-dev:38725] [ruby-core:36966]
+
+Thu Nov 8 04:45:21 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * include/ruby/intern.h: Restore rb_enumeratorize as it was before
+ r37497 and introduce rb_enumeratorize_with_size instead. [#7302]
+
+ * enumerator.c: ditto.
+
+Wed Nov 7 15:22:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (ruby_float_step): fix r37514: it yielded with NaN
+ if the unit is infinity.
+
+Wed Nov 7 15:46:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/webrick.rb: fix typo. reported by Rohit Arondekar.
+ https://github.com/ruby/ruby/pull/211
+
+Wed Nov 7 15:34:12 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/core.rb: alias CGI#http_header to CGI#header.
+
+Wed Nov 7 12:49:39 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_mod_refine): set RMODULE_IS_REFINEMENT to a created
+ refinement module, and don't override method_added.
+
+ * vm_method.c (rb_method_entry_make): check redefinition of
+ optimized methods when a method is added to a refinement module.
+ [ruby-core:48970] [Bug #7290]
+
+ * test/ruby/test_refinement.rb: related test.
+
+Wed Nov 7 11:48:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-additional.el (ruby-mode-set-encoding): now encoding needs
+ to be set always explicitly actually. [Feature #6679]
+
+Wed Nov 7 09:15:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_mod_const_get): avoid inadvertent symbol creation.
+
+Wed Nov 7 07:52:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (rb_enum_cycle_size): prefix with rb.
+
+Wed Nov 7 04:32:15 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/ruby/test_file_exhaustive.rb: Remove FIXME skip on Windows
+ specific test because the test in question was already fixed.
+
+Wed Nov 7 03:45:12 2012 Luis Lavena <luislavena@gmail.com>
+
+ * ext/zlib/extconf.rb: Recognize zlibwapi as linking library.
+ Patch by Daniel Berger.
+
+ [ruby-core:44979] [Feature #6421]
+
+Wed Nov 7 02:06:40 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * enumerator.c: New method #size; constructor accepts size.
+ Have #to_enum accept a block
+ Warn when using deprecated form of constructor
+ Support #size for enumerators created from enumerators
+ Support for lazy.{map|flat_map|...}.size.
+
+ * include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of
+ sized enumerators.
+
+ * array.c: Support for various enumerator.size.
+
+ * enum.c: ditto.
+
+ * hash.c: ditto.
- * enum.c: fix a typo in documentation.
- [ci skip][fix GH-1140] Patch by @jutaz
- * io.c: ditto.
- * iseq.c: ditto.
* numeric.c: ditto.
- * process.c: ditto.
+
+ * range.c: ditto.
+
* string.c: ditto.
- * vm_trace.c: ditto.
-Mon Dec 14 11:41:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * struct.c: ditto.
- * lib/cgi.rb: fix a typo in documentation.
- [ci skip][fix GH-1140] Patch by @jutaz
+ * vm_eval.c: ditto.
-Mon Dec 14 11:31:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Nov 6 20:40:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * compile.c: fix typos.
- [ci skip][fix GH-1140] Patch by @jutaz
- * dir.c: ditto.
- * gc.c: ditto.
- * io.c: ditto.
- * node.h: ditto.
- * thread_pthread.c: ditto.
- * vm_insnhelper.c: ditto.
- * vsnprintf.c: ditto.
+ * object.c (rb_mod_const_get): Fix constant missing exception class
+ and message to maintain backwards compatibility. Constant search
+ should start at Object when constant starts with '::'
-Mon Dec 14 11:27:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * test/ruby/test_module.rb: test for fixes
- * enc/iso_2022_jp.h: fix typos.
- [ci skip][fix GH-1140] Patch by @jutaz
- * enc/utf_16_32.h: ditto.
- * enc/utf_7.h: ditto.
+Tue Nov 6 16:50:00 2012 Masaki Matsushita <glass.saga@gmail.com>
-Mon Dec 14 11:25:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#inspect): fix confusing #inspect.
+ previous Tempfile#inspect says it is a File, but actually
+ it is not a File.
- * benchmark/bm_app_aobench.rb: fix typos.
- [ci skip][fix GH-1140] Patch by @jutaz
- * benchmark/bm_vm_thread_pipe.rb: ditto.
+ t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
+ t.is_a? File #=> false
-Sun Dec 13 23:46:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ now Tempfile#inspect returns like:
- * parse.y (trace_lex_state): trace lex_state changes if yydebug is
- set, and send the messages to rb_stdout.
+ t = Tempfile.new("foo")
+ #=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>
- * parse.y (rb_parser_printf): store YYPRINTF messages per lines
- so that lex_state traces do not mix.
+ [ruby-core:47544] [Bug #7027]
- * tool/ytab.sed: add parser argument to yy_stack_print too.
+Tue Nov 6 16:22:30 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sun Dec 13 20:41:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * atomic.h: add #include <sys/atomic.h> for the workaround of
+ header file name conflict of atomic.h with /usr/include/atomic.h
+ on Solaris 10. [ruby-dev:46414] [Bug #7287]
- * parse.y (build_lex_state_name, trace_lex_state): lex_state is
- now bit flags and can be set 2 bits or more.
+Tue Nov 6 14:38:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Dec 13 20:26:30 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+ * test/win32ole/test_win32ole.rb: now source encoding is UTF-8, so
+ binary strings in old scripts are dangerous.
- * test/ruby/test_syntax.rb: fix typo in test
+Tue Nov 6 14:25:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 13 20:12:14 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278]
- * parse.y (parse_percent): Allow %-literals in labeled arg as
- r51624 did for parentheses.
- Fixes [ruby-core:72084] [Bug #11812].
+Tue Nov 6 09:42:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 13 20:02:15 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * string.c (rb_str_b): Add String#b, returning a copied string
+ whose encoding is ASCII-8BIT. [ruby-dev:45992] [Feature #6767]
- * ChangeLog: fix a typo
+Tue Nov 6 09:37:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 13 19:54:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ruby.c (load_file_internal): set default source encoding as
+ UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]
- * test/lib/envutil.rb: move envutil's assertions under Test::Unit::Assertion.
- * test/lib/test/unit/assertions.rb: ditto.
+ * parse.y (parser_initialize): set default parser encoding as
+ UTF-8 instead of US-ASCII.
-Sun Dec 13 19:24:20 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+Tue Nov 6 05:48:06 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * parse.y (lex_state_name): Make it return the correct names.
- Add new names to follow r51617; Indices ffs(2) returns are 1-origin.
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_to_path_redefined_in_load_path,
+ TestRequire#test_require_to_str_redefined_in_load_path):
+ Suppress method redefined warning when test-all with RUBYOPT=-w.
-Sun Dec 13 18:40:45 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+Thu Nov 8 00:24:14 2012 Akinori MUSHA <knu@iDaemons.org>
- * parse.y: debug output of lex_state transition if PARSER_DEBUG
+ * ext/curses/view.rb: Do not fail if the file to view is shorter
+ than the screen height.
-Sun Dec 13 18:49:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 5 11:40:00 2012 Mark Somerville <mark@scottishclmibs.com>
- * io.c (parse_mode_enc): preserve encoding of mode string in
- warnings.
+ * thread_pthread.c (rb_reserved_fd_p): fix typo in macro check
+ that prevented the ifdef ever being true.
+ [Bug #7281] [ruby-core:48940]
- * io.c (io_encname_bom_p): check BOM prefix only, not including
- UTF prefix.
+Mon Nov 5 23:28:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * io.c (parse_mode_enc): warn BOM with non-UTF encoding.
+ * file.c (rb_get_path_check_to_string): extract from
+ rb_get_path_check(). We change the spec not to call to_path of
+ String object.
- * io.c (parse_mode_enc): fix buffer overflow.
+ * file.c (rb_get_path_check_convert): extract from rb_get_path_check().
-Sun Dec 13 18:35:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_get_path_check): follow the above change.
- * ext/fiddle/function.c (initialize): check all arguments first.
- reported by Marcin 'Icewall' Noga of Cisco Talos.
+ * file.c (rb_file_expand_path_fast): remove check_expand_path_args().
+ Instead we call it in load.c.
- * ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
- Fixnum for negative values.
+ * file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to
+ reduce expand cost.
-Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_find_file_safe): ditto.
- * pack.c (pack_pack): always check index range against the
- receiver array length, which can be shortened by elements
- conversion. reported by Marcin 'Icewall' Noga of Cisco Talos.
+ * internal.h (rb_get_expanded_load_path): add a declaration.
-Sun Dec 13 18:28:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
+ add declarations.
- * ext/psych/psych_emitter.c (start_document): should not exceed
- tags array range.
+ * load.c (rb_construct_expanded_load_path): fix for compatibility.
+ Same checks in rb_get_path_check() are added. We don't replace
+ $LOAD_PATH and ensure that String object of $LOAD_PATH are frozen.
+ We don't freeze non String object and expand it every time. We add
+ arguments for expanding load path partially and checking if load path
+ have relative paths or non String objects.
- * ext/psych/psych_emitter.c (start_document): ensure string before
- encoding conversion.
+ * load.c (load_path_getcwd): get current working directory for checking
+ if it's changed when getting load path.
-Sun Dec 13 18:26:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (rb_get_expanded_load_path): fix for rebuilding cache properly.
+ We check if current working directory is changed and rebuild expanded
+ load path cache. We expand paths which start with ~ (User HOME) and
+ non String objects every time for compatibility. We make this
+ accessible from other source files.
- * ext/tk/tkutil/tkutil.c (tk_hash_kv): check types of array
- argument. reported by Marcin 'Icewall' Noga of Cisco Talos.
+ * load.c (rb_feature_provided): call rb_get_path() since we changed
+ rb_file_expand_path_fast() not to call it.
- * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check length of
- argument arrays for each access, as callback methods can modify
- them. reported by Marcin 'Icewall' Noga of Cisco Talos.
+ * load.c (Init_load): initialize vm->load_path_check_cache.
- * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check types of
- argument elements. reported by Marcin 'Icewall' Noga of Cisco
- Talos.
+ * vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC.
-Sun Dec 13 18:19:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data
+ to check load path cache validity.
- * ext/win32ole/win32ole.c (ole_vstr2wc): check argument type, vstr
- must be a String here. reported by Marcin 'Icewall' Noga of
- Cisco Talos.
+ * test/ruby/test_require.rb (TestRequire): add tests for require
+ compatibility related to cached expanded load path.
+ [ruby-core:47970] [Bug #7158]
-Sun Dec 13 16:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 5 23:26:05 2012 Greg Price <price@mit.edu>
- * configure.in (BOOTSTRAPRUBY): make BASERUBY full path before
- building ruby to get rid of unexpectedly invoking built ruby.
- [ruby-core:72065] [Bug #11807]
+ * load.c (rb_get_expanded_load_path): cache the expanded load
+ path. This saves 4KB of allocation and some stats for every
+ element of the load path (so nearly a MB in my Rails app)
+ on every require.
- * configure.in (BOOTSTRAPRUBY): use MINIRUBY but not BASERUBY
- unless cross compiling. [ruby-core:72065] [Bug #11807]
+ * load.c (rb_construct_expanded_load_path): ensure that $LOAD_PATH
+ entries are frozen strings. The user must mutate $LOAD_PATH
+ itself rather than its individual entries.
-Sun Dec 13 14:17:19 2015 Akinori MUSHA <knu@iDaemons.org>
+ * vm_core.h (rb_vm_struct): add fields.
- * test/test_shellwords.rb (TestShellwords): Add many more tests
- for handling whitespace characters and frozenness.
+ * vm.c (rb_vm_mark): mark new fields.
-Sun Dec 13 14:16:09 2015 Akinori MUSHA <knu@iDaemons.org>
+ * ruby.c (process_options): modify $LOAD_PATH directly rather than
+ its elements.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * lib/shellwords.rb (Shellwords#shellsplit): Document that this
- method does not treat shell metacharacters as such.
+Mon Nov 5 23:24:42 2012 Greg Price <price@mit.edu>
-Sun Dec 13 12:17:43 2015 Eric Wong <e@80x24.org>
+ * load.c (rb_feature_p, rb_provide_feature): index $LOADED_FEATURES
+ so that require isn't so slow.
- * lib/shellwords.rb (shellescape): duplicate frozen literal
- * test/test_shellwords.rb (test_stringification): new test
+ * load.c (rb_provide_feature, get_loaded_features_index): ensure
+ that $LOADED_FEATURES entries are frozen strings. The user
+ must mutate $LOADED_FEATURES itself rather than its individual
+ entries.
-Sun Dec 13 11:47:35 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * load.c (reset_loaded_features_snapshot): add a new function to reset
+ vm->loaded_features_snapshot.
- * object.c (rb_inspect): check the default internal encoding as
- String#inspect do.
- [ruby-dev:49415] [Bug #11787]
+ * load.c (get_loaded_features_index_raw): add a new function to get
+ the loaded-features index.
-Sun Dec 13 11:38:12 2015 Akinori MUSHA <knu@iDaemons.org>
+ * load.c (features_index_add_single): add a new function to add to the
+ loaded-features index a single feature.
- * lib/shellwords.rb: Turn on frozen-string-literal after fixing
- shellsplit.
+ * load.c (features_index_add): add a new function to add to the
+ loaded-features index all the required entries for `feature`.
-Sun Dec 13 10:44:44 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * vm_core.h (rb_vm_struct): add fields.
- * KNOWNBUGS.rb: Fixed typo, made more explicit [ci skip]
+ * vm.c (rb_vm_mark): mark new fields.
-Sun Dec 13 10:26:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * include/ruby/intern.h (rb_hash_clear): declare function.
- * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): fix parsing
- protocol list.
- The protocol list from OpenSSL is not null-terminated.
- patched by Kazuki Yamaguchi [Bug #11810] [ruby-core:72082]
+ * hash.c (rb_hash_clear): make function non-static.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
-Sun Dec 13 06:40:30 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Mon Nov 5 23:23:51 2012 Greg Price <price@mit.edu>
- * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a
- symbol
- nor a string. See [#11762]
+ * array.c (rb_ary_shared_with_p): new function.
+ Expose whether two arrays are shared (read-only, C only).
-Sun Dec 13 00:05:42 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * include/ruby/intern.h (rb_ary_shared_with_p): declare.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * vm_insnhelper.c (vm_call_method_missing): method_missing should
- not be refined.
- [ruby-core:72080] [Bug #11809]
+Mon Nov 5 23:21:14 2012 Greg Price <price@mit.edu>
-Sat Dec 12 23:00:17 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * load.c (loaded_feature_path): clarify and briefly comment
+ function. These clarifications have no effect on the behavior
+ of the function.
- * ext/nkf/nkf-utf8/nkf.c: Merge nkf 2.1.4.
+ * load.c (rb_feature_p): explain the search loop. Especially
+ useful because the logic is complicated as described in the
+ second paragraph.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
-Sat Dec 12 18:52:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 5 22:45:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * object.c (rb_obj_dig): raise TypeError if an element does not
- have #dig method. [ruby-core:71798] [Bug #11762]
+ * ext/dl/win32/lib/Win32API.rb (Win32API#call): use 64bit pointer for x64
+ Windows. This would fix
+ TestSecureRandom#test_s_random_bytes_without_openssl error.
+ [ruby-core:47451] [Bug #6990]
-Sat Dec 12 17:59:07 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+Mon Nov 5 22:09:26 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/ruby/test_regexp.rb: Add test cases for `$KCODE` and `$=` warning
- [Misc #11770][ruby-dev:49398]
+ * cygwin/GNUmakefile.in (uncommon.mk): link *.res.o.
+ EXTOBJES is defined in uncommon.mk. *.res.o setting should be below
+ uncommon.mk.
+ [ruby-core:48858] [Bug #7277]
-Sat Dec 12 17:11:57 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Mon Nov 5 11:35:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * doc/NEWS-0.2.2: add description about incompatible change in Hash
- duplicated key overriding policy. [Bug #10315] [Bug #11501]
+ * thread_pthread.c (native_thread_init, native_thread_destroy):
+ removed HAVE_PTHREAD_CONDATTR_INIT check because this silly
+ #ifdef makes use-uninitialized-var issue and (2) native_cond_initialize()
+ already have a right platform and caller don't need any additional care.
+ [Bug #6825]
-Sat Dec 12 07:44:38 2015 Eric Wong <e@80x24.org>
+Mon Nov 5 10:57:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (do_io_advise): do not raise on ENOSYS
- * test/ruby/test_io.rb (test_advise): do not skip on Errno::ENOSYS
- (test_advise_pipe): ditto
- [ruby-core:72066] [Feature #11806]
+ * lib/cgi/core.rb: check if Tempfile is defined before use it.
-Sat Dec 12 07:05:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/cgi/core.rb: remove tempfiles only if tempfiles exist
- * enc/windows_1252.c: separate from ISO-8859-1 to fix 0x80..0x9e
- range. [ruby-core:64049] [Bug #10097]
+Mon Nov 5 12:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Dec 11 23:33:40 2015 Yusuke Endoh <mame@ruby-lang.org>
+ * lib/uri/http.rb (URI::HTTP.build): Fix example
+ Patch by Carina C. Zona
+ [Fixes #209 Github]
- * sample/trick2015/: added the award-winning entries of TRICK 2015.
- See https://github.com/tric/trick2015 for the contest outline.
+Mon Nov 5 09:55:05 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-Fri Dec 11 17:59:05 2015 Eric Wong <e@80x24.org>
+ * lib/cgi/core.rb: remove tempfile more early.
- * insns.def (opt_case_dispatch): avoid converting Infinity
- * test/ruby/test_optimization.rb (test_opt_case_dispatch_inf): new
- [ruby-dev:49423] [Bug #11804]'
+Sun Nov 4 20:29:46 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-Fri Dec 11 16:48:57 2015 Eric Wong <e@80x24.org>
+ * lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to CGI#http_header,
+ add and update HTML5 tag generator. [Bug #7110]
+ Patch provided by Marcus Stollsteimer, thank you !
- * hash.c (rb_num_hash_start): avoid pathological behavior
- [ruby-core:72028] [Feature #11405]
+Sun Nov 4 11:47:39 2012 Masaki Matsushita <glass.saga@gmail.com>
-Fri Dec 11 11:58:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]
+ [Feature #5337]. improve performance of FileUtils.compare_stream.
+ [ruby-core:47545] [Feature #7028]
- * NEWS: Mentioned rubygems-2.5.1
+Sun Nov 4 11:27:54 2012 Masaki Matsushita <glass.saga@gmail.com>
-Fri Dec 11 11:52:39 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * array.c (recursive_equal): fix to return true when self and other
+ are resized to same size and the current index become out of
+ range.
- * lib/rubygems: Update to RubyGems 2.5.1
- * test/rubygems: ditto.
+ * test/ruby/test_array.rb: add a test for the above.
-Fri Dec 11 11:38:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 4 10:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * 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
+ * dir.c (file_s_fnmatch): match with expanding braces if FNM_EXTGLOB
+ is set. [ruby-core:40037] [Feature #5422]
-Fri Dec 11 03:44:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Nov 3 23:38:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * object.c (rb_inspect): dump inspected result with rb_str_escape()
- instead of raising Encoding::CompatibilityError. [Feature #11801]
+ * complex.c: modified doc.
+ * rational.c: ditto.
- * string.c (rb_str_escape): added to dump given string like
- rb_str_inspect without quotes and always dump in US-ASCII
- like rb_str_dump.
+Sat Nov 3 22:38:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Dec 10 14:59:59 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/date/date_core.c: modified doc.
- * test/ruby/test_gc.rb (test_expand_heap): relax condition (1->2).
+Sat Nov 3 18:35:55 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Dec 10 14:15:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm.c (rb_vm_rewrite_ep_in_errinfo, vm_rewrite_ep_in_errinfo):
+ merge code and remove `rb_vm_rewrite_ep_in_errinfo'.
- * cont.c: fix a double word typo.
- [Bug #11313][ruby-core:69749]
+Sat Nov 3 18:15:24 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Dec 10 14:13:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm.c, proc.c: avoid unnecessary `rb_vm_rewrite_ep_in_errinfo'
+ calls.
- * ext/tk/lib/multi-tk.rb: fix typos.
- [Bug #11764][ruby-core:71800]
+Sat Nov 3 17:53:43 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 10 11:33:34 2015 Eric Wong <e@80x24.org>
+ * bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
+ compatible API to be available by both test/unit bundled in Ruby
+ and test-unit gem.
+ * lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb.
- * compile.c (iseq_compile_each): reduce needless rb_str_dup
- [ruby-core:72018] <5668DB6E.8000101@ruby-lang.org>
+Sat Nov 3 14:56:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Dec 10 09:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_parse.c (parse_eu): should capture apostrophe too.
- * lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal.
- [ruby-core:72011] [Bug #11800]
+Sat Nov 3 14:46:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Dec 10 06:33:39 2015 Eric Wong <e@80x24.org>
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
- * marshal.c (memsize_dump_arg): remove NULL check
- (memsize_load_arg): ditto
+Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 10 05:53:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A
+ and \z.
- * tool/mkconfig.rb: rbconfig must not be frozen-string-literal to
- expand CONFIG hash. [ruby-core:72006] [Bug #11798]
+Sat Nov 3 14:42:55 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 10 05:03:51 2015 Eric Wong <e@80x24.org>
+ * lib/rexml/output.rb (REXML::Output#initialize): Use normalized
+ encoding name.
- * ext/socket/ifaddr.c (ifaddr_mark): remove empty function
- (ifaddr_type): pass zero to rb_data_type_t.function.dmark
+Sat Nov 3 14:41:17 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 10 04:49:16 2015 Eric Wong <e@80x24.org>
+ * lib/rexml/output.rb (REXML::Output): Don't output BOM in middle
+ of the output string.
+ * test/rexml/test_document.rb: Add a test for the above change.
- * proc.c (bm_free): remove, use default free
- (method_data_type): use RUBY_TYPED_DEFAULT_FREE
+Sat Nov 3 14:09:55 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 10 02:01:41 2015 Koichi Sasada <ko1@atdot.net>
+ * NEWS: Add an item about REXML::Document#write.
- * compile.c (iseq_compile_each): do not add debug information
- without --debug or --debug=frozen-string-literal option
- because String#dup slows down with debug information.
- [Feature #11725]
+Sat Nov 3 13:46:49 2012 Kouhei Sutou <kou@cozmixng.org>
- * NEWS: apply about it.
+ * test/rexml/test_document.rb: Fix tests that expect encoding name
+ isn't normalized.
- * test/ruby/test_rubyoptions.rb: catch up this fix with refactoring.
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Dec 10 00:06:56 2015 Koichi Sasada <ko1@atdot.net>
+ * dir.c (Dir#glob):
+ Documentation for pattern section, backslash subsection
+ Patch by Eric Bouchut
+ [ruby-core:48528] [Bug #7230]
- * iseq.c: rename methods
- RubyVM::InstructionSequence#to_binary_format -> #to_binary
- RubyVM::InstructionSequence.from_binary_format -> .load_from_binary
- RubyVM::InstructionSequence.from_binary_format_extra_data ->
- .load_from_binary_extra_data
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * iseq.c: fix document of iseq.to_binary.
- [Fix GH-1134]
+ * io.c (IO#new):
+ Documentation for IO#open modes and formatting
+ [ruby-core:48052] [Bug #7179]
- * sample/iseq_loader.rb: catch up this change.
+Sat Nov 3 13:01:02 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/lib/iseq_loader_checker.rb: ditto.
+ * test/rexml/test_encoding.rb (EncodingTester#test_in_different_out):
+ Fix a test that expects encoding in XML declaration is changed by
+ Output's encoding. It is dropped feature.
-Wed Dec 9 17:02:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 3 12:49:45 2012 Kouhei Sutou <kou@cozmixng.org>
- * regparse.h (SET_NTYPE): get rid of breaking strict aliasing.
- patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790]
+ * lib/rexml/document.rb (REXML::Document#write): Document encoding
+ option. Now different encoding between XML file's encoding and
+ XML declaration's encoding is support.
+ [Feature #4872] (work in progress)
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's
+ encoding.
+ * test/rexml/test_document.rb: Update tests for the above change.
-Wed Dec 9 16:10:37 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 3 12:18:35 2012 Masaki Matsushita <glass.saga@gmail.com>
- * vm.c (rb_vm_cref_in_context): Module#define_method in non-class
- expression should be public.
- [Bug #11754]
+ * array.c (recursive_equal): fix not to make invalid pointers when
+ self and other are resized to same size in #== of their elements.
+ [ruby-dev:46373] [Feature #6177]
- * test/ruby/test_method.rb: add a test.
+Sat Nov 3 12:06:15 2012 Kouhei Sutou <kou@cozmixng.org>
-Wed Dec 9 14:45:27 2015 Koichi Sasada <ko1@atdot.net>
+ * test/rexml/test_xml_declaration.rb (TestXmlDeclaration#test_*):
+ Remove needless prefix from test names.
- * gc.c (gc_mark_stacked_objects): fix typo.
- reported by XIE Zhibang. [Bug #11763]
+Sat Nov 3 12:04:52 2012 Kouhei Sutou <kou@cozmixng.org>
-Wed Dec 9 14:37:51 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/rexml/test_xml_declaration_parent_child.rb: Rename to ...
+ * test/rexml/test_xml_declaration.rb: ... this.
- * doc/syntax/refinements.rdoc: remove outdated description.
+Sat Nov 3 11:43:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Wed Dec 9 09:58:09 2015 Koichi Sasada <ko1@atdot.net>
+ * hash.c (rb_hash_delete): Correct grammar
+ Patch by Glenn Oppegard
+ [Fixes #208 Github]
- * ext/**/*.c (*_memsize): same as r52986 for extensions.
+Sat Nov 3 11:28:28 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Dec 9 09:46:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * NEWS: add a news about GC::Profiler.raw_data.
- * .gitignore: ignored ISeq binary format.
+Sat Nov 3 11:01:32 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Dec 9 09:34:41 2015 Koichi Sasada <ko1@atdot.net>
+ * NEWS: add a news about rb_newobj_of() and NEWOBJ_OF().
- * *.c (*_memsize): do not check ptr.
- NULL checking is finished Before call of memsize functions.
- See r52979.
+Sat Nov 3 10:17:41 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Dec 9 09:25:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * eval.c (f_current_dirname): add the new method for Kernel.
+ This method almost same as File.dirname(__FILE__). One
+ different behavior is it returns nil when __FILE__ returns nil.
+ [Feature #3346]
- * test/net/smtp/test_response.rb: use Test::Unit. We should use Test::Unit
- without rubygems and rdoc.
+ * NEWS: ditto
-Wed Dec 9 06:26:23 2015 Colin Kelley <colindkelley@gmail.com>
+ * test/ruby/test_method.rb: related test.
- * lib/uri/generic.rb: enable frozen_string_literal
- (split_userinfo): remove explicit .freeze for string literals
- (check_path): ditto
- (query): ditto
- (fragment): ditto
- (to_s): ditto
- [ruby-core:71910] [Bug #11759]
+Sat Nov 3 09:03:34 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Dec 9 06:25:47 2015 Eric Wong <e@80x24.org>
+ * test/ruby/test_refinement.rb (test_new_method_by_send,
+ test_new_method_by_method_object): add tests for Kernel#send and
+ Kernel#method with refinements.
- * test/uri/test_generic.rb (to_s): new test
- [ruby-core:71820]
+ * test/ruby/test_refinement.rb (test_symbol_to_proc): add a test
+ calling a proc created by Symbol#to_proc outside the scope where
+ a refinement is closed over.
-Wed Dec 9 02:18:52 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 3 04:14:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (ibf_dump_memsize): should check NULL.
+ * vm.c (rb_vm_rewrite_ep_in_errinfo): rewrite all catch points in
+ errinfo, not only the topmost frame. based on the patch by
+ ktsj (Kazuki Tsujimoto) in [ruby-dev:45656]. [Bug #6460]
-Wed Dec 9 01:46:35 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Nov 2 20:11:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_init): now accepts new option parameter `encoding'.
- [Feature #11785]
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): remove @ which looks like
+ configure variables.
-Wed Dec 9 00:52:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use .-. instead of !, a
+ special character of NMAKE and BSD make. [Bug #7265]
- * file.c (rb_stat_wr, rb_stat_ww): call get_stat only once and
- reduce checking struct. patch by Yuki Kurihara in
- [ruby-core:71949]. [Misc #11789]
+Fri Nov 2 17:55:39 2012 Shota Fukumori <sorah@tubusu.net>
-Wed Dec 9 00:24:33 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/test/unit.rb (_run_parallel): Delete status line before showing
+ results. Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
- * compile.c (iseq_ibf_dump): dump extra data just string length.
+ * lib/test/unit.rb (_run_parallel): Fix strange result when disabled retrying.
+ Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
- * sample/iseq_loader.rb: add using
- RubyVM::InstructionSequence.from_binary_format_extra_data method
- (commented out).
+Fri Nov 2 17:52:12 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Dec 9 00:21:19 2015 Yuki Nishijima <mail@yukinishijima.net>
+ * object.c (rb_mod_to_s): Module#{to_s,inspect}, when invoked on
+ a refinement, returns a string in the format #<refinement:C@M>,
+ where C is a refined class and M is a module at which the refinement
+ is defined.
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.rc1
+ * eval.c (rb_mod_refine): store information on a refinement for the
+ above change.
-Wed Dec 9 00:17:49 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_refinement.rb: related test.
- * compile.c (ibf_load_setup): cast to int.
+Fri Nov 2 16:57:52 2012 Shota Fukumori <sorah@tubusu.net>
-Wed Dec 9 00:13:09 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_dump.c (rb_vm_bugreport): Because of many log directories,
+ making directory lists readable.
- * compile.c (ibf_setup_load): rename to ibf_load_setup().
+Fri Nov 2 16:44:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * compile.c (iseq_load_setup): check binary format.
+ * vm_dump.c (rb_vm_bugreport): add ~/Library/Logs/DiagnosticReports
+ in the locations list of crash reports.
-Tue Dec 8 23:30:07 2015 Naohisa Goto <ngotogenome@gmail.com>
+Fri Nov 2 14:52:52 2012 Masaki Matsushita <glass.saga@gmail.com>
- * test/io/console/test_io_console.rb (run_pty): Avoid waiting twice
- for a process. Fix Errno::ECHILD in TestIO_Console#test_close and
- TestIO_Console#test_sync.
+ * array.c (recursive_equal): performance improvement by avoiding
+ overhead to call rb_ary_elt().
+ [ruby-dev:45412] [Feature #6177]
-Tue Dec 8 23:05:47 2015 Koichi Sasada <ko1@atdot.net>
+Fri Nov 2 14:47:53 2012 Shugo Maeda <shugo@ruby-lang.org>
- * compile.c (iseq_ibf_dump): fix for clang type checker.
+ * string.c (sym_to_proc, sym_call): A Proc created by Symbol#to_proc
+ should close over the current refinements.
+ [ruby-dev:46345] [Bug #7261]
-Tue Dec 8 23:04:02 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_eval.c (rb_call0, rb_search_method_entry,
+ rb_funcall_passing_block_with_refinements): add a new argument
+ `refinements' for the above changes.
- * iseq.c (iseq_s_load): fix mysterious bug.
+ * test/ruby/test_refinement.rb: related test.
-Tue Dec 8 22:31:58 2015 Koichi Sasada <ko1@atdot.net>
+Fri Nov 2 08:24:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * introduce new ISeq binary format serializer/de-serializer
- and a pre-compilation/runtime loader sample.
- [Feature #11788]
+ * proc.c (top_define_method): new method, main.define_method.
+ [ruby-core:45715] [Feature #6609]
- * 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)
+ * eval.c (top_include): fix a warning message, main is not a class or
+ module.
- * compile.c: implement body of this new feature.
+Fri Nov 2 04:41:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * 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.
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use ! instead of %, a GNU
+ make special character.
- We can return any ISeq object as a result value.
- Otherwise loading will be continue as usual.
+Fri Nov 2 04:40:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- This interface is not matured and is not extensible.
- So that we don't guarantee the future compatibility of this method.
- Basically, you shouldn't use this method.
+ * test/ruby/test_process.rb (test_execopts_preserve_env_on_exec_failure):
+ use never existing file in the current temporary directory.
- * iseq.h: move ISEQ_MAJOR/MINOR_VERSION (and some definitions)
- from iseq.c.
+Fri Nov 2 04:23:20 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * encoding.c (rb_data_is_encoding), internal.h: added.
+ * tool/merger.rb: add feature to tag preview/rc.
- * 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().
+Fri Nov 2 03:23:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * insns.def: some check for lazy loading feature.
+ * lib/mkmf.rb: fix for if config["libdir"] is nil.
- * vm_insnhelper.c: ditto.
+Thu Nov 1 23:06:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * proc.c: ditto.
+ * tool/make-snapshot: fix wrong regexp for releasing preview.
+ patched by mame.
- * vm.c: ditto.
+Thu Nov 1 22:27:11 2012 Koichi Sasada <ko1@atdot.net>
- * test/lib/iseq_loader_checker.rb: enabled iff suitable
- environment variables are provided.
+ * NEWS: add a news about objspace,
+ ObjectSpace.reachable_objects_from.
- * test/runner.rb: enable lib/iseq_loader_checker.rb.
+Thu Nov 1 21:57:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * sample/iseq_loader.rb: add sample compiler and loader.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new),
+ test/bigdecimal/test_bigdecimal.rb:
+ Fix exception message of BigDecimal constructor with a Float.
- $ ruby sample/iseq_loader.rb [dir]
+Thu Nov 1 21:52:20 2012 Kenta Murata <mrkn@mrkn.jp>
- will compile all ruby scripts in [dir].
- With default setting, this compile creates *.rb.yarb files
- in same directory of target .rb scripts.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_add),
+ test/bigdecimal/test_bigdecimal.rb:
+ need to specify precision for converting Rational and Float.
+ [ruby-core:48045] [Bug #7176]
- $ ruby -r sample/iseq_loader.rb [app]
+Thu Nov 1 21:42:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
- will run with enable to load compiled binary data.
+ * test/ruby/test_process.rb: Revert r37404. My ubuntu box has
+ actually the directory named "/nonexistent"... Sorry.
-Tue Dec 8 21:21:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Thu Nov 1 21:28:28 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * NEWS: mention about Enumerator::Lazy#grep_v.
- [ruby-core:71845] [Feature #11773]
+ * test/ruby/test_process.rb: Process.exec raised EACCES on Linux
+ 3.5.0-17-generic. This is a temporal fix to rescue that exception.
+ Needs kosaki's review.
-Tue Dec 8 17:36:36 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+Thu Nov 1 21:19:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c: removed unused variable
+ * iseq.c (set_relation): parent_iseq need to be set regardless iseq
+ type. fix r37397.
-Tue Dec 8 16:23:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 1 19:47:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
- as Enumerable, to enumerate lazily.
- [ruby-core:71845] [Feature #11773]
+ * thread_pthread.c (RUBY_STACK_MIN): may not a compile time constant.
+ fix r37079. [ruby-dev:46322] [Bug #7247]
-Tue Dec 8 14:27:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 1 16:44:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * error.c (name_err_local_variables): new method
- NameError#local_variables for internal use only.
- [Feature #11777]
+ * NEWS: add note for Module#refine, Module#refinements,
+ Module#using, and Kernel#using.
-Tue Dec 8 14:20:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 1 14:41:47 2012 Shugo Maeda <shugo@ruby-lang.org>
- * marshal.c (w_objivar): skip internal instance variables in
- T_OBJECT too.
+ * eval.c (rb_using_module): using should be used indirectly.
+ [ruby-dev:46326] [Feature #7251]
-Tue Dec 8 12:58:04 2015 Naohisa Goto <ngotogenome@gmail.com>
+Wed Oct 31 18:17:38 2012 Narihiro Nakamura <authornari@gmail.com>
- * test/io/console/test_io_console.rb (test_getpass): s.getpass
- should be tested. Narrow ensure block. This reverts r52911.
- [Bug #11780] [ruby-dev:49412]
+ * gc.c (gc_profile_record): don't define unused variables when
+ GC_PROFILE_MORE_DETAIL is 0.
-Tue Dec 8 10:40:21 2015 Eric Wong <e@80x24.org>
+Wed Oct 31 18:10:53 2012 Narihiro Nakamura <authornari@gmail.com>
- * benchmark/bm_vm2_case_lit.rb: new benchmark
- * compile.c (case_when_optimizable_literal): add nil/true/false
- * insns.def (opt_case_dispatch): ditto
- * vm.c (vm_redefinition_check_flag): ditto
- * vm.c (vm_init_redefined_flag): ditto
- * vm_core.h: ditto
- * object.c (InitVM_Object): define === explicitly for nil/true/false
- * test/ruby/test_case.rb (test_deoptimize_nil): new test
- * test/ruby/test_optimization.rb (test_opt_case_dispatch): update
- (test_eqq): new test
- [ruby-core:71923] [Feature #11769]
- Original patch by Aaron Patterson <tenderlove@ruby-lang.org>
+ * gc.c (gc_prof_mark_timer_stop): count is not initialized.
-Tue Dec 8 10:19:02 2015 Jake Worth <jakeworth82@gmail.com>
+Wed Oct 31 09:28:24 2012 Eric Hodel <drbrain@segment7.net>
- * lib/optparse.rb: fix double word typo in the document.
- [Misc #10608] [Fix GH-1126]
+ * thread.c (rb_thread_call_without_gvl2): Note that ubf() may or may
+ not be called with the GVL. Hinted that rb_thread_call_with_gvl()
+ can be used to access ruby functionality.
-Tue Dec 8 09:03:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 31 09:06:54 2012 Eric Hodel <drbrain@segment7.net>
- * ext/date/date_core.c (d_lite_lshift): should check the argument
- before negation.
+ * thread.c (rb_thread_call_without_gvl2): Update documentation to
+ natural English.
+ * thread.c (rb_thread_call_with_gvl): ditto.
-Tue Dec 8 08:56:16 2015 Eric Wong <e@80x24.org>
+Wed Oct 31 02:53:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * insns.def (opt_case_dispatch): check Float#=== redefinition
- * test/ruby/test_optimization.rb (test_opt_case_dispatch): new
- [ruby-core:71920] [Bug #11784]
+ * ext/dl/lib/dl/struct.rb: fix strange require order. [ruby-dev:45702]
-Tue Dec 8 03:56:05 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/dl/lib/dl/value.rb: ditto
- * test/lib/iseq_loader_checker.rb: add iseq dumper/loader checker.
- If you enable this checker (remove `#' in test/runner.rb),
- you can see comparison results between an original iseq disassembed
- result and dumped and loaded iseq disassembed result.
+ * test/dl/test_c_struct_entry.rb: remove strange require order from
+ tests.
- There are several bugs around there, because of inexact stack depth
- calculation. Now, I leave these bugs because they are not critical
- and difficult to solve completely.
+ * test/dl/test_c_union_entity.rb: ditto
- * test/runner.rb: require test/lib/iseq_loader_checker.rb but
- disabled at default (commented out).
+Tue Oct 30 23:59:32 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Dec 8 03:45:47 2015 Eric Wong <e@80x24.org>
+ * eval.c (rb_mod_refine): fix the error message when no block is
+ given. [ruby-dev:46319] [Bug #7244]
- * doc/extension.rdoc: warn about kwargs performance in C
- [Feature #11339] [ci skip]
+ * test/ruby/test_refinement.rb: related test.
-Tue Dec 8 03:44:51 2015 Koichi Sasada <ko1@atdot.net>
+Tue Oct 30 19:27:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c (iseq_load): disable peephole optimization option
- because apply it multiple times change the sequence.
- (iseq != peephole_optimize(load(iseq.to_a)))
+ * process.c (redirect_dup2): set standard handles when new fd is stdio,
+ because if there is no allocated console at the moment Windows does
+ not automatically associate it for child process's standard handle.
+ this is adhoc workaround.
+ reported by Martin Thiede at [ruby-core:48542] [Bug #7239].
-Tue Dec 8 03:43:21 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (rb_cloexec_dup2): ditto.
- * compile.c (rb_iseq_build_from_ary): do not allocate table
- if table_size is 0.
+Tue Oct 30 03:08:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 8 03:30:34 2015 Eric Wong <e@80x24.org>
+ * lib/rbconfig/obsolete.rb (Config): re-introduce warnings for a
+ lame-duck. [ruby-core:46836] [Bug #6809]
- * ext/socket/unixsocket.c (unix_send_io): document args
- (unix_recv_io): ditto
- * test/socket/test_unix.rb (test_fd_passing_class_mode): added
+Tue Oct 30 02:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Dec 08 02:21:35 2015 Koichi Sasada <ko1@atdot.net>
+ * thread.c: added Thread#thread_variable_(get|set),
+ Thread#thread_variable?, and Thread#thread_variables for operating
+ on variables that are local to threads. [ruby-core:47790]
- * iseq.c (iseq_translate): at the end of constructing an iseq,
- call RubyVM::InstructionSequence.translate(iseq) if this method
- is defined. If the return value is also an object of
- RubyVM::InstructionSequence, then use it instead of created one.
+ * vm.c: ditto
- For example, this method is useful to test iseq dumper/loader
- such as RubyVM::InstructionSequence#to_a and rb_iseq_load().
+ * test/ruby/test_thread.rb: tests for thread variables.
- Because this method is for such internal experimental usage,
- the interface is not matured. For example, this interface has
- no extensibility. Two or more translators can not run
- simultaneously.
+Mon Oct 29 18:22:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- So that we don't guarantee future compatibility of this method.
- Basically, do not use this method.
+ * ext/stringio/stringio.c (strio_close): close separately per each
+ instances, as well as IO.
-Tue Dec 8 01:57:13 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Mon Oct 29 10:22:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/psych/*: update psych to 2.0.16
- * test/psych/*: ditto
+ * ext/psych/lib/psych/handlers/recorder.rb: added a class for
+ recording YAML parse and emit events.
-Mon Dec 7 23:45:20 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych/handler.rb: adding a list of events so that
+ handler classes can more easily be meta-programmed.
- * string.c: introduce String#+@ and String#-@ to control
- String mutability.
- [Feature #11782]
+ * test/psych/handlers/test_recorder.rb: tests for the change.
-Mon Dec 7 23:39:49 2015 Ben Miller <bjmllr@gmail.com>
+Mon Oct 29 05:48:52 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * parse.y: add heredoc <<~ syntax. [Feature #9098]
+ * lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyer.
+ Also accept {Open}Struct as argument to new.
+ Add #eql?, #hash & #each_pair
+ Protect new_ostruct_member
-Mon Dec 7 23:06:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Oct 29 03:20:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * prelude.rb (IO#read_nonblock): [DOC] add missing options to
- call-seq. [ruby-core:71627] [Bug #11730]
+ * lib/matrix.rb: Fix determinant_e [ruby-dev:46305] [Bug #7228]
-Mon Dec 7 15:50:50 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+Sun Oct 28 23:52:25 2012 Kouhei Sutou <kou@cozmixng.org>
- * .gitignore: added cygruby*.def for Cygwin
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-8 with BOM.
-Sun Dec 6 19:52:31 2015 Eric Wong <e@80x24.org>
+Sun Oct 28 23:47:09 2012 Kouhei Sutou <kou@cozmixng.org>
- * 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]
+ * lib/rexml/source.rb: Move encoding detection code to base class.
+ * lib/rexml/encoding.rb: Remove needless encoding detection code.
-Sun Dec 6 18:25:22 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Oct 28 21:40:13 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): gave up the test
- of binary path info test on Windows because the test had passed
- occasionally as the comment said.
+ * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is used
+ for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in
+ XML declaration.
+ * test/rexml/test_document.rb: Add tests for the above change.
-Sun Dec 6 15:25:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 28 21:37:34 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/io/console/console.c (console_getpass): add IO#getpass
- method.
+ * test/rexml/test_document.rb: Group tests that they parse
+ UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration.
-Sun Dec 6 08:39:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Oct 28 21:25:11 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
- upstream changes.
+ * lib/rexml/source.rb (REXML::IOSource#initialize): Reduce
+ @line_break initialize code. It should be done only in #encoding=.
+ * lib/rexml/parsers/baseparser.rb: Don't set UTF-16 encoding to
+ source by encoding="UTF-16" in XML declaration because UTF-16XX
+ source encoding should be set in Source#initialize or
+ IOSource#initialize. They should handle BOM. Parser should not
+ consider about it.
- https://github.com/ruby/ruby/commit/4d059bf9f5f10f3d3088de49fc87e5555db7770d
- https://github.com/flori/json/commit/d4c99de78905d96c3f301f48b2c789943bb3f098
+Sun Oct 28 21:18:37 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/json/lib/json/version.rb: ditto.
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-16 with BOM.
-Sat Dec 5 17:48:25 2015 Lars Kanis <lars@greiz-reinsdorf.de>
+Sun Oct 28 19:12:11 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * tool/fake.rb: Fix cross build when srcdir is an absolute path.
+ * ext/date/date_parse.c (iso8601_{ext,bas}_time): should not match
+ empty string.
- * Makefile.in: PREP dependency is needed when cross build too, not
- "-r$(arch)-fake" to be used before created. [Fix GH-1125]
+Sun Oct 28 18:51:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sat Dec 5 17:26:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
- * hash.c (env_str_new, env_path_str_new): make default string
- UTF-8 for the case conversion is not possible. [Bug #8822]
+Sun Oct 28 15:41:50 2012 Kouhei Sutou <kou@cozmixng.org>
- * hash.c (get_env_cstr): convert non-ASCII string to UTF-8 string.
+ * lib/rexml/document.rb (REXML::Document#write): Add :encoding option
+ to support custom XML encoding.
+ [Feature #4872] (work in progress)
+ * test/rexml/test_document.rb: Add tests for the above change.
- * hash.c (ruby_setenv): use wide char version to put environment
- variable to deal with non-ASCII value.
+Sun Oct 28 15:00:19 2012 Kouhei Sutou <kou@cozmixng.org>
-Sat Dec 5 09:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rexml/document.rb (REXML::Document#write): Remove needless
+ indent in document.
- * ruby_atomic.h (ATOMIC_CAS): old value to be swapped should be
- same as the destination. immediate value may need type
- promotion.
+Sun Oct 28 14:59:14 2012 Kouhei Sutou <kou@cozmixng.org>
- * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
- InterlockedCompareExchange64. new value and then old value is
- the last.
+ * lib/rexml/document.rb (REXML::Document#write): Accept options
+ Hash as argument.
+ * test/rexml/test_document.rb: Add tests for the above change.
-Sat Dec 5 09:23:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 28 14:09:44 2012 Kouhei Sutou <kou@cozmixng.org>
- * random.c (fill_random_seed): fix the size to be filled, not the
- size of element, but the whole size of array.
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong usage
+ in document.
-Sat Dec 5 06:03:54 2015 Eric Wong <e@80x24.org>
+Sun Oct 28 14:03:48 2012 Kouhei Sutou <kou@cozmixng.org>
- * vm.c (ruby_vm_verbose_ptr): make static
- (ruby_vm_debug_ptr): ditto
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong method
+ names in document.
-Sat Dec 5 00:56:29 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sun Oct 28 10:12:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * include/ruby/ruby.h (RB_OBJ_TAINT): follow-up of r52881.
- Turn into void expression not to use unexpected result.
- Fix "operands have incompatible types" error with
- Oracle Solaris Studio 12.x on Solaris.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
+ same thing on every call.
-Fri Dec 4 19:52:52 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * test/psych/visitors/test_yaml_tree.rb: related test.
- * enc/iso_8859_13.c: Added three missing lower/upper-case
- character pairs (from Kimihito Matsui)
+Sun Oct 28 10:05:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Dec 4 18:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
+ be able to take an emitter object as it's output.
- * enc/iso_8859_4.c: Added missing lower/upper-case character
- pair (U+014A and U+014B, LATIN CAPITAL/SMALL LETTER ENG)
- (from Kimihito Matsui)
+ * test/psych/visitors/test_yaml_tree.rb: related test.
-Fri Dec 4 16:48:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 28 08:23:16 2012 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_obj_as_string): fstring should not be infected.
- re-apply r52872 and fix a typo.
- TODO: other frozen strings also may not be.
+ * bignum.c (bignew_1): Bignum instances are frozen.
+ Feature #3222
-Fri Dec 4 15:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * include/ruby/ruby.h: Fixnum instances are also frozen.
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).
- this version includes #1396, #1397, #1398, #1399
- * test/rubygems: ditto.
+ * class.c (singleton_class_of): check Bignum before
+ singleton checking.
-Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_bignum.rb: add a test.
- * thread.c (rb_thread_setname): name must be ascii-compatible, as
- pthread APIs do not accept legacy wide char strings.
+ * test/ruby/test_fixnum.rb: ditto.
-Thu Dec 3 15:39:21 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb,
+ test/ruby/test_object.rb: catch up above changes.
- * lib/scanf.rb: fixed double words typo.
- [ci skip][fix GH-1123] Patch by @jwworth
+Sun Oct 28 04:38:06 2012 Koichi Sasada <ko1@atdot.net>
-Thu Dec 3 15:37:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm.c (vm_define_method): remove type and frozen checking.
+ Checking is done in `rb_singleton_class()'.
- * test/ruby/test_mixed_unicode_escapes.rb: fixed typo.
- [fix GH-1122] Patch by @davydovanton
- * test/ruby/test_object.rb: ditto.
- * test/socket/test_tcp.rb: ditto.
+Sun Oct 28 00:49:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 3 15:33:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (assign_in_cond): warn for static content object assignments
+ in conditional statements. [ruby-dev:43083] [Feature #4299]
- * sprintf.c (rb_str_format): fix wrong shifting position in
- Rational conversion when not at the beginning of the result.
- [ruby-core:71806] [Bug #11766]
+Sat Oct 27 23:33:41 2012 Benoit Daloze <eregontp@gmail.com>
-Thu Dec 3 14:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_profile_result, gc_profile_report): use internal structures
+ to avoid allocations and progressively print the output for #report.
+ [ruby-core:47163] [Bug #6865]
- * range.c (range_to_s): should be infected by the receiver.
- str2 infects by appending. [ruby-core:71811] [Bug #11767]
+Sat Oct 27 11:01:10 2012 Koichi Sasada <ko1@atdot.net>
-Thu Dec 3 11:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:
+ make all Float objects frozen.
+ [ruby-dev:46081] [ruby-trunk - Feature #6936]
+ Most part of patch by NARUSE, Yui <naruse@ruby-lang.org>.
- * configure.in: separate SET_CURRENT_THREAD_NAME, which can set
- the name of current thread only, and SET_ANOTHER_THREAD_NAME,
- which can set the name of other threads.
+ * class.c (singleton_class_of): raise TypeError when
+ trying to define a singleton method on Float objects.
- * thread.c (rb_thread_setname): use SET_ANOTHER_THREAD_NAME. OS X
- is not possible to set another thread name.
+ * vm.c (vm_define_method): ditto.
- * thread_pthread.c (native_set_thread_name, thread_timer): use
- SET_CURRENT_THREAD_NAME.
+ * test/ruby/marshaltestlib.rb: catch up above changes.
-Wed Dec 02 22:57:46 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_class.rb: ditto.
- * vm_core.h, iseq.h: remove rb_iseq_t::variable_body.
- Fields in rb_iseq_t::variable_body are contained by
- rb_iseq_t::body::mark_ary (hidden Array object).
+ * test/test_pp.rb: ditto.
- Index 0 to 2 of mark_ary are reserved by these objects.
+Sat Oct 27 10:50:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * iseq.c: catch up this fix.
+ * object.c (rb_mod_const_get): make sure the constant name is
+ converted to a string before searching. [ruby-core:48405]
- * compile.c (rb_iseq_original_iseq): trivial rewrite.
+Sat Oct 27 10:12:13 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Wed Dec 2 17:19:02 2015 Koichi Sasada <ko1@atdot.net>
+ * iseq.c (rb_iseq_compile_with_option): Instead of testing
+ respond_to, just check if the argument is actually a file,
+ because by calling user-defined gets something weired can
+ happen. Patch by Glass_saga. [ruby-dev:40202] [Bug #2861]
- * iseq.h: introduce ISEQ_ORIGINAL_ISEQ() and
- ISEQ_ORIGINAL_ISEQ_ALLOC() macro.
+ * parse.y (ripper_initialize): ditto.
- * compile.c: use them to access original iseq buffer.
+Sat Oct 27 10:07:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.c: ditto.
+ * parse.y (enum lex_state_e): [EXPERIMENTAL] lex_state as bit field /
+ IS_lex_state() macro. based on the patch by Dave B in
+ [ruby-core:23503]. [Feature #1493]
- * vm_core.h: rename iseq field to support this fix.
+Sat Oct 27 10:05:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 2 17:10:32 2015 Koichi Sasada <ko1@atdot.net>
+ * include/ruby/win32.h (fstat): use _fstati64() instead of fstati64()
+ on mingw32.
- * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro.
+Sat Oct 27 06:28:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * compile.c (iseq_compile_each): use it.
+ * object.c (rb_mod_const_get): const_get accepts qualified constant
+ strings. e.g. Object.const_get("Foo::Bar::Baz") [ruby-core:41404]
- * vm_core.h: rename flip_cnt field to support this fix.
+ * test/ruby/test_module.rb: tests for new behavior
-Wed Dec 2 17:05:15 2015 Koichi Sasada <ko1@atdot.net>
+Fri Oct 26 13:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro.
+ * parse.y (literal_concat_gen): merge fixed strings across
+ concatenated literals, after an interpolation.
- * compile.c: use them.
+Thu Oct 25 17:48:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c: ditto.
+ * win32/win32.c (has_redirection): should use shell (cmd.exe) when
+ the commandline contains '&'.
+ reported by Roger Pack at [ruby-core:47912] [Bug #7143], and
+ patched by Heesob Park at [ruby-core:47931].
- * iseq.c (rb_iseq_coverage): added.
+Thu Oct 25 15:00:08 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (update_coverage): use rb_iseq_coverage().
+ * include/ruby/ruby.h, class.c: remove (revert)
+ `rb_add_method_cfunc_frameless()' API.
+ This API is not mature to become an official API.
+ For example, we can not use this API with
+ `rb_define_private_method()'.
- * vm_core.h: rename coverage field name to support this fix.
+ * method.h, vm_method.c (rb_add_method_cfunc_frameless): removed.
-Wed Dec 2 17:00:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 25 13:35:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * encoding.c (enc_name, rb_enc_name_list_i, rb_enc_aliases_enc_i):
- make fstring instead of making each copies.
+ * tool/mkconfig.rb: remove string literal concatenation.
-Wed Dec 2 16:32:08 2015 Koichi Sasada <ko1@atdot.net>
+Wed Oct 24 18:49:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.h: introduce ISEQ_COMPILE_DATA() macro.
+ * ext/objspace/objspace.c (type2sym, count_objects_size): use enum
+ instead of size_t which may be larger than actual values.
- * compile.c, iseq.c: use ISEQ_COMPILE_DATA().
+Wed Oct 24 17:41:24 2012 Koichi Sasada <ko1@atdot.net>
- * vm_core.h: rename compile_data field to support this fix.
+ * benchmark/driver.rb: add `-x' or `--exclude' option
+ to specify exclude benchmark name pattern.
+ You can specify "-x foo" if you want to exclude the benchmarks
+ if the name of benchmark contains `foo'.
-Wed Dec 2 16:27:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 24 11:57:24 2012 Narihiro Nakamura <authornari@gmail.com>
- * encoding.c (enc_m_loader): defer finding encoding object not to
- be infected by marshal source. [ruby-core:71793] [Bug #11760]
+ * gc.c (gc_prepare_free_objects): rename to match the behavior of
+ this function.
- * 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.
+Wed Oct 24 11:55:19 2012 Koichi Sasada <ko1@atdot.net>
- * marshal.c (compat_allocator_table): initialize
- compat_allocator_tbl on demand.
+ * ext/objspace/objspace.c (reachable_object_from_i): change data
+ structure of the result of reachable objects. Keys of table
+ contains object_id of each reachable objects. Value of table
+ is an object itself or an instance of InternalObjectWrapper.
+ To avoid duplication, we use st_table and object_id keys.
- * object.c (rb_undefined_alloc): extract from rb_obj_alloc.
+ * ext/objspace/objspace.c (type2sym): bug fix.
+ Should use `i' instead of `type'.
-Wed Dec 2 15:12:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed Oct 24 10:33:09 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: Fixed double negative comments.
- [Bug #11698][ruby-core:71506]
+ * gc.c (garbage_collect, gc_marks): move the location of
+ clear and restore rb_objspace_t::mark_func_data
+ from garbage_collect() to gc_marks().
-Wed Dec 2 14:55:01 2015 yui-knk <spiketeika@gmail.com>
+Wed Oct 24 10:17:45 2012 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_string.rb: removed non executing tests.
- [Misc #11757][ruby-dev:49397]
+ * ext/objspace/objspace.c (Init_objspace): add a new method
+ `ObjectSpace::InternalObjectWrapper#internal_object_id' which returns
+ an object id of a wrapped internal object.
-Wed Dec 2 11:23:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed Oct 24 08:55:04 2012 Koichi Sasada <ko1@atdot.net>
- * lib/csv.rb: enable frozen_string_literal.
- [fix GH-1116] Patch by @marshall-lee
+ * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):
+ internal object support.
+ If given object `obj' has references to internal objects
+ (such as T_NODE objects), then this method returns instances of
+ `ObjectSpace::InternalObjectWrapper' instead of that internal objects.
+ This instance contains a reference to an internal object and you can
+ check the type of internal object using
+ `ObjectSpace::InternalObjectWrapper#type' method.
+ Rdoc of `InternalObjectWrapper' is not prepared yet.
-Wed Dec 2 10:36:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * gc.c (rb_objspace_reachable_objects_from), gc.h: change
+ an interface of 'rb_objspace_reachable_objects_from()'
- * ext/bigdecimal/bigdecimal.c: Fix double word typo.
- [ci skip][fix GH-1120] Patch by @jwworth
+ * gc.c, gc.h: add two APIs
+ - rb_objspace_markable_object_p(obj): check markable or not.
+ - rb_objspace_internal_object_p(obj): check internal or not.
-Wed Dec 2 07:43:51 2015 Eric Wong <e@80x24.org>
+Wed Oct 24 05:52:36 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_ssl.c (mSSLExtConfig): make static
- (eSSLError): ditto
- (ID_callback_state): ditto
- (ossl_ssl_ex_vcb_idx): ditto
- (ossl_ssl_ex_store_p): ditto
- (ossl_ssl_ex_ptr_idx): ditto
- * ext/openssl/ossl_ssl.h: remove extern declarations for
- mSSLExtConfig and eSSLError
+ * vm_insnhelper.c (vm_call_method): remove `default' and
+ add a case for `VM_METHOD_TYPE_UNDEF'.
-Wed Dec 2 07:41:08 2015 Eric Wong <e@80x24.org>
+Wed Oct 24 05:41:18 2012 Koichi Sasada <ko1@atdot.net>
- * missing/explicit_bzero.c (explicit_bzero): fixup r52839
- for compilers with "weak" attribute
+ * eval_error.c (error_print), vm_eval.c (eval_string_with_cref),
+ vm_trace.c (rb_suppress_tracing): use TH_PUSH_TAG() instead of
+ PUSH_TAG().
-Wed Dec 2 06:47:25 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Oct 24 05:17:52 2012 Koichi Sasada <ko1@atdot.net>
- * missing/explicit_bzero.c: add ruby_explicit_bzero_hook_unused
- for preventing optimization. Inspired from OpenBSD.
+ * vm_eval.c (vm_call0_body): remove RUBY_VM_CHECK_INTS()
+ after method invocation using rb_call0().
-Tue Dec 1 23:36:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): remove default section on top of
+ switch statement and add cases for `VM_METHOD_TYPE_CFUNC_FRAMELESS'
+ and `VM_METHOD_TYPE_UNDEF'.
- * thread.c (rb_thread_setname): allow to reset thread name.
+ * vm_eval.c (vm_call0_body): remove useless brackets.
-Tue Dec 1 23:14:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 23 22:34:49 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (rb_thread_setname): check the argument if valid
- string. [ruby-core:71774] [Bug #11756]
+ * thread.c (thread_raise_m): check interrupts after Thread#raise
+ if a target thread is the current thread because the behavior
+ of Thread.current.raise is expected to perform same as
+ Kernel.raise (by rubyspec).
-Tue Dec 1 17:13:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 23 17:08:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_string_value_cstr): should not raise on frozen
- string.
+ * ruby.c (usage, process_options): show more info in --help.
+ [EXPERIMENTAL] [ruby-core:48072] [Bug #7184]
-Tue Dec 1 09:35:29 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 14:20:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * missing/explicit_bzero.c: add a few comment.
+ * misc/ruby-electric.el using variable `last-command-event' instead of
+ obsolete `last-command-char', so that work with Emacs trunk.
+ a patch by Victor Deryagin <vderyagin AT gmail.com>.
-Tue Dec 1 09:31:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 14:06:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * missing/explicit_bzero.c: add disabling optimization on gcc.
+ * configure.in (visibility_option): visibility attribute is not
+ available before GCC 4, so do not use -fvisibility option in that
+ case. [ruby-core:48147] [Bug #7205]
-Tue Dec 1 07:50:33 2015 Eric Wong <e@80x24.org>
+Tue Oct 23 12:57:29 2012 Koichi Sasada <ko1@atdot.net>
- * missing/explicit_bzero.c: new file. define explicit_bzero.
- Fixup r52806
+ * vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):
+ add a new optimization and its macro `OPT_CALL_CFUNC_WITHOUT_FRAME'.
+ This optimization makes all cfunc method calls `frameless', which
+ is faster than ordinal cfunc method call.
+ If `frame' is needed (for example, it calls another method with
+ `rb_funcall()'), then build a frame. In other words, this
+ optimization delays frame building.
+ However, to delay the frame building, we need additional overheads:
+ (1) Store the last call information.
+ (2) Check the delayed frame building before the frame is needed.
+ (3) Overhead to build a delayed frame.
+ rb_thread_t::passed_ci is storage of delayed cfunc call information.
+ (1) is lightweight because it is only 1 assignment to `passed_ci'.
+ To achieve (2), we modify GET_THREAD() to check `passed_ci' every
+ time. It causes 10% overhead on my environment.
+ This optimization only works for cfunc methods which do not need
+ their `frame'.
+ After evaluation on my environment, this optimization does not
+ effective every time. Because of this evaluation results, this
+ optimization is disabled at default.
-Thu Oct 22 12:54:43 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c, vm.c: add VM_PROFILE* macros to measure behaviour
+ of VM internals. I will extend this feature.
- * thread_pthread.c (register_ubf_list): renamed from
- add_signal_thread_list.
- * thread_pthread.c (unregister_ubf_list): renamed
- from remove_signal_thread_list.
- * thread_pthread.c (ubf_wakeup_all_threads): renamed from
- ping_signal_thread_list.
- * thread_pthread.c (ubf_wakeup_thread): renamed from
- ubf_select_each.
- * thread_pthread.c (ubf_threads_empty): renamed from
- check_signal_thread_list().
- * thread_pthread.c (ubf_list_lock): renamed from
- signal_thread_list_lock.
+ * vm_method.c, method.h: change parameters of the `invoker' function.
+ Receive `func' pointer as the first parameter.
- * thread_pthread.c (register_ubf_list): large simplification
- by using ccan/list.h.
- bonus: removed malloc() and exit(EXIT_FAILURE).
- * thread_pthread.c (unregister_ubf_list): ditto.
- * thread_pthread.c (ubf_threads_empty): ditto.
- * thread_pthread.c (ubf_wakeup_all_threads): ditto.
+Tue Oct 23 06:21:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * thread_pthread.c (print_signal_list): removed.
+ * ext/psych/parser.c: just get the constant defined in Ruby.
-Thu Oct 22 08:03:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/lib/psych/syntax_error.rb: Psych::SyntaxError now inherits
+ from StandardError rather than SyntaxError. Thanks Eric Hodel!
- * test/ruby/test_rand.rb (TestRand#test_default_seed): add
- srand case.
+ * test/psych/test_exception.rb: tests for change.
-Thu Oct 22 06:33:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 06:17:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * random.c (InitVM_Random): move Random::DEFAULT initialization
- bits to Init_Random_default.
- * random.c (Init_Random_default): renamed from Init_RandomSeed2.
- * random.c (Init_RandomSeedCore): renamed from Init_RandomSeed.
+ * ext/psych/lib/psych/scalar_scanner.rb: Cache symbols while
+ tokenizing. Thanks Kevin Menard!
-Thu Oct 22 06:20:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 06:15:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * random.c (Init_RandomSeed): move all Random::DEFAULT
- construction bits to Init_RandomSeed2. Random::DEFAULT
- and Ruby internal hashes are no longer shared their seed.
- * random.c (Init_RandomSeed2): ditto. And, kill evil
- rb_obj_reveal() stuff.
+ * ext/psych/lib/psych/scalar_scanner.rb: Updated the RegExp to catch
+ Strings earlier in the tokenization process. Thanks Kevin Menard!
- * random.c (init_hashseed): add MT argument.
- * random.c: (init_siphash): ditto.
+Tue Oct 23 06:12:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/ruby/test_rand.rb (TestRand#test_default_seed): new
- test for Random::DEFAULT::seed.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Handle nil tags specially
+ to avoid slow method_missing calls. Thanks Kevin Menard!
-Thu Oct 22 05:23:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 06:07:57 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * random.c (init_hashseed, init_siphash): extract initialize
- functions.
+ * ext/psych/lib/psych/scalar_scanner.rb: Ignore bad timestamps. If
+ something looks like a timestamp but has an invalid component, treat
+ it as a string instead of throwing an ArgumentError.
+ Thanks Rhett Sutphin!
-Thu Oct 22 01:01:34 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/psych/test_scalar_scanner.rb: appropriate tests.
- * configure.in: sort AC_CHECK_HEADERS() by alphabetical order.
+Tue Oct 23 06:04:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Oct 22 00:19:07 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/lib/psych/scalar_scanner.rb: Fix scalar_scanner to
+ understand strings starting with an underscore and containing only
+ digits. Thanks Kelley Reynolds.
- * random.c (init_randomseed): remove "initial" argument. It never
- be used from outside of this function.
+ * test/psych/test_scalar_scanner.rb: test for fix
-Thu Oct 22 00:12:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 06:00:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
- for initialize OpenSSL's rand.
+ * ext/psych/lib/psych.rb: Changed comment in psych.rb to update new
+ home page for libyaml. Thanks to Carolyn Ann.
-Wed Oct 21 12:10:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Oct 21 19:12:59 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
- be return -1 as an error. Therefore, added error handling.
- * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto.
+ * vm_core.h (rb_vm_t::trace_running): add a new field
+ `trace_running' to store vm global tracing status.
-Wed Oct 21 09:04:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_trace.c: fix SEGV bug. event_hook was free'd
+ even when the hook is still used in another thread.
+ [ruby-dev:46141] [Bug #7032]
- * include/ruby/util.h: remove a warning suppression C4723
- (potential divide by zero) for VisualC++. It's meaningless.
- Before r26197, there is ruby_div0() in this place and it
- actually made divide by zero. But now it's just garbage.
+Sun Oct 21 19:12:42 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Oct 21 08:23:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h (rb_vm_t::trace_flag): remove `trace_flag'
+ which is no longer used.
- * random.c: random_raw_seed don't use GRND_NONBLOCK. GRND_NONBLOCK
- mean the result might not have an enough cryptic strength and
- easy predictable. That's no good for SecureRandom.
+Sun Oct 21 18:34:27 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sun Oct 18 17:26:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/date/date_parse.c (date__parse): uses more tight parser if
+ defined TIGHT_PARSER. now inactivated; because it introduces
+ incompatibilities and it is a bit slow.
- * common.mk: add a rule for explicit_bzero.o.
- * configure.in: detect explicit_bzero and memset_s.
- * include/ruby/missing.h: add explicit_bzero.
- * random.c (init_randomseed): use explicit_bzero() instead of
- memset(). memset could be eliminated by compiler optimization.
+Sat Oct 20 15:35:06 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon Nov 30 18:46:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * include/ruby/ruby.h: add C APIs.
+ VALUE rb_newobj_of(VALUE klass, VALUE flags)
+ #define NEWOBJ_OF(obj,type,klass,flags)
+ These allow to change a allocation strategy depending on klass
+ or flags.
- * ext/readline/extconf.rb: call dir_config("libedit")
- if --enable-libedit is specified. [Bug #11751]
- patched by John Hein
+ * gc.c: ditto
-Mon Nov 30 08:44:29 2015 Eric Wong <e@80x24.org>
+ * array.c: use new C API.
+ * bignum.c: ditto
+ * class.c: ditto
+ * complex.c: ditto
+ * ext/socket/ancdata.c: ditto
+ * ext/socket/option.c: ditto
+ * hash.c: ditto
+ * io.c: ditto
+ * marshal.c: ditto
+ * numeric.c: ditto
+ * object.c: ditto
+ * random.c: ditto
+ * range.c: ditto
+ * rational.c: ditto
+ * re.c: ditto
+ * string.c: ditto
+ * struct.c: ditto
+ [Feature #7177][Feature #7047]
- * variable.c: remove spurious #define for globals
- [ruby-core:71735] [Feature #11749]
+Sat Oct 20 12:50:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sun Nov 29 09:13:03 2015 Conor Landry <clandry94@gmail.com>
+ * ext/socket/socket.c: Documentation for Socket
+ Based on a patch by David Albert
+ [Bug #7105] [ruby-core:47828]
- * NEWS: [DOC] Various grammar corrections and clarifications to
- increase readability. [Fix GH-1115]
+Sat Oct 20 11:00:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Sat Nov 28 19:33:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/open-uri.rb: Documentation for OpenURI
- * parse.y (parser_here_document): store dispatched result of
- on_tstring_content at the last fragment of a here document.
+Sat Oct 20 06:18:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Nov 27 19:19:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * hash.c (initialize_copy): unset the default proc if there isn't one
+ for the target hash, call to_hash, check frozen status.
- * lib/net/http.rb (connect): detect closed connection and reconnect
- If the server closes a keep-alive http connection, the client socket
- reaches EOF. To avoid an EOFError, detect the closed connection and
- reconnect.
- Added test to ensure HTTP#post succeeds even if the
- keep-alive-connection has been closed by the server.
- by Kristian Hanekamp <kris.hanekamp@gmail.com>
- https://github.com/ruby/ruby/pull/1089 fix GH-1089
+Fri Oct 19 22:22:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 26 21:36:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects.
+ [ruby-dev:46234] [Bug #7185]
- * compile.c (iseq_peephole_optimize): enable tail call
- optimization for specialized indexers.
+ * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and
+ rb_vm_jump_tag_but_local_jump() just jump tag.
- * compile.c (iseq_compile_each): blockiseq should be NULL, but not
- Qnil.
+Fri Oct 19 22:11:55 2012 Benoit Daloze <eregontp@gmail.com>
-Thu Nov 26 17:22:53 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * pack.c (pack_unpack): set encoding of the
+ 'H','h','B' and 'B' modifiers to US-ASCII.
- * regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
- Merge Onigmo 58fa099ed1a34367de67fb3d06dd48d076839692
- + https://github.com/k-takata/Onigmo/pull/52
+ * test/ruby/test_pack.rb: tests for the above.
+ [ruby-core:47653][Bug #7050]
-Thu Nov 26 09:50:02 2015 yui-knk <spiketeika@gmail.com>
+ * test/test_securerandom.rb: tests for SecureRandom.hex
+ from tenderlove. [ruby-core:46792][Bug #6799]
- * test/coverage/test_coverage.rb: Added test-case for Coverage.restart.
- [Misc #11732][ruby-dev:49379]
+Fri Oct 19 19:29:11 2012 Koichi Sasada <ko1@atdot.net>
-Thu Nov 26 09:46:36 2015 yui-knk <spiketeika@gmail.com>
+ * method.h (rb_method_cfunc_t::invoker): add new field (func ptr)
+ `invoker'. `invoker' function invoke cfunc body
+ (rb_method_cfunc_t::func).
+ `invoker' is set at method definition timing.
+ With this change, the big `switch' (branch) in `call_cfunc()'
+ is no longer needed.
+ However, the performance benefit is only a bit.
- * test/coverage/test_coverage.rb: Added test-case for Coverage.peek_result
- without Coverage.start. [Misc #11726][ruby-core:71622]
+ * vm_core.h (rb_call_info_t::aux::func): add a new field to store
+ cfunc body function pointer.
-Thu Nov 26 07:22:55 2015 Eric Wong <e@80x24.org>
+ * vm_method.c (call_cfunc_invoker_func): add a new function which
+ returns a suitable invoke function.
- * test/openssl/test_ssl.rb (test_copy_stream): new test
+ * vm_method.c (setup_method_cfunc_struct): added.
-Wed Nov 25 21:23:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (rb_add_method): fix to set `invoker'.
- * io.c (copy_stream_body): try to_io conversion before read,
- readpartial, and write methods. [ruby-dev:49008] [Bug #11199]
+ * vm_eval.c (vm_call0_body): catch up above changes.
-Wed Nov 25 10:55:21 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_insnhelper.c (call_cfunc): removed.
- * io.c (argf_getpartial): should not resize str if the second
- argument is not given.
- [ruby-core:71668] [Bug #11738]
+ * vm_insnhelper.c (vm_call_cfunc): fix to call cfunc body
+ with `invoker' function.
-Tue Nov 24 23:56:25 2015 Naohisa Goto <ngotogenome@gmail.com>
+Fri Oct 19 16:55:58 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
- when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile).
+ * eval.c, vm_eval.c: use TH_PUSH_TAG() instead of PUSH_TAG().
-Tue Nov 24 10:00:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Fri Oct 19 11:13:55 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems/installer.rb: Fix two double-word typos.
- [ci skip][fix GH-1108] Patch by @jwworth
+ * benchmark/driver.rb: remove unexpected `output'.
+ (commit miss)
-Tue Nov 24 09:17:02 2015 Alexander von Gluck IV <kallisti5@unixzen.com>
+Fri Oct 19 10:24:03 2012 Koichi Sasada <ko1@atdot.net>
- * beos: Drop support for BeOS now that Haiku is stable.
- [Fix GH-1112]
+ * vm_insnhelper.c (vm_search_method): remove needless local variable.
-Tue Nov 24 09:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 19 10:22:26 2012 Koichi Sasada <ko1@atdot.net>
- * internal.h (rb_gc_for_fd): move to export, as referred by
- ext/socket.
+ * benchmark/bmx_temp.rb: removed.
+ This file should not be in repository.
-Tue Nov 24 09:04:29 2015 David Rodriguez <deivid.rodriguez@gmail.com>
+Fri Oct 19 10:20:10 2012 Koichi Sasada <ko1@atdot.net>
- * file.c: [DOC] add a missing period to File docs, to terminate
- the sentence and separate from the next sentence. [Fix GH-1111]
+ * benchmark/driver.rb: add new option `--ruby-arg [ARG]'
+ which is passed as a launch parameter for each ruby's execution.
+ ($ ruby [ARG] [File])
-Tue Nov 24 08:30:06 2015 JuanitoFatas <katehuang0320@gmail.com>
+Thu Oct 18 18:42:35 2012 Koichi Sasada <ko1@atdot.net>
- * NEWS: Fix the issue number of `Struct#dig`, which should be
- [Feature #11688]. [Fix GH-1110]
+ * insns.def (opt_send_simple): move the location of
+ `opt_send_simple' to the place near `send' definition.
+ (to take care about icache locality).
-Tue Nov 24 07:56:54 2015 Eric Wong <e@80x24.org>
+Thu Oct 18 18:29:25 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/init.c (rsock_s_accept): handle ENOMEM
+ * insns.def (send): remove unused condition.
+ This condition will be true after r37258.
-Tue Nov 24 07:50:15 2015 Eric Wong <e@80x24.org>
+ * vm_insnhelper.c (vm_caller_setup_args): remove `UNLIKELY' on
+ checking blockiseq (it seems `LIKELY').
- * 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]
+Thu Oct 18 17:31:58 2012 Koichi Sasada <ko1@atdot.net>
-Tue Nov 24 06:46:27 2015 Eric Wong <e@80x24.org>
+ * insns.def (opt_send_simple): introduce new instruction used
+ when no need to care about block and splat.
- * io.c (rb_gc_for_fd): new helper function
- (ruby_dup): use rb_gc_for_fd
- (rb_sysopen): ditto
- (rb_fdopen): ditto
- (rb_pipe): ditto
- [ruby-core:71623] [Feature #11727]
+ * compile.c: use the `opt_send_simple' instruction.
-Tue Nov 24 05:13:35 2015 Eric Wong <e@80x24.org>
+Thu Oct 18 16:44:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * 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
+ * vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless):
+ check arity earlier at definition time.
-Mon Nov 23 19:53:12 2015 Naohisa Goto <ngotogenome@gmail.com>
+Thu Oct 18 15:11:31 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: On Solaris, with gcc, "-std=iso9899:1999"
- in $ansi_options is often also needed in CPPFLAGS,
- because some feature definitions vary depending on such
- standards options.
+ * vm_insnhelper.c: add `inline' keyword to several functions.
+ Compilers (gcc) are conservative than I expected.
-Mon Nov 23 12:54:39 2015 Hamish Morrison <hamishm53@gmail.com>
+Thu Oct 18 15:01:15 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: remove obsolete workarounds for Haiku.
+ * include/ruby/ruby.h: add a decl. of
+ `rb_define_frameless_method()'.
- * dln.c, file.c, io.c: remove obsolete Haiku workarounds.
+Thu Oct 18 14:31:17 2012 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c: add stack bounds detection for Haiku.
+ * compile.c (new_callinfo): set a temporary index of callinfo
+ (used in `iseq_set_sequence()') to rb_call_info_t::aux::index.
+ rb_call_info_t::argc is initialized by same value of
+ rb_call_info_t::orig_argc.
- * signal.c: get stack pointer from signal context on Haiku.
- [ruby-core:67923] [Bug #10811] [Fix GH-1109]
+Thu Oct 18 14:11:08 2012 Koichi Sasada <ko1@atdot.net>
-Mon Nov 23 11:44:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * class.c (rb_define_frameless_method): rename from
+ rb_define_method_fast(). Defined method with this C API
+ does not make a method frame. It is bit lightweight than
+ ordinal C functions. Now only 0 or 1 argc are permitted.
- * gems/bundled_gems: bump version to minitest-5.8.3
+ * method.h (VM_METHOD_TYPE_CFUNC_FRAMELESS): rename macro name
+ from VM_METHOD_TYPE_CFUNC_FAST.
-Mon Nov 23 08:55:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm_insnhelper.c, vm_method.c: rename related functions.
- * ChangeLog: fix wrong reference for r52714
+ * proc.c (rb_method_entry_arity): catch up above changes.
-Sun Nov 22 22:23:37 2015 Rei Odaira <Rei.Odaira@gmail.com>
+Thu Oct 18 10:30:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_raw_obj_info): fix compile errors when USE_RGENGC
- is 0.
+ * parse.y (assignable_gen): fail if yyerror occurred. fix a bug in
+ r36973.
-Sun Nov 22 21:58:09 2015 Naohisa Goto <ngotogenome@gmail.com>
+Thu Oct 18 09:23:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/cmath.rb: methods which has suffix '!' are now deprecated.
- Re-apply r52469 made by Kazuki Tanaka, with fixing bug about
- mathn.rb compatibility. [ruby-core:68528] [Feature #10974]
+ * hash.c (initialize_copy): duping should rehash the hash.
-Sun Nov 22 19:36:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * test/ruby/test_hash.rb: added a test to ensure rehash.
- * ext/openssl/ossl.c: fix brew command for installation of openssl.
- [ci skip][fix GH-1107] Patch by @arthurnn
+Wed Oct 17 21:16:47 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun Nov 22 17:59:50 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * common.mk (WPROGRAM): need same dependencies as PROGRAM.
- * configure.in: On Solaris, add -D_XOPEN_SOURCE=n only when both
- AC_TRY_CPP and AC_TRY_COMPILE pass, because some options
- (e.g. -std=iso9899:1999) are not set when running C preprocessor
- or building ext.
+ * cygwin/GNUmakefile.in (uncommon.mk): move include position
+ below WPROGRAM definition to be defined in uncommon.mk.
-Sun Nov 22 16:53:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/extmk.rb (all, static): fix make rubyw.exe failure with make -jN.
+ If make of ruby.exe and rubyw.exe run in parallel, link dll and link
+ exe run in parallel, which causes link failure on mingw. To fix this,
+ we make ruby.exe and rubyw.exe in one make process.
+ [ruby-core:48007] [Bug #7165]
- * compile.c (iseq_peephole_optimize): remove unreachable code
- chunk after jump/leave.
+Wed Oct 17 16:25:34 2012 Koichi Sasada <ko1@atdot.net>
- * parse.y: move dead code elimination of logical operation to
- compile.c. not to warn logical operation of literal constants.
+ * benchmark/bm_vm2_method_missing.rb: add a benchmark to measure
+ performance of invoking `method_missing'.
-Sun Nov 22 16:37:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 17 16:23:17 2012 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_peephole_optimize): eliminate always/never
- branches after a literal object and when the value is used after
- the branch.
+ * vm_insnhelper.c (vm_getivar): fix to use `aux.index' instead of
+ `aux.opt_pc'.
-Sun Nov 22 01:23:43 2015 Naohisa Goto <ngotogenome@gmail.com>
+Wed Oct 17 16:03:54 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
- if available, mainly for enabling some features in sockets.
+ * vm_insnhelper.c (vm_call_method_missing): make a refactoring
+ about method_missing process. Use `vm_call_method()' to invoke
+ `method_missing' method instead of `rb_funcall2()'.
+ In `vm_call_method()', set fastpath to `vm_call_method_missing()'
+ if it can be cached.
-Sun Nov 22 00:17:22 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * vm_core.h (rb_call_info_t): add new field
+ `rb_call_info_t::aux::missing_reason' to pass the reason to
+ `vm_call_method_missing()'.
- * test/socket/test_socket.rb (test/socket/test_socket.rb): skip
- the test when Socket::SO_TIMESTAMP is not defined. Fix error
- on Solaris 10. [Bug #11728] [ruby-dev:49377]
+Wed Oct 17 15:33:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 21 18:57:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (opt-dir): allow multiple directories separated by
+ $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868]
+ [Bug #7120]
- * ruby.c (need_argument): move frozen-string-literal-debug option
- from --enable to --debug. [Feature #11725]
+Wed Oct 17 15:08:13 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ruby.c (proc_options): fix pointer overrun. do not advance argv
- until it is valid.
+ * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept
+ message/delivery-status ([ruby-core:47920] [Bug #7146]),
+ message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and
+ (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]).
+ patched by Tony Arkles.
-Sat Nov 21 13:59:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/net/imap/test_imap_response_parser.rb: related test.
- * ext/digest/sha1/extconf.rb: OpenSSL's struct name for SHA1 is
- SHA_CTX. http://openssl.org/docs/man0.9.8/crypto/SHA1.html
+Wed Oct 17 11:04:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 21 13:31:52 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_hash.rb (TestHash#test_dup_equality): added a new test
+ to show the problem of r37232.
- * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
- including ext/digest/extconf.h. [Bug #3231]
- https://msdn.microsoft.com/library/36k2cdd4.aspx
+Wed Oct 17 10:48:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/digest/*/extconf.rb: remove ext/digest from include search path
- to avoid confusion of cl.exe.
+ * vm_insnhelper.c (vm_search_method): fix a build error that occurs
+ when OPT_INLINE_METHOD_CACHE is 0.
- * ext/digest/*/*.[ch]: explicitly specify def.h's path.
+Wed Oct 17 08:46:47 2012 Koichi Sasada <ko1@atdot.net>
-Sat Nov 21 13:05:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * benchmark/bm_vm2_dstr.rb: add a benchmark to measure
+ performance of dynamic generated string ("foo#{bar}baz").
- * ext/openssl/ossl.h: LibreSSL doesn't have and need e_os2.h.
+Wed Oct 17 08:32:46 2012 Koichi Sasada <ko1@atdot.net>
-Sat Nov 21 09:18:10 2015 Koichi Sasada <ko1@atdot.net>
+ * compile.c (compile_dstr_fragments): use `putobject' instead of
+ `putstring' for all of strings used by NODE_DSTR because
+ ruby users can not grab this string.
+ For example, the string object of "baz" in "foo#{bar}baz"
+ is located by `putobject' (users can not touch "baz" object
+ directly). This change reduces GC pressure.
+ This improvement is suggested by Aaron Patterson.
- * thread_sync.c: reduce the specification of Queue#close.
- * Queue#close accepts no arguments.
- * deq'ing on closed queue returns nil, always.
- [Feature #10600]
+Wed Oct 17 08:02:57 2012 Koichi Sasada <ko1@atdot.net>
- * test/thread/test_queue.rb: catch up this fix.
+ * thread.c (rb_threadptr_interrupt_mask): fix to check interrupt
+ after interrupt_mask changed.
-Sat Nov 21 08:44:21 2015 Koichi Sasada <ko1@atdot.net>
+Wed Oct 17 06:42:47 2012 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_compile_each): add debug information to NODE_STR
- strings as default.
- [Feature #11725]
+ * vm_insnhelper.c (vm_call_method): fix to return value immediately.
+ Remove CHECK_INTS() after that method dispatch.
- * insns.def (freezestring): add new instruction to support adding
- debug information for dynamically constructed strings.
+Wed Oct 17 06:25:56 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * compile.c (iseq_compile_each): support adding debug information
- for NODE_DSTR with freezestring instruction.
+ * hash.c (initialize_copy): copy the underlying st_table on dup,
+ rather than copying the hash key by key. [ruby-core:48009]
- * error.c (rb_error_frozen): change the debug information ID name
- id_debug_created_info and this field should have a 2 element array
- containing path and line information.
+ * test/ruby/test_hash.rb: relevant tests for initialize_copy
- * defs/id.def: ditto.
+Wed Oct 17 06:17:44 2012 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_rubyoptions.rb: catch up this fix.
+ * vm_insnhelper.c (vm_call_iseq_setup_2): separate tailcall and normal
+ method frame setup functions.
+ Add checking interrupts at the tailcall setup function.
- * test/ruby/test_iseq.rb: now frozen strings are not same.
+Wed Oct 17 05:35:37 2012 Koichi Sasada <ko1@atdot.net>
-Sat Nov 21 04:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield'
+ (invoke empty block) performance.
- * symbol.c (rb_str_intern): should not freeze the receiver itself
- unexpectedly. [ruby-core:71611] [Bug #11721]
+ * benchmark/bm_vm2_method_with_block.rb: add a benchmark to measure
+ method invocation with empty block.
-Fri Nov 20 23:15:18 2015 Naotoshi Seo <sonots@gmail.com>
+Wed Oct 17 05:05:07 2012 Koichi Sasada <ko1@atdot.net>
- * lib/logger.rb: expose logger mutex
- [fix GH-541] Patch by @arthurnn
+ * vm_insnhelper.c (vm_invoke_block): vm_caller_setup_args() can skip
+ when splat flag is not set.
-Fri Nov 20 15:05:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed Oct 17 01:53:47 2012 Koichi Sasada <ko1@atdot.net>
- * Added missing reference of GitHub
+ * vm_insnhelper.c (vm_getivar, vm_setivar): support index inline cache
+ with rb_call_info_t to speedup `attr' getter and setter.
+ Cached index is stored in rb_call_info_t::aux::index.
+ `index' == 0 means not cached. `index' > 0 means cached and cached
+ index is `index - 1'.
-Fri Nov 20 14:57:01 2015 Trevor Rowe <trevorrowe@gmail.com>
+ * insns.def ((get|set)instancevariable): use new wrapper functions
+ vm_(get|set)instancevariable() defined in vm_insnhelper.c.
- * lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100"
- header. [fix GH-949]
- * test/net/http/test_http.rb: added test.
+ * vm_core.h (rb_call_info_t::aux): introduce new union data because
+ opt_pc can share with index.
-Fri Nov 20 14:39:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Oct 16 22:24:44 2012 Koichi Sasada <ko1@atdot.net>
- * lib/net/http.rb: set hostname before call ossl_ssl_set_session.
- [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek
+ * benchmark/driver.rb (show_results): Show speedup ratio
+ with first executables score at last of results
+ if two or more executables are given.
-Fri Nov 20 12:53:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Oct 16 21:59:01 2012 Koichi Sasada <ko1@atdot.net>
- * array.c: clarify docs for take_while/drop_while samples.
- [ci skip][fix GH-1028] Patch by @leriksen
+ * benchmark/driver.rb: some refactoring.
+ (1) Remove `average differential'.
+ In this benchmark driver, We should not care about `average'.
+ We use fastest score because this score should not include
+ any disturbances (affections of background process, etc).
+ If you care about timing affect, I recommend `median'
+ score with more than 5 examinations rather than simple
+ `average' score (`average' score was affected by error scores).
+ (2) Show log file name.
+ (3) Change default directory from './' to driver's directory.
-Fri Nov 20 12:48:04 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c: remove mention of :UNIX in getaddrinfo().
- It's typically not a support option.
- [ci skip][fix GH-990] Patch by @eam
+ * file.c (rb_file_join): need to check again after any conversion run.
+ [ruby-core:48012] [Bug #7168]
-Fri Nov 20 12:44:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Oct 16 12:52:14 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/rss/syndication.rb: Add nodoc marker for #validate_sy_updatePeriod.
- [ci skip][fix GH-1105] Patch by @davydovanton
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
+ rename from file_assertion.
-Fri Nov 20 09:05:21 2015 Koichi Sasada <ko1@atdot.net>
+Tue Oct 16 11:30:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (rb_vm_cref_replace_with_duplicated_cref): added.
+ * file.c (rb_file_join): hide the result under construction until
+ return.
- CREFs should not be shared by methods between `using'.
- [Bug #11247]
+ * file.c (rb_file_join): check nul-byte only for strings, since
+ FilePathStringValue() does it. [ruby-core:48012] [Bug #7168]
- * vm_insnhelper.c (vm_cref_replace_with_duplicated_cref): ditto.
+ * file.c (rb_file_join): path names must be ASCII-compatible.
+ [ruby-core:48012] [Bug #7168]
- * vm.c (vm_cref_dup): should copy refinements correctly.
+ * file.c (check_path_encoding): new function to ensure path name
+ encoding to be ASCII-compatible.
- * eval.c: use rb_vm_cref_replace_with_duplicated_cref().
+Tue Oct 16 09:40:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval_intern.h: add a decl. of
- rb_vm_cref_replace_with_duplicated_cref().
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): use
+ Regexp.new instead of literal to ignore a parser warning.
- * vm_eval.c (eval_string_with_cref): do not need to pass
- scope's CREF because VM can find out CREF from stack frames.
+Tue Oct 16 09:30:30 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_refinement.rb: add a test.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): ignoring
+ warnings are already set in setup method.
-Fri Nov 20 06:52:53 2015 Eric Wong <e@80x24.org>
+Tue Oct 16 06:44:06 2012 Koichi Sasada <ko1@atdot.net>
- * .gitattributes: new file for git users
- [ruby-core:71578] [Feature #11713]
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): fix wrong condition.
-Thu Nov 19 22:35:31 2015 Tanaka Akira <akr@fsij.org>
+Tue Oct 16 06:29:18 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/ancdata.c: Check buffer full and ignore MSG_TRUNC flag.
- buffer fullness is more robust to detect the message is too big for
- the buffer.
- AIX 7.1 recvmsg doesn't set MSG_TRUNC for rflags when MSG_PEEK is
- given.
+ * vm_insnhelper.c (vm_call_method): disable CI_SET_FASTPATH() if
+ this method call needs splat argument because cached functions
+ (vm_call_attrset, vm_call_ivar, vm_call_cfunc_fast_(unary|binary))
+ do not check an arity.
-Thu Nov 19 21:55:11 2015 Koichi Sasada <ko1@atdot.net>
+ * bootstraptest/test_method.rb: add a test to check an above issue.
- * gc.c (gc_start): force to invoke GC by GC.start
- even if it is GC.disable'd.
+Tue Oct 16 06:15:44 2012 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_gc.rb: add a test.
+ * method.h: introduce new method type VM_METHOD_TYPE_CFUNC_FAST.
+ This method is similar to VM_METHOD_TYPE_CFUNC methods, but
+ called cfunc without building new frame (does not push new control
+ frame). If error is occurred in cfunc, the backtrace only shows
+ caller frame and upper.
+ This kind of methods can be added by rb_define_method_fast().
+ This feature is similar to specialized instructions (opt_plus, etc),
+ but more flexible (but a bit slower).
-Thu Nov 19 20:08:59 2015 Koichi Sasada <ko1@atdot.net>
+ * class.c (rb_define_method_fast): added.
+ Maybe it will be renamed soon.
- * gc.c: trivial performance improvements.
+ * vm_insnhelper.c (vm_call_method): support method type
+ VM_METHOD_TYPE_CFUNC_FAST.
- name modified
- vm1_gc_short_lived* 1.015
- vm1_gc_short_with_complex_long* 1.014
- vm1_gc_short_with_long* 1.000
- vm1_gc_short_with_symbol* 1.016
- vm1_gc_wb_ary* 1.002
- vm1_gc_wb_ary_promoted* 0.996
- vm1_gc_wb_obj* 1.045
- vm1_gc_wb_obj_promoted* 1.014
- vm3_gc 1.021
+ * proc.c (rb_method_entry_arity): catch up new method type.
- * gc.c (gc_writebarrier_generational): reorder parameters to optimize
- register passing function call.
+ * vm_method.c (rb_add_method_cfunc_fast): added.
- * gc.c (gc_writebarrier_incremental): ditto.
+Tue Oct 16 02:32:29 2012 Koichi Sasada <ko1@atdot.net>
- * gc.c (rb_gc_writebarrier): remove LIKELY().
- LIKELY() seems to move related functions not better places.
+ * vm_insnhelper.h (CI_SET_FASTPATH): add new parameter `enabled'.
+ If `enable' is 0 then CI_SET_FASTPATH() doesn't work.
+ And add new configuration option OPT_CALL_FASTPATH. If this macro
+ was defined by 0, then CI_SET_FASTPATH() doesn't work any more.
-Thu Nov 19 19:45:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): Pass `0' for `enabled' parameter
+ of CI_SET_FASTPATH if this method is protected.
- * ruby.c (ruby_prog_init): [DOC] ARGV does not contain the name of
- the executable. [ruby-core:71561] [Bug #11711]
+Tue Oct 16 02:17:35 2012 Koichi Sasada <ko1@atdot.net>
-Thu Nov 19 15:53:21 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_core.h (VM_CALL_*): rename VM_CALL_*_BIT
+ to VM_CALL_* (remove `_BIT' suffix).
+ Add comments on each macros.
+ Remove unused macro VM_CALL_TAILRECURSION_BIT.
- * signal.c: should also clear ruby_disable_gc.
- [Bug #11692]
+ * compile.c, iseq.c, insns.def, vm_insnhelper.c: ditto.
-Thu Nov 19 15:31:45 2015 Koichi Sasada <ko1@atdot.net>
+Mon Oct 15 22:14:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (iseq_compile_each): T_IMEMO/iseq objects should be
- wrap with ISeq wrappers. [Bug #11676]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#file_assertion):
+ rewrite file assertions.
-Thu Nov 19 15:16:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Oct 15 09:41:17 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(c6b4946).
- this version includes #1114, #1314, #1322, #1375, #1383, #1387
- * test/rubygems: ditto.
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): skip CI_SET_FASTPATH() if
+ it was called from vm_yield_setup_args().
-Thu Nov 19 14:14:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 15 05:20:13 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (finish_overlapped_socket): return value of this
- function should be only 0 or SOCKET_ERROR.
+ * vm_insnhelper.h CI_SET_FASTPATH: introduce new macro
+ `CI_SET_FASTPATH(ci, func)'. This macro set `ci->call' as `func'.
+ `func' (ci->call) is called at the last of `send'
+ (and `invokesuper') instruction.
+ `CI_SET_FASTPATH' does not set `ci->call' when the method
+ (stored in `ci->me') is `protected'.
-Thu Nov 19 14:12:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): use `CI_SET_FASTPATH'.
+ After several checking (visibility, argc checking), the result of
+ checking can be reused until re-definition of this method
+ with inline method cache.
- * compile.c (iseq_tailcall_optimize): apply tail call optimization
- before conversion to specialized instructions. when looking
- back from `leave` instruction, `send` instructions have been
- translated already.
+ Note that this optimization is now experimental.
+ If you find any problem about it, please tell us.
-Thu Nov 19 13:57:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 15 04:51:55 2012 Koichi Sasada <ko1@atdot.net>
- * win32/win32.c (finish_overlapped_socket): ignore EMSGSIZE when input,
- because POSIX platforms just do so. fixes test errors revealed by
- r52647.
+ * vm_insnhelper.c: refactoring.
+ - move all `call' related functions to the last of file.
+ - make functions for respective method types in vm_call_method().
+ (all functions have same function parameters)
-Thu Nov 19 02:52:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_core.h: add `opt_pc' field in `rb_call_info_t'
+ as temporal variable.
- * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
- only when vmaxdatlen is nil.
+ * vm_eval.c (vm_call0_body): catch up above changes.
-Thu Nov 19 02:20:11 2015 Tanaka Akira <akr@fsij.org>
+Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net>
- * test/socket/test_socket.rb (test_udp_recvmsg_truncation): rflags is
- nil on Solaris 10 which have no HAVE_STRUCT_MSGHDR_MSG_CONTROL.
- Reported by Naohisa Goto. [ruby-core:71557] [Bug #11709]
+ * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed).
-Thu Nov 19 01:48:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * benchmark/bm_vm1_float_simple.rb: added (for flonum/float).
- * configure.in: add -static-libgcc for mingw automatically if available.
+Mon Oct 15 02:51:16 2012 Koichi Sasada <ko1@atdot.net>
-Thu Nov 19 00:53:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): add new function.
+ `vm_call0()' makes call_info struct and calls `vm_call0_body()'
+ with this struct. In near future, `vm_call0()' will be removed
+ because all of `vm_call0()' users setup call_info struct by itself.
- * ext/extmk.rb (--extflags): new option to pass EXTLDFLAGS to children,
- especially exts.mk.
+Mon Oct 15 01:38:06 2012 Koichi Sasada <ko1@atdot.net>
- * common.mk (EXTMK_ARGS): use above option.
+ * insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:
+ use only a `ci' (rb_call_info_t) parameter instead of using
+ parameters such as `op_id', 'op_argc', `blockiseq' and flag.
+ These information are stored in rb_call_info_t at the compile
+ time.
+ This technique simplifies parameter passing at related
+ function calls (~10% speedups for simple method invocation at
+ my machine).
+ `rb_call_info_t' also has new function pointer variable `call'.
+ This `call' variable enables to customize method (block)
+ invocation process for each place. However, it always call
+ `vm_call_general()' at this changes.
+ `rb_call_info_t' also has temporary variables for method
+ (block) invocation.
-Wed Nov 18 22:50:43 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP
+ VM_CALL macro. This flag indicates that this call can skip
+ caller_setup (block arg and splat arg).
- * vm_method.c (rb_class_clear_method_cache): should clear all
- RCLASS_CALLABLE_M_TBLs of all sub-classes (T_ICLASS).
+ * compile.c: catch up above changes.
- RCLASS_CALLABLE_M_TBL() caches complemented method entries.
- It should be cleared when the modules are cleared.
- On previous version clears only for direct children.
- It is enough for normal modules because corresponding T_ICLASSes
- are direct children.
+ * iseq.c: catch up above changes (especially for TS_CALLINFO).
- However, refinements create complex data structure. So that
- we need to clear all children (and descendants).
- [ruby-core:71423] [Bug #11672]
+ * tool/instruction.rb: catch up above changes.
- * vm_method.c (rb_clear_method_cache_by_class): rb_mKernel
- doesn't call rb_class_clear_method_cache, so that
- clear child T_ICLASSes.
+ * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions
+ parameters are changed.
- * test/ruby/test_refinement.rb: enable disabled test.
+ * vm_eval.c (vm_call0): ditto (it will be rewritten soon).
-Wed Nov 18 21:09:08 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 14 12:30:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c (prepare_callable_method_entry): use
- RCLASS_CALLABLE_M_TBL() instead of accessing a filed directly.
+ * ruby.c (rb_f_sub, rb_f_gsub): pass the given block.
+ [ruby-core:47967] [Bug #7157]
-Wed Nov 18 17:08:18 2015 Koichi Sasada <ko1@atdot.net>
+Sat Oct 13 23:15:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * method.h: introduce the following field and macros.
+ * regparse.c (parse_char_class): should match with a hyphen after a
+ range in a character class.
- * rb_method_definition_t::complemented_count to count shared method
- entries because of complemented method entries and separate from
- alias_count.
+ * test/ruby/test_regexp.rb (TestRegexp#test_char_class): fixed wrong
+ test.
- Shared `def' only by complemented method entries should not prevent
- method re-definition warning.
+ * test/ruby/test_regexp.rb (TestRegexp#check): now can accept the
+ error message.
- * METHOD_ENTRY_COMPLEMENTED(me) to represent complemented method entry.
- * METHOD_ENTRY_COMPLEMENTED_SET(me) to check it as complemented me.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): renamed
+ because the previous name was wrong.
- * vm_insnhelper.c (aliased_callable_method_entry): should also
- check me->def->complemented_count.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): added
+ more test pattern.
- * vm_method.c (method_definition_addref_complement): add to count
- complemented method entries number.
+Sat Oct 13 03:01:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c (rb_method_definition_release): release `def' iff
- alias_count == 0 and complemented_count == 0.
+ * file.c (realpath_rec): prevent link from GC while link_names refers
+ the content.
- * test/ruby/test_module.rb: add a test.
+Sat Oct 13 01:37:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Nov 18 17:06:19 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_regexp.rb
+ (TestRegexp#test_raw_hyphen_and_type_char_after_range): added new
+ test. ref [ruby-core:47115] [Backport #6853]
- * gc.c (rb_raw_obj_info): fix trivial issues.
+Fri Oct 12 21:55:08 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * support SPECIAL_CONSTs.
- * fix IMEMO/ment outputs.
+ * include/ruby/win32.h (rb_w32_pow): set floating point precision
+ for mingw-w64 x86 pow(). This improves the precision of pow() on
+ Windows XP for TestFloat#test_round_with_precision failure.
+ [ruby-core:47911] [Bug #7142]
-Wed Nov 18 11:32:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 12 21:37:25 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * compile.c (iseq_peephole_optimize): eliminate always/never
- branches after a literal object. this sequence typically
- appears by defined? operator for a method call on a local
- variable.
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test
+ depending on locale on Windows. ENV[] doesn't work properly if
+ console code page is not equal to file system encoding.
+ [ruby-core:47910] [Bug #7140]
-Wed Nov 18 10:33:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 12 20:40:29 2012 Tanaka Akira <akr@fsij.org>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
- when EMSGSIZE occurs on non HAVE_STRUCT_MSGHDR_MSG_CONTROL platforms
- (such as, Windows). fixes a test error revealed by r52625.
+ * process.c (posix_sh_cmds): the command name of colon is ":".
-Wed Nov 18 10:12:36 2015 Eric Wong <e@80x24.org>
+Fri Oct 12 18:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): use 4096 as
- default size to match pre-r52610, which also maps to a common
- page size.
+ * file.c (rb_get_path_check): path name must not contain NUL bytes.
-Wed Nov 18 10:05:25 2015 Shugo Maeda <shugo@ruby-lang.org>
+Fri Oct 12 16:06:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * doc/syntax/refinements.rdoc: update documentation to reflect
- recent changes.
- [ci skip] [ruby-core:71466] [Misc #11681] Patch by James Adam
+ * tool/merger.rb: now can merge revision(s) without --ticket again.
-Wed Nov 18 09:50:21 2015 Naotoshi Seo <sonots@gmail.com>
+Fri Oct 12 14:10:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/logger/test_logdevice.rb: Fix tests of logger to make it work on
- windows (windows can not remove opened file) [Bug #11702]
+ * lib/mkmf.rb (dir_config, init_mkmf): use configured libdir value as
+ default library path. [ruby-core:43726] [Bug #6207]
-Wed Nov 18 06:59:52 2015 Eric Wong <e@80x24.org>
+Fri Oct 12 05:25:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): grow buffer
- on unspecified maxdatlen
- [ruby-core:71517] [Bug #11701]
- * ext/socket/lib/socket.rb (Socket#recvmsg): nil default for dlen
- (Socket#recvmsg_nonblock): ditto
- * test/socket/test_socket.rb (test_recvmsg_udp_no_arg): new test
+ * lib/timeout.rb (timeout):
+ Remove paragraph on wrong implementation detail.
+ [ruby-core:47739] [Bug #7088]
-Tue Nov 17 19:50:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 11 23:09:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (fstat): declare for mingw.
+ * string.c (rb_str_sub{seq,pos,str}, rb_str_each_{line,codepoint}):
+ prevent String copies from GC. [ruby-core:47881] [Bug #7135]
-Tue Nov 17 19:02:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 11 07:40:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (BASERUBY): use Kernel#print instead of Kernel#p because
- the baseruby may output CRLF as end of line.
+ * iseq.c (insn_operand_intern): cast op to rb_call_info_t* before
+ compare with iseq->callinfo_entries whose type is rb_call_info_t*.
-Tue Nov 17 15:34:34 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * NEWS: Added update from Unicode 7.0.0 to 8.0.0 [ci skip]
+Thu Oct 11 03:37:08 2012 Koichi Sasada <ko1@atdot.net>
-Tue Nov 17 15:30:30 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * enc/unicode/casefold.h, name2ctype.h: Change Unicode
- Version for regular expressions from 7.0.0 to
- 8.0.0 (with help from Kimihito Matsui) [Feature #11563]
+ * bootstraptest/test_block.rb: add tests for block with super.
-Tue Nov 17 14:36:00 2015 Kenichi Kamiya <kachick1@gmail.com>
+Thu Oct 11 02:54:07 2012 Koichi Sasada <ko1@atdot.net>
- * lib/ostruct.rb (dig): Implement OpenStruct#dig
- [Feature #11688]
+ * vm_dump.c: fix debug prints to catch up recent changes
+ such as VM data structures.
-Tue Nov 17 14:04:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 11 02:50:34 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values
- of clen must be nil.
+ * iseq.c (insn_operand_intern): add support disasm TS_CALLINFO
+ operands.
- * ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen.
- fixes test errors introduced at r52602.
+Wed Oct 10 15:12:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Nov 17 13:43:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_process.rb (TestProcess#test_execopts_gid): skip on
+ windows because the platform does not have Process.group method.
+ patched by Jon Forums in [ruby-core:47878] [Bug #7133].
- * ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
- install error on Windows, introduced at r52601.
+Tue Oct 9 23:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 17 11:27:23 2015 Eric Wong <e@80x24.org>
+ * test/ruby/envutil.rb (assert_file, assert_file_not): more
+ descriptive assertions for File predicates.
- * ext/socket/lib/socket.rb (Socket#recvfrom_nonblock):
- UDPSocket#recvfrom_nonblock):
- update doc for `exception: false` and destination buffer
- [ruby-core:69542] [Feature #11229]
- [ruby-core:69543] [Feature #11242]
+Tue Oct 9 18:01:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 17 11:25:05 2015 Eric Turner <ericturnerdev@gmail.com>
+ * array.c (rb_ary_sample): use rb_random_ulong_limited, since
+ precision of long may be larger than double.
- * array.c (rb_ary_dig), hash.c (rb_hash_dig): [DOC] Update
- comments describing dig methods. [Fix GH-1103]
+ * random.c (rb_random_ulong_limited): new function to return a random
+ value from 0 upto limit as unsigned long, similarly to
+ rb_genrand_ulong_limited but with arbitrary RNG object.
- * struct.c (rb_struct_dig): [DOC] add rdoc.
+Tue Oct 9 17:13:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 17 11:22:22 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * NEWS: Small grammatical fix [ci skip]
+ * process.c (rb_execarg_addopt, rb_execarg_run_options): add :uid and
+ :gid options. [ruby-core:47414] [Feature #6975]
-Tue Nov 17 10:12:30 2015 Eric Wong <e@80x24.org>
+Tue Oct 9 14:36:11 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/lib/socket.rb (Socket.accept_loop): avoid exceptions
- (Socket.udp_server_recv): ditto
+ * iseq.c (iseq_free): fix memory leak.
+ rb_iseq_t::callinfo_entries should be freed.
-Tue Nov 17 09:59:00 2015 Eric Wong <e@80x24.org>
+Tue Oct 9 14:28:18 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/ancdata.c (bsock_sendmsg_internal): avoid arg parsing
- [ruby-core:71439] [Feature #11339]
- (rsock_bsock_sendmsg): make private, adjust for above
- (rsock_bsock_sendmsg_nonblock): ditto
- * ext/socket/rubysocket.h: adjust prototypes
- (rsock_opt_false_p): remove
- * ext/socket/basicsocket.c (rsock_init_basicsocket):
- define private methods
- * ext/socket/lib/socket.rb (BasicSocket#sendmsg): new wrapper
- (BasicSocket#sendmsg_nonblock): ditto
+ * vm_core.h (rb_call_info_t): add new type `rb_call_info_t'.
+ This data structure contains information including inline method
+ cache. After that, `struct iseq_inline_cache_entry' does not
+ need to contain inline cache for method invocation.
+ Other information will be added to this data structure.
-Tue Nov 17 09:45:18 2015 Eric Wong <e@80x24.org>
+ * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size'
+ members to `rb_iseq_t'.
- * ext/socket/ancdata.c (bsock_recvmsg_internal): avoid arg parsing
- (rsock_bsock_recvmsg): adjust for above change
- (rsock_bsock_recvmsg_nonblock): ditto
- [ruby-core:71439] [Feature #11339]
- * ext/socket/rubysocket.h: adjust prototypes for above
- * ext/socket/basicsocket.c (rsock_init_basicsocket):
- adjust private methods
- * ext/socket/lib/socket.rb (BasicSocket#recvmsg): wrapper method
- (BasicSocket#recvmsg_nonblock): ditto
+ * insns.def, compile.c: Use CALL_INFO instead of IC.
-Tue Nov 17 08:36:34 2015 Eric Wong <e@80x24.org>
+ * tool/instruction.rb: support CALL_INFO as operand type.
- * ext/socket/init.c (rsock_s_accept_nonblock): avoid parsing args
- [ruby-core:71439] [Feature #11339]
- * ext/socket/rubysocket.h: adjust prototype
- * ext/socket/socket.c (sock_accept_nonblock): make private
- * ext/socket/tcpserver.c (tcp_accept_nonblock): ditto
- * ext/socket/unixserver.c (unix_accept_nonblock): ditto
- * ext/socket/lib/socket.rb (Socket#accept_nonblock):
- implement as wrapper, move RDoc
- (TCPServer#accept_nonblock): ditto
- (UNIXServer#accept_nonblock): ditto
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
-Tue Nov 17 08:25:57 2015 Eric Wong <e@80x24.org>
+Sun Oct 7 23:54:33 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/socket/socket.c (sock_connect_nonblock):
- avoid argument parsing in C.
- [ruby-core:71439] [Feature #11339]
- * ext/socket/lib/socket.rb (Socket#connect_nonblock):
- new wrapper for private method, move RDoc
+ * ext/zlib/zlib.c (zstream_run_func): don't call inflate() when
+ z->stream.avail_in == 0. it return Z_BUF_ERROR.
+ but deflate() could be called with z->stream->avail_in == 0 because
+ it has hidden buffer in z->stream->state (opaque structure).
+ fix for gem install error. [ruby-dev:46149] [Bug #7040]
-Tue Nov 17 08:16:09 2015 Eric Wong <e@80x24.org>
+Mon Oct 8 23:55:41 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/socket/init.c (rsock_s_recvfrom_nonblock):
- avoid arg parsing with C API
- [ruby-core:71439] [Feature #11339]
- * ext/socket/basicsocket.c (bsock_recv_nonblock):
- adjust for above change, make private
- * ext/socket/socket.c (sock_recvfrom_nonblock): ditto
- * ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
- * ext/socket/lib/socket.rb (BasicSocket#recv_nonblock):
- new wrapper for private method, move RDoc
- (Socket#recvfrom_nonblock): ditto
- (UDPSocket#recvfrom_nonblock): ditto
+ * eval.c (rb_mod_refinements): new method Module#refinements.
-Mon Nov 16 21:27:54 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
- * test/dtrace/helper.rb (Dtrace::TestCase#trap_probe): dtrace buffer
- size is set as 8m on Solaris (default 4m). [Bug #11697]
+Mon Oct 8 23:02:19 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Nov 16 20:03:14 2015 Naotoshi Seo <sonots@gmail.com>
+ * eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,
+ vm_method.c: rename omod and overlaid modules to refinements.
- * lib/logger.rb: Add Logger#reopen
+ * eval.c (hidden_identity_hash_new): renamed from identity_hash_new.
-Mon Nov 16 18:21:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * object.c (rb_obj_dig): dig in nested structs too.
+ * lib/abbrev.rb: Documentation examples for Abbrev.
+ [ruby-core:47442] [Bug #6985]
- * struct.c (rb_struct_dig): new method Struct#dig.
- [Feature #11688]
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Mon Nov 16 17:41:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_aref):
+ Grammar in Thread documentation.
+ Patch by Steve Klabnik [ruby-core:47799] [Bug #7099]
- * compile.c (iseq_peephole_optimize): optimize tail calls on aref
- and aset specialized instructions.
+Sun Oct 7 04:37:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * compile.c (iseq_peephole_optimize): optimize replaced leave
- instruction copied to jump instruction too.
+ * string.c (rb_str_match):
+ Clarify behavior for captured strings and local variable assignment
+ Patch by Marcus Stollsteimer [ruby-core:47668] [Bug #7062]
-Mon Nov 16 16:39:38 2015 Akinori MUSHA <knu@iDaemons.org>
+Sat Oct 6 18:31:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/set.rb: Enable frozen_string_literal.
+ * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to
+ enable/disable global method caching. [ruby-dev:46203] [Bug #7111]
- * lib/set.rb: Move << out of the begin block that ensures pop.
+ * vm_method.c (rb_method_entry_get_with_omod): don't use global
+ method cache if OPT_GLOBAL_METHOD_CACHE is 0.
-Mon Nov 16 16:28:30 2015 Akinori MUSHA <knu@iDaemons.org>
+Sat Oct 6 16:32:04 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/set.rb (Hash#flatten!, #add?, #delete?, #collect!, #reject!,
- #select!, #^, #classify): Micro-optimize some methods for
- performance and readability.
+ * vm_method.c (search_method): check omod only once for performance.
-Mon Nov 16 16:17:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Oct 6 09:42:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ChangeLog: fixed accidentally commit.
+ * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide
+ UTF encodings are dummy but Unicode.
-Mon Nov 16 16:10:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * encoding.c (rb_encdb_set_unicode): set Unicode flag.
- * mkconfig.rb: Add some high-level documentation.
- [ci skip][fix GH-1081] Patch by @ulfalizer
+ * template/encdb.h.tmpl: allow ENC_DUMMY variants.
-Mon Nov 16 15:59:14 2015 yui-knk <spiketeika@gmail.com>
+ * encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag.
- * proc.c: Add call-seq of `Method#super_method`
- [ci skip][fix GH-1094]
+Fri Oct 5 17:18:42 JST 2012 TAKANO Mitsuhiro <tak@no32.tk>
-Mon Nov 16 15:58:39 2015 Kenichi Kamiya <kachick1@gmail.com>
+ * template/Doxyfile.tmpl: remove SHOW_DIRECTORIES and
+ HTML_ALIGN_MEMBERS lines. They have been obsolete in
+ Doxygen version 1.8.2.
- * struct.c: Standardize a method signature of Struct#[]=.
- [ci skip][fix GH-1095]
+Fri Oct 5 15:26:18 2012 Koichi Sasada <ko1@atdot.net>
-Mon Nov 16 15:42:36 2015 Akinori MUSHA <knu@iDaemons.org>
+ * ext/objspace/objspace.c: add ObjectSpace#reachable_objects_from.
+ This method returns an array of objects referenced by given object.
+ If given object is special objects such as true/false/nil/Fixnum etc
+ then it returns nil. See rdoc for details.
+ [ruby-core:39772]
- * lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, and
- #<= when comparing against an instance of the same kind.
+ * test/objspace/test_objspace.rb: add a test for this method.
-Mon Nov 16 15:37:11 2015 Naotoshi Seo <sonots@gmail.com>
+ * gc.c: add rb_objspace_reachable_objects_from().
+ To make this function, add several member `mark_func_data'
+ to rb_objspace_t. If mark_func_data is not null, then
+ gc_mark() calls mark_func_data::mark_func.
- * lib/logger.rb: Support symbol and string log level setting
+ * gc.h: export rb_objspace_reachable_objects_from().
-Mon Nov 16 15:33:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Oct 4 23:40:04 2012 Narihiro Nakamura <authornari@gmail.com>
- * tool/rbinstall.rb: fix wrong permission for gem specification without
- zlib runtime. [Bug #11685][ruby-dev:49343]
+ * gc.c (init_heap): call init_mark_stack before to allocate
+ altstack. This change avoid the stack overflow at the signal
+ handler on 32bit, but I don't understand reason... [Feature #7095]
-Mon Nov 16 12:11:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Oct 4 22:39:27 2012 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/httpauth/basicauth.rb: fix a typo.
- [ci skip][fix GH-1099] Patch by @jwworth
- * lib/webrick/httpauth/digestauth.rb: ditto.
+ * insns.def (getlocal, setlocal): remove old getlocal/setlocal
+ instructions and rename getdaynmic/setdynamic instructions
+ to getlocal/setlocal.
-Sun Nov 15 18:28:43 2015 Kenichi Kamiya <kachick1@gmail.com>
+ * compile.c: ditto.
- * vm_method.c (set_method_visibility): should fail if the receiver
- is frozen. [ruby-core:71489] [Bug #11687]
+ * iseq.c: remove TS_DINDEX.
-Sat Nov 14 22:15:07 2015 Tanaka Akira <akr@fsij.org>
+ * vm_exec.h (dindex_t): remove type definition of `dindex_t'.
- * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
+ * tool/instruction.rb: ditto.
-Sat Nov 14 21:44:56 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 4 21:44:17 2012 Koichi Sasada <ko1@atdot.net>
- * lib/time.rb: Use "<<" to reduce string allocation.
+ * vm.c (vm_analysis_insn|operand|register): use st_insert
+ instead of using rb_hash_aset() because rb_hash_aset()
+ check $SAFE.
-Sat Nov 14 17:45:49 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 4 21:15:26 2012 Koichi Sasada <ko1@atdot.net>
- * lib/tsort.rb: Specify frozen_string_literal: true.
+ * vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysis
+ hooks (old macro name is COLLECT_USAGE_ANALYSIS).
+ This feature is only for VM developers. (I'm not sure I can use
+ `VM developers' (the plural form) in this sentence).
+ If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following
+ usage collection features:
+ (1) instruction: collect instruction usages.
+ (2) operand: collect operand usages.
+ (3) register: collect register usages.
+ The results are stored in
+ RubyVM::USAGE_ANALYSIS_INSN for (1, 2),
+ RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and
+ RubyVM::USAGE_ANALYSIS_REGS for (3).
+ You can stop collecting usages with
+ RubyVM::USAGE_ANALYSIS_INSN_STOP(),
+ RubyVM::USAGE_ANALYSIS_OPERAND_STOP(),
+ RubyVM::USAGE_ANALYSIS_REGISTER_STOP()
+ for (1), (2), (3) respectively.
+ You can also change the hook functions by setting
+ C level global variables
+ `ruby_vm_collect_usage_func_(insn|operand|register)'
+ for (1), (2), (3) respectively.
+ See codes for more details.
-Sat Nov 14 17:25:15 2015 Tanaka Akira <akr@fsij.org>
+ * tool/instruction.rb: fix macro names.
- * lib/resolv-replace.rb: Specify frozen_string_literal: true.
+ * iseq.c (insn_operand_intern): make it export (used in vm.c).
+ fix to skip several processes if not needed (pointer is 0).
-Sat Nov 14 17:00:13 2015 Tanaka Akira <akr@fsij.org>
+ * vm_dump.c: move codes for collection features to vm.c.
- * lib/time.rb: Specify frozen_string_literal: true.
+ * vm_exec.h: rename macro and function names.
-Sat Nov 14 16:43:02 2015 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.h: ditto.
- * lib/open3.rb: Specify frozen_string_literal: true.
+Thu Oct 4 18:59:14 2012 Koichi Sasada <ko1@atdot.net>
-Sat Nov 14 05:04:09 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_settracefunc.rb (test_tracepoint):
+ remove unused test case.
+ (this test case is redefined by newer tests)
- * node.h: remove old comments.
+Thu Oct 4 17:24:51 2012 Narihiro Nakamura <authornari@gmail.com>
-Sat Nov 14 04:55:36 2015 Koichi Sasada <ko1@atdot.net>
+ * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects
+ at suitable point.
- * refactoring CREF related code.
+Thu Oct 4 16:31:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_intern.h: remove unused setter functions.
- CREF_CLASS_SET()
- CREF_NEXT_SET()
- CREF_SCOPE_VISI_COPY()
+ * gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers
+ before run finalizers, to fix SEGV from btest on 32bit.
- * eval_intern.h: rename flags:
- * NODE_FL_CREF_PUSHED_BY_EVAL_ -> CREF_FL_PUSHED_BY_EVAL
- * NODE_FL_CREF_OMOD_SHARED_ -> CREF_FL_OMOD_SHARED
- and use IMEMO_FL_USER1/2.
+ * gc.c (gc_mark_stacked_objects): extract from gc_marks().
- * vm.c (vm_cref_new): accept push_by_eval parameter.
+Thu Oct 4 11:43:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (vm_cref_new_use_prev): added for rb_vm_rewrite_cref().
+ * thread_pthread.c (ruby_init_stack): round stack limit to page size
+ boundary to calculate stack size more precisely. [ruby-dev:46174]
+ [Bug #7084]
- * vm_insnhelper.c (vm_cref_push): accept pushed_by_eval parameter.
+Wed Oct 3 19:51:57 2012 Narihiro Nakamura <authornari@gmail.com>
- * vm_insnhelper.h: remove unused macros:
- COPY_CREF_OMOD() and COPY_CREF().
+ * gc.c: Use the non-recursive marking instead of recursion. The
+ recursion marking of CRuby needs checking stack overflow and the
+ fail-safe system, but these systems not good at partial points,
+ for example, marking deep tree structures. [ruby-dev:46184]
+ [Feature #7095]
- * vm_eval.c, insns.def: catch up this fix.
+ * configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by
+ checking stack overflow of marking.
-Sat Nov 14 02:58:03 2015 Koichi Sasada <ko1@atdot.net>
+ * win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto.
- * vm.c (vm_define_method): refactoring.
- * get CREF in this function.
- * cbase is no longer needed (CREF_CLASS(cref) is enough).
+Wed Oct 3 15:33:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c: RubyVM::FrozenCore.define_method only accept 2 args.
+ * thread_pthread.c (ruby_init_stack): use getrlimit() for the main
+ thread on Mac OS X, since pthread_get_stack{addr,size}_np()
+ return the default value always, but not the ulimit value.
+ [ruby-dev:46174] [Bug #7084]
-Sat Nov 14 02:34:43 2015 Koichi Sasada <ko1@atdot.net>
+Wed Oct 3 11:43:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (vm_define_method): do not use current CREF immediately,
- but check CREF in environment or methods. Methods defined in methods
- should be public.
- [Bug #11571]
+ * io.c (rb_io_reopen): improvement to accept optional arguments.
+ a patch by Glass_saga (Masaki Matsushita) in [ruby-core:47806].
+ [Feature #7103]
- * vm_method.c (rb_scope_module_func_check): check CREF in env or me.
- if CREF is contained by `me', then return FALSE.
+Wed Oct 3 04:36:11 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_method.rb: add a test.
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_file): Added
+ documentation
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
+ ditto
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_cert): ditto
-Sat Nov 14 02:19:16 2015 Koichi Sasada <ko1@atdot.net>
+Wed Oct 3 02:23:37 2012 Shugo Maeda <shugo@ruby-lang.org>
- * method.h: constify rb_cref_t::scope_visi;
+ * error.c (exc_to_s, name_err_to_s, name_err_mesg_to_str): do not
+ taint messages.
- * eval_intern.h (CREF_SCOPE_VISI_COPY): catch up this fix.
+Tue Oct 2 16:47:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c: ditto.
+ * eval.c (identity_hash_new): hide internal hashes for refinements.
-Sat Nov 14 01:53:52 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * eval.c (rb_mod_refine): no default value.
- * pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for
- optimization bug of Oracle Solaris Studio 12.4 on Solaris
- with -xO4 optimization option. [Bug #11684]
+Mon Oct 1 22:54:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Nov 13 23:00:23 2015 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+ * eval.c (identity_hash_new): new function to create a new identity
+ hash.
- * configure.in: unset LD_PRELOAD on mingw. msys2 child processes
- crash at make test-all with LD_PRELOAD.
- [ruby-core:71461] [Bug #11680]
+ * eval.c (rb_overlay_module, rb_mod_using, rb_mod_refine): use
+ identity_hash_new().
-Fri Nov 13 14:00:43 2015 Zachary Scott <zzak@ruby-lang.org>
+Mon Oct 1 02:34:53 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
+ * configure.in (--with-opt-dir): Make this also work on DLDFLAGS
+ so LIBRUBY_SO links fine with libexecinfo installed in a
+ non-system directory.
-Fri Nov 13 13:09:16 2015 Zachary Scott <zzak@ruby-lang.org>
+Sun Sep 30 23:32:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/openssl/ossl_ssl.c: Merge ruby/openssl@81e1a30
+ * vm_dump.c (rb_vm_bugreport): add /Library/Logs/DiagnosticReports
+ in the list of locations of crash reports.
- * test/openssl/test_ssl.rb: ditto
+Sun Sep 30 21:18:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 13 13:05:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_concat): use memcpy to copy a string which contains
+ NUL characters. [ruby-core:47751] [Bug #7090]
- * prelude.rb (Thread.exclusive): warn as deprecated.
+Sat Sep 29 19:41:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Nov 13 10:36:39 2015 Victor Nawothnig <Victor.Nawothnig@gmail.com>
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill child process
+ before Timeout::Error is raised. rmdir of mktmpdir fails with
+ EACCES if child process is alive on Windows.
- * parse.y (new_unless): optimize constant condition for `unless`
- as well as `if`. [Fix GH-1092]
+ * test/thread/test_queue.rb (TestQueue): increase timeout.
+ This test takes long time on Windows XP.
-Fri Nov 13 10:08:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/psych/psych.gemspec: bump version to 2.0.15
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):
+ clear environment variables. If http_proxy environment variable was
+ set, the test failed.
-Thu Nov 12 18:44:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto.
- * parse.y (parser_magic_comment): should match exactly.
- [ruby-core:71460] [Bug #11679]
+Sat Sep 29 19:41:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu Nov 12 16:16:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/drb/drbtest.rb (DRbCore#teardown):
+ Use Process.kill :KILL on Windows because Process.kill :INT silently
+ fails on Windows 7 and raises EINVAL on Windows XP for spawned
+ process with new_pgroup: false.
- * template/prelude.c.tmpl: enable tail call optimization.
+ * test/drb/drbtest.rb (DRbAry#teardown): ditto.
-Thu Nov 12 14:17:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 29 19:40:32 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * parse.y (parser_yylex): ANDDOT at the head of the line denote
- line continuation from previous one to support fluent interface,
- as well as single dot.
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ set script encoding to work with LANG=C. It would work on both
+ Windows and Unix. Refix of r37051.
-Thu Nov 12 13:49:50 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Sep 29 11:21:06 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(db78980).
- this version includes #1367 , #1373 , #1375
- * test/rubygems: ditto.
+ * vm_insnhelper.c (rb_vm_using_modules): use using_modules before
+ klass to fix method lookup order, and use klass even if klass is
+ not a module to make refinements in class_eval invoked on classes
+ work.
-Thu Nov 12 10:53:41 2015 Eric Wong <e@80x24.org>
+ * eval.c (rb_using_module): accept a class as the second argument.
- * benchmark/bm_io_nonblock_noex2.rb: new benchmark based
- on bm_io_nonblock_noex.rb
- * io.c (io_read_nonblock): move documentation to prelude.rb
- (io_write_nonblock): ditto
- (Init_io): private, internal methods for prelude.rb use only
- * prelude.rb (IO#read_nonblock): wrapper + documentation
- (IO#write_nonblock): ditto
- [ruby-core:71439] [Feature #11339]
+ * eval.c (rb_mod_using, f_using): raise a TypeError if the argument
+ is not a module.
-Wed Nov 11 18:30:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
- * 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]
+Sat Sep 29 02:18:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Nov 11 17:38:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ Use ruby only on Windows since the test fails on Unix with LANG=C.
+ [ruby-core:47709] [Bug #7076]
- * vm_eval.c (local_var_list_add): skip internal local variable
- name by its type but not if it has a name. internal local
- variable names are just unique per frame, not globally.
- [ruby-core:71437] [Bug #11674]
+Fri Sep 28 22:19:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Nov 11 14:14:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ echo command doesn't work properly against non-ascii character on
+ Windows with chcp 437. Instead we use ruby.
+ [ruby-core:47709] [Bug #7076]
- * transcode.c: fix a typo
- [ci skip][fix GH-1091] Patch by @jwworth
+Fri Sep 28 17:54:31 2012 Koichi Sasada <ko1@atdot.net>
-Wed Nov 11 11:58:38 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_insnhelper.c (vm_setup_method): refactoring.
+ Remove src_argc and use iseq->arg_size directly.
- * lib/net/ftp.rb (initialize): Connections are in passive mode per
- default now. The default mode can be changed by
- Net::FTP.default_passive=.
- [ruby-core:71146] [Feature #11612]
+Fri Sep 28 17:26:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/ftp.rb (default_passive=, default_passive): new methods.
+ * lib/rubygems/installer.rb (check_that_user_bin_dir_is_in_path):
+ test_generate_bin_bindir_with_user_install_warning(TestGemInstaller)
+ fails on Windows with msys bash. It makes comparing paths
+ case-insensitive.
+ pick from upstream to fix a failure of test-all [ruby-core:47711]
+ https://github.com/rubygems/rubygems/commit/c474edb2f3704206f04da1c8c6cf9fb079d84abe
-Wed Nov 11 09:03:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 28 15:44:45 2012 Shugo Maeda <shugo@ruby-lang.org>
- * sprintf.c (rb_str_format): respect default value of a hash. no
- longer raises KeyError unless the default value of the hash is
- nil. [ruby-core:71354] [Bug #11661]
+ * vm_method.c (search_method): copy refinement iclasses to search
+ superclasses correctly.
-Tue Nov 10 20:35:12 2015 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_refinement.rb: related test.
- * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".
+Fri Sep 28 15:15:41 2012 Koichi Sasada <ko1@atdot.net>
- * lib/pp.rb: Ditto.
+ * insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.
- * lib/prettyprint.rb: Ditto.
+ * compile.c (iseq_compile_each): ditto.
- * lib/resolv.rb: Ditto.
+ * node.h: remove unused node `NODE_OPTBLOCK'.
- * lib/securerandom.rb: Ditto.
+ * ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.
- * lib/tmpdir.rb: Ditto.
+Fri Sep 28 13:14:34 2012 Koichi Sasada <ko1@atdot.net>
- * lib/unicode_normalize/tables.rb: Ditto.
+ * vm_core.h: now VM_DEBUG_BP_CHECK should be 1.
- * test/net/ftp/test_buffered_socket.rb: Ditto.
+Fri Sep 28 12:51:54 2012 Koichi Sasada <ko1@atdot.net>
- * test/net/ftp/test_mlsx_entry.rb: Ditto.
+ * vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).
+ `bp' can be calculate by `sp' (stack pointer) of previous frame.
+ Now, `bp_check' field is remained for debug. You can eliminate
+ this field by setting VM_DEBUG_BP_CHECK as 0.
- * test/open-uri/test_open-uri.rb: Ditto.
+ * vm_insnhelper.c (vm_base_ptr): add `vm_base_ptr(cfp).
+ This function calculates base pointer from cfp.
- * test/open-uri/test_ssl.rb: Ditto.
+ * vm_insnhelper.c (vm_setup_method): push `recv' value on top of
+ value stack (before method parameters).
+ This change is for keeping consistency with normal method dispatch.
- * test/pathname/test_pathname.rb: Ditto.
+ * insns.def: fix to use vm_base_ptr().
- * test/test_pp.rb: Ditto.
+ * vm.c (vm_exec): ditto.
- * test/test_prettyprint.rb: Ditto.
+ * vm_dump.c: remove `bp' related dumps.
- * tool/transcode-tblgen.rb: Ditto.
+ * cont.c (fiber_init): fix to check VM_DEBUG_BP_CHECK.
- * ext/pathname/lib/pathname.rb: Ditto.
+Fri Sep 28 10:40:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 10 18:42:24 2015 Aleksandrs Ledovskis <aleksandrs@ledovskis.lv>
+ * io.c (rb_io_reopen): accept File::Constants as well as mode string.
+ based on the patch by Glass_saga (Masaki Matsushita) in
+ [ruby-core:47694]. [Feature #7067]
- * defs/id.def, parse.y: Switch internal token name to reflect
- current form of safe-call operator. [Fix GH-1090]
+Thu Sep 27 18:36:51 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Nov 10 18:25:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_overlay_module, rb_mod_refine): accept a module as the
+ argument of Module#refine.
- * hash.c (rb_hash_to_proc): use rb_func_proc_new to make light
- weight proc. [Feature #11653]
+ * vm_method.c (search_method): if klass is an iclass, lookup the
+ original module of the iclass in omod in order to allow
+ refinements of modules.
-Tue Nov 10 18:23:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_refinement.rb: add tests for the above changes.
- * proc.c (cfunc_proc_t): add room for me.
+Thu Sep 27 18:12:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * proc.c (cfunc_proc_new): generalise for cfunc proc without env.
+ * ext/syslog/lib/syslog/logger.rb: add a formatter to the
+ Syslog::Logger object. [Bug #7065]
+ * test/syslog/test_syslog_logger.rb: ditto.
- * proc.c (rb_func_proc_new, rb_func_lambda_new): new functions to
- make proc/lambda without env from cfunc.
+Wed Sep 26 16:39:57 2012 Koichi Sasada <ko1@atdot.net>
-Tue Nov 10 17:32:35 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * insns.def: add new instruction `opt_empty_p' for optimize `empty?'
+ method. Apply a patch proposed at [ruby-dev:46120]
+ [ruby-trunk - Feature #6972] by Glass_saga (Masaki Matsushita).
- * bootstraptest/test_fork.rb ([ruby-dev:37934]): :NPROC (RLIMIT_NPROC)
- is not supported on some platforms (e.g. Solaris 10).
+ * compile.c (iseq_specialized_instruction), vm.c, vm_insnhelper.h:
+ ditto.
-Tue Nov 10 16:57:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * id.c, template/id.h.tmpl: ditto.
- * hash.c (rb_hash_to_proc): new method Hash#to_proc.
- [Feature #11653]
+ * test/ruby/test_optimization.rb: test for this changes.
-Tue Nov 10 14:34:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Sep 25 09:59:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (rb_time_timespec_new): swap utc and localtime
- to generate gmt flag by INT_MAX - gmtoff.
+ * insns.def (invokesuper): klass in cfp is not valid in at_exit and
+ END blocks. [ruby-core:47680] [Bug #7064]
-Tue Nov 10 14:01:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 25 08:11:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (rb_hash_{le,lt,ge,gt}): new methods, Hash#<=, Hash#<,
- Hash#>=, Hash#>, to test if all elements of a hash are also
- included in another hash, and vice versa.
- [ruby-core:68561] [Feature #10984]
+ * iseq.c (rb_iseq_defined_string): the index of defined_strings must
+ be the value of type - 1.
-Tue Nov 10 11:25:29 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Sep 24 17:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (rb_timespec_now): added. [Feature #11558]
+ * compile.c (defined_expr), insns.def (defined): share single frozen
+ strings. [EXPERIMENTAL] [ruby-core:47558][Feature #7035]
- * time.c (rb_time_timespec_new): added. [Feature #11558]
+ * iseq.c (rb_iseq_defined_string): make expression strings.
-Tue Nov 10 06:17:17 2015 Eric Wong <e@80x24.org>
+Mon Sep 24 11:22:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * 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]
+ * tool/merger.rb: add --ticket option to add ticket number.
-Tue Nov 10 00:36:46 2015 Tanaka Akira <akr@fsij.org>
+Sun Sep 23 21:51:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/resolv.rb (Resolv::DNS::Message::MessageEncoder#put_labels):
- Prevent overflow of pointer to labels.
- Patch by Hannes Georg. [ruby-core:71248] [Bug #11632]
+ * lib/mkmf.rb (String#unspace): unescape with backslashes. normal
+ makes need to escape spaces with backslashes. nmake is not the
+ case. [Bug #7036]
-Tue Nov 10 00:25:41 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+ * lib/mkmf.rb (create_makefile): use timestamp file dependencies for
+ directories.
- * gems/bundled_gems: update to power_assert 0.2.6.
+ * lib/mkmf.rb: unexpand macros.
-Mon Nov 9 21:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (LIBPATHFLAG): no needs to escape library path here.
- * vm_eval.c (rb_check_funcall_default): split from
- rb_check_funcall to return the given fallback value.
+ * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths
+ internal to deal with in Makefile.
- * object.c (rb_obj_dig): use rb_check_funcall_default so that tail
- call optimization will be possible. [Feature #11643]
+ * lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now.
-Mon Nov 9 21:27:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@gmail.com>
- * array.c (rb_ary_dig): new method Array#dig.
+ * complex.c: Fix examples of r36993.
+ Keep the simple definition, mathematics define the result.
+ Based on patch by Robin Dupret. Fixes #188 on github.
- * hash.c (rb_hash_dig): new method Hash#dig.
+Sat Sep 22 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * object.c (rb_obj_dig): dig in nested arrays/hashes.
- [Feature #11643]
+ * ext/ripper/lib/ripper.rb:
+ Match sample output to Ripper.sexp from current trunk version.
+ [Bug #6929]
-Mon Nov 9 18:00:47 2015 Yuki Nishijima <mail@yukinishijima.net>
+Thu Sep 20 23:05:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta3
+ * thread_pthread.c (native_cond_initialize): destroy condattr
+ after using it. Patch by Stanislav Sedov. Thank you.
+ [Bug #7041] [ruby-core:47619]
-Mon Nov 9 17:38:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Sep 20 22:53:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/runner.rb: use official repository for coverage tool.
- * Makefile.in: ditto.
- * common.mk: ditto.
- * .gitignore: ignored third party repositories.
+ * thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
-Mon Nov 9 17:29:09 2015 Shugo Maeda <shugo@ruby-lang.org>
+Thu Sep 20 16:42:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * compile.c (iseq_compile_each): Dynamic string literals should be
- frozen.
- [ruby-core:57574] [Feature #8976]
+ * lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): add
+ SSLTmpDhCallback for configuration option.
-Mon Nov 9 15:56:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/drb/ssl.rb (setup_ssl_context): copy the value of tmp_dh_callback.
- * common.mk: Use ruby organization url for simplecov repository.
+ * test/drb/ut_array_drbssl.rb: set tmp_dh_callback to suppress warning.
-Sun Nov 8 16:24:09 2015 Masaki Matsushita <glass.saga@gmail.com>
+ * test/drb/ut_drb_drbssl.rb: ditto.
- * NEWS: describe addition of File::TMPFILE
+Thu Sep 20 10:56:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Nov 8 15:19:17 2015 Masaki Matsushita <glass.saga@gmail.com>
+ * test/drb/ut_drb.rb: revert a part of r36987, and get rid of a warning
+ with another method. if the substitution is removed, the ExtSrv
+ object will be GC'ed and some tests will be blocked.
- * file.c: Add O_TMPFILE.
+Thu Sep 20 07:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sun Nov 8 14:24:43 2015 windwiny <windwiny.ubt@gmail.com>
+ * complex.c: Examples for Complex Documentation.
+ Patch by Robin Dupret.
+ Fixes #184 on github.
- * method.h (METHOD_ENTRY_{VISI,BASIC,FLAGS}_SET): suppress
- shift-op-parentheses warnings. [Fix GH-1082]
+Thu Sep 20 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sun Nov 8 14:01:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ +:void_stmt+ is meaningless
+ [Bug #6929] [ruby-core:47507]
- * ext/psych/psych_emitter.c: backport 5bd7744 from tenderlove/psych.
- support backward compatibility of Ruby 2.0
+Thu Sep 20 07:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sun Nov 8 10:55:10 2015 Anton Davydov <antondavydov.o@gmail.com>
+ * lib/csv.rb (Object#CSV, Array#to_csv, String#parse_csv):
+ Examples and documentation for CSV.
+ [Bug #6880] [ruby-core:47218]
- * io.c (rb_io_gets_m): Update IO#gets doc for characters more than
- 1 byte. [Fix GH-1085]
+Thu Sep 20 00:42:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 8 10:37:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * array.c (take_items), enum.c (enum_zip): raise TypeError at
+ non-enumerable objects, not NoMethodError. [ruby-dev:46145]
+ [Bug #7038]
- * lib/uri/ftp.rb: fix a typo.
- [fix GH-1084][ci skip] Patch by @windwiny
+ * vm_eval.c (rb_check_block_call): check_funcall variant with block
+ function.
-Sun Nov 8 08:10:31 2015 Koichi Sasada <ko1@atdot.net>
+Tue Sep 18 17:51:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_trace.c (exec_hooks_precheck): check need_clean everytime
- to clean-up unused hooks.
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_attrs): add npn_select_db to
+ suppress warning: instance variable @npn_select_cb not initialized
- * vm_trace.c (list->need_clean): use as boolean value.
+Sun Sep 16 17:47:00 2012 Eric Hodel <drbrain@segment7.net>
-Sun Nov 8 01:31:27 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * tool/change_maker.rb: Update svn detection for subversion 1.7's
+ single .svn directory.
- * lib/net/http.rb (Net::HTTP#initialize):
- default value of Net::HTTP#open_timeout is now 60 (was nil).
+Sun Sep 16 11:39:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 7 12:18:05 2015 Eric Wong <e@80x24.org>
+ * io.c (io_set_read_length): if the read length equals to the buffer
+ string size then nothing to do. or ensure the string modifiable
+ before setting the length only when the former is shorter. based on
+ the patch in [ruby-core:47541] by Hiroshi Shirosaki.
+ [ruby-core:46586] [Bug #6764]
- * string.c (id_to_s): remove redundant variable
- (rb_obj_as_string): trade id_to_s for idTo_s
- (rb_str_equal): replace rb_intern(...) with pre-defined ID
- (rb_str_cmp_m): ditto
- (rb_str_match): ditto
- (str_upto_each): ditto
- (rb_str_sum): ditto
- (Init_String): remove id_to_s initialization
+Sun Sep 16 08:57:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 7 11:40:05 2015 Eric Wong <e@80x24.org>
+ * configure.in (strict_warnflags): separate strict flags from
+ warnflags only for core. [ruby-dev:46105]
- * thread.c (rb_cThreadShield): make static
+Sun Sep 16 08:16:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 7 09:51:38 2015 Koichi Sasada <ko1@atdot.net>
+ * .editorconfig: add. [ruby-core:47548] [Feature #7030]
- * vm_trace.c (rb_threadptr_exec_event_hooks_orig):
- maintain trace_running counter on internal events.
+Sat Sep 15 01:56:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
- This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
- [Bug #11603] https://github.com/ruby/ruby/pull/1059
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream: 50a383c84.
+ [ruby-dev:46128] [Bug #7005]
-Sat Nov 7 03:32:27 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 15 00:20:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/ruby.h (RSTRUCT_PTR): need a close parenthesis.
+ * ext/nkf/nkf.c (rb_nkf_convert): suppress warning.
-Sat Nov 7 01:32:06 2015 Naohisa Goto <ngotogenome@gmail.com>
+Fri Sep 14 04:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * dir.c (dir_fileno, dirfd): support of Dir#fileno on Solaris 10.
- Solaris 10 does not have dirfd, but the file descriptor of a
- directory is stored in the d_fd or dd_fd member in the DIR struct.
- Note that Solaris 11 has dirfd(3C).
+ * array.c (rb_ary_diff, rb_ary_uniq):
+ Enhance documentation for array uniqueness
+ Based on a patch by Robin Dupret
+ [Bug #6872] [ruby-core:47209]
- * configure.in: checks for DIR.d_fd and DIR.dd_fd on Solaris 10.
+Fri Sep 14 03:30:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Fri Nov 6 23:13:53 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * array.c (rb_ary_select):
+ Update documentation for Array#select
+ * enum.c (enum_find_all, enum_reject):
+ Update documentation for Enumerable#find_all and Enumerable#reject
+ Based on a patch by Jeff Saracco
+ [Bug #6908] [ruby-core:47285] [Fixes #166 on github]
- * array.c: clarifies Array#reject! documentation.
- [fix GH-894][ci skip] Patch by @GxSplinter
+Fri Sep 14 00:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Fri Nov 6 20:18:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * signal.c (rb_f_kill):
+ Update documentation for Process.kill to reflect kill(2)
+ Patch by Richo Healey
- * test/runner.rb: extracted test helper.
- * test/lib/zombie_hunter.rb: ditto.
+Thu Sep 13 21:40:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Nov 6 18:07:47 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * lib/securerandom.rb (SecureRandom.random_bytes):
+ Use 64bit value as pointer for Windows x64 to fix SystemCallError.
- * include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr):
- Suppress pointer type mismatch warnings occurred with old version
- of Fujitsu C Compiler (fcc) on Solaris 10. The warnings cause
- failure of TestMkmf::TestConvertible. [Bug #11644] [ruby-dev:49326]
- * include/ruby/ruby.h (FIX_CONST_VALUE_PTR): macro for the above,
- only effective with fcc.
+ * lib/securerandom.rb (SecureRandom.lastWin32ErrorMessage):
+ Set proper encoding to avoid invalid byte sequence error.
+ [ruby-core:47451] [Bug #6990]
-Fri Nov 6 12:39:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ
- from ".?" to "&.". [ruby-core:71363] [Feature #11537]
+ * lib/optparse.rb: Remove unreachable email address from documentation
+ [Bug #6996] [ruby-core:47459]
-Fri Nov 6 09:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * parse.y (kwd_append): fix segv after invalid keyword argument,
- preceding keyword list is NULL when syntax error is there.
- [ruby-core:71356] [Bug #11663]
+ * lib/xmlrpc.rb: Documentation for XMLRPC
+ * lib/xmlrpc/datetime.rb: ditto.
+ * lib/xmlrpc/parser.rb: ditto.
+ * lib/xmlrpc/client.rb: ditto.
+ * lib/xmlrpc/utils.rb: ditto.
+ * lib/xmlrpc/README.rdoc: ditto.
+ * lib/xmlrpc/create.rb: ditto.
+ * lib/xmlrpc/base64.rb: ditto.
+ * lib/xmlrpc/config.rb: ditto.
+ * lib/xmlrpc/httpserver.rb: ditto.
+ * lib/xmlrpc/server.rb: ditto.
+ * lib/xmlrpc/marshal.rb: ditto.
+ * lib/xmlrpc/README.txt: ditto.
+ [Bug #6909] [ruby-core:47286]
-Fri Nov 6 06:59:37 2015 Eric Wong <e@80x24.org>
+Thu Sep 13 10:22:11 2012 Takashi Toyoshima <toyoshim@gmail.com>
- * test/ruby/test_autoload: hoist out ruby_impl_require
+ * configure.in: Don't use PIE on Haiku because loader support is not
+ enough.
-Thu Nov 5 13:03:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 13 08:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * defs/id.def (token_ops): gather associations between IDs,
- operators, and parser tokens.
+ * lib/shellwords.rb: Documentation for Shellwords.
-Thu Nov 5 10:17:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 13 08:00:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * ext/socket/socket.c (make_addrinfo): use RARRAY_ASET for
- write-barrier.
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ * ext/ripper/lib/ripper/lexer.rb: ditto.
+ * ext/ripper/lib/ripper/sexp.rb: ditto.
+ * ext/ripper/lib/ripper/filter.rb: ditto.
+ * ext/ripper/lib/ripper/core.rb: ditto.
+ [Bug #6929] [ruby-core:47309]
- * ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): ditto.
+Wed Sep 12 22:59:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tkutil/tkutil.c (ary2list, ary2list2): ditto.
+ * vm_insnhelper.c (vm_method_missing, vm_call_method): reuse arguments
+ on the VM stack and get rid of ALLOCA.
-Thu Nov 5 10:09:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 12 22:45::00 2012 Zachary Scott <zzak@ruby-lang.org>
- * ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
- pointed out by hanmac.
- https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670
+ * ext/pathname/lib/pathname.rb: Documentation for Pathname.
+ * ext/pathname/pathname.c: ditto.
+ [Bug #6947] [ruby-core:47354]
-Wed Nov 4 17:33:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Sep 10 10:19:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/debug.rb: Add documentation for #thread_list_all.
- [Misc #11580][ci skip]
+ * enc/depend: fixed wrong change in a part of r34802.
-Wed Nov 4 15:45:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Sep 9 22:02:50 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * class.c: fix documentation for rb_define_class{_id}_under.
- [fix GH-991][ci skip] Patch by @kachick
+ * ext/socket/basicsocket.c (rsock_bsock_send):
+ avoid unnecessary select() calls before doing I/O
+ Patch by Eric Wong. [Feature #4538] [ruby-core:35586]
+ * ext/socket/init.c (rsock_s_recvfrom): ditto.
+ * ext/socket/init.c (rsock_s_accept): ditto.
+ * ext/socket/udpsocket.c (udp_send): ditto.
+ * io.c (io_fflush): ditto.
+ * io.c (io_binwrite): ditto.
+ * io.c (rb_io_syswrite): ditto.
-Wed Nov 4 15:40:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Sep 10 01:38:51 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * method.h: fix typo. Patch by @davydovanton
- [fix GH-1076][ci skip]
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ suppress integer <-> pointer cast warnings.
+ [Feature #4570] [ruby-core:35711]
-Wed Nov 4 15:39:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Sep 10 01:36:00 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * hash.c: use correct grammar. Patch by @tveastman
- [fix GH-1079][ci skip]
+ * io.c (rb_io_close): notify fd close before releasing gvl.
+ * io.c (fptr_finalize): modify fptr->mode before releasing gvl.
+ remove unnecessary rb_thread_fd_close().
+ [Feature #4570] [ruby-core:35711]
-Wed Nov 4 11:38:23 2015 Jake Worth <jakeworth82@gmail.com>
+Mon Sep 10 00:16:34 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c (proc_getsid): [DOC] Fix double word 'for' and typo.
- [Fix GH-1080]
+ * process.c: exec() requires to be single threaded also on Haiku.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/178
-Wed Nov 4 06:01:52 2015 Eric Wong <e@80x24.org>
+Sun Sep 9 21:21:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * include/ruby/ruby.h (struct RObject): hide iv_index_tbl type
- [ruby-core:71306] [Feature #11647]
+ * lib/thread.rb (Queue#pop): Fixed double registration issue when
+ mutex.sleep is interrupted. [Bug #5258] [ruby-dev:44448]
+ * lib/thread.rb (SizedQueue#push): ditto.
-Tue Nov 3 06:48:58 2015 Eric Wong <e@80x24.org>
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup,
+ test_queue_pop_interrupt, test_sized_queue_pop_interrupt,
+ test_sized_queue_push_interrupt): new tests.
- * variable.c (find_class_path): remove cast for rb_class_ivar_set
- (rb_ivar_set): ditto
- (rb_cvar_set): ditto
+Sun Sep 9 20:20:31 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Nov 3 06:18:21 2015 Eric Wong <e@80x24.org>
+ * lib/sync.rb (Sync_m#sync_lock): Fixed wakeup/raise unsafe code.
+ Patched by Masaki Matsushita. [Bug #5355] [ruby-dev:44521]
- * variable.c (rb_global_tbl): convert to id_table
+ * test/thread/test_sync.rb (test_sync_lock_and_wakeup,
+ test_sync_upgrade_and_wakeup, test_sync_lock_and_raise):
+ new test.
-Tue Nov 3 01:58:46 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sun Sep 9 18:39:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * parse.y (NO_QCALL): fix type mismatch of operands that causes
- compile error with Oracle Solaris Studio on Solaris.
- [Bug #11645] [ruby-dev:49327]
+ * include/ruby/intern.h (rb_thread_blocking_region): Added
+ a comment of recommended alternative way.
-Sun Nov 1 17:14:36 2015 Koichi Sasada <ko1@atdot.net>
+Sun Sep 9 18:37:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * id_table.c (mix_id_table_insert): do not touch list during
- list->hash transition because GC can run during transition.
+ * lib/sync.rb (Sync_m): Removed RCS_ID.
-Sun Nov 1 11:07:31 2015 Eric Wong <e@80x24.org>
+Sun Sep 9 18:21:03 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * iseq.c (iseq_memsize): account for rb_call_cache entries
+ * test/ruby/test_io.rb (test_advise_pipe): new test to check
+ io.advise() against anonymous io object don't make crash.
+ made by Eric Wong. [Bug #6081] [ruby-core:42880]
-Sun Nov 1 09:12:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 9 16:47:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * parse.y (parser_yylex): ':' separated by a comment and a newline
- is not valid as symbol.
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ new functions.
+ * io.c (fptr_finalize): release GVL if possible.
+ Patched by Eric Wong. [Feature #4570] [ruby-core:35711]
-Sat Oct 31 20:15:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Sep 9 16:08:48 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/openssl/test_pair.rb: skipped tests if openssl doesn't support
- ECDH cipher.
+ * io.c (io_bufread): removed unnecessary rb_thread_wait_fd().
+ Patch by Eric Wong. [Bug #6629] [ruby-core:45789]
+ * io.c (rb_io_sysread): ditto.
+ * io.c (copy_stream_fallback_body): ditto.
-Sat Oct 31 14:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 9 15:21:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
- it does not allow spaces before its argument.
- [ruby-core:71283] [Bug #11641]
+ * thread.c (rb_mutex_lock): stop multiple threads use
+ pthread_cond_timedwait() concurrently. [Bug #6278] [ruby-core:44275]
-Sat Oct 31 14:58:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 8 18:52:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
- it does not allow spaces before its argument.
- [ruby-core:71283] [Bug #11641]
+ * internal.h (struct rb_classext_struct): move allocator function into
+ rb_classext_t from ordinary method table. [ruby-dev:46121]
+ [Feature #6993]
-Sat Oct 31 10:22:49 2015 yui-knk <spiketeika@gmail.com>
+ * object.c (rb_obj_alloc): call allocator function directly.
- * eval_error.c (undef_mesg_for): fix typo. Before this commit
- `ArgumentError: malformed format string - %$` was raised when
- `NameError#message` is called. [ruby-core:71282] [Bug #11640]
- [Fix GH-1077]
+ * vm_method.c (rb_define_alloc_func, rb_undef_alloc_func)
+ (rb_get_alloc_func): use allocator function in rb_classext_t.
-Fri Oct 30 21:12:45 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+Fri Sep 7 01:21:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gems/bundled_gems: update to power_assert 0.2.5.
+ * ext/extmk.rb (extmake), lib/mkmf.rb (have_framework): fix splitting
+ options with an argument, not using NUL as special character.
+ [ruby-core:47447] [Bug #6987]
-Fri Oct 30 19:29:52 2015 Koichi Sasada <ko1@atdot.net>
+Thu Sep 6 14:49:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (newobj_slowpath): do not need to use flags hack (commit miss).
+ * .gdbinit (rp): FLONUM support.
-Fri Oct 30 19:08:48 2015 Koichi Sasada <ko1@atdot.net>
+ * include/ruby/ruby.h (ruby_special_consts): define FLONUM constants
+ always, so that they are available from gdb.
- * gc.c (heap_get_freeobj_from_next_freepage): not so UNLIKELY.
+ * include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
+ versions. inline TYPE() comparison and FLONUM_P() should be
+ optimized away on non-FLONUM.
-Fri Oct 30 18:09:51 2015 Koichi Sasada <ko1@atdot.net>
+Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * gc.c (newobj_slowpath): reduce 1 parameter to use only registers
- for performance.
+ * lib/minitest/*: Imported minitest 3.4.0 (r7762)
+ * test/minitest/*: ditto
- On my laptop, 'N.times{x = []}' (where N = 29_000_000) is
- 1.86 sec -> 1.74 sec.
+Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Oct 30 12:53:21 2015 yui-knk <spiketeika@gmail.com>
+ * parse.y (rb_warn4S): renamed from rb_warn4(), because the case in
+ r36911 takes a string.
- * test/ruby/test_call.rb: added test for safe navigation operator.
- [fix GH-1066]
+ * parse.y (rb_warn4S): use ripper_warnS() for ripper.
-Fri Oct 30 12:47:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * parse.y (ripper_warnS): now it is used.
- * ChangeLog: fix wrong commit name.
+Wed Sep 5 15:51:52 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Oct 30 12:36:16 2015 yui-knk <spiketeika@gmail.com>
+ * .travis.yml (notifications): [experimental] update notification
+ template.
- * vm_method.c: added documentation of protected/private methods.
- [fix GH-1072]
- * test/ruby/test_module.rb: added testcase for method_defined?
- [fix GH-1071]
+Wed Sep 5 15:21:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 30 12:06:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (rb_warn4): added as a rb_warn variant to warn with explicit
+ source file name and line in parse.y.
- * variable.c (rb_class_ivar_set): rename as class specific ivar
- setter, and st_table is no longer involved.
+ * parse.y (warn_unused_var): use rb_warn4 to suppress warning on ripper.
-Fri Oct 30 11:36:33 2015 Eric Wong <e@80x24.org>
+Wed Sep 5 13:30:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * 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
+ * dir.c (glob_make_pattern): names under recursive need to be single
+ basenames to match for each name. [ruby-core:47418] [Bug #6977]
-Fri Oct 30 10:37:56 2015 Eric Wong <e@80x24.org>
+Tue Sep 4 20:55:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * 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
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): show Timeout::Error
+ instead of IOError if the timeout has expired.
-Fri Oct 30 09:57:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * test/test_pstore.rb
+ (PStoreTest#test_pstore_files_are_accessed_as_binary_files):
+ increase timeout because this test is slow on Windows.
+ [ruby-core:47402] [Bug #6965]
- * gems/bundled_gems: update latest gems.
- test-unit-3.1.5 and minitest-5.8.2
+Tue Sep 4 11:28:57 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Oct 30 09:54:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm_eval.c (ruby_eval_string_from_file_protect): initializer
+ element is not computable at load time.
- * lib/rubygems: Update to RubyGems HEAD(60d7972).
- this version contains pull requests number of #1343, #1356, #1357, #1363
- at https://github.com/rubygems/rubygems/pulls
- * test/rubygems: ditto.
+Tue Sep 4 07:48:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Fri Oct 30 07:38:29 2015 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_asn1_rb:
+ test/openssl/test_ssl_session.rb:
+ test/openssl/test_x509name.rb:
+ test/openssl/test_buffering.rb:
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_ssl.rb: Refactor code that leads to warnings on
+ Ruby CI.
- * insns.def (getinlinecache/setinlinecache): compare ic->ic_cref and
- current cref only when cached CREF list includes singleton class.
+Tue Sep 4 07:02:56 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- Singleton classes have own namespaces, so that we need to check
- cref as a key (#10943).
+ * test/openssl/utils.rb: Use DSS1 as DSA signature digest for all
+ OpenSSL versions < 1.0.0.
+ [Feature #6946] [ruby-core:47405]
- However, if current CREF list does not include singleton class,
- no need to check CREF because it should be same name space.
+Mon Sep 3 21:22:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (vm_get_const_key_cref): add a function returns
- CREF only when it includes singleton class.
+ * include/ruby/ruby.h (rb_float_value): suppress warnings.
+ [ruby-core:47406][Bug #6971]
- * vm_core.h: constify iseq_inline_cache_entry::ic_cref.
+Mon Sep 3 14:49:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 30 06:43:50 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/matrix.rb (Vector#magnitude): accumulate squares of absolute
+ values to fix for complex vector. [ruby-dev:46100] [Bug #6966]
- * vm_insnhelper.c (vm_env_cref): make it inline for performance.
+Mon Sep 3 10:09:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.
+ * ext/openssl/extconf.rb: Detect OpenSSL_FIPS macro
+ ext/openssl/ossl.c: Expose OpenSSL::OPENSSL_FIPS constant to
+ indicate whether OpenSSL runs in FIPS mode.
+ test/openssl/test_pkey_dh.rb: Generate 256 bit keys for
+ non-FIPS installations to improve test performance (e.g. for
+ rubyci).
+ test/openssl/utils.rb: Replace DSS1 as certificate signature
+ digest with SHA1 for FIPS installations when using DSA by
+ introducing TestUtils::DSA_SIGNATURE_DIGEST.
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_x509crl.rb:
+ test/openssl/test_x509req.rb: Use DSA_SIGNATURE_DIGEST
+ NEWS: Introduce OpenSSL::OPENSSL_FIPS
-Fri Oct 30 06:20:40 2015 Koichi Sasada <ko1@atdot.net>
+ These changes allow running the OpenSSL tests in FIPS mode
+ while keeping a high performance for non-FIPS installations.
+ Introduction of OpenSSL::OPENSSL_FIPS allows for applications
+ to react to special requirements when using OpenSSL in FIPS mode.
+ [Feature #6946] [ruby-core:47345]
- * insns.def: nobody set ic->ic_value.value to Qundef.
+Sun Sep 2 21:46:28 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Fri Oct 30 06:15:50 2015 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/utils.rb: Use a cached DH key instead of generating a
+ new one each time.
- * vm.c: add ifndef guard for VM_CHECK_MODE.
+Sun Sep 2 05:41:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 30 06:13:10 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/webrick/ssl.rb (WEBrick::Config::SSL): add new key
+ SSLTmpDhCallback to set SSLContext#tmp_dh_callback.
- * vm_insnhelper.c (vm_check_frame_detail): should require me for
- VM_FRAME_FLAG_BMETHOD type frame.
+ * lib/webrick/ssl.rb (WEBrick::GenericServer#setup_ssl_context):
+ follow above.
-Thu Oct 29 18:42:30 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 1 18:50:50 2012 Akinori MUSHA <knu@iDaemons.org>
- * gc.c (gc_mark_ptr): specify NOINLINE so that gc_mark() can return
- immediately when obj is not a markable object.
+ * lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
+ instead of instance_eval.
-Thu Oct 29 18:05:22 2015 Koichi Sasada <ko1@atdot.net>
+Fri Aug 31 21:47:56 2012 Kouhei Sutou <kou@cozmixng.org>
- * encoding.c (rb_enc_check_str): add for performance.
- This function only accepts T_STRING (and T_REGEXP).
+ * lib/test/unit/test-unit.gemspec: Make test/unit default gem.
+ [Feature #6875] [ruby-dev:46051]
- 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
+Fri Aug 31 18:35:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * encoding.c: add ENC_DEBUG and ENC_ASSERT() macros.
+ * ext/openssl/extconf.rb: Check existence of OPENSSL_NPN_NEGOTIATED.
+ ext/ossl_ssl.c: Support Next Protocol Negotiation. Protocols to be
+ advertised by the server can be set in the SSLContext by using
+ SSLContext#npn_protocols=, protocol selection on the client is
+ supported by providing a selection callback with
+ SSLContext#npn_select_cb. The protocol that was finally negotiated
+ is available through SSL#npn_protocol.
+ test/openssl/test_ssl.rb: Add tests for Next Protocol Negotiation.
+ NEWS: add news about NPN support.
+ [Feature #6503] [ruby-core:45272]
- * internal.h: add a decl. of rb_enc_check_str().
+Fri Aug 31 17:38:43 2012 Akinori MUSHA <knu@iDaemons.org>
- * string.c (rb_str_plus): use rb_enc_check_str().
+ * lib/set.rb (Set#{each,reject!,select!}, SortedSet#each): Pass
+ the original block through instead of creating one that only
+ yields the passed argument.
- * string.c (rb_str_subpat_set): ditto.
+Fri Aug 31 16:23:20 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Oct 29 17:16:40 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/ipaddr.rb: Introduce several new error classes where only
+ ArgumentError and StandardError were used. IPAddr::Error is
+ their common ancestor class that inherits from ArgumentError for
+ backward compatibility. Submitted by Jon Daniel. Fixes #173 on
+ GitHub.
- * internal.h: export rb_wb_(un)protected_newobj_of()
- because some extensions include internal.h.
+Fri Aug 31 14:51:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Oct 29 16:42:19 2015 Koichi Sasada <ko1@atdot.net>
+ * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): added
+ for previous commit.
- * gc.c (rb_imemo_new): should not pass FL_WB_PROTECTED flag.
+Fri Aug 31 14:32:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (rb_wb_protected_newobj_of): add more assertions.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use self's sign to
+ determine 0.0 and Inf's sign instead of internal double value's.
+ Reported by phasis68 (Heesob Park) at [ruby-core:47381] [Bug #6955]
- * gc.c (rb_wb_unprotected_newobj_of): ditto.
+Fri Aug 31 14:31:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 29 16:20:26 2015 Koichi Sasada <ko1@atdot.net>
+ * template/id.h.tmpl, tool/id2token.rb: make id.h independent from
+ parse.h, and make parse.c dependent on it instead.
- * gc.c: introduce rb_wb_unprotected_newobj_of() and
- rb_wb_protected_newobj_of(), pass the WB_PROTECTED
- information explicitly.
+Fri Aug 31 14:27:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: use introduced functions by NEWOBJ_OF().
- `flag' is immediate value, so that C compilers can
- solve them at compile time.
+ * lib/mkmf.rb (create_makefile): fix race conditions at install-ext.
+ target files need to depend on destination directory timestamp
+ files, not phony targets.
- * include/ruby/ruby.h: add a comment about that.
+Fri Aug 31 14:03:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 29 14:52:03 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_trace.c (clean_hooks): do not access freed memory.
- * gc.c: add rb_objspace::flags::has_hook to represent hook availability.
+ * vm_trace.c (rb_threadptr_exec_event_hooks): fix uninitialized state
+ when no events is executed.
- * gc.c: add gc_event_hook_available_p(objspace) to check that flag.
+Thu Aug 30 18:21:51 2012 Tanaka Akira <akr@fsij.org>
- * gc.c (newobj_of): use gc_event_hook_available_p() instead of
- checking gc_event_hook_needed_p(objspace, RUBY_INTERNAL_EVENT_NEWOBJ).
- for performance.
+ * io.c (rb_io_close): call rb_last_status_clear.
- * gc.c (newobj_init): add UNLIKELY() for FL_WB_PROTECTED flag.
+Thu Aug 30 16:17:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (newobj_init): change parameters order (trivial change).
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): check underflow since
+ strtod() sets errno to ERANGE at underflow too. [ruby-core:47342]
+ [Bug #6944]
-Thu Oct 29 14:45:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 30 12:44:43 2012 Akinori MUSHA <knu@iDaemons.org>
- * vm_core.h (rb_thread_struct): move forward declarations before
- used.
+ * lib/set.rb (Set#{<,>,<=,>=}): Define comparison operators as
+ shorthand for the {proper_}{subset?,superset?} methods (finally).
+ Given a push by Alexander E. Fischer.
-Thu Oct 29 14:07:54 2015 Koichi Sasada <ko1@atdot.net>
+Thu Aug 30 09:21:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (gc_mark_ptr): remove debug code for #11244.
+ * lib/uri/ftp.rb (URI::FTP#initialize): raise InvalidURIError if "//"
+ is not present [ruby-core:47344] [Bug #6945]
-Thu Oct 29 10:08:33 2015 Eric Wong <e@80x24.org>
+Thu Aug 30 07:45:12 2012 Luis Lavena <luislavena@gmail.com>
- * 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
+ * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for
+ posix environments where HOME is not defined. [ruby-core:47322]
-Thu Oct 29 08:48:05 2015 Eric Wong <e@80x24.org>
+Wed Aug 29 23:42:59 2012 Tanaka Akira <akr@fsij.org>
- * variable.c (struct autoload_data_i): add waitq_head
- (struct autoload_state): new struct
- (autoload_require): save result in autoload_state for use
- in autoload_reset
- (autoload_reset): wake up other waiters with open-coded
- wait-queues
- (rb_autoload_load): add ensure autoload_const_set happens
- atomically w.r.t. autoload-triggered "require"
- [ruby-core:70075] [ruby-core:71239] [Bug #11384]
+ * internal.h (rb_last_status_clear): declared.
-Wed Oct 29 00:39:50 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * process.c (rb_last_status_clear): exported.
+ (rb_f_system): call rb_last_status_clear.
- * test/rubygems/test_gem_commands_server_command.rb
- (test_handle_options_port): change port from http to discard.
- Solaris does not include "http 80/tcp" in its default
- /etc/inet/services. AFAIK, discard (9/tcp) is older than http
- and it is expected that all OS can resolve the service name.
- [Bug #10004] [ruby-core:63518]
+ * io.c (rb_f_backquote): call rb_last_status_clear.
-Wed Oct 28 23:52:48 2015 Naohisa Goto <ngotogenome@gmail.com>
+Wed Aug 29 22:01:15 2012 Tanaka Akira <akr@fsij.org>
- * probes_helper.h (RUBY_DTRACE_HOOK): add RB_GC_GUARD, though paranoic.
+ * process.c (rb_f_system): check failures of waitpid.
+ [ruby-talk:398687]
-Wed Oct 28 15:36:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 29 15:03:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (rb_name_err_new): store the receiver directly.
+ * configure.in (LIBDIR_BASENAME): use configured libdir value to fix
+ --enable-load-relative on systems where libdir is not default value,
+ overridden in config.site files. [ruby-core:47267] [Bug #6903]
- * error.c (name_err_receiver): return directly stored receiver.
- [Feature #10881]
+ * ruby.c (ruby_init_loadpath_safe): ditto.
- * error.c (name_err_mesg_to_str): quote the name if unprintable.
+Wed Aug 29 14:34:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * object.c (check_setter_id): use rb_check_id to convert names.
+ * addr2line.c: SIZE_MAX is defined in stdint.h, so r36755 breaks
+ 32bit FreeBSD. [ruby-core:47360] [Bug #6948]
- * variable.c (uninitialized_constant): use NameError::message to
- keep the receiver of uninitialized constant. [Feature #10881]
+Wed Aug 29 04:50:04 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * error.c (rb_name_err_new): new function to create NameError
- exception instance. [Feature #10881]
+ * test/openssl/utils.rb
+ test/openssl/test_pair.rb
+ test/openssl/test_pkey_dh.rb: Use 1024 bit DH parameters to satisfy
+ OpenSSL FIPS requirements. Patch by Vit Ondruch.
+ [Bug #6938] [ruby-core:47326]
-Wed Oct 28 13:29:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 28 22:31:49 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * parse.y (new_attr_op_assign): fix op_assign type, which is
- already an ID since r52284. [Feature #11537]
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47339]
+ [Bug #6930]
-Tue Oct 27 23:14:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 28 20:03:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * defs/id.def: enable anonymous IDs not to expose internal IDs for
- frozen-string-literal-debug by Marshal.dump.
+ * configure.in: Fixing Haiku R1/alpha3 build with gcc-4.4.4.
+ - omit ANSI standard flags to compile socket extension where
+ anonymous union is required.
+ - remove redundant -be flags.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/168
-Tue Oct 27 17:06:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 28 11:32:37 2012 Yuki Yugui Sonoda <yugui@google.com>
- * defs/id.def: move internal IDs for frozen-string-literal-debug.
+ * nacl/GNUmakefile.in (.rbconfig.time): r36828 was incomplete.
+ It did not run correctly on clean build.
-Tue Oct 27 16:41:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 28 09:25:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * error.c (rb_error_frozen_object): use rb_attr_get instead of
- rb_ivar_get to get rid of warnings for string objects created
- when frozen-string-literal-debug is disabled.
+ * win32/Makefile.sub (Makefile): make to depend on common.mk, to
+ stop and force to re-run make process when common.mk is changed.
-Tue Oct 27 16:18:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Aug 27 20:19:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/logger.rb (Logger::Period#previous_period_end): as weekly
- rotation shifts the log file on Sundays, the end date of the
- previous period should be Saturdays. fix r45072.
- [ruby-dev:49314] [Bug #11622]
+ * test/etc/test_etc.rb (TestEtc#test_getgrgid): fix for non unique GID.
+ No unixen systems guarantee that GID is unique. Etc.getgrgid would
+ not return the first entry in the order of Etc.group for shared GID.
+ [ruby-core:47312] [Bug #6935]
-Tue Oct 27 16:12:37 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Aug 27 18:19:36 2012 Koichi Sasada <ko1@atdot.net>
- * vm_dump.c (rb_print_backtrace): our addr2line doesn't work on sparc.
- http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20151027T043311Z.log.html.gz
+ * include/ruby/ruby.h (rb_float_value): optimize it.
+ This technique was pointed by shinichiro.hamaji
+ <http://shinh.skr.jp/m/?date=20120825#p02>.
-Tue Oct 27 12:00:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Aug 27 15:08:25 2012 Yuki Yugui Sonoda <yugui@google.com>
- * lib/logger.rb (Logger::Period#next_rotate_time): get rid of
- adding to mday not to exceed the days of the month.
- [ruby-core:71185] [Bug #11620]
+ * common.mk (vm_trace.o): Added a missing dependency.
-Mon Oct 26 22:43:03 2015 yui-knk <spiketeika@gmail.com>
+Sun Aug 26 09:29:32 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * test/ruby/test_module.rb (test_method_defined): Add test cases
- for `public/protected/private _method_defined?`
- These methods accept string as argument, so add string argument
- cases. [Fix GH-1067]
+ * nacl/GNUmakefile.in (package): make package should install
+ example.html for nacl build
-Mon Oct 26 22:23:30 2015 SimonDKnight <simondknight@hotmail.com>
+ Patch by Takashi Toyoshima <toyoshim AT gmail.com>.
- * lib/racc/rdoc/grammar.en.rdoc: Grammatical errors fixed.
- [Fix GH-1070]
+Sun Aug 26 09:22:33 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Mon Oct 26 18:36:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
+ * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY)
+ Rewrites these variables instead of PATH.
+ NaCl port uses a toolchain which is specified by NACL_SDK_ROOT
+ environment variable. Originally, NaCl build added the toolchain
+ under the NACL_SDK_ROOT to the PATH. But updating PATH doesn't work
+ on Mac.
+ (RBCONFIG): Replaces configs with the variable updates above.
- * vm_method.c(rb_method_entry_make):
- [DOC] [ci skip] Remove a needless space from comment
- [Fixes GH-1069] Patch by @yui-knk
+ * configure.in: Thus it is no longer necessary to check $PATH.
-Mon Oct 26 17:30:13 2015 Ryan Hosford <tad.hosford@gmail.com>
+ Based on a patch by Takashi Toyoshima <toyoshim AT gmail.com>.
- * lib/fileutils.rb: rename tailing to trailing.
- [Misc #11548]
+Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 26 17:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47310]
+ [Bug #6930]
- * parse.y (call_op, call_op2): fix values on ripper. [Feature #11537]
+ * vm_core.h (VM_FRAME_TYPE_FINISH_P): ditto.
-Mon Oct 26 12:55:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 24 15:42:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (call_op2): separate from call_op and also allow "::",
- while dot_or_colon should not allow ".?". [Feature #11537]
+ * lib/mkmf.rb (create_makefile): use timestamp for destination
+ directories to make them before making or copying files there.
+ [ruby-dev:46067] [Bug #6904]
-Mon Oct 26 01:03:23 2015 Rei Odaira <Rei.Odaira@gmail.com>
+Fri Aug 24 12:40:15 2012 Luis Lavena <luislavena@gmail.com>
- * thread_pthread.c: fix compile errors when
- USE_SLEEPY_TIMER_THREAD is disabled.
+ * configure.in (mingw): add shlwapi to the list of dependency
+ libs for Windows.
+ * win32/Makefile.sub (EXTSOLIBS): ditto.
-Sun Oct 25 10:12:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h: declare internal functions rb_w32_init_file,
+ rb_file_expand_path_internal and rb_file_expand_path_fast.
- * symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537]
+ * file.c (Init_File): invoke Windows initialization rb_w32_init_file
-Sat Oct 24 22:51:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * win32/file.c (rb_file_load_path_internal): new function.
+ Windows-specific implementation that replaces file_expand_path.
+ [Bug #6836][ruby-core:46996]
- * configure.in: fixed build failure of Haiku.
- [fix GH-984] Patch by @kallisti5
- * ext/socket/getaddrinfo.c: ditto.
- * ext/socket/getnameinfo.c: ditto.
- * ext/socket/rubysocket.h: ditto.
+ * win32/file.c (rb_w32_init_file): new function. Initialize codepage
+ cache for faster conversion encodings lookup.
-Sat Oct 24 21:16:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (file_expand_path): rename to rb_file_expand_path_internal.
+ Conditionally exclude from Windows.
- * test/fileutils/test_fileutils.rb (test_uptodate): relax error
- message format. [Feature #9025], [ruby-core:71178] [Bug #11617]
+ * file.c (rb_file_expand_path_fast): new function. delegates to
+ rb_file_expand_path_internal without performing a hit to the
+ filesystem.
-Sat Oct 24 21:06:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
+ * file.c (file_expand_path_1): use rb_file_expand_path_internal without
+ path expansion (used by require).
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
- * lib/mkmf.rb: Revert r45640 because it may lead to link
- with different libruby. [Bug #9760]
+ * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast.
+ * load.c (rb_feature_provided): ditto.
-Sat Oct 24 15:42:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_file_expand_path): use rb_file_expand_path_internal with
+ path expansion.
+ * file.c (rb_file_absolute_path): ditto.
- * bootstraptest/test_method.rb: relax error message format.
+ * test/ruby/test_file_exhaustive.rb: new tests to exercise
+ rb_file_expand_path_internal implementation and compliance with
+ existing behaviors.
- * test/ruby/test_arity.rb (err_mess): ditto.
- [Feature #9025], [ruby-core:71178] [Bug #11617]
+Fri Aug 24 07:35:24 2012 Eric Hodel <drbrain@segment7.net>
-Sat Oct 24 12:47:47 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * lib/net/http/backward.rb (class Net): Restored Net::HTTPSession to
+ fix backwards-compatibility with ancient Net::HTTP. [Bug #6889]
- * vm_insnhelper.c: improved error message for "wrong number
- of arguments", distinguishing given and expected argument
- numbers clearly. [Feature #9025]
+Thu Aug 23 20:58:55 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Oct 24 11:57:59 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * common.mk: support `make id.h` without `rm .id.h.time` after
+ `rm id.h`.
- * vm_insnhelper.c: remove the typedef redeclaration of
- vm_call_handler.
+Thu Aug 23 20:48:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 24 07:29:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fixnum.rb (TestFixnum#test_singleton_method): new test.
- * lib/forwardable.rb (def_instance_delegator, def_single_delegator):
- match backtraces against ::Forwardable in case the target class
- is a subclass of BasicObject and does not include Kernel.
- [ruby-core:71176] [Bug #11616]
+ * test/ruby/test_bignum.rb (TestBignum#test_singleton_method): ditto.
-Sat Oct 24 04:10:13 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_float.rb (TestFloat#test_singleton_method): ditto.
- * iseq.c (make_compile_option_value): include frozen_string_literal*
- in a made option value.
+ * test/ruby/test_symbol.rb (TestSymbol#test_singleton_method): ditto.
- * vm_opts.h: forgot to add OPT_FROZEN_STRING_LITERAL_DEBUG
- at last commit.
+Thu Aug 23 20:34:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 24 03:58:02 2015 Koichi Sasada <ko1@atdot.net>
+ * class.c (singleton_class_of): flonum can't have singleton class.
- * ruby.c: introduce --enable-frozen-string-literal-debug option.
- If this option is enabled, the modify error will be:
- can't modify frozen String (RuntimeError) =>
- can't modify frozen String, created at test.rb:3 (RuntimeError)
+ * vm.c (vm_define_method): flonum can't have singleton method.
- * iseq.h: add compile option frozen_string_literal_debug.
+Thu Aug 23 19:18:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * compile.c: catch up this fix.
+ * common.mk (win32/*): macro RUBY_H_INCLUDES is not defined there,
+ so need to move dependency rules under the definition of it.
- * error.c (rb_error_frozen): ditto.
+Thu Aug 23 19:16:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c (set_compile_option_from_hash): ditto.
+ * win32/Makefile.sub: refactoring. remove unused rules, and update
+ some rules which are not used usually to fit current macros.
- * test/ruby/test_rubyoptions.rb: add a test for this fix.
+Thu Aug 23 16:46:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 24 02:02:24 2015 Koichi Sasada <ko1@atdot.net>
+ * file.c (rb_find_file_ext_safe, rb_find_file_safe): default to
+ US-ASCII for encdb and transdb.
- * vm_insnhelper.c: introduce new call handler for simple ISeqs.
+ * load.c (search_required): keep encoding of feature name. set
+ loading path to filesystem encoding. [Bug #6377][ruby-core:44750]
- vm_call_iseq_setup_normal_0start() is simple, however it has
- some loops/conditions depends on ISeq::param.size and
- ISeq::local_size (in vm_push_frame(), inlined into this function).
+ * ruby.c (add_modules, require_libraries): assume default external
+ encoding as well as ARGV.
- There are many simple methods which has a few parameters and local
- variables. So that this patch introduces several special functions
- generated in vm_call_iseq_optimized.inc by
- tool/mk_call_iseq_optimized.rb.
+Thu Aug 23 16:20:04 2012 Koichi Sasada <ko1@atdot.net>
- This script makes
- vm_call_iseq_setup_normal_0start_Xparams_Ylocals()
- where X is 0 to 3 and Y is 1 to 6 (as current setting).
- In this case, X * Y = 24 functions are created.
+ * include/ruby/ruby.h: introduce flonum technique for
+ 64bit CPU environment (sizeof(double) == sizeof(VALUE)).
+ flonum technique enables to avoid double object creation
+ if the double value d is in range about between
+ 1.72723e-77 < |d| <= 1.15792e+77 or 0.0.
+ flonum Float value is immediate and their lowest two bits
+ are b10.
+ If flonum is activated, then USE_FLONUM macro is 1.
+ I'll write detailed in this technique on
+ https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech
- These functions creates fast method dispatch by inlining
- vm_push_frame() with immediate params/locals sizes.
+ * benchmark/bmx_temp.rb: add an benchmark for simple
+ Float calculation.
- On my laptop, we can have the following results.
+ * gc.c (id2ref, rb_obj_id): add flonum Float support.
- vm2_method* 1.083 (8.3% faster)
- vm2_poly_method* 0.961 (3.4% slower)
+ * include/ruby/intern.h: move decl of rb_float_new(double)
+ to include/ruby/ruby.h.
- It shows 8.3% faster for inner loop method dispatch (hit inline
- cache), but 3.4% slower when inline cache miss because we need
- to find a suitable call handler.
+ * insns.def, vm.c, vm_insnhelper.c: add flonum optimization
+ and simplify source code.
- * common.mk: add a rule for vm_call_iseq_optimized.inc.
+ * vm_insnhelper.h (FLONUM_2_P): added.
- * tool/mk_call_iseq_optimized.rb: added.
+ * marshal.c: support flonum output.
- * vm.c: include vm_call_iseq_optimized.inc.
+ * numeric.c (rb_float_new_in_heap): added.
-Sat Oct 24 01:58:50 2015 Koichi Sasada <ko1@atdot.net>
+ * parse.y: support flonum.
- * vm_core.h: define vm_call_handler.
+ * random.c: ditto.
-Sat Oct 24 01:56:01 2015 Koichi Sasada <ko1@atdot.net>
+Thu Aug 23 16:12:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_core.h, vm_insnhelper.h: move definition of VMDEBUG
- from vm_insnhelper.h to vm_core.h.
+ * lib/mkmf.rb (create_makefile): add dependency to header files when
+ depend files don't exist. now we can remove simple (and often
+ wrong) depend files in most cases.
-Sat Oct 24 01:51:01 2015 Akinori MUSHA <knu@iDaemons.org>
+Thu Aug 23 16:02:20 2012 Koichi Sasada <ko1@atdot.net>
- * NEWS: [DOC] In the new safe call syntax, arguments are evaluated
- only if a call is made.
+ * ext/date/depend: add dependency to $(ruby_headers).
- * doc/syntax/calling_methods.rdoc: Fix a typo.
+Thu Aug 23 12:51:39 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sat Oct 24 00:38:34 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * insns.def (invokesuper): reverted r36640 partially to make super
+ in a thread work correctly. [ruby-core:47284] [Bug #6907]
- * lib/forwardable (def_instance_delegator, def_single_delegator):
- rescue ::Exception instead of Exception in case Exception is
- defined under the target class.
- [ruby-core:71175] [Ruby trunk - Bug #11615]
+ * test/ruby/test_super.rb: related test.
-Fri Oct 23 21:10:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 23 12:30:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * error.c (name_err_mesg_to_str): separate class names from the
- receiver description.
+ * win32/configure.bat: support --with(out)?-ext(ensions) options.
- * vm_eval.c (make_no_method_exception, raise_method_missing): add
- format specifiers for class names.
+Thu Aug 23 11:52:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 23 18:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * configure.in: Fixing Haiku build.
+ - -lbe is not required for linking
+ - stack protector doesn't work for now because of the default gcc's
+ bug
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/167
- * .gitignore: ignored environmental wrapper files.
+ * signal.c (ruby_signal): haiku doesn't have SIGBUS.
-Fri Oct 23 17:55:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Aug 23 11:32:44 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/irb.rb: Ignored assignment of STDOUT.sync = true
- when irb.rb loaded. It's affected to IDE such as Jetbrain.
- [fix GH-864] Patch by @os97673
+ * test/open-uri/test_open-uri.rb (TestOpenURI#test_read_timeout): this
+ test expects that the server thread will be killed in sleep, but 0.01
+ sec is too short to reach there.
-Fri Oct 23 16:35:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Aug 23 10:49:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
- EOL string. Patch by @kachick [fix GH-942][Bug #11513]
+ * configure.in: use the value of --with-opt-dir on building ruby
+ itself. [ruby-dev:46064] [Bug #6900]
-Fri Oct 23 16:03:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Aug 23 10:36:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * file.c: fix indent style. [fix GH-977]
- * test/ruby/test_string.rb: indent. [fix GH-975]
- [ci skip] These patches are contributed from @yui-knk
+ * common.mk (ID_H_TARGET): revert a part of r36724 and r36751. they
+ break mswin build from clean source.
-Fri Oct 23 15:46:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Aug 23 02:37:35 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * string.c: Added method signature to include hash. It's inconsistency
- with `gsub` method signature.
- [ci skip][fix GH-1023] Patch by @danielevans
+ * ext/syck: removed. Fixes [ruby-core:43360]
-Fri Oct 23 15:25:51 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/syck: removed.
- * lib/net/imap.rb: remove an empty comment line and -*-.
+ * lib/yaml.rb: only require psych, show a warning if people try to set
+ the engine to syck.
-Fri Oct 23 15:20:02 2015 Shugo Maeda <shugo@ruby-lang.org>
+Thu Aug 23 01:46:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/net/ftp.rb (gettextfile, getbinaryfile): use the safe
- navigation operator.
+ * insns.def: search up the cf stack for an object that is an instance
+ of the recipient class. Fixes [ruby-core:47186]
-Fri Oct 23 13:51:33 2015 yui-knk <spiketeika@gmail.com>
+ * test/ruby/test_super.rb: related test.
- * test_call.rb (test_safe_call): Add test cases for safe
- navigation operator assignment. [Fix GH-1064]
- Validate:
- * can assign an attribute which is `nil`
- * can "or assign" an attribute which is `nil`
+Wed Aug 22 19:46:24 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Fri Oct 23 11:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_core.c: [ruby-core:47266].
- * compile.c (iseq_peephole_optimize): optimize lengthy safe
- navigation method chain. [Feature #11537]
+Wed Aug 22 19:41:19 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Fri Oct 23 10:58:41 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/date/date_core.c: [ruby-core:47226].
- * lib/matrix/eigenvalue_decomposition.rb (tridiagonalize): fix
- indentation to avoid a warning when the command line option -w of
- ruby is specified.
+Wed Aug 22 16:57:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/matrix/eigenvalue_decomposition.rb (hessenberg_to_real_schur):
- change the name of a block parameter to avoid a warning when the
- command line option -w of ruby is specified.
+ * lib/mkmf.rb (configuration): extract least ruby headers list as
+ ruby_headers, so depend files can use default dependency
+ explicitly.
-Fri Oct 23 10:49:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 22 15:27:50 2012 Koichi Sasada <ko1@atdot.net>
- * compile.c (iseq_compile_each): support safe navigation of simple
- attribute assignment. [Feature #11537]
+ * vm_insnhelper.c (vm_setup_method): fix last commit of
+ vm_insnhelper.c (r36771). [ruby-dev:46065] [Bug #6901]
+ Should not disable tail call opt on FINISH_FRAME.
+ This flag should be propagated correctly.
- * parse.y (mlhs_node, lhs, attrset_gen): ditto. keep mid
- non-attrset as the sign of safe navigation.
+Wed Aug 22 14:05:23 2012 Koichi Sasada <ko1@atdot.net>
-Fri Oct 23 07:17:11 2015 Eric Wong <e@80x24.org>
+ * vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]
- * test/io/wait/test_io_wait.rb (test_wait_eof): test return value
+ * test/ruby/test_settracefunc.rb: add tests for above.
-Fri Oct 23 00:32:02 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * proc.c (rb_binding_new_with_cfp): add an internal function.
- * ext/openssl/ossl_ssl.c (ssl_npn_select_cb): explicitly raise error
- in ext/openssl instead of OpenSSL itself because LibreSSL
- silently truncate the selected protocol name by casting the length
- from int to unsigned char. [Bug #11369]
- Patch by Jeremy Evans <merch-redmine@jeremyevans.net>
+ * vm.c (rb_vm_control_frame_id_and_class): add an internal function.
-Fri Oct 23 00:49:45 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_trace.c: add rb_add_event_hook2() and rb_thread_add_event_hook2().
+ Give us the good name for them!
- * lib/un.rb (help): change the name of a block parameter to avoid
- a warning when the command line option -w of ruby is specified.
+Wed Aug 22 11:38:16 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Oct 23 00:22:20 2015 Josef Simanek <josef.simanek@gmail.com>
+ * .travis.yml (before_script): Turned out that make -j is broken.
- * string.c (rb_str_tr): [DOC] Escape backslash in String#tr
- documentation. [Fix GH-1063]
+Wed Aug 22 11:23:35 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Oct 23 00:19:04 2015 yui-knk <spiketeika@gmail.com>
+ * vm_insnhelper.c (vm_setup_method): should not enable tail call
+ optimization for frames with VM_FRAME_FLAG_FINISH.
+ [ruby-dev:46065] [Bug #6901]
- * array.c (rb_ary_collect): [DOC] Fix space of code example of
- Array#map. [Fix GH-1062]
+Wed Aug 22 11:20:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Oct 22 18:52:53 2015 Akinori MUSHA <knu@iDaemons.org>
+ * lib/rubygems/test_case.rb: run test with psych if exist.
- * vm_eval.c (rb_f_loop): When a loop is stopped by a StopIteration
- exception, return what the enumerator has returned instead of
- nil. [ruby-core:71133] [Feature #11498]
+Thu Aug 16 12:09:51 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Oct 22 18:25:10 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * nacl/pepper_main.c (init_loadpath): Pushes the correct load path on
+ other architectures than x86_64. Fixes #6873.
- * lib/net/imap.rb (idle): add a new argument timeout for keep-alive.
- [ruby-core:63693] [Bug #10031]
+Wed Aug 15 19:37:33 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Oct 22 15:30:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (ac_cv_func_shutdown): shutdown(2) has a dummy
+ implementation but has no declaration and does not work in
+ NativeClient SDK pepper_20.
- * compile.c (iseq_peephole_optimize): peephole optimization for
- branchnil jumps.
+Wed Aug 15 19:29:29 2012 Yuki Yugui Sonoda <yugui@google.com>
- * compile.c (iseq_compile_each): generate save navigation operator
- code.
+ * common.mk (vm_backtrace.o): Added missing dependencies.
- * insns.def (branchnil): new opcode to pop the tos and branch if
- it is nil.
+ * ext/nkf/depend (nkf.o): ditto.
- * parse.y (NEW_QCALL, call_op, parser_yylex): parse token '.?'.
- [Feature #11537]
+ * ext/ripper/depend (ripper.o) ditto.
-Thu Oct 22 13:16:19 2015 Guilherme Reis Campos <guilhermekbsa@gmail.com>
+Wed Aug 22 07:27:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * dir.c (ruby_brace_expand): glob brace expansion edge case fix.
- When there are closing braces '}' before a open brace '{' it
- must be ignored and considered as literal.
- [ruby-core:71138] [Bug #11609]
+ * lib/cgi/util.rb (CGI.escapeHTML): use &#39;
+ [ruby-core:47221] [Bug #6861]
-Thu Oct 22 13:13:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 21 21:59:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * io.c (argf_next_argv): check ARGV element type, and try
- conversion if necessary. [ruby-core:71140] [Bug #11610]
+ * lib/observer.rb: fix typo. https://github.com/ruby/ruby/pull/162 by
+ unsymbol (Philip Cunningham).
-Thu Oct 22 11:11:16 2015 Shugo Maeda <shugo@ruby-lang.org>
+Tue Aug 21 20:30:06 2012 Benoit Daloze <eregontp@gmail.com>
- * test/net/ftp/test_ftp.rb: add tests for getbinaryfile and
- gettextfile.
+ * test/fileutils/test_fileutils.rb (TestFileUtils#teardown):
+ do not assume cwd is TMPROOT and never remove current directory.
+ [ruby-core:47224][Bug #6884]
-Wed Oct 21 18:34:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 21 17:29:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (parser_magic_comment): allow a sole magic comment without
- indicators, neither other non-space comments. [Feature #8976]
+ * addr2line.c (fill_lines): need check and cast of the file size of
+ target binary because there are some platforms which off_t > size_t.
-Tue Oct 20 12:17:56 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Tue Aug 21 17:07:58 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/prime.rb: Add basic argument checking to Prime.prime?
- [Bug #11606]
+ * .travis.yml (compiler): [experimental] clang support.
-Tue Oct 20 12:17:50 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Tue Aug 21 15:44:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/prime.rb: Optimize Integer#prime?
- Patch by Nick Slocum [Bug #10354]
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
+ test/dl/test_import.rb (DL::TestImport#test_carried_function)
+ introduced by r36718.
+ the instance of the anonymous class which wraps the block should have
+ same methods and instance variables of self.
-Tue Oct 20 08:12:47 2015 Rei Odaira <Rei.Odaira@gmail.com>
+Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: pthread_getattr_np is broken on AIX.
- More specifically, the stack address and size returned are
- not correct.
+ * win32/Makefile.sub (scriptbin.mk): no need to include twice.
-Tue Oct 20 05:54:46 2015 Eric Wong <e@80x24.org>
+Tue Aug 21 10:52:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/fiddle/closure.c (callback): static function
+ * test/unit/test.rb (Test::Unit::ProxyError): new exception class to
+ wrap exceptions raised in workers in parallel test mode.
-Mon Oct 19 10:33:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/unit/parallel.rb (Test::Unit::Worker#puke): use above wrapper
+ exception.
+ [Bug #6882] [ruby-dev:46054]
- * ext/socket/init.c (rsock_raise_socket_error): get rid of a glibc
- bug. [ruby-core:71100] [Bug #11600]
+Tue Aug 21 10:40:06 2012 Koichi Sasada <ko1@atdot.net>
-Mon Oct 19 01:26:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test_continuation.rb (tracing_with_thread_set_trace_func):
+ fix to use Thread#set_trace_func(nil), not set_trace_func(nil).
- * file.c (rb_file_identical_p): not necessary to compare the paths after
- comparing the file indexes on Windows. designate by kosaki.
+Tue Aug 21 09:32:41 2012 Ryan Davis <ryand-ruby@zenspider.com>
-Sun Oct 18 21:17:27 2015 Tanaka Akira <akr@fsij.org>
+ * lib/minitest/*: Imported minitest 3.3.0 (r7676)
+ * test/minitest/*: ditto
- * lib/open-uri.rb: Specify frozen_string_literal: true.
+Tue Aug 21 09:05:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Oct 18 14:37:56 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/testunit/tests_for_parallel/ptest_forth.rb: added a test case
+ which causes an error.
- * random.c (fill_random_bytes_urandom): add a comment why using
- O_NONBLOCK and O_NOCTTY.
+ * test/testunit/test_parallel.rb: follow above change.
+ see [Bug #6882]
-Sun Oct 18 13:24:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Aug 21 05:43:00 2012 James Edward Gray II <james@graysoftinc.com>
- * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
- updating try_syscall.
+ * lib/csv.rb: Fixes #161 on github
+ * lib/csv.rb: You can now specify a pattern for :skip_lines.
+ Matching lines will not be passed to the CSV parser.
+ * lib/csv.rb: Patch by Christian Schwartz.
-Sun Oct 18 13:03:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Aug 21 05:25:41 2012 Eric Hodel <drbrain@segment7.net>
- * include/ruby/backward/util.h: Good-by Borland-C.
+ * re.c (rb_reg_initialize_m): Forgot to update output for or'd-options
+ example.
-Sun Oct 18 13:03:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Aug 21 05:18:03 2012 Eric Hodel <drbrain@segment7.net>
- * common.mk: add a comment how to use "make test-all"
+ * re.c (rb_reg_initialize_m): Update example to show that regexp
+ options use | an not || to avoid confusion.
-Sun Oct 18 12:59:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Aug 20 23:02:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk: add comments how to use "make benchmark"
+ * parse.y: more descriptive token names in syntax error messages.
-Sun Oct 18 12:58:15 2015 Tanaka Akira <akr@fsij.org>
+Mon Aug 20 20:36:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/securerandom.rb: Specify frozen_string_literal: true.
+ * vm_insnhelper.c (vm_call_method): follow iclasses as klass in cfp
+ but not included modules. [ruby-core:47241] [Bug #6891]
-Sun Oct 18 11:22:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c (vm_call_bmethod): pass defined_class to follow
+ proper ancestors. [ruby-core:47241] [Bug #6891]
- * dln.c: remove defined(__WATCOMC__).
+Mon Aug 20 11:40:27 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun Oct 18 11:16:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * common.mk: fix failed to make with -j2.
+ https://gist.github.com/3397935
- * lib/mkmf.rb: Good-by Borland-C.
+Mon Aug 20 10:51:01 2012 Shota Fukumori <sorah@tubusu.net>
-Sun Oct 18 11:04:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/test/unit.rb, lib/test/unit/parallel.rb:
+ generate error message (String) in parallel.rb instead of
+ marshalling Exception. Fixes [Bug #6882] [ruby-dev:46054]
- * numeric.c: Good-by Borland-C.
- * include/ruby/backward/rubyio.h: ditto.
- * include/ruby/backward/st.h: ditto.
- * include/ruby/backward/util.h: ditto.
- * include/ruby/backward/rubysig.h: ditto.
- * include/ruby/backward/classext.h: ditto.
- * dln.c: ditto.
- * gc.c: ditto.
- * win32/resource.rb: ditto.
- * win32/dir.h: ditto.
- * ext/tk/tcltklib.c: ditto.
- * NEWS: announce that Borland-C is no longer supported.
+Sun Aug 19 01:24:32 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sun Oct 18 10:54:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enum.c: fix docs. https://github.com/ruby/ruby/pull/129 by
+ richardkmichael (Richard Michael).
- * dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.
- see include/ruby/defines.h
- * gc.c: ditto.
- * ext/sdbm/_sdbm.c: ditto.
+Sun Aug 19 00:47:26 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sun Oct 18 10:42:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/fileutils.rb: fix typo.
+ https://github.com/ruby/ruby/pull/155 by simonc (Simon COURTOIS).
- * ruby.c (open_load_file): add a comment.
+Sat Aug 18 09:57:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 18 10:12:46 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enc/depend: fix inplace-build condition. enc.mk is generated with
+ setting $srcdir to enc, but pwd is still top build directory.
+ [ruby-core:47236] [Bug #6888]
- * file.c (rb_file_identical_p): simplify ifdefs
+Fri Aug 17 23:28:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 18 10:01:40 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * object.c (rb_any_to_s, rb_obj_inspect): preserve encodings of class
+ name and instance variable names.
- * ChangeLog: Good-bye OS/2.
- * common.mk: ditto.
- * configure.in: ditto.
- * dln_find.c: ditto.
- * ext/Setup.emx: ditto.
- * ext/extmk.rb: ditto.
- * ext/socket/extconf.rb: ditto.
- * ext/zlib/extconf.rb: ditto.
- * file.c: ditto.
- * include/ruby/defines.h: ditto.
+Fri Aug 17 12:39:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): allow to return/break from
+ the callback method. (Fiddle already allows it.)
+ [Bug #6389] [ruby-dev:45604]
+
+Thu Aug 16 19:54:24 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c, vm_core.h: simplify tracing mechanism.
+
+ (1) add rb_hook_list_t data structure which includes
+ hooks, events (flag) and `need_clean' flag.
+ If the last flag is true, then clean the hooks list.
+ In other words, deleted hooks are contained by `hooks'.
+ Cleanup process should run before traversing the list.
+ (2) Change check mechanism
+ See EXEC_EVENT_HOOK() in vm_core.h.
+ (3) Add `raw' hooks APIs
+ Normal hooks are guarded from exception by rb_protect().
+ However, this protection is overhead for too simple
+ functions which never cause exceptions. `raw' hooks
+ are executed without protection and faster.
+ Now, we only provide registration APIs. All `raw'
+ hooks are kicked under protection (same as normal hooks).
+
+ * include/ruby/ruby.h: remove internal data definition and
+ macros.
+
+ * internal.h (ruby_suppress_tracing), vm_trace.c: rename
+ ruby_suppress_tracing() to rb_suppress_tracing()
+ and remove unused function parameter.
+
+ * parse.y: fix to use renamed rb_suppress_tracing().
+
+ * thread.c (thread_create_core): no need to set RUBY_VM_VM.
+
+ * vm.c (mark_event_hooks): move definition to vm_trace.c.
+
+ * vm.c (ruby_vm_event_flags): add a global variable.
+ This global variable represents all of Threads and VM's
+ event masks (T1#events | T2#events | ... | VM#events).
+ You can check the possibility kick trace func or not
+ with ruby_vm_event_flags.
+ ruby_vm_event_flags is maintained by vm_trace.c.
+
+ * cont.c (fiber_switch, rb_cont_call): restore tracing status.
+ [Feature #4347]
+
+ * test/ruby/test_continuation.rb: ditto.
+
+Thu Aug 16 19:15:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_class_initialize): forbid inheriting uninitialized
+ class. another class tree not based on BasicObject cannot exist.
+ [ruby-core:47148][Bug #6863]
+
+Thu Aug 16 11:52:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/-ext-/test_printf.rb (Test_SPrintf#test_{taint,untrust}): use
+ plain object so that the results of to_s and inspect are infected.
+ [ruby-dev:46053] [Bug #6881]
+
+Thu Aug 16 09:46:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c: remove unnecessary macros to check traditional C.
+ https://github.com/ruby/ruby/pull/46 by lateau (Daehyub Kim).
+
+ * vsnprintf.c: remove K&R.
+
+Wed Aug 15 20:47:49 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class
+ can now benefit from the nice default #inspect even if it defines #to_s.
+ Also, there is no more unexpected change in #inspect result.
+
+ * NEWS: Add note about the change.
+
+ * bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
+ Adapt internal structures (by aliasing #inspect to #to_s) so they
+ don't rely on the removed behavior (#inspect calling overridden #to_s).
+
+ * test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
+
+ * lib/pp.rb (class PP): do not call #to_s anymore, as #inspect
+ no more does (mame).
+
+ * test/test_pp.rb (class PPInspectTest): remove related assertion (mame).
+ [ruby-core:43238][Feature #6130]
+
+ * test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown):
+ adapt DRb tests with the new change (shirosaki).
+ [ruby-core:47182][Bug #6866]
+
+Wed Aug 15 18:05:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#failed): need to delete the
+ status line if the status is skipped and -q is specified.
+
+Wed Aug 15 16:26:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (ruby__sfvextra): the result should be infected by the
+ given strings.
+
+ * sprintf.c (ruby__sfvwrite): set buffer length and exclude
+ uninitialized garbage to get correct coderange.
+
+Wed Aug 15 16:20:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (ID_H_TARGET): make timestamp file of id.h so that the
+ header will not be remade repetitively.
+
+Wed Aug 15 11:39:53 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: separate trace_func related functions from
+ thread.c.
+
+ * thread.c: ditto.
+
+ * common.mk: add vm_trace.o.
+
+ * inits.c: call Init_vm_trace().
+
+Tue Aug 14 16:25:46 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/erb/test_erb.rb (test_html_escape): add assertions for the
+ cases where the argument is not a String.
+
+Tue Aug 14 16:03:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (check_valid_dir): reject "..." as directory name.
+ [Bug #6851]
+
+Tue Aug 14 16:02:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_dotted_prefix): added.
+
+Tue Aug 14 15:39:09 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_drive_root): added.
+
+Tue Aug 14 10:38:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/erb.rb (ERB::Util.html_escape): fix r36687: call to_s before
+ passing it to CGI.escapeHTML.
+
+Mon Aug 13 13:13:19 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/erb.rb (ERB::Util.html_escape): use CGI.escapeHTML to escape
+ single quotes. [ruby-core:47138] [Bug #6861]
+
+Sun Aug 12 11:57:20 2012 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (invoke_block_from_c): fix unintentional block passing.
+ [ruby-dev:45071] [Bug #5832]
+
+Fri Aug 10 08:41:28 2012 Eric Hodel <drbrain@segment7.net>
+
+ * gc.c (gc_malloc_allocated_size): RDoc does not process macros, so
+ mention this method is only available when ruby is built with
+ CALC_EXACT_MALLOC_SIZE
+ * gc.c (gc_malloc_allocations): ditto
+
+Thu Aug 9 23:46:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkrunnable.rb: see build_os instead of target arch for
+ cross-compiling.
+
+ * configure.in (MINIRUBY): use real path for include path.
+
+ * template/fake.rb.in (builddir): remove duplications
+
+Thu Aug 9 20:03:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_special_file): add a test.
+ GetFileAttributesExW fails to get attributes of special files
+ such as pagefile.sys.
+
+ * win32/win32.c (check_valid_dir): for performance, check the path
+ by FindFirstFileW only if the path contains "..."
+
+ * win32/win32.c (winnt_stat): use GetFileAttributesExW instead of
+ FindFirstFileW since GetFileAttributesExW is faster.
+ Based on the patch by Dusan D. Majkic.
+ [ruby-core:47083] [Feature #6845]
+
+Thu Aug 9 18:33:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (proc_options): show version only once even if -v and
+ --version are given together.
+ http://twitter.com/d6rkaiz/status/233491797085671424
+
+Thu Aug 9 12:37:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/openssl/test_config.rb (OpenSSL#test_constants): skip this
+ test if platform is Mac OS X or Windows. [Bug #6830]
+
+Wed Aug 8 22:51:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (eval_under): singletons other than special constants
+ don't need cref-scope hack.
+
+Wed Aug 8 22:45:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (.y.h): split from .y.c rule to manage dependency on
+ parse.h. [ruby-core:46741] [Bug #6789]
+
+ * common.mk (id.h): keep old file unless changed.
+
+Wed Aug 8 17:11:20 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (ADD_INSNL): make ADD_INSNL as alias of ADD_INSN1.
+
+Wed Aug 8 17:08:14 2012 Koichi Sasada <ko1@atdot.net>
+
+ * bootstrap/test_exception.rb: fix a last committed test.
+
+Wed Aug 8 16:27:58 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c, insns.def (checkmatch):
+ remove checkincludearray instruction and
+ add new instruction checkmatch.
+ This change is to solve
+ [Bug #4438] "rescue args type check omitted".
+
+ * iseq.c: increment ISEQ_MAJOR_VERSION because removal of
+ checkincludearray instruction.
+
+ * vm_core.h: add several definitions for
+ the checkmatch instruction.
+
+ * vm_insnhelper.c (check_match): added.
+
+ * bootstraptest/test_exception.rb: add a test.
+
+ * test/ruby/test_exception.rb: ditto.
+
+Wed Aug 8 05:51:20 2012 Eric Hodel <drbrain@segment7.net>
+
+ * proc.c (method_clone): Added documentation. Patch by Robin Dupret.
+ Fixes #152 on github.
+
+Tue Aug 7 20:19:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (Init_readline): rl_catch_signals=0 returns
+ back. Without this, on FreeBSD9 and readline 6.2 irb can't catch ^C.
+ [Bug #5423]
+
+Tue Aug 7 20:12:39 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_exec.c, insns.def (leave): solve problems on
+ OPT_CALL_THREADED_CODE.
+ Catch up finish frame structure on OPT_CALL_THREADED_CODE.
+
+ * vm_core.h: add rb_thread_t#retval for temporary space on
+ OPT_CALL_THREADED_CODE.
+
+ * vm.c (th_init): clear rb_thread_t#retval as Qundef.
+
+ * vm_dump.c (rb_vmdebug_debug_print_pre): fix debug print format.
+
+Tue Aug 7 11:58:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_twice): added.
+
+Tue Aug 7 11:35:37 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_method.c (rb_redefine_opt_method): use RCLASS_ORIGIN to avoid
+ SEGV when a module-prepended class is refined.
+
+Tue Aug 7 10:46:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_expand_path*): refactoring. split the method
+ into some chunks of the same kind of tests.
+
+Tue Aug 7 00:31:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_special_singleton_class_of): utility function.
+
+ * vm_eval.c (eval_under): special deal for class variable scope with
+ instance_eval.
+
+ * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow method
+ definition in instance_eval of special constants. [ruby-core:28324]
+ [Bug #2788]
+
+Tue Aug 7 00:23:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (CVAR_LOOKUP): split into helper functions.
+
+Mon Aug 6 19:15:11 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
+ to pass some assertion. Thanks to Hiroshi Shirosaki.
+ [ruby-core:46873][Bug #6814]
+
+Mon Aug 6 15:54:50 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * internal.h, class.c, eval.c, insns.def: find the appropriate
+ receiver for super called in instance_eval. If such a receiver is
+ not found, raise NoMethodError. [ruby-dev:39772] [Bug #2402]
+
+Mon Aug 6 14:54:38 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * include/ruby/ruby.h, eval.c, vm_insnhelper.c: fix typo.
+
+Mon Aug 6 13:13:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (vm_call_super): since cfp->klass is always class or
+ iclass, no search from method entry.
+
+ * insns.def (defined): now should use klass in the current control
+ frame to search superclass, not me->klass. reported by naruse.
+
+Mon Aug 6 11:19:19 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/etc/test_etc.rb (TestEtc#test_getpwuid): `s' is never set to nil.
+
+Mon Aug 6 11:08:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/syslog/test_syslog_logger.rb: skip unless Syslog module is
+ available.
+
+Mon Aug 6 00:40:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): fix format specifier.
+
+Mon Aug 6 00:39:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (NUM2ULONG): optimize by inline as well as
+ NUM2LONG, and cast to unsigned long explicitly for the platforms
+ where SIZEOF_VALUE is larger than SIZEOF_LONG.
+
+ * include/ruby/ruby.h (NUM2SSIZET): fix type to cast.
+
+Sun Aug 5 21:10:36 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c : if ENABLE_VM_OBJSPACE is 1, rest_sweep is not defined.
+ remove unused declarations. [ruby-core:47004] [Bug #6837]
+
+Sun Aug 5 19:31:57 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: just move functions and so on. I don't touch any internal
+ implementation.
+
+Sun Aug 5 13:22:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: use gcc-4.2 prior to clang, gcc, and cc if exist for
+ the use of Snow Leopard's old clang. see also r36594, r36610, r36611.
+
+Sun Aug 5 06:55:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_{core,strftime}.c: [ruby-core:46990].
+
+Sat Aug 4 22:56:20 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: use inline functions instead of macros, and close up
+ related codes for the profiler.
+
+Sat Aug 4 20:37:56 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (gc_mark_children): use gc_mark_ptr instead of marking
+ a object directly.
+
+Sat Aug 4 10:02:03 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/ruby/test_alias.rb (test_super_in_aliased_module_method):
+ add a test case for [ruby-dev:46028], which fails in 1.8.
+
+Sat Aug 4 01:56:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_search_normal_superclass): no longer needs
+ receiver, klass is always unique in the ancestors now.
+
+Sat Aug 4 01:27:40 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * insns.def (invokesuper): reverted r36612 so that super in an
+ aliased method will not call the same method.
+
+Fri Aug 3 19:26:10 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * insns.def (invokesuper): don't skip the same class. instead, use
+ rb_method_entry_get_with_omod() to avoid infinite loop when
+ super is used with refinements. [ruby-core:30450] [Bug #3351]
+
+Fri Aug 3 19:21:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: use clang prior to gcc only when self-compiling on
+ darwin. search default compilers on other platforms. [Bug #6816]
+
+Fri Aug 3 17:25:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: move RUBY_MINGW32 after AC_PROG_CC.
+ RUBY_MINGW32 uses AC_TRY_CPP and it sets CC and CPP. [Bug #6816]
+
+ * configure.in: don't use AC_PROG_CC in AS_CASE.
+
+Fri Aug 3 17:21:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/runner.rb: get rid of loading previously installed gems.
+ [ruby-dev:46025]
+
+Fri Aug 3 16:40:01 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (notifications): [experimental] IRC notifications.
+
+Thu Aug 2 20:32:29 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_mod_using): new method Module#using. [experimental]
+
+ * eval.c (rb_mod_refine): new method Module#refine. [experimental]
+
+ * eval.c (f_using): new method Kernel#using. [experimental]
+
+Thu Aug 2 20:08:02 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * class.c, insns.def, method.h, proc.c, vm.c, vm_core.h, vm_eval.c,
+ vm_insnhelper.c, vm_insnhelper.h, vm_method.c: add klass to
+ rb_control_frame_t to implement super correctly.
+
+Thu Aug 2 13:23:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (AC_PROG_CC): AC_PROG_CC tries clang at first on
+ darwin. [Bug #6816]
+
+Thu Aug 2 11:39:25 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821]
+
+ * test/ruby/test_gc.rb: add test-case for this bug.
+
+Thu Aug 2 10:51:12 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * ext/openssl/lib/openssl/digest.rb
+ test/openssl/test_digest.rb: Add Digest module function to OpenSSL
+ module and test it. Patch provided by Eric Hodel.
+ [ruby-core:46908][Feature #6819]
+
+Wed Aug 1 22:29:12 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * ext/digest/digest.c (hexencode_str_new): return an ASCII string
+
+ * test/digest: tests for all kind of digests encodings
+ [ruby-core:46792][Bug #6799]
+
+Wed Aug 1 05:50:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_encoding):
+ Fix test_encoding failure on Windows.
+ With chcp 65001, 1252 and 437, test_encoding failed. Test result
+ depends on locale because LANG environment variable doesn't affect
+ locale on Windows.
+ [ruby-core:46872] [Bug #6813]
+
+Wed Aug 1 00:33:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (include_class_new): fix duplication of prepended module.
+ since m_tbl of prepended module is always zero, copy from its
+ copy iclass of original.
+
+Tue Jul 31 18:22:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (classname): tell if found name is permanent. search
+ tmp_classpath only if class id is set. [ruby-core:42865][Bug #6078]
+
+ * variable.c (rb_class_path): duplicate found temporary path.
+
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set class
+ id to find classpath.
+
+Tue Jul 31 10:36:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: updated to released version.
+
+ * ext/psych/psych.gemspec: ditto
+
+Tue Jul 31 06:18:06 2012 Eric Hodel <drbrain@segment7.net>
+
+ * time.c (time_sec): Remove extra wording about leap seconds and refer
+ directly to Wikipedia's leap second page for further information.
+ [Bug #6749]
+
+Mon Jul 30 23:01:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/platform.rb (Gem::Platform#initialize): Support pattern
+ like x86_64-netbsd6.99.7.
+
+Mon Jul 30 21:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (find_class_path): no retry when preferred is given.
+
+ * variable.c (classname): if classid is set try it to find full
+ qualified class path, and then try arbitrary class path. try
+ tmp_classpath at last even if enclosing namespace is anonymous.
+ fix r36574. [ruby-core:42865][Bug #6078]
+
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set
+ tmp_classpath instead of classpath if the name is not permanent.
+
+Mon Jul 30 14:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c: store anonymous class path in tmp_classpath but not in
+ classpath. [ruby-core:42865][Bug #6078]
+
+Mon Jul 30 13:11:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DLDFLAGS): on Darwin, deprecate -flat_namespace to get
+ rid of huge imported symbols table.
+
+ * configure.in (LIBRUBY_RELATIVE): libruby_so is not made when
+ disable-shared, so no absolute path is used for it and executable
+ file is runnable anywhere.
+
+Mon Jul 30 01:30:10 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * common.mk: add a dependency. [ruby-core:46741] [Bug #6789]
+
+Sun Jul 29 15:44:47 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * thread.c (thread_create_core): hide th->async_errinfo_mask_stack from
+ ObjectSpace.each_object. refix of r36539.
+
+Sun Jul 29 23:57:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/option.c (inet_ntop): use rb_w32_inet_ntop, instead of
+ inet_ntop directly, which is unavailable on older version Windows.
+
+ * win32/win32.c (rb_w32_inet_ntop): type should be const.
+
+Sun Jul 29 14:20:34 2012 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * thread.c (Init_Thread): does not need to set klass
+ explicitly.
+
+Sun Jul 29 06:21:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * win32/win32.c: suppress warning redeclared on mingw64.
+ *_s functions are declared if MINGW_HAS_SECURE_API is defined.
+ Follow up r36556.
+
+Sun Jul 29 00:28:46 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: remove unused initialization.
+
+Sat Jul 28 16:26:09 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * win32/win32.c (gmtime_r): use _gmtime64_s() with x86_64-w64-mingw32.
+
+ * win32/win32.c (localtime_r): use _localtime64_s() with
+ x86_64-w64-mingw32. Since FileTimeToSystemTime() seems not work with
+ large value under x64. Mingw-w64 doesn't have these declaration.
+ [ruby-core:46780] [Bug #6794]
+
+Fri Jul 27 18:25:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_check_io): make public.
+
+ * process.c (check_exec_redirect): try conversion to IO on redirect
+ parameters. [ruby-core:44181] [Bug #6269]
+
+Fri Jul 27 17:58:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_CPPOUTFILE): get rid of variable conflict so
+ CPPFLAGS is not duplicated. [ruby-core:43097] [Bug #6119]
+
+Fri Jul 27 12:12:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/mkexports.rb: should not export DllMain().
+ reported by luis at [ruby-core:46743] [Bug #6790], solved by
+ Heesob Park, and confirmed by nobu.
+
+Thu Jul 26 14:51:29 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/http/test_https.rb (TestNetHTTPS#test_session_reuse):
+ localhost is not (always) 127.0.0.1. Don't expect that.
+
+Thu Jul 26 07:18:38 2012 <kanemoto@ruby-lang.org>
+
+ * ext/json/fbuffer/fbuffer.h: avoid compilation error on AIX by
+ -ansi -std=iso9899:199409 (r36038). [ruby-core:46744] [Bug #6791].
+
+Thu Jul 26 00:42:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * thread.c (thread_create_core, Init_Thread): hide
+ th->async_errinfo_queue and th->async_errinfo_mask_stack from
+ ObjectSpace.each_object.
+
+Wed Jul 25 17:41:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * complex.c, rational.c: compatible marshal loader for compatibilities
+ with 1.8. [ruby-core:45775] [Bug #6625]
+
+Wed Jul 25 17:17:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * atomic.h: prefer GCC atomic builtins than Windows APIs, if possible,
+ since they are generic.
+
+Wed Jul 25 11:16:57 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/.document: Removed. All files in net/ should be included in
+ RDoc.
+
+Wed Jul 25 10:00:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/testunit/test_redefinition.rb: broken class/method names.
+
+Wed Jul 25 09:26:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/cgi/html.rb: Use << instead of +=.
+ `a += b` is syntax sugar of `a = a + b`; it creates a new string
+ object. `a << b` is concatenation and doesn't create new object.
+
+Wed Jul 25 09:16:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/cgi/html.rb (element_init): suppress redefine warning.
+ Don't define methods if they are already defined.
+
+Wed Jul 25 09:05:38 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Added SSL session reuse across connections for a
+ single instance to speed up connection. [Feature #5341]
+ * NEWS: ditto
+ * test/net/http/test_https.rb: Tests for #5341
+
+Wed Jul 25 06:54:24 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc: Fix spelling
+
+Wed Jul 25 06:49:12 2012 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (rb_reg_s_last_match): Update $~ to reference Regexp
+ documentation about "special global variables". [Bug #6723]
+
+Wed Jul 25 06:28:56 2012 Eric Hodel <drbrain@segment7.net>
+
+ * iseq.c: Added documentation. Patch by David Albert. [Bug #6785]
+
+Wed Jul 25 03:05:06 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * parse.y: added symbols and qsymbols productions for %i and %I
+ support. %i{ .. } returns a list of symbols without interpolation,
+ %I{ .. } returns a list of symbols with interpolation. Thanks to
+ Josh Susser for inspiration of this feature. [Feature #4985]
+
+ * ext/ripper/eventids2.c: added ripper events for %i and %I.
+
+ * test/ripper/test_parser_events.rb: ripper tests
+
+ * test/ripper/test_scanner_events.rb: ditto
+
+ * test/ruby/test_array.rb: test for %i and %I behavior
+
+Tue Jul 24 23:34:43 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * include/ruby/win32.h (rb_w32_pow): add new function.
+ We use powl() instead of broken pow() for x64-mingw32. This workaround
+ fixes test failures related to floating point numeric.
+ [ruby-core:46686] [Bug #6784]
+
+Tue Jul 24 15:01:24 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_socket, rb_w32_socketpair): remember the family
+ in the high word of socklist value.
+
+ * win32/win32.c (overlapped_socket_io, recvmsg, sendmsg, setfl): follow
+ above changes.
+
+ * win32/win32.c (rb_w32_getsockname): set remembered family to the
+ argument when OS's function fails.
+
+Tue Jul 24 12:35:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_dir_m17n.rb: remove a garbage.
+
+ * test/ruby/test_dir_m17n.rb: convert from ascii-8bit to other encoding
+ with 8bit bytes always fails.
+
+Tue Jul 24 12:32:18 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_dir_m17n.rb: sorry, typo.
+
+Tue Jul 24 12:13:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_dir_m17n.rb: refactoring. RE should be in the left side
+ of the =~ operator, and compare the result with nil is meaningless.
+
+Tue Jul 24 11:35:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_pack.rb (test_pack_unpack_M): was redefined
+ accidentally.
+
+Tue Jul 24 09:31:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Updated to RubyGems 1.8.24, a bugfix release.
+
+Tue Jul 24 08:30:15 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/ruby/test_dir_m17n.rb (create_and_check_raw_file_name): add new
+ helper method to ease encoding testing. Patch by Oleg Sukhodolsky.
+ [ruby-core:46589][Bug #6765]
+
+ * test/ruby/test_dir_m17n.rb (test_filename_extutf8): use filesystem
+ encoding when reading entries and comparing.
+
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_name): removed.
+
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_jp_name): split test.
+
+Tue Jul 24 08:09:30 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/win32ole/test_win32ole_method.rb (is_ruby64?): Correct platform
+ used to identify mingw-w64 (x64-mingw32). Patch by Hiroshi Shirosaki.
+ [ruby-core:46651][Bug #6782]
+
+Tue Jul 24 07:22:58 2012 Eric Hodel <drbrain@segment7.net>
+
+ * time.c (time_sec): Updated description of leap seconds for accuracy.
+ Based on patch by Marcus Stollsteimer. [Bug #6749]
+
+Tue Jul 24 07:03:11 2012 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (rb_str_sub): Fixed wording of documentation to match the
+ replacement operation. Minor cleanup of markup. [Bug #6719]
+ * string.c (rb_str_sub_bang): Minor wording change for clarity, minor
+ cleanup of markup.
+
+Mon Jul 23 23:58:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/Makefile.in (TARGET_NAME, TARGET_ENTRY): needed for EXTDLDFLAGS
+ on some platforms. [ruby-core:46600] [Bug #6768]
+
+ * enc/depend: no longer needs tweaking DLDFLAGS for TARGET names.
+
+Mon Jul 23 22:48:19 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb: use respond_to? to test Tempfile.
+ [ruby-dev:45995] [Bug #6781] reported by hsbt (Hiroshi SHIBATA).
+
+Mon Jul 23 14:43:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBPATHENV): LIBPATH is used on AIX, but not
+ SHLIB_PATH which was carelessly copied from HP/UX. suggested by
+ Perry Smith at [ruby-core:46397]. [Bug #6728]
+
+Mon Jul 23 01:55:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/uri/test_generic.rb (URI#test_find_proxy): add tests with
+ empty *_proxy env variables.
+
+Mon Jul 23 01:47:26 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/uri/test_generic.rb (URI#with_env): unset proxy related env
+ variables. [Bug #6774]
+
+ * test/uri/test_generic.rb (URI#test_find_proxy): fix failures
+ when proxy related env variables already set. [Bug #6774]
+
+Sun Jul 22 23:58:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts_common): increase
+ running_time_us on THREAD_TO_KILL like on THREAD_RUNNABLE.
+ This cause not to switch from a thread which is to be killed
+ on FreeBSD and Mac OS X. see also the test.
+ This issue maybe exist for long time but happens after r36430.
+
+Sat Jul 21 06:21:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: fixes for r36476. [Feature #6546]
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120720T030101Z.diff.html.gz
+
+ * lib/net/http.rb (Net::HTTP.newobj): return back for compatibility.
+
+ * lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
+ not given.
+
+ * lib/net/http.rb (Net::HTTP#initialize): ditto.
+
+ * lib/net/http.rb (Net::HTTP#proxy?): return true or false.
+
+ * lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.
+
+ * lib/net/http.rb (Net::HTTP#proxy_port): ditto.
+
+Sat Jul 21 23:12:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (ruby_init_stack): STACK_GROW_DIR_DETECTION is
+ necessary on platforms with unknown stack direction. [Bug #6761]
+
+Sat Jul 21 15:13:42 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/testcase.rb (method_added): refactoring.
+
+Sat Jul 21 14:06:41 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/testcase.rb: warn when test_* method is redefined.
+ Patch by mame (Yusuke Endoh). [Feature #2643] [ruby-core:27790]
+
+ * test/testunit/test_redefinition.rb: Test for above.
+
+ * test/testunit/test4test_redefinition.rb: Ditto.
+
+Sat Jul 21 08:41:14 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/logger.rb: Updated example in Logger comment to match other
+ examples and fixed a bug. Patch by Marcus Stollsteimer.
+ [Bug #6759]
+
+Fri Jul 20 17:20:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (rb_random_real): refine error message.
+
+Fri Jul 20 11:03:17 2012 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Updated net/http for automatic proxy detection (#6546) and
+ automatic gzip and deflate compression (#6492, #6494).
+
+Fri Jul 20 10:55:38 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Net::HTTP now automatically detects and uses
+ proxies from the environment. A proxy may also be specified as
+ before.
+
+ Net::HTTP::Proxy still creates anonymous classes, but these classes
+ are only used to store configuration information. When an HTTP
+ instance is created the configuration is now copied.
+
+ Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP
+
+ [Feature #6546]
+ * lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic.
+ * lib/uri/generic.rb: Imported find_proxy from open-uri.
+ * test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI.
+ * test/uri/test_generic.rb: Imported proxy-discovery tests from
+ open-uri.
+ * test/net/http/test_http.rb: Added tests for proxy behavior.
+
+Fri Jul 20 09:34:11 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OS
+ X (iCloud Back to my Mac addresses) for test_udp_socket since they do
+ not act as loopback addresses. [Bug #6692]
+
+Fri Jul 20 09:32:14 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Added
+ Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local
+ addresses. Part of #6692
+ * ext/socket/rubysocket.h: Add IN6_IS_ADDR_UNIQUE_LOCAL macro if
+ missing.
+ * test/socket/test_addrinfo.rb: Test for ipv6_unique_local?
+
+Fri Jul 20 07:40:32 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http/response.rb: Automatically inflate gzip and
+ deflate-encoded response bodies. [Feature #6942]
+ * lib/net/http/generic_request.rb: Automatically accept gzip and
+ deflate content-encoding for requests. [Feature #6494]
+ * lib/net/http/request.rb: Updated documentation for #6494.
+ * lib/net/http.rb: Updated documentation for #6492 and #6494, removed
+ Content-Encoding handling now present in Net::HTTPResponse.
+ * test/net/http/test_httpresponse.rb: Tests for #6492
+ * test/net/http/test_http_request.rb: Tests for #6494
+ * test/open-uri/test_open-uri.rb (test_content_encoding): Updated test
+ for automatic content-encoding handling.
+
+Fri Jul 20 03:42:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c: use #ifdef, not #if.
+
+Thu Jul 19 15:08:40 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_s_control_interrupt,
+ rb_thread_s_check_interrupt): added for
+ Thread.control_interrupt and Thread.check_interrupt.
+ See details on rdoc.
+ I'll make an ticket for this feature.
+
+ * test/ruby/test_thread.rb: add a test for Thread.control_interrupt.
+
+ * thread.c (rb_threadptr_raise): make a new exception object
+ even if argc is 0.
+
+ * thread.c (rb_thread_kill): kill thread immediately if target thread
+ is current thread.
+
+ * vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): added.
+ CHECK_INTS while/after blocking operation.
+
+ * vm_core.h (RUBY_VM_CHECK_INTS): require rb_thread_t ptr.
+
+ * cont.c (fiber_switch): use replaced RUBY_VM_CHECK_INTS().
+
+ * eval.c (ruby_cleanup): ditto.
+
+ * insns.def: ditto.
+
+ * process.c (rb_waitpid): ditto.
+
+ * vm_eval.c (vm_call0): ditto.
+
+ * vm_insnhelper.c (vm_call_method): ditto.
+
+Thu Jul 19 22:46:48 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_io.rb: remove temporally files early.
+
+Thu Jul 19 15:38:35 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * variable.c (rb_mod_class_variables): return inherited variables
+ except when the optional argument is set to false.
+ [ruby-dev:44034] [Bug #4971]
+
+ * variable.c (rb_mod_constants): fix typo in documentation.
+
+Thu Jul 19 14:30:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h: move mark function declarations that should be private.
+
+Thu Jul 19 14:18:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/init.c (rsock_init_sock): need to update max fd on all
+ platforms.
+
+Thu Jul 19 14:15:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_gc_mark_threads): remove deprecated function.
+
+Thu Jul 19 13:28:03 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ re-enable the tests because now it's OK on windows.
+
+Thu Jul 19 13:26:25 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/extconf.rb: now enable IPv6 by default on mswin.
+
+Thu Jul 19 09:33:46 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/emitter.c (initialize): allow a configuration object to be
+ passed to the constructor so that mutation isn't required after
+ instantiation.
+
+ * ext/psych/lib/psych/handler.rb: add configuration object
+
+ * ext/psych/lib/psych/visitors/emitter.rb: use configuration object if
+ extra configuration is present.
+
+Thu Jul 19 08:20:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_file.rb: remove temporally files early.
+
+Thu Jul 19 07:37:41 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * test/drb/drbtest.rb: fixed: can't delete unix domain sockets problem.
+
+Thu Jul 19 03:41:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * bignum.c: Added #include <strings.h> for ffs(). Patch by Perry
+ Smith. Thank you. [Bug #6748]
+
+Thu Jul 19 01:56:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h (rb_num_zerodiv): Added NORETURN.
+ Patched by Xi Wang. [Bug #6736]
+
+Wed Jul 18 23:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (pack_pack): round down too long uuencode width. folding
+ width in uuencode format cannot be longer than 63 bytes.
+
+Wed Jul 18 23:04:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/dbm/dbm.c (fdbm_empty_p): fix wrong condition introduced in r36438.
+
+ * ext/sdbm/init.c (fsdbm_empty_p): ditto.
+
+Wed Jul 18 23:08:57 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_beginendblock.rb: remove temporally files early.
+
+Wed Jul 18 22:43:02 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_autoload.rb: remove temporally files early.
+
+Wed Jul 18 21:59:46 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_argf.rb: use temporally directory.
+
+Wed Jul 18 19:41:19 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/test_config.rb: remove temporally files early.
+
+Wed Jul 18 17:45:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_builtin_type_name): map by index.
+
+Wed Jul 18 16:17:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (have_framework): get rid of separating -framework
+ option and its argument and dealing with the argument as a library
+ or an object name. if $LDFLAGS were an array...
+
+Wed Jul 18 16:09:10 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses/extconf.rb: support PDCurses. patched by Luis Lavena.
+ [ruby-core:46485] [Feature #6735]
+
+Wed Jul 18 15:50:25 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * parse.y (primary): allow an empty grouped expression as the
+ operand of the not operator (e.g., not ()).
+ [ruby-core:45976] [Bug #6674]
+
+ * parse.y (parser_yylex): show no warning for a grouped expression
+ as the operand of the not operator (e.g., not (a)) or as an
+ argument of a method call without parentheses (e.g., foo (a)).
+ [ruby-core:39050] [Bug #5214]
+
+Wed Jul 18 15:33:21 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_call_without_gvl2): added.
+ it can skip last CHECK_INTS. See document for more details.
+ Document about it was updated a bit.
+
+ * include/ruby/thread.h (decl. of rb_thread_call_without_gvl2): added.
+
+ * thread.c (rb_thread_call_with_gvl): remove "EXPERIMENTAL!"
+ warning from a document.
+
+Wed Jul 18 14:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (EXTDLDFLAGS): split options for each extension
+ libraries, and unused in ruby.pc. [Bug #6734]
+
+ * lib/mkmf.rb (MakeMakefile#configuration): add EXTDLDFLAGS.
+
+Wed Jul 18 14:47:23 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c: fix last commit miss.
+
+Wed Jul 18 14:16:51 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_threadptr_async_errinfo_*): manage async errors queue.
+ Async events such as an exception throwed by Thread#raise,
+ Thread#kill and thread termination (after main thread termination)
+ will be queued to th->async_errinfo_queue.
+ - clear: clear the queue.
+ - enque: enque err object into queue.
+ - deque: deque err object from queue.
+ - active_p: return 1 if the queue should be checked.
+ rb_thread_t#thrown_errinfo was removed.
+
+ * vm_core.h: add declarations of rb_threadptr_async_errinfo_*.
+ remove rb_thread_t#thrown_errinfo field and
+ add rb_thread_t#async_errinfo_queue (queue body: Array),
+ rb_thread_t#async_errinfo_queue_checked (flag),
+ rb_thread_t#async_errinfo_mask_stack(Array, not used yet).
+
+ * vm.c (rb_thread_mark): fix a mark function.
+
+ * cont.c (rb_fiber_start): enque an error.
+
+ * process.c (after_fork): clear async errinfo queue.
+
+Wed Jul 18 14:25:55 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * pack.c: (ditto) bitwise operations are not char. Apply explicit
+ casts on them.
+
+Wed Jul 18 12:59:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * encoding.c (load_encoding): explicit cast to suppress warning.
+ Though the cast truncates some bits, from heuristic analysis I
+ believe it is OK to do so here.
+
+ * bignum.c (rb_cstr_to_inum): ditto.
+
+Wed Jul 18 12:55:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/benchmark.rb: Fix Benchmark.benchmark output with an empty
+ caption. patched by Benoit Daloze. [ruby-core:45719] [Bug #6610]
+
+Wed Jul 18 10:00:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/debug.rb: Added toplevel documentation. Based on patch by Oscar
+ Del Ben. [Bug #6743], fixes #146 on github.
+
+Wed Jul 18 09:33:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole/test_win32ole_event.rb (TestWIN32OLE_EVENT): use
+ standard skip method to skip tests.
+
+Wed Jul 18 09:26:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/logger.rb: Updated typos and output to match modern Logger
+ output. Patch by Marcus Stollsteimer. [Bug #6738]
+
+Wed Jul 18 07:59:29 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/util.rb (CGI.escapeHTML,unescapeHTML): Add &apos; for HTML5
+ escaping.
+ [Feature #6620]
+
+Tue Jul 17 22:17:13 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb: call io.close! for Tempfile.
+
+Tue Jul 17 16:41:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * proc.c (rb_proc_arity): return normal value (not -n-1) if it is not
+ a labmda, or it is a labmda and no arg_opts. [Bug #5694]
+
+Tue Jul 17 03:56:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
+ are properly referenced. Patched by Joe Rafaniello via Github:
+ https://github.com/tenderlove/psych/pull/69
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * test/psych/test_alias_and_anchor.rb: test for change
+
+Mon Jul 16 23:20:24 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_float_cmp): use FIXNUM_MIN and FIXNUM_MAX,
+ instead of LONG_MIN and LONG_MAX.
+
+Mon Jul 16 22:50:41 2012 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (flo_to_s): use the exponential form if the integer part
+ is longer than or equal DBL_DIG.
+ [ruby-dev:45960] [ruby-trunk - Bug #6741]
+
+Mon Jul 16 22:01:00 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/readline/readline.c: fixed docs. [Bug #6740][ruby-core:46501]
+ patched by Nobuhiro IMAI.
+
+Mon Jul 16 19:24:01 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_float_eq): new function.
+ (rb_big_eq): use rb_integer_float_eq.
+
+ * internal.h (rb_integer_float_eq): declared.
+
+ * numeric.c (flo_eq): use rb_integer_float_eq.
+ (fix_equal): ditto.
+
+Mon Jul 16 19:02:31 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_float_cmp): rename a local variable.
+
+Mon Jul 16 18:40:26 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_integer_float_cmp): renamed from rb_big_float_cmp.
+
+ * internal.h: follow the above change.
+
+ * numeric.c: ditto.
+
+Mon Jul 16 17:57:54 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_float_cmp): compare an integer and float precisely.
+ [ruby-core:31376] [Bug #3589] reported by Tomasz Wegrzanowski.
+
+Mon Jul 16 17:29:45 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_float_cmp): support fixnum for argument x.
+
+ * numeric.c (fix_equal): use rb_big_float_cmp.
+ (fix_cmp): ditto.
+ (fix_gt): ditto.
+ (fix_ge): ditto.
+ (fix_lt): ditto.
+ (fix_le): ditto.
+ (flo_eq): ditto.
+ (flo_cmp): use rb_big_float_cmp for fixnum argument.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
+
+Mon Jul 16 17:05:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
+
+Mon Jul 16 16:56:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/fileutils.rb (FileUtils.uptodate?): remove useless parameter.
+ patched by Oscar Del Ben.[Bug #6708][ruby-core:46256]
+
+Mon Jul 16 15:37:56 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (rb_big_eq): use rb_big_float_cmp.
+
+Mon Jul 16 15:00:45 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_big_float_cmp): declared.
+
+ * bignum.c (rb_big_float_cmp): extracted from rb_big_cmp and big_op.
+ (rb_big_cmp): use rb_big_float_cmp.
+ (big_op): ditto.
+
+ * numeric.c (flo_cmp): use rb_big_float_cmp.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
+
+Mon Jul 16 14:14:21 2012 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (enum big_op_t): new type.
+ (big_op): use enum big_op_t.
+ (big_gt): ditto.
+ (big_ge): ditto.
+ (big_lt): ditto.
+ (big_le): ditto.
+
+Sat Jul 14 18:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_get_values_at): fill with nil out of range.
+ [ruby-core:43678] [Bug #6203]
+
+Sat Jul 14 17:17:55 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * cont.c (cont_restore_0): improve docs. [Bug #6706][ruby-core:46243]
+ patched by Oscar Del Ben via https://github.com/ruby/ruby/pull/140
+
+Sat Jul 14 17:08:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_s_create): raise an exception, when input elements
+ are not one or two elements arrays. [ruby-core:39945] [Bug #5406]
+
+Sat Jul 14 16:16:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): use
+ Array#uniq!.
+
+ * lib/test/unit.rb (Test::Unit::Runner#deal): deal tasks to workers.
+
+ * lib/test/unit.rb (Test::Unit::Runner#quit_workers): close and kill
+ all workers.
+
+ * lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead
+ worker from working set.
+
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): add new worker
+ to working set.
+
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): extract.
+
+ * lib/test/unit.rb (Test::Unit::Runner#start_watchdog): extract.
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move
+ initializations with nothing to release outside begin/ensure.
+
+Sat Jul 14 16:04:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_join): should not infected by separator if it is not
+ used. [ruby-core:42161][Bug #5902]
+
+Sat Jul 14 02:31:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_thread_blocking_region): fix declarations
+ prototypes without arguments in C++ have different meanings than C.
+
+Thu Jul 12 12:32:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/runner.rb: skip default gems to get rid of loading old versions
+ before installation.
+
+Thu Jul 12 11:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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]
+
+Thu Jul 12 10:46:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ cannot cross between network interfaces on Windows, so skip this test
+ until we find better test.
+
+Thu Jul 12 08:48:33 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 3.2.0 (r7598)
+ * test/minitest/*: ditto
+
+Thu Jul 12 05:11:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def (defined): use method entry and id in cfp for proper
+ superclass, since klass in iseq is shared by dynamically defined
+ methods from the same block. [ruby-core:45831][Bug #6644]
+
+Thu Jul 12 01:49:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP#connect): use local_host and local_port
+ if specified. patched by Ricardo Amorim [Feature #6617]
+
+Wed Jul 11 17:36:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb: append ENCOBJS to DLDOBJS but not EXTSOLIBS which is
+ not a target, to compile enc/encinit.c.
+
+Wed Jul 11 12:38:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): nonstatic initializer
+ of an aggregate type is a C99ism.
+
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): get rid of VC++
+ warnings.
+
+Mon Jul 9 16:11:30 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * vm_eval.c (rb_eval_string_from_file,
+ rb_eval_string_from_file_protect): new functions to replace
+ rb_compile_main_from_string() and ruby_eval_main().
+
+ * nacl/pepper_ruby.c: Follows the change in vm_eval.c
+
+Mon Jul 9 14:05:42 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ Reverts a half of r36079. As we discussed on ruby-dev@ and IRC,
+ we do not need to disclose intermediate representation of program.
+ The program embedding CRuby should use rb_eval_string family.
+ * include/ruby/ruby.h (ruby_opaque_t): removed.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string,
+ ruby_eval_main): removed.
+
+ * eval.c (ruby_eval_main_internal): became ruby_exec_internal() again.
+ (ruby_eval_main): removed.
+
+ * ruby.c (PREPARE_PARSE_MAIN) reverted.
+ (parse_and_compile_main, ruby_compile_main_from_file,
+ ruby_compile_main_from_string): removed
+
+Wed Jul 11 10:16:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby.h (HAVE_RUBY_THREAD_H): to show ruby/thread.h to be
+ available. fixup of r36355.
+
+Wed Jul 11 03:26:47 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Added streaming support to inflate processing.
+ This allows zlib streams to be processed without huge memory growth.
+ [Feature #6612]
+ * NEWS: ditto
+ * ext/zlib/zlib.c (zstream_expand_buffer): Uses rb_yield when a block
+ is given for streaming support. Refactored to use
+ zstream_expand_buffer_into to remove duplicate code.
+ * ext/zlib/zlib.c (zstream_expand_buffer_protect): Added wrapper
+ function to pass jump state back through GVL-free section to allow
+ zstream clean-up before terminating the ruby call.
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Acquire GVL to
+ yield processed chunk of output stream.
+ * ext/zlib/zlib.c (zstream_detach_buffer): When a block is given,
+ returns Qnil mid-stream and yields the output buffer at the end of
+ the stream.
+ * test/zlib/test_zlib.rb: Updated tests
+
+Tue Jul 10 22:57:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/thread.h: new header file for thread stuff.
+
+ * thread.c (rb_thread_call_without_gvl): export. [Feature#4328]
+ returns void* instead of VALUE. [Feature #5543]
+
+ * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295]
+
+Tue Jul 10 10:48:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h (NT, NtInitialize): removed unused old macros.
+
+Tue Jul 10 10:43:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * configure.in: removed --enable/disable-win95 options. (see r36342)
+
+Tue Jul 10 00:44:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/ruby.h: Removed RUBY_GLOBAL_SETUP completely. It is
+ no meaning definition since r24894.
+ * main.c: ditto.
+ * nacl/pepper_main.c: ditto.
+
+Mon Jul 9 23:59:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * dln.c: Simplify and make consistent an ifdef for Mac OS X.
+ * ext/socket/rubysocket.h: ditto.
+ * ext/tk/stubs.c: ditto.
* io.c: ditto.
- * lib/mkmf.rb: ditto.
- * missing/os2.c: ditto.
* process.c: ditto.
+ * signal.c: ditto.
+ * vm_dump.c: ditto.
+
+Mon Jul 9 17:37:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (win95_stat): removed unnecessary macro.
+
+Mon Jul 9 17:22:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omitted
+ Win9x support. removed --enable/disable-win95 options.
+
+ * include/ruby/win32.h, file.c, win32/win32.c: ditto.
+
+ * win32/README.win32: ditto.
+
+Mon Jul 9 13:28:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
+ instead of TARGET which may contain non-identifier characters.
+
+ * lib/mkmf.rb (create_makefile): add TARGET_NAME which is the first
+ part consists of only word characters. [ruby-core:46248][Bug #6709]
+
+Sun Jul 8 07:36:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
+ variables starting with _. [ruby-core:46160][Feature #6693]
+
+Sat Jul 7 23:07:30 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * test/csv/test_features.rb: add require for Tempfile.
+ * test/csv/test_serialization.rb: ditto.
+
+Fri Jul 6 06:49:50 2012 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_aref): Added a description of the behavior of
+ 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
+
+Fri Jul 6 05:38:44 2012 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (rb_str_bytesize): Improve documentation. Patch by Oscar
+ Del Ben from github issue #138.
+ * string.c (rb_str_empty): ditto.
+ * string.c (rb_str_times): ditto.
+ * string.c (rb_str_dump): ditto.
+ * string.c (rb_str_center): ditto.
+
+Fri Jul 6 04:05:59 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Use
+ ruby_xrealloc() to avoid crash with CALC_EXACT_MALLOC_SIZE.
+
+Thu Jul 5 17:32:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h: move ThreadShield declarations from intern.h.
+
+Thu Jul 5 16:00:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (ThreadShield): rename from Barrier.
+
+Thu Jul 5 15:14:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bootstraptest/runner.rb (show_progress): refine error output. do not
+ count non-empty error message, but just warn.
+
+ * bootstraptest/runner.rb (error): show errors immediately if tty.
+
+Thu Jul 5 12:28:11 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/net/http/test_httpresponses.rb: Add a test file for
+ Net::HTTPResponses and put a test case for the previous bug.
+
+Thu Jul 5 06:33:52 2012 Mark Dodwell <mark@mkdynamic.co.uk>
+
+ * lib/net/http/responses.rb: Fix 4xx classes to inherit correctly
+ from Net::HTTPClientError. [Bug #6700]
+
+Wed Jul 4 21:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ruby.c (proc_options): warn only if -K and -w option is specified.
+ see also r36274 [Feature #5206]
+
+Wed Jul 4 21:41:44 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * gc.c, atomic.h (ATOMIC_SIZE_*): moved from gc.c to atomic.h
+ [ruby-dev:45909]
+
+Wed Jul 4 19:13:15 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650]
+
+Wed Jul 4 11:52:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * gc.c (ATOMIC_SIZE_*): 64bit Windows support.
+
+Wed Jul 4 11:11:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_frame_callee, rb_f_callee_name): fix to return the
+ called id. this longstanding bug has been caused and blocked by
+ the structure of old rb_control_frame_t and rb_iseq_t.
+
+ * vm_insnhelper.c (vm_push_frame): set proper method entry.
+
+Wed Jul 4 08:29:31 2012 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_aref): Updated documentation to indicate the
+ 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.
+
+Wed Jul 4 07:05:59 2012 Eric Hodel <drbrain@segment7.net>
+
+ * test/zlib/test_zlib.rb (test_inflate_partial_input): Added test for
+ inflating incomplete zlib streams.
+
+Tue Jul 3 23:14:16 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * gc.c (ATOMIC_SIZE_EXCHANGE): fix function name on Solaris [Bug #6689]
+ [ruby-dev:45904]
+
+Tue Jul 3 16:07:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (vm_malloc_fixup, vm_xrealloc, vm_xfree, after_gc_sweep): use
+ atomic operations to update malloc_params.
+
+Tue Jul 3 14:50:16 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (zstream_run_func): Don't exit run loop for buffer
+ error. [Feature #6615]
+ * ext/zlib/zlib.c: Fix style to match existing functions.
+
+Tue Jul 3 12:05:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): also needed the workaround for VC8
+ for x64. [ruby-dev:45875] [Bug #6676]
+ reported by aves_ramphastos (Seigo Ishigane)
+
+Tue Jul 3 11:56:46 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (zstream_detach_buffer): Refactored tainting of
+ output string, moving it from the callee to zstream_detach_buffer.
+ * ext/zlib/zlib.c (rb_zstream_finish): ditto
+ * ext/zlib/zlib.c (rb_zstream_flush_next_out): ditto
+ * ext/zlib/zlib.c (rb_deflate_deflate): ditto
+ * ext/zlib/zlib.c (rb_deflate_flush): ditto
+ * ext/zlib/zlib.c (rb_inflate_inflate): ditto
+
+Tue Jul 3 11:16:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (runnable): make symbolic links to run in build directory.
+
+Tue Jul 3 10:46:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ruby.c (proc_options): warn if -K option is specified. [Feature #5206]
+
+Tue Jul 3 06:12:13 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Added RDoc location pointers for
+ Kernel#methods, Kernel#protected_methods, Kernel#private_methods and
+ Kernel#public_methods. [Bug #6666]
+
+Tue Jul 3 06:02:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (zstream_run): Process zlib streams without GVL.
+ [Feature #6615]
+ * NEWS: ditto.
+
+Mon Jul 2 22:13:04 2012 Tanaka Akira <akr@fsij.org>
+
+ * thread.c (rb_thread_aref): add explanation for why Thread#[] and
+ Thread#[]= are fiber-local and not thread-local.
+ reported by Julien A. [ruby-core:41606] [ruby-trunk - Bug #5750]
+
+Mon Jul 2 21:25:55 2012 Tanaka Akira <akr@fsij.org>
+
+ * time.c (timew_out_of_timet_range): specialization for
+ SIZEOF_TIME_T == SIZEOF_INT64_T.
+
+Mon Jul 2 17:06:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_include_module): include modules after the origin.
+
+ * class.c (include_modules_at): skip prepended modules.
+
+ * class.c (rb_prepend_module): now basic.klass in ICLASS refers the
+ old original class/module. [ruby-dev:45868][Bug #6662]
+
+ * class.c (rb_mod_ancestors): ditto.
+
+ * vm_method.c (search_method): search method entry from the origin
+ iclass.
+
+Mon Jul 2 05:54:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:46058].
+
+Mon Jul 2 05:35:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (d_lite_marshal_load): accepts old dump.
+
+Mon Jul 2 03:21:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * README.EXT.ja: fixed args of have_struct_member() ,
+ create_makefile() same as r35977. however, mkmf.rb include
+ no Japanese-docs, so Appendix C was not removed. [Bug #6597]
+
+Fri Jun 29 05:08:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit/parallel.rb: workaround fix for rubygems.
+ RubyGems can't find rake if the source directory is not equal to
+ the directory which is running the test. [Bug #6604]
+
+Thu Jun 28 20:33:15 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650]
+
+Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * class.c (class_instance_method_list): consider prepended Class/Module
+ when recur != 0. [ruby-dev:45863] [Bug #6660]
+
+ * test/ruby/test_module.rb (test_prepend_instance_methods_false): add
+ a test for it.
+
+
+Thu Jun 28 06:12:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mod_ancestors): fix ancestors order.
+ [ruby-core:45919][Bug #6658] [ruby-dev:45861][Bug #6659]
+
+Wed Jun 27 21:28:59 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * lib/racc/parser.rb: NotImplementError is not exist.
+
+ * lib/irb/output-method.rb (IRB::OutputMethod#print): ditto.
+
+Wed Jun 27 21:31:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_prepend_module): ancestors of prepending module also
+ should be included. [ruby-core:45914][Bug #6654]
+
+Wed Jun 27 21:01:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (class_instance_method_list): m_tbl in prepended
+ class/module is NULL. [ruby-core:45915][Bug #6655]
+
+Wed Jun 27 16:48:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_prepend_module): prepend module into another module.
+
+ * eval.c (rb_mod_prepend): new method Module#prepend. [Feature #1102]
+
+Wed Jun 27 09:15:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (is_popen_fork): check if fork and raise NotImplementedError if
+ unavailable.
+
+ * io.c (rb_io_s_popen): allow environment variables hash and exec
+ options as flat parameters, not in an array arguments.
+ [Feature#6651] [EXPERIMENTAL]
+
+ * process.c (rb_execarg_extract_options): extract exec options, but no
+ exceptions on non-exec options and returns them as a Hash.
+
+ * process.c (rb_execarg_setenv): set environment variables.
+
+Tue Jun 26 16:57:14 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (register_cached_thread_and_wait):
+ return immediately if malloc() failed.
+ [ruby-core:43960] [ruby-trunk - Bug #6235]
+
+ * thread_pthread.c (USE_THREAD_CACHE): check already defined or not.
+
+Tue Jun 26 10:01:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_s_popen): revert r36213 "popen: shell commands with
+ envvar" because it disabled to let single command bypass shell.
+
+Mon Jun 25 17:49:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mix_module): revert Module#mix.
+
+Mon Jun 25 16:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_mod_define_method): allow method transplanting from a
+ module to either class or module. [ruby-core:34267][Feature #4254]
+
+Mon Jun 25 11:34:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * internal.h: use rb_pid_t instead of pid_t because of there is no
+ definition of pid_t here on Windows.
+
+Mon Jun 25 00:25:01 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in (for stack end address): remove human68k specific
+ check. It is no longer supported.
+
+Sun Jun 24 23:02:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (pipe_open): merge win32 code using spawnv().
+
+Sun Jun 24 22:53:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (check_exec_fds): separate check_exec_fds_1() since
+ nonstatic initializer of an aggregate type is not allowed by C89.
+
+Sun Jun 24 07:47:17 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): options field removed.
+
+ * process.c: follow the rb_execarg change.
+
+Sat Jun 23 23:48:21 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (proc_spawn_cmd): unused variable removed to suppress a
+ warning.
+ (save_env): ditto.
+
+ [ruby-core:45797] reported by Luis Lavena.
+
+Sat Jun 23 23:19:31 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add new_pgroup_given and new_pgroup_flag
+ fields.
+
+ * process.c (EXEC_OPTION_NEW_PGROUP): removed.
+ (proc_spawn_cmd): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): use the new fields.
+ (rb_spawn_process): follow the proc_spawn_cmd change.
+
+ [ruby-core:45794] [ruby-trunk - Bug #6633] reported by Luis Lavena.
+
+Sat Jun 23 20:26:36 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add fd_dup2, fd_close, fd_open,
+ fd_dup2_child fields.
+
+ * process.c (EXEC_OPTION_DUP2): removed.
+ (EXEC_OPTION_CLOSE): removed.
+ (EXEC_OPTION_OPEN): removed.
+ (EXEC_OPTION_DUP2_CHILD): removed.
+ (mark_exec_arg): mark the new fields.
+ (check_exec_redirect1): change condition for default option.
+ (check_exec_redirect): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): follow the check_exec_redirect change.
+ (check_exec_fds): use the new fields.
+ (save_redirect_fd): ditto.
+
+Sat Jun 23 19:01:18 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_execarg_fixup): fix envopts condition.
+
+Sat Jun 23 18:44:13 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (check_exec_redirect1): extracted from
+ check_exec_redirect.
+
+Sat Jun 23 17:22:02 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (save_env): don't use EXEC_OPTION_UNSETENV_OTHERS.
+ (rb_execarg_run_options): ditto.
+
+Sat Jun 23 17:04:08 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add env_modification field.
+
+ * process.c (EXEC_OPTION_ENV): removed.
+ (mark_exec_arg): mark env_modification field.
+ (rb_exec_fillarg): update the new field, instead of options array.
+ (rb_execarg_fixup): use the new field.
+ (save_env): ditto.
+ (rb_execarg_run_options): ditto.
+
+Sat Jun 23 16:27:01 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add rlimit_limits field.
+
+ * process.c (EXEC_OPTION_RLIMIT): removed.
+ (mark_exec_arg): mark rlimit_limits field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_rlimit): use the new field.
+ (rb_execarg_run_options): clear sarg using MEMZERO. use the new
+ field.
+
+Sat Jun 23 14:29:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add chdir_given and chdir_dir fields.
+
+ * process.c (EXEC_OPTION_CHDIR): removed.
+ (mark_exec_arg): mark chdir_dir field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_run_options): use the new fields.
+
+Sat Jun 23 13:20:47 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add close_others_given, close_others_do and
+ close_others_maxhint fields.
+
+ * process.c (EXEC_OPTION_CLOSE_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (check_exec_fds): take eargp as an argument. update the
+ close_others_maxhint field.
+ (rb_execarg_fixup): follow the argument change of check_exec_fds.
+ (rb_execarg_run_options): use the new fields.
+
+Sat Jun 23 10:41:59 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add unsetenv_others_given and
+ unsetenv_others_do fields.
+
+ * process.c (EXEC_OPTION_UNSETENV_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_fixup): use the new fields.
+
+Sat Jun 23 09:35:47 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: use the variable name "soptions" for sargp->options.
+
+Sat Jun 23 09:17:49 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: use the name "sargp" for struct rb_execarg variables
+ consistently for saving process attributes.
+
+ * io.c: ditto.
+
+Sat Jun 23 07:59:57 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: use the name "eargp" for struct rb_execarg variables
+ consistently except for saving process attributes.
+
+ * io.c: ditto.
+
+ * ext/pty/pty.c: ditto.
+
+Wed Jun 20 18:27:03 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * common.mk: Add missing dependencies.
+
+Fri Jun 22 20:27:39 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg): add pgroup_given and pgroup_pgid fields.
+
+ * process.c (EXEC_OPTION_PGROUP): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_pgroup): take a struct rb_execarg argument. refer the new
+ fields.
+ (rb_execarg_run_options): follow run_exec_pgroup change.
+
+Fri Jun 22 18:48:51 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * README.EXT, README.EXT.ja: use "sval" for the third argument
+ name of Data_Wrap_Struct().
+ Suggested by @satoh_fumiyasu. Thanks!!!
+
+Fri Jun 22 18:04:26 2012 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c, vm_eval.c: set th->base_block properly.
+ th->base_block is information for (a) parsing, (b) compiling
+ and (c) setting up the frame to execute the program passed by
+ `eval' method. For example, (1) parser need to know up-level
+ variables to detect it is variable or method without paren.
+ Befor (a), (b) and (c), VM set th->base_block by passed bindng
+ (or previous frame information). After execute (a), (b) and (c),
+ VM should clear th->base_block. However, if (a), (b) or (c)
+ raises an exception, then th->base_block is not cleared.
+ Problem is that the uncleared value th->balo_block is used for
+ irrelevant iseq compilation. It causes SEGV or critical error.
+ I tried to solve this problem: to clear them before exception,
+ but finally I found out that it is difficult to do it (Ruby
+ program can be run in many places).
+ Because of this background, I set th->base_block before
+ compiling iseq and restore it after compiling.
+ Basically, th->base_block is dirty hack (similar to global
+ variable) and this patch is also dirty.
+
+ * bootstraptest/test_eval.rb: add a test for above.
+
+ * internal.h: remove unused decl.
+
+ * iseq.c (rb_iseq_compile_with_option): add base_block parameter.
+ set th->base_block before compilation and restore it after
+ compilation.
+
+ * ruby.c (require_libraries): pass 0 as base_block instead of
+ setting th->base_block
+
+ * tool/compile_prelude.rb (prelude_eval): apply above changes.
+
+ * vm.c, vm_eval.c: ditto.
+
+ * vm_core.h: add comments.
+
+Fri Jun 22 18:19:38 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: pass struct rb_execarg value instead of its options
+ field for saving process attribute changing functions.
+ (save_redirect_fd): take a struct rb_execarg argument.
+ (run_exec_dup2): ditto.
+ (run_exec_close): ditto.
+ (run_exec_open): ditto.
+ (run_exec_dup2_child): ditto.
+ (run_exec_pgroup): ditto.
+ (run_exec_rlimit): ditto.
+ (save_env): ditto.
+ (rb_execarg_run_options): follow the above functions change.
+
+Fri Jun 22 17:55:48 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_backtrace.rb: decrease recursion depth
+ to reduce consuming stack size.
+
+Fri Jun 22 13:36:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (random_init, random_load): cannot initialize frozen object
+ again, nor with tainted/untrusted object. [Bug #6540]
+
+Fri Jun 22 13:32:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_check_copyable): new function, to ensure the target is
+ not frozen and the source is not tainted nor untrusted.
+
+Fri Jun 22 05:55:20 2012 Eric Hodel <drbrain@segment7.net>
+
+ * eval.c (ruby_cleanup): Fixed typo. Patch by Trever Dawe.
+ Fixes #131 (github). [ruby-trunk - Bug #6619]
+
+Thu Jun 21 21:16:58 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_execarg_addopt): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_exec_arg_addopt): follow the rb_execarg_addopt change.
+ (check_exec_options_i): ditto.
+
+ * io.c (pipe_open): follow the rb_execarg_addopt change.
+
+ * internal.h (rb_execarg_addopt): follow the definition change.
+
+Thu Jun 21 20:34:19 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_check_exec_options): ditto.
+ (check_exec_options_i): ditto.
+
+Thu Jun 21 19:48:05 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_async_signal_safe): use rb_execarg_run_options
+ instead of rb_run_exec_options_err.
+ (rb_spawn_process): ditto.
+
+Thu Jun 21 19:02:43 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_init): follow the rb_exec_fillarg change.
+
+Thu Jun 21 18:36:43 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_execarg_init): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_new): follow the rb_execarg_init change.
+ (rb_exec_arg_init): ditto.
+
+ * internal.h (rb_execarg_init): follow the definition change.
+
+Thu Jun 21 17:20:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (new_args_tail_gen): fix GC problem of keyword rest
+ argument. the wrapped struct should be bound to the wrapping node
+ before assignment of child nodes, to get rid of the case the
+ children are referred by only the struct pointer which is not a
+ subject of GC. [ruby-core:45744]
+
+Thu Jun 21 07:06:52 2012 Koichi Sasada <ko1@atdot.net>
+
+ * error.c (err_append): rename err_append() to compile_err_append()
+ and move definition body. err_append() is used only by compiling.
+
+Thu Jun 21 06:21:54 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_execarg_fixup): take a VALUE argument instead of
+ struct rb_execarg.
+
+ * internal.h (rb_execarg_fixup): follow the definition change.
+
+ * io.c (pipe_open): follow rb_execarg_fixup change.
+
+ * ext/pty/pty.c (establishShell): ditto.
+
+Wed Jun 20 21:25:37 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (struct rb_execarg): add umask_given and umask_mask
+ fields.
+
+ * process.c (STATIC_ASSERT): removed.
+ (rb_execarg_addopt): follow the rb_execarg change.
+ (rb_execarg_run_options): ditto.
+
+Wed Jun 20 20:38:23 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (struct rb_execarg) moved and renamed from
+ struct rb_exec_arg in intern.h.
+
+ * include/ruby/intern.h (struct rb_exec_arg): refer Data object which
+ contains struct rb_execarg.
+
+ * process.c: use struct rb_execarg instead of struct rb_exec_arg
+ except functions declared in intern.h.
+ (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from
+ struct rb_exec_arg.
+ (rb_exec_arg_init): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options_err): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_exec_err): ditto.
+ (rb_exec): ditto.
+
+ * io.c: use struct rb_execarg instead of struct rb_exec_arg.
+
+ * ext/pty/pty.c: ditto.
+
+Wed Jun 20 19:13:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_execarg_new): declared.
+ (rb_execarg_get): ditto.
+
+ * process.c (mark_exec_arg): new function.
+ (free_exec_arg): ditto.
+ (memsize_exec_arg): ditto.
+ (exec_arg_data_type): defined.
+ (rb_execarg_new): new function.
+ (rb_execarg_get): ditto.
+ (rb_f_exec): use rb_execarg_new.
+ (rb_spawn_internal): ditto.
+ (rb_f_spawn): ditto.
+
+ * io.c (pipe_open_v): use rb_execarg_new.
+ (pipe_open_s): ditto.
+
+ * ext/pty/pty.c (establishShell): use rb_execarg_new.
+
+Wed Jun 20 16:36:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
+ environ on Darwin for namespace cleanness, same as [ruby-core:00537].
+ [ruby-core:45615] [Bug #6576]
+
+Wed Jun 20 11:33:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (rb_execarg_addopt): always make Fixnum, and ignore higher
+ bits in too large umask value.
+
+Wed Jun 20 11:24:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): deal with
+ sudden-death of workers.
+
+Mon Jun 18 20:34:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * time.c (init_leap_second_info): fix non-ANSI function declaration.
+
+Mon Jun 18 20:29:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ruby.c (rb_f_sub): use ansi style declaration.
+ * ruby.c (rb_f_gsub): ditto.
+ * ruby.c (rb_f_chomp): ditto.
+
+Mon Jun 18 20:26:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * random.c (rb_random_int32): get rid of "warning: constant 0x100000000
+ is so big it is long" warning.
+
+Mon Jun 18 20:07:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * dir.c (dir_initialize): get rid of "unused return: argc = rb_scan_args()"
+ warning.
+
+Mon Jun 18 19:31:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/missing.h: include math.h before checking INFINITY
+ and NAN. Otherwise, strange macro redefinition will occur.
+
+Mon Jun 18 19:12:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * array.c (ary_reverse): use ansi style declaration.
+
+Tue Jun 19 18:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/backward/rubysig.h: fix visibility. [Bug #6607]
+
+Tue Jun 19 17:51:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (rb_execarg_run_options): do not call any methods in the
+ async-signal-safe function. mask has been checked with NUM2MODET()
+ already and converted with LONG2NUM().
+
+Tue Jun 19 11:59:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (Init_readline): don't set 0 to
+ rl_catch_signals and rl_catch_sigwinch. [Bug #5423]
+
+Tue Jun 19 11:52:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_s_get_special_prefixes): suppress
+ warning: uninitialized instance variable.
+
+Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_getc): fix editline compatibility
+ broken by r36123. [Bug #6601]
+
+Mon Jun 18 17:10:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_subpos): split from rb_str_substr. returns
+ adjusted position for substring.
+
+Mon Jun 18 10:42:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_getc): deal with ESC just followed
+ by ASCII as meta prefix in incremental search mode. based on the
+ patch from rctay (Tay Ray Chuan) at [ruby-core:45682]. [Bug #6601]
+
+Sun Jun 17 22:23:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (rb_file_directory_p): move documentation for Dir.exist? from
+ file.c so that the proper description will be shown instead of the
+ documentation of File.directory?. [ruby-core:45685]
+
+Sun Jun 17 16:21:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_win32.h (rb_thread_lock_t): make a union for USE_WIN32_MUTEX.
+ this internal is used only in thread_win32.c, but has to be complete
+ to define rb_thread_t.
+
+ * thread_win32.c (native_mutex_lock, native_mutex_destroy): fix for
+ USE_WIN32_MUTEX.
+
+ * thread_win32.c (native_cond_timedwait_ms): rename reserved pattern
+ name. user defined symbols should not start with __.
+
+Sat Jun 16 19:24:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: define date_sg_t.
+
+Sat Jun 16 18:46:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_tmx.h: offset in struct tmx_funcs is now int.
+ * ext/date/date_strftime.c: ditto.
+ * ext/date/date_core.c: ditto.
+
+Sat Jun 16 18:31:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_setup): set running state in the normal case before
+ popping a tag.
+
+Sat Jun 16 07:46:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): format workers
+ results in the parent.
+
+Sat Jun 16 07:12:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/runruby.rb (File.realpath): return real path of expanded path.
+ [Bug #6598]
+
+Sat Jun 16 07:12:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bootstraptest/runner.rb (main): ignore -j option for compatibility
+ with test/unit.
+
+Sat Jun 16 07:11:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
+
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#_run_suite): report
+ unformatted results. formatting messages is not a workers task.
+
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#puke): store raw
+ results.
+
+Sat Jun 16 01:27:14 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: bumping psych to 1.3.3
+ * ext/psych/psych.gemspec: ditto
+
+Fri Jun 15 20:54:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * vm_backtrace.c (backtrace_collect): rename from backtreace_collect.
+
+Fri Jun 15 19:22:13 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).
+ Before this commit:
+ `finish frame' was place holder which indicates that VM loop
+ needs to return function.
+ If a C method calls a Ruby methods (a method written by Ruby),
+ then VM loop will be (re-)invoked. When the Ruby method returns,
+ then also VM loop should be escaped. `finish frame' has only
+ one instruction `finish', which returns VM loop function.
+ VM loop function executes `finish' instruction, then VM loop
+ function returns itself.
+ With such mechanism, `leave' instruction (which returns one
+ frame from current scope) doesn't need to check that this `leave'
+ should also return from VM loop function.
+ Strictly, one branch can be removed from `leave' instruction.
+ Consideration:
+ However, pushing the `finish frame' needs costs because
+ it needs several memory accesses. The number of pushing
+ `finish frame' is greater than I had assumed. Of course,
+ pushing `finish frame' consumes additional control frame.
+ Moreover, recent processors has good branch prediction,
+ with which we can ignore such trivial checking.
+ After this commit:
+ Finally, I decide to remove `finish frame' and `finish'
+ instruction. Some parts of VM depend on `finish frame',
+ so the new frame flag VM_FRAME_FLAG_FINISH is introduced.
+ If this frame should escape from VM function loop, then
+ the result of VM_FRAME_TYPE_FINISH_P(cfp) is true.
+ `leave' instruction checks this flag every time.
+ I measured performance on it. However on my environments,
+ it improves some benchmarks and slows some benchmarks down.
+ Maybe it is because of C compiler optimization parameters.
+ I'll re-visit here if this cause problems.
+
+ * insns.def (leave, finish): remove finish instruction.
+
+ * vm.c, vm_eval.c, vm_exec.c, vm_backtrace.c, vm_dump.c:
+ apply above changes.
+
+Fri Jun 15 19:11:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): always add skipped
+ results to the report for parallel test. [Bug #6595]
+
+Fri Jun 15 09:01:35 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * nacl/pepper_main.c: Removed an unnecessary and erroneous inclusion.
+
+Thu Jun 14 22:59:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_CPPOUTFILE): check if output is really sent to
+ specified file to tell if -o option works. [ruby-dev:45742]
+ [Bug#6591]
+
+ * configure.in (RUBY_CPPOUTFILE): check if output file is actually
+ created. [ruby-dev:45742] [Bug#6591]
+
+Thu Jun 14 22:10:50 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (proc_exec_sh): don't strip leading spaces of the script.
+
+Thu Jun 14 15:54:02 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * file.c (rb_file_s_basename, rb_file_s_dirname): documentation fix.
+ File.basename and File.dirname support File::ALT_SEPARATOR.
+
+Thu Jun 14 11:10:10 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * nacl/pepper_main.c: Applies the new embedding API to pepper_ruby.
+
+Thu Jun 14 10:44:41 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter.
+ (ruby_setup, ruby_compile_main_from_file,
+ ruby_compile_main_from_string, ruby_eval_main,
+ ruby_set_script_name): new APIs to embed CRuby.
+ (ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq
+ in particular.
+
+ * eval.c (ruby_setup): Similar to ruby_init but returns an error code
+ instead of exit(3) on error.
+ (ruby_eval_main): Similar to ruby_exec_node but returns the
+ evaluation result.
+ (ruby_eval_main_internal): renamed from ruby_exec_internal.
+
+ * ruby.c (toplevel_context): new helper function.
+ (PREPARE_EVAL_MAIN): moved.
+ (process_options): refactored with new functions.
+ (parse_and_compile_main) new helper function.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string) new API
+ (ruby_set_script_name): new API.
+
+
+Thu Jun 14 10:39:48 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * eval.c: Add doxygen comments.
+
* ruby.c: ditto.
- * NEWS: announce OS/2 is no longer supported.
-Sun Oct 18 08:50:15 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread_pthread.c: ditto
- * include/ruby/defines.h (DOSISH): add comments.
+ * version.c: ditto.
-Sun Oct 18 08:26:51 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h: ditto.
- * io.c (fptr_finalize): don't release gvl if fptr is not writable.
- writable fd may block on close(2) when it's on NFS. But readonly
- fd doesn't. [Bug #11559]
- result: make benchmark OPTS="-p bm_require_t -e ruby-trunk -e ruby-2.2.2"
- build-ruby: 0.171
- ruby 2.3.0dev(r52151): 0.659
- ruby 2.2.0p95 (r50295): 0.834
+Thu Jun 14 10:16:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Oct 18 09:32:58 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * configure.in: revert r36071 and add NetBSD to blacklist of -ansi.
- * file.c (ruby_is_fd_loadable): this should be fail if st_mode is
- not regular file nor FIFO.
+Thu Jun 14 07:59:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Oct 18 09:20:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread_pthread.c (get_stack): Linux is the only OS which includes
+ the size of guard page into the stack size.
- * ruby.c (open_load_file): use rb_thread_wait_fd() instead of reopen.
+Thu Jun 14 06:21:00 2012 Eric Hodel <drbrain@segment7.net>
-Sun Oct 18 05:11:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/drb/drb.rb: Replace broken links to the English DRb book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6544]
- * ruby.c (open_load_file): reset O_NONBLOCK after open.
- Even if S_ISREG() is true, the file may be file on FUSE filesystem
- or something. We can't assume O_NONBLOCK is safe.
- Moreover, we should wait if the path is point to FIFO. That's
- FIFO semantics. GVL should be transparent from ruby script.
- Thus, just reopen without O_NONBLOCK for filling the requirements.
- [Bug #11060][Bug #11559]
+Thu Jun 14 06:17:47 2012 Eric Hodel <drbrain@segment7.net>
- * ruby.c (loadopen_func): new for the above.
+ * lib/observer.rb: Update broken link to the Programming Ruby book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6536]
+ * lib/drb/drb.rb: ditto.
- * file.c (ruby_is_fd_loadable): new. for checks loadable file type
- of not.
- * file.c (rb_file_load_ok): use ruby_is_fd_loadble()
- * internal.h: add ruby_is_fd_loadble()
+Thu Jun 14 05:23:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * common.mk: now, ruby.o depend on thread.h.
+ * regparse.c (PFETCH_READY): suppress Wunused-but-set-variable.
- * test/ruby/test_require.rb
- (TestRequire#test_loading_fifo_threading_success): new test.
- This test successful case that loading from FIFO.
+ * regparse.c (is_onechar_cclass): restructured to clarify that c is
+ used iff found == 1.
- * test/ruby/test_require.rb
- (TestRequire#test_loading_fifo_threading_raise): rename from
- test_loading_fifo_threading. You shouldn't rescue an exception
- if you test raise or not.
- Moreover, this case should be caught IOError because load(FIFO)
- should be blocked until given any input.
+Thu Jun 14 02:54:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Oct 17 13:55:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: use -fbuiltin with -ansi -std=iso9899:199409.
+ This prevents errors introduced by disabling builtin functions,
+ which is the sub-effect of -ansi/-std.
+ Now NetBSD can use -ansi -std=iso9899:199409.
+ Maybe mingw, cygwin and darwin can also.
- * file.c (rb_file_expand_path_internal): concatenate converted
- string to the result instead of making converted string and
- append it.
+Thu Jun 14 02:53:30 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_cat_conv_enc_opts): from rb_str_conv_enc_opts,
- separate function to concatenate with transcoding.
+ * Makefile.in: don't remove macros. now name2ctype uses macros.
-Sat Oct 17 13:19:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/enc-unicode.rb: add comment why it uses Hash#index.
- * ruby.c (load_file): unify each preparations and clean-ups by
- merging load_file_internal and load_file_internal2, and remove
- nested rb_protect and rb_ensure.
+ * enc/unicode/{name2ctype.kwd,name2ctype.src,name2ctype.h.blt}:
+ update to follow the current name2ctype.h.
+ FYI current Unicode version is 6.1.
-Sat Oct 17 05:28:32 2015 Rei Odaira <Rei.Odaira@gmail.com>
+Thu Jun 14 00:16:59 2012 Akinori MUSHA <knu@iDaemons.org>
- * test/ruby/test_symbol.rb (test_symbol_fstr_leak): add a warm-up
- code and check RSS to avoid false positive on AIX and false
- negative on Mac OS X. [Bug #10686]
+ * lib/net/http/responses.rb, lib/webrick/httpstatus.rb: Add HTTP
+ response codes added in RFCs 2817 and 4918. [ruby-core:45547]
+ [Feature #6569]
-Fri Oct 16 15:54:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http/responses.rb: Rename Net::HTTPMultipleChoice to
+ Net::HTTPMultipleChoices, leaving the former as alias to the
+ latter for backward compatibility. [ruby-core:45547]
+ [Feature #6569]
- * file.c (rb_file_load_ok): open in non-blocking mode withoout
- releasing GVL. don't care about others than regular files and
- directories. [ruby-dev:49272] [Bug #11559]
+ * lib/net/http/responses.rb: Add comments about unused,
+ still-in-draft and private extension response codes.
+ [ruby-core:45547] [Feature #6569]
- * ruby.c (load_file_internal): ditto.
+Wed Jun 13 22:44:32 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/dl/test_func.rb (test_qsort1, test_qsort2): use TYPE_SIZE_T
+ for size_t variables. [ruby-dev:45733] [Bug #6584]
-Thu Oct 15 23:56:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 22:18:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (rb_sym_to_proc): make void env.
+ * configure.in: remove -ansi and -std options for lgamma_r() and
+ finite().
-Thu Oct 15 13:37:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 21:46:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (rb_sym_to_proc): move from string.c and create a Proc
- with no environments. [ruby-core:71088] [Bug #11594]
+ * configure.in: cygwin does not provide some declarations in strict
+ ANSI mode.
-Thu Oct 15 01:57:03 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Wed Jun 13 20:19:59 2012 Tanaka Akira <akr@fsij.org>
- * test/objspace/test_objspace.rb
- (test_trace_object_allocations_start_stop_clear): clear object
- allocation table first to get rid of erroneous detection for obj3.
- [ruby-dev:49095] [Bug #11271]
+ * process.c (rb_fork_internal): move a variable declaration.
-Thu Oct 15 01:53:38 2015 Benoit Daloze <eregontp@gmail.com>
+Wed Jun 13 17:54:38 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * test/ostruct/test_ostruct.rb: Add tests for OpenStruct#respond_to.
- Patch by @jeremy in [GH-1041]: https://github.com/ruby/ruby/pull/1041
+ * regparse.c (PFETCH_READY): this line was to suppress warning,
+ but did emit warnings if -Wuninitialized was set. Assigning
+ NULL instead if pfetch_prev should suffice the situation.
-Thu Oct 15 01:49:25 2015 Benoit Daloze <eregontp@gmail.com>
+Wed Jun 13 17:51:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/ostruct.rb: Finish defining OpenStruct attributes lazily.
- Patch by @sferik in [GH-1037]: https://github.com/ruby/ruby/pull/1037
- This commit is an addendum to https://github.com/ruby/ruby/pull/1033.
- It:
- 1. lazily defines attribute accessors for copied and marshaled objects,
- 2. returns nil when an attribute reader is not defined, and
- 3. defines respond_to_missing? to maintain the same respond_to? behavior
+ * configure.in: cygwin needs C99 for some stuff, e.g.,
+ pthread_attr_setstacksize, sched_yield.
-Wed Oct 14 16:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 17:50:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: check for libunwind.h, which is not available in
- very old OS X SDK. [ruby-core:71080] [Bug #11591]
+ * Makefile.in (.c.i): add warnflags to make the result consistent with
+ compilation.
-Wed Oct 14 14:11:42 2015 Brian Black <bblack@veracode.com>
+Wed Jun 13 15:12:07 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * iseq.c (rb_insn_operand_intern): change kw in callinfo disasm from the
- number of keyword arguments to an ordered list of the keywords used.
- [Feature #11589]
+ * configure.in: On Windows platforms, system provided headers are
+ VC++ optimized. That is, C++ habits are often contaminated into
+ various headers. Most frequent situation is the use of //
+ comments. We bypass ANSI C mode for them. Otherwise extension
+ libs cannot include those headers.
-Wed Oct 14 13:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 13:39:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_nextc): send a warning to ripper, not to STDERR
- always.
+ * include/ruby/win32.h: get rid of C99 style one line comments.
- * parse.y (rb_warn1, rb_warning1): move argument conversions to
- callers. PRIsVALUE is not valid in String#%.
+Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 14 13:37:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * encoding.c (enc_alias_internal): use strdup defined as macro.
- * lib/racc/rdoc/grammar.en.rdoc: fix spell error.
- [fix GH-1053][ci skip] Patch by @Matrixbirds
+Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Oct 13 22:06:50 2015 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need
+ more headers.
- * ext/socket/raddrinfo.c (rsock_fd_family): Check sa_len.
+ * process.c (rb_exec_fillarg): fix array element size. "continue" and
+ "readonly" exceeded the size.
-Tue Oct 13 12:14:10 2015 Craig Davison <craig65535@gmail.com>
+ * process.c (rb_exec_fillarg): use shell if the first word is reserved
+ or special built-in name.
+ http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
- * ext/socket/rsock_addrinfo (rsock_addrinfo): specify address
- family. [Fix GH-1052]
+ * process.c (rb_exec_fillarg): treat '=' only in the first word. if
+ the first word does not contain '=', it is the command name and
+ environment assignments cannot be anymore.
- * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send):
- address family by the receiver.
+Tue Jun 12 23:45:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Oct 11 07:09:19 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/mkmf.rb: add dummy clean-static target to prevent errors for the
+ case real clean-static target doesn't exist.
- * vm_insnhelper.c (vm_push_frame): initialize other than sp (and ep)
- first for performance.
+Tue Jun 12 22:49:42 2012 Naohisa Goto <ngotogenome@gmail.com>
-Sun Oct 11 06:21:50 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_exec_arg_fixup): fix compile error
- * vm_eval.c, internal.h (rb_yield_1): added for performance which
- doesn't check Qundef.
+Tue Jun 12 21:40:13 2012 Tanaka Akira <akr@fsij.org>
- * numeric.c (int_dotimes): use rb_yield_1.
+ * process.c (rb_exec_fillarg): treat '=' character as a meta
+ character to detect assignments preceding command name.
-Sun Oct 11 06:19:49 2015 Koichi Sasada <ko1@atdot.net>
+Tue Jun 12 20:29:19 2012 Tanaka Akira <akr@fsij.org>
- * vm_insnhelper.c (vm_call_iseq_setup_normal): setup sp first
- for performance.
+ * include/ruby/intern.h (rb_exec_arg_init): deprecated.
+ (rb_exec_arg_addopt): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_run_exec_options_err): ditto.
-Sun Oct 11 05:29:51 2015 Koichi Sasada <ko1@atdot.net>
+ * internal.h (rb_execarg_init): declared.
+ (rb_execarg_addopt): ditto.
+ (rb_execarg_fixup): ditto.
+ (rb_execarg_run_options): ditto.
- * vm.c (invoke_block_from_c): split this function into several
- functions.
+ * process.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
+ (rb_execarg_addopt): renamed from rb_exec_arg_addopt.
+ (rb_exec_arg_addopt): stub to call rb_execarg_addopt.
+ (rb_execarg_init): renamed from rb_exec_arg_init.
+ (rb_exec_arg_init): stub to call rb_execarg_init.
+ (rb_execarg_fixup): renamed from rb_exec_arg_fixup.
+ (rb_exec_arg_fixup): stub to call rb_execarg_fixup.
+ (rb_execarg_run_options): renamed from rb_run_exec_options_err.
+ (rb_run_exec_options_err): stub to call rb_execarg_run_options.
+ (rb_run_exec_options): call rb_execarg_run_options.
- * vm_insnhelper.c (vm_yield_callee_setup_arg): remove this function
- because it is only delegation function.
+ * io.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
-Sun Oct 11 03:48:46 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/pty/pty.c (establishShell): call rb_execarg_init and
+ rb_execarg_fixup.
- * gc.c (newobj_of_slowpass): fix typo (pass -> path).
- Pointed out by Yukihiro Matsumoto <matz@ruby-lang.org>.
+Tue Jun 12 18:39:59 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * gc.c (newobj_of_...): `of' is unnecessary.
+ * configure.in: enable strict ANSI mode by default in case of GCC,
+ requested by _ko1.
-Sat Oct 10 19:04:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 12 06:40:23 2012 Tanaka Akira <akr@fsij.org>
- * ext/socket/udpsocket.c (udp_connect, udp_bind): get open files
- inside ensure functions.
+ * process.c (rb_exec_fillarg): detect '#' as a meta character.
-Sat Oct 10 18:35:12 2015 Koichi Sasada <ko1@atdot.net>
+Mon Jun 11 22:15:44 2012 Tanaka Akira <akr@fsij.org>
- * vm_insnhelper.c (vm_call_method0): do not propagate enable_fastpath,
- but pass dummy CC to prevent wrong caching.
+ * include/ruby/intern.h (rb_proc_exec_n): deprecated.
+ (rb_exec): ditto.
+ (rb_exec_err): ditto.
+ (rb_fork): ditto.
+ (rb_fork_err): ditto.
-Sat Oct 10 15:28:45 2015 Koichi Sasada <ko1@atdot.net>
+Mon Jun 11 18:49:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * import a github pull request
- https://github.com/ruby/ruby/pull/1050
- by Kazuho Oku <kazuho@natadeco.co>.
+ * configure.in: on checking libexecinfo, don't specify /use/local.
+ On FreeBSD people must specify --with-opt-dir or --with-execinfo-dir.
- This pull request has the following commits.
+Mon Jun 11 12:14:37 2012 Koichi Sasada <ko1@atdot.net>
- * gc.c: reduce # of args to 6 (max. of register args on x86-64) so
- that the `newobj_of_slowpass` can be called via TCO.
+ * vm_core.h: remove lfp (local frame pointer) and rename
+ dfp (dynamic frame pointer) to ep (environment pointer).
+ This change make VM `normal' (similar to other interpreters).
+ Before this commit:
+ Each frame has two env pointers lfp and dfp. lfp points
+ local environment which is method/class/toplevel frame.
+ lfp[0] is block pointer.
+ dfp is block local frame. dfp[0] points previous (parent)
+ environment pointer.
+ lfp == dfp when frame is method/class/toplevel.
+ You can get lfp from dfp by traversing previous environment
+ pointers.
+ After this commit:
+ Each frame has only `ep' to point respective environment.
+ If there is parent environment, then ep[0] points parent
+ environment (as dfp). If there are no more environment,
+ then ep[0] points block pointer (as lfp). We call such ep
+ as `LEP' (local EP). We add some macros to get LEP and to
+ detect LEP or not.
+ In short, we replace dfp and lfp with ep and LEP.
+ rb_block_t and rb_binding_t member `lfp' and `dfp' are removed
+ and member `ep' is added.
+ rename rb_thread_t's member `local_lfp' and `local_svar' to
+ `root_lep' and `root_svar'.
+ (VM_EP_PREV_EP(ep)): get previous environment pointer. This macro
+ assume that ep is not LEP.
+ (VM_EP_BLOCK_PTR(ep)): get block pointer. This macro assume
+ that ep is LEP.
+ (VM_EP_LEP_P(ep)): detect ep is LEP or not.
+ (VM_ENVVAL_BLOCK_PTR(ptr)): make block pointer.
+ (VM_ENVVAL_BLOCK_PTR_P(v)): detect v is block pointer.
+ (VM_ENVVAL_PREV_EP_PTR(ptr)): make prev environment pointer.
+ (VM_ENVVAL_PREV_EP_PTR_P(v)): detect v is prev env pointer.
+
+ * vm.c: apply above changes.
+ (VM_EP_LEP(ep)): get LEP.
+ (VM_CF_LEP(cfp)): get LEP of cfp->ep.
+ (VM_CF_PREV_EP(cfp)): utility function VM_EP_PREV_EP(cfp->ep).
+ (VM_CF_BLOCK_PTR(cfp)): utility function VM_EP_BLOCK_PTR(cfp->ep).
+
+ * vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, insns.def:
+ apply above changes.
+
+ * cont.c: ditto.
+
+ * eval.c, eval_intern.h: ditto.
- * gc.c (newobj_of), string.c (str_duplicate): for performance,
- the hot functions must be inlined.
+ * proc.c: ditto.
- * gc.c: for performance, preceding arguments of `.*newobj_of.*`
- must be same, so that the arg registers can be reused in case of
- TCO.
+ * thread.c: ditto.
-Sat Oct 10 08:52:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c: ditto.
- * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send): fix
- memory leaks at closed socket.
+ * vm_exec.h: fix function name (on vm debug mode).
-Fri Oct 9 17:29:07 2015 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jun 11 11:52:18 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/net/ftp.rb (parse257): refactor.
+ * compile.c (iseq_set_sequence): nonstatic initializer of an
+ aggregate type is a C99ism.
-Fri Oct 9 16:42:26 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * compile.c (enum compile_array_type_t): comma at the end of enum
+ list is a C99ism.
- * lib/net/imap.rb: use frozen_string_literal: true.
+ * vm_backtrace.c (enum LOCATION_TYPE): ditto.
- * test/net/imap/test_imap.rb: ditto.
+Mon Jun 11 06:31:33 2012 Tanaka Akira <akr@fsij.org>
- * test/net/imap/test_imap_response_parser.rb: ditto.
+ * process.c (rb_proc_exec_n): revert the function removed at r35889.
-Fri Oct 9 15:52:28 2015 Shugo Maeda <shugo@ruby-lang.org>
+Mon Jun 11 06:20:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/ftp.rb: use frozen_string_literal: true.
+ * thread_pthread.c (rb_thread_create_timer_thread): assign return
+ value to the variable err.
- * test/net/ftp/test_buffered_socket.rb: ditto.
+Mon Jun 11 06:17:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/net/ftp/test_ftp.rb: ditto.
+ * thread_pthread.c (native_cond_initialize): fix typo in r36022.
+ this cause a failure on FreeBSD 8.2 amd64.
+ http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20120610T130201Z.diff.html.gz
- * test/net/ftp/test_mlsx_entry.rb: ditto.
+Mon Jun 11 05:21:57 2012 Koichi Sasada <ko1@atdot.net>
-Fri Oct 9 14:12:35 2015 Shota Fukumori (sora_h) <her@sorah.jp>
+ * .gdbinit (SDR): add SDR function. It's only for VM debugging.
- * ext/openssl/lib/openssl/ssl.rb: Revert r52082 because it was
- dropping TLS v1.1 support too. Supporting only TLS v1.2 is too
- early, because many popular websites still don't support it.
+Sun Jun 10 21:50:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- For instance, Servers where aws-sdk connects to still don't support
- TLS v1.2 and it became broken.
+ * nacl/nacl_config.rb: Fixed for 32bit hosts.
- We should consider more carefully about this.
+Sun Jun 10 20:23:14 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- [Fix GH-873] [Feature #11524]
+ Fixes threading on NativeClient.
-Fri Oct 9 12:52:08 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * thread_pthread.c (timer_thread_sleep): Extracted out a function from
+ thread_timer(). Added an alternative implementation for platforms
+ that lacks select(2) or pipe(2).
+ (rb_thread_create_timer_thread, native_cond_initialize,
+ native_cond_destroy): Replaced wrong HAVE_XXX checks.
- * compile.c (iseq_compile_each): Dynamic string literals (e.g.,
- "#{x}") should not be frozen because they don't literally
- represent strings.
- https://twitter.com/shugomaeda/status/651937650027401216
- https://twitter.com/yukihiro_matz/status/651942882312482817
- https://twitter.com/yukihiro_matz/status/651980835181096960
+ * configure.in (pthread_attr_init): New check.
-Fri Oct 9 06:52:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Jun 10 21:30:11 2012 Tanaka Akira <akr@fsij.org>
- * benchmark/prepare_require.rb: skip file creation if it already
- exist. Suggested by ko1.
+ * process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.
+ (rb_exec_err): new stub function to call
+ rb_exec_without_timer_thread.
+ (rb_f_exec): call rb_exec_without_timer_thread.
+ (rb_exec): call rb_exec_without_timer_thread.
-Fri Oct 9 06:18:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * benchmark/bm_require.rb: new benchmark for require.
- * benchmark/bm_require_thread.rb: new benchmark for conflicting
- require vs thread. like [Bug #11559]
- * prepare_require.rb: new file for preparing above tests.
- * prepare_require.rb: ditto.
+Sun Jun 10 21:13:10 2012 Tanaka Akira <akr@fsij.org>
-Thu Oct 8 14:10:45 2015 Zachary Scott <zzak@ruby-lang.org>
+ * process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.
- * ext/openssl/lib/openssl/ssl.rb: Default to TLSv1.2 and drop TLS v1
- Patch provided by @claudijd [Fixes GH-873] [Feature #11524]:
- https://github.com/ruby/ruby/pull/873
+Sun Jun 10 20:55:59 2012 Tanaka Akira <akr@fsij.org>
-Wed Oct 7 22:55:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_fork_ruby): call rb_fork_internal directly.
- * test/minitest/metametameta.rb (with_output): restore output to
- fix mixing test result output in worker responses.
+Sun Jun 10 20:19:40 2012 Tanaka Akira <akr@fsij.org>
-Wed Oct 7 21:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_fork_ruby): new function.
+ (rb_f_fork): use rb_fork_ruby instead of rb_fork.
+ (rb_daemon): ditto.
- * string.c (str_duplicate): move from rb_str_resurrect to short
- circuit initialization.
+ * io.c (pipe_open): use rb_fork_ruby instead of rb_fork.
-Wed Oct 7 20:43:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_fork_ruby): declared.
- * string.c (rb_str_resurrect): fix resurrection of short enough to
- be embedded but not embedded string.
+Sun Jun 10 18:58:16 2012 Akinori MUSHA <knu@iDaemons.org>
-Wed Oct 7 20:17:29 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/net/http/response.rb: Remove a duplicated rdoc and leave a
+ pointer.
- * gc.c (newobj_of): divide fast path and slow path
- to avoid register savings for fast path.
+ * lib/net/http/responses.rb: Add RFC numbers to base on.
- This idea is given by Kazuho Oku <kazuho@natadeco.co>.
+Sun Jun 10 18:31:42 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-Wed Oct 7 17:30:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_NACL): Warns if $PATH does not contain the path
+ to NativeClient SDK. PATH variable redefinition in GNUmakefile does
+ not work for GNU make 3.81.
- * string.c (rb_str_times): optimize for the argument 0 and 1.
+Sun Jun 10 17:54:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 7 01:20:46 2015 Koichi Sasada <ko1@atdot.net>
+ * gc.h (IS_STACK_DIR_UPPER): utility macro.
- * gc.h, gc.c: introduce new debug function rb_obj_info_dump(VALUE obj)
- which prints the result of rb_raw_obj_info(..., obj).
+ * thread_pthread.c (get_stack): seems stack size does not include
+ guard size on Mac OS X.
-Wed Oct 7 01:16:11 2015 Koichi Sasada <ko1@atdot.net>
+ * thread_pthread.c (ruby_init_stack): adjust stack size for offset of
+ addr from the bottom.
- * vm_args.c: remove an unused field args_info::calling.
+Sun Jun 10 15:49:47 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 6 23:43:10 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (retry_fork): call after_fork except in a child process.
+ (rb_fork_internal): restrict after_fork call condition.
- * proc.c (rb_method_entry_min_max_arity): should support
- OPTIMIZED_METHOD_TYPE_CALL.
+Sun Jun 10 14:19:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 6 21:29:08 2015 Tanaka Akira <akr@fsij.org>
+ * configure.in: NetBSD 6 adds libexecinfo but it only works on amd64.
+ http://www.mail-archive.com/source-changes-full@netbsd.org/msg38729.html
- * lib/tmpdir.rb (Dir.tmpdir): return duplicated string to be
- modify safely even when $SAFE > 0.
+Sun Jun 10 12:43:23 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 6 19:24:38 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_f_exec): call rb_exec_async_signal_safe except on
+ Mac OS X. cf. the comment in before_exec_non_async_signal_safe.
- * vm_insnhelper.c (vm_call_method0): use switch() for visibilities
- (for readability).
+Sun Jun 10 12:15:18 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 6 19:23:58 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (popen_exec): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_exec_err.
+ (pipe_open): use rb_fork_async_signal_safe instead of rb_fork_err.
- * proc.c (Init_Proc): Proc#call and others should be public.
+Sun Jun 10 11:44:57 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 6 18:51:51 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_fork_internal): call after_fork only unless
+ chfunc_is_async_signal_safe.
- * method.h: IMEMO_FL_USER3 and IMEMO_FL_USER4 is not needed any more.
+Sun Jun 10 11:33:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 6 18:47:45 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_pkey_ec.c
+ test/openssl/test_pkey_ec.rb: Add support for EC_POINT_mul.
+ Patch provided by Sambasiva Suda. Thanks!
+ [ruby-core:44408][ruby-trunk - Feature #6310]
- * method.h: remove METHOD_ENTRY_SAFE(me) and related code
- because $SAFE = 3 and 4 is not available.
- Now, $SAFE is not checked on method dispatch at all.
+Sun Jun 10 10:48:15 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
+ * lib/openssl/ssl.rb: Use a simple random number to generate the
+ session id. MD5, as was used before, causes problems when
+ using a FIPS version of OpenSSL. Issue was found by Jared
+ Jennings, thank you!
+ [ruby-trunk - Bug #6137]
-Tue Oct 6 13:56:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jun 10 10:27:34 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * include/ruby/ruby.h: turn function macros into inline functions,
- for debuggers.
+ * NEWS: Add note about the new private key export behavior.
- * include/ruby/ruby.h: turn constant macros into enums, for
- debuggers.
+Sun Jun 10 10:24:51 2012 Tanaka Akira <akr@fsij.org>
-Tue Oct 6 13:48:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * process.c (rb_exec_async_signal_safe): exported.
- * method.h: typo fix. Patch by @davydovanton [fix GH-1032][ci skip]
+ * ext/pty/extconf.rb: modify $INCFLAGS to include internal.h
-Tue Oct 6 06:54:34 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/pty/pty.c: include internal.h.
+ (chfunc): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_f_exec.
+ (establishShell): set up earg. use rb_fork_async_signal_safe
+ instead of rb_fork_err.
- * iseq.c (rb_iseq_free): free iseq::variable_body to avoid memory
- leak.
+ * internal.h (rb_exec_async_signal_safe): declared.
+ (rb_fork_async_signal_safe): declared.
-Tue Oct 6 06:32:52 2015 Koichi Sasada <ko1@atdot.net>
+Sun Jun 10 10:21:37 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * proc.c: enable optimization of Proc#call.
- [Feature #11569]
+ * ext/openssl/ossl.c
+ ext/openssl/ossl_pkey_rsa.c
+ ext/openssl/ossl_pkey_dsa.c
+ ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less
+ than four characters long, as OpenSSL itself does not allow this.
+ Issue found by Eric Hodel.
+ * ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem,
+ following the PKey interface contract.
+ * test/openssl/test_pkey_dsa.rb
+ test/openssl/test_pkey_rsa.rb
+ test/openssl/test_pkey_ec.rb: Add tests that assert correct
+ behaviour when dealing with passwords that are less than four
+ characters long.
+ [ruby-core: 42281][ruby-trunk - Bug #5951]
- * NEWS: write about this optimization and incompatibilities.
+Sun Jun 10 10:14:26 2012 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_backtrace.rb: catch up this fix.
+ * process.c (rb_f_exec): use rb_exec_arg_prepare.
-Tue Oct 6 04:41:03 2015 Koichi Sasada <ko1@atdot.net>
+Sun Jun 10 06:43:51 2012 Tanaka Akira <akr@fsij.org>
- * vm_insnhelper.c: solve goto spaghetti.
+ * process.c: split after_exec into async-signal-safe part and rest.
+ (after_exec_async_signal_safe): extracted from after_exec.
+ (after_exec_non_async_signal_safe): ditto.
+ (after_exec): call them.
+ (rb_exec_async_signal_safe): call after_exec_async_signal_safe.
+ (rb_exec_err): call after_exec_non_async_signal_safe instead of
+ after_exec.
- Change all goto statement across blocks to tail call functions.
+Sun Jun 10 06:21:10 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 6 02:29:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: document new features of Ruby OpenSSL.
- * string.c (rb_str_resurrect): optimize by short circuit to copy
- hidden string without checking length, encoding and so on.
+Sun Jun 10 03:09:41 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Oct 5 23:08:17 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * ext/openssl/ossl.c: Fix error in example. Patch by David Albert.
- * test/ruby/test_thread.rb (test_handle_interrupt_blocking): check if
- exception handling was postponed until sleep.
+ Add/extend existing documentation. Examples now also cover RSA
+ signatures and PBKDF2.
+ [ruby-core: 45154][ruby-trunk - Bug #6475]
-Mon Oct 5 22:25:49 2015 Tanaka Akira <akr@fsij.org>
- * lib/pp.rb: Use frozen_string_literal: true.
+Sun Jun 10 01:41:45 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/prettyprint.rb: Ditto.
+ * ext/openssl/ossl_ssl.c: Introduce SSLContext#renegotiation_cb and
+ remove SSLContext#disable_client_renegotiation and related
+ functionality introduced in r35797. The new callback approach
+ gives clients maximum flexibility to decide on their own what to
+ do on renegotiation attempts.
+ Add documentation for SSL module and SSLError.
+ * test/openssl/test_ssl.rb: Add a test for
+ SSLContext#renegotiation_cb.
- * lib/resolv.rb: Ditto.
+Sun Jun 10 01:37:18 2012 Tanaka Akira <akr@fsij.org>
- * lib/tmpdir.rb: Ditto.
+ * process.c (rb_fork_internal): initialize exc.
- * test/test_pp.rb: Ditto.
+Sun Jun 10 00:19:25 2012 Tanaka Akira <akr@fsij.org>
- * test/test_prettyprint.rb: Ditto.
+ * process.c: don't use non async-signal-safe functions in a child
+ process before exec, for invoking a command.
+ (rb_exec_atfork): call rb_exec_async_signal_safe only.
+ (retry_fork): take chfunc_is_async_signal_safe argument. call
+ before_fork and after_fork only unless chfunc_is_async_signal_safe.
+ (send_child_error): take chfunc_is_async_signal_safe argument.
+ send an exception only unless chfunc_is_async_signal_safe.
+ (recv_child_error): take chfunc_is_async_signal_safe argument.
+ receive an exception only unless chfunc_is_async_signal_safe.
+ (rb_fork_internal): renamed from rb_fork_err and take
+ chfunc_is_async_signal_safe argument.
+ use rb_protect only unless chfunc_is_async_signal_safe.
+ (rb_fork_err): call rb_fork_internal with false as
+ chfunc_is_async_signal_safe.
+ (rb_fork_async_signal_safe): call rb_fork_internal with true as
+ chfunc_is_async_signal_safe.
+ (rb_spawn_process): call rb_fork_async_signal_safe instead of
+ rb_fork_err.
- * tool/transcode-tblgen.rb: Ditto.
+Sat Jun 9 23:57:03 2012 Tanaka Akira <akr@fsij.org>
-Mon Oct 5 20:39:32 2015 Benoit Daloze <eregontp@gmail.com>
+ * process.c (rb_fork_err): rewrite a complex "if" statement.
- * test/ruby/test_thread.rb: fix potential race condition.
- The thread could have a "sleep" status because it tries
- to acquire the mutex, but does not have it yet.
+Sat Jun 9 23:44:29 2012 Tanaka Akira <akr@fsij.org>
-Mon Oct 5 15:39:30 2015 Zachary Scott <zzak@ruby-lang.org>
+ * process.c (before_exec_async_signal_safe): extracted from
+ before_exec.
+ (before_exec_non_async_signal_safe): ditto.
+ (before_exec): call before_exec_async_signal_safe and
+ before_exec_non_async_signal_safe.
+ (rb_exec_async_signal_safe): call before_exec_async_signal_safe.
+ (rb_exec_err): call before_exec_non_async_signal_safe instead of
+ before_exec.
- * numeric.c: [DOC] Overview for Numeric class by Joe Corcoran
- This patch was created at ROSSConf Berlin 2015 [Bug #11555]
+Sat Jun 9 23:36:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 5 15:34:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (iseq_load, insn_operand_intern, rb_iseq_disasm)
+ (rb_iseq_parameters): use rb_id2str() instead of rb_id2name() to
+ keep encoding.
- * proc.c (proc_new): link ep to calling block.
- [ruby-core:70980] [Bug #11566]
+ * string.c (rb_str_symname_p): new function that checks if the string
+ is valid as a symbol name. split from sym_inspect().
-Mon Oct 5 00:53:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 9 22:27:05 2012 Tanaka Akira <akr@fsij.org>
- * dir.c (rb_dir_getwd): make ASCII-8BIT if filesystem encoding is
- US-ASCII, like as Dir.glob.
+ * process.c (retry_fork): rewrite a complex "for" statement by
+ simple statements.
-Sun Oct 4 23:39:09 2015 Tanaka Akira <akr@fsij.org>
+Sat Jun 9 21:50:04 2012 Tanaka Akira <akr@fsij.org>
- * enum.c (nmin_filter): Fix limit value.
- patch by Helder Pereira.
- [Bug #11471] [ruby-core:70477]
+ * process.c (retry_fork): extracted from rb_fork_err.
+ (send_child_error): ditto.
+ (recv_child_error): ditto.
-Sun Oct 4 15:11:48 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jun 9 17:21:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
- and if invalid, return 1. [Bug #11486]
+ * iseq.c (iseq_load): type is a symbol, and invalid as ID in common.
-Sun Oct 4 10:09:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 9 10:57:14 2012 Tanaka Akira <akr@fsij.org>
- * dir.c (rb_dir_getwd): normalize OS path to UTF-8 on OS X.
+ * process.c (rb_exec_async_signal_safe): extracted from rb_exec_err.
-Sun Oct 4 00:09:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 9 09:31:07 2012 Tanaka Akira <akr@fsij.org>
- * template/ruby-runner.c.in: wrapper to set dynamic loading path
- environment variable. /bin/sh on Mac OS X 10.11 (El Capitan)
- clears DYLD_LIBRARY_PATH.
+ * process.c: simplified because close_others option is always
+ enabled by default.
+ (rb_f_exec): don't need to set the option.
+ (rb_exec_arg_prepare): don't need to set the option. don't need
+ default_close_others argument.
+ (rb_spawn_internal): don't need to give default_close_others
+ argument for rb_exec_arg_prepare. don't need default_close_others
+ argument.
+ (rb_spawn_err): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_spawn): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_f_system): don't need to give default_close_others argument for
+ rb_spawn_internal.
+ (rb_f_spawn): don't need to give default_close_others argument for
+ rb_exec_arg_prepare.
- it must:
- - do nothing even if current directory is not present
- - do not set other environment variables, e.g. PWD, SHLVL, etc
- - do not open other FDs, e.g. pipes for timer thread
+Sat Jun 9 09:00:58 2012 Tanaka Akira <akr@fsij.org>
-Sun Oct 2 10:59:00 2015 schneems <richard.schneeman@gmail.com>
+ * process.c (rb_proc_exec): call before_exec() here addition to
+ rb_exec_err.
- * ext/pathname/lib/pathname.rb: freeze string literals for
- reduced object allocation.
- [Feature #11375] [ruby-core:70043]
+Sat Jun 9 08:30:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 2 09:20:20 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * thread_pthread.c (ruby_init_stack): use stack info if possible.
- * common.mk, lib/unicode_normalize/tables.rb: Change Unicode
- Version for character normalization data from 7.0.0 to
- 8.0.0.
+Sat Jun 9 08:21:32 2012 Eric Hodel <drbrain@segment7.net>
-Fri Oct 2 00:18:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * README.EXT (prepare extconf.rb): Added note to see MakeMakefile for
+ documentation of extconf.rb functions. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6522]
+ * README.EXT (Appendix C): Removed in favor of MakeMakefile.
+ Patch by Zachary Scott.
+ * lib/mkmf.rb: Merged documentation from README.EXT Appendix C. Patch
+ by Zachary Scott.
- * proc.c (proc_mark): block.ep of Proc from Symbol is now NULL.
- [ruby-core:70961] [Bug #11560]
+Sat Jun 9 08:16:47 2012 Eric Hodel <drbrain@segment7.net>
-Wed Sep 30 15:47:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/re.rdoc: Completed wording in the description of the =~ operator.
+ [ruby-trunk - Bug #6529]
- * vm_args.c (vm_caller_setup_arg_block): bypass Symbol#to_proc
- call to optimize symbol block passing.
+Sat Jun 9 08:09:38 2012 Eric Hodel <drbrain@segment7.net>
-Wed Sep 30 01:34:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_start_with): Removed "p" from start_with? examples
+ 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.
- * parse.y (parser_free): fix memory leak at syntax error when
- warn-indent is enabled.
+Sat Jun 9 07:56:03 2012 Eric Hodel <drbrain@segment7.net>
-Tue Sep 29 22:27:50 2015 Benoit Daloze <eregontp@gmail.com>
+ * lib/benchmark.rb: Updated formatting of Benchmark documentation for
+ consistency. [ruby-trunk - Bug #6533]
- * parse.y: fix minor typo. [ci skip][fix GH-1038].
- Patch by @ltratt.
+Sat Jun 9 07:46:26 2012 Eric Hodel <drbrain@segment7.net>
-Tue Sep 29 16:53:53 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * lib/delegate.rb: Added documentation for Delegator#!. Patch by
+ Zachary Scott. [ruby-trunk - Feature #6534]
- * tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
- get rid of many .freeze commands by using frozen_string_literal
- pragma.
+Sat Jun 9 07:39:50 2012 Eric Hodel <drbrain@segment7.net>
-Tue Sep 29 16:37:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http/responses.rb: Add RFC 6585 response codes. Patch by
+ Sangil Jung. [ruby-trunk - Feature #6480]
+ * lib/net/http/response.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/webrick/httpstatus.rb: ditto
- * compile.c (compile_dstr_fragments): fix performance by omitting
- the first empty string only for keeping literal encoding if
- other literals are too. [ruby-core:70930] [Bug #11556]
+Sat Jun 9 01:24:28 2012 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_append_literal): append but keep encoding non
- US-ASCII.
+ * process.c (rb_exec_err): before_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
-Mon Sep 28 17:40:17 2015 Shugo Maeda <shugo@ruby-lang.org>
+Sat Jun 9 01:11:07 2012 Tanaka Akira <akr@fsij.org>
- * lib/net/ftp.rb (mtime): use usec instead of fractions to parse
- decimal fractions of a second correctly when the number of digits
- is not 6.
+ * include/ruby/intern.h (rb_exec_arg_init): declaration changed to
+ return a value.
-Mon Sep 28 16:07:08 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * process.c (rb_exec_arg_init): return a value.
- * lib/net/ftp.rb (mtime): parse decimal fractions of a second as
- specified in RFC 3659.
+Fri Jun 8 23:44:14 2012 Tanaka Akira <akr@fsij.org>
-Mon Sep 28 10:31:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * process.c: don't check the availability of FD_CLOEXEC. It should
+ be available if fork() is available.
- * test/test_forwardable.rb: Write basic tests for lib/forwardable.
- [fix GH-1035] Patch by @kachick
+ * io.c: ditto.
-Sun Sep 27 23:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 8 22:39:32 2012 Tanaka Akira <akr@fsij.org>
- * class.c (rb_define_class, rb_define_class_id_under): refine
- error messages.
+ * process.c (rb_fork_err): revert r35955. The condition needs !chfunc
+ to close ep[0] and ep[1]. The catched exception is re-raised
+ immediately after that if status is not NULL.
- * class.c (rb_define_module, rb_define_module_id_under): ditto,
- and make consistent with class.
+Fri Jun 8 19:43:33 2012 Tanaka Akira <akr@fsij.org>
-Sun Sep 27 18:44:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
- * ChangeLog: removed duplicated message.
+Fri Jun 8 19:00:59 2012 Tanaka Akira <akr@fsij.org>
-Sun Sep 27 15:46:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (ARGV_COUNT): unused macro removed.
+ (ARGV_SIZE): ditto.
+ (ALLOC_ARGV): ditto.
+ (ALLOC_ARGV_WITH_STR): ditto.
- * ruby.c (process_options): add an option to enable/disable
- frozen-string-literal. [Feature #8976]
+Fri Jun 8 16:19:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (iseq_compile_each): override compile option by option
- given by pragma.
+ * test/runner.rb (src_testdir): expand real path so that
+ TestGem#test_self_find_files does not fail by aliased load path when
+ srcdir contains a symbolic link.
- * iseq.c (rb_iseq_make_compile_option): extract a function to
- overwrite rb_compile_option_t.
+ * tool/runruby.rb (srcdir): ditto.
- * parse.y (parser_set_compile_option_flag): introduce pragma to
- override compile options.
+Fri Jun 8 12:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (magic_comments): new pragma "frozen-string-literal".
- [Feature #8976]
+ * process.c (rb_fork_err): error state in the child process is prior
+ to exceptions in proc_syswait().
-Sun Sep 27 08:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_fork_err): determine status on errors.
- * lib/ostruct.rb (delete_field): do not raise NameError for
- existing keys. [Fix GH-1033]
+ * ext/pty/pty.c (establishShell): reraise exception if something
+ raised during sleep.
-Sun Sep 27 00:34:31 2015 Zachary Scott <zzak@ruby-lang.org>
+ * ext/pty/pty.c (establishShell): now needs status to protect from
+ exceptions in rb_fork_err().
- * lib/ostruct.rb: Move method definitions for getter/setter to be lazy
- Patch by @sferik in [GH-1033]: https://github.com/ruby/ruby/pull/1033
+Thu Jun 7 22:13:05 2012 Tanaka Akira <akr@fsij.org>
-Fri Sep 25 10:07:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * process.c (rb_fork_err): Fix the condition to use rb_protect.
- * lib/net/http.rb: removed unused variable. It's removed at r13648.
- [fix GH-1022] Patch by @nkondratyev
+Thu Jun 7 20:29:12 2012 Tanaka Akira <akr@fsij.org>
-Fri Sep 25 09:48:27 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * include/ruby/intern.h: rb_exec_arg and related stuff moved back from
+ internal.h
- * gems/bundled_gems: upgrade to minitest-5.8.1
+Thu Jun 7 15:53:03 2012 Koichi Sasada <ko1@atdot.net>
-Fri Sep 25 09:47:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * .gdbinit: add function `trace_machine_instructions' to trace
+ in native machine assemble.
+ See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
+ for more details.
- * id_table.c: fix typo. [ci skip][fix GH-1031] Patch @davydovanton
+Wed Jun 6 21:31:21 2012 Tanaka Akira <akr@fsij.org>
-Fri Sep 25 07:54:05 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * process.c (proc_exec_cmd) renamed from proc_exec_v.
+ (proc_exec_sh): renamed from rb_proc_exec_e.
+ (proc_spawn_cmd_internal): renamed from proc_spawn_v.
+ (proc_spawn_cmd): renamed from proc_spawn_n.
+ (proc_spawn_sh): renamed from proc_spawn.
- * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_lock): skip
- this test on AIX. The issue is the same as on Solaris.
- [ruby-dev:47631]
+Wed Jun 6 21:18:47 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Sep 24 17:25:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (try_with_sh): please take care of the macro defined by
+ you.
- * parse.y (paren_args): fix separator token at `foo::bar()` in
- ripper.
+Wed Jun 6 20:45:08 2012 Tanaka Akira <akr@fsij.org>
-Thu Sep 24 00:00:17 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * process.c (proc_exec_v): don't call dln_find_exe_r here because it
+ is not async-signal-safe and proc_exec_v is called in a child
+ process.
+ command_abspath field of rb_exec_arg.
+ (rb_exec_fillarg): call dln_find_exe_r and set command_abspath.
+ (rb_exec_err): Give the absolute path of the invoking command for
+ proc_exec_v, instead of the command name.
- * complex.c: ruby/config.h must be included before math.h
- because it defines _LARGE_FILES on AIX and _LARGE_FILES
- must be defined before sys/types.h is included from math.h.
- [Bug #11483]
+ * internal.h: add command_abspath field for rb_exec_arg.
-Wed Sep 23 22:22:38 2015 Zachary Scott <zzak@ruby-lang.org>
+Wed Jun 6 20:08:01 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkcs12*: Remove svn commit id macro
+ * process.c (try_with_sh): take envp argument.
+ (exec_with_sh): ditto. use it for execve.
+ (proc_exec_v): provide envp for try_with_sh.
-Wed Sep 23 01:11:28 2015 Zachary Scott <zzak@ruby-lang.org>
+Wed Jun 6 13:25:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/*: Remove svn commit id macros to make sync easier
+ * win32/win32.c, include/ruby/win32.h (rb_w32_wrap_io_handle): new API.
+ this API wraps an I/O handle (HANDLE or SOCKET) and returns fd.
+ the second parameter should be combination of O_*, for example,
+ O_RDWR | O_BINARY | O_NOINHERIT.
-Tue Sep 22 04:20:01 2015 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * win32/win32.c, include/ruby/win32.h (rb_w32_unwrap_io_handle): new
+ API. this API unwraps an I/O handle and close the fd (not closes
+ the handle itself).
- * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027]
- patch by voxik.
+ [Feature #4906] [ruby-core:37227]
- * test/rinda/test_rinda.rb: ditto
+Wed Jun 6 13:18:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Sep 21 20:53:39 2015 tbpgr <tbpgr@tbpgr.jp>
+ * win32/win32.c (rb_w32_close): of course, console handle is not socket.
- * test/win32ole/test_win32ole_event.rb: fix typo.
- swbemsink_avairable? => swbemsink_available? [Fix GH-1025]
+Wed Jun 6 12:37:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Sep 20 10:07:35 2015 Anton Davydov <antondavydov.o@gmail.com>
+ * process.c (rb_run_exec_options_err): allocate a temporary buffer for
+ run_exec_dup2() for restoring fds on non-fork environments.
- * cont.c (rb_callcc): [DOC] append continuations example accros
- methods. [Fix GH-1026]
+Wed Jun 6 09:45:21 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Sep 20 03:20:21 2015 Koichi Sasada <ko1@atdot.net>
+ * test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.
- * iseq.c (rb_iseq_free): free rb_iseq_t::body::cc_entries.
+Wed Jun 6 05:27:54 2012 Tanaka Akira <akr@fsij.org>
-Sun Sep 20 02:46:34 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_exec_fillarg): check use_shell field before accessing
+ a union field.
- * vm_core.h: split rb_call_info_t into several structs.
- * rb_call_info (ci) has compiled fixed information.
- * if ci->flag & VM_CALL_KWARG, then rb_call_info is
- also rb_call_info_with_kwarg. This technique reduce one word
- for major rb_call_info data.
- * rb_calling_info has temporary data (argc, blockptr, recv).
- for each method dispatch. This data is allocated only on
- machine stack.
- * rb_call_cache is for inline method cache.
+Wed Jun 6 04:58:44 2012 Tanaka Akira <akr@fsij.org>
- Before this patch, only rb_call_info_t data is passed.
- After this patch, above three structs are passed.
+ * process.c (rb_spawn_process): prog variable is not used for Unix.
- This patch improves:
- * data locality (rb_call_info is now read-only data).
- * reduce memory consumption (rb_call_info_with_kwarg,
- rb_calling_info).
+Wed Jun 6 00:20:37 2012 Tanaka Akira <akr@fsij.org>
- * compile.c: use above data.
+ * internal.h (rb_exec_arg_init): change return type to void.
- * insns.def: ditto.
+ * process.c (rb_exec_arg_init): don't return a value.
+ (rb_exec_arg_prepare): ditto.
+ (rb_spawn_process): don't take the prog argument. extract the
+ information from earg.
+ (rb_spawn_internal): follow rb_spawn_process change.
+ (rb_f_spawn): ditto.
+
+ * io.c (pipe_open): don't take the prog argument. extract the
+ information from eargp.
+ (pipe_open_v): follow pipe_open change.
+ (pipe_open_s): ditto.
+
+Tue Jun 5 23:51:33 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_exec_arg): use union to represent command invocation
+ with/without shell.
+
+ * process.c: follow the rb_exec_arg change.
+
+ * io.c (pipe_open): ditto.
+
+Tue Jun 5 22:28:46 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: rb_exec_arg and related stuff moved from intern.h
+
+ * include/ruby/intern.h (rb_proc_exec_n): removed.
+
+Tue Jun 5 21:57:22 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_arg_fixup): allocate a temporary buffer for
+ run_exec_dup2 here because it should be async-signal-safe.
+ (run_exec_dup2): use the temporary buffer.
+ (run_exec_dup2_tmpbuf_size): new function.
+
+ * include/ruby/intern.h (rb_exec_arg): add dup2_tmpbuf field.
+
+Tue Jun 5 20:13:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_obj_init_copy): should check if trusted too.
+
+Tue Jun 5 19:59:13 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (strtok): declaration removed because it is not used.
+
+Tue Jun 5 19:33:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (proc_spawn): don't detect simple command line here
+ because rb_exec_fillarg already did.
+
+Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): bail out a loop eagerly.
+
+Tue Jun 5 19:15:14 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: add comments about async-signal-safe.
+
+ * io.c: ditto.
+
+Tue Jun 5 09:25:10 2012 Eric Hodel <drbrain@segment7.net>
+
+ * io.c: Edited documentation for IO and File open and new and
+ Kernel#open for consistency and clarity.
+
+Mon Jun 4 21:53:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_sysinit): let the system not display the
+ critical-error-handler message box and the Windows Error Reporting
+ dialog. [ruby-core:45389] [Bug #6535]
+
+Mon Jun 4 19:36:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): allocate one more element before
+ beginning in argv_str for try_with_sh.
+
+ * internal.h (ARGVSTR2ARGC): adjust for the above change.
+ (ARGVSTR2ARGV): ditto.
+
+Mon Jun 4 19:17:06 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (ARGVSTR2ARGC): defined.
+ (ARGVSTR2ARGV): defined.
+
+ * process.c (proc_exec_v): use ARGVSTR2ARGV.
+ (rb_spawn_process): use ARGVSTR2ARGC and ARGVSTR2ARGV.
+
+ * io.c (pipe_open): use ARGVSTR2ARGV.
+
+Mon Jun 4 16:13:00 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.h: remove magical code "lfp[0] & 0x02".
+ Current VM doesn't use this bit.
+
+ * vm_core.h (RUBY_VM_GET_BLOCK_PTR): added.
+
+ * eval.c (rb_block_given_p): use RUBY_VM_GET_BLOCK_PTR().
+
+ * vm_eval.c (rb_f_block_given_p): ditto.
+
+Mon Jun 4 15:39:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (constat_apply): apply VT100 functions.
+ [ruby-core:44958] [Feature #6418]
+
+ * win32/win32.c (constat_parse): parse some VT100 escape sequence.
+
+Mon Jun 4 14:06:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (rb_exec_err): should preserve errno.
+
+Mon Jun 4 13:10:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/dl/test_c_{struct_entry,union_entity}.rb: broken require.
+
+Mon Jun 4 12:01:21 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_backtrace.rb: fix test.
+ Windows path includes `:' character.
+
+Mon Jun 4 11:42:39 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h (rb_location_t): fix type and field name.
+ (1) rename rb_location_t to rb_iseq_location_t.
+ (2) rename field names of rb_iseq_location_t to adjust
+ RubyVM::Backtrace::Location methods.
+ (2-1) filename -> path
+ (2-2) filepath -> absolute_path
+ (2-3) basename -> base_label
+ (2-4) name -> label
+ (3) rename filed name rb_iseq_location_t#line_no to
+ rb_iseq_location_t#first_lineno to clear purpose of this field.
+ (4) The field names rb_binding_t#(filename|line_no) are also renamed
+ to rb_binding_t#(path|first_lineno).
+
+ * compile.c: apply above changes.
* iseq.c: ditto.
- * vm_args.c: ditto.
+ * proc.c: ditto.
+
+ * vm*.c: ditto.
+
+Mon Jun 4 11:40:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using
+ compatible loader.
+
+Mon Jun 4 11:33:42 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (rb_run_exec_options_err): restore save_env() call for
+ non-fork environments.
+
+ * process.c (rb_exec_err): restore environments after the failure of
+ exec to fix [ruby-core:44093] [Bug #6249] on non-fork environments
+
+Mon Jun 4 10:42:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (pipe_open): follow up changes in r35889.
+
+ * process.c (proc_spawn_n): now uses char ** instead of VALUE *.
+
+ * process.c (rb_spawn_process): prog is now VALUE of String, not char *.
+
+Mon Jun 4 06:12:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): remove old warning for _alloc.
+
+Mon Jun 4 04:24:06 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * marshal.c: experimental test aborted.
+ * complex.c: ditto.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
+
+Mon Jun 4 00:45:18 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_spawn_process): fix for Windows. not tested.
+
+Mon Jun 4 00:11:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_proc_exec_e): don't use ISSPACE(). \f, \r and \v
+ are not word separator in Bourne shell.
+
+Sun Jun 3 23:47:30 2012 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_exec_arg): remove argc and argv fields.
+ add use_shell, argv_str and argv_buf fields.
+
+ * process.c (rb_proc_exec_e): don't split shell command line arguments
+ here to avoid memory allocation in a child process.
+ (rb_exec_fillarg): split shell command line arguments here.
+ (proc_exec_v): takes argv_str argument instead of argv.
+ (rb_proc_exec_ne): removed.
+ (rb_proc_exec_n): removed.
+ (rb_run_exec_options_err): don't initialize the removed fields.
+ (rb_exec_err): don't initialize the removed fields.
+ call proc_exec_v directly instead of rb_proc_exec_ne.
+ (rb_spawn_process): use use_shell field.
+
+Sun Jun 3 21:53:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328]
+ http://www.gnu.org/licenses/gpl-2.0.txt
+
+Sun Jun 3 21:22:52 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_getargs): remove rb_exec_arg argument.
+
+Sun Jun 3 21:14:26 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().
+ But now disabled. [experimental]
+ * complex.c: followed the above.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
+
+Sun Jun 3 21:18:17 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_check_argv): use rb_str_new_frozen instead of
+ rb_str_new4.
+
+Sun Jun 3 20:10:52 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_proc_exec_e): extended version of rb_proc_exec() to
+ call execle().
+ (rb_proc_exec): use rb_proc_exec_e().
+ (rb_exec_err): use rb_proc_exec_e().
+
+Sun Jun 3 19:47:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (vm_living_thread_num): suppress a warning.
+
+Sun Jun 3 17:23:52 2012 Tanaka Akira <akr@fsij.org>
+
+ * use execve() to preserve environment variables when exec method is
+ failed. [ruby-core:44093] [ruby-trunk - Bug #6249]
+
+ * include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field
+ to store envp of execve().
+
+ * process.c (proc_exec_v): takes envp_str as an argument and use it
+ for execve().
+ (rb_proc_exec_ne): extended version of rb_proc_exec_n().
+ (rb_proc_exec_n): use rb_proc_exec_ne().
+ (rb_proc_exec): follow proc_exec_v() change.
+ (fill_envp_buf_i): new function.
+ (rb_exec_arg_fixup): set up envp_str and envp_buf.
+ (save_env_i): removed.
+ (save_env): removed.
+ (rb_run_exec_options_err): don't modify environment variables.
+ (rb_exec_err): use rb_proc_exec_ne().
+
+Sun Jun 3 16:33:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c: revert r35879 "now marshal_{load|dump} are external."
+
+ * complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}.
+
+ * rational.c (nurat_marshal__{dump,load}): ditto.
+
+Sun Jun 3 14:13:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: checks whether the object is frozen or not.
+
+Sun Jun 3 14:00:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: wrote Complex#_dump and Complex::load. But now
+ disabled (due to compatibility) [experimental].
+
+ * rational.c: wrote Rational#_dump and Rational::load. ditto.
+
+Sun Jun 3 10:23:32 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (nucomp_marshal_load): [ruby-core:45394]
+ * rational.c (nurat_marshal_load): ditto.
+
+Sun Jun 3 03:15:46 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regparse.c (onig_number_of_names): suppress a warning.
+
+Sun Jun 3 01:36:52 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: change names.
+ (1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location.
+ (2) Method name: RubyVM::FrameInfo.caller ->
+ Kernel.caller_locations.
+ (3) Instance methods of
+ RubyVM::FrameInfo (RubyVM::Backtrace::Location)
+ (3-1) name -> label
+ (3-2) basename -> base_label (basename is confusing with
+ File.basename)
+ (3-3) line_no -> lineno (We have already similar name
+ File#lineno, commented by kou [ruby-dev:45686]).
+ (3-4) filename -> path.
+ (3-5) filepath -> absolute_path.
+ (3-5) iseq -> removed (we will make other APIs to access iseq
+ and other information of frame for debugging).
+
+ * test/ruby/test_backtrace.rb: apply above changes.
+ And apply comment from kou [ruby-dev:45686].
+
+Sun Jun 3 00:49:11 2012 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: fix to build vm_backtrace.c only itself (vm_backtrace.c
+ is no longer included from vm.c). I hope this separation reduce
+ compile time of vm.c.
+
+ * internal.h: ditto.
+
+ * vm.c, vm_core.h, vm_dump.c, vm_eval.c: ditto.
+
+ * vm_eval.c: some functions (callee, etc) moved to vm_backtrace.c.
+
+Sun Jun 3 00:20:53 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_backtrace.c: added. Separate backtrace related functions to
+ this file.
+
+ * vm.c, common.mk: ditto.
+
+Sat Jun 2 18:09:02 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/ipaddr.rb: Inhibit zero-filled octets in an IPv4 address in
+ all platforms. [ruby-dev:45671]
+
+ * lib/ipaddr.rb: Allow the x:x:x:x:x:x:d.d.d.d form not limited to
+ IPv4 mapped/compatible addresses. This change also makes it
+ possible for the parser to understand IPv4 mapped and compatible
+ IPv6 addresses in non-compressed form.
+
+ * lib/ipaddr.rb: Stop exposing IPSocket.valid*? methods which were
+ only usable on non-IPv6-ready platforms.
+
+Sat Jun 2 16:59:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_buf_cat): don't reset coderange as unknown.
+ 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]
+
+Sat Jun 2 07:04:48 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc (Performance): Replaced incorrect example of reducing
+ backtracking through anchoring with reduced backtracking through a
+ range. [ruby-trunk - Bug #6525]
+
+Sat Jun 2 06:34:15 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc (Performance): Removed useless sample output from final
+ performance example and switched from #match to #=~ for consistency.
+ [ruby-trunk - Bug #6524]
+
+Fri Jun 1 09:30:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (class_or_module_required): extract check for class or
+ module.
+
+Fri Jun 1 08:50:47 2012 Eric Hodel <drbrain@segment7.net>
+
+ * array.c: Updated Array documentation formatting. Patch by Zachary
+ Scott. [ruby-trunk - Feature #6517]
+
+Fri Jun 1 06:57:10 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity#set_ctypes): Refactored
+ #set_ctypes using newer ruby features to simplify its implementation.
+ * test/dl/test_c_struct_entry.rb (class DL): Test to verify
+ refactoring.
+
+Fri Jun 1 06:40:25 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Restored Kernel documentation based on
+ Pickaxe book documentation. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6521]
+
+Fri Jun 1 06:29:42 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (rb_equal): Let Object be a link in #=== documentation.
+ Patch by Zachary Scott. [ruby-trunk - Feature #6518]
+
+Thu May 31 09:27:06 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity::size): Refactored ::size
+ to remove unused variables and simplify using newer ruby features.
+ * test/dl/test_c_struct_entry.rb: Test to validate refactoring
+
+Thu May 31 08:40:34 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity#set_ctypes): Refactored
+ #set_types to reuse DL::CUnionEntity::size
+ * test/dl/test_c_union_entity.rb: Added test
+
+Thu May 31 08:20:14 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity::size): Fixed ::size to
+ return the size of the union.
+ * test/dl/test_c_union_entity.rb: Test for DL::CUnionEntity::size
+
+Thu May 31 07:45:43 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl: Added documentation. Patch by Vincent Batts.
+ [ruby-trunk - Bug #6496]
+
+Wed May 30 16:30:00 2012 Kenta Murata <mrkn@cookpad.com>
+
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb,
+ ext/bigdecimal/lib/bigdecimal/newton.rb:
+ fix documentation comments.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
+
+Wed May 30 16:20:00 2012 Kenta Murata <mrkn@cookpad.com>
+
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian#dfdxi):
+ fix jacobian to get stuck in an infinite loop when a solution is not
+ found due to forget to increment nRetry counter.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
+
+Wed May 30 10:58:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (utc_offset_arg): utc offset can be precision in seconds.
+ e.g. old Europe/Lisbon (c.f. [ruby-dev:40066])
+
+Wed May 30 06:20:29 2012 Eric Hodel <drbrain@segment7.net>
+
+ * error.c (exc_set_backtrace): Updated documentation to indicate
+ set_backtrace allows a string as well as an array of strings.
+ [ruby-trunk - Bug #6501]
+
+Tue May 29 17:28:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): support GNU extension triple
+ colons modifier. [EXPERIMENTAL]
+
+ * strftime.c (rb_strftime_with_timespec): check conversion with locale
+ modifier.
+
+ * strftime.c (rb_strftime_with_timespec): colons are valid only for
+ 'z' and must come just before it.
+
+Mon May 28 16:56:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): StatusLineOutput
+ needs job_status to be :replace.
+
+Mon May 28 13:35:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (do-install-*): fix dependencies. based on the patch by
+ nagachika at [ruby-dev:45683]. [Bug #6506]
+
+Mon May 28 12:03:04 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (obj_free): doesn't free a method table if it doesn't
+ exist. [ruby-dev:44436]
+ * test/ruby/test_gc.rb (class TestGc): added the test case for
+ this issue.
+
+Sun May 27 23:37:48 2012 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm1_lvar_init.rb: added.
+ This benchmark measures a initialize time of non-used variable.
+
+ * benchmark/bm_vm1_lvar_set.rb: added.
+ This benchmark measures a local variables initialization time.
+
+ * benchmark/bm_vm2_bigarray.rb: added.
+ This benchmark mesures a big array literal creation time.
+
+ * benchmark/bm_vm2_bighash.rb: added.
+ This benchmark mesures a big hash literal creation time.
+
+ * benchmark/bm*: change notation "i=0" to "i = 0".
+
+Sun May 27 13:33:26 2012 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/driver.rb: fix to continue benchmarks when
+ an error is occurred.
+
+Sun May 27 11:27:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): fix operator
+ precedence, so that platform and TERM should be counted.
+
+Sun May 27 10:02:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: allows %Ok and %Ol.
+
+Sun May 27 09:29:20 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: modified doc.
+
+Sat May 26 19:04:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added description.
+
+Sat May 26 18:14:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: reduced the code.
+
+Sat May 26 18:08:59 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * time.c: modified doc.
+ * ext/date/date_core.c: ditto.
+
+Sat May 26 17:05:45 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (backtrace_*): change type of lev and n from size_t to int.
+ Also set type of rb_backtrace_t#backtrace_size to int.
+ A patch from nobu.
* vm_eval.c: ditto.
- * vm_insnhelper.c: ditto.
+Sat May 26 16:26:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.h: ditto.
+ * file.c (realpath_rec): UNC prefix does not end with path separator,
+ so new separator is needed after it.
+
+Sat May 26 15:29:22 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_backtrace.rb (test_caller_lev):
+ decrease recursion size.
- * iseq.h: add iseq_compile_data::ci_index and
- iseq_compile_data::ci_kw_index.
+Sat May 26 13:50:48 2012 Koichi Sasada <ko1@atdot.net>
- * tool/instruction.rb: introduce TS_CALLCACHE operand type.
+ * NEWS: add Kernel#caller's second argument.
-Sun Sep 20 02:18:10 2015 Tanaka Akira <akr@fsij.org>
+Sat May 26 13:40:29 2012 Koichi Sasada <ko1@atdot.net>
- * test/lib/envutil.rb: mkfifo command based File.mkfifo method
- definition removed.
+ * vm.c (RubyVM::FrameInfo): add a class to access each frame
+ information. You don't need to parse strings from caller().
+ FrameInfo has the following methods:
+ FrameInfo#name: method name, class name, etc with decorations.
+ FrameInfo#basename: name without decorations.
+ FrameInfo#line_no: line number.
+ FrameInfo#filename: file name.
+ FrameInfo#filepath: full filepath.
+ FrameInfo#iseq: iseq if it is iseq frame (defined by ruby script)
+ FrameInfo#to_s: return caller() method style string.
+ RubyVM::FrameInfo.caller(n, lev) returns array of FrameInfo objects.
+ The name "RubyVM::FrameInfo.caller" is long and ambiguous (it is
+ confusing with Kernel::caller() method), we need to change the name
+ before Ruby 2.0 release. Good names or comments are welcome.
-Fri Sep 18 20:11:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: add a test for above change.
- * file.c (rb_file_s_mkfifo): implement File.mkfifo.
- [Feature #11536]
+Sat May 26 12:18:09 2012 Koichi Sasada <ko1@atdot.net>
-Fri Sep 18 16:56:19 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm.c (frame_info_to_str): add `break'.
- * NEWS: add Net::FTP#mlst and Net::FTP#mlsd.
+ * vm.c (backtrace_object): remove lev and n parameter.
+ backtrace_object always returns all of backtrace information.
-Fri Sep 18 07:39:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * vm.c (rb_backtrace_to_str_ary): fix to use backtrace_object().
+ This change improve performance of caller(lev, n).
- * ext/objspace/objspace_dump.c (obj_type): add IMEMO types to the heap
- dump information.
+ * benchmark/bm_vm3_backtrace.rb: added to check above improvement.
+ FYI: measurement on my laptop, 1.9.3p229 needs 5.125 sec,
+ and current trunk only needs 0.299sec.
-Thu Sep 17 22:33:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat May 26 11:05:09 2012 Koichi Sasada <ko1@atdot.net>
- * common.mk: fix command error with outside builddir.
+ * vm.c (rb_frame_info_t): keep previous ISEQ frame info for CFUNC
+ frame info. And fix to cache a calculated line_no of ISEQ frame
+ info.
-Thu Sep 17 17:42:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat May 26 09:54:53 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * common.mk: separated test for test-framework from test-all task.
- They should be invoke at first before tests of test-all.
+ * ext/openssl/ossl_ssl.c: Allow disabling client-side renegotiation.
+ * test/openssl/test_ssl.rb: Simple tests for this.
-Thu Sep 17 12:05:54 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ Client-side renegotiation is still considered problematic, even
+ when used in the context of secure renegotiation (RI, RFC 5746).
+ The changes allow users to either completely disable client
+ renegotiation on the server, or to specify a maximum number of
+ handshakes allowed in total. The number of total handshakes is
+ counted in a callback set as SSL_set_info_callback. If the
+ maximum number of handshakes is exceeded an error will be raised
+ We do not support renegotiation in the OpenSSL extension, therefore
+ this feature can only be tested externally.
+ The feature is opt-in, the default setting will be to allow
+ unlimited client renegotiation, as was the case before.
- * test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don't
- use tricky code, please.
+Fri May 25 23:38:58 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Sep 16 20:49:56 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * test/openssl/test_ssl.rb: Clarify the intention of errors to be
+ expected. Two errors are possible when connection is refused due
+ to a protocol version that was explicitly disallowed,
+ OpenSSL::SSL::SSLError or Errno::ECONNRESET, depending on the
+ OpenSSL version in use.
- * encindex.h: fix typo of last #endif comment. [ci skip]
+Fri May 25 22:19:40 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Sep 16 20:39:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c: Revert r35583
+ * test/openssl/test_ssl.rb: Handle ECONNRESET in code instead to avoid
+ the test failing in Ruby CI [1]
- * variable.c (set_const_visibility): fail if the class/module is
- frozen. [ruby-core:70828] [Bug #11532]
+ [1] http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz#test-all
-Wed Sep 16 17:16:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 25 19:51:36 2012 Koichi Sasada <ko1@atdot.net>
- * vm_core.h (ENABLE_VM_OBJSPACE): enable per-VM object space on
- Windows by default, as rb_w32_sysinit() no longer depends on
- ruby_xmalloc.
+ * vm_eval.c (rb_f_caller): caller() method accepts second optional
+ argument `n' which specify how many frames should return.
+ For example, `caller(0, 1)' returns only one frame information
+ which calls caller() method. If there are less than n frame
+ information, then all frame information are returned. If n is 0,
+ then always return [].
+ This fix is part of [ruby-dev:42345] [Ruby 1.9-Feature#3917].
+ However, performance and features are not enough.
+ RDoc is also not available.
-Wed Sep 16 15:08:17 2015 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_backtrace.rb: add a test for above.
- * doc/syntax/literals.rdoc (Strings): [DOC] Revise the character
- literal part.
+Fri May 25 17:05:07 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 16 14:55:33 2015 Akinori MUSHA <knu@iDaemons.org>
+ * vm.c (oldbt_init, vm_backtrace_str_ary): arg->data should
+ be initialized before calling `backtrace_each()'.
- * doc/syntax/literals.rdoc (Strings): [DOC] Document the full list
- of supported escape sequences in string literals.
+Fri May 25 16:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Sep 16 14:49:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * trunk/ext/-test-/printf/printf.c: change function names because of
+ conflict with msvcrt. fixed build error of mswin.
- * string.c (rb_str_setbyte): keep the code range as possible.
+Fri May 25 10:52:52 2012 Koichi Sasada <ko1@atdot.net>
-Wed Sep 16 13:23:48 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c: refactoring backtrace related functions.
+ (1) unify similar functions (rb_backtrace_each() and
+ backtrace_object()). backtrace_each() is a unified function.
+ variation:
+ a) backtrace_object(): create backtrace object.
+ b) vm_backtrace_str_ary(): create bt as an array of string.
+ c) vm_backtrace_print(): print backtrace to specified file.
+ d) rb_backtrace_print_as_bugreport(): print backtrace on
+ bugreport style.
+ (2) remove rb_backtrace_each(). Use backtrace_each() instead.
+ (3) change the type of lev parameter to size_t.
+ a) lev == 0 means current frame (exception, etc use it).
+ b) lev == 1 means upper frame (caller(0) use it).
- * doc/syntax/literals.rdoc (Strings): mention about ?a literal.
+ * vm_core.h, vm_dump.c, vm_eval.c: ditto.
-Wed Sep 16 12:06:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm.c (backtrace_object(), vm_backtrace_str_ary()): fix to return a
+ correct size of caller(lev) array.
+ Let n be a "caller(0).size" then ln as caller(lev).size should be
+ (n - lev). However, the previous implementation returns a wrong
+ size array (ln > n - lev). [ruby-dev:45673]
- * dir.c (glob_helper): check pathtype once again by lstat(2) if
- dp->d_type is DT_UNKNOWN. XFS may return DT_UNKNOWN.
+ * test/ruby/test_backtrace.rb: add tests for backtrace.
-Wed Sep 16 03:49:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri May 25 08:51:39 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_thread.rb (TestThread#test_mutex_synchronize):
- insert waste loop for invoking preemptive thread context switch.
- [Bug #11496]
+ * enum.c (enum_count): Enumerable#count no longer uses #size when
+ counting elements. Patch by Nobuhiro IMAI. [ruby-trunk - Bug #6473]
-Tue Sep 15 19:38:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 25 01:15:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_objspace_alloc, rb_objspace_free): define always
- regardless ENABLE_VM_OBJSPACE, and free heap pages.
+ * sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
+ to_s if plus flag is given.
-Tue Sep 15 15:15:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vsnprintf.c (BSD_vfprintf): pass sign flag.
- * win32/win32.c (rb_w32_sysinit, rb_w32_readdir): compare by
- encoding index to get rid of encoding initialization before VM
- object space allocation.
+Fri May 25 00:37:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (fundamental_encoding_p, push_glob): compare by encoding
- index immediately.
+ * test/rubygems/test_gem_indexer.rb (setup, teardown): save @tempdir
+ to remove it properly. [Bug #5348]
- * enc/{ascii,us_ascii,utf_8}.c: set encoding indexes of
- fundamental built-in encodings so that usable as well as
- allocated rb_encoding before rb_enc_init().
+Thu May 24 23:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encindex.h: separate encoding index constants from internal.h.
+ * vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in
+ rb_enc_vsprintf(). [Feature #5896]
-Tue Sep 15 13:13:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 24 15:33:01 2012 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] correct block
- return values, which may be a negative or positive integer, not
- only -1 or +1.
+ * vm_method.c (rb_method_defined_by): removed.
+ nobu pointed out that rb_method_basic_definition_p() is enough
+ for last commit.
-Tue Sep 15 12:49:10 2015 Jason Barnabe <jason.barnabe@gmail.com>
+ * error.c, eval_error.c: change for above.
- * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] Correct
- description of array sort block return values. And also fix up
- the grammar a bit. [Fix GH-1020]
+Thu May 24 14:30:13 2012 Koichi Sasada <ko1@atdot.net>
-Tue Sep 15 12:44:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c: add RubyVM::Backtrace object (btobj).
+ Backtrace information contains an array consists of location
+ information for each frames by string.
+ RubyVM::Backtrace object is lightweight backtrace information,
+ which contains complete information to generate traditional style
+ backtrace (an array of strings) with faster generation.
+ If someone accesses to backtrace information via
+ Exception#backtrace, then convert a RubyVM::Backtrace object to
+ traditional style backtrace.
+ This change causes incompatibility on marshal dumped binary
+ of Exception. If you have any trouble on it, please tell us
+ before Ruby 2.0 release.
+ Note that RubyVM::Backtrace object should not expose Ruby level.
- * util.c (ruby_qsort): use BSD-style qsort_r if available.
+ * error.c, eval.c, vm_eval.c: ditto.
-Mon Sep 14 19:26:34 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * internal.h: ditto.
- * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames including
- space correctly.
+ * eval_error.c: fix to skip "set_backtrace" method invocation in
+ creating an exception object if it call a normal set_backtrace
+ method (defined by core).
-Mon Sep 14 11:12:10 2015 Anton Davydov <antondavydov.o@gmail.com>
+ * test/ruby/test_settracefunc.rb: fix for above change.
- * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo, "convertion" to
- "conversion". [Fix GH-1016]
+ * vm_method.c (rb_method_defined_by): added. This function
+ checks that the given object responds with the given method
+ by the given cfunc.
-Sun Sep 13 11:03:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb:
+ add to measure exception creation speed. raise1 create
+ exception objects from shallow stack frame. raise2 create
+ exception objects from deep stack frame.
- * include/ruby/ruby.h: prefix RUBY or RB to global symbols to get
- rid of name conflicts with other headers.
+Thu May 24 12:07:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/encoding.h, include/ruby/intern.h: ditto.
+ * io.c (io_strip_bom): check EOF. [Bug #6487][ruby-core:45203]
-Sun Sep 13 09:38:51 2015 Shugo Maeda <shugo@ruby-lang.org>
+Wed May 23 22:06:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,
- media_type, charset): new methods to return standard facts.
+ * lib/net/http/header.rb (Net::HTTPHeader#range): fix broken parser of
+ HTTP Range request. Old one can't parse invalid specs and multiple
+ specs correctly.
-Sat Sep 12 19:43:49 2015 Koichi Sasada <ko1@atdot.net>
+Wed May 23 10:18:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear local
- variables here. vm_push_frame() clears.
+ * win32/win32.c (finish_overlapped_socket, overlapped_socket_io):
+ replace ECONNABORTED to EPIPE in send, sendto and sendmsg to improve
+ BSD socket compatibility. this change removes a failure on the test
+ of net/ftp.
- * vm_insnhelper.c (vm_call_iseq_setup_tailcall): ditto.
+Wed May 23 05:35:58 2012 Eric Hodel <drbrain@segment7.net>
- * vm_insnhelper.c (vm_push_frame): move check code to
- vm_check_frame().
+ * lib/net/http.rb: Broke up Net::HTTP into individual files.
+ [ruby-trunk - Feature #6435]
+ * lib/net/http/backward.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/net/http/exceptions.rb: ditto.
+ * lib/net/http/responses.rb: ditto.
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/header.rb: ditto.
+ * lib/net/http/request.rb: ditto.
+ * lib/net/http/proxy_delta.rb: ditto.
+ * lib/net/http/requests.rb: ditto.
- Reorder initialization timing to reuse same values (sp).
+Wed May 23 05:15:11 2012 Eric Hodel <drbrain@segment7.net>
- * compile.c (rb_iseq_compile_node): use
- iseq_set_exception_local_table() for ISEQ_TYPE_DEFINED_GUARD.
+ * class.c (rb_mod_init_copy): Clear the cached inspect string of a
+ dup'd anonymous module or class. [ruby-trunk - Bug #6454]
+ * test/ruby/test_module.rb (class TestModule): ditto
-Sat Sep 12 23:06:51 2015 Shugo Maeda <shugo@ruby-lang.org>
+Tue May 22 16:49:15 2012 Koichi Sasada <ko1@atdot.net>
- * lib/net/ftp.rb (file?, directory?, appendable?, creatable?,
- deletable?, enterable?, renamable?, listable?, directory_makable?,
- purgeable?, readable?, writable?): new methods.
+ * vm_core.h: add a data type rb_location_t to store iseq location
+ information.
+ rb_location_t#filename, filepath, name and line_no was moved from
+ rb_iseq_t. rb_location_t#basename is a new field which is
+ similar to `name' field without any decoration.
+ `name' field contains some decoration such as `block in foo'.
+ `basename' only contains `foo'.
+ rb_iseq_t contains memory object of rb_location_t.
-Sat Sep 12 21:27:22 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * iseq.c: setup rb_location_t for each rb_iseq_t memory objects.
- * lib/net/ftp.rb (FACT_PARSERS): support system dependent facts
- UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime.
+ * compile.c, proc.c, vm.c, vm_dump.c, vm_eval.c, vm_insnhelper.c,
+ vm_method.c: support about it.
-Sat Sep 12 19:08:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 22 00:45:05 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * win32/win32.c (rb_w32_dup2): should return the new fd on
- success, while msvcrt returns 0 wrongly.
+ * struct.c (rb_struct_members): Refactoring. As Struct#members had
+ returned an array of String, the old code was needed to convert
+ Symbols to Strings. But it is almost unnecessary because the
+ method now returns an array of Symbols. A patch by Masaki
+ Matsushita <glass.saga at gmail dot com> [Feature #6218]
+ [ruby-dev:45451]
-Sat Sep 12 18:14:11 2015 Shugo Maeda <shugo@ruby-lang.org>
+Mon May 21 19:20:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError
- when parsing failed.
+ * lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
+ because transfercmd may fail and return nil.
-Sat Sep 12 18:00:35 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/net/ftp.rb (Net::FTP#retrlines): ditto.
- * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "+00:00" to
- get UTC time. Thanks, Wilson Bilkovich.
+Mon May 21 15:10:28 2012 Akinori MUSHA <knu@iDaemons.org>
-Sat Sep 12 17:55:24 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/syslog/syslog.c: Classify constants and macros into several
+ sub-modules. (Syslog::Priority, Syslog::Level, Syslog::Option
+ and Syslog::Macros)
- * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD
- specified in RFC 3659.
+ * ext/syslog/syslog.c (mSyslog_inspect): Use rb_sprintf().
-Sat Sep 12 16:14:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
+ module before calling rb_class2name().
- * file.c: access()/eaccess() wrapping methods check more than just uid.
- [fix GH-1007][ci skip] Patch by @eam
+Mon May 21 12:44:11 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sat Sep 12 16:07:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * .travis.yml (install): It seems tcl/tk is skipped in Travis
+ CI. Trying to fix the situation.
- * README.md: improve markdown rendering for readability.
- [fix GH-1015][ci skip] Patch by @Matrixbirds
+Mon May 21 12:11:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Sep 12 14:30:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/depend (ENCOBJS): add dependencies.
- * process.c (save_redirect_fd): make saved FDs close-on-exec not
- to be inherited.
+ * enc/make_encmake.rb (target_encodings): extract dependencies.
- * process.c (run_exec_dup2): restore close-on-exec flags too.
+Mon May 21 11:26:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (fcntl): implement F_GETFD, F_SETFD, and
- F_DUPFD_CLOEXEC.
+ * lib/net/ftp.rb (Net::FTP#transfercmd): rescue shutdown.
-Sat Sep 12 05:35:24 2015 Eric Wong <e@80x24.org>
+Sun May 20 23:00:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * rational.c (string_to_r_strict): preserve encoding in exception
+ * ext/extmk.rb (extmake): reopen $stdout to NULL, since setting
+ $stdout cannot affect child processes.
-Fri Sep 11 20:23:35 2015 Koichi Sasada <ko1@atdot.net>
+Sun May 20 21:36:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h: remove rb_call_info_t::aux.opt_pc.
+ * enc/shift_jis.c (code_to_mbclen): return
+ ONIGERR_INVALID_CODE_POINT_VALUE if the code is invalid.
- * vm_insnhelper.c: introduce shortcut functions for opt_pc == 0
- because opt_pc is always 0 on shortcut function.
+ * string.c (tr_next): increment character until the code
+ is a valid character. [ruby-dev:45652] [Bug #6450]
-Fri Sep 11 17:49:36 2015 Koichi Sasada <ko1@atdot.net>
+Sun May 20 12:25:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.c: disable ISeq.load. It enabled accidentally at r51794.
+ * Makefile.in (LIBRUBY_SO): link EXTSOLIBS too.
-Fri Sep 11 11:15:12 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/extmk.rb (mf.macro): use EXTSOLIBS instead of SOLIBS to get rid
+ of discard libraries needed by default. [Bug #6462]
- * lib/net/ftp.rb (size, mdtm, system): parse responses according to
- RFC 959 and 3659, where reply codes must be followed by SP.
+Sat May 19 19:04:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/ftp.rb (system): remove LF from the return value.
+ * ext/extmk.rb (command_output): ENCOBJS is needed for all linked
+ ruby, if --disable-shared and --with-static-linked-ext.
-Thu Sep 10 22:48:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/extmk.rb (command_output): dmyext is needed as DLDOBJS if no
+ static linked extensions.
- * parse.y (literal_concat_gen, evstr2dstr_gen): keep literal
- encoding beginning with an interpolation same as the source file
- encoding. [ruby-core:70703] [Bug #11519]
+ * Makefile.in, common.mk (PROGRAM): no extension libraries.
-Thu Sep 10 22:15:51 2015 Joe Rafaniello <jrafanie@redhat.com>
+ * common.mk (build-ext): pass macros for libruby.so.
- * process.c (rb_f_spawn): Be more specific regarding "other
- values" by having "non-zero positive integers" Add nil, the
- default value, as a possible value and what it means.
+ * ext/extmk.rb (command_output): link extension libraries and encoding
+ libraries into libruby.so, not ruby executable.
- Try to use more consistent language.
- [Fix GH-1008]
+ * ext/extmk.rb (command_output): fold long macro lines.
-Thu Sep 10 15:16:02 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * Makefile.in (LIBEXT): add macro.
- * lib/net/ftp.rb (getmultiline): refactor.
+ * configure.in (ENCOBJS, EXTOBJS): use LIBEXT, not hardcoded suffix.
-Thu Sep 10 12:17:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in (LIBRUBY_A): fix typo. re-applying r35242.
- * compile.c (iseq_build_from_ary_body): register cdhash to the
- iseq constant body instead of compile time mark array, not to
- get GCed. [ruby-core:70708] [Feature #8543]
+Sat May 19 04:46:53 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Sep 9 18:16:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/extconf.rb: Use Logging::message instead of message.
+ * ext/zlib/extconf.rb: ditto.
- * lib/rubygems/stub_specification.rb (Gem::StubSpecification#data):
- should not change the value of $. when `require`ing gems.
- this fixed test failures introduced by r51813.
+Fri May 18 18:13:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 9 16:55:45 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/mkmf.rb (MakeMakefile#configuration): keep space at end of
+ OUTFLAG and COUTFLAG. [ruby-dev:45650]
- * ruby.c (usage, enable_option, disable_option, process_options): new
- option `--disable-did_you_mean`.
+Fri May 18 17:39:42 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gem_prelude.rb: now requires did_you_mean gem by default if available.
+ * thread_pthread.c (rb_thread_create_timer_thread): Added error
+ check when failing fcntl(). [Bug #6147] [ruby-dev:45364]
-Wed Sep 9 13:38:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 18 17:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/extlibs.rb (do_patch): let "patch" command change the
- working directory and open the patch file there, instead of
- spawn options, so that proper error message will be shown by the
- command not just "chdir" or "open".
+ * ext/extmk.rb (extmake): link archives only, skip script only
+ extension libraries.
-Wed Sep 9 11:33:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri May 18 17:25:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * common.mk (update-gems): use BASERUBY instead of RUNRUBY.
+ * cont.c: bump up fiber machine stack size when running on 64bit
+ arch. [Bug #6344] [ruby-dev:45554]
-Wed Sep 9 11:08:59 2015 Zachary Scott <zzak@ruby-lang.org>
+Fri May 18 15:20:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/delegate.rb: Remove backtrace cleaning for delegated methods
- This patch was provided by Rafael Franca and greatly improves
- performance when an exception is raised. [Bug #11461]
+ * lib/uri/generic.rb (URI::Generic.build): duplicate args before adding
+ new items. (don't change arguments)
-Wed Sep 9 10:05:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT
+ if this method is called from URI::Generic.
- * test/rubygems/test_config.rb: fix broken tests for Windows platform.
+ * lib/uri/generic.rb (URI::Generic.build2): escape only if the item is
+ a String.
-Wed Sep 9 07:46:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because
+ it doesn't have parser method. [Bug #6420]
- * lib/rubygems: Update to RubyGems HEAD(fe61e4c112).
- this version contains new feature that warn invalid SPDX license
- identifiers. https://github.com/rubygems/rubygems/pull/1249
- and #1032, #1023, #1332, #1328, #1306, #1321, #1324
- * test/rubygems: ditto.
+Fri May 18 15:54:07 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 8 23:17:36 2015 Yuki Nishijima <mail@yukinishijima.net>
+ * ext/zlib/extconf.rb: Use an exception instead of bare puts.
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta2.
+Fri May 18 15:53:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 8 23:09:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/extconf.rb: Use an exception instead of bare abort.
- * io.c (rb_io_s_popen): do not wait the child process during being
- killed. [ruby-core:70671] [Bug #11510]
+Fri May 18 15:51:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 8 22:18:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/fiddle/extconf.rb: Use an exception instead of bare abort.
- * gems/bundled_gems: revert because ruby trunk never be able to install
- the did_you_mean gem. retry after enough test.
+Fri May 18 15:49:35 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 8 21:48:22 2015 Yuki Nishijima <mail@yukinishijima.net>
+ * ext/readline/extconf.rb: Use an exception instead of bare exit.
- * gems/bundled_gems: Automatically install the did_you_mean gem
- as a bundled gem. [Feature #11252]
+Fri May 18 15:38:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Sep 8 17:17:48 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/ripper/extconf.rb: Use an exception instead of bare
+ Logging.message.
- * vm_core.h: remove rb_call_info_t::blockiseq.
+Fri May 18 15:23:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * insns.def (send, invokesuper): pass blockiseq explicitly.
+ * ext/openssl/extconf.rb: Clarify a message when hit Apple
+ OpenSSL issue.
- * compile.c: catch up this fix.
+Fri May 18 15:14:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * iseq.c: ditto.
+ * ext/extmk.rb: Show a message when extconf.rb raised an exception.
+ * ext/openssl/extconf.rb: Use exception raising instead of message
+ and/or abort. We want to display error message to console _and_
+ logging into mkmf.log.
- * vm_args.c: ditto.
+Fri May 18 06:14:07 2012 Eric Hodel <drbrain@segment7.net>
- * iseq.c (ISEQ_MINOR_VERSION): 2->3 because instruction spec was
- changed.
+ * ext/syslog/lib/syslog/logger.rb: Added Syslog::Logger which was
+ ported from the SyslogLogger gem. [ruby-trunk - Feature #5096]
+ * NEWS: ditto.
+ * test/syslog/test_syslog_logger.rb: ditto.
-Tue Sep 8 15:01:19 2015 Shugo Maeda <shugo@ruby-lang.org>
+Fri May 18 01:28:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/net/ftp.rb (list): fetch all the lines before yielding a block
- to allow other commands in the block. [Feature #11454]
- Patched by Srikanth Shreenivas.
+ * ext/psych/parser.c (transcode_string): fix encoding index names.
+ Thanks markizko for reporting.
-Tue Sep 8 12:05:00 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu May 17 23:03:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_read_reparse_point): return correct required
- buffer size for IO_REPARSE_TAG_MOUNT_POINT.
+ * configure.in: fix function name to be checked, to initialize
+ rb_thread_cond_t properly.
-Tue Sep 8 00:14:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.c (native_cond_initialize, native_cond_destroy):
+ fix macro name.
- * process.c (rb_execarg_parent_start1): raise with the target path
- name when open() failed.
+Thu May 17 12:53:07 2012 Yuki Yugui Sonoda <yugui@google.com>
-Mon Sep 7 23:45:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c, thread_pthread.c: Moved pthread-specific preprocessor
+ hacks to thread_pthread.c
- * process.c (rb_exec_fail): raise with the target directory name
- when chdir() failed. pointed out by sorah.
+Thu May 17 12:18:47 2012 Yuki Yugui Sonoda <yugui@google.com>
-Mon Sep 7 22:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c: Fix a mistake on merging the patch in the previous commit.
- * win32/win32.c (insert): should use plain strdup() instead of
- ruby_strdup() at startup time, and plain free()ed in cmdglob().
+Thu May 17 11:33:07 2012 Yuki Yugui Sonoda <yugui@google.com>
-Mon Sep 7 16:49:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Imports Ruby's port to NativeClient (a.k.a NaCl).
+ Patch by Google Inc. [ruby-core:45073].
- * vm_core.h (rb_vm_struct): define objspace always regardless
- ENABLE_VM_OBJSPACE.
+ * configure.in (RUBY_NACL): New M4 func to configure variables for
+ NaCl.
+ (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names
+ of Pepper interface types.
+ (BTESTRUBY): New variable to specify which ruby should be run on
+ "make btest". NaCl can run the built binary by sel_ldr, but it need
+ rbconfig.rb. So this variable is distinguished from $MINIRUBY.
-Mon Sep 7 15:54:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.c: Disabled some features on NaCl.
- * ruby_atomic.h (ATOMIC_VALUE_CAS): fix typo.
- TODO: make arguments of all CAS macros consistent.
+ * io.c: ditto.
+
+ * process.c: ditto.
-Sun Sep 6 16:07:22 2015 Eric Wong <e@80x24.org>
+ * signal.c: ditto.
- * ccan/list/list.h: suppress unused argument warnings
- [ccan commit 6aaca17e07588997417a73fac19dcf0ff17ed81b]
+ * file.c: ditto.
-Sat Sep 5 11:39:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * missing/flock.c: ditto.
- * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
- digits. [ruby-core:70667] [Bug #11509]
+ * nacl/pepper_main.c: An example implementation of Pepper application
+ that embeds Ruby.
-Sat Sep 5 08:28:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * nacl/example.html: An example of web page that uses the Pepper
+ application.
- * hash.c (rb_hash_equal, rb_hash_eql): [DOC] the orders of each
- hashes are not compared. [Bug #11508]
+ * nacl/nacl-config.rb: Detects variants of NaCl SDK.
-Fri Sep 4 23:26:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * nacl/GNUmakefile.in: Makefile template for NaCl specific build
+ process.
- * include/ruby/win32.h: fix macro name for VC runtime version,
- RT_VER is only in Makefile.
+ * nacl/package.rb: script for packaging a NaCl-Ruby embedding
+ application.
-Fri Sep 4 17:46:17 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * nacl/reate_nmf.rb: Wrapper script of create_nmf.py
- * doc/contributing.rdoc: fix configuration option.
- [ci skip] [fix GH-1009]
+ * dln.c (dln_load): Added a hack to call on NaCl.
-Fri Sep 4 04:46:54 2015 Koichi Sasada <ko1@atdot.net>
+ * util.c (ruby_getcwd): Path to the current directory is not available
+ on NaCl.
- * iseq.c (iseq_memsize): functions for wrapper object should have
- iseqw_ prefix.
+Thu May 17 10:54:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 3 21:12:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/extconf.rb: add -l options to $libs not $LDFLAGS,
+ to be passed to EXTLIBS in exts.mk.
- * lib/cgi/session.rb (create_new_id): use SHA512 instead of MD5.
- pointed out by SARWAR JAHAN.
+ * enc/encinit.c.erb: use %-lines to adjust indent in the generated file.
-Thu Sep 3 20:29:18 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/mkmf.rb (MakeMakefile#have_framework): combine -framework option
+ and its argument with an equal sign not to be separated in merge_libs.
- * gc.c (rb_raw_obj_info): iseq->body->location.first_lineno is Fixnum.
+ * ext/tk/extconf.rb: ditto.
-Thu Sep 3 17:54:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/extmk.rb: EXTLDFLAGS also needs to be passed.
- * vm_eval.c (raise_method_missing): "names" should be singular.
- pointed out by Filip Bartuzi.
+Wed May 16 15:44:22 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Sep 3 17:50:09 2015 Koichi Sasada <ko1@atdot.net>
+ * configure.in: Fix an unbalanced quote.
- * gc.c (rb_raw_obj_info): should support IMEMO/iseq.
+Wed May 16 15:43:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Sep 3 10:07:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/extmk.rb (exts.mk): use double quotes instead of single quotes
+ for commandline because it's not recognized as quotes on Windows.
- * vm_eval.c (raise_method_missing): refine error messages when a
- symbol is not given. [Fix GH-1013]
+Wed May 16 15:15:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 2 18:49:55 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * configure.in (LD): enclose with single quotes but not double quotes
+ not to expand command substitution.
- * ext/psych/*: merge psych master(8737e5b). It contains following fixes.
- https://github.com/tenderlove/psych/pull/242
- https://github.com/tenderlove/psych/pull/246 [ruby-list:50219]
- * test/psych/*: ditto.
+Wed May 16 14:19:51 2012 Yuki Yugui Sonoda <yugui@google.com>
-Wed Sep 2 18:04:13 2015 Koichi Sasada <ko1@atdot.net>
+ Supports static linking of extensions and encodings again.
+ Fixes --with-static-linked-ext.
- * vm_insnhelper.h (GET_PC_COUNT): remove unused macro.
+ Patch by Google Inc. [ruby-core:45073].
-Wed Sep 2 17:18:37 2015 Chris Schneider <chris@christopher-schneider.com>
+ * Makefile.in (ENCOBJS, EXTOBJS): New variables to specify static
+ linked libraries. Also reintroduces extinit.o, introduces encinit.o
+ introduces encinit.o
- * process.c (proc_detach): [DOC] fix typo "intent" as "intend" in
- rdoc. [Fix GH-1011]
+ * common.mk: Builds static libraries rather than shared objects if
+ specified.
-Wed Sep 2 16:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (LD): new substitution.
- * file.c (rb_realpath_internal): use filesystem encoding if the
- argument is in ASCII encodings.
+ * enc/depend: Supports static linked libraries
+ (libencs, libenc, libtrans): New target.
- * win32/file.c (rb_readlink): needs the result encoding.
+ * enc/encinit.c.erb: new template to generate the initialization of
+ statically linked encodings.
-Tue Sep 1 18:37:15 2015 Koichi Sasada <ko1@atdot.net>
+ * enc/make_encmake.rb (--module): new flag to specify whether static
+ or dynamic.
- * test/thread/test_queue.rb: catch up last commit.
+ * transcode_data.h (TRANS_INIT): New macro to get rid of the name
+ collision of encoding initializers and transcoder initializers.
-Tue Sep 1 18:16:32 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/extmk.rb: Fixes the behavior on $extstatic is true.
- * thread_sync.c (queue_do_close): ignore multiple close to allow
- multiple producers.
- https://bugs.ruby-lang.org/issues/10600#note-14
+ * lib/mkmf.rb (clean-static): new target to clean up static linked
+ libraries.
-Tue Sep 1 18:06:26 2015 Koichi Sasada <ko1@atdot.net>
+ * ruby.c (process_options): New initializes statically linked
+ encodings here.
- * thread_tools.c: rename thread_tools.c to thread_sync.c.
+Wed May 16 14:30:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Aug 31 17:04:45 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c: fixed a merge mistake of r33878, reported by nobu via IRC.
- * class.c (move_refined_method): should insert a write barrier
- from an original class to a created (cloned) method entry.
+Wed May 16 06:59:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_refinement.rb: add a test.
+ * ext/date/date_strftime.c: should also be aware of flags on
+ complex specifier.
-Sun Aug 30 02:42:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Wed May 16 05:11:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl_ssl.c (ossl_ssl_method_tab): Only add SSLv3 support
- if the SSL library supports it. Thanks Kurt Roeckx <kurt@roeckx.be>
- [Bug #11376]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string
+ subclass dumping and loading.
- * ext/openssl/extconf.rb: check for SSLv3 support in the SSL
- implementation.
+ * test/psych/test_array.rb: pertinent tests
- * test/openssl/test_ssl.rb (class OpenSSL): Skip tests that need SSLv3
- if there is no support.
+ * test/psych/test_string.rb: ditto
-Fri Aug 28 16:05:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed May 16 01:31:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rdoc/*: Update rdoc master(cfffed5)
- https://github.com/rdoc/rdoc/pull/337
- https://github.com/rdoc/rdoc/pull/367
+ * ext/psych/lib/psych/visitors/to_ruby.rb: convert omap tagged maps to
+ Psych::Omap objects rather than hashes. [Bug #6425]
-Fri Aug 28 10:16:20 2015 Koichi Sasada <ko1@atdot.net>
+ * test/psych/test_omap.rb: pertinent test.
- * vm.c (hook_before_rewind): prevent kicking :return event while
- finishing vm_exec func because invoke_block_from_c() kick a :return
- event for bmethods.
- [Bug #11492]
+Wed May 16 01:15:45 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/ruby/test_settracefunc.rb: add a test.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
+ custom coders so that GC does not impact dumped yaml reference ids.
+
+Tue May 15 23:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Options#setup_options): add --color option.
+
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): defer color code
+ initialization to regard --color option.
+
+Mon May 14 16:28:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (f_arglist): should reset lexical states after empty
+ argument list with no parenthesis as well as parenthesized list,
+ so that reserved name method definition work. [ruby-dev:45626]
+ [Bug #6403]
+
+Mon May 14 00:14:24 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * enumerator.c (lazy_take_func, lazy_take): multiple calls of
+ force/to_a method to Enumerator::Lazy#take should return same
+ results. [ruby-dev:45634] [Bug #6428]
+
+ * test/ruby/test_lazy_enumerator.rb (test_take_recycle): add test for
+ above.
+
+Sun May 13 23:38:31 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): don't use IO.for_fd
+ to close IO objects. it create IO object with already closed fd, and
+ cause occasional Errno::EBADF in following tests. [ruby-core:45020]
+ [Bug #6228]
+
+Sun May 13 23:32:16 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO): revert r35631. it broke the intent of
+ test_flush_in_finalizer1. [ruby-core:43951] [Bug #6228]
+
+Sun May 13 22:46:36 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c (passwd_ensure): move endpwent() call from
+ passwd_iterate to close /etc/passwd on exception.
+ (group_ensure): move endgrent() call from group_iterate to close
+ /etc/group on exception.
+
+Sun May 13 18:10:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: removed unused code and changed the style.
+
+Sun May 13 17:37:56 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: refactored.
+
+Sun May 13 06:40:12 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/ruby/test_io.rb (class TestIO): Disable GC during IO tests to
+ avoid file descriptors being GC'ed. Suggestion by Tomoyuki Chikanaga
+ [ruby-core:43951][Bug #6228]
+
+Sat May 12 07:00:16 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/sdbm/init.c: Added documentation. Patch by Justin Collins,
+ cleanup by Zachary Scott. [ruby-trunk - #6410]
+
+Sat May 12 06:02:03 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/fileutils.rb (cp_r): Fixed cp_r example. Patch by TJ Koblentz
+ from pull request #114. [ruby-trunk - Bug #6411]
+
+Sat May 12 05:23:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ test_signal_requiring of test/ruby/test_signal.rb fail if the sub
+ process is killed on waiting IO in lex_io_gets in rb_load_file in
+ rb_load_internal in require.
+ This is because
+ (1) the process receive the killing signal in
+ rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
+ (2) set th->errinfo as INT2FIX(TAG_FATAL) at
+ rb_threadptr_execute_interrupts_common.
+ (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
+ without set loaded as TRUE.
+ (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
+ is FALSE as above. this errinfo should be an exception object
+ but this is INT2FIX(TAG_FATAL).
+ Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.
+
+Fri May 11 14:23:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (primary): begin/end block should be isolated from outside.
+ [ruby-dev:45631][Bug #6419]
+
+Fri May 11 14:09:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
+ must not cast it to unsigned long, which may be shorter than
+ VALUE, and the result can be mere garbage.
+
+Fri May 11 09:51:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary
+ newlines if no reports to be displayed.
+
+Thu May 10 10:55:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/minitest/test_minitest_mock.rb: Correct requiring path to
+ metametameta.rb.
+
+ * test/minitest/test_minitest_unit.rb: Correct requiring path to
+ metametameta.rb.
+
+Thu May 10 10:18:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lex_state_name): returns name for lex_state_e, for debug
+ use.
+
+Wed May 9 16:36:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#pkg_config): check if libs resulted from
+ pkg-config works actually.
+
+Wed May 9 16:01:38 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (decode_utf7, encode_utf7): refactored by
+ Nobuyoshi Nakada, to use String#encode.
+
+Wed May 9 13:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_remote_fetcher.rb: skip OpenSSL dependent
+ tests if not available.
+
+Wed May 9 08:09:38 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 3.0.0 (r7435)
+ * test/minitest/*: ditto
+ * test/rubygems/*: Imported fixes for buggy use of assert_match
+ and deprecated assert_block
+ UNBUNCH YOUR PANTIES. THE TESTS DO NOT RUN CLEAN ON OSX.
+
+Wed May 9 06:28:59 2012 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (rb_reg_equal): Removed incorrect example for Regexp#== with
+ "n" option. [ruby-talk - Bug #6415]
+
+Wed May 9 06:23:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: reverted.
+
+Wed May 9 04:31:26 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/rinda/ring.rb (lookup_ring_any): fix Rinda::RingFinger.primary
+ hungs forever. [ruby-talk:395364]
+
+Tue May 8 21:09:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * include/ruby/win32.h (FD_SET): change function to macro.
+ To avoid buffer overflow when smaller FD_SETSIZE is used in ext
+ libraries.
+
+ * win32/win32.c (rb_w32_fdset): this function is not used anymore.
+ But we leave this for compatibility.
+
+ * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
+ FD_SETSIZE is used in ext libraries. Dereference of fd_set pointer
+ causes SEGV.
+
+ * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
+ above.
+ * ext/-test-/win32/fd_setsize/depend: ditto.
+ * ext/-test-/win32/fd_setsize/extconf.rb: ditto.
+ * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.
+
+ [ruby-core:44588] [Bug #6352]
+
+Tue May 8 20:44:46 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * io.c (io_unread): fix IO#pos with mode 'r' bug on Windows.
+ If the end of reading buffer is CR, io_unread() needs to unread one
+ more byte.
+ [ruby-core:44874] [Bug #6401]
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_pos_with_buffer_end_cr):
+ add a test for above.
+
+Tue May 8 13:38:17 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/date/date_core.c: improving introduction in Date/DateTime
+ documentation. patched by Daniel Kaufman via Github.
+ https://github.com/ruby/ruby/pull/110
+
+Tue May 8 13:36:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (POSTLINK): default to : command to get rid of flag
+ only command, since BSD make does not work with it.
+
+Tue May 8 13:35:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (MiniTest#run_test): remove exact trace and get rid
+ of IndexError, which could caused by modified $@ sometimes.
+
+Tue May 8 11:21:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report):
+ support drive letter on Windows. yes, the original code is metameta.
+
+Tue May 8 08:54:48 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
+ patch by Mark Rushakoff. [ruby-trunk - #6346]
+
+Tue May 8 07:44:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl): remove useless rb_sys_fail
+ before ossl_raise. this cause a test failure on Linux.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz
+
+Tue May 8 05:35:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Added reference to variable.c where
+ public_constant and private_constant documentation lives. [#6381]
+
+Tue May 8 04:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#output): prefer local output to
+ get rid of unexpected side effect in test/minitest/metametameta.rb.
+
+ * lib/test/unit.rb (MiniTest#run_test): show the running test in $0.
+
+ * lib/test/unit.rb (Test::Unit::StatusLineOutput): new class to output
+ in status line.
+
+ * test/testunit/test_hideskip.rb (TestHideSkip#test_hideskip):
+ MiniTest#puke now reports Skipped messages only if verbose mode.
+
+ * test/testunit/test_sorting.rb (TestTestUnitSorting#test_sorting):
+ ditto.
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
+
+ * bootstraptest/runner.rb (exec_test, show_progress): show rotators
+ and pass/fail counts.
+
+ * sample/test.rb (PROGRESS): refine output.
+
+Tue May 8 02:34:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (assert_match): refix of r35563.
+ r35563 breaks the intention of the original change.
+ https://github.com/seattlerb/minitest/commit/68858105b2eb11c85105ffac5f32b662c59397f3
+ * lib/minitest/unit.rb (refute_match): ditto.
+
+Mon May 7 21:19:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge JSON 1.7.1.
+ https://github.com/flori/json/commit/e5b9a9465c1159fae533bca320d950b772bcb4ac
+
+Mon May 7 22:54:22 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: add support for option flags
+ OpenSSL::SSL::OP_NO_TLSv1_1
+ OpenSSL::SSL::OP_NO_TLSv1_2
+ to allow blocking specific TLS versions. Thanks to Justin Guyett for
+ pointing this out to me.
+ * test/openssl/test_ssl.rb: add tests to assert correct behavior when
+ blocking certain versions of TLS/SSL both on server and client side.
+ Also refactored tests to reduce boilerplate code a little.
+ * test/openssl/utils.rb: rescue Errno::ECONNRESET for tests where
+ client rejects the connection because a forbidden protocol version
+ was used.
+
+Mon May 7 20:14:15 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb (random_bytes): call to_int method for the
+ argument at first.
+
+Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (assert_match): replace matcher only if both
+ matcher and obj are String. fix r35541. [Bug #6405]
+ DON'T COMMIT IF YOU CAN'T RUN TEST.
+ FIX AS SOON AS POSSIBLE YOU BREAK TESTS.
+ patched by ayumin.
+ https://github.com/seattlerb/minitest/pull/124
+
+ * lib/minitest/unit.rb (refute_match): ditto.
+
+Mon May 7 13:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (PROGRAM), configure.in (POSTLINK): sign built program
+ using RUBY_CODESIGN identity.
+
+Mon May 7 13:03:55 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (body_type_attachment): parse body type
+ "ATTACHMENT". [ruby-core:44849] [Bug #6397]
+
+Mon May 7 10:49:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
+ they are used. [ruby-core:44900] [Bug #6406]
+
+Mon May 7 10:27:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/rmd160/rmd160.c (RMD160_Update): fix for huge data.
+
+Mon May 7 10:23:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/fileutils/fileasserts.rb: use assert_equal, assert_match, and so on.
+
+ * test/ruby/enc/test_utf16.rb, test/ruby/enc/test_utf32.rb,
+ test/ruby/test_io_m17n.rb (assert_str_equal): ditto.
+
+ * test/rubygems/test_gem_remote_fetcher.rb
+ (assert_data_from_{server,proxy}): ditto.
+
+ * test/test_pstore.rb (test_thread_safe): ditto.
+
+Mon May 7 10:16:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_installer.rb (TestGemInstaller#test_dir): fix
+ argument order. expected value must come first.
+
+Mon May 7 09:14:11 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: support TLSv1.1 & TLSv1.2. Add
+ SSLContext#version to inspect the version that was negotiated for
+ a given connection.
+ * ext/openssl/extconf.rb: detect TLS 1.1 & 1.2 support.
+ * test/openssl/test_ssl.rb: add tests for TLS 1.1 & 1.2 given they
+ are supported by the native OpenSSL being used.
+
+Sun May 6 21:34:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_encoding_set): suppress warnings. [ruby-dev:45627]
+ this tmp1 is not required after r35538.
+
+ * addr2line.c: suppress warnings.
+
+Sun May 6 18:39:39 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): remove unused variable `size'.
+
+Sun May 6 14:50:03 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb: show actual read length in an error message.
+
+Sat May 5 06:43:10 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.12.1 (r7323)
+ * test/minitest/*: ditto
+
+Sat May 5 01:47:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/zlib/test_zlib.rb (test_inflate): add a test for Zlib.inflate.
+ patched by headius (Charles Nutter). [ruby-core:44859] [Bug #6398]
+
+ * test/zlib/test_zlib.rb (test_deflate): add a test for Zlib.deflate.
+
+Sat May 5 00:53:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.
+ [ruby-core:44455] [Bug #6324]
+
+ * io.c (io_encoding_set): ditto.
+
+Fri May 4 07:19:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
+ [ruby-core:44798] [Bug #6393]
+
+Fri May 4 01:33:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/parser.rb (RDoc.alias_extension): a real file is irrelevant
+ to aliasing. [ruby-core:44796][Bug #6392]
+
+ * lib/rdoc/parser.rb (RDoc.zip?): non-existent file will not be a zip
+ file.
+
+ * lib/rdoc/parser.rb (RDoc.can_parse_by_name): accept aliased
+ extension file names.
+
+ * lib/rdoc/parser.rb (RDoc.binary?): binary read data may have
+ incomplete multibyte sequence. [ruby-core:44798][Bug #6393]
+
+Wed May 2 23:55:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): expand
+ real path to get rid of loading same files via symlinks.
+
+Wed May 2 23:26:04 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (rb_fiber_m_transfer): improve sample code in Fiber#transfer
+ documentation. emphasize the difference between transfer and resume.
+
+Wed May 2 23:21:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): allow spaces between lambda arrow and
+ parenthesis. [ruby-dev:45605][Feature #6390]
+
+Wed May 2 19:06:30 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * cont.c (rb_fiber_m_transfer): Improved Fiber documentation.
+ patched by Anuj Dutta. [ruby-core:44540][Bug #6343]
+
+Wed May 2 13:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * README, README.ja: reformatted using rdoc markup. based on the
+ patches by zzak (Zachary Scott) in [Feature #6388].
+
+ * README, README.ja: updated the author's mail address.
-Thu Aug 27 18:05:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed May 2 09:46:09 2012 Kouji Takao <kouji@takao7.net>
- * lib/webrick/server.rb: use IO::NULL instead of '/dev/null'
- * test/ruby/test_string.rb: ditto.
+ * ext/readline/readline.c (Readline.special_prefixes=)
+ (Readline.special_prefixes): new function. An original patch was
+ created by nagachika. [Feature #5784]
-Thu Aug 27 15:24:57 2015 Koichi Sasada <ko1@atdot.net>
+Tue May 1 22:18:45 2012 Kouji Takao <kouji@takao7.net>
- * compile.c (iseq_set_sequence): rename variable names
- to make it readable.
+ * ext/readline/readline.c (Readline.pre_input_hook)
+ (Readline.insert_text, Readline.redisplay): new function. An
+ original patch was created by nagachika. [Feature #5785]
-Thu Aug 27 07:45:34 2015 Koichi Sasada <ko1@atdot.net>
+Tue May 1 15:46:48 2012 Koichi Sasada <ko1@atdot.net>
- * thread_tools.c: add Queue#close(exception=false) and
- SizedQueue#close(exception=false).
- [Feature #10600]
+ * common.mk: "$(Q)-..." doesn't work on nmake.
- Trying to deq from a closed empty queue return nil
- if exception parameter equals to false (default).
+Tue May 1 15:32:10 2012 Koichi Sasada <ko1@atdot.net>
- If exception parameter is truthy, it raises
- ClosedQueueError (< StopIteration).
- ClosedQueueError inherits StopIteration so that you can write:
+ * common.mk: replace '@' prefix to '$(Q)' to control build
+ process outputs.
- loop{ e = q.deq; (using e) }
+Tue May 1 14:17:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Trying to close a closed queue raises ClosedQueueError.
+ * ext/openssl/deprecation.rb (OpenSSL.check_func): check if header is
+ available for macro compatibility.
- Blocking threads to wait deq for Queue and SizedQueue will be
- restarted immediately by returning nil (exception=false) or
- raising a ClosedQueueError (exception=true).
+Tue May 1 10:53:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- Blocking threads to wait enq for SizedQueue will be
- restarted by raising a ClosedQueueError immediately.
+ * test/ruby/test_settracefunc.rb: ignore traces from another threads
+ because Kernel.set_trace_func affects other threads.
- The above specification is not proposed specification, so that
- we need to continue discussion to conclude specification this
+Tue May 1 06:04:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/sha2/sha2.c (REVERSE32): explicitly cast since unsigned
+ long may be larger than sha2_word32.
+
+ * ext/digest/sha2/sha2.c (SHA{256,512,384}_{Final,End}): should clear
+ whole content, not pointer size.
+
+ * ext/digest/*/extconf.rb: use pkg_config to use same library with
+ openssl. [ruby-core:44755][Bug #6379]
+
+ * ext/openssl/deprecation.rb: extract check for broken Apple OpenSSL.
+
+Tue May 1 05:02:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (optflags): disable unsafe optimizations.
+ [ruby-core:44679][Bug #6370]
+
+Mon Apr 30 23:36:49 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod to
+ update meta data of symlinks.
+
+Mon Apr 30 23:05:53 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_continuation.rb (tracing_with_set_trace_func): don't
+ call Continuation from other threads. [ruby-dev:45596] [Bug #6382]
+
+Mon Apr 30 20:10:04 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/zlib/extconf.rb: detect z_crc_t type which will be defined
+ since zlib-1.2.7.
+
+ * ext/zlib/zlib.c (rb_zlib_crc_table): use z_crc_t if available.
+
+Mon Apr 30 09:02:15 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/openssl/lib/openssl/ssl.rb: add hostname to "hostname does not
+ match server cert." error. patched by Wes Morgan via Github.
+ https://github.com/ruby/ruby/pull/122
+
+Mon Apr 30 04:43:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/yaml_events.rb: implicit styles should not
+ be changeable for JSON events.
+
+Sun Apr 29 06:12:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (assoc, parser_yylex): add syntax to splat keyword hash.
+ [ruby-core:44591][Feature #6353]
+
+ * compile.c (compile_array_): generate keyword splat insns.
+
+ * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate
+ hash. leftward argument is prior currently.
+
+Fri Apr 27 12:34:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): should convert a Bignum value to
+ unsigned long long on Win64.
+ [ruby-core:44636][Bug #6364] reported by raylinn@gmail.com (ray linn)
+
+Fri Apr 27 10:58:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/readline/test_readline.rb (setup): avoid affected by user's
+ inputrc file. [ruby-dev:45584][Bug #6357]
+
+Fri Apr 27 01:45:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ handle timer_interrupt only on the first loop for the case to avoid
+ the infinite loop like following case:
+ * there is 2 Ruby threads (3 pthreads)
+ (1) main thread is waiting at gvl_yield:112 (native_cond_wait)
+ (2) sub thread works
+ (3) sub thread waits at gvl_yield:133 (native_mutex_unlock)
+ (4) main thread works
+ (5) main thread goes to gvl_acquire_common
+ (6) main thread call rb_wakeup_timer_thread
+ (7) timer thread set timer interrupt to the main thread
+ (8) main thread works
+ (9) main thread waits at gvl_acquire_common:64 (native_cond_wait)
+ (10) sub tread works
+ (11) set sub thread as the current thread
+ (12) run Ruby thread
+ (13) ...100ms
+ (14) sub thread goes to rb_threadptr_execute_interrupts_common
+ (15) sub thread call rb_thread_schedule_limits
+ (16) sub thread call gvl_release_common
+ (17) sub threads waits at gvl_yield:121 (native_cond_wait)
+ (18) main threads works
+ (19) main thread back to gvl_yield
+ (20) set main thread as the current thread
+ (21) main thread call gvl_yield
+ (22) main thread waits at gvl_yield:112 (native_cond_wait)
+ As described above, the main thread can't escape from
+ rb_threadptr_execute_interrupts_common.
+ See extended memo: http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/R35480_ExtendedMemo
+
+Fri Apr 27 07:15:07 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un, really.
+ reported by nagachika.
+ http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476
+
+Thu Apr 26 12:28:06 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): support the longest
+ path in sockaddr_un.
+ (inspect_sockaddr): ditto.
+ (addrinfo_mdump): ditto.
+ (addrinfo_mload): ditto.
+ (rsock_unixpath_str): new function.
+ (rsock_unixpath): removed.
+ (rsock_unixaddr): use rsock_unixpath_str.
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un.
+ (sock_s_unpack_sockaddr_un): ditto.
+ (sock_s_gethostbyaddr): unused variable removed.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): support the longest
+ path in sockaddr_un.
+
+ * ext/socket/rubysocket.h (rsock_unixpath_str): declared.
+ (rsock_unixpath): removed.
+
+ * test/socket/test_unix.rb: comment out test_nul because abstract unix
+ sockets may contain NULs.
+
+Thu Apr 26 01:32:33 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/optparse/test_summary.rb (test_summary_containing_space): add
+ test for r35467. OptionParser#to_a shouldn't split banner by spaces.
+
+Wed Apr 25 23:02:46 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): refine error message
+ format.
+ (addrinfo_mload): show more information on "too long AF_UNIX path"
+ error.
+ (addrinfo_unix_path): ditto for "too short AF_UNIX address" and
+ "too long AF_UNIX address" error.
+
+Wed Apr 25 05:46:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): split for each lines.
+ [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 21:57:53 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): show actual path length
+ when it is too long for Unix socket.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): ditto.
+
+Tue Apr 24 21:43:58 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/net/smtp.rb (check_continue): raise an error with an explanatory
+ message. [ruby-core:35854] [Feature #4598]
+
+Tue Apr 24 21:11:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line,
+ and MUST TEST IT, MUST RUN THE TEST, MUST VERIFY BEFORE BACKPORT.
+ [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 19:59:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enc/euc_jp.c: added EUC-JP-2004 and its alias EUC-JISX0213.
+ [ruby-dev:45571] [Feature #6349]
+ Requested by Kyouhei Yanagita <yanagi@shakenbu.org>.
+
+ * enc/trans/japanese_euc.trans: ditto.
+
+ * enc/trans/JIS/JISX0213-[12]%UCS@{BMP,SIP}.src: JIS X 0213:2004 ->
+ Unicode mapping table from NetBSD.
+
+ * enc/trans/JIS/UCS@{BMP,SIP}%JISX0213-[12].src: Unicode -> JIS X
+ 0213:2004 mapping table from NetBSD.
+
+ * tool/transcode-tblgen.rb: added SIP support.
+
+ * test/ruby/test_transcode.rb: tests of above changes.
+
+Tue Apr 24 18:12:13 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c: fix to output warning when the same literals
+ are available as a condition of same case clause.
+ And remove information ('#n') because we can find duplicated
+ condition with explicit line numbers.
+ [ruby-core:38343] [Ruby 1.9 - Bug #5068]
+
+ * test/ruby/test_syntax.rb: add a test for above.
+
+Tue Apr 24 17:03:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (waitpid): need to check the return value of
+ FindChildSlotByHandle() before passing poll_child_status().
+ this fixed a SEGV in test-all. reported by ko1 via IRC.
+
+Tue Apr 24 16:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): EXPR_BEG by keywords is a start point of
+ commands. [ruby-dev:45563][Bug #6347]
+
+ * parse.y (superclass): ditto for superclass.
+
+ * parse.y (parser_parse_string, parser_here_document): ditto for
+ string interpolation.
+
+ * parse.y (parser_yylex): ditto for singleton class.
+
+Tue Apr 24 15:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line
+ [ruby-dev:45568][Bug #6348]
+
+ * lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
+ defined. [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 12:46:50 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.
+ [Feature #6276]
+
+Tue Apr 24 10:54:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/drb/drbtest.rb ({DRbCore,DRbAry}#teardown): cannot pass SIGTERM
+ to another process on Windows, so use SIGINT instead.
+
+Tue Apr 24 00:25:39 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread.c (rb_check_deadlock): refine an error message of deadlock
+ detection. [ruby-core:44336] [Bug #6288]
+
+Tue Apr 24 00:14:42 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y (primary): remove wrong "fixpos" that caused incorrect
+ source_location of blocks. [ruby-core:42232] [Bug #5930]
+
+ * test/ruby/test_proc.rb: add a test for above.
+
+Mon Apr 23 22:56:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv: deprecated. [Feature #6322]
+
+Mon Apr 23 22:07:00 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_unix.rb (bound_unix_socket): make temporary
+ filename shorter for less possibility of Unix socket path over
+ 107 bytes when TMPDIR has long path.
+
+Mon Apr 23 20:35:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (szInternalCmds, internal_match, internal_cmd_match):
+ get rid of a segmentation fault with GCC 4.7.0.
+ reported by raylinn@gmail.com (ray linn) at [ruby-core:44505]
+ [Bug #6333], and patched by mame.
+
+ * test/ruby/test_system.rb (TestSystem#test_system): test for it.
+
+Mon Apr 23 20:11:02 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/ssl.rb: generate 1024 bits RSA key instead of 512 bits.
+ OpenSSL 1.0.1 rejects 512 bits RSA key for TLS1.2 with SHA512.
+ http://rt.openssl.org/Ticket/Display.html?id=2769&user=guest&pass=guest
+ reported by Bohuslav Kabrda.
+ [ruby-core:43844] [ruby-trunk - Bug #6221]
+
+Mon Apr 23 19:54:33 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/drb/drbtest.rb: rescue Errno::ESRCH for Process.kill.
+ reported by NARUSE, Yui. [ruby-dev:45551]
+
+Mon Apr 23 14:16:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * .gdbinit (rb_ps_vm): follow st_table's packing change.
+
+Mon Apr 23 10:43:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: disable rubygems not to load rbconfig.rb before
+ fake.rb. [ruby-core:44492][Bug #6329]
+
+Sun Apr 22 20:26:06 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/extservm.rb (DRb::ExtServManager): don't use /bin/sh to
+ invoke service subprocess. mark detach threads for clean up.
+
+ * test/drb/drbtest.rb: clean up the service subprocess in teardown.
+
+ * test/drb/test_drb.rb: set @service_name for teardown.
+
+ * test/drb/test_drbunix.rb: ditto.
+
+ * test/drb/test_drbssl.rb: ditto.
+
+ [ruby-dev:45547]
+
+Sun Apr 22 07:51:29 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed.
+ [ruby-dev:45541]
+
+Sat Apr 21 14:36:49 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * test/rinda/test_rinda.rb: fix sticks on some tests problem
+ [Bug #6272]
+
+Fri Apr 20 12:24:04 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem: Removed to avoid
+ conflict with ca-bundle.pem
+ * lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem:
+ ditto.
+ * lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem:
+ ditto.
+
+Fri Apr 20 08:07:06 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.23 which contains security
+ fixes:
+
+ RubyGems now disallows redirection from HTTPS to HTTP.
+
+ RubyGems now verifies SSL connections.
+
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.22.
+ * test/rubygems: ditto.
+
+Thu Apr 19 16:33:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): fix carry-up bug and
+ overwrite '+' with '-' if negative offset less than a hour.
+ [ruby-core:44447][Bug #6323]
+
+Thu Apr 19 09:39:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/-test-/win32/dln/extconf.rb: need import library for ordinal
+ entry even on mingw. [ruby-core:44441][Bug #6320]
+
+Thu Apr 19 09:35:15 2012 Eric Hodel <drbrain@segment7.net>
+
+ * random.c (random_init): Clarify that the default seed is
+ Random.new_seed, not zero. Based on patch by Roger Pack.
+ [ruby-trunk - Bug #6313]
+ * random.c (rb_f_srand): ditto.
+
+Thu Apr 19 08:59:02 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c (window_nodelay): Fixed call-seq of nodelay to
+ include the '='.
+
+ Improved description window.nodelay=.
+
+Thu Apr 19 08:47:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * io.c (io_readpartial): Document the output buffer parameter is
+ overwritten with the read contents even when non-empty.
+ Patch by yu nobuoka. [ruby-trunk - Bug #6285]
+ * io.c (io_read_nonblock): ditto.
+ * io.c (io_read): ditto.
+ * io.c (rb_io_sysread): ditto.
+ * io.c (argf_read): ditto.
+ * io.c (argf_readpartial): ditto.
+ * ext/stringio/stringio.c (strio_read): ditto.
+ * test/ruby/test_argf.rb (class TestArgf): Add test for existing
+ behavior of read outbuf.
+ * test/ruby/test_io.rb (class TestIO): ditto.
+ * test/stringio/test_stringio.rb (class TestStringIO): ditto.
+
+Wed Apr 18 22:58:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DOT, DOXYGEN): use AC_CHECK_PROGS instead of
+ AC_CHECK_PROG which needs the third argument. [ruby-core:44433]
+ [Bug #6316]
+
+ * configure.in (PKG_CONFIG): fix condition to skip older version
+ of pkg-config. continue in backticks does not affect outside.
+
+Wed Apr 18 13:59:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK.
+
+Wed Apr 18 10:22:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): add an interim digit for
+ the timezone offset which is less than an hour.
+
+Wed Apr 18 09:58:29 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/version.rb: Fixed init_with warning by calling into
+ yaml_initialize (for syck) from psych's init_with
+
+Wed Apr 18 09:03:43 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
+ were ported to the rubygems git repository.
+
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.11.
+
+ * test/rubygems: ditto.
+
+Tue Apr 17 22:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): fix padding of time zone
+ offset. [ruby-dev:43287][Bug #4458]
+
+Tue Apr 17 13:11:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (rb_w32_check_imported): skip ordinal entries. based on a
+ patch by phasis68 (Heesob Park) at [ruby-core:44381].
+ [ruby-core:44371][Bug #6303]
+
+Mon Apr 16 18:22:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * spec/default.mspec: expand relative path for ruby_exe which uses
+ them with Dir.chdir; it breaks relative paths, for example
+ core/kernel/exec_spec.rb.
+
+Mon Apr 16 16:22:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (gmtime_r, localtime_r): POSIX compliant reentrant
+ versions.
+
+ * configure.in (RUBY_MSVCRT_VERSION): define on mingw too.
+
+ * win32/Makefile.sub (config.h): prefix RT_VER with RUBY and make
+ more descriptive to get rid of potential conflict.
+
+Mon Apr 16 15:19:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (NO_RUBY_VENDOR_LIB): fix missing comma.
+
+Mon Apr 16 12:17:12 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb (hermitian?): Bug fix, patch by George Koehler
+ [Bug #6290] [rubyspec:4b9573d7613]
+
+Mon Apr 16 09:42:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/remote_fetcher.rb (Gem::RemoteFetcher#download): should
+ use File.identical? to check the identity of the files.
+ this fixed an error of a test on Windows.
+
+Sat Apr 14 12:55:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (UNREACHABLE): gcc 4.4 eliminates unreachable code
+ if -O3 is given.
+
+ * win32/win32.c (child_result): dropped colon.
+
+Sat Apr 14 10:45:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start):
+ partially revert r35315.
+
+ * test/webrick/test_server.rb (test_start_exception):
+ received signal is delivered to the main thread, so it is needed to
+ emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236]
+
+Sat Apr 14 09:35:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * variable.c (trace_ev): Removed "not reached" comment as this line is
+ reached.
+ * variable.c (rb_obj_remove_instance_variable): Replaced "not reached"
+ comment with the UNREACHABLE macro.
+ * variable.c (rb_mod_const_missing): ditto.
+ * variable.c (rb_mod_remove_cvar): ditto.
+ * enum.c (first_i): ditto.
+ * string.c (rb_str_aref): ditto.
+ * string.c (str_byte_aref): ditto.
+ * string.c (rb_to_id): ditto.
+ * io.c (rb_io_fmode_modestr): ditto.
+ * io.c (rb_io_oflags_modestr): ditto.
+ * pack.c (num2i32): ditto.
+ * vm_eval.c (rb_method_missing): ditto.
+ * vm_eval.c (rb_f_throw): ditto.
+ * dir.c (dir_read): ditto.
+ * win32/win32.c (child_result): ditto.
+ * struct.c (rb_struct_getmember): ditto.
+ * struct.c (rb_struct_set): ditto.
+ * struct.c (rb_struct_aref_id): ditto.
+ * eval.c (rb_f_raise): ditto.
+ * process.c (rb_f_exit_bang): ditto.
+ * process.c (rb_f_exit): ditto.
+ * process.c (rb_f_abort): ditto.
+ * ext/-test-/iter/break.c (iter_break_value): ditto.
+ * ext/pty/pty.c (pty_check): ditto.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto.
+ * ext/readline/readline.c (rb_remove_history): ditto.
+ * ext/stringio/stringio.c (strio_unimpl): ditto.
+ * numeric.c (num_sadded): ditto.
+ * numeric.c (num_init_copy): ditto.
+ * numeric.c (rb_num2ll): ditto.
+ * numeric.c (rb_num2ull): ditto.
+ * vm_insnhelper.c (call_cfunc): ditto.
+ * ruby.c (opt_W_getter): ditto.
+ * bignum.c (rb_big_coerce): ditto.
+ * file.c (rb_f_test): ditto.
+
+Sat Apr 14 08:38:20 2012 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
+ reaches end of non-void function" warnings. [ruby-trunk - Bug #6066]
+ * re.c (name_to_backref_number): ditto.
+ * object.c (rb_Float): ditto.
+ * io.c (io_readpartial): ditto.
+ * io.c (io_read_nonblock): ditto.
+ * pack.c (rb_uv_to_utf8): ditto.
+ * proc.c (rb_method_entry_arity): ditto.
+ * vm_method.c (rb_f_notimplement): ditto.
+ * struct.c (rb_struct_aset_id): ditto.
+ * class.c (rb_scan_args): ditto.
+ * process.c (rlimit_resource_type): ditto.
+ * process.c (rlimit_resource_value): ditto.
+ * process.c (p_uid_switch): ditto.
+ * process.c (p_gid_switch): ditto.
+ * ext/digest/digest.c (rb_digest_instance_update): ditto.
+ * ext/digest/digest.c (rb_digest_instance_finish): ditto.
+ * ext/digest/digest.c (rb_digest_instance_reset): ditto.
+ * ext/digest/digest.c (rb_digest_instance_block_length): ditto.
+ * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto.
+ * ext/dl/handle.c (rb_dlhandle_close): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check0): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check1): ditto.
+ * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto.
+ * ext/tk/tcltklib.c (lib_get_reltype_name): ditto.
+ * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto.
+ * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto.
+ * ext/fiddle/conversions.c (generic_to_value): ditto.
+ * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto.
+ * ext/socket/socket.c (sock_s_getnameinfo): ditto.
+ * ext/ripper/eventids2.c (ripper_token2eventid): ditto.
+ * cont.c (return_fiber): ditto.
+ * dmydln.c (dln_load): ditto.
+ * vm_insnhelper.c (vm_search_normal_superclass): ditto.
+ * bignum.c (big_fdiv): ditto.
+ * marshal.c (r_symlink): ditto.
+ * marshal.c (r_symbol): ditto.
+
+Fri Apr 13 17:12:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (inspect_i): keep string's coderange.
+
+Fri Apr 13 15:26:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_aset, rb_hash_update, rb_hash_update_by): use
+ st_update() to reduce evaluation of hash values.
+
+Fri Apr 13 15:17:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;
+ this method is to deny new connections, not shutdown yet.
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start):
+ re-raise exception only when the exception is Interrupt (^C).
+
+Thu Apr 12 19:51:45 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added some notes.
+
+Wed Apr 11 17:16:49 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (compile_array, compile_array_):
+ Divide big array (or hash) literals into several blocks and
+ concatenate them. There was a problem that a big array (hash)
+ literal causes SystemStackError exception (stack overflow)
+ because VM push all contents of the literal onto VM stack to
+ make an array (or hash). To solve this issue, we make several
+ arrays (hashes) and concatenate them to make a big array (hash)
+ object. [ruby-dev:37701] [Bug #982]
+
+ * compile.c (iseq_compile_each, setup_args): use modified
+ compile_array.
+
+ * vm.c (m_core_hash_from_ary, m_core_hash_merge_ary,
+ m_core_hash_merge_ptr): added for above change.
+
+ * id.c (Init_id), parse.y: add core method ids.
+
+ * bootstraptest/test_literal.rb: add simple tests.
+
+ * bootstraptest/test_eval.rb: remove rescue clause to catch
+ SystemStackError exception.
+
+ * test/ruby/test_literal.rb: add tests to check no stack overflow.
+
+Thu Apr 12 07:10:37 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri/generic.rb (module URI): URI now downcases the scheme to
+ follow RFC 2396 section 3.1. [ruby-trunk - Feature #4551]
+ * test/uri/test_generic.rb (class URI): Test for above
+
+Thu Apr 12 06:15:44 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/protocol.rb (module Net): Added ReadTimeout to match
+ OpenTimeout. ReadTimeout is now raised by rbuf_fill instead of
+ Timeout::Error to help users distinguish what type of timeout
+ occurred. [ruby-trunk - Feature #6088]
+ * lib/net/pop.rb (module Net): Updated documentation for ReadTimeout
+ and OpenTimeout.
+ * lib/net/http.rb (module Net): ditto
+ * lib/net/smtp.rb (module Net): ditto
+ * lib/net/telnet.rb (module Net): Net::ReadTimeout is now raised in
+ waitfor to match Net::Protocol.
+ * test/net/http/test_http.rb: Updated Timeout::Error expectation to
+ Net::ReadTimeout.
+ * test/net/ftp/test_ftp.rb: ditto
+
+Thu Apr 12 05:27:01 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/server.rb (module WEBrick::GenericServer): A server
+ will now continue only when a StandardError subclass is raised. For
+ other exception types the error will be logged at the fatal level and
+ the server will safely stop. Based on a patch by Alex Young.
+ [ruby-trunk - Feature #6236]
+ * test/webrick/test_server.rb: Test for new exception handling
+ behavior. Join the server thread instead of busy-waiting for it to
+ shut down to remove race conditions.
+
+Thu Apr 12 03:50:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit:Runner::Worker#_run_suites):
+ call GC.start before running the test suites.
+
+Wed Apr 11 22:31:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_check_id_cstr): new function to check if ID is
+ registered with NUL-terminated C string.
+
+ * sprintf.c (rb_str_format): avoid inadvertent symbol creation.
+
+Wed Apr 11 20:28:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * io.c (rb_io_eof): use eof() instead of io_fillbuf(). It's because
+ io_unread() doesn't work properly when reading CRLF with read(length)
+ and mode 'r'.
+ [ruby-core:44189][Bug #6271]
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_read_crlf_and_eof):
+ test for above.
+
+Wed Apr 11 07:38:33 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/digest/sha2/lib/sha2.rb (Digest#block_length): Fixed method name
+ in documentation examples. Patch by naleski via
+ https://github.com/ruby/ruby/pull/115
+
+Wed Apr 11 07:33:13 2012 Eric Hodel <drbrain@segment7.net>
+
+ * pack.c (pack_pack): Warn when an invalid character is found in the
+ format string when $VERBOSE is true. [ruby-trunk - Feature #5219]
+ * pack.c (pack_unpack): ditto
+ * test/ruby/test_pack.rb (class TestPack): Test for warnings on
+ invalid format characters.
+
+Wed Apr 11 06:11:10 2012 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (rb_str_tr): Documented use of \ to escape characters.
+ [ruby-trunk - Bug #6161]
+ * string.c (rb_str_count): ditto
+
+Wed Apr 11 05:14:51 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/abbrev.rb: Clarified that Abbrev.abbrev returns a Hash instead
+ of an Array. Patch by Andrei Bocan. [ruby-trunk - Bug #6107]
+
+Wed Apr 11 03:02:24 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/ripper/lib/ripper/sexp.rb: fix spelling. patched by
+ Jonathan Hinkle via https://github.com/ruby/ruby/pull/116
+
+Tue Apr 10 19:07:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_enc_raise): new function to raise an exception with
+ the message in the given encoding. patched by now (Nikolai
+ Weibull) at [ruby-core:41160]. [Feature #5650]
+
+Tue Apr 10 18:19:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP#send_request_with_body_stream):
+ use IO.copy_stream for requests using body_stream.
+ patched by Eric Wong. [ruby-core:40898] [Feature #5605]
+
+Tue Apr 10 16:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c: add prototype declarations for older Mac OS X.
+ [ruby-core:43376][Bug #6170]
+
+Tue Apr 10 15:35:21 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_set_sequence): show a hint if there are duplicated
+ "when" clauses. [ruby-core:41502] [ruby-trunk - Feature #5716]
+
+Tue Apr 10 09:57:00 2012 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (rb_str_split_m): Documented behavior of split on the empty
+ string. [ruby-trunk - Feature #3575]
+
+Tue Apr 10 09:48:31 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
+ NO_FLUSH with FINISH. [ruby-trunk - Bug #6273]
+
+Mon Apr 9 23:10:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (isUNCRoot, winnt_stat): support long UNC.
+ [ruby-core:30623][Feature #3399]
+
+Mon Apr 9 15:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (string_content, parser_yylex): count brace nesting to
+ dispatch embexpr_end. [ruby-core:43775][Bug #6211]
+
+Mon Apr 9 13:06:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * hash.c (rb_hash_set_default_proc): Accept nil, patch by Run Paint
+ [Feature #4234]
+
+ * test/ruby/test_hash.rb: test for above.
+
+Mon Apr 9 08:01:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: gets the value with range() consistently.
+ * ext/date/date_strftime.c (range): now just replaces the given item.
+
+Mon Apr 9 06:58:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (nucomp_expt): [ruby-core:44170].
+
+Mon Apr 9 02:52:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum
+ with mathn. [ruby-core:44170] [Bug #6267]
+
+Sun Apr 8 22:46:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/generator/generator.c (generate_json_bignum):
+ add RB_GC_GUARD.
+ http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120407T210301Z.diff.html.gz
+
+Sun Apr 8 07:26:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): get keys
+ and fetch values from it to prevent @timeout_info's error
+ "can't add a new key into hash during iteration".
+
+Sun Apr 8 06:51:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_unread): cast as long the value for extra_max.
+ [ruby-core:44137] [Bug #6257]
+
+Sun Apr 8 06:46:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
+ use readpartial to get data even if the response is streaming data and
+ each data is smaller than @buffer_size.
+ patched by yu nobuoka. [ruby-dev:45471] [Bug #6230]
+
+Sat Apr 7 22:35:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
+ new function.
+
+ * process.c (enum): add EXEC_OPTION_PGROUP and move the position
+ above for the usage in proc_spawn_n().
+
+ * process.c (proc_spawn_n): add an argument to pass new option
+ `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
+ CreateProcessW(). This flag is necessary for the usage of
+ Process.kill on the subprocess on Windows.
+
+ * process.c (rb_exec_arg_addopt): ditto.
+
+ * process.c (rb_spawn_process): ditto.
+
+ * process.c (documentation for rb_f_spawn): add documentation for new
+ option `new_pgroup` of spawn.
+
+ * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
+ add tests for option `new_pgroup`.
+
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt):
+ add option `new_pgroup: true` to spawn on Windows. It's needed for
+ Process.kill on a subprocess.
+
+ * win32/win32.c (CreateChild): add an argument to pass
+ dwCreationFlags of CreateProcessW().
+
+ * win32/win32.c (rb_w32_spawn): ditto.
+
+ * win32/win32.c (rb_w32_aspawn_flags): add new function to pass
+ dwCreationFlags.
+
+ * win32/win32.c (rb_w32_aspawn): refactor to move the content to
+ rb_w32_aspawn_flags().
+ [ruby-core:43245][Bug #6131]
+
+Sat Apr 7 22:32:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
+ Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
+ flag is not specified in a call to CreateProcessW().
+
+ * win32/win32.c (CreateChild): revert the usage of
+ CREATE_NEW_PROCESS_GROUP flag for compatibility.
+ [ruby-core:43245][Bug #6131]
+
+Sat Apr 7 10:28:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: bumping up psych version to match release.
+ * ext/psych/psych.gemspec: ditto
+
+Sat Apr 7 02:07:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c: fall back to any encoding if the external
+ encoding is wrong. [ruby-core:44163]
+ * test/psych/test_encoding.rb: fix test
+
+Fri Apr 6 16:24:24 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * struct.c (documentation for rb_struct_members_m):
+ fix 'array of strings' to 'array of symbols'
+ [ruby-core:44152][Bug #6264]
+
+Fri Apr 6 14:27:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * Makefile.in ($(LIBRUBY_A)): fix typo.
+
+Thu Apr 5 13:26:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * missing/alloca.c (xmalloc, xfree): use ruby version, not
+ depending on RUBY_LIB_PREFIX. [ruby-dev:45492][Bug #6255]
+
+Wed Apr 4 13:06:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
+
+Wed Apr 4 10:33:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and
+ read on closing.
+
+Wed Apr 4 01:48:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully.
+
+ * lib/ftp/ftp.rb (Net::BufferedSocket#shutdown): added.
+
+ * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): wait socket
+ with shutdown and read.
+
+Tue Apr 3 19:00:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): should wait
+ a little before closing socket because if the client call
+ Net::FTP#getmultiline the socket is suddenly closed by the server in
+ the getline loop.
+
+Tue Apr 3 18:33:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (setreuid, setregid): suppress warnings.
+ [ruby-core:43374][Bug #6169]
+
+Tue Apr 3 10:18:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (inspect_enumerator): suppress uninitialized
+ instance variable warnings. [ruby-dev:45449][Bug #6214]
+ patched by no6v (Nobuhiro IMAI).
+
+Mon Apr 2 13:25:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse/ac.rb: autoconf-like options.
+
+Mon Apr 2 10:34:00 2012 eregon <eregontp@gmail.com>
+
+ * string.c (rb_str_start_with, rb_str_end_with): raise an error if
+ an argument is not convertible to a String.
+ [ruby-core:40623][Bug #5536]
+
+Mon Apr 2 03:35:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/server.rb (WEBrick::GenericServer): close socket only if
+ the socket is not closed yet.
+
+Sun Apr 1 23:03:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/ftp.rb (Net::BufferedSocket): should delegate send() to @io
+ for Net::FTP#abort and Net::FTP#status.
+
+Sun Apr 1 00:41:56 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb: fixed the domain name in examples.
+
+Sat Mar 31 21:39:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): dup to prevent
+ @timeout_info's "can't add a new key into hash during iteration".
+
+Sat Mar 31 14:22:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (hash_default_value): extract from rb_hash_aref(), to be
+ shared with rb_hash_shift(), so that overriding Hash#default
+ will be respected.
+
+Sat Mar 31 14:16:02 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
+
+ * hash.c: do not allocate st_table when it is not necessary.
+
+Sat Mar 31 13:42:39 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (read_timeout=, open_timeout=): supported timeout.
+
+Sat Mar 31 13:20:40 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
+
+ * hash.c: remove unnecessary checks for Qundef in hash iterations.
+ since hash use st_foreach_check for iterations, such checks are
+ needless.
+
+Sat Mar 31 12:05:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_x509cert.c: Fix doc typo.
+
+Sat Mar 31 10:13:24 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
+
+ * st.c (st_foreach_check, st_foreach): remove ancient check. This
+ check are from initial ordered hash commit when first entry were
+ created with entry->fore = entry->back = entry.
+
+ * st.c (st_delete): use real_entries in st_delete for packed tables
+
+Sat Mar 31 07:53:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (st_foreach_check): remove the entry by replacing with never
+ when ST_DELETE.
+
+ * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is
+ not special value, so use 0 instead. therefore this function can be
+ applied to only st_table which 0 is invalid as keys, e.g., IDs.
+
+ * hash.c: Qundef cannot be passed from st_foreach_check().
+
+ * hash.c, marshal.c, object.c, variable.c: fix callback argument types
+ of iterators.
+
+Thu Mar 29 23:50:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (st_update): pass pointer to key to the callback function.
+
+Thu Mar 29 16:36:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (st_update): add existing parameter to the callback function.
+
+Thu Mar 29 16:35:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (terminal_width, del_status_line, put_status):
+ extract as methods.
+
+Thu Mar 29 10:20:18 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkcs7.c: fix crash when parsing garbage data.
+ * test/openssl/test_pkcs7.rb: assert correct behavior for it.
+ Thanks to Matt Venables for reporting the issue.
+ [ruby-core:43250][Bug #6134]
+
+Thu Mar 29 10:16:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental]
+ cf. [Bug #6098]
+
+Thu Mar 29 10:12:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts_common): use defined
+ TIME_QUANTUM_USEC instead of a magic number. there is no meanings
+ to use different values for checking interval of interruption and
+ thread switching limits.
+ cf. [Bug #6098]
+
+Thu Mar 29 09:26:17 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_x509cert.rb: exclude test that fails when issuing
+ a certificate with RSA signature and DSS1 digest for earlier
+ OpenSSL versions when used in conjunction with OpenSSL 1.0.1.
+ Thanks, Vit Ondruch, for reporting the issue.
+ [ruby-core:42949][Bug #6089]
+
+Thu Mar 29 08:25:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS: add note about unified behavior of encoding nil values in
+ instances of OpenSSL::ASN1::ASN1Data.
+
+Thu Mar 29 07:45:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: raise TypeError when trying to encode nil
+ values for Primitive instances.
+ * test/openssl/test_asn1.rb: Assert consistent behavior when
+ encoding nil values: Primitives raise TypeError, Constructives
+ raise NoMethodError.
+ Fixes [ruby-core:43009][Bug #6102]
+
+Wed Mar 28 16:39:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (obj2uid, obj2gid): allow strings as input user/group id.
+ [ruby-core:40923][Feature #5610]
+
+Wed Mar 28 15:06:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_symreal): default to ASCII-8BIT for non-ascii symbols,
+ otherwise it should be converted to US-ASCII in rb_intern_str() if
+ possible. [ruby-core:43762][Bug #6209]
+
+Wed Mar 28 08:44:24 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: updating version to match gem
+ * ext/psych/psych.gemspec: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fixing deprecation warning
+
+Tue Mar 27 23:44:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (io_unread): fixed memory leak. report by nagachika via IRC.
+
+Tue Mar 27 22:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (verconf.h): separate load path specific stuff from
+ config.h.
+
+Tue Mar 27 22:43:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub: fix config.h path to include.
+
+Tue Mar 27 17:08:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * win32/win32.c (check_if_dir): fix memory leak.
+
+Tue Mar 27 13:13:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_new_empty): should copy also the encoding as an
+ empty substring. [ruby-dev:45441][Bug #6206]
+
+Mon Mar 26 23:43:04 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use $~.
+
+Mon Mar 26 23:34:40 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use local
+ variables defined by named capture for other Ruby implementations
+ such as Rubinius.
+
+Mon Mar 26 23:19:03 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (parse_pasv_port): refactored.
+
+Mon Mar 26 19:49:49 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/net/ftp/test_ftp.rb: add the test, which was forgotten in the
+ previous commit.
+
+Mon Mar 26 19:37:27 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (parse227, parse228, parse229): refactored.
+
+Mon Mar 26 11:46:23 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (inspect_enumerator): show method arguments of
+ lazy enumerators correctly.
+
+Mon Mar 26 13:51:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (check_if_dir, check_if_wdir): fix for Visual C++
+ not to use S_ISDIR(). [Feature #2408][ruby-core:26925]
+
+ * ruby.c (load_file_internal): ditto.
+
+Mon Mar 26 11:46:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (load_file_internal): bail out if the script is a directory.
+ [Feature #2408][ruby-core:26925]
+
+ * win32/win32.c (rb_w32_open, rb_w32_wopen): check if the file is a
+ directory when access denied, to set errno to EISDIR.
+
+Sun Mar 25 18:13:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_setup_table): fix multiple non latin argument for
+ non latin (over 256 characters) tr-like methods.
+ [ruby-core:43371] [Bug #6167]
+
+Sun Mar 25 00:46:06 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator (lazy_initialize): set the instance variable "receiver"
+ to include the receiver to the return value of inspect on a lazy
+ enumerator directly created by Enumerator::Lazy.new.
+
+ * enumerator (RETURN_LAZY): don't set the instance variable "receiver".
+
+Sat Mar 24 23:59:00 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator (enumerator_inspect): include the original receiver and
+ method name of Enumerator::Lazy in the result of inspect.
+ [ruby-core:43345] [Bug #6159]
+
+ * enumerator (InitVM_Enumerator): don't use rb_define_alias for
+ some methods such as collect in order to make rb_frame_this_func()
+ return the correct method names.
+
+Sat Mar 24 22:22:18 2012 Sambasiva Rao Suda <sambasivarao@gmail.org>
+
+ * time.c (time_init_1): Time.new will accept seconds as string or
+ int. [ruby-core:43569][Bug #6193]
+
+Fri Mar 23 15:12:12 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * transcode.c (documentation for str_encode): Explain
+ that transcoding to the same encoding is a no-op
+ (i.e. no exceptions, no replacements,...).
+ [ruby-core:43557][Bug #6190]
+
+Fri Mar 23 13:19:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_str_to_inum): must be ASCII compatible encoding as
+ well as String#hex and String#oct. [ruby-core:43566][Bug #6192]
+
+ * string.c (rb_must_asciicompat): check if ASCII compatible.
+
+Thu Mar 22 23:14:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (str_encode_bang, encoded_dup): if nothing was
+ transcoded, just set encoding but leave coderange unchanged as
+ force_encoding. [ruby-core:43557][Bug #6190]
+
+Thu Mar 22 22:30:44 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * io.c (static int io_fflush): add the definition.
+ Use it in set_binary_mode_with_seek_cur().
+
+ * io.c (set_binary_mode_with_seek_cur): refactoring to split the
+ content into io_unread(). Fix the possibility of buffer overflow.
+
+ * io.c (io_unread): add new implementation for Windows. Previous one
+ caused invalid cursor position using IO#pos with OS text mode. New
+ one fixes the bug.
+
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_pos_dont_move_cursor_position): add a test for
+ above bug.
+ [ruby-core:43497] [Bug #6179]
+
+Thu Mar 22 19:55:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIME
+ to time_t directly, not to be affected by TZ unnecessarily.
+
+ * win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME
+ simply.
+
+Thu Mar 22 13:43:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.
+ [Bug #6094]
+
+Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
+ see [ruby-core:43550]
+
+Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
+ [Bug#6143] [Bug#6144] [Bug#6145]
+
+Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
+ see [Bug #6179][ruby-core:43518]
+
+Mon Mar 19 17:18:51 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_flat_map_func): convert the block value to
+ Array if it doesn't respond to each. [ruby-core:43334]
+ [Bug #6155]
+
+Mon Mar 19 16:34:14 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enum.c (zip_i): variadic argument needs explicit cast on the
+ platforms where VALUE is longer than int.
+
+Mon Mar 19 15:36:41 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (enumerable_lazy): add an example of take and first
+ to the documentation. [ruby-core:43344] [Bug #6158]
+ add the description of the behavior when a block is given to zip
+ or cycle.
+
+Mon Mar 19 15:20:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_specialized_instruction): DRY and replace chain
+ of if-else with switch for special instructions. based on a
+ patch by Vasfed. https://github.com/ruby/ruby/pull/105
+
+Mon Mar 19 15:05:54 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/test_pty.rb: same as r29280, skip tests when PTY allocation
+ failed (that's not our fault).
+
+Sun Mar 18 23:21:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (aligned_free): fix condition for free. memalign() and
+ posix_memalign() are not defined together normally.
+
+Sun Mar 18 18:31:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * gc.c (aligned_malloc, aligned_free): added fallback implementations
+ for platforms like OSX Leopard.
+
+Sun Mar 18 17:17:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_big_pow): estimate result bit size more precisely.
+ [ruby-core:30735][Feature #3429]
+
+Sun Mar 18 17:17:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (free_method_entry_i): method entry may be in
+ unlinked_method_entry_list. [ruby-core:43383][Bug #6171]
+
+Sun Mar 18 15:27:31 2012 Tanaka Akira <akr@fsij.org>
+
+ * compile.c: typo fix by Run Paint Run Run.
+ [ruby-core:28368] [Bug #2824]
+
+Sun Mar 18 10:01:02 2012 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * lib/profiler.rb: support calling singleton methods of
+ an instance of BasicObject.
+
+Sat Mar 17 06:56:58 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c: Fix indentation of Class#inherited example.
+
+Sat Mar 17 01:46:05 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * string.c (trnext): fix bug with string ending with '\\'.
+ [ruby-dev:45374][Bug #6160]
+
+ * test/ruby/test_string.rb (TestString#test_delete): test for
+ above.
+
+Fri Mar 16 20:06:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (trnext): should advance char-wise.
+ [ruby-core:43335][Bug #6156]
+
+Fri Mar 16 17:42:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (block_append_gen): fix unreachable warning line number.
+ should warn at the code, not jump.
+
+Fri Mar 16 17:33:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (enum_take): allocate buffer array before iteration, as well
+ as enum_first did.
+
+ * enum.c (enum_first): remove duplication.
+
+Fri Mar 16 14:43:18 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * load.c (ruby_init_ext): don't free the given pointer itself.
+ It is not guaranteed even that the pointer is on heap.
+
+Fri Mar 16 14:37:57 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention class variable lookup. [ruby-core:40649]
+ [Bug #5544]
+
+Fri Mar 16 14:27:11 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention constant lookup. [ruby-core:41718]
+ [Bug #5777]
+
+Fri Mar 16 14:10:45 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (initialize): raise Net::IMAP::Error when the
+ connection is closed without a greeting response.
+ [ruby-core:40938] [Bug #5616]
+
+Fri Mar 16 13:50:12 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
+ [ruby-core:40945] [Bug #5620]
+
+Fri Mar 16 12:00:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (argument_error): use line number at the beginning
+ of lambda, not the first code of its body.
+ [ruby-core:43314][Bug #6151]
+
+ * iseq.c (rb_iseq_first_lineno): constified.
+
+Fri Mar 16 11:20:07 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_take): don't enumerate an extra value.
+ [ruby-dev:45370] [Bug #6152]
+
+Fri Mar 16 06:30:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (lazy_zip_func): variadic argument needs explicit cast
+ on the platforms where VALUE is longer than int.
+
+ * enumerator.c (lazy_init_iterator): no need to check overflow twice.
+
+Fri Mar 16 05:47:09 2012 Eric Hodel <drbrain@segment7.net>
+
+ * enumerator.c (lazy_init_iterator): Fix type error (int vs long).
+
+Thu Mar 15 23:13:36 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enum.c (rb_enum_values_pack): rename from enum_values_pack, and
+ remove static.
+
+ * enumerator.c (lazy_init_iterator, lazy_init_yielder,
+ lazy_select_func, lazy_reject_func, lazy_grep_func): handle
+ multiple values correctly.
+
+ * enumerator.c (lazy_grep): change the behavior when a block is
+ given, to be consistent with Enumerable#grep.
+
+Thu Mar 15 19:12:31 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_zip): rescue StopIteration returned by
+ Enumerator#next.
+
+Thu Mar 15 18:19:53 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_zip, lazy_cycle): Enumerator::Lazy#{zip,cycle}
+ should be eager when a block is given, to be consistent with
+ Enumerable#{zip,cycle}.
+
+Thu Mar 15 17:45:27 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy to
+ Enumerator::Lazy.
+
+Thu Mar 15 16:37:38 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (enumerable_lazy): added cycle to the documentation.
+
+Thu Mar 15 15:37:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): fix warning line number.
+
+Thu Mar 15 15:19:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (lazy_cycle): check argument number overflow before
+ creating temporary array.
+
+Thu Mar 15 15:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_strtod): no need to check same digit for hexdigit
+ twice. [ruby-dev:45363][Bug #6146]
+
+ * parse.y (sym_check_asciionly): check ascii compatibility before
+ scanning for code range.
+
+ * parse.y (intern_str): set to us-ascii if ascii only.
+ [ruby-dev:45363][Bug #6146]
+
+ * file.c (ruby_enc_find_basename): allow NULL as alllen.
+ [ruby-dev:45363][Bug #6146]
+
+Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_conv_enc_opts): default to original encoding.
+
+Thu Mar 15 13:47:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): use rb_str_conv_enc()
+ instead of rb_str_encode() to simplify the code.
+
+Thu Mar 15 12:44:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API to
+ accept and to return UTF-8 strings.
+
+ * win32/win32.c (rb_w32_getenv): follow above change.
+
+ * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area.
+
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes.
+ [Bug #5570] [ruby-core:40737]
+
+Thu Mar 15 10:57:27 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.
+
+Thu Mar 15 10:31:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.
+
+Thu Mar 15 07:03:52 2012 Eric Hodel <drbrain@segment7.net>
+
+ * vm_eval.c (check_funcall): Raise ArgumentError if respond_to?
+ requires more than three arguments. [Bug #6000]
+
+ * test/ruby/test_object.rb (class TestObject): Test for respond_to?
+ requiring more than three arguments.
+
+Thu Mar 15 06:08:06 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
+
+ * array.c: Use rb_check_arity / rb_error_arity
+
+ * class.c: ditto
+
+ * enumerator.c: ditto
+
+ * eval.c: ditto
+
+ * file.c: ditto
+
+ * hash.c: ditto
+
+ * numeric.c: ditto
+
+ * proc.c: ditto
+
+ * process.c: ditto
+
+ * random.c: ditto
+
+ * re.c: ditto
+
+ * signal.c: ditto
+
+ * string.c: ditto
+
+ * struct.c: ditto
+
+ * transcode.c: ditto
+
+ * vm_eval.c: ditto
+
+ * vm_insnhelper.c: ditto & implementation of rb_error_arity
+
+ * test/ruby/test_arity.rb: tests for above
+
+Thu Mar 15 06:08:05 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * vm_insnhelper.c: improve number of arguments error in case of
+ optional parameters (issue #6085)
+
+ * include/ruby/intern.h: define UNLIMITED_ARGUMENTS
+
+ * test/ruby/test_arity.rb: test for above
+
+Thu Mar 15 00:58:04 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (enumerable_lazy): fix the documentation of
+ Enumerable#lazy.
+
+Wed Mar 14 22:01:06 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_init_iterator): break when Qundef is returned
+ to make obj.drop(3).take(2) work properly.
+
+ * enumerator.c (lazy_take_while): add Enumerable::Lazy#take_while.
+
+ * enumerator.c (lazy_drop): add Enumerable::Lazy#drop.
+
+ * enumerator.c (lazy_drop_while): add Enumerable::Lazy#drop_while.
+
+ * enumerator.c (InitVM_Enumerator): add Enumerable::Lazy#force as an
+ alias of to_a.
+
+Wed Mar 14 19:28:40 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_take): add Enumerable::Lazy#take.
+
+Wed Mar 14 18:40:36 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c: use long for array indices.
+
+Wed Mar 14 18:25:18 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c: moved the comment of StopIteration.
+
+Wed Mar 14 17:55:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * numeric.c (flodivmod): must go through the same pass if HAVE_FMOD or
+ not. this is a bugfix of r35013.
+
+Wed Mar 14 16:41:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
+
+Wed Mar 14 15:09:23 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c: fix flodivmod for cornercases [Bug #6044]
+ add ruby_float_mod
+
+ * insns.def (opt_mod): use ruby_float_mod
+
+ * internal.h: declare ruby_float_mod
+
+ * test/ruby/test_float.rb: tests for above
+
+ * test/ruby/envutil.rb: create helper assert_is_minus_zero
+
+Wed Mar 14 10:44:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (lazy_grep_func): should use === instead of =~, as
+ well as Enumerable#grep
+
+Wed Mar 14 08:15:54 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_flat_map_func): use each for non-Array objects.
+
+Wed Mar 14 08:06:35 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_zip): add Enumerable::Lazy#zip.
+
+ * enumerator.c (lazy_lazy): just returns self.
+
+Wed Mar 14 07:48:36 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (datetime_s_now): [ruby-core:43256].
+
+Tue Mar 13 22:00:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_set_arguments): keyword rest arg without keyword args.
+
+ * node.c (dump_node): dump kw_rest_arg too.
+
+ * parse.y (block_param, f_arg): more kwrest patterns.
+ [ruby-core:42455][Bug #5989]
+
+ * parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.
+
+Tue Mar 13 15:17:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (block_param, f_args): add rules for the case arguments
+ begin with kwrest. [ruby-core:42455][Bug #5989]
+
+Tue Mar 13 12:37:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_encoding_set): always warn if external encoding and internal
+ encoding are identical. [ruby-core:40727] [Bug #5568]
+
+Tue Mar 13 12:37:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c: add ObjectSpace::WeakMap. [ruby-dev:44565][Bug #5350]
+
+ * lib/weakref.rb: use WeakMap instead of _id2ref.
+
+Tue Mar 13 10:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (prepare): skip if basedir is not defined.
+ [ruby-core:39135][Bug #5238]
+
+ * tool/rbinstall.rb (CONFIG.[]): check for mandatory
+ configurations.
+
+Tue Mar 13 00:09:18 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (enumerable_lazy): added documentation.
+
+Mon Mar 12 20:19:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/tmpdir.rb (Dir::tmpdir): test the current directory suitable for
+ temporary directory.
+
+Mon Mar 12 20:08:16 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/fileutils.rb (fu_have_symlink?): specify TypeError for rescue
+ clause.
+
+Mon Mar 12 19:23:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_find_encoding): new function find encoding from
+ arbitrary object as a pointer to rb_encoding, and return NULL if
+ not found.
+
+ * io.c (io_encoding_set): just warn unsupported encodings, but not
+ exception. [ruby-core:40726] [Bug #5567]
+
+Mon Mar 12 19:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (Init_eval_method): respond_to? and
+ respond_to_missing? are public.
+
+Mon Mar 12 14:56:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
+ has been already obsolete. patch by Thomas Enebo.
+ [ruby-core:41929][Bug #5847]
+
+Mon Mar 12 12:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (Init_eval_method): copy basic methods to Exception.
+ [ruby-core:40287][Bug #5473]
+
+Mon Mar 12 10:13:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_jump.c (rb_exec_end_proc): remember the latest exit status.
+ [ruby-core:43173][Bug #5218]
+
+Mon Mar 12 07:33:12 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/tmpdir.rb: update document for changing
+ FileUtils.remove_entry_secure to FileUtils.remove_entry.
+
+ * NEWS: add incompatibility note for lib/tmpdir.rb.
+
+Mon Mar 12 07:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tmpdir.rb (Dir.tmpdir): should not use world-writable but
+ non-sticky directory.
+
+ * lib/tmpdir.rb (Dir.mktmpdir): check the parent directory.
+
+Mon Mar 12 07:04:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (Init_Random): removed rb_Random_DEFAULT and register as
+ mark-object instead of global variable.
+
+Mon Mar 12 07:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * random.c (random_s_rand): ensure default PRNG is re-initialized
+ after fork. patched by Eric Wong. [ruby-core:41209][Bug #5661]
+
+Sun Mar 11 23:57:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_unpack): when unpack('M') occurs an illegal byte
+ sequence, output the "=" character and the following character in
+ the decoded data without any transformation.
+ [ruby-dev:44875] [Bug #5635]
+
+Sun Mar 11 22:32:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge 164a75c8bd2007d32c4d7665d53140d8fc126dcd.
+ [ruby-core:41917] [Bug #5846]
+
+Sun Mar 11 17:10:04 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Put error message into STDERR if failed to launch
+ worker (job) process. [ruby-dev:44802] [Bug #5577]
+
+ * lib/test/unit/parallel.rb: If failed to increment_io, exit with code
+ 2. [ruby-dev:44802] [Bug #5577]
+
+Sun Mar 11 15:46:45 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * io.c: fix rdoc of `IO.binwrite` to show same as `IO.write` except
+ it opens file with mode "wb:ASCII-8BIT". [Bug #5782] [ruby-core:42592]
+
+Sat Mar 10 23:52:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c: pack tables also generic keys. patched by Sokolov Yura at
+ https://github.com/ruby/ruby/pull/84
+
+ * st.c: add st_foreach_check for fixing iteration over packed table
+ and st_delete_safe. patched by Sokolov Yura at
+ https://github.com/ruby/ruby/pull/84
+
+ * st.c: fix packed num_entries on delete_safe. patched by Sokolov
+ Yura at https://github.com/ruby/ruby/pull/84
+
+Fri Mar 9 14:29:32 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_flat_map): add Enumerable::Lazy#flat_map.
+
+Fri Mar 9 06:29:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
+ the first document has been parsed.
+
+ * test/psych/test_stream.rb: pertinent tests.
+
+Fri Mar 9 06:17:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb (parse_stream, load_stream): if a block is
+ given, documents will be yielded to the block as they are parsed.
+ [ruby-core:42404] [Bug #5978]
+
+ * ext/psych/lib/psych/handlers/document_stream.rb: add a handler that
+ yields documents as they are parsed
+
+ * test/psych/test_stream.rb: corresponding tests.
+
+Fri Mar 9 00:35:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (lazy_initialize, enumerable_lazy): no additional
+ arguments.
+
+Fri Mar 9 00:30:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c: add Enumerable#lazy. based on the patch by
+ Innokenty Mikhailov at <https://github.com/ruby/ruby/pull/101>
+ [ruby-core:37164] [Feature #4890]
+
+Fri Mar 9 00:25:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enumerator.c (enumerator_each, generator_each): pass arguments to
+ the block with yielder.
+
+Fri Mar 9 00:25:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_cat): new function to concat objects into array.
+
+Thu Mar 8 16:44:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * .gdbinit (rb_numtable_entry): update for recent refactoring of
+ st_table.
+
+Wed Mar 7 22:41:50 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * lib/xmlrpc/client.rb (module XMLRPC): fix typo.
+
+ * test/xmlrpc/test_client.rb (test_async_call): add test for
+ XMLRPC::Client#call_async to check above fix.
+
+Wed Mar 7 16:30:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_load_fail): should honor encoding.
+
+ * load.c (load_failed): ditto.
+
+Wed Mar 7 12:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_load_fail): use path as a string, not char*.
+
+ * internal.h: (rb_load_fail): moved from ruby/intern.h.
+
+ * ruby.c (load_file_internal): fname cannot be NULL.
+
+Wed Mar 7 08:32:43 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * error.c (rb_loaderror_with_path): Adding the missing file as an
+ instance variable to the LoadError exception.
+ [ruby-core:39079]
+
+ * load.c: call rb_loaderror_with_path so that the missing path is
+ added to the exception.
+
+ * ruby.c: call rb_loaderror rather than raising our own LoadError
+ exception.
+
+ * include/ruby/intern.h: add declaration for rb_loaderror_with_path.
+
+ * test/ruby/test_require.rb: add supporting test for LoadError#path
method.
- * test/thread/test_queue.rb: add tests originally written by
- John Anderson and modify detailed behavior.
+Wed Mar 7 08:28:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Aug 26 10:52:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/parser.rb: support i8 types. Thanks Stas Kelvich!
+ [ruby-core:29246] [Feature #3090]
- * re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
- till the end of string. [ruby-core:70592] [Bug #11488]
+ * test/xmlrpc/test_client.rb: supporting test
- * test/ruby/test_m17n.rb (test_include?, test_index): add tests by
- Tom Stuart.
+Wed Mar 7 07:43:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Aug 26 09:26:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/client.rb: assume servers that do not send a Content-Type
+ header are sending 'text/xml'. Thanks Nathan Leavitt!
+ [ruby-core:41204] [Bug #5660]
- * id_table.c (list_table_extend, hash_table_extend): remove C99
- features. [ruby-dev:49239] [Bug #11487]
+ * test/xmlrpc/test_client.rb: supporting test
-Tue Aug 25 06:34:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 7 07:39:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/win32.c (w32_symlink): implement symlink().
+ * test/xmlrpc/test_client.rb: adding a test for performing an XMLRPC
+ call.
+ * test/xmlrpc/data/blog.xml: supporting XML document for the response.
-Mon Aug 24 16:01:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 6 16:24:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (rb_locale_encindex): find encoding index without
- making a string object every time. [ruby-core:58160] [Bug #9080]
+ * parse.y (parser_tokadd_string): escape simple regexp meta
+ character terminators.
-Sat Aug 22 15:43:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 6 10:11:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_eval.c (check_funcall_failed, check_funcall_missing): cache
- results of respond_to? and respond_to_missing?, and search a
- public method only for compatibility with rb_respond_to.
+ * ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
+ bits too.
-Sat Aug 22 08:23:32 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
+ [ruby-dev:45309] [Bug #6116]
- * ext/thread/thread.c: move definitions of Queue, SizedQueue
- and ConditionalVariables to thread_tools.c. In other words,
- such classes are built-in.
- [Feature #8919]
+ * ext/io/console/console.c (console_raw): fix rdoc.
- At first, I planned to embed only a Queue class.
- However, rubygems requires 'thread.rb' (rubygems are
- required at first, when launch MRI without --disable-gems).
- So most of people require 'thread.rb' as an embedded library.
+ * ext/io/console/console.c (console_set_echo): mentioned about
+ platform dependency.
- Now, ext/thread/thread.c is empty, only for a dummy for
- compatibility.
+Tue Mar 6 07:18:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * thread.c: move a definition of Mutex class to thread_tools.c.
+ * lib/xmlrpc/client.rb: switch net/http post2 calls to modern
+ `request_post` methods.
- And define Mutex class under Thread (so now Mutex is Thread::Mutex).
- Because other thread related classes are also defined under Thread.
- We remain ::Mutex as Thread::Mutex. Only an inspect result is changed.
+Tue Mar 6 02:31:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * common.mk: add dependency from thread.o to thread_tools.c.
+ * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
+ in order to stop method pollution.
-Sat Aug 22 05:31:37 2015 Koichi Sasada <ko1@atdot.net>
+Tue Mar 6 01:34:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_opts.h, iseq.c, iseq.h: add compile option to force frozen
- string literals.
- [Feature #11473]
+ * parse.y (block_call): rules for block_call after block_call.
+ based on a patch by pasberth https://github.com/ruby/ruby/pull/102
+ [ruby-dev:45308][Bug #6115]
- This addition is not specification change, but to try frozen
- string literal world discussed on [Feature #11473].
+Tue Mar 6 01:24:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- You can try frozen string literal world using this magical line:
+ * parse.y (block_command, block_call): simplified rules.
- RubyVM::InstructionSequence.compile_option =
- {frozen_string_literal: true}
+Mon Mar 5 18:28:35 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- Note that this is a global compilation option, so that you need to
- compile another script like that:
+ * test/ruby/test_regexp.rb (TestRegexp#test_source): fix typo.
+ * test/ruby/test_regexp.rb (TestRegexp#test_equal): ditto.
- p 'foo'.frozen? #=> false
- RubyVM::InstructionSequence.compile_option =
- {frozen_string_literal: true}
- p 'foo'.frozen? #=> false, because this line is already compiled.
- p eval("'foo'.frozen?") #=> true
+Mon Mar 5 17:11:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Details:
- * String literals are deduped by rb_fstring().
- * Dynamic string literals ("...#{xyz}...") is now only frozen,
- not deduped. Maybe you have other ideas.
+ * ext/syck/lib/syck/rubytypes.rb (Exception.yaml_new): fix bug
+ that causes YAML serialization problem for Exception.
+ Exception#initialize doesn't use visible instance variable for
+ the exception message, so call the method with the message.
+ patched by Jingwen Owen Ou <jingweno AT gmail.com>.
+ http://github.com/ruby/ruby/pull/41
- Now, please do not use this option on your productions :)
- Of course, current specification can be changed.
+Mon Mar 5 16:50:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * compile.c: ditto.
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error.
- * test/ruby/test_iseq.rb: add a test.
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): call uname
+ only on linux because it's a workaround for linux only.
-Sat Aug 22 02:53:12 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Mon Mar 5 12:44:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/*: update to Psych 2.0.14
+ * st.c (unpack_entries): chain entries directly. based on a patch
+ by Sokolov Yura <funny.falcon AT gmail.com>.
- * test/psych/*: ditto
+ * st.c (unpack_entries): use union instead of casted pointer.
+ patched by Sokolov Yura <funny.falcon AT gmail.com>.
-Fri Aug 21 19:58:48 2015 Koichi Sasada <ko1@atdot.net>
+ * st.c: use PACKED_ENT and FIND_ENTRY. patched by Sokolov
+ Yura <funny.falcon AT gmail.com>.
- * ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.
- [Feature #11158]
+ * st.c (unpack_entries): reallocate bins if packed array size
+ is not same as initial bins size. based on a patch by
+ Sokolov Yura <funny.falcon AT gmail.com>.
- * symbol.c (rb_sym_immortal_count): added to count immortal symbols.
+Mon Mar 5 11:51:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * symbol.h: ditto.
+ * ext/bigdecimal/lib/bigdecimal/math.rb: remove description about
+ BigMath#log. patched by Sho Hashimoto [ruby-dev:45307] [Bug #6112]
- * test/objspace/test_objspace.rb: add a test for this method.
+ * string.c (str_byteslice): fix typo.
- * NEWS: describe about this method.
+Sun Mar 4 23:21:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 21 19:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (parser_tokadd_string): regexp engine doesn't need
+ terminators to be escaped. [ruby-core:40364][Bug #5484]
- * win32/Makefile.sub ($(LIBRUBY_SO)): needs additional libraries
- for extension libraries to link statically.
- [ruby-core:70499] [Feature #9018]
+Sat Mar 3 22:51:46 2012 Tanaka Akira <akr@fsij.org>
-Fri Aug 21 18:49:22 2015 Koichi Sasada <ko1@atdot.net>
+ * process.c (rb_run_exec_options_err): chdir at last to interpret
+ relative pathnames from the current directory of the parent process.
- * include/ruby/ruby.h, cont.c, vm_trace.c: add a new event
- fiber_switch. We need more discussion about this feature
- so that I don't write it on NEWS.
- [Feature #11348]
+Sat Mar 3 12:20:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_settracefunc.rb: add tests.
+ * ext/date/date_strftime.c: reassigned some variables.
-Fri Aug 21 17:32:42 2015 Koichi Sasada <ko1@atdot.net>
+Sat Mar 3 12:12:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
- stable after invoking a block. [Bug #11451]
+ * ext/date/date_{parse,strptime}.c: [ruby-dev:45303].
- * test/ruby/test_yield.rb: add a test. This test script is given by
- Alex Dowad.
+Sat Mar 3 10:09:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Aug 21 06:35:50 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * lib/xmlrpc/client.rb (initialize): net/http defaults to 1_2 in 1.8+,
+ so we can safely remove the call to enable it.
- * test/openssl/test_ssl_session.rb: Fix tests so that they take in to
- account OpenSSL installations that have SSLv3 disabled by default.
- Thanks Jeremy Evans <code@jeremyevans.net> for the patches.
- [Bug #11366] [Bug #11367]
+Sat Mar 3 08:42:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Aug 20 22:19:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/client.rb (new2): use URI for uri parsing.
+ * test/xmlrpc/test_client.rb: test that query params are passed to the
+ client constructor.
- * vm_method.c (basic_obj_respond_to): call respond_to_missing?
- only when redefined. [ruby-core:70460] [Bug #11465]
+Sat Mar 3 08:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Aug 20 14:13:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/xmlrpc/client.rb (new2): raises an ArgumentError on bad
+ arguments.
+ * test/xmlrpc/test_client.rb: tests for bad uris
- * vm_eval.c (check_funcall_respond_to): share the behavior with
- rb_obj_respond_to. [ruby-core:70460] [Bug #11465]
+Sat Mar 3 08:08:11 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_method.c (vm_respond_to): extract from rb_obj_respond_to and
- merge r39881.
+ * lib/xmlrpc/client.rb (new2): fix custom port specification when an
+ SSL uri is used.
+ * test/xmlrpc/test_client.rb: tests for XMLRPC::Client.new2
-Thu Aug 20 08:53:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Mar 3 08:03:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c (rb_obj_respond_to): reuse found method entry
- instead of searching same entry repeatedly.
+ * ext/syck/rubyext.c (mktime_do): use ISDIGIT().
+ [ruby-core:43060] [Bug #6108]
-Thu Aug 20 08:31:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char.
+ [ruby-core:43060] [Bug #6108]
- * dir.c (replace_real_basename), win32/win32.c (opendir_internal):
- check reparse point tags and treat supported tags only as
- symbolic links. [ruby-core:70454] [Bug #11462]
+Sat Mar 3 06:57:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 19 23:59:28 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * configure.in (ruby_pc): make configurable. [Bug #6051]
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to
- existing options rather than just setting it. Some vendors apply
- custom patches to their versions of OpenSSL that set default values
- for options. This commit respects the custom patches they've
- applied.
+Fri Mar 2 17:49:03 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been
- added to the options.
+ * .travis.yml (branches): Enable TravisCI for ruby_1_9_3.
-Wed Aug 19 23:55:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 2 17:13:33 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * process.c (rb_f_spawn): [DOC] elaborate environment variable
- values. [ruby-core:70456] [Bug #11463]
+ * test/ruby/test_array.rb (test_combination2): Make the test case for
+ [ruby-core:29240] more descriptive.
+ cf. http://bugs.jruby.org/6518
-Wed Aug 19 23:48:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 2 16:37:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (winnt_lstat): check reparse point tags and treat
- supported tags only as symbolic links.
- [ruby-core:70454] [Bug #11462]
+ * file.c (file_expand_path): use wcscasecmp().
-Tue Aug 18 20:05:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Mar 2 16:36:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.c (reserve_stack): ensure the memory is really
- allocated. [Bug #11457]
+ * thread_pthread.c (native_cond_timeout): cast explicitly to suppress
+ a warning.
-Tue Aug 18 17:19:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 2 16:35:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (IS_BEG): include labeled argument state, which was
- EXPR_LABELARG. [ruby-dev:49221] [Bug #11456]
+ * io.c (pipe_open): cmd is no longer used if fork is available.
-Tue Aug 18 16:16:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 1 16:13:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h (RClass): define only in C, `__attribute__`
- between `struct` and the name can't compile with g++.
- [ruby-core:70297] [Bug #11426]
+ * internal.h (rb_file_const, rb_file_load_ok): moved functions for
+ internal use only.
-Mon Aug 17 20:56:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 1 15:40:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y: fix syntax error at do-block after a conditional
- operator. separate label-allowed and after-a-label states from
- others as bit flags. [ruby-dev:48790] [Bug #10653]
+ * win32/makedirs.bat: new command to make intermediate
+ directories, and not to report any errors if the directory
+ already exists.
-Mon Aug 17 11:57:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/Makefile.sub (MAKEDIRS): enable command extensions.
- * io.c (rb_io_each_codepoint): raise an exception at incomplete
- character before EOF when conversion takes place. [Bug #11444]
+Thu Mar 1 01:25:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Aug 16 17:33:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * regparse.c (is_onechar_cclass): optimize character class
+ Merge Onigmo 27278c12e6674043cc8affca6507e20e119a86ee.
- * gems/bundled_gems: update latest version of bundled gems.
- It includes minitest-5.8.0 and test-unit 3.1.3.
+ * regparse.c (is_onechar_cclass): [bug] unexpected match occurs when a
+ char class contains no char
-Sun Aug 16 17:24:10 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+ * enc/unicode.c (init_case_fold_table): define the sizes of case
+ folding tables in casefold.h
- * gc.c (gc_mark_children): check if RCLASS_EXT is valid
- before marking. This fixes the following test failure
- introduced in r51126:
+Wed Feb 29 16:11:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- make test-all TESTOPTS='--gc-stress ruby/test_refinement.rb'
+ * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby.
+ [Bug #6103] [ruby-core:43012]
-Sat Aug 15 10:51:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/README.win32: added a notice about command extension of cmd.exe.
- * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
- be in bytes, not in chars. [ruby-core:70365] [Bug #11439]
+Wed Feb 29 15:39:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Aug 15 10:15:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io.rb (TestIO#test_readpartial_locktmp): skip on
+ windows because of the platform restriction.
- * io.c (rb_io_each_codepoint): read more data when read partially.
- [ruby-core:70379] [Bug #11444]
+Wed Feb 29 15:38:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Aug 15 04:33:39 2015 Eric Wong <e@80x24.org>
+ * test/ruby/memory_status.rb (Memory): syntax error.
- * hash.c (any_hash): skip rb_objid_hash for static syms
- (rb_num_hash_start): extract from rb_ident_hash
- (rb_objid_hash): call rb_num_hash_start
- (rb_ident_hash): ditto
- [ruby-core:70181] [Feature #11405]
+Wed Feb 29 13:06:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Aug 15 04:16:13 2015 Eric Wong <e@80x24.org>
+ * test/ruby/memory_status.rb: use /proc/self/status if it is in
+ the expected format.
- * iseq.c (rb_iseq_mark): reduce NULL checks
+Wed Feb 29 06:14:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Fri Aug 14 18:50:57 2015 Eric Wong <e@80x24.org>
+ * ext/date/date_core.c: reverted r34825.
- * method.h (METHOD_ENTRY_VISI_SET): cast visi to int
- (METHOD_ENTRY_FLAGS_SET): ditto
+Tue Feb 28 23:20:01 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Aug 14 18:43:11 2015 Eric Wong <e@80x24.org>
+ * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory.
+ * Makefile.in (clean-platform): add new target.
+ It cleans `win32` directory.
- * process.c (close_unless_reserved): add extra check
- (dup2_with_divert): remove
- (redirect_dup2): use dup2 without divert
- (before_exec_non_async_signal_safe): adjust call + comment
- (rb_f_exec): stop timer thread for all OSes
- (rb_exec_without_timer_thread): remove
- * eval.c (ruby_cleanup): adjust call
- * thread.c (rb_thread_stop_timer_thread): always close pipes
- * thread_pthread.c (struct timer_thread_pipe): add writing field,
- mark owner_process volatile for signal handlers
- (rb_thread_wakeup_timer_thread_fd): check valid FD
- (rb_thread_wakeup_timer_thread): set writing flag to prevent close
- (rb_thread_wakeup_timer_thread_low): ditto
- (CLOSE_INVALIDATE): new macro
- (close_invalidate): new function
- (close_communication_pipe): removed
- (setup_communication_pipe_internal): make errors non-fatal
- (setup_communication_pipe): ditto
- (thread_timer): close reading ends inside timer thread
- (rb_thread_create_timer_thread): make errors non-fatal
- (native_stop_timer_thread): close write ends only, always,
- wait for signal handlers to finish
- (rb_divert_reserved_fd): remove
- * thread_win32.c (native_stop_timer_thread): adjust (untested)
- (rb_divert_reserved_fd): remove
- * vm_core.h: adjust prototype
- [ruby-core:70386] [Bug #11336]
+ * common.mk (clean): add a dependency for `win32` directory.
+ * common.mk (distclean): ditto.
+ * common.mk (distclean-platform): add new target.
+ It cleans `win32` directory.
+ * common.mk ($(PLATFORM_D)): add new target to make `win32` directory.
+ * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32`
+ directory.
+ * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c.
-Fri Aug 14 18:40:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: move win32.o into `win32` directory and add
+ win32/file.o to MISSING.
- * ext/win32/lib/win32/registry.rb (API#SetValue): add terminator
- size, not 1 byte. [ruby-core:70365] [Bug #11439]
+ * file.c (file_load_ok, rb_file_load_ok): replace static
+ file_load_ok() with public rb_file_load_ok().
+ It's to link Windows implementation in win32/file.c.
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
-Thu Aug 13 22:49:42 2015 Juanito Fatas <katehuang0320@gmail.com>
+ * win32/file.c (rb_file_load_ok): new file. Add Windows specific
+ optimized implementation of rb_file_load_ok(). We created a
+ separated file to avoid too many #ifdef macro which is unreadable.
- * lib/timeout.rb (Timeout#timeout): freeze a string message to
- reduce string allocations. [Fix GH-996]
+ * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32`
+ directory.
+ * win32/Makefile.sub (MISSING): move win32.obj into `win32`
+ directory and add win32/file.obj to MISSING.
+ * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY.
+ It's because miniruby doesn't exist when making `win32` directory.
+ * win32/Makefile.sub (clean-platform): add new target to clean `win32`
+ directory.
+ * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match
+ win32/file.c to build properly.
+ * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into
+ `win32` directory.
-Thu Aug 13 17:42:34 2015 Koichi Sasada <ko1@atdot.net>
+ Patch created with Luis Lavena.
+ [ruby-core:42480] [Feature #5999]
- * vm_core.h (rb_call_info_kw_arg_bytes): move the definition
- to iseq.h because this function is shared with iseq.c and compile.c.
+Tue Feb 28 20:27:25 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Aug 13 14:36:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_core.c: [ruby-core:42998]
- * object.c (rb_num_to_dbl): move from num2dbl_with_to_f in math.c.
+Tue Feb 28 18:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 13 09:01:25 2015 Eric Wong <e@80x24.org>
+ * io.c (io_binwrite, rb_io_syswrite): use shared frozen source
+ strings.
- * load.c (features_index_add): avoid repeat calculation
+ * io.c (io_fread, io_getpartial, rb_io_sysread): set buffer size
+ after check if readable, which can cause thread switch.
+ [ruby-dev:45297][Bug #6099]
-Wed Aug 12 21:57:31 2015 Koichi Sasada <ko1@atdot.net>
+Tue Feb 28 17:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * id_table.c: IMPL() macro accept op as _opname instead of opname
- because jemalloc seems to replace the word `free' to `je_free'.
+ * lib/time.rb (Time#xmlschema): use strftime specifiers instead of
+ fractional exponential calculation which yields undesirable
+ result. [ruby-core:42997][Bug #6100]
-Wed Aug 12 21:51:11 2015 Koichi Sasada <ko1@atdot.net>
+Tue Feb 28 14:15:29 2012 Eric Hodel <drbrain@segment7.net>
- * id_table.c (mix_id_table_insert): fix memory leak.
+ * lib/net/protocol.rb: Add OpenTimeout subclass of Timeout::Error
+ * lib/net/pop.rb: Modernize Timeout usage. Patch by Eric Wong.
+ Use Net::OpenTimeout instead of Timeout::Error. [Bug #5765]
+ * lib/net/http.rb: ditto
+ * lib/net/smtp.rb: ditto
+ * lib/net/telnet.rb: ditto
-Wed Aug 12 21:17:38 2015 Eric Wong <e@80x24.org>
+Tue Feb 28 13:51:12 2012 Eric Hodel <drbrain@segment7.net>
- * iseq.c (iseq_memsize): reimplement for wrapper
- (param_keyword_size): extracted from iseq_memsize
- (iseqw_mark): new mark function
- (iseqw_data_type): new data type
- (iseqw_new): wrap as iseqw_data_type
- (iseqw_check): adjust for wrapper
- (Init_ISeq): remove iseqw_iseq_key initialization
- * test/objspace/test_objspace.rb: new test
- [ruby-core:70344] [Feature #11435]
+ * lib/net/http.rb: Retry HTTP requests for additional network errors.
+ Introduce OpenTimeout subclass of Timeout::Error. [Bug #6001]
+ * test/net/http/test_http.rb: Reduce timeout to 0.01s for faster test
+ * test/net/http/test_https.rb: ditto
-Wed Aug 12 21:15:27 2015 Eric Wong <e@80x24.org>
+Tue Feb 28 11:44:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h (rb_call_info_kw_arg_bytes): extract from compile.c
- * compile.c (iseq_build_callinfo_from_hash): use above function
+ * configure.in (debugflags): check if -ggdb is accepted.
+ [ruby-core:42875][Bug #6080]
-Wed Aug 12 18:00:17 2015 Koichi Sasada <ko1@atdot.net>
+Tue Feb 28 10:28:51 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * class.c (move_refined_method): same as the last commit.
+ * ext/psych/lib/psych.rb: default open YAML files with utf8 external
+ encoding. [ruby-core:42967]
+ * test/psych/test_tainted.rb: ditto
-Wed Aug 12 17:57:53 2015 Koichi Sasada <ko1@atdot.net>
+Mon Feb 27 23:46:09 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
- * class.c, gc.c vm.c: use ID_TABLE_* instead of ST_*
- (such as ST_CONTINUE) for enum rb_id_table_iterator_result.
+ * parse.y (opt_bv_decl): allow newline at the end. [ruby-dev:45292]
-Wed Aug 12 17:05:36 2015 Koichi Sasada <ko1@atdot.net>
+Mon Feb 27 20:43:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * id_table.h: introduce ID key table.
- [Feature #11420]
+ * io.c (rb_io_set_pos): add rdoc about textmode.
- This table only manage ID->VALUE table to reduce overhead of st.
+ * test/ruby/test_io.rb (TestIO#test_setpos): use binmode.
- Some functions prefixed rb_id_table_* are provided.
+Mon Feb 27 17:00:15 2012 Akinori MUSHA <knu@iDaemons.org>
- * id_table.c: implement rb_id_table_*.
+ * string.c (rb_str_crypt): Update rdoc and state that this
+ function is system dependent. Reviewed by nobu, thanks to
+ @takai.
- There are several algorithms to implement it.
+Mon Feb 27 17:03:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Now, there are roughly 4 types:
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
+ can be overridden, so should not make an assumption on the type
+ of results. [ruby-core:42969][Bug #6093]
- * st
- * array
- * hash (implemented by Yura Sokolov)
- * mix of array and hash
+Mon Feb 27 10:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- The macro ID_TABLE_IMPL can choose implementation.
- You can see detailes about them at the head of id_table.c.
+ * lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the
+ target flags if the given flag is accepted.
- At the default, I choose 34 (mix of list and hash).
- This is not final decision.
- Please report your suitable parameters or
- your data structure.
+Mon Feb 27 10:53:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * symbol.c: introduce rb_id_serial_t and rb_id_to_serial()
- to represent ID by serial number.
+ * test/rubygems/test_gem_specification.rb (test_self_from_yaml_syck_default_key_bug):
+ ignore the test for too old versions.
- * internal.h: use id_table for method tables.
+Mon Feb 27 10:53:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c, gc.c, marshal.c, vm.c, vm_method.c: ditto.
+ * lib/test/unit.rb (Test::Unit::Runner#puke): skips with no
+ messages should be trivial.
-Wed Aug 12 05:19:11 2015 Eric Wong <e@80x24.org>
+Mon Feb 27 10:50:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (rb_parser_compile_cstr): remove volatile arg
- (rb_parser_compile_string): ditto
- (rb_parser_compile_file): ditto
- (rb_parser_compile_string_path): ditto
- (rb_parser_compile_file_path): ditto
- [ruby-core:70323] [Misc #11431]
+ * io.c, process.c, time.c, ext: use rb_sys_fail_str instead of
+ rb_sys_fail.
-Tue Aug 11 22:59:57 2015 Tanaka Akira <akr@fsij.org>
+Mon Feb 27 10:48:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (Init_Numeric): Fix document for Float::MIN and
- Float::EPSILON.
+ * ext/openssl/extconf.rb: suppress useless deprecation warnings
+ from OpenSSL added by Apple.
-Tue Aug 11 15:22:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 26 23:29:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/ruby.h (ALLOCV_N): check integer overflow, as well
- as ruby_xmalloc2. pointed out by Paul <pawlkt AT gmail.com>.
+ * regparse.c (add_code_range_to_buf0): wrong condition of duplicated
+ warnings.
-Tue Aug 11 14:57:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 26 11:26:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_repeated_permutation): fix buffer size, ALLOCV_N
- already multiplies element size.
+ * compile.c (iseq_compile_each): call on special object instead of
+ self. since stabby lambda is a syntax, so it should not be
+ affected by the context. [ruby-core:42349][Bug #5966]
-Tue Aug 11 12:13:20 2015 Jeremy Evans <merch-redmine@jeremyevans.net>
+ * insns.def (send): no special deal for FCALL. self should be put
+ on TOS instead.
- * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised
- in OpenSSL tests. [ruby-core:70020][Bug #11368]
+Sun Feb 26 05:35:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Aug 11 11:54:13 2015 Alexey Lipnyagov <liptonshmidt@gmail.com>
+ * error.c (report_bug): use buf and snprintf to avoid consuming stack.
+ [ruby-dev:45272] [Bug #6058]
- * string.c: Fix documentation for String#slice
- [ruby-core:70298][Bug #11427]
+Sat Feb 25 17:41:19 2012 Tanaka Akira <akr@fsij.org>
-Tue Aug 11 11:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb (headers): try ambiguous headers at last.
- * parse.y (superclass): make superclass rule optional and allow
- any contents without a terminator. [EXPERIMENTAL]
+Sat Feb 25 17:07:15 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Aug 11 10:58:42 2015 Juanito Fatas <juanitofatas@gmail.com>
+ * lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid
+ to regexping invalid string.
- * string.c: [DOC] Make #end_with? example doc symmetry
- with #start_with? [fix GH-992][ci skip]
+Sat Feb 25 16:18:24 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Aug 11 10:51:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * complex.c (nucomp_marshal_load): raise error on invalid data.
+ reported by John Firebaugh [ruby-core:42860] [Bug #6076]
- * test/ruby/test_array.rb: Add test for `Array#flatten` with level 1
- [fix GH-986] Patch @yui-knk
+Sat Feb 25 14:46:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 11 10:48:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
+ and intptr_t. [ruby-core:42460][Feature #5992]
- * enum.c: added doc for Enumerable#zip
- [fix GH-985] Patch by @yui-knk
- * test/ruby/test_enum.rb: added tests for Enumerable#zip
- [fix GH-985] Patch @yui-knk
+ * ext/fiddle/fiddle.c (Init_fiddle): ditto.
-Tue Aug 11 10:33:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.
- * vm_method.c: typo fix [fix GH-993][ci skip] Patch by @0x0dea
- * test/ruby/test_refinement.rb: ditto.
+Sat Feb 25 11:08:28 2012 Tanaka Akira <akr@fsij.org>
-Sun Aug 9 14:15:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/curses.c (Init_curses): use rb_define_const once for
+ Curses::VERSION.
- * vm.c (Init_vm_objects, rb_vm_fstring_table): use frozen_strings
- table in rb_vm_t. [ruby-core:70274] [Bug #11423]
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
-Sat Aug 8 03:59:51 2015 Zachary Scott <zzak@ruby-lang.org>
+Sat Feb 25 10:34:22 2012 Tanaka Akira <akr@fsij.org>
- * object.c: [DOC] Improve grammar for Module#===
- Patch by @SkyBirdSoar in documenting-ruby/ruby#52:
- https://github.com/documenting-ruby/ruby/pull/52
+ * ext/curses/curses.c (Init_curses): make Curses::VERSION
+ understandable without context.
-Sat Aug 8 03:39:33 2015 Zachary Scott <zzak@ruby-lang.org>
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
- * hash.c: [DOC] Improve description of symbol key syntax
- Patch by Raphael Das Gupta in documenting-ruby/ruby#51:
- https://github.com/documenting-ruby/ruby/pull/51
+Sat Feb 25 07:53:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 7 21:04:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (parser_tokadd_string): insert a backslash only if
+ quoted by single quotes. [ruby-dev:45281] [Bug #6069]
- * parse.y (parser_params): turn in_def and in_single into bit
- flags and reduce the size by 2-words.
+Sat Feb 25 07:53:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_params): remove redundant prefixes.
+ * dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
+ [Bug #6072]
- * parse.y (yylex): non-pure parser has not been supported since
- merger of ripper. change argument types from void pointers.
+Sat Feb 25 07:53:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Aug 7 17:07:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (dir_initialize): keep path in original encoding.
- * proc.c (method_super_method): uncallable method entry does not
- have the defined class, use the owner instead.
- [ruby-core:70254] [Bug #11419]
+ * error.c (syserr_initialize): prefer the encoding of message over
+ locale. [ruby-dev:45279][Bug #6071]
- * test/ruby/test_method.rb (test_super_method_unbound): add test
- by Akira Matsuda.
+Sat Feb 25 06:55:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 6 10:49:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (utime_internal): fix a variable missed to replace.
+ [ruby-core:42864] [Bug #6077]
- * node.c (rb_alloc_tmp_buffer): round up the size and check the
- range.
+Fri Feb 24 18:21:55 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * ruby_atomic.h (ATOMIC_VALUE_EXCHANGE, ATOMIC_VALUE_CAS): add
- atomic operations for VALUE.
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_encoding): Add
+ encoding testcases for GzipReader#read. read() emits
+ Encoding.default_external in contrast to read(size) emits BINARY.
+ See also: http://bugs.jruby.org/6208
-Thu Aug 6 08:15:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Fri Feb 24 17:56:39 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- SSLSocket#sysclose to Ruby.
+ * test/ruby/test_literal.rb (TestRubyLiteral#test_special_const):
+ test for https://bugs.php.net/bug.php?id=61095
- * ext/openssl/ossl_ssl.c (ossl_ssl_close): ditto
+Fri Feb 24 16:48:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 6 07:57:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str.
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move nonblock
- enable to SSLSocket#initialize and remove Nonblock module.
+ * error.c: new functions to deal exceptions with string instances.
-Thu Aug 6 07:53:47 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * dir.c, file.c, io.c: use rb_sys_fail_path.
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- OpenSSL::SSL::SSLSocket#initialize to Ruby.
+Fri Feb 24 15:49:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c: ditto
+ * configure.in (__builtin_unreachable): check for clang.
+ [ruby-core:42849]
-Thu Aug 6 02:25:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h (UNREACHABLE): fallback definition.
- * node.c (rb_alloc_tmp_buffer): use NODE_ALLOCA to mark locations
- like as builtin alloca. [ruby-core:70251] [Bug #11418]
+Fri Feb 24 13:54:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Aug 5 14:37:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/parser.c: prevent a memory leak by protecting calls to
+ handler callbacks.
+ * test/psych/test_parser.rb: test to demonstrate leak.
- * transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name
- and rb_econv_t::destination_encoding_name should refer static
- strings always or NULL. [ruby-core:70247] [Bug #11416]
+Fri Feb 24 12:07:34 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Aug 4 16:53:43 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * lib/net/http.rb: Fix documentation. Patched from Florian Mhun
+ via http://github.com/ruby/ruby/pull/96
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
- lookup to private Ruby methods. This means we can keep the default
- DH callback logic hidden from consumers. Also, since the SSLSocket
- always has a context, we can remove conditionals about that
- instance.
+Fri Feb 24 11:48:07 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby
- methods.
+ * string.c (rb_str_prepend): Fix documentation for String#prepend.
+ Patched from Franck Verrot via http://github.com/ruby/ruby/pull/98
+ and Andrew Horsman via http://github.com/ruby/ruby/pull/55
-Tue Aug 4 16:40:26 2015 Koichi Sasada <ko1@atdot.net>
+Fri Feb 24 10:08:33 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_module.rb: should not expect a method table ordering.
- [Feature #11414]
+ * lib/net/http.rb (Net::HTTP#transport_request): Fix infinite loop
+ upon EOFError or Errno::ECONNRESET where count is reset to 0.
+ * test/net/http/test_http.rb (class TestNetHTTPKeepAlive): Test for
+ above.
-Tue Aug 04 15:30:04 2015 Koichi Sasada <ko1@atdot.net>
+Fri Feb 24 09:05:40 2012 Eric Hodel <drbrain@segment7.net>
- * proc.c (rb_block_clear_env_self): clear by Qfalse instead of Qnil.
- [Bug #11409]
+ * complex.c (Init_Complex): Document Complex::I. Patch by Sylvain
+ Daubert. [Feature #5623]
- * test/ruby/test_eval.rb: add tests for this issue,
- written by @0x0dea.
- https://github.com/ruby/ruby/pull/988
+Fri Feb 24 08:52:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 4 12:12:14 2015 Eric Wong <e@80x24.org>
+ * parse.y (parser_tokadd_string, parser_yylex): insert a backslash
+ if the next character is non-ascii. [ruby-dev:45278] [Bug #6069]
- * variable.c: wrap long lines
+Fri Feb 24 08:13:20 2012 Eric Hodel <drbrain@segment7.net>
-Tue Aug 4 09:32:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/profiler.rb: Add Profiler documentation by Gonzalo Rodriguez.
+ [Bug #5816]
- * proc.c: Removing duplicate doc [fix GH-987][ci skip]
- Patch by @ronakjangir47
+Fri Feb 24 08:08:38 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Aug 4 09:21:58 2015 Richard Schneeman <richard.schneeman+foo@gmail.com>
+ * ext/psych/parser.c: set parser encoding based on the YAML input
+ rather than user configuration.
+ * test/psych/test_encoding.rb: corresponding tests.
+ * test/psych/test_parser.rb: ditto
+ * test/psych/test_tainted.rb: ditto
- * doc/contributing.rdoc: fixed wrong instructions with OS X
- [fix GH-989][ci skip] Patch by @schneems
+Fri Feb 24 08:02:52 2012 Eric Hodel <drbrain@segment7.net>
-Mon Aug 3 10:08:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (Init_Hash): Add section on how objects are used as Hash keys
+ and how to use custom classes as Hash keys.
- * re.c (rb_memsearch): should match only char boundaries in wide
- character encodings. [ruby-core:70220] [Bug #11413]
+Fri Feb 24 07:36:11 2012 Eric Hodel <drbrain@segment7.net>
-Sun Aug 2 07:01:17 2015 Eric Wong <e@80x24.org>
+ * object.c (rb_obj_eql): Improve equality documentation by adding an
+ example of equal? vs == and recommending eql? be aliased to == when
+ overridden.
- * ext/openssl/lib/openssl/buffering.rb (gets):
- avoid comparing fixnum with nil
- * test/openssl/test_pair.rb: test gets with limit when EOF is hit
- Thanks to Bar Hofesh <bar.hofesh@safe-t.com> for the bug report
- and testing.
- [ruby-core:70149] [Bug #11400]
+Fri Feb 24 07:21:15 2012 Eric Hodel <drbrain@segment7.net>
-Sat Aug 1 17:13:15 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+ * object.c (rb_obj_hash): Added note that the hash value is not
+ deterministic on Marc-Andre's suggestion. Expanded description of
+ the purpose of the hash method. [Bug #6068]
- * lib/net/http/response.rb (Net::HTTPResponse::Inflater#finish):
- fix a bug that empty gzipped response body causes Zlib::BufError.
- [ruby-core:68846] [Bug #11058]
+Thu Feb 23 23:01:21 2012 Tanaka Akira <akr@fsij.org>
- * test/net/http/test_httpresponse.rb: tests for the above.
+ * ext/dbm/extconf.rb: unused macro removed.
-Sat Aug 1 17:05:18 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+Thu Feb 23 22:26:53 2012 Tanaka Akira <akr@fsij.org>
- * lib/net/http/response.rb (Net::HTTPResponse#inflater):
- fix TypeError. An exception object might be nil.
- [ruby-core:68846] [Bug #11058]
+ * test/test_curses.rb: new file.
-Sat Aug 1 09:09:46 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Thu Feb 23 19:57:56 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): Implement
- SSLContext#options and options= using SSL_CTX_set_options and
- SSL_CTX_get_options. This reduces the number of ivars we need and
- simplifies `ossl_sslctx_setup`.
+ * ext/curses/rain.rb: trap SIGHUP, SIGINT, SIGQUIT and SIGTERM only.
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Default `options`
- to SSL_OP_ALL
+Thu Feb 23 19:56:48 2012 Tanaka Akira <akr@fsij.org>
-Sat Aug 1 06:54:36 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * signal.c (sig_trap): show signal name on error.
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): OpenSSL declares these
- constants as longs, so we should follow that and use LONG2NUM.
- http://git.io/vOqxD
+Thu Feb 23 12:21:48 2012 Tanaka Akira <akr@fsij.org>
-Sat Aug 1 04:06:29 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of
+ Berkeley DB.
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): change callback
- to return the Ruby dh (or ecdh) object that the caller cares about
- instead of doing rb_iv_get / set to communicate. This means we can
- remove an rb_iv_get call, and only use the set calls for their
- intended purpose (to prevent the object from being GC'd).
+Thu Feb 23 10:00:18 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): ditto
- * ext/openssl/ossl_ssl.c (ossl_tmp_ecdh_callback): ditto
+ * io.c (rb_io_f_sync): Fix double-negative typo. [ruby-trunk - #5837]
-Sat Aug 1 03:49:31 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Thu Feb 23 09:57:21 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): Similarly to the
- tmp_ecdh_callback, the SSLSocket instance always holds a reference
- to the SSLContext object (it's always set in `initialize`). The
- SSLContext holds a reference to the tmp_dh_callback. Ask the
- context for the callback instead of storing the callback in two
- places.
+ * load.c (rb_f_require): Add note to require for scope of items in the
+ loaded file. [ruby-trunk - #5910]
-Sat Aug 1 03:43:10 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Thu Feb 23 03:58:08 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): create an array
- and use `rb_apply` to clean up calls to `rb_protect`.
+ * lib/ostruct.rb (delete_field): Bug fix so previous value is
+ returned. Patch by Nick Recobra [Bug #6063]
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
+Thu Feb 23 02:33:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Aug 1 03:27:12 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * io.c (rb_io_extract_modeenc): fail only if conflicting
+ text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): The SSL socket
- always holds a reference to the SSLContext object, which will have
- the callback object. Ask the context for the callback instead of
- storing the callback in two places.
+Wed Feb 22 23:27:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Aug 1 03:14:07 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * test/iconv/test_option.rb: enabled. [ruby-core:42802][Bug #6061]
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): convert
- `tmp_dh_callback` to Ruby, and call it when setting up an SSL
- connection. This allows us to move the "default" behavior to the
- reader method.
+Wed Feb 22 21:45:56 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c: call the tmp_dh_callback instead of
- accessing the SSLContext's internals.
+ * ext/curses/curses.c: use defined() to suppress a warning.
-Fri Jul 31 23:34:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Wed Feb 22 21:44:29 2012 Tanaka Akira <akr@fsij.org>
- * .travis.yml: update libssl before running tests.
- Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for figuring out the
- travis settings!
+ * ext/curses/extconf.rb: refactored.
-Fri Jul 31 21:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 20:42:28 2012 Tanaka Akira <akr@fsij.org>
- * load.c (rb_require_internal): use rb_load_internal0 not to raise
- a exception to be caught.
+ * ext/curses/extconf.rb: try to distinguish curses_version is a
+ function or variable.
-Thu Jul 30 13:19:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/curses.c (Init_curses): refine Curses::VERSION.
- * variable.c (rb_const_get_0): warn deprecated constant reference.
+Wed Feb 22 19:47:03 2012 Tanaka Akira <akr@fsij.org>
- * variable.c (rb_mod_deprecate_constant): mark constants to be
- warned as deprecated. [Feature #11398]
+ * ext/curses/extconf.rb: show the chosen header and library.
-Thu Jul 30 11:53:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 19:22:31 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * thread.c (rb_thread_s_handle_interrupt): make identity hash, to
- compare masking classes just by their IDs.
+ * reverted 34739 for test/date.
-Thu Jul 30 11:52:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 19:08:55 2012 Tanaka Akira <akr@fsij.org>
- * load.c (rb_load_internal0): stop separating exits at loading
- from exits from execution. TAG_FATAL is the only case that
- `errinfo` is a Fixnum, and should continue to exit by JUMP_TAG
- but not raising as an ordinary exception.
- [ruby-core:70169] [Bug #11404]
+ * ext/curses/extconf.rb: refactored.
-Thu Jul 30 10:42:27 2015 Alex Dowad <alexinbeijing@gmail.com>
+Wed Feb 22 18:44:41 2012 Shota Fukumori <sorah@tubusu.net>
- * load.c (rb_load_internal0): extra check before returning
- TAG_RAISE when a non-local transfer of control happens while
- loading and parsing a Ruby source file.
- [ruby-core:70169] [Bug #11404]
+ * lib/test/unit.rb (setup_options): add option "--retry" as opposite
+ for "--no-retry"
-Thu Jul 30 08:48:42 2015 Eric Wong <e@80x24.org>
+Wed Feb 22 18:34:02 2012 Shota Fukumori <sorah@tubusu.net>
- * st.c (find_entry): constify st_table*
- (find_packed_index_from): ditto
- (find_packed_index): ditto
- (get_keys): ditto
- (get_values): ditto
+ * lib/test/unit.rb (setup_options): add option "--show-skip" to
+ cancel "--hide-skip" (-q)
-Thu Jul 30 04:29:25 2015 Eric Wong <e@80x24.org>
+Wed Feb 22 17:36:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/bm_hash_aref_dsym.rb: new benchmark
- * benchmark/bm_hash_aref_dsym_long.rb: ditto
- * benchmark/bm_hash_aref_fix.rb: ditto
+ * io.c (rb_io_s_foreach): argument check before making Enumerator.
+ [ruby-dev:31525]
-Wed Jul 29 21:38:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 17:07:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (any_hash), symbol.c (dsymbol_alloc): fix dynamic symbol
- hash value by restricting in Fixnum range, that is `long`.
+ * io.c (rb_io_s_foreach): return enumerator including keyword
+ arguments. [ruby-dev:45267][Bug #6054]
-Wed Jul 29 17:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 12:15:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (rb_obj_hash): move in order to share with rb_any_hash.
+ * configure.in: allow llvm-gcc because it work fine with r34278.
-Wed Jul 29 16:00:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 10:57:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (str_buf_cat): consider empty non-embed string case,
- not to loop infinitely. [ruby-core:70074] [Bug #11383]
+ * regparse.c (fetch_token): don't use // comment.
-Wed Jul 29 15:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 10:32:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_eval.c (send_internal): set method_missing_reason before
- invoking overriding method_missing method so that the default
- method_missing can achieve it properly.
- [ruby-core:68515] [Bug #10969]
+ * test/mkmf/test_framework.rb: try CoreFoundation framework, than
+ Cocoa which is dependent on QuickTime SDK which has separated
+ since Xcode 4.3.
-Wed Jul 29 14:54:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 22 10:18:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_sym_hash): return same value as rb_any_hash() of
- Symbol. [Bug #9381]
+ * common.mk (test-all, test-ruby): more dependencies.
- * hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
- Fixnum, but not a long. [Bug #9381]
+Wed Feb 22 06:48:55 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 29 11:07:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_f_test): Fix formatting of Kernel#test rdoc.
- * internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.
+Wed Feb 22 06:12:15 2012 Tanaka Akira <akr@fsij.org>
-Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com>
+ * ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
+ Its ndbm.h doesn't include db.h.
- * gc.c: document argument passed to finalizer proc.
- [fix GH-976][ci skip] Patch by @alexdowad
+Wed Feb 22 06:02:42 2012 Tanaka Akira <akr@fsij.org>
-Wed Jul 29 10:36:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.
- * io.c (rb_io_extract_modeenc): add option parameter `flags'
- to append extra oflags to normal mode.
- [Feature #11253] [ruby-core:69539]
+ * ext/dbm/extconf.rb: check DBC type for above.
-Wed Jul 29 04:54:47 2015 Eric Wong <e@80x24.org>
+ [ruby-dev:45269]
- * test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
- [ruby-core:70151] [Bug #11397]
+Tue Feb 21 20:23:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 28 10:32:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_any_hash): treat Qundef like as other special constants.
- * internal.h (struct RClass): moved from ruby/ruby.h to hide the
- internals.
+ * hash.c (hash_foreach_iter): fix signature.
-Tue Jul 28 08:48:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 21 19:39:34 2012 Tanaka Akira <akr@fsij.org>
- * configure.in (RUBY_TYPE_ATTRIBUTE): attribute declaration for
- types.
+ * ext/curses/curses.c (Init_curses): use curses_version() for
+ Curses::VERSION.
-Tue Jul 28 07:23:03 2015 Eric Wong <e@80x24.org>
+Tue Feb 21 18:21:25 2012 Narihiro Nakamura <authornari@gmail.com>
- * symbol.h (struct RSymbol): add hashval field
- * symbol.c (dsymbol_alloc): setup hashval field once
- * hash.c (rb_any_hash): return RSymbol->hashval directly
- * common.mk: hash.o depends on symbol.h
- Thanks to Bruno Escherl <bruno@escherl.net> for the bug report
- [ruby-core:70129] [Bug #11396]
+ * gc.c : remove gc_clear_mark_on_sweep_slots() and use
+ rest_sweep() instead of it, because some dead objects might be
+ marked in next the mark phase by false pointers.
+ [ruby-core:42672]
-Tue Jul 28 03:26:15 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Tue Feb 21 16:08:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): raise a more
- helpful exception when verifying the peer connection and an
- anonymous cipher has been selected. [ruby-core:68330] [Bug #10910]
- Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for the patch.
+ * proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]
- * test/openssl/test_ssl.rb (class OpenSSL): test for change
+Tue Feb 21 14:41:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 27 13:24:11 2015 Koichi Sasada <ko1@atdot.net>
+ * template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir
+ and {ruby,vendor,site}archdir. [ruby-core:42766][Feature #6052]
- * template/id.h.tmpl (ID2ATTRSET): remove an unused macro.
+Tue Feb 21 09:13:25 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Jul 27 12:21:15 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * proc.c (method_hash, proc_hash): Fix {Unbound}Method#hash
+ [Bug #6048]. Isolate hash computation for proc
- * test/openssl/test_ssl.rb: run tests on non-Unix platforms.
+ * internal.h: Declaration for above
-Sun Jul 26 19:21:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (rb_method_definition_hash): Computation for
+ hash part of a method definition
- * ext/openssl/ossl_ssl.c (ossl_ssl_alpn_protocol): fix condition
- to compile, needs ALPN to be available. [Feature #9390]
+ * method.h: Declaration for above
-Sun Jul 26 11:29:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_method.rb: Test for above
- * signal.c (default_handler, Init_signal): discard SIGSYS, ENOSYS
- should raise a SystemCallError always instead.
+Tue Feb 21 02:56:15 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sun Jul 26 10:26:35 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * enumerator.c (enumerator_rewind): update the documentation.
+ fixed: #6053
- * ext/openssl/ossl_ssl.c (ossl_call_servername_cb): set the ssl context
- object returned by the servername callback on to the socket as an
- instance variable. If the callback allocated a new context object
- and didn't keep a reference to it, it could be GC'd out from under
- the socket object.
+Mon Feb 20 23:38:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/openssl/test_ssl.rb (class OpenSSL): test for change.
+ * enc/depend: ignore mktable.c because it's not encoding library.
+ [ruby-core:42760] [Bug #6049]
-Sun Jul 26 10:07:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Mon Feb 20 21:40:53 2012 Tanaka Akira <akr@fsij.org>
- * test/openssl/test_ssl.rb (class OpenSSL): add test coverage around
- OpenSSL::SSL::SSLContext#servername_cb
+ * ext/curses/extconf.rb: fold too long lines.
-Sun Jul 26 09:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Feb 20 21:16:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * gems/bundled_gems: update latest version of bundled power_assert.
+ * lib/fileutils.rb: revert a line modified accidentally at r34669.
+ This fixes mingw test errors in TestDir_M17N.
+ [ruby-core:42728] [Feature #4970]
-Sun Jul 26 08:49:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Feb 20 21:09:27 2012 Tanaka Akira <akr@fsij.org>
- * test/rubygems/test_gem_remote_fetcher.rb: backport rubygems upstream
- change for OpenSSL key length. see detail to
- https://github.com/rubygems/rubygems/pull/1290
+ * ext/curses/curses.c (Init_curses): define Curses::VERSION.
-Sun Jul 26 08:33:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Mon Feb 20 21:08:00 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/pkey.rb: implement DEFAULT_512 and
- DEFAULT_1024 constants in Ruby.
+ * ext/curses/extconf.rb: restore $libs and $defs for each
+ header/library choice.
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Ask PKey for the
- default DH callback since it already must check whether openssl has
- been compiled with DH support.
+Mon Feb 20 19:57:26 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey_dh.c (OSSL_PKEY_BN): Remove C definitions of
- DEFAULT_512 and DEFAULT_1024
+ * ext/dbm/extconf.rb: weaken header/library consistency check if db is
+ "ndbm". It seems several (possibly historical) distributions
+ provide libndbm. However the content of libndbm vary: Berkeley DB,
+ GDBM or even 4.3BSD NDBM. (Mandriva, Tru64 UNIX, OpenSuSE,
+ SCO OpenServer, ...)
+ "ndbm" is not searched automatically now (dblib doesn't contain it)
+ but configure --with-dbm-type=ndbm choose libndbm and ndbm.h.
- * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
+Mon Feb 20 19:15:57 2012 Tanaka Akira <akr@fsij.org>
- * test/openssl/test_pkey_dh.rb (class OpenSSL): add test to ensure the
- Ruby definitions are the same as the C definitions were.
+ * ext/dbm/extconf.rb: refine variable names.
-Sun Jul 26 08:14:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Mon Feb 20 15:50:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): support
- specifically setting the tmp_dh_callback to nil.
+ * configure.in: check if -fstack-protector is really available.
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
+Sun Feb 19 23:43:38 2012 Tanaka Akira <akr@fsij.org>
- * test/openssl/test_pair.rb (module OpenSSL): add a test
+ * ext/dbm/extconf.rb: show header and library found.
-Sun Jul 26 07:47:14 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Sun Feb 19 23:01:01 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move the default
- tmp_dh_callback Ruby code and set it as a default in `initialize`.
+ * ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.
- * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_512_GEN):
- move this constant to Ruby.
+ * ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro.
- * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_1024_GEN):
- ditto
+Sun Feb 19 17:07:27 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check pag and dir is
+ empty for 4.3BSD ndbm.
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
+Sun Feb 19 03:00:30 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): tmp_dh_callback should
- always be set, so we can remove this conditional
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check magic numbers.
-Sun Jul 26 06:22:24 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Sun Feb 19 01:05:41 2012 Tanaka Akira <akr@fsij.org>
- * test/openssl/test_pair.rb: add a test ensuring that the default DH
- callback is used when no DH callback is specified.
+ * ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr is
+ an empty macro.
-Sun Jul 26 04:08:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Sun Feb 19 00:25:55 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add missing
- instance variables to squash warnings with alpn.
+ * ext/dbm/extconf.rb: don't choose 'dbm' if _GDB_H_ is defined which
+ is available since GDBM 1.9 because 'gdbm_compat' is appropriate
+ choice since GDBM 1.8.1.
-Sun Jul 26 03:42:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Sat Feb 18 23:27:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- OpenSSL::SSL::SSLContext#initialize implementation to pure Ruby.
+ * random.c: remove a duplicated comment.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): ditto
+Sat Feb 18 18:43:13 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
+ * ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.
+ (have_declared_libvar): new function to check a declared variable
+ exists in a library.
+ (have_undeclared_libvar): renamed from renamed from have_libvar.
+ (headers.db_check2): check that GDBM version variable if GDBM header
+ is chosen.
-Sat Jul 25 21:03:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and
+ HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro.
- * random.c (fill_random_bytes_syscall): get rid of blocking when
- no entropy is available. based on the patch by mame in
- [ruby-core:70114]. [Bug #11395]
+Sat Feb 18 13:53:01 2012 Tanaka Akira <akr@fsij.org>
-Sat Jul 25 11:05:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): DBM::VERSION should
+ be Berkeley DB if foo.db is created by DBM.open.
- * string.c (str_replace_shared_without_enc): fill the terminator
- of embedded strings in wide char encodings.
+Sat Feb 18 13:40:37 2012 Tanaka Akira <akr@fsij.org>
-Sat Jul 25 06:38:36 2015 Koichi Sasada <ko1@atdot.net>
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): test dbm file suffix.
- * vm_core.h: size should be unsigned.
- * rb_call_info_t::index
- * rb_iseq_constant_body::stack_max
- * rb_iseq_constant_body::local_size
- * rb_iseq_constant_body::param::size
- * rb_iseq_constant_body::local_table_size
- * rb_iseq_constant_body::is_size
- * rb_iseq_constant_body::callinfo_size
+Sat Feb 18 12:50:59 2012 Tanaka Akira <akr@fsij.org>
- * iseq.h: same for iseq_catch_table::size.
+ * ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ or
+ _DBM_IOERR.
- * compile.c: catch up these fix.
+Sat Feb 18 07:52:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * iseq.c: ditto.
+ * tool/enc-unicode.rb: don't use 1.9 feature on tools.
- * proc.c: ditto.
+Sat Feb 18 02:48:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm.c: ditto.
+ * lib/fileutils.rb: refactored FileUtil methods to use the
+ `define_command` API. Patch from 7rans <transfire@gmail.com>
+ * test/fileutils/test_dryrun.rb: corresponding test refactoring
+ * test/fileutils/test_nowrite.rb: ditto
+ * test/fileutils/test_verbose.rb: ditto
- * vm_args.c: ditto.
+Fri Feb 17 21:39:36 2012 Tanaka Akira <akr@fsij.org>
- * vm_eval.c: ditto.
+ * ext/dbm/extconf.rb: remove dbm.
- * vm_insnhelper.c: ditto.
+Fri Feb 17 21:18:39 2012 Tanaka Akira <akr@fsij.org>
-Sat Jul 25 06:00:09 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/dbm/extconf.rb: refine header/library mismatch detection.
+ check only for ndbm.h except libc. check _GDBM_H_ for gdbm.
+ check _DBM_IOERR for the original ndbm.
- * vm_core.h: constify rb_iseq_constant_body::line_info_table.
+Fri Feb 17 20:30:44 2012 Tanaka Akira <akr@fsij.org>
- * iseq.c: catch up this fix.
+ * ext/dbm/extconf.rb: don't check libdbm. It is not a ndbm
+ implementation. (libdbm in Version 7 Unix is database library
+ for single database per process.)
-Sat Jul 25 05:56:43 2015 Koichi Sasada <ko1@atdot.net>
+Fri Feb 17 15:38:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h: constify rb_iseq_constant_body::param::opt_table and
- rb_iseq_constant_body::param::keyword.
+ * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]
+ https://github.com/k-takata/Onigmo
+ cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h
+ cp oniguruma.h
+ cp tool/enc-unicode.rb
+ cp -r enc/
- * compile.c: catch up this fix.
+Fri Feb 17 15:20:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jul 25 04:47:01 2015 Koichi Sasada <ko1@atdot.net>
+ * enum.c (enum_each_slice): arrays to be yielded can be newly
+ created in the block.
- * vm_core.h: constify rb_iseq_constant_body::catch_table.
+ * enum.c: move work variables to objects not to let called blocks
+ access stack area out of scope. [Bug #5801]
- * compile.c (iseq_set_exception_table): catch up this fix.
+Fri Feb 17 12:35:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * iseq.c: ditto.
+ * tool/merger.rb: remove borders from the commit message which is used
+ when the commit doesn't change ChangeLog.
- * vm.c (vm_exec): ditto.
+Fri Feb 17 11:50:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 24 21:29:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (btest, btest-ruby, test-sample test-knownbugs)
+ (test-all, test-ruby): depend on prog.
- * st.c (EQUAL, st_delete_safe): fix arguments order to compare
- function, searching key is the first and stored key is the
- second always.
+Fri Feb 17 09:56:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 24 21:27:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (create_header): log the content of header.
- * string.c (fstr_update_callback): fstring must not be a shared
- string, or the content without RSTRING_FSTR may be freed.
- [ruby-dev:49188] [Bug #11386]
+Fri Feb 17 09:44:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jul 24 20:09:43 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * tool/transcode-tblgen.rb (import_ucm): don't use \h because the
+ script should work with ruby 1.8.
- * test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6): prevent to use
- IPv6 loopback interface for
- Rinda::TestRingFinger#test_make_socket_ipv6_multicast and
- Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops.
- The tests are skipped if there are no IPv6 devices other than the
- loopback device. [Bug #11394] [ruby-dev:49199]
+ * tool/enc-unicode.rb: ditto.
- * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast): ditto
- for Rinda::TestRingServer#test_make_socket_ipv6_multicast.
+Fri Feb 17 07:33:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rinda/test_rinda.rb (test_ring_server_ipv6_multicast): ditto
- for Rinda::TestRingServer#test_ring_server_ipv6_multicast.
+ * enum.c (id_lshift): use constant ID.
-Fri Jul 24 16:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 17 07:30:53 2012 Tanaka Akira <akr@fsij.org>
- * string.c (fstr_update_callback): pool bare strings only.
+ * ext/dbm/extconf.rb: refactored to split too long conditions.
- * string.c (rb_fstring): return the original string with sharing a
- fstring if it has extra attributes, not the fstring itself.
- [ruby-dev:49188] [Bug #11386]
+Fri Feb 17 00:23:25 2012 Tanaka Akira <akr@fsij.org>
-Fri Jul 24 16:35:34 2015 yui-knk <spiketeika@gmail.com>
+ * test/dbm/test_dbm.rb: fix skip condition for libgdbm 1.8.0 or prior.
+ reported by Bohuslav Kabrda.
+ [ruby-core:42685] [ruby-trunk - Bug #6036]
- * file.c (rb_file_s_extname): [DOC] add an example.
+Fri Feb 17 00:04:21 2012 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_path.rb (test_extname): add tests. [Fix GH-978]
- * path starts with dot ('.a.rb')
- * path includes dir name ('a/b/d/test.rb')
- * path includes dir name and dir name starts with dot
- ('.a/b/d/test.rb')
+ * ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
+ Berkeley DB library.
-Thu Jul 23 18:50:43 2015 Koichi Sasada <ko1@atdot.net>
+Thu Feb 16 05:41:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: constify rb_iseq_constant_body::local_table and
- rb_iseq_param_keyword::table and
- rb_iseq_param_keyword::default_values.
+ * insns.def (splatarray): make new array if flag is set.
- * compile.c: catch up this fix.
+ * compile.c (iseq_compile_each): make new array with
+ splat. [ruby-core:21901][Feature #1125]
- * iseq.c: ditto.
+Thu Feb 16 00:14:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Jul 23 17:30:43 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/abbrev.rb (Array#abbrev): add missing '"' in documentation.
- * vm_core.h: constify rb_iseq_constant_body::iseq_encoded and
- rb_control_frame_t::pc.
+Wed Feb 15 22:20:19 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * compile.c (rb_iseq_translate_threaded_code): catch up this fix.
+ * cont.c (rb_fiber_reset_root_local_storage): add a new function to
+ restore rb_thread_t::local_storage.
- * iseq.c: ditto.
+ * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to
+ prevent fibers from destroy.
- * vm_exec.c (vm_exec_core): ditto.
+ * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing
+ objspace.
-Thu Jul 23 10:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber):
+ add prototypes.
- * include/ruby/ruby.h: add raw FL macros, which assume always the
- argument object is not a special constant.
+ * vm.c (ruby_vm_destruct): reset main thread's local_storage before
+ free main thread. rb_thread_t::local_storage is replaced by fiber's
+ local storage when forked from fiber, and it should be already freed
+ when the fiber was destroyed. [ruby-core:41456] [Bug #5700]
- * internal.h (STR_EMBED_P, STR_SHARED_P): valid only for T_STRING.
+ * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork
+ from fiber.
- * string.c: deal with taint flags directly across String instances.
+Wed Feb 15 19:57:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 23 09:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/closure.c (callback): deal with unsigned integers.
+ [ruby-core:42458][Bug #5991][Bug #6022]
- * parse.y (lambda_body): pop cmdarg stack for lookahead
- token. [ruby-core:70067] [Bug #11380]
+ * ext/fiddle/conversions.c (value_to_generic, generic_to_value):
+ ditto.
-Thu Jul 23 04:03:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * ext/fiddle/closure.c (callback): same as r34506.
- * ext/openssl/ossl_ssl.c: fix tests by not setting the instance
- variable on the frozen ssl instance.
+Wed Feb 15 17:41:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jul 23 03:32:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * io.c (io_strsetbuf): call rb_str_modify to make str independent
+ before calling rb_str_set_len for r34580.
- * ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356]
+Wed Feb 15 12:30:10 2012 Eric Hodel <drbrain@segment7.net>
- * test/openssl/test_pair.rb: test for ECDH callback support
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::TEXT and note that
+ Zlib::ASCII is deprecated in zlib 1.2.3 and newer.
-Thu Jul 23 03:29:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Wed Feb 15 12:24:40 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_ssl.c: add ALPN support. [Feature #9390]
+ * ext/zlib/zlib.c: Move constant descriptions to constants. Remove
+ extra comment block at the top of Init_zlib().
- * ext/openssl/extconf.rb: detect ALPN support in OpenSSL
+Wed Feb 15 12:30:46 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * test/openssl/test_ssl.rb: test for ALPN
+ * lib/ostruct.rb: Create getters and setters after dup.
+ [Bug #6028] [rubyspecs:0380bcc]
-Wed Jul 22 23:44:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 15 10:59:52 2012 Narihiro Nakamura <authornari@gmail.com>
- * string.c (rb_str_reverse): reversed string is not a substring,
- and should not set coderange of the original string.
- [ruby-dev:49189] [Bug #11387]
+ * gc.c (HEAP_BITMAP_LIMIT): HEAP_BITMAP_LIMIT is computed on the
+ basis of HEAP_SIZE because it must covers a whole heap block.
+ [ruby-trunk - Bug #6006]
-Wed Jul 22 20:17:51 2015 Koichi Sasada <ko1@atdot.net>
+Wed Feb 15 09:27:45 2012 Eric Hodel <drbrain@segment7.net>
- * vm_core.h: modify layout of rb_iseq_constant_body.
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE
+ strategies.
+ * NEWS: Add note about the new Zlib constants.
- Move frequent accessing fields to upper part.
+Wed Feb 15 09:11:36 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 22 19:57:47 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/zlib/zlib.c: Improve documentation. [ruby-trunk - Bug #5948]
- * vm_core.h: remove unused declaration of
- iseq_compile_data_ensure_node_stack.
+Wed Feb 15 07:28:54 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 22 19:52:45 2015 Koichi Sasada <ko1@atdot.net>
+ * encoding.c (Init_Encoding): Add IO example of internal and external
+ encoding. Fixed a typo in the force_encoding example. [#5949]
- * vm_core.h: separate rb_iseq_body into rb_iseq_constant_body and
- rb_iseq_variable_body (rb_iseq_t::variable_body).
+Wed Feb 15 06:58:21 2012 Eric Hodel <drbrain@segment7.net>
- rb_iseq_variable_body can be modified after compilation.
+ * encoding.c (Init_Encoding): Add Encoding documentation.
+ [ruby-trunk - Bug #5949]
+ * encoding.c (rb_set_default_external): Fix typo in documentation.
- * compile.c: use rb_iseq_t::variable_body.
+Tue Feb 14 20:22:11 2012 Narihiro Nakamura <authornari@gmail.com>
- * iseq.c: ditto.
+ * gc.c (CEILDIV): rename to a appropriate name.
- * thread.c: ditto.
+Tue Feb 14 18:07:20 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Jul 22 17:50:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * gc.c (assign_heap_slot): SEGV happens cause on 64-bit platform
+ sometime there should be `objs-=2` instead of `objs--`.
+ [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
- * lib/matrix/eigenvalue_decomposition.rb: refine code style.
- [fix GH-959][ci skip] Patch by @bogdanvlviv
+Tue Feb 14 16:00:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 22 15:48:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * io.c (io_setstrbuf): cut down the buffer if longer.
- * test/ruby/test_range.rb: Add test case for Range#end with
- exclude_end true case. [fix GH-968] Patch by @yui-knk
+Tue Feb 14 15:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 22 09:45:31 2015 Maksim Sitnikov <sitnikovme@undev.ru>
+ * lib/test/unit/assertions.rb (build_message): skip escaped
+ question marks.
- * numeric.c (num_coerce): [DOC] fix doc for Numeric#coerce,
- missing '+'. [Fix GH-974]
+Tue Feb 14 12:10:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 22 07:24:18 2015 Koichi Sasada <ko1@atdot.net>
+ * variable.c (autoload_const_set, autoload_require): fix
+ signatures.
- * make rb_iseq_t T_IMEMO object (type is imemo_iseq).
+Tue Feb 14 05:23:40 2012 Eric Hodel <drbrain@segment7.net>
- All contents of previous rb_iseq_t is in rb_iseq_t::body.
- Remove rb_iseq_t::self because rb_iseq_t is an object.
+ * process.c (proc_wait): Change typo "SystemError" to
+ "SystemCallError". [ruby-trunk - Bug #5962]
+ * process.c (proc_wait2): ditto
- RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq.
- So RubyVM::ISeq.of(something) method returns different wrapper
- objects but they point the same T_IMEMO/iseq object.
+Tue Feb 14 05:18:24 2012 Eric Hodel <drbrain@segment7.net>
- This patch is big, but most of difference is replacement of
- iseq->xxx to iseq->body->xxx.
+ * enumerator.c: Document use of Enumerator.new for creating a lazy
+ enumeration for filtering/chaining. [ruby-trunk - Feature #707]
- (previous) rb_iseq_t::compile_data is also located to
- rb_iseq_t::compile_data.
- It was moved from rb_iseq_body::compile_data.
+Mon Feb 13 23:01:50 2012 Akinori MUSHA <knu@iDaemons.org>
- Now rb_iseq_t has empty two pointers.
- I will split rb_iseq_body data into static data and dynamic data.
+ * vm_method.c (rb_method_boundp):
+ obj.respond_to?(:a_protected_method) should return false because
+ calling a protected method may cause NoMethodError if called
+ from outside the class inheritance tree. Kernel#respond_to? is
+ mostly used to test if it is safe to call a method, so the false
+ positive should be avoided. [ruby-dev:40461] [ruby-dev:41739]
+ [ruby-dev:41837]
- * compile.c: rename some functions/macros.
- Now, we don't need to separate iseq and iseqval (only VALUE).
+Mon Feb 13 21:52:06 2012 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
+ * gc.c (HEAP_OBJ_LIMIT, HEAP_BITMAP_LIMIT): HEAP_OBJ_LIMIT used
+ `sizeof(struct heaps_slot)` while heap is currently allocated
+ with `struct heaps_header`.
+ HEAP_BITMAP_LIMIT were calculated from
+ `HEAP_OBJ_LIMIT/sizeof(uintptr_t)` - one Byte for each object,
+ not one Bit. [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
- * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
+Mon Feb 13 18:30:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: check T_IMEMO/iseq.
+ * io.c (io_setstrbuf): defer resizing buffer string until data is
+ read actually.
- * internal.h: add imemo_type::imemo_iseq.
+Mon Feb 13 10:24:39 2012 Loren Segal <lsegal@soen.ca>
- * iseq.c: define RubyVM::InstructionSequence as T_OBJECT.
- Methods are implemented by functions named iseqw_....
+ * io.c (Init_IO): use directive hack to make ARGF documentable
+ in other tools. [ruby-core:42515][Bug #6007]
- * load.c (rb_load_internal0): rb_iseq_new_top() returns
- rb_iseq_t (T_IMEMO/iesq).
+Sun Feb 12 20:43:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
+ * include/ruby/ruby.h (rb_event_hook_func_t): add argument names.
- * vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
+Sun Feb 12 16:30:23 2012 Akinori MUSHA <knu@iDaemons.org>
- * vm_core.h (struct rb_iseq_body): remove padding for
- [Bug #10037][ruby-core:63721].
+ * tool/merger.rb (#default_merge_branch): Add support for
+ Subversion 1.7 which adopted a whole new working directory
+ structure.
-Wed Jul 22 07:15:33 2015 Koichi Sasada <ko1@atdot.net>
+Sun Feb 12 15:14:41 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/objspace/objspace.c (total_i): no need to skip singleton classes.
+ * benchmark/driver.rb: suppress unused/shadowing variable warnings.
-Wed Jul 22 06:37:54 2015 Koichi Sasada <ko1@atdot.net>
+Sun Feb 12 03:14:40 2012 Eric Hodel <drbrain@segment7.net>
- * vm_core.h: constify rb_call_info_t::kw_arg,
- rb_control_frame_t::iseq and rb_control_frame_t::block_iseq.
+ * vm_eval.c (check_funcall): Call respond_to? with matching arity for
+ legacy single-argument implementations. [ruby-trunk - Bug #6000]
- * iseq.c (iseq_free): catch up this fix.
+Sat Feb 11 12:04:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c: ditto.
+ * compile.c (defined_expr): guard the whole expression.
+ [ruby-dev:45021][Bug#5786]
- * vm_dump.c: ditto.
+Sat Feb 11 08:34:42 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (rb_inflate_add_dictionary): Added
+ Zlib::Inflate#add_dictionary to allow users to pre-specify
+ for using during #inflate. [ruby-trunk - Feature #5937]
+
+Sat Feb 11 08:23:02 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered data
+ exists. Allows Zlib::Inflate#set_dictionary to work.
+ [ruby-trunk - Bug #5929]
+
+Sat Feb 11 06:00:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@atdot.net>
+ * dir.c (fnmatch): The * needs to be escaped to avoid formatting in
+ fnmatch comment.
+ patched by @dalton. https://github.com/ruby/ruby/pull/91
- * vm_core.h: constify rb_call_info_t::blockiseq and rb_block_t::iseq.
+Fri Feb 10 03:41:31 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm.c, vm_insnhelper.c: catch up this fix.
+ * ext/psych/parser.c: removed external encoding setter, allow parser
+ to be reused.
+ * ext/psych/lib/psych/parser.rb: added external encoding setter.
+ * test/psych/test_parser.rb: test parser reuse
- * iseq.c (iseq_data_to_ary): constify the first iseq parameter.
+Fri Feb 10 01:30:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (vm_make_proc_with_iseq): ditto.
+ * ext/dl/dl.h (ALIGN_OF): use offsetof().
-Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow.
- * method.h: constify rb_method_iseq_t::iseqptr.
+Fri Feb 10 00:47:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (rb_method_entry_min_max_arity): catch up this fix.
+ * test/ruby/envutil.rb (assert_no_memory_leak): new assertion to
+ check memory leak by invoking child ruby process and watch its
+ memory size.
- * vm_insnhelper.c (def_iseq_ptr): constify.
+Thu Feb 9 23:41:44 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Jul 22 03:37:39 2015 Koichi Sasada <ko1@atdot.net>
+ * test/pathname/test_pathname.rb (test_binread): add assertion to
+ check encoding.
- * gc.c (internal_object_p): Now a singleton classes appear by
- ObjectSpace.each_object. [Bug #11360]
+Thu Feb 9 16:48:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_objectspace.rb: add a test about it.
+ * ext/dl/dl.c (Init_dl): fix mangled document.
-Tue Jul 21 21:21:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 9 16:10:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c (do_select): replace switch and goto with a loop to
- suppress maybe-uninitialized warnings by gcc6.
+ * test/ruby/memory_status.rb (Memory::Win32): 64bit support.
- * thread.c (set_unblock_function, rb_wait_for_single_fd): ditto.
+Thu Feb 9 16:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jul 21 20:32:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
+ currently pack/unpack does not accept "q!" and "Q!".
- * test/ruby/test_range.rb: Add test for Range#hash
- [fix GH-969] Patch by @yui-knk
+Thu Feb 9 16:01:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jul 21 19:43:20 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/fiddle/conversions.c (value_to_generic): src is not guaranteed as
+ a Bignum if the type is LONG_LONG. it may be a Fixnum if the value
+ is small.
- * compile.c: constify the first parameter (iseq).
- * iseq_add_mark_object()
- * iseq_add_mark_object_compile_time()
+Thu Feb 9 11:32:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c, iseq.h (rb_iseq_add_mark_object): ditto.
+ * ext/dl/lib/types.rb: Win64 support.
-Tue Jul 21 16:18:48 2015 Eric Wong <e@80x24.org>
+Thu Feb 9 04:12:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/socket/test_nonblock.rb: increase buffer sizes
- to OpenBSD limits. Thanks to Jeremy Evans <code@jeremyevans.net>
- [ruby-core:70058]
+ * test/pathname/test_pathname.rb: not read but binread.
+ patched by Benoit Daloze, [ruby-core:42440] [Bug #5984]
-Tue Jul 21 16:08:53 2015 Eric Wong <e@80x24.org>
+Wed Feb 8 22:29:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * load.c (ruby_dln_librefs): make static
+ * string.c (rb_str_modify_expand): fix memory leak.
-Tue Jul 21 13:36:54 2015 yuuji.yaginuma <yuuji.yaginuma@gmail.com>
+Wed Feb 8 14:06:59 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/optparse.rb (complete): [DOC] fix typo. [Fix GH-973]
+ * ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
+ option to prevent BEAST attack. See [Bug #5353].
-Tue Jul 21 05:20:21 2015 Eric Wong <e@80x24.org>
+ In OpenSSL, OP_DONT_INSERT_EMPTY_FRAGMENTS is used to prevent
+ TLS-CBC-IV vulnerability described at
+ http://www.openssl.org/~bodo/tls-cbc.txt
+ It's known issue of TLSv1/SSLv3 but it attracts lots of attention
+ these days as BEAST attack. (CVE-2011-3389)
- * io.c (nogvl_wait_for_single_fd): new function for Linux
- (maygvl_copy_stream_wait_read): Linux-specific version
- (nogvl_copy_stream_wait_write): use nogvl_wait_for_single_fd
- [ruby-core:70051] [Feature #11377]
+ Until now ossl sets OP_ALL at SSLContext allocation and call
+ SSL_CTX_set_options at connection. SSL_CTX_set_options updates the
+ value by using |= so bits set by OP_ALL cannot be unset afterwards.
-Mon Jul 20 15:04:30 2015 Eric Wong <e@80x24.org>
+ This commit changes to call SSL_CTX_set_options only 1 time for each
+ SSLContext. It sets the specified value if SSLContext#options= are
+ called and sets OP_ALL if not.
- * parse.y (parser_initialize): avoid redundant zero-ing
+ To help users to unset bits in OP_ALL, this commit also adds several
+ constant to SSL such as
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS. These constants were
+ not exposed in Ruby because there's no way to unset bits in OP_ALL
+ before.
-Mon Jul 20 12:12:05 2015 Eric Wong <e@80x24.org>
+ Following is an example to enable 0/n split for BEAST prevention.
- * parse.y (struct parser_params): pack: 88 => 256 bytes on 64-bit
- [ruby-core:70034] [Feature #11371]
+ ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
-Sun Jul 19 14:29:18 2015 windwiny <windwiny.ubt@gmail.com>
+ * test/openssl/test_ssl.rb: Test above option exists.
- * ext/pty/pty.c: [DOC] fix example typo, an old name at move from
- PTY.open. [Fix GH-972]
+Wed Feb 8 13:12:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Jul 18 21:29:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509name.c: Use the numerical representation of
+ unrecognized OIDs instead of the sn "UNDEF".
- * thread.c (vm_check_ints_blocking): gather common statements at
- the end, and prefer LIKELY for Visual C optimization.
+ * test/openssl/test_x509name.rb: Add tests for the fixed behavior.
-Sat Jul 18 20:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Patch provided by Paul Kehrer, thank you!
+ [ruby-core:41769] [Feature #5787]
- * load.c (rb_load_internal0): do not raise any exceptions but
- return the result tag state.
+Wed Feb 8 09:49:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * load.c (rb_load_protect): reduce nested EXEC_TAGs.
+ * tool/merger.rb: don't abort, update first.
-Sat Jul 18 19:52:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 8 09:47:33 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * gc.c (run_finalizer): set and restore safe level here to reduce
- nested EXEC_TAGs.
+ * ext/openssl/ossl_asn1.c: Call INT2NUM only once for GeneralString.
+ Thanks to Mantas Mikulenas for noticing and providing a patch!
+ [ruby-core:42358] [Bug #5972]
-Sat Jul 18 18:45:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 8 09:19:00 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * eval.c (ruby_cleanup): error_handle() returns exit status to the
- system, not internal error state, do not convert the exit status
- again.
+ * ext/openssl/ossl_cipher.c: Add warning about key as IV.
-Sat Jul 18 10:29:03 2015 Eric Wong <e@80x24.org>
+Tue Feb 7 20:08:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/ruby/test_process.rb: test thread+sigs work after failed exec
+ * error.c (exc_inspect): Fix typo. patch from Trent Ogren
+ via https://github.com/ruby/ruby/pull/90
-Sat Jul 18 07:20:18 2015 Jeremy Evans <code@jeremyevans.net>
+Tue Feb 7 19:37:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/socket/test_nonblock: use smaller buffer for sendmsg
- [ruby-core:70016] [Bug #11364]
+ * st.c: refactor packed entries using structs.
-Sat Jul 18 07:04:24 2015 Eric Wong <e@80x24.org>
+Tue Feb 7 14:52:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c (trap_handler): cleanup to use RSTRING_GETMEM + memcmp
+ * st.c (st_update): table can be unpacked in the callback.
-Sat Jul 18 02:53:06 2015 Eric Wong <e@80x24.org>
+ * st.c (st_foreach): should not yield same pair when checking
+ after unpacking.
- * io.c (argf_read_nonblock): support `exception: false'
- (io_nonblock_eof): new function
- (io_read_nonblock): use io_nonblock_eof
- (argf_getpartial): accept kwargs hash for `exception: false'
- * test/ruby/test_argf.rb (test_read_nonblock): new test
- * NEWS: add item for ARGF.read_nonblock
- [ruby-core:70000] [Feature #11358]
+Mon Feb 6 21:55:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jul 17 23:51:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/merger.rb: abort if the working directory is dirty.
- * vm_eval.c (rb_eval_cmd): $SAFE=4 has been deprecated.
+ * tool/merger.rb: update the working directory after commit.
-Fri Jul 17 22:18:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Feb 6 00:16:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * compile.c (iseq_compile_each): use enum ruby_tag_type names.
+ * encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
+ is ascii only string. [ruby-core:42354] [Bug #5968]
- * vm_core.h (ruby_tag_type): move from eval_intern.h for compiling
- break/next/redo/return.
+Fri Feb 3 07:16:47 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jul 17 15:39:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick.rb: Moved proxy rewriting to WEBrick::HTTPProxy.
+ * lib/webrick/httpproxy.rb: Add examples of creating a proxy server
+ and response rewriting using HTTPProxy.
- * include/ruby/encoding.h (ENC_CODERANGE_CLEAN_P): predicate that
- tells if the coderange is clean, that is 7bit or valid, and no
- needs to scrub.
+Fri Feb 3 06:53:22 2012 Eric Hodel <drbrain@segment7.net>
- * re.c (rb_reg_expr_str): use ENC_CODERANGE_CLEAN_P.
+ * ext/openssl/ossl_x509store.c: Add class documentation for
+ OpenSSL::X509::Store
- * string.c (enc_strlen, rb_enc_cr_str_buf_cat, rb_str_scrub):
+Thu Feb 2 22:28:13 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/net/http/test_https_proxy.rb
+ (HTTPSProxyTest#test_https_proxy_authentication):
+ add workaround to avoid to hang up without openssl.
+ see [ruby-dev:45021][Bug #5786]
+
+ * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
ditto.
- * string.c (rb_str_enumerate_chars): ditto, and suppress a warning
- by gcc6.
+Thu Feb 2 21:48:18 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Jul 17 15:36:52 2015 yui-knk <spiketeika@gmail.com>
+ * lib/rexml/parsers/baseparser.rb: use meaningful names.
- * test/ruby/test_range.rb (test_first_last): Add test for
- `Range.new`. [Fix GH-971]
+Thu Feb 2 21:38:52 2012 Kouhei Sutou <kou@cozmixng.org>
-Fri Jul 17 15:36:40 2015 yui-knk <spiketeika@gmail.com>
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
+ fix the default xml namespace URI validation.
+ [ruby-dev:45169] [Bug #5956]
+ Reported by Miho Hiramatsu. Thanks!!!
- * test/ruby/test_range.rb (test_first_last): Add assertions to
- test of `Range#last` with exclude_end true case. [Fix GH-970]
+Thu Feb 2 17:51:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jul 17 09:59:14 2015 Eric Wong <e@80x24.org>
+ * io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
+ r34409 breaks replacing ARGV.
+ [ruby-dev:45160] [Bug #5952]
- * thread.c (rb_thread_alone): simplify
+Thu Feb 2 16:21:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jul 17 09:58:32 2015 Eric Wong <e@80x24.org>
+ * test/net/http/test_http.rb (TestNetHTTPKeepAlive#*): remove debug
+ output.
- * lib/rinda/tuplespace.rb: remove enumerator require
- * test/pathname/test_pathname.rb: ditto
+Thu Feb 2 01:24:34 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Fri Jul 17 05:33:58 2015 Eric Wong <e@80x24.org>
+ * parse.y (debug_lines, coverage): set file path encoding for coverage
+ result. [ruby-dev:44950]
- * iseq.c (rb_iseq_compile_with_option): reuse result of previous
- GET_THREAD() call
- * thread.c (thread_create_core): ditto
- (rb_mutex_trylock): ditto
- (rb_mutex_lock): ditto
- * process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS
- * thread.c (rb_thread_check_ints): ditto
+Wed Feb 1 14:38:31 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Jul 16 19:12:30 2015 Eric Wong <e@80x24.org>
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): Just
+ call File.unlink and ignore ENOENT because existence check
+ before unlinking does not help in terms of race condition.
- * thread.c (mutex_alloc): remove needless volatile
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): My
+ comment about thread safeness is obsolete.
-Thu Jul 16 22:05:29 2015 Koichi Sasada <ko1@atdot.net>
+Wed Feb 1 09:50:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: constify rb_iseq_t::parent_iseq.
+ * doc/re.rdoc (Repetition): fix typo. reported by Ori Avtalion
+ and patched by Zachary Scott. [Bug #5947]
- rb_iseq_t::local_iseq is not constant data because
- local_iseq::flip_cnt can be modified (commented).
+Wed Feb 1 06:38:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c: catch up this fix.
+ * io.c (argf_close): skip stdin, which should be readable again.
+ [ruby-dev:45160] [Bug #5952]
- * iseq.c: ditto.
+ * io.c (argf_readlines): reinitialize after all read to be
+ readable again.
- * vm_insnhelper.c: ditto.
+Tue Jan 31 21:27:43 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Jul 16 21:47:47 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page
+ size in OpenBSD. [ruby-core:42158][Bug #5901]
- * process.c (redirect_dup2): when the new FD of dup2() conflicts
- with one of the timer thread FDs, the internal FD is diverted.
- [Bug #11336] [ruby-core:69886] [Bug #11350] [ruby-core:69961]
+ * gc.c : avoid to redefine.
- * process.c (dup2_with_divert): new function for the above purpose.
+Tue Jan 31 14:27:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.c (rb_divert_reserved_fd): new function for
- diverting reserved FD. If the given FD is the same as one of the
- reserved FDs, the reserved FD number is internally changed.
- It returns -1 when error. Otherwise, returns 0. It also returns
- 0 if there is no need to change reserved FD number.
+ * test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid
+ in block form.
- * thread_win32.c (rb_divert_reserved_fd): always returns 0 because
- of no reserved FDs.
+Mon Jan 30 19:08:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h (rb_divert_reserved_fd): prototype declaration.
- It is Ruby internal use only.
+ * vm_eval.c (vm_call0): should pass block to enumerators. patched
+ by Kazuki Tsujimoto. [ruby-dev:44961][Bug #5731]
-Thu Jul 16 21:47:46 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_eval.c (method_missing), vm_insnhelper.c (vm_call_method):
+ ditto. patched by satoshi shiba.
- * iseq.c (rb_iseq_disasm): rename rb_iseq_t *iseqdat to iseq
- and VALUE *iseq to code.
+Mon Jan 30 12:31:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c (rb_iseq_disasm_insn): ditto.
+ * file.c (append_fspath): need to set the encoding to result always.
-Thu Jul 16 14:34:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 30 10:38:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm.c (REWIND_CFP): keep the arguments region inside the valid
- value stack. [ruby-core:69969] [Bug #11352]
+ * test/irb/test_completion.rb: skip if cannot load irb/completion
+ (maybe readline does not exist).
-Thu Jul 16 11:38:21 2015 Eric Wong <e@80x24.org>
+Sun Jan 29 22:47:19 2012 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * process.c (close_unless_reserved): declare type of `fd' arg
+ * tool/config.{guess,sub}: updated to automake-1.11.2.
-Thu Jul 16 08:47:29 2015 Eric Wong <e@80x24.org>
+Sun Jan 29 12:17:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * load.c (rb_construct_expanded_load_path): fstring expanded path
- (get_loaded_features_index): fstring feature path
- (rb_provide_feature): ditto
- [ruby-core:69871] [Feature #11331]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ respect encodings. [Bug #5941]
-Thu Jul 16 02:56:14 2015 Eric Wong <e@80x24.org>
+Sat Jan 28 09:33:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * thread.c (thread_initialize): avoid RSTRING_PTR and NUMT2INT
+ * win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
+ terminate by CTRL-C on Windows.
+ [ruby-dev:45149] [Bug #5812]
-Thu Jul 16 01:00:46 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sat Jan 28 08:18:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/ruby/test_process.rb (test_exec_close_reserved_fd): test for
- [Bug #11353]
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt): skip exit status
+ assertion because we cannot get signal status on Windows.
-Thu Jul 16 00:35:42 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * win32/win32.c (CreateChild): create process group to receive the
+ signal by GenerateConsoleCtrlEvent().
- * .gitignore: ignore version.i.
+ * win32/win32.c (kill): use CTRL_BREAK_EVENT instead of CTRL_C_EVENT
+ if a process group is specified. CTRL_C_EVENT signal cannot be
+ generated for process groups for the specification.
+ [ruby-dev:45149] [Bug #5812]
-Wed Jul 15 23:40:32 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sat Jan 28 07:46:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
- use RUBY (= EnvUtil.rubybin)
+ * thread_win32.c (rb_w32_wait_events_blocking): use
+ ruby_thread_from_native() instead of GET_THREAD() because
+ GET_THREAD() doesn't always return the current thread and
+ WaitForMultipleObjects() at rb_w32_read() doesn't return by
+ Thread#kill. This fixes TestQueue#test_thr_kill failure on
+ Windows.
-Wed Jul 15 23:01:22 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * thread_win32.c (rb_w32_wait_events): use ruby_thread_from_native()
+ instead of GET_THREAD() for consistency with the above change.
- * process.c (redirect_close, parent_redirect_close): should not close
- reserved FD. It should be closed in the exec system call due to the
- O_CLOEXEC or FD_CLOEXEC flag. [Bug #11353] [ruby-core:69977]
+ * thread_win32.c (rb_w32_sleep): ditto.
- * process.c (close_unless_reserved): new function to close FD unless
- it is reserved for internal communication.
+ * thread_win32.c (rb_w32_Sleep): ditto.
+ [ruby-dev:45149] [Bug #5812]
- * thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
- to avoid false positive in forked child process.
+Sat Jan 28 07:28:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Jul 15 18:31:18 2015 Eric Wong <e@80x24.org>
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_reader_wrap): set
+ binmode explicitly for fixing test error on Windows. This is consistent
+ with r34243.
+ [ruby-dev:45149] [Bug #5812]
- * proc.c (proc_mark): remove redundant check
- * vm.c (env_mark): ditto
+Sat Jan 28 05:53:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 15 17:27:40 2015 Eric Wong <e@80x24.org>
+ * lib/irb/completion.rb (IRB::InputCompletor::CompletionProc):
+ ignore non-string name modules. [ruby-core:42244][Bug #5938]
- * iseq.c (iseq_mark): remove check for data pointer
- * proc.c (binding_mark): ditto
- * vm.c (rb_thread_mark): ditto
- * vm_trace.c (tp_mark): ditto
+Fri Jan 27 16:31:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 15 16:55:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculate
+ from HEAP_ALIGN_LOG.
- * encoding.c (enc_autoload): drop dummy encoding flag from
- the loaded encoding index. this flag is used only in this
- source.
+Thu Jan 26 11:03:37 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 15 14:39:29 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/matrix.rb: Clean up extra whitespace in output documentation.
- * vm.c (vm_make_env_each): add comments about env layout.
- Do not use `i' to specify `new_ep'.
+Thu Jan 26 03:24:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (rb_proc_create, rb_vm_make_proc_lambda): envval is not used.
+ * ext/io/console/console.c (io_getch): default delegating method
+ for StringIO. https://github.com/nobu/io-console/issues/4
-Wed Jul 15 08:59:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/stringio/stringio.c: moved some methods to hidden modules.
- * gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once
- to get rid of inadvertent side effects.
+Wed Jan 25 13:27:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 15 02:53:11 2015 Koichi Sasada <ko1@atdot.net>
+ * file.c (rb_file_s_basename): ignore non-ascii extension in
+ different encoding, which cannot match.
- * vm_core.h, vm.c: remove rb_proc_t::envval because we can know it via
- rb_proc_t::block::ep.
+ * file.c (rmext): no extension to strip if empty string.
- rb_vm_proc_envval(const rb_proc_t *proc) returns an Env object which
- the Proc object use.
+ * file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
+ (rb_enc_path_last_separator, rb_enc_path_end)
+ (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
+ path handling functions.
- * proc.c: catch up this fix.
+ * file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
+ (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
+ (rb_file_join): should respect the encodings of arguments than
+ file system encoding. [ruby-dev:45145] [Bug #5919]
- * vm_dump.c (rb_vmdebug_proc_dump_raw): ditto.
+ * dir.c (check_dirname, ruby_glob0): ditto.
-Wed Jul 15 02:27:22 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/pathname/pathname.c (path_sub_ext): ditto.
- * vm_core.h, vm.c: remove rb_env_t::prev_envval because we can know it
- via env->ep.
+Tue Jan 24 14:20:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- rb_vm_env_prev_envval(env) returns prev_envval via env->ep.
+ * vm.c (rb_iter_break_value): new function to break a block with
+ the value. [ruby-dev:45132] [Feature #5895]
- * vm_core.h (rb_vm_env_local_variables): change parameter type
- from VALUE (T_DATA/env) to `const rb_env_t *' to make same as
- rb_vm_env_prev_envval().
+Tue Jan 24 12:58:41 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
- * proc.c: catch up these changes.
+ * object.c (rb_Hash): add Kernel#Hash conversion method like
+ Array() or Float(). a patch from Run Paint Run Run. Fix #3131
- * vm_dump.c: ditto.
+Tue Jan 24 11:38:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm.c: rename macros.
+ * lib/uri/common.rb (URI.encode_www_form_component): initialize on
+ requiring to support JRuby, which runs parallel multithreads.
+ [ruby-core:42222] [Bug #5925]
- * ENV_IN_HEAP_P() to VM_EP_IN_HEAP_P() because it uses ep.
- * ENV_VAL() to VM_ENV_EP_ENVVAL() because it is too short.
+ * lib/uri/common.rb (URI.decode_www_form_component): initialize on
-Wed Jul 15 01:09:09 2015 Koichi Sasada <ko1@atdot.net>
+Mon Jan 23 20:33:11 2012 Jason Kay <geniture@me.com>
- * vm.c: refactoring Proc/Env related code.
+ * lib/net/http.rb (Net::HTTP#connect): Writing entire packet at
+ once to avoid incomplete transmission. Current code using
+ writeline was causing sub-optimal conversing with a proxy due to
+ the connect tunnel request headers being split over multiple
+ packets. The modification I made allows the connect request to
+ be written as one packet, avoiding problems and optimizing the
+ conversation.
- * vm_core.h: remove blockprocval field from rb_proc_t and rb_binding_t.
- Instead of this field, mark given block in Proc at rb_env_t::env.
+ https://github.com/ruby/ruby/pull/72
+ [Feature #5460]
- * vm.c (vm_make_env_each): make an Env object with this layout.
- And also simplify parameters.
+Mon Jan 23 17:06:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * proc.c: catch up this fix.
+ * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of
+ Ruby 1.9; use Array#join. [Bug #5840]
- * vm_core.h: remove rb_env_t::local_size because it is not used.
+Mon Jan 23 16:42:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_dump.c (rb_vmdebug_env_dump_raw): catch up this fix.
+ * io.c (extract_binmode): raise an exception if binmode/textmode
+ is specified with both vmode and opthash.
+ [ruby-core:42199] [Bug #5918]
- * vm_core.h (rb_vm_make_env_object): remove rb_vm_make_env_object()
- because it is only referred from vm.c.
+Mon Jan 23 16:35:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_eval.c (eval_string_with_cref): catch up this fix.
+ * io.c (rb_io_extract_modeenc): set ASCII-8BIT if binmode is specified
+ with opthash. [ruby-core:42197] [Bug #5917]
-Wed Jul 15 00:03:36 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 23 10:08:00 2012 Kenta Murata <mrkn@cookpad.com>
- * gc.c (__has_feature): move into internal.h.
+ * test/cgi/test_cgi_util.rb (test_cgi_escape_preserve_encoding):
+ add a test for CGI::escape to preserve encoding.
- * internal.h (__has_feature): ditto.
+ * test/cgi/test_cgi_util.rb (test_cgi_unescape_preserve_encoding):
+ add a test for CGI::unescape to preserve encoding.
- * internal.h (__has_extension): new macro.
+Mon Jan 23 00:45:34 2012 Akinori MUSHA <knu@iDaemons.org>
- * internal.h (STATIC_ASSERT): use _Static_assert with
- clang. [ruby-core:69931] [Bug #11343]
+ * misc/rdoc-mode.el (rdoc-imenu-create-index): Add imenu support
+ to rdoc-mode.
-Wed Jul 15 00:00:00 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * misc/rdoc-mode.el (rdoc-mode): Fix regexp patterns containing
+ "\s " where CR/LF is not supposed to match.
- * random.c (fill_random_bytes_syscall): fix compile error with
- clang. [ruby-core:69931] [Bug #11343]
+Sun Jan 22 15:41:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 14 11:22:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (rb_intern3): split to registration check and new
+ registration.
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
- notify the handler thread of new timeout registration.
+ * parse.y (rb_intern_str): make interned string shared with the
+ given string.
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
- make sleep intervals adaptive than fixed period intervals.
+ * parse.y (rb_intern3, rb_intern_str): check the coderange first.
- * lib/webrick/server.rb (WEBrick::GenericServer#start): flush
- shutdown pipe.
+Sat Jan 21 22:21:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
- server to stop immediately by sending data via shutdown pipe.
+ * include/ruby/ruby.h (FIXNUM_P): simple flag should be int.
-Mon Jul 13 23:58:08 2015 Stefano Tortarolo <stefano.tortarolo@gmail.com>
+Sat Jan 21 21:51:19 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT):
- fix typos in debugger statements. [Fix GH-967]
+ * encoding.c (rb_enc_compatible): fix segv on symbols.
+ [ruby-core:42204] [Bug #5921]
-Mon Jul 13 19:11:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 21 11:43:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/timeout.rb (timeout): warn as deprecated for a long time.
+ * dir.c (dir_chdir, check_dirname): get rid of optimization-out.
-Mon Jul 13 01:37:27 2015 Zachary Scott <zzak@ruby-lang.org>
+Fri Jan 20 20:47:37 2012 Kenta Murata <mrkn@cookpad.com>
- * ext/openssl/ossl.c: [DOC] Backport ruby/openssl@dbb3fdb [Bug #11345]
- Thanks to Tomoya Chiba for the report and help with patch.
+ * lib/cgi/util.rb (CGI.escape): support a string with invalid byte
+ sequence. [Bug #5913]
-Sun Jul 12 09:20:02 2015 Shota Fukumori <her@sorah.jp>
+ * test/cgi/test_cgi_util.rb
+ (test_cgi_escape_with_invalid_byte_sequence): test for the above
+ change.
- * ext/socket/basicsocket.c: [DOC] typo (Errno::AGAIN -> Errno::EAGAIN)
+Fri Jan 20 17:37:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/socket.c: ditto
+ * vm.c (vm_exec): remove workaround for LLVM because r34278 fixes it.
- * ext/socket/tcpserver.c: ditto
+ * vm_insnhelper.c (vm_call_cfunc): ditto.
- * ext/socket/udpsocket.c: ditto
+Fri Jan 20 14:31:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/unixserver.c: ditto
+ * lib/net/http.rb (Net::HTTP#transport_request): retry a idempotent
+ request automatically. [ruby-dev:45030] [Bug #5790]
+ [ruby-core:41821] [Bug #5813]
- * io.c: ditto
+ * lib/net/http.rb (Net::HTTP#keep_alive_timeout=): added to specify
+ the second to reconnect the TCP connection on Keep-Alive.
+ The default value is 2 second because current servers uses 2 sec.
+ http://ftp-admin.blogspot.com/2009/09/keepalivetimeout2.html
-Sun Jul 12 06:42:23 2015 ksss <co000ri@gmail.com>
+ * lib/net/http.rb (Net::HTTP#begin_transport): reconnect TCP
+ connection on keep-alive timeout.
- * test/stringio/test_stringio.rb (test_sysread): add a test for
- StringIO#sysread. [Fix GH-966]
+Thu Jan 19 07:53:09 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sat Jul 11 21:16:34 2015 ksss <co000ri@gmail.com>
+ * ext/date/date_strptime.c: moved detector of leftover.
- * ext/stringio/stringio.c (Init_stringio): [DOC] Fix an example,
- StringIO#puts should be set "\n" at last. [Fix GH-965]
+Thu Jan 19 07:10:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sat Jul 11 12:45:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/date_parse.c: [ruby-core:42173].
- * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line
- number and fix caller depth.
+Wed Jan 18 18:11:02 2012 Akinori MUSHA <knu@iDaemons.org>
-Fri Jul 10 22:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * misc/rdoc-mode.el (rdoc-mode): Add provide so that requiring
+ this library succeeds.
- * lib/timeout.rb (ExitException): removed internal exception class
- and use Timeout::Error instead, as using throw/catch to isolate
- each timeouts now. [ruby-dev:49179] [Bug #11344]
+Wed Jan 18 18:06:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 10 17:41:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/curses.c (cWindow, cMouseEvent): made typed data.
- * dir.c (is_case_sensitive): get attributes by the file descriptor
- of open directory, instead of using mount point name.
+Wed Jan 18 12:49:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Jul 10 10:46:02 2015 ksss <co000ri@gmail.com>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
+ subclasses of String with ivars
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
+ subclasses of String with ivars
+ * test/psych/test_string.rb: corresponding tests
- * ext/stringio/stringio.c (writable): remove unnecessary check for
- deprecated safe level 4. [Fix GH-963]
+Wed Jan 18 10:39:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Jul 9 15:07:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
+ subclasses with ivars.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
+ array subclasses with ivars.
+ * test/psych/test_array.rb: corresponding tests
- * win32/win32.c (waitpid): return immediately if interrupted.
- reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]
+Tue Jan 17 17:18:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 9 13:03:46 2015 Koichi Sasada <ko1@atdot.net>
+ * configure.in (SPT_TYPE): enable as SPT_REUSEARGV on Darwin.
- * vm_insnhelper.c (vm_search_super_method): use CI_SET_FASTPATH().
+ * missing/setproctitle.c (ruby_init_setproctitle): changed prefix.
-Thu Jul 9 11:07:06 2015 Koichi Sasada <ko1@atdot.net>
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: remove rb_call_info_t::klass because
- rb_callable_method_entry_t has information about defined class.
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
- * vm_insnhelper.c (vm_search_method): don't set ci->klass because
- it is removed.
+Tue Jan 17 10:54:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (rb_equal_opt): ditto.
+ * st.c (do_hash): it's the time to remove cast to unsigned int.
- * vm_insnhelper.c (vm_search_superclass): removed because it is too
- simple to write code directly.
+Tue Jan 17 07:30:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c (vm_defined): don't use vm_search_superclass().
- This fix avoid searching current callable `me' twice.
+ * st.c (unpack_entries): Fix r34310: on unpacking, the position of
+ a hash must be do_hash-ed value.
- * vm_insnhelper.c (vm_search_super_method): ditto.
+ * st.c (add_packed_direct): ditto.
-Thu Jul 9 10:03:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Jan 16 16:41:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http/responses.rb: Added 308 status to CODE_TO_OBJ list.
- [fix GH-961] Patch by @billinghamj
+ * lib/optparse.rb (Regexp): fix incorrect options when casting to
+ a Regexp, and suppress encoding option warnings.
+ https://github.com/ruby/ruby/pull/82
-Thu Jul 9 09:34:14 2015 Koichi Sasada <ko1@atdot.net>
+Mon Jan 16 11:22:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h (rb_control_frame_t): fix comments (layout index).
+ * win32/win32.c (rb_chsize): no need to get the current file size.
-Thu Jul 9 09:25:50 2015 Zachary Scott <e@zzak.io>
+Mon Jan 16 00:41:33 2012 Sokolov Yura <funny.falcon@gmail.com>
- * parse.y: Improve duplicate key warning with patch by @andremedeiros
- [Fix GH-938] https://github.com/ruby/ruby/pull/938 [Bug #11327]
+ * st.c: st use function instead of macro. In my current
+ environment (Ubuntu 11.04 32bit gcc-4.5.2) it gives 4%
+ performance improvement.
-Wed Jul 8 07:43:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ https://github.com/ruby/ruby/pull/77
- * lib/csv.rb: typo fix [ci skip][fix GH-958] Patch by @henrik
+Sun Jan 15 14:09:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jul 8 04:42:27 2015 Eric Wong <e@80x24.org>
+ * object.c (rb_inspect): raise the result is not compatible with
+ the default external encoding. [ruby-core:42095] [Bug #5848]
+ If the default external encoding is ASCII compatible, the encoding of
+ inspected result must be compatible with it.
+ If the default external encoding is ASCII incompatible,
+ the result must be ASCII only.
- * iseq.c (iseq_data_to_ary): dump kw_arg as symbol
- * test/-ext-/iseq_load/test_iseq_load.rb: test kw_arg roundtrip
- [ruby-core:69891] [Bug #11338]
+Sun Jan 15 13:21:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jul 7 18:18:41 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/json/parser/parser.rl (json_string_unescape): workaround fix
+ for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862
- * random.c (fill_random_bytes_syscall): fix compile error.
+Sat Jan 14 22:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 7 16:47:30 2015 Eric Wong <e@80x24.org>
+ * ext/dl/callback/mkcallback.rb (gencallback): suppress unused
+ variables.
- * compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
+Sat Jan 14 21:56:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 7 16:39:04 2015 Eric Wong <e@80x24.org>
+ * iseq.c (iseq_data_to_ary): check line info table boundary. line
+ number 0 means no line number info is needed. [ruby-dev:45130]
+ [Bug #5894]
- * random.c (fill_random_bytes_syscall): return -1 for error
- * random.c (fill_random_bytes): try urandom on syscall failure
+Sat Jan 14 18:24:13 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Tue Jul 7 15:02:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (exc_equal): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-core:41979] [Bug #5865]
- * file.c (rb_str_normalize_ospath): skip invalid byte sequence not
- to loop infinitely. this case usually does not happen as the
- input name should come from real file systems.
+Sat Jan 14 12:02:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 7 14:40:08 2015 Koichi Sasada <ko1@atdot.net>
+ * sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the
+ implementation deeply depends on plain char, so wchar_t based
+ encodings are not supported.
- * vm_backtrace.c: remove debug flag introduced accidentally.
+Sat Jan 14 12:00:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 7 12:05:37 2015 Koichi Sasada <ko1@atdot.net>
+ * error.c (exc_equal): ignore exceptions during implicit
+ conversion. [ruby-core:41979] [Bug #5865]
- * cont.c (cont_free): remove mysterious fflush()
- introduced at r19890, maybe accidentally.
+Sat Jan 14 05:58:54 2012 Eric Hodel <drbrain@segment7.net>
-Tue Jul 7 11:45:14 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (rb_io_s_read): Fix formatting of open_args comment. Reported
+ by Adam Prescott.
- * proc.c (rb_method_call): because data->me should be non-NULL,
- do not check data->me
+Fri Jan 13 18:41:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (method_inspect): ditto.
+ * sprintf.c (rb_enc_vsprintf): can be used for ASCII compatible
+ encodings only.
-Tue Jul 7 11:37:25 2015 Koichi Sasada <ko1@atdot.net>
+Fri Jan 13 18:29:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()
- no longer exists.
+ * thread.c (rb_mutex_unlock_th): simplified.
- * iseq.c: don't use rb_iseq_t::orig.
+ * thread.c (rb_barrier_waiting): fix potential overflows.
-Tue Jul 07 11:25:57 2015 Koichi Sasada <ko1@atdot.net>
+Fri Jan 13 17:23:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.c, internal.h (rb_iseq_clone): removed because we don't need to
- clone iseq any more.
+ * load.c (load_unlock): update loading table at once.
- * class.c (clone_method): share iseq between cloned methods. All of
- method dependent information are able to refer from method entry.
+Fri Jan 13 16:44:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 7 04:42:25 2015 Eric Wong <e@80x24.org>
+ * error.c (exc_equal): try implicit conversion for delegator.
+ [ruby-core:41979] [Bug #5865]
- * string.c (Init_String): use rb_str_freeze for String#freeze
- to resize internal buffer
- [ruby-core:69870] [Feature #11330]
+Fri Jan 13 03:46:53 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Jul 7 04:12:32 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/shellwords.rb (Shellwords#shellescape): shellescape() now
+ stringifies the given object using to_s.
- * vm.c (vm_define_method): remove an unused local variable.
+ * lib/shellwords.rb (Shellwords#shelljoin): shelljoin() accepts
+ non-string objects in the given array, each of which is
+ stringified using to_s.
-Tue Jul 7 03:57:28 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/shellwords.rb: Fix rdoc markups.
- * vm_core.h: remove rb_iseq_t::defined_method_id because it is not
- needed.
+Fri Jan 13 03:38:36 2012 Akinori MUSHA <knu@iDaemons.org>
- * eval.c (frame_func_id): simplify. rb_callable_method_entry_t
- has enough information.
+ * lib/shellwords.rb (Shellwords#shellsplit): Fix a bug where
+ consecutive backslashes in double quotes are all removed except
+ the one at the tail.
- * eval.c (frame_called_id): ditto.
+Fri Jan 13 03:28:00 2012 Luis Lavena <luislavena@gmail.com>
- * iseq.c (prepare_iseq_build): catch up this fix.
+ * ext/socket/extconf.rb (if ipv6): only define _WIN32_WINNT if was not
+ previously defined. This solve warnings with multiple defines in
+ command line with GCC 4.6.1
- * proc.c (rb_mod_define_method): ditto.
+Thu Jan 12 18:44:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (vm_define_method): ditto.
+ * lib/mkmf.rb: fix r33904 and revert r33905. initialize global
+ variables with init_mkmf before initializing constants.
+ [ruby-dev:45124] [Bug #5879]
-Tue Jul 7 03:47:26 2015 Koichi Sasada <ko1@atdot.net>
+Thu Jan 12 13:51:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h: remove a useless declaration.
+ * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
+ reserving a memory space with ALLOCA_N for restoring machine stack
+ stored in cont->machine_stack, but clang optimized out it (and
+ maybe #5851 is also caused by this).
+ This affected TestContinuation#test_check_localvars.
-Tue Jul 7 03:33:20 2015 Koichi Sasada <ko1@atdot.net>
+ * cont.c (cont_restore_1): revert workaround introduced in r32201.
- * vm_core.h: remove rb_iseq_t::klass to reduce dynamic data.
+Thu Jan 12 02:14:43 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * internal.h, iseq.c (rb_iseq_klass): remove it because
- rb_iseq_t::klass is removed.
+ * object.c: Added examples for Object#is_a? and
+ Object#instance_of? patched from Manoj Kumar.
+ [Bug #5880] [ruby-core:42057]
- * vm_insnhelper.c (vm_super_outside): do not see cfp->iseq, but
- check callable method entry on a frame.
- This fix simplify the logic to search super class.
+Thu Jan 12 00:57:48 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_method.rb: support super() from Proc.
- Now, [Bug #4881] and [Bug #3136] was solved.
+ * lib/mkmf.rb: verbose-mode can use by RM, RMDIRS, etc.
+ (e.g. make V=1 realclean)
- * proc.c (rb_mod_define_method): catch up this change.
+Wed Jan 11 23:40:21 2012 Naohisa Goto <ngoto@gen-info.osaka-u.ac.jp>
- * vm.c (vm_define_method): ditto.
+ * string.c (rb_str_concat): set array element after definition
+ to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10
+ on Sparc. [Bug #5878] [ruby-dev:45123]
- * vm_backtrace.c (rb_profile_frames): now, each `frame' objects
- are rb_callable_method_entry_t data or iseq VALUEs.
+Wed Jan 11 22:52:51 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- This fix introduce minor compatibility issue that
- rb_profile_frame_label() always returns
- rb_profile_frame_base_label().
+ * gc.c (ruby_mimmalloc): don't set allocated size to header.
+ ruby_mimmalloc() doesn't increment allocated_size/allocations and
+ decrement them in ruby_xfree() cause inconsistency.
- * test/-ext-/debug/test_profile_frames.rb: catch up this change.
+ * gc.c (ruby_xfree): don't decrement allocated_size/allocations if
+ allocated size record is 0.
-Tue Jul 7 01:52:14 2015 Koichi Sasada <ko1@atdot.net>
+Wed Jan 11 22:36:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * cont.c (fiber_init): initialize control frame correctly.
- This fix does not affect any ordinal execution, but
- affects debug prints.
+ * test/readline/test_readline.rb (test_completion_proc_empty_result):
+ ensure clearance of Readline's line_buffer after the test.
-Mon Jul 6 17:59:05 2015 Koichi Sasada <ko1@atdot.net>
+Tue Jan 10 21:57:38 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * vm_insnhelper.c (vm_search_super_method): do not skip calling
- same methods in super.
- [Bug #3351]
+ * ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
+ use `extern __declspec(dllimport)` for dll link with VC.
+ [ruby-core:41996] [Bug #5869]
- * test/ruby/test_super.rb: fix a test.
+Tue Jan 10 15:31:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 6 17:59:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * vm.c (vm_exec): refix r34162; suppress warning and add description.
- * ext/tk/tcltklib.c: removed deprecated safe level.
+Tue Jan 10 15:13:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 6 17:16:37 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ use rb_memerror().
- * method.h, proc.c (rb_method_entry_location): make it static
- and remove prefix `rb_' because it is used only in proc.c.
+Tue Jan 10 12:49:42 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 6 16:42:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.
- * test/lib/memory_status.rb: removed redundant path.
+Tue Jan 10 12:44:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jul 6 01:18:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,
+ but should return pointer suitable for ruby_xfree;
+ main vm and main thread.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79
- * test/lib/test/unit/parallel.rb: make @@project_dir one level
- upper as this file had moved one level deeper.
+ * internal.h: ditto.
-Sun Jul 5 23:54:10 2015 mizokami <suzunatsu@yahoo.com>
+ * vm.c (Init_BareVM): use ruby_mimmalloc.
- * lib/optparse.rb: [DOC] Fix typo.
+ * ext/dl/cfunc.c: #include <ruby/util.h>.
-Sun Jul 5 18:25:37 2015 Eric Wong <e@80x24.org>
+ * ext/syslog/syslog.c: use xfree because it is allocated by
+ ruby_strdup.
- * gc.c (gc_profile_record_get): fix spelling error in keys
+Tue Jan 10 12:13:56 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun Jul 5 14:49:01 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix compile error.
- * README.md: fix a typo pointed out by raoulvdberge.
- https://github.com/ruby/ruby/pull/953#commitcomment-11998186
+Tue Jan 10 10:41:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jul 5 12:56:20 2015 Irvi Firqotul Aini <viarc7@gmail.com>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ empty completion result does not mean memory error.
- * README.md: Added link HowToReport bugs.
+Tue Jan 10 02:19:22 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Sun Jul 5 10:51:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io.rb (test_autoclose_true_closed_by_finalizer,
+ test_autoclose_true_closed_by_finalizer): skip if IO objects are
+ not recycled yet. [ruby-dev:45098] [Bug #5850]
- * array.c (rb_ary_sort_bang): the original array may not be
- embedded even if a substitution array is embedded, as it is
- embedded when the original array is short enough but not
- embedded. [ruby-dev:49166] [Bug #11332]
+Tue Jan 10 00:41:28 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Sun Jul 5 09:31:40 2015 Eric Wong <e@80x24.org>
+ * lib/tempfile.rb (Tempfile#_close): clear @tempfile and @data[1] even
+ when exception is raised at @tempfile.close. [ruby-dev:45113]
- * test/ruby/test_process.rb: test for fd=3 usability in child
+ * lib/tempfile.rb (Tempfile#unlink): fix a typo.
-Sat Jul 4 19:43:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Jan 10 00:32:17 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * Add test case for empty array and first method with args.
- Patch by @yui-knk [fix GH-955]
+ * gc.c (run_finalizer): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-dev:45113]
-Sat Jul 4 19:39:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Jan 9 23:37:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * Add test for `Enumerable#sort` with block. Patch by @yui-knk
- [fix GH-954]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix typos.
-Sat Jul 4 14:38:43 2015 Eric Wong <e@80x24.org>
+Mon Jan 9 20:55:34 2012 Narihiro Nakamura <authornari@gmail.com>
- * enum.c (zip_ary): remove volatile, use RB_GC_GUARD
- (zip_i): ditto
+ * gc.c : don't embed struct heaps_slot to a heap block because it
+ can causes copy-on-write of memory page on heap block when its
+ free_next is rewritten.
-Sat Jul 4 10:42:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 20:26:33 2012 Tanaka Akira <akr@fsij.org>
- * lib/rubygems/test_case.rb (teardown): do not delete features
- loaded from the original load paths, the same libraries should
- be loaded again when the same features are required.
- [ruby-dev:49031] [Bug #11222]
+ * ext/pathname/pathname.c (path_entries): add document suggested by
+ the thread [ruby-core:41959] [Bug #5859].
-Sat Jul 4 09:38:52 2015 Eric Wong <e@80x24.org>
+Mon Jan 9 20:14:13 2012 Tanaka Akira <akr@fsij.org>
- * vm.c (rb_vm_mark): reduce branches for always-set VM fields
- (rb_vm_add_root_module): ditto
+ * ext/socket/lib/socket.rb (family_addrinfo): don't require protocol
+ equality. For example, protocol 0 and IPPROTO_TCP is not problem
+ for TCP.
-Fri Jul 03 20:05:10 2015 Koichi Sasada <ko1@atdot.net>
+Mon Jan 9 20:08:52 2012 Tanaka Akira <akr@fsij.org>
- * method.h: introduce rb_callable_method_entry_t to remove
- rb_control_frame_t::klass.
- [Bug #11278], [Bug #11279]
+ * ext/socket/lib/socket.rb (family_addrinfo): return the given
+ addrinfo object.
+ Patch by Ippei Obayashi. [ruby-dev:45095] [Bug #5845]
- rb_method_entry_t data belong to modules/classes.
- rb_method_entry_t::owner points defined module or class.
+Mon Jan 9 19:40:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- module M
- def foo; end
- end
+ * test/zlib/test_zlib.rb (TestZlibGzipWriter#test_writer_wrap): set
+ binmode explicitly.
- In this case, owner is M.
+Mon Jan 9 14:42:41 2012 Narihiro Nakamura <authornari@gmail.com>
- rb_callable_method_entry_t data belong to only classes.
- For modules, MRI creates corresponding T_ICLASS internally.
- rb_callable_method_entry_t can also belong to T_ICLASS.
+ * gc.c: free_slots is changed Singly linked list. clear
+ free_slots before sweep.
- rb_callable_method_entry_t::defined_class points T_CLASS or
- T_ICLASS.
- rb_method_entry_t data for classes (not for modules) are also
- rb_callable_method_entry_t data because it is completely same data.
- In this case, rb_method_entry_t::owner == rb_method_entry_t::defined_class.
+Mon Jan 9 07:46:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- For example, there are classes C and D, and includes M,
+ * gc.c: i686-linux needs to define _XOPEN_SOURCE 600 for posix_memalign.
- class C; include M; end
- class D; include M; end
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- then, two T_ICLASS objects for C's super class and D's super class
- will be created.
+ * gc.c (rb_objspace_free): global_List is allocated with xmalloc.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78
- When C.new.foo is called, then M#foo is searched and
- rb_callable_method_t data is used by VM to invoke M#foo.
+ * dln_find.c: remove useless replacement of free.
- rb_method_entry_t data is only one for M#foo.
- However, rb_callable_method_entry_t data are two (and can be more).
- It is proportional to the number of including (and prepending)
- classes (the number of T_ICLASS which point to the module).
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ strings for readline must allocated with malloc.
- Now, created rb_callable_method_entry_t are collected when
- the original module M was modified. We can think it is a cache.
+ * process.c (run_exec_dup2): use free; see also r20950.
- We need to select what kind of method entry data is needed.
- To operate definition, then you need to use rb_method_entry_t.
+ * re.c (onig_new_with_source): use malloc for oniguruma.
- You can access them by the following functions.
+ * vm.c (ruby_vm_destruct): use free for VMs.
- * rb_method_entry(VALUE klass, ID id);
- * rb_method_entry_with_refinements(VALUE klass, ID id);
- * rb_method_entry_without_refinements(VALUE klass, ID id);
- * rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me);
+ * vm.c (thread_free): use free for threads.
- To invoke methods, then you need to use rb_callable_method_entry_t
- which you can get by the following APIs corresponding to the
- above listed functions.
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * rb_callable_method_entry(VALUE klass, ID id);
- * rb_callable_method_entry_with_refinements(VALUE klass, ID id);
- * rb_callable_method_entry_without_refinements(VALUE klass, ID id);
- * rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me);
+ * dln_find.c: remove useless replacement of free.
- VM pushes rb_callable_method_entry_t, so that rb_vm_frame_method_entry()
- returns rb_callable_method_entry_t.
- You can check a super class of current method by
- rb_callable_method_entry_t::defined_class.
+ * ext/readline/readline.c (filename_completion_proc_call):
+ matches should use xfree.
- * method.h: renamed from rb_method_entry_t::klass to
- rb_method_entry_t::owner.
+ * ext/readline/readline.c (username_completion_proc_call): ditto.
- * internal.h: add rb_classext_struct::callable_m_tbl to cache
- rb_callable_method_entry_t data.
+Mon Jan 9 01:12:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- We need to consider about this field again because it is only
- active for T_ICLASS.
+ * numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
+ is invalid. [Feature #5855] [Bug #5863] [Bug #5864]
- * class.c (method_entry_i): ditto.
+ * string.c (rb_str_concat): ditto.
- * class.c (rb_define_attr): rb_method_entry() does not takes
- defined_class_ptr.
+ * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
+ is US-ASCII and the argument is an integer greater than 127.
- * gc.c (mark_method_entry): mark RCLASS_CALLABLE_M_TBL() for T_ICLASS.
+ * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.
- * cont.c (fiber_init): rb_control_frame_t::klass is removed.
+ * enc/euc_jp.c (code_to_mbclen): ditto.
- * proc.c: fix `struct METHOD' data structure because
- rb_callable_method_t has all information.
+ * enc/shift_jis.c (code_to_mbclen): ditto.
- * vm_core.h: remove several fields.
- * rb_control_frame_t::klass.
- * rb_block_t::klass.
+Sun Jan 8 20:31:45 2012 Narihiro Nakamura <narihiro@netlab.jp>
- And catch up changes.
+ * gc.c : consider header bytes which are used by malloc.
- * eval.c: catch up changes.
+Sun Jan 8 11:54:43 2012 Narihiro Nakamura <authornari@gmail.com>
- * gc.c: ditto.
+ * gc.c (aligned_free): support MinGW. Patch by Hiroshi Shirosaki.
- * insns.def: ditto.
+Sun Jan 8 11:43:05 2012 Narihiro Nakamura <authornari@gmail.com>
- * vm.c: ditto.
+ * gc.c (slot_sweep): add a assertion instead of a debug print.
- * vm_args.c: ditto.
+Sun Jan 8 01:18:19 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * vm_backtrace.c: ditto.
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ avoid platform bug. [Bug #5858] [ruby-dev:45108]
- * vm_dump.c: ditto.
+Sun Jan 8 00:46:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_eval.c: ditto.
+ * gc.c: get rid of implicit narrowing conversion.
- * vm_insnhelper.c: ditto.
+Sun Jan 8 00:10:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_method.c: ditto.
+ * configure.in: check posix_memalign(3) and memalign(3).
-Fri Jul 3 14:30:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (aligned_malloc): use configure's result instead of
+ _POSIX_C_SOURCE and _XOPEN_SOURCE because they can't be used
+ to check availability at least on FreeBSD.
- * win32/file.c: some mingw compilers need a tweek for the
- declarations of _wfreopen_s. [Bug #11320]
+Sat Jan 7 22:25:50 2012 Narihiro Nakamura <authornari@gmail.com>
-Fri Jul 3 12:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: use Bitmap Marking algorithm to avoid copy-on-write of
+ memory pages. See [ruby-dev:45085] [Feature #5839]
+ [ruby-core:41916].
- * transcode.c (rb_econv_set_replacement): target encoding name can
- be empty now. [ruby-core:69841] [Bug #11324]
+ * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1.
-Fri Jul 3 07:21:06 2015 Eric Wong <e@80x24.org>
+ * node.h : ditto.
- * benchmark/bm_io_nonblock_noex.rb: new benchmark
- * ext/openssl/ossl_ssl.c (no_exception_p): new function
- (ossl_start_ssl): adjust for no_exception_p
- (ossl_ssl_connect): adjust ossl_start_ssl call
- (ossl_ssl_connect_nonblock): ditto
- (ossl_ssl_accept): ditto
- (ossl_ssl_accept_nonblock): ditto
- (ossl_ssl_read_internal): adjust for no_exception_p
- (ossl_ssl_write_internal): ditto
- (ossl_ssl_write): adjust ossl_write_internal call
- (ossl_ssl_write_nonblock): ditto
- * ext/stringio/stringio.c (strio_read_nonblock):
- delay exception check
- * io.c (no_exception_p): new function
- (io_getpartial): call no_exception_p
- (io_readpartial): adjust for io_getpartial
- (get_kwargs_exception): remove
- (io_read_nonblock): adjust for io_getpartial,
- check no_exception_p on EOF
- (io_write_nonblock): call no_exception_p
- (rb_io_write_nonblock): do not check `exception: false'
- (argf_getpartial): adjust for io_getpartial
- [ruby-core:69778] [Feature #11318]
+ * debug.c : ditto.
-Fri Jul 3 07:13:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (rb_obj_clone): FL_MARK move to a bitmap.
- * dir.c (replace_real_basename): Win32 API does not set errno, get
- the last error by GetLastError() and map to errno. [Bug #10015]
+ * class.c (rb_singleton_class_clone): ditto.
-Thu Jul 2 21:32:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 7 00:47:07 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * dir.c (replace_real_basename): show warnings at errors.
- [Bug #10015]
+ * configure.in: always define CANONICALIZATION_FOR_MATHN.
+ [ruby-dev:45100] [Bug #5852]
-Thu Jul 2 18:39:20 2015 Koichi Sasada <ko1@atdot.net>
+Fri Jan 6 23:11:20 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * gc.c: remove `#define RGENGC_OBJ_INFO 1' line introduced to
- debug Bug #11244.
+ * include/ruby/version.h: RUBY_API_VERSION 2.0.0
-Thu Jul 2 18:34:26 2015 Koichi Sasada <ko1@atdot.net>
+Fri Jan 6 12:24:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (rb_raw_obj_info): separated from rb_obj_info().
- Fill internal object information into passed buffer.
+ * object.c (rb_inspect): raises Encoding::CompatibilityError if the
+ result is incompatible with the default external encoding.
+ [ruby-core:41931] [Bug #5848]
- * gc.h: declare rb_raw_obj_info().
+Thu Jan 5 15:26:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Jul 2 16:15:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (check_valid_dir): strict checking of root.
+ GetDriveType() succeeds with non root directory as the argument,
+ even if MSDN says that the API needs the root directory.
+ this patch fixes a failure of test/ruby/test_file_exhaustive.rb.
- * dir.c (replace_real_basename): update path type by the target
- attributes if possible, to improve the performance. [Bug #10015]
+Thu Jan 5 12:15:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jul 2 14:45:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * file.c (rb_file_join): separator is appended by array length - 1
+ times. patched by Benoit Daloze [ruby-core:41901] [Bug #5841]
- * st.c: get rid of VC++'s warnings of C4700 (uninitialized local
- variable used). I think that these are wrong, but should shut them
- up.
+Thu Jan 5 11:47:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jul 2 14:15:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/common.rb (URI::Parser#initialize_regexp):
+ use \A \z instead of ^ $. [Bug #5843]
- * lib/rubygems.rb (Gem.load_path_insert_index): search
- @gem_prelude_index first.
+Wed Jan 4 17:55:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/rubygems/test_case.rb (Gem::TestCase#setup): keep already
- expanded paths to preserve instance variables.
+ * array.c (rb_ary_sample): add example for Array#sample
+ based on patch from https://github.com/ruby/ruby/pull/74
-Thu Jul 2 14:12:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 4 14:24:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (process_options): also copy initial load path marks at
- setting load paths encoding.
+ * string.c (str_nth_len): count ascii-only run at the end. this
+ bug appears only when single-byte-optimization is disabled due
+ to unknown coderange. [ruby-core:41896] [Bug #5836]
-Thu Jul 2 12:26:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 4 11:32:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/rubygems/test_gem_server.rb (process_based_port): use
- dynamically chosen port numbers to get rid of conflicts.
+ * win32/win32.c (check_valid_dir): special case for a root directory.
+ Reported by Masateru OKAMOTO at [Bug #5819].
-Thu Jul 2 11:58:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jan 4 00:19:54 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/rubygems/test_gem_specification.rb: skip tests which the
- platform does not permit the filename of its test file.
+ * lib/rexml/parsers/baseparser.rb: use private instead of _xxx
+ method name. This is Ruby code not Python code.
+ refs #5696
-Thu Jul 2 11:36:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 3 23:57:37 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/rubygems/test_gem_resolver_git_specification.rb: require
- rubygems/installer.rb before Gem::TestCase#setup runs, otherwise
- as Gem::TestCase#teardown restores $LOADED_FEATURES to the state
- at that time, the requiring the file in GitSpecification#install
- method causes a lot of constant redefinitions.
+ * lib/rexml/parsers/baseparser.rb: rexml BaseParser uses
+ instance_eval unnecessarily on listener add.
+ patch from Charles Nutter. [Bug #5696] [ruby-core:41437]
-Thu Jul 2 10:43:36 2015 Eric Wong <e@80x24.org>
+Tue Jan 3 20:44:13 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/socket/rubysocket.h: flags for common socket families
- (rsock_getfamily): update signature
- * include/ruby/io.h: comment socket FMODE flags
- * ext/socket/init.c (rsock_getfamily): memoize family
- * ext/socket/basicsocket.c: adjust rsock_getfamily calls
- * ext/socket/ancdata.c: ditto
- [ruby-core:69713] [Feature #11298]
+ * README: add comment for Git user. patch from Arun Agrawal.
+ * README.ja: ditto.
-Thu Jul 2 10:30:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Jan 3 15:58:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/rubygems/resolver.rb: fixed NameError of Gem::Util::NULL_DEVICE.
+ * thread.c: changed documentation for "thread-local" variables.
+ patch from Julien Ammous.
-Thu Jul 2 09:51:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Jan 3 15:50:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/rubygems/resolver.rb: fix error of null device reference with DOSISH
- platform.
+ * process.c: Fix typo. patch from Aviv Ben-Yosef.
-Thu Jul 2 06:49:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Jan 3 13:43:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rubygems: Update to RubyGems HEAD(c202db2).
- this version contains many enhancements see http://git.io/vtNwF
- * test/rubygems: ditto.
+ * tool/merger.rb: allow r0123 style revision number.
-Wed Jul 1 23:50:34 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Jan 3 11:17:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/net/http/test_httpresponse.rb
- (HTTPResponseTest#test_read_body_content_encoding_deflate_uppercase):
- fix a failure without zlib.
+ * tool/merger.rb (#version_up): version.h date should be Japanese
+ locale date.
-Wed Jul 1 10:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Jan 2 22:08:00 2012 Akinori MUSHA <knu@iDaemons.org>
- * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
+ * tool/file2lastrev.rb (VCS::detect): Add support for Subversion
+ 1.7 which adopted a whole new working directory structure.
-Wed Jul 1 09:30:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/file2lastrev.rb (VCS::detect): Simply use .each instead of
+ .sort.reverse_each which looks too arbitrary. If you want SVN
+ to be tried first, then you just have to register it first as it
+ is right now.
- * struct.c (struct_set_members): hide internal back_members
- object, and members object does not need to be duped as it
- should be frozen and hidden.
+Mon Jan 2 20:53:36 2012 Tanaka Akira <akr@fsij.org>
-Wed Jul 1 09:28:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/securerandom.rb (random_bytes): use IO#read instead of
+ IO#readpartial to make the intent more clear.
- * struct.c (struct_member_pos): revert r51080 to fix other
- implicit conversions but cast the return value to fix the
- previous implicit conversion.
+Mon Jan 2 15:26:39 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jul 1 08:47:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_object.rb (test_send_with_block): add a normal case.
- * struct.c (struct_member_pos): avoid implicit conversion loses
- integer precision: 'long' to 'int'.
+Mon Jan 2 15:18:54 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jul 1 05:57:03 2015 Eric Wong <e@80x24.org>
+ * test/ruby/test_object.rb (test_send_with_block): moved from
+ bootstraptest/test_flow.rb.
- * vm_method.c (rb_add_method_iseq): add RB_GC_GUARD
- * class.c (clone_method): remove RB_GC_GUARD
- * struct.c (define_aref_method): ditto
- (define_aset_method): ditto
- * vm.c (vm_define_method):
- * iseq.c (rb_iseq_clone): add RB_GC_GUARD
+Mon Jan 2 15:10:11 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Jul 1 05:43:58 2015 Eric Wong <e@80x24.org>
+ * lib/test/unit/parallel.rb: use pack("m0") instead of
+ pack("m").gsub("\n","").
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): ditto.
- * struct.c (AREF_HASH_THRESHOLD): new macro
- (id_back_members): new ID
- (struct_member_pos_ideal): new function
- (struct_member_pos_probe): ditto
- (struct_set_members): ditto
- (struct_member_pos): ditto
- (rb_struct_getmember): use struct_member_pos for O(1) access
- (rb_struct_aref_sym): ditto
- (rb_struct_aset_sym): ditto
- (setup_struct): call struct_set_members
- (struct_define_without_accessor): ditto
- (Init_Struct): initialize __members_back__
- [ruby-core:66851] [ruby-core:69705] [ruby-core:69821]
+Mon Jan 2 15:05:09 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Jun 30 23:12:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): use
+ File.basename with suffix instead of gsub.
- * io.c (rb_io_reopen): FilePathValue() ensures the path
- NUL-terminated and frozen, so it is unnecessary to make it shared.
+Mon Jan 2 14:55:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Jun 30 23:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): find may
+ return nil and nil can not dup.
- * dir.c (check_dirname): ensure path name NUL-terminated for
- SHARABLE_MIDDLE_SUBSTRING.
+Sun Jan 1 12:23:10 2012 Akinori MUSHA <knu@iDaemons.org>
- * io.c (rb_sysopen): ditto.
+ * lib/shellwords.rb (Shellwords#shellescape): Drop the //n flag
+ that only causes warnings with no real effect. [Bug #5637]
-Tue Jun 30 18:38:16 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Dec 31 06:28:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/file.c (rb_freopen): need to terminate by NUL.
+ * thread.c (rb_barrier_waiting): save the number of waiting threads
+ in RBASIC()->flags. [ruby-dev:45002] [Bug #5768]
-Tue Jun 30 17:28:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_barrier_wait): increment and decrement around
+ rb_mutex_lock, and use rb_barrier_waiting().
- * io.c (rb_io_reopen): freopen(3) with OS encoding path.
- [ruby-core:69780] [Bug #11320]
+ * thread.c (rb_barrier_release): use rb_barrier_waiting().
- * win32/file.c (rb_freopen): wrapper of wchar version freopen(3).
- use _wfreopen_s() if available.
+ * thread.c (rb_barrier_destroy): ditto.
-Tue Jun 30 08:24:08 2015 Eric Wong <e@80x24.org>
+Mon Dec 26 17:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_oflags_modestr): handle O_TRUNC correctly
- * test/ruby/test_io.rb (test_reopen_stdio): new test
- Patch-by: cremno phobia <cremno@mail.ru>
- [ruby-core:69779] [Bug #11319]
+ * vm.c (vm_exec): add guard to prevent optimization for LLVM clang.
-Tue Jun 30 02:47:02 2015 Eric Wong <e@80x24.org>
+Fri Dec 30 17:01:12 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * include/ruby/st.h (struct st_table): hide struct list_head
- * st.c (struct st_table_entry): adjust struct
- (head, tail): remove shortcut macros
- (st_head): new wrapper function
- (st_init_table_with_size): adjust to new struct and API
- (st_clear): ditto
- (add_direct): ditto
- (unpack_entries): ditto
- (rehash): ditto
- (st_copy): ditto
- (remove_entry): ditto
- (st_shift): ditto
- (st_foreach_check): ditto
- (st_foreach): ditto
- (get_keys): ditto
- (get_values): ditto
- (st_values_check): ditto
- (st_reverse_foreach_check): ditto (unused)
- (st_reverse_foreach): ditto (unused)
- [ruby-core:69726] [Misc #10278]
+ * vm_eval.c (rb_f_send): fix obj.send() documentation issue.
+ [Bug #5125] [ruby-core:38633]
-Mon Jun 29 17:38:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 29 22:36:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * insns.def (defineclass): do not quote unprintable characters at
- raising an exception.
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#_run_parallels): fix
+ premature exit when all workers' status are :ready or :prepare.
+ [ruby-dev:45061] [Bug #5822]
-Mon Jun 29 16:01:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 29 01:51:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/net/http/response.rb (inflater): CONTENT_ENCODING can be upper
- case. [ruby-core:69670] [Bug #11285] patched by Andy Chu
+ * include/ruby/ruby.h: fix #error pragma. LLP64 platform is supported.
-Mon Jun 29 14:50:08 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * include/ruby/st.h: ditto.
- * eval.c (add_activated_refinement): should not include the original
- class.
+Wed Dec 28 11:22:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 29 12:09:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/fileutils.rb (FileUtils::Entry_#entries): use utility method
+ instead of typoed regexp. [ruby-core:41829] [Bug #5817]
- * README.md: tweak styles. [fix GH-945][ci skip] Patch by @bryndyment
+Wed Dec 28 02:08:04 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Mon Jun 29 07:23:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (unknown_keyword_error): add GC guard to prevent
+ intermediate object from GC.
- * template/sizes.c.tmpl: extract RUBY_DEFINT to define sizes of
- types checked by configure.in, and fix size of intptr_t in
- universal binary.
+Tue Dec 27 22:34:54 2011 Shota Fukumori <sorah@tubusu.net>
-Mon Jun 29 02:10:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Worker#close): "closing IO if IO is closed"
+ should be "closing IO if IO isn't closed"
- * insns.def (defineclass): preserve encoding of name in error
- messages for super class mismatch.
+Tue Dec 27 22:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * insns.def (defineclass): preserve encoding of name in error
- messages for non-class super.
+ * st.c (st_update): new function to lookup the given key and
+ update the value. [ruby-dev:44998]
- * insns.def (defineclass): preserve encoding of name in error
- messages when already defined but type mismatch.
+Tue Dec 27 21:17:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 28 12:07:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * node.h (rb_args_info): change pre_args_num and post_args_num as
+ int, to match with rb_iseq_t.
- * class.c (rb_define_class_id_under): raise TypeError exception
- same as ruby level class definition when superclass mismatch.
+ * parse.y (new_args_gen): check overflow.
-Sun Jun 14 19:02:03 2015 Benoit Daloze <eregontp@gmail.com>
+Mon Dec 26 22:38:35 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/net/ftp.rb (makeport): close the TCPServer
- when sending the port fails.
+ * vm_insnhelper.c (unknown_keyword_error): make it kind a error
+ message when unknown keyword is given. It require more work.
+ See [ruby-core:40518] and [ruby-core:40541] in detail.
- * test/net/ftp/test_ftp.rb: test for above.
+Mon Dec 26 22:31:07 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Fri Jun 26 12:48:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments),
+ iseq.c (rb_iseq_parameters), vm_insnhelper.c
+ (vm_callee_setup_arg_complex): support Method#parameters for keyword
+ arguments. The provisional spec is what Benoit Daloze proposed.
+ [ruby-core:40541]
- * transcode.c (load_transcoder_entry): fix transcoder loading race
- condition, by waiting in require. [ruby-dev:49106] [Bug #11277]
+ * test/ruby/test_keyword.rb: add a test for above.
-Fri Jun 26 07:53:56 2015 Eric Wong <e@80x24.org>
+Mon Dec 26 22:15:27 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * enum.c (enum_minmax): simplify return value creation
- * test/ruby/test_enum.rb: test behavior on empty
- * hash.c (rb_hash_fetch_m): remove unnecessary volatile since r41597
- (env_reject_bang): trade volatile for GC guard
- (env_select): ditto
- (env_select_bang): ditto
- (env_keep_if): ditto
- (rb_env_clear): ditto
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments,
+ iseq_compile_each), vm_insnhelper.c (vm_callee_setup_arg_complex):
+ implement keyword arguments. See [ruby-core:40290]
+ The feature is promised to be included in 2.0, but the detail spec
+ is still under discussion; this commit is a springboard for further
+ discussion. Please try it and give us feedback.
+ This commit includes fixes for some problems reported by Benoit
+ Daloze <eregontp AT gmail.com> [ruby-core:40518] and Marc-Andre
+ Lafortune <ruby-core-mailing-list AT marc-andre.ca>
+ [ruby-core:41772].
-Thu Jun 25 21:24:28 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * iseq.c (iseq_free, prepare_iseq_build): bookkeeping.
- * test/-ext-/popen_deadlock/test_popen_deadlock.rb: test [Bug #11265]
+ * test/ruby/test_keyword.rb: add tests for keyword arguments.
- * ext/-test-/popen_deadlock/infinite_loop_dlsym.c: new ext to call
- dlsym(3) infinitely without GVL, used in the above test.
+ * test/ripper/dummyparser.rb (class DummyParser): temporal fix for
+ ripper test.
- * ext/-test-/popen_deadlock/extconf.rb: extconf.rb for the above
- ext. Currently, only enabled on Solaris (main target) and Linux
- (as a reference platform and for debugging the ext).
+Mon Dec 26 22:00:17 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Thu Jun 25 19:24:25 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * node.h, node.c, parse.y: implement a parser part for keyword
+ arguments.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * configure.in: not to use vfork on Solaris to avoid deadlock
- occurred in vfork(2) with multi-threading and dynamic linker
- on Solaris. [Bug #11265] [ruby-dev:49089]
+ * gc.c (gc_mark_children): bookkeeping.
-Thu Jun 25 18:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
+Mon Dec 26 21:03:18 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * test/lib/envutil.rb (Test::Unit::Assertions#assert_no_memory_leak):
- NO_MEMORY_LEAK_ENVS is moved to Memory::NO_MEMORY_LEAK_ENVS
- to reduce child executions during test-all on Solaris.
+ * node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use
+ struct rb_args_info instead of NODEs.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * test/lib/memory_status.rb (Memory::NO_MEMORY_LEAK_ENVS): ditto.
+ * node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping.
-Thu Jun 25 17:32:33 2015 Koichi Sasada <ko1@atdot.net>
+Mon Dec 26 20:59:51 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * vm_method.c (rb_method_entry_create): need to call
- method_definition_reset() if def is given.
+ * node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- Actually, `me' is a new object, so we don't need to call it.
- It is just to make sure.
+Mon Dec 26 22:01:19 2011 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * vm_method.c (method_definition_reset): remove duplicated insertion.
+ * io.c (rb_sys_fail_path): move the definition.
+ Move above for using it in set_binary_mode_with_seek_cur().
- * vm_method.c (rb_method_entry_clone): assign dst->def here,
- not in method_definition_reset().
+ * io.c (set_binary_mode_with_seek_cur): fix improper seek cursor.
+ Seeking file cursor with setting binary mode has possibility to
+ cause infinite loop. Fixed the bug and refined error handling.
+ Introduced at r34043.
-Thu Jun 25 16:44:54 2015 Koichi Sasada <ko1@atdot.net>
+ And cleanups as below.
+ Remove unnecessary parentheses of `fptr`.
+ Use return value of setmode().
- * vm_method.c: make a rb_method_definition_t data (def) *after* making
- a rb_method_entry_t data (me).
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_seek_with_setting_binmode): add a test for above.
+ [ruby-core:41671] [Bug #5714]
- Normally, `me' points `def'. Some Ruby objects pointed from `def'
- and objects are marked by `me' (mark_method_entry() in gc.c).
- However, `def' is built before making a `me', then nobody can mark
- objects pointed from `def' before making (and pointing from) `me'.
+Mon Dec 26 17:01:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- I hope this patch solve #11244.
+ * common.mk (LIBRUBY_A): depends on main.o since r33774.
+ [ruby-core:41786] [Bug #5796]
- * vm_method.c: remove `rb_' prefix from some static functions.
+Mon Dec 26 13:07:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * method.h (rb_method_entry_create): constify
+ * test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn't
+ accept the block argument.
- * gc.c (mark_method_entry): add checking `def' and
- `def->body.iseq.iseqptr' availability because they can be NULL.
+Mon Dec 26 13:06:52 2011 Shota Fukumori <sorah@tubusu.net>
-Thu Jun 25 14:14:16 2015 takiy33 <takiy33@gmail.com>
+ * lib/test/unit.rb: Avoid zombie processes on "--separate" option
+ added at r34121.
- * test/test_prime.rb (test_eratosthenes_works_fine_after_timeout):
- use spaces instead of TABs in ruby codes. [Fix GH-944]
+Mon Dec 26 04:01:23 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Thu Jun 25 07:08:35 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_cipher.c: Update and complete documentation.
- * gc.c (obj_info, method_type_name): show method type name in a string
- instead of a number.
+Sun Dec 25 23:16:11 2011 Shota Fukumori <sorah@tubusu.net>
-Thu Jun 25 06:49:25 2015 Koichi Sasada <ko1@atdot.net>
+ * test/testunit/test_parallel.rb (test_separate): Test for "--separate"
+ option (r34121)
- * gc.c (obj_info): show more details for T_IMEMO/imemo_ment.
+Sun Dec 25 22:39:49 2011 Shota Fukumori <sorah@tubusu.net>
-Thu Jun 25 06:40:46 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/test/unit.rb (_run_parallel):
+ New option "--separate" for test/unit; when running tests with this
+ option, a job process will be restarted after one test file has done.
+ This means all test files will run with separated process.
- * vm_method.c (rb_method_definition_reset): need a WB for
- VM_METHOD_TYPE_ATTRSET.
+ * lib/test/unit/parallel.rb: Fix for above. Now parallel.rb puts
+ "ready!" for first ready, "ready" for afters.
-Thu Jun 25 03:33:21 2015 Koichi Sasada <ko1@atdot.net>
+Sun Dec 25 00:02:15 2011 Luis Lavena <luislavena@gmail.com>
- * gc.c (RGENGC_OBJ_INFO, obj_info): add a macro to enable/disable
- rich obj_info() output.
+ * configure.in: change --with-ntver to --with-winnt-ver to be more
+ descriptive in the context. [ruby-core:41794]
- At the default, the value of RGENGC_OBJ_INFO is
- (RGENGC_DEBUG | RGENGC_CHECK_MODE).
+Sat Dec 24 23:25:15 2011 Luis Lavena <luislavena@gmail.com>
- * gc.c (RGENGC_OBJ_INFO): force enable it to debug #11244.
+ * configure.in: add --with-ntver option to match win32/configure.bat
+ functionality. Set 0x0501 as default. [ruby-core:35010]
+ [ruby-core:35035]
- * gc.c (gc_mark_ptr): print more details with obj_info().
+Sat Dec 24 12:38:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_mark_children): remove useless debug prints.
+ * proc.c (proc_call): get rid of optimization-out by clang.
-Thu Jun 25 02:40:33 2015 Eric Wong <e@80x24.org>
+ * proc.c (rb_proc_call, rb_proc_call_with_block): ditto.
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal):
- do not process kwargs in blocking mode
- * test/openssl/test_ssl.rb: test sysread
+Sat Dec 24 10:56:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 24 16:54:11 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/readline/readline.c (readline_readline): check if outstream
+ is closed to get rid of a bug of readline 6. [ruby-dev:45043]
+ [Bug #5803]
- * gc.c (gc_mark_children): add additional debug code for #11244.
+Sat Dec 24 06:59:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 24 16:05:42 2015 Eric Wong <e@80x24.org>
+ * test/readline/test_readline.rb (test_line_buffer__point): use
+ lambda not to exit entire method by "return". or "next" for
+ proc. [ruby-dev:45042] [Bug #5802]
- * string.c (rb_str_justify): use RB_GC_GUARD
+Sat Dec 24 01:20:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jun 24 14:25:17 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed
+ just before calling rb_call0.
- * gc.c (gc_mark_ptr): add a check code for #11244.
+ * bootstraptest/test_flow.rb: add a test for above.
- It should be removed later. But we can remain this check
- because it is only a branch.
+Sat Dec 24 00:55:16 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 24 12:49:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#initialize): warn if a block is given.
- * string.c (rb_fstring_cstr): new function to make a fstring from
- a string literal.
+Fri Dec 23 16:14:30 2011 TAKAO Kouji <kouji@takao7.net>
- * internal.h (rb_fstring_lit): new macro to make a fstring from a
- string literal.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ in Readline module with GNU Readline 6 case, Readline module
+ resets completion_append_character to " ", after it executes
+ completion. So, Readline module stores
+ completion_append_character, and Readline module always sets it
+ after Readline module executes completion. [ruby-dev:43456]
+ [Feature #4635]
- * include/ruby/intern.h (rb_strlen_lit): new macro to get the
- length of a string literal, borrowed from mruby/mruby@e4afd53.
+Fri Dec 23 15:59:05 2011 TAKAO Kouji <kouji@takao7.net>
-Wed Jun 24 12:21:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/readline/readline.c (Init_readline): libedit check
+ rl_getc_function only when rl_initialize() is called, and
+ using_history() call rl_initialize(). This assignment should be
+ placed before using_history(). [ruby-core:40641] [Bug #5539]
- * re.c: Update documentation for Regexp class.
- [fix GH-937][ci skip] Patch by @davydovanton
+Fri Dec 23 10:14:47 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 24 09:23:03 2015 Eric Wong <e@80x24.org>
+ * test/thread/test_queue.rb (test_thr_kill): show the number of loop
+ run when the test failed.
- * variable.c (generic_ivar_set): remove FL_ABLE check
- (gen_ivar_copy): ditto
- [ruby-core:69715]
+Fri Dec 23 09:23:48 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 24 08:28:15 2015 Eric Wong <e@80x24.org>
+ * test/test_pty.rb (test_pty_check_default): call PTY.check until
+ "cat" command is finished.
- * ext/socket/ancdata.c (bsock_recvmsg_internal): reduce stack use
- [ruby-core:69595] [Feature #11263]
+Fri Dec 23 06:03:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Jun 23 14:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk: add "check succeeded" message.
- * error.c (name_err_receiver): raise ArgumentError if no receiver
- is available on this exception object. [Feature #10881]
+ * README, README.ja: follow above change.
-Tue Jun 23 09:48:34 2015 Eric Wong <e@80x24.org>
+Fri Dec 23 06:00:39 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * dir.c (check_dirname): avoid volatile, use return value
- (dir_s_chroot, dir_s_mkdir, dir_s_rmdir): adjust callers
+ * ext/bigdecimal/bigdecimal.h: add satisfy cc-mode comment.
+ * util.c: ditto.
-Tue Jun 23 06:37:10 2015 Eric Wong <e@80x24.org>
+Fri Dec 23 00:08:25 2011 Tanaka Akira <akr@fsij.org>
- * struct.c (struct_ivar_get): cache member definition in a subclass
- Thanks to Sokolov Yura aka funny_falcon <funny.falcon@gmail.com>
- in https://bugs.ruby-lang.org/issues/10585
+ * test/test_pty.rb (test_pty_check_default): "cat" may not terminated
+ in the 0.1 second.
-Tue Jun 23 04:58:06 2015 Eric Wong <e@80x24.org>
+Thu Dec 22 23:37:25 2011 Tanaka Akira <akr@fsij.org>
- * benchmark/bm_vm2_struct_big_href_hi.rb: new benchmark
- * benchmark/bm_vm2_struct_big_href_lo.rb: ditto
- * benchmark/bm_vm2_struct_big_hset.rb: ditto
- * benchmark/bm_vm2_struct_small_href.rb: ditto
- * benchmark/bm_vm2_struct_small_hset.rb: ditto
- Thanks to Sokolov Yura aka funny_falcon <funny.falcon@gmail.com>
- in https://bugs.ruby-lang.org/issues/10585
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): don't test the
+ maximum sleep time. Ruby is not a real-time system.
-Mon Jun 22 18:08:48 2015 Naohisa Goto <ngotogenome@gmail.com>
+Thu Dec 22 22:37:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/lib/test/unit.rb (Test::Unit::Parallel#start_watchdog): removed
- because it has been meaningless since r36385. [Bug #11288]
+ * thread_pthread.c (ping_signal_thread_list): remove return value.
+ * thread_pthread.c (check_signal_thread_list): add a new function to
+ check if signal thread list is empty.
+ * thread_pthread.c (thread_timer): check signal thread list after
+ timer_thread_function(). main thread might be added into signal thread
+ list during timer_thread_function().
- * test/lib/test/unit.rb (Test::Unit::Parallel#_run_parallel): delete
- lines related to the removed start_watchdog method
+Thu Dec 22 00:40:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Sun Jun 21 23:52:46 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assigned
+ but unused variables.
- * NEWS: mention about Array#bsearch_index and Hash#fetch_values.
+Wed Dec 21 18:28:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jun 21 23:46:27 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * common.mk (newline.c, miniprelude.c): revert r33949 because the change
+ broke mswin build, and the changer said no reason about the change.
+ [ruby-dev:45016] [Bug #5783]
- * NEWS: add a reference to a ticket.
+Wed Dec 21 12:35:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 21 20:28:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follow
+ Allocation Framework. [Bug #5775]
- * internal.h (roomof): extract from type_roomof, and move from
- bignum.c.
+Wed Dec 21 02:25:36 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jun 21 18:32:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/emitter.c: fixing clang warnings. Thanks Joey!
- * ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not
- via size_t, to suppress a warning by mingw gcc.
+Wed Dec 21 01:06:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun Jun 21 05:31:41 2015 Shota Fukumori <her@sorah.jp>
+ * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * ext/socket/ancdata.c: ditto
+ * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
+ * test/syck/test_yaml.rb: ditto
+ * doc/ChangeLog-1.9.3: ditto
- * ext/objspace/objspace_dump.c(dump_object): Return empty JSON object when
- passed object is a special const, instead of SEGV.
- Based patch by Kohei Suzuki (eagletmt). [ruby-core:69692] [Bug #11291]
+Tue Dec 20 23:50:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix.
+ * PStore content update perf optimization. Patch by Masaki Matsushita.
+ See #5248.
+ * lib/pstore.rb (save_data):
-Sat Jun 20 03:56:58 2015 Yusuke Endoh <mame@ruby-lang.org>
+ * Delete inadequate Marshal check.
- * enc/make_encmake.rb: the list of encoding extension libraries must
- not include encinit.c itself. It caused "undefined reference to
- Init_encinit".
+ * Deferred file truncation: when writing the new content, truncate
+ the saved file to the data size after writing the data, instead of
+ truncating whole bytes before writing data.
-Sat Jun 20 02:03:53 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * Deferred MD5 calculation: when comparing MD5 hash to check the
+ content modification, calculate MD5 hash of new data iif the
+ content length is differ from the old one.
- * process.c (rb_execarg_parent_start1): new macro ALWAYS_NEED_ENVP
- to generate envp_str anytime on Solaris 10 (or earlier version
- of Solaris) to avoid calling execv() which is async-signal unsafe
- on Solaris 10. [Bug #11265] [ruby-dev:49089]
+ * Compare content size with String#bytesize instead of String#size.
- * process.c (exec_with_sh, proc_exec_cmd): On Solaris 10,
- because ALWAYS_NEED_ENVP is 1 and envp_str is always generated,
- execv() in exec_with_sh() and proc_exec_cmd() are never called.
- To guarantee this, execv() is replaced by a macro to print
- out error message on Solaris 10.
+Tue Dec 20 21:00:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * process.c (proc_exec_sh): Because proc_exec_sh() may be called
- by rb_proc_exec() with envp_str = Qfalse, execl() is replaced
- by a macro that calls execle() with "extern char **environ"
- traditional global variable on Solaris 10.
- TODO: This may be unsafe and should be changed in the future.
- Although rb_proc_exec() is not used from inside current version
- of ruby, it may be called by third-party extensions.
+ * ext/date/date_core.c: uses to_integer instead.
+ * test/date/test_switch_hitter.rb: added a test.
-Sat Jun 20 01:10:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Dec 20 15:04:18 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * NEWS: mention about $SAFE.
+ * Make sure to clear $! when ignoring an exception
-Fri Jun 19 14:53:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl.c (ossl_pem_passwd_cb0, ossl_verify_cb):
+ pem_passwd_cb and verify_cb ignores the exception raised in a
+ callback proc so it should clear $! for subsequent execution.
- * proc.c (rb_mod_define_method): now requires a block direct to
- this method call. [ruby-core:69655] [Bug #11283]
+ That's said, both subsequent processes for pem_passwd_cb and
+ verify_cb raises another exception before leaking $! to Ruby world.
+ We cannot test this fix in Ruby land.
-Fri Jun 19 13:54:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_pkey_rsa.rb
+ (test_read_private_key_pem_pw_exception): Test for pem_passwd_cb +
+ exception.
- * proc.c (rb_mod_define_method): get rid of inadvertent ID
- creations at error.
+Tue Dec 20 11:49:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 19 07:58:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/date/test_date_base.rb (test_jd): tests for
+ [ruby-dev:45008].
- * ext/extmk.rb: if no with-ext option is given, default to
- enable everything. [ruby-dev:49108] [Bug #11280]
+Tue Dec 20 10:20:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 19 06:30:07 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/date/date_core.c (wholenum): fix the type of the return value.
- * bootstraptest/test_method.rb: remove a test because $SAFE=2 was
- obsolete.
+Tue Dec 20 05:03:24 2011 Eric Hodel <drbrain@segment7.net>
- Please check btest, too.
+ * README.ja: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * README: ditto
+ * common.mk: ditto
+ * man/erb.1: ditto
+ * man/irb.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ * sparc.c: ditto
+ * tool/install-sh: ditto
-Thu Jun 18 23:51:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Dec 20 02:15:18 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * bin/erb: $SAFE=3 is obsolete.
+ * ext/date/date_core.c: [ruby-dev:45008].
-Thu Jun 18 23:45:11 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sun Dec 18 18:52:37 2011 Naohisa Goto <ngotogenome@gmail.com>
- * safe.c: removed needless doc related $SAFE=2
+ * vm.c (vm_define_method): improve guard of iseq from GC. Fix
+ failure or segmentation fault in test_singleton_method(TestGc)
+ on sparc Solaris10 compiled with Oracle Solaris Studio 12.2.
+ [Bug #5762] [ruby-dev:45000] [Bug #4178]
-Thu Jun 18 23:38:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_thread_safe_level): fix document. $SAFE=3 is obsolete.
- [ci skip]
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
+ allocation framework right now. [ruby-core:41710] [Bug #5773]
-Thu Jun 18 23:25:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 18 12:42:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/extmk.rb: configure intersection of with-ext and not
- without-ext, as withouts is no longer true by default if
- with-ext option is given. [ruby-dev:49108] [Bug #11280]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
+ from YAML.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
+ to YAML.
+ * test/psych/test_numeric.rb: tests for BigDecimal serialization
-Thu Jun 18 23:20:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Dec 18 12:03:13 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * include/ruby/ruby.h: $SAFE=2 is now obsolete.
+ * ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
+ should be treated as strings and not dates.
- * dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c
- gc.c, io.c, process.c, safe.c, signal.c, win32/file.c:
- removed code for $SAFE=2
+ * test/psych/test_scalar_scanner.rb: corresponding tests.
- * test/erb/test_erb.rb, test/fiddle/test_handle.rb
- test/ruby/test_env.rb: removed tests for $SAFE=2.
+Sun Dec 18 09:43:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Jun 18 22:50:07 2015 Yusuke Endoh <mame@ruby-lang.org>
+ * test/thread/test_queue.rb (test_thr_kill): extend timeout.
+ this test takes a long time at slow machine.
- * enc/make_encmake.rb: added --transes and --no-transes options.
+Sun Dec 18 09:36:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Jun 18 18:24:12 2015 Eric Wong <e@80x24.org>
+ * test/ruby/envutil.rb (invoke_ruby): remove :timeout option before
+ pass it to Kernel#spawn.
- * test/socket/test_unix.rb: replace sleep with select
+Fri Dec 16 17:18:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net>
+ * README, README.ja: 'make check' is preferable to 'make test'.
- * vm.c (rb_vm_control_frame_id_and_class): remove useless codes.
- `me' knows ID and owner class.
+Thu Dec 15 23:16:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Jun 18 16:58:35 2015 Koichi Sasada <ko1@atdot.net>
+ * error.c (builtin_type_name): don't return pointer to the buffer of
+ temporary String object.
- * method.h: constify rb_method_alias_struct::original_me and
- rb_method_refined_struct::orig_me.
+Thu Dec 15 17:56:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (move_refined_method): use RB_OBJ_WRITE() for
- me->def->body.refined.orig_me.
+ * io.c (argf_type): make typed data.
-Thu Jun 18 14:35:28 2015 Koichi Sasada <ko1@atdot.net>
+Thu Dec 15 17:40:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.
+ * error.c (rb_check_type): fix typo.
-Thu Jun 18 13:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 15 14:48:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (name_err_receiver): add NameError#receiver method.
- [Feature #10881]
+ * ext/strscan/strscan.c: use typed data with
+ onig_region_memsize().
-Thu Jun 18 10:00:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 15 14:33:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * safe.c: removed needless doc related $SAFE=3
+ * error.c (rb_check_typeddata): refine error message with
+ including expected struct name.
-Thu Jun 18 09:59:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 15 13:15:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * safe.c: rename old method name for $SAFE=3
+ * regcomp.c (onig_region_memsize): implemented for memsize_of().
-Thu Jun 18 06:02:42 2015 Eric Wong <e@80x24.org>
+ * ext/objspace/objspace.c (memsize_of): use it.
- * compile.c (get_exception_sym2type, iseq_build_from_ary_body):
- rely on %+PRIsVALUE instead of calling rb_inspect directly
+Thu Dec 15 10:44:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 17 20:59:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
+ documentation from Thomas Leitner <t_leitner AT gmx.at> in
+ [ruby-core:41616]. [Bug #5752]
- * common.mk (ENC_MK): needs fake.rb if cross compilation.
- [ruby-dev:49098] [Bug #11272]
+Thu Dec 15 10:10:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 17 20:23:29 2015 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_require.rb (test_race_exception): get rid of
+ not-guaranteed timing issue. [ruby-core:41655] [Bug #5754]
- * ext/rbconfig/sizeof/extconf.rb: Check __float80.
+Wed Dec 14 21:58:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jun 17 15:15:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{read_with_binmode_and_get[cs]}): only for Windows.
- * safe.c (safe_setter): of course, don't have to warn the limitation of
- $SAFE=3 after it's removed.
+Wed Dec 14 19:57:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jun 17 14:29:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * common.mk,Makefile.in,win32/Makefile.sub (ECHO1): move platform
+ specific hack from common.mk to Makefile.in (and win32/Makefile.sub).
+ [Bug #5711]
- * include/ruby/ruby.h: $SAFE=3 is now obsolete.
+ * lib/mkmf.rb: we can generate Makefile as we like.
- * ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
- ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
- for $SAFE=3
+Wed Dec 14 19:22:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
- test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
- test/ruby/test_thread.rb: remove tests for $SAFE=3
+ * win32/win32.c, include/ruby/win32.h (rb_w32_fd_is_text): new function.
-Wed Jun 17 12:13:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * win32/win32.c (init_stdhandle): set default mode of stdin as binmode.
- * ChangeLog: added contributor name.
+ * io.c (set_binary_mode_with_seek_cur): new function to replace
+ SET_BINARY_MODE_WITH_SEEK_CUR macro. now returns previous mode of the
+ fd and take care of LF in rbuf.
-Wed Jun 17 10:57:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * io.c (do_writeconv): set text mode when needed.
- * lib/csv.rb: accept to use Range object for row selection.
- contributed by Mitsutaka Mimura.
- [Feature #11267][ruby-dev:49091]
+ * io.c (io_read): need to change the mode of the IO to binmode
+ temporally when the length for IO#read, because IO#read with length
+ must behave so.
-Wed Jun 17 09:50:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{read_with_length,
+ read_with_length_binmode,get[cs]_and_read_with_binmode,
+ read_with_binmode_and_get[cs],read_write_with_binmode}): tests for
+ above changes.
- * lib/rdoc/servlet.rb (documentation_search, root_search):
- requires json for JSON.dump and fix sporadic failures due to
- the loading order.
+ all patches are written by Hiroshi Shirosaki. [ruby-core:41496]
+ [Feature #5714]
-Tue Jun 16 19:19:53 2015 Tanaka Akira <akr@fsij.org>
+Wed Dec 14 15:28:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/rbconfig/sizeof/extconf.rb: Check several types defined in C99
- and x86_64 ABI.
+ * transcode.c (str_encode): about the extension of :fallback
+ option since 1.9.3.
- * template/sizes.c.tmpl: Relax a pattern for types.
+Wed Dec 14 12:19:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 16 17:37:01 2015 Koichi Sasada <ko1@atdot.net>
+ * load.c (load_unlock): release loading barrier and then remove it
+ from loading_table if it is not in-use. [Bug #5754]
- * test/objspace/test_objspace.rb: relax pattern because uncollectible
- flag and marked flag can be false at major GC.
- [Bug #10852]
+ * thread.c (rb_barrier_release, rb_barrier_destroy): return
+ whether any other threads are waiting on it.
-Tue Jun 16 04:50:44 2015 Eric Wong <e@80x24.org>
+Wed Dec 14 11:23:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/socket/basicsocket.c (bsock_recv): document outbuf
- * ext/socket/unixsocket.c (unix_recvfrom): ditto
- * ext/socket/init.c (rsock_strbuf, recvfrom_locktmp): new functions
- (rsock_s_recvfrom): support destination buffer as 3rd arg
- (rsock_s_recvfrom_nonblock): ditto
- * string.c (rb_str_locktmp_ensure): export for internal ext
- * test/socket/test_nonblock.rb: test recv_nonblock
- * test/socket/test_unix.rb: test recv
- [ruby-core:69543] [Feature #11242]
+ * thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
+ only when it is not timer_thread. [Bug #5757] [ruby-dev:44985]
+ patched by Tomoyuki Chikanaga.
-Tue Jun 16 04:38:02 2015 Eric Wong <e@80x24.org>
+Wed Dec 14 10:20:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/ancdata.c (bsock_sendmsg_internal,
- bsock_recvmsg_internal):
- support "exception: false" kwarg
- * ext/socket/init.c (rsock_s_recvfrom_nonblock):
- ditto
- * ext/socket/init.c (rsock_s_recvfrom_nonblock): use rsock_opt_false_p
- * ext/socket/socket.c (sock_connect_nonblock): ditto
- * ext/socket/rubysocket.h (rsock_opt_false_p): new function
- * ext/socket/basicsocket.c (bsock_recv_nonblock): update rdoc
- * ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
- * test/socket/test_nonblock.rb: new tests
- [ruby-core:69542] [Feature #11229]
+ * load.c (load_lock): delete the loading barrier if it has been
+ destroyed.
-Mon Jun 15 14:33:02 2015 Akinori MUSHA <knu@iDaemons.org>
+ * thread.c (rb_barrier_wait): return nil for recursive lock
+ instead of false, to distinguish it from destroyed barrier.
- * lib/set.rb: Make Set#each and SortedSet#each generate a sized
- enumerator. [GH-931] by kachick (Kenichi Kamiya)
+Wed Dec 14 01:24:55 2011 okkez <okkez000@gmail.com>
- * test/test_set.rb: Import tests from Set into SortedSet. [GH-931]
- by kachick (Kenichi Kamiya)
+ * thread_pthread.c (rb_thread_create_timer_thread): fix memory
+ leak. [ruby-dev:44904] [Bug #5688]
-Mon Jun 15 02:26:34 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 14 00:01:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP#connect): use connect_nonblock and
- io/wait to eliminate timeout use. fix GH-899
+ * parse.y (primary): point method name line. [ruby-core:40936]
+ [Bug #5614]
-Sat Jun 13 07:21:18 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Dec 13 23:43:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * thread.c (thread_start_func_2): don't interrupt when last thread
- exit unless main thread is already exited. Otherwise main thread
- could be wrongly interrupted when it uses rb_thread_call_without_gvl().
- Patch by Takehiro Kubo. [Bug #11237][ruby-dev:49044][GH-898]
+ * error.c (name_err_mesg_to_str): clear rb_thread_t::errinfo when
+ ignore exception under rb_protect(). [ruby-core:41612] [Bug #5755]
- * test/-ext-/gvl/test_last_thread.rb: new test for the above fix.
+ * test/ruby/test_exception.rb (test_exception_in_name_error_to_str):
+ add a corresponding test.
- * ext/-test-/gvl/call_without_gvl/call_without_gvl.c: new ext for
- the above test.
- * ext/-test-/gvl/call_without_gvl/extconf.rb: ditto.
+Tue Dec 13 16:13:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 15 00:14:33 2015 Tanaka Akira <akr@fsij.org>
+ * load.c (load_unlock): all threads requiring one file should
+ share same loading barrier, so it must be kept alive while those
+ are waiting on it. [ruby-core:41618] [Bug #5754]
- * ext/pathname/lib/pathname.rb (descend): Blockless form supported.
- (ascend): Ditto.
- [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski.
+Tue Dec 13 07:30:14 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jun 14 20:09:25 2015 Tanaka Akira <akr@fsij.org>
+ * lib/webrick/httpresponse.rb (setup_header): 1xx responses
+ are allowed to have Keep-Alive connections.
- * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
- formats.
- [ruby-core:68306] [Misc #10905] Patch by Charles Korn.
+ * test/webrick/test_httpresponse.rb: corresponding test.
-Sun Jun 14 18:49:56 2015 Tanaka Akira <akr@fsij.org>
+Tue Dec 13 07:13:28 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/socket/raddrinfo.c (parse_numeric_port): Detect
- port overflow.
- (numeric_getaddrinfo): Use parse_numeric_port.
- numeric_getaddrinfo fails if port is too big now.
- This makes rb_getaddrinfo invokes the real getaddrinfo()
- on such condition.
- This change is related to [ruby-core:69355] [Bug #11179].
+ * lib/webrick/httpresponse.rb (setup_header): 204 and 304 responses
+ are allowed to have a Keep-Alive connection. [ruby-core:41581]
-Sun Jun 14 17:26:03 2015 Tanaka Akira <akr@fsij.org>
+ * test/webrick/test_httpresponse.rb: corresponding test.
- * enum.c (enum_chunk_while): New method Enumerable#chunk_while.
- [ruby-core:67738] [Feature #10769] proposed by Tsuyoshi Sawada.
+Tue Dec 13 06:29:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 14 17:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (parser_magic_comment): should pass the proper value.
+ [ruby-dev:44984][Bug #5753]
- * file.c (rb_file_load_ok): try opening file without gvl not to
- lock entire process. [Bug #11060]
+Tue Dec 13 05:50:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 14 10:43:50 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c (vm_yield_setup_block_args): splat single
+ argument if optional arguments are defined not only mandatory or
+ post arguments. [ruby-core:41557] [Bug #5730]
- * tool/runruby.rb: just remove the lines of RUBY_VERSION check and raise
- instead of replacing the check to `true`, for getting rid of a
- warning `possibly useless use of true in void context`.
+Mon Dec 12 22:35:39 2011 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jun 14 10:13:55 2015 Kouhei Sutou <kou@cozmixng.org>
+ * parse.y (stmt_or_begin): changed the error message for BEGIN not
+ at toplevel. [ruby-dev:44963] [Bug #5738]
- * lib/rexml/source.rb (REXML::IOSource#scan): Fix a typo in
- document. [fix GH-934]
- Patch by Anton Davydov. Thanks!!!
+Mon Dec 12 17:29:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jun 14 10:09:48 2015 Kouhei Sutou <kou@cozmixng.org>
+ * README: Fixed SupportedPlatforms URL in the README.
+ patched by eMxyzptlk. https://github.com/ruby/ruby/pull/62
- * lib/rexml/attlistdecl.rb (REXML::AttlistDecl): Fix a typo in
- document. [fix GH-934]
- Patch by Anton Davydov. Thanks!!!
+Mon Dec 12 17:26:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 14 06:24:57 2015 Benoit Daloze <eregontp@gmail.com>
+ * load.c (rb_feature_p): lazy assigned load_path searched in
+ loading_table were not expanded, but all features, pushed to
+ loading table, are expanded. a patch by Yura Sokolov
+ <funny.falcon AT gmail.com> in [ruby-core:41545]. [Bug #5727]
- * test/ruby/test_io.rb: add test for IO.binread fd leak.
- See r50881.
+Mon Dec 12 15:41:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 14 05:23:51 2015 Benoit Daloze <eregontp@gmail.com>
+ * ext/stringio/stringio.c (strio_truncate): fix typo. patched by
+ Nick Howard <ndh AT baroquebobcat.com>.
+ https://github.com/ruby/ruby/pull/65
- * io.c (rb_io_s_binread): close fd if seek offset is invalid.
+Sun Dec 11 12:19:17 2011 Shugo Maeda <shugo@ruby-lang.org>
-Sun Jun 14 04:40:32 2015 Benoit Daloze <eregontp@gmail.com>
+ * lib/net/imap.rb: includes the sequence number of UID in a error
+ message. suggested by art lussos.
+ [ruby-core:41413] [Feature #5692]
- * test/lib/leakchecker.rb (check): refactor.
+Sun Dec 11 11:42:10 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Sun Jun 14 04:34:14 2015 Benoit Daloze <eregontp@gmail.com>
+ * ext/syslog/syslog.c: fix a typo. [ruby-core:41585] [Bug #5740]
- * test/lib/leakchecker.rb: Return false for no leaks.
- Otherwise the GC could run for nothing.
+Sun Dec 11 10:48:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 14 04:15:40 2015 Benoit Daloze <eregontp@gmail.com>
+ * error.c (exit_initialize): deal with true and false as well as
+ Kernel#exit. [ruby-dev:44951] [Bug #5728]
- * lib/delegate.rb: [DOC] Update SimpleDelegator example. [ci skip]
+Sun Dec 11 10:37:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 13 20:28:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * object.c (rb_check_to_int): new function to convert a VALUE to
+ an Integer if possible, but returns nil instead of raising an
+ exception otherwise.
- * file.c (rb_stat_ino): get inode from the interval of struct st.
+Sun Dec 11 10:34:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (stati64_set_inode): get nFileIndexHigh/Low, and set it
- to the interval of struct st as inode.
- [Feature #11216]
+ * process.c (rb_exit_status_code): extract from rb_f_exit_bang and
+ rb_f_exit. assume 0 to be success in Kernel#exit! too.
- * win32/win32.c (stati64_set_inode_handle): call stati64_set_inode.
+Fri Dec 9 19:24:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (rb_w32_fstati64): call stati64_set_inode_handle.
+ * enc/trans/iso-8859-16-tbl.rb: add ISO-8859-16 converter.
- * win32/win32.c (stati64_handle): call stati64_set_inode.
+ * enc/trans/single_byte.trans: ditto.
-Sat Jun 13 19:44:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Dec 9 14:28:40 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/io/console/depend (.list.chksum): revert a part of r50859, because
- it was not mentioned at its commit log and it caused a build error on
- Windows ($(MAKE) is already quoted).
+ * file.c (file_path_convert): don't convert it when the path string is
+ ascii only. [ruby-core:41556] [Bug #5733]
+ tests are contributed by nobu.
-Sat Jun 13 17:35:11 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Dec 9 08:00:15 2011 Luis Lavena <luislavena@gmail.com>
- * vm_core.h (rb_thread_t): add th->name.
+ * include/ruby/win32.h: undef stat to silence mingw-w64 stat
+ redefinition warnings (GCC 4.6.3).
- * vm.c (th_init): initialize th->name.
+Thu Dec 8 23:38:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * thread.c (Init_Thread): add Thread.name and name=. [Feature #11251]
+ * variable.c (set_const_visibility): clear inline-cache when constant's
+ visibility is modified. [ruby-dev:44929]
- * thread.c (rb_thread_inspect): show thread's name if set.
+ * test/ruby/test_module.rb (test_private_constants_clear_inlinecache):
+ add test for it.
- * thread.c (rb_thread_getname): defined.
+Thu Dec 8 23:26:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c (rb_thread_setname): ditto.
+ * ext/extmk.rb (extract_makefile): should sort after map, not before
+ it. in this case there is no difference, but we should write better
+ code. this bad smell was caught by nagachika.
-Sat Jun 13 11:39:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 8 22:31:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/tempfile.rb: Fix typo. [fix GH-933] Patch by @Zorbash
+ * ext/extmk.rb (extract_makefile): need to sort the array of current
+ srcs before comparing to the sorted old srcs.
+ fixed the problem that the configuring stage of exts were always
+ run, introduced at r33801.
-Sat Jun 13 11:38:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 8 13:26:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_ocsp.c: fix documentation on ocsp response cert status.
- [fix GH-932] Patch by @chrisholmes
+ * test/rexml/test_order.rb (OrderTester#test_more_ordering): use
+ Zlib::GzipReader.open instead of Zlib::GzipReader.new with File.new.
+ fixed a test error on Windows introduced at r33946.
-Sat Jun 13 11:35:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Thu Dec 8 13:11:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem.
- [fix GH-929] Patch by @voxik
- * ext/io/console/io-console.gemspec: ditto.
+ * test/ruby/test_process.rb (TestProcess#test_sete[gu]id): silently
+ skip if not implemented such functions (such as, on Windows).
+ fixed test errors on Windows introduced at r33953.
-Sat Jun 13 00:45:08 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Thu Dec 8 12:57:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/prime.rb: Return sized enumerators.
- Patch by Kenichi Kamiya [GH-931]
+ * ext/socket/extconf.rb: forgotten to define HAVE_SOCKETPAIR for
+ windows.
+ fixed test errors on Windows introduced at r33947.
-Sat Jun 13 00:45:06 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Thu Dec 8 12:11:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/prime.rb: Fix with_object with no block given
+ * configure.in (RUBY_WERROR_FLAG): append all warning flags which
+ are enabled to compile, so that printf format modifiers properly
+ fail. [ruby-core:41351] [Bug #5679]
-Sat Jun 13 00:44:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Thu Dec 8 07:20:15 2011 Eric Hodel <drbrain@segment7.net>
- * lib/prime.rb: Have with_index accept an offset parameter.
- Based on patch by T Yamada. [#11007]
+ * doc/re.rdoc: Document difference between match and =~, options with
+ Regexp.new and global variables. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5709]
-Fri Jun 12 22:21:12 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Thu Dec 8 06:53:10 2011 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_extlibs.rb (TestExtLibs::check_existence): fix
- error. [Bug #11255] [ruby-dev:49079]
+ * doc/re.rdoc: Fix example code to match documentation. Patch by
+ Jarno Lamberg. [Ruby 1.9 - Bug #5624]
-Fri Jun 12 21:17:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Dec 7 19:04:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (pack_{un,}pack): new template character `j` and `J`, pointer
- with signed and unsigned integers.
+ * configure.in (rpath): fix typo in the help string. a patch from
+ Yuji Yamano <yyamano AT kt.rim.or.jp> in [ruby-list:48568].
- * NEWS: mention about this feature.
- [Feature #11215] [ruby-dev:49015]
+Wed Dec 7 18:55:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 12 21:01:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c (vm_set_top_stack, vm_set_eval_stack): check for stack
+ overflow with stack_max before push new frame. [ruby-core:41520]
+ [Bug #5720]
- * file.c (File::SHARE_DELETE): new flag to be able to delete opened file
- on Windows.
+ * vm.c (vm_set_main_stack): no stack overflow chances after
+ vm_set_eval_stack().
- * include/win32/win32.c (O_SHARE_DELETE): new pseudo file mode flag.
+Wed Dec 7 09:58:15 2011 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (rb_w32_{w,}open): support above flag. [EXPERIMENTAL]
+ * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.
+ Patch by Sylvain Daubert. [Ruby 1.9 - Feature #5622]
- * NEWS: mention about this feature.
- [Feature #11218] [ruby-dev:49022]
+Wed Dec 7 09:48:00 2011 Eric Hodel <drbrain@segment7.net>
-Fri Jun 12 18:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
+ * ext/io/console/console.c: Mention that io/console must be required
+ similar to lib/time.rb
- * ChangeLog: added missing commit message.
+Wed Dec 7 08:04:31 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Jun 12 18:20:37 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/psych/lib/psych.rb (module Psych): parse and load methods take
+ an optional file name that is used when raising Psych::SyntaxError
+ exceptions
+ * ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
+ names and handle nil file names in the exception message
+ * test/psych/test_exception.rb (module Psych): Tests for changes.
- * sample/exyacc.rb: Fix some typos. [fix GH-927] Patch by @davydovanton
- * sample/list.rb: ditto.
- * sample/trick2013/kinaba/remarks.markdown: ditto.
+Tue Dec 6 18:26:33 2011 Tanaka Akira <akr@fsij.org>
-Fri Jun 12 17:34:14 2015 Wojciech Mach <wojtek@wojtekmach.pl>
+ * ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING to
+ detect runtime Berkeley DB version.
+ use dpversion instead of _QDBM_VERSION to detect runtime QDBM
+ version.
+ [ruby-dev:44948]
- * hash.c (rb_hash_fetch_values): add `Hash#fetch_values`.
- [Feature #10017] [Fix GH-776]
+Tue Dec 6 12:30:41 2011 Tanaka Akira <akr@fsij.org>
-Fri Jun 12 16:28:17 2015 Radan Skoric <radan.skoric@gmail.com>
+ * ext/dbm/extconf.rb: detect gdbm_version in libgdbm.
- * array.c (rb_ary_bsearch_index): Implement Array#bsearch_index
- method, which is similar to bsearch and returns the index or
- nil. [Feature #10730]
+ * ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and
+ Berkeley DB 1.x. [ruby-dev:44944]
-Thu Jun 11 19:11:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Tue Dec 6 07:26:37 2011 Eric Hodel <drbrain@segment7.net>
- * ext/zlib/zlib.c: Fix indentation for rdoc.
- [Bug #11221][ruby-core:69465]
+ * range.c: Improve documentation for Range. Patch by Chris Zetter.
+ [Ruby 1.9 - Bug #5656]
-Thu Jun 11 16:23:37 2015 Koichi Sasada <ko1@atdot.net>
+Mon Dec 5 19:08:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * method.h (METHOD_ENTRY_BASIC_SET): fix last commit (unbalanced parens).
+ * regparse.c (PFETCH_READY): separate gcc specific trick.
-Thu Jun 11 15:14:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Dec 5 19:01:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: define SET_THREAD_NAME if it has pthread_set_name_np
- for FreeBSD, and don't define it if both pthread_setname_np
- and pthread_set_name_np don't exist.
+ * process.c (proc_seteuid_m): fix argument.
- * thread_pthread.c (SET_THREAD_NAME): don't define if they don't exist.
+ * test/ruby/test_process.rb (test_geteuid): fix typo.
- * thread_pthread.c (native_set_thread_name): run if SET_THREAD_NAME
- is defined.
+ * test/ruby/test_process.rb (test_getegid, test_set[eg]uid): add.
-Thu Jun 11 15:53:31 2015 Koichi Sasada <ko1@atdot.net>
+Mon Dec 5 18:56:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * method.h (METHOD_ENTRY_BASIC_SET): should clear last bit.
+ * bignum.c (big_rshift), compile.c (validate_label,
+ iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
+ (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
+ (rb_io_advise), parse.y (parser_compile_string)
+ (rb_parser_compile_file), proc.c (binding_free), process.c
+ (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
+ (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
+ signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
+ vm_insnhelper.c (vm_expandarray): suppress
+ unused-but-set-variable warnings.
-Thu Jun 11 14:34:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * class.c (rb_obj_methods), compile.c (iseq_compile_each),
+ iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
+ regcomp.c (is_not_included, update_string_node_case_fold),
+ transcode.c (rb_econv_open0, make_replacement),
+ vm_eval.c (raise_method_missing): remove unused variable.
- * lib/rubygems.rb: bump version to 2.4.7 and 2.4.8. these versions fixed
- CVE-2015-3900.
- * lib/rubygems/remote_fetcher.rb: ditto.
- * test/rubygems/test_gem_remote_fetcher.rb: added testcase for CVE-2015-3900
+ * signal.c (reserved_signal_p): static.
-Thu Jun 11 14:18:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Dec 5 14:27:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rubygems.rb: bump version to 2.4.6. It's missing change at r49774.
+ * include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revert
+ r33876. [ruby-core:41475] [Bug #5706]
-Thu Jun 11 13:50:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/extconf.rb: the alternative hack for [Bug #5675].
- * array.c (ary_ensure_room_for_push): check if array size will
- exceed maximum size to get rid of buffer overflow.
- [ruby-dev:49043] [Bug #11235]
+Mon Dec 5 10:18:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (ary_ensure_room_for_unshift, rb_ary_splice): ditto.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
+ 1st, to change the mode of an IO is very sensitive problem, so
+ the maintainer of this library should judge it.
+ 2nd, usually Zlib::GzipReader.new is not called directly. #initialize
+ is called via .open, and in the method the I/O is opened in binary
+ mode, so there is no problem without changing the mode in #initialize.
-Thu Jun 11 13:17:34 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 4 22:53:12 2011 Tanaka Akira <akr@fsij.org>
- * test/test_cmath.rb (TestCMath#test_trigonometric_functions): should
- not compare float values (in complex values) by `==`.
+ * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197]
-Thu Jun 11 08:52:01 2015 Koichi Sasada <ko1@atdot.net>
+Sun Dec 4 22:34:43 2011 Tanaka Akira <akr@fsij.org>
- * method.h: embed rb_method_entry_t::attr::flags (5 bits) into
- rb_method_entry_t::flags to make one word spare space.
+ * lib/tempfile.rb (Tempfile::MAX_TRY): remove unused constant.
- Add some macros to access these flags.
+Sun Dec 4 12:11:28 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * vm_method.c: use these macros.
+ * lib/pp.rb: fix rdoc.
- * internal.h: define IMEMO_FL_USHIFT and IMEMO_FL_USER[0-4]
- for T_IMEMO local flags.
+Sun Dec 4 12:03:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jun 11 08:27:06 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/delegate.rb (Delegator#methods): Kernel#methods receives
+ zero or one argument. [ruby-core:37118] [Bug #4882]
- * vm.c: use VM_ASSERT instead of assert().
+Sun Dec 4 10:15:00 2011 Luis Lavena <luislavena@gmail.com>
- * vm_args.c: ditto.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): use binary mode by default
+ under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706]
+ [Feature #5562]
- * vm_insnhelper.c: ditto.
+ * include/ruby/encoding.h (void rb_econv_binmode): define NEWLINE
+ decorator.
- * vm_method.c: ditto.
+ * io.c (rb_cloexec_fcntl_dupfd): Introduce NEED_READCONV and
+ NEED_WRITECONV to replace universal newline decorator by CRLF only
+ when required to improve file reading and writing under Windows.
+ Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]
+ * io.c (do_writeconv): adjust binary mode if required.
+ * io.c (read_all, appendline, swallow, rb_io_getline_1): ditto.
+ * io.c (io_getc, rb_io_each_codepoint, rb_io_ungetc): ditto.
+ * io.c (rb_io_binmode, rb_io_ascii8bit_binmode): ditto.
+ * io.c (rb_io_extract_modeenc, rb_sysopen): ditto.
+ * io.c (pipe_open, prep_stdio, io_encoding_set): ditto.
+ * io.c (rb_io_s_pipe, copy_stream_body): ditto.
-Thu Jun 11 08:16:48 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_io_m17n.rb (EOT): add test for pipe and stdin in
+ binary mode.
- * vm_core.h: define VM_ASSERT() for assertion
- enabled only when (VM_CHECK_MODE > 0).
+ * win32/win32.c (init_stdhandle): remove O_BINARY from stdhandle
+ initialization.
+ * win32/win32.c (rb_w32_write): use FTEXT mode accordingly.
- * vm_insnhelper.c: move definition VM_CHECK_MODE
- from vm_insnhelper.c to vm_core.h.
+Sat Dec 3 20:49:16 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * vm.c: remove <assert.h>
+ * variable.c (set_const_visibility): print a warning when no argument
+ is passwd to Module#private_constant. [ruby-list:48558]
-Thu Jun 11 06:46:07 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_method.c (set_method_visibility): ditto for
+ Module#private_class_method.
- * vm_insnhelper.c (check_frame): check type of cref_or_me first.
+Sat Dec 3 20:43:14 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Thu Jun 11 04:34:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * variable.c (set_const_visibility): Module#private_constant has
+ changed the visibility of only the first argument. Now it changes
+ all of them. [ruby-list:48558]
- * test/test_cmath.rb: Add some assertions.
+ * test/ruby/test_module.rb: add a test for above.
-Thu Jun 11 00:34:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 3 07:17:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * template/fake.rb.in: expanded macro result may have spaces
- between tokens. [ruby-dev:49047] [Bug #11243]
+ * Makefile.in (CFLAGS): append ARCH_FLAG.
-Wed Jun 10 22:27:32 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * configure.in (ARCH_FLAG): exclude from CFLAGS.
- * lib/mkmf.rb: revert r50804 because of build failure when specifying
- LDFLAGS during configure, observed on Solaris with GCC 4.6.
- [Bug #11245]
+ * configure.in (UNIVERSAL_INTS): include short int. fix for
+ test/mkmf.
-Wed Jun 10 21:59:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Fri Dec 2 15:48:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * README.ja.md: fix markup miss.
+ * ext/bigdecimal/bigdecimal.c (VpAllocReal): reduce extra frac.
-Wed Jun 10 11:06:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 2 15:41:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * template/fake.rb.in: turn into erb template from autoconf
- template to fake more accurately.
+ * configure.in: check whether -pie or -Wl,-pie is valid as
+ LDFLAGS. [ruby-core:41438] [Bug#5697]
- * common.mk (fake.rb): needs preprocessed file now.
+ * configure.in: use $linker_flag for LDFLAGS option which is not
+ limited to particular platforms.
- * version.c (Init_version): add dummy expression to
- RUBY_ENGINE_VERSION.
+Thu Dec 1 23:21:58 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Tue Jun 9 12:31:25 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) only if
+ PR_SET_NAME is available.
- * lib/prime.rb: Simplify and optimize EratosthenesSieve
+Thu Dec 1 22:31:16 2011 Tanaka Akira <akr@fsij.org>
-Tue Jun 9 11:45:00 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * io.c (linux_get_maxfd): change local variable name.
- * lib/prime.rb: Simplify and optimize EratosthenesSieve
- based on patch by Ajay Kumar. [Fixes GH-921]
+Thu Dec 1 16:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/extconf.rb: add arguments for macro calls.
+ [ruby-core:41370] [Bug#5681]
- * gc.c (obj_info): print method id for T_IMEMO/ment.
+Thu Dec 1 16:20:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 7 07:05:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * lib/mkmf.rb (MakeMakefile#try_func): fix broken patch at r33834.
- * Move test cases from test/ruby/test_complex.rb to test/test_cmath.rb
+Thu Dec 1 14:43:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 6 18:23:41 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
+ clang. [ruby-core:41418] [Bug#5693]
- * method.h: back to share rb_method_definition_t by
- rb_method_entry_t.
+Thu Dec 1 10:31:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- r50728 changed sharing `def's to isolating `def's
- on alias and so on. However, this change conflicts
- future improvement plan. So I change back to sharing approach.
+ * configure.in (LDFLAGS): -fstack-protector is always needed to
+ link static library created with it. [ruby-core:41387]
+ [Bug#5686]
- * method.h: move rb_method_definition_t::flags to
- rb_method_entry_t::attr::flags.
+Thu Dec 1 07:03:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- rb_method_entry_t::attr is union with VALUE because this field
- should have same size of VALUE. rb_method_entry_t is T_IMEMO).
+ * configure.in: add sys/prctl.h test.
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) to change
+ thread name. It may help to debug.
- And also add the following access macros to it's fields.
+Wed Nov 30 23:35:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * METHOD_ENTRY_VISI(me)
- * METHOD_ENTRY_BASIC(me)
- * METHOD_ENTRY_SAFE(me)
+ * variable.c (rb_path2class): don't raise NameError when the middle
+ constant of the path is not defined but defined on toplevel.
+ [ruby-core:41410] [Bug #5691]
- * vm_method.c (rb_method_definition_addref): added instead of
- rb_method_definition_clone().
+Wed Nov 30 20:02:02 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
- Do not create new definition, but increment alias_count.
+ * transcode.c: Simplified rb_econv_binmode, avoided a warning on cygwin.
- * class.c (clone_method): catch up this fix.
+Wed Nov 30 08:57:07 2011 Eric Hodel <drbrain@segment7.net>
- * class.c (method_entry_i): ditto.
+ * lib/mkmf.rb: Use MakeMakefile's rm_f to avoid conflict with Rake or
+ FileUtils.
+ * test/ruby/test_module.rb: Hide MakeMakefile's inclusion in Object
- * proc.c (mnew_internal): ditto.
+Wed Nov 30 09:12:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * proc.c (mnew_missing): ditto.
+ * lib/rdoc/encoding.rb (RDoc::Encoding.read_file): fixup newline chars
+ on Windows.
+ see https://github.com/rdoc/rdoc/issues/87
- * vm_eval.c: ditto.
+ * test/rdoc/test_rdoc_markup_pre_process.rb
+ (TestRDocMarkupPreProcess#test_include_file,
+ TestRDocMarkupPreProcess#test_include_file_encoding_incompatible):
+ follow above change.
- * vm_insnhelper.c: ditto.
+Wed Nov 30 09:09:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_method.c: ditto.
+ * ext/psych/parser.c (parse): parse method can take an option file
+ name for use in exception messages.
+ * test/psych/test_parser.rb: corresponding tests.
-Sat Jun 6 15:59:38 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 29 09:07:59 2011 Eric Hodel <drbrain@segment7.net>
- * class.c: ins_methods_push() needs rb_method_visibility_t type on
- 2nd arg.
+ * lib/mkmf.rb: Fix indentations of constants at end of module.
+ Document some constants.
-Sat Jun 6 15:05:47 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 29 09:58:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (ins_methods_push): Change type and name of parameters
- to make more clear.
+ * io.c (rb_write_error2): suppress unused variable warning.
-Sat Jun 6 08:52:13 2015 Eric Wong <e@80x24.org>
+Tue Nov 29 07:45:26 2011 Eric Hodel <drbrain@segment7.net>
- * test/socket/test_nonblock.rb: try to avoid EMSGSIZE
- [ruby-core:69466]
+ * lib/mkmf.rb: Wrap comments to 78 columns and clean up formatting.
-Sat Jun 6 07:58:30 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 29 05:54:18 2011 Eric Hodel <drbrain@segment7.net>
- * gc.c: remove struct mark_tbl_arg and pass objspace directly
- to avoid indirect access overhead.
+ * lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object
+ documentation. [Ruby 1.9 - Feature #5658]
+ * ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
+ * test/mkmf/base.rb: ditto
-Sat Jun 6 07:08:45 2015 Eric Wong <e@80x24.org>
+Tue Nov 29 00:08:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
+ * common.mk (INSTRUBY_ARGS): added --mantype to apply mdoc2man.rb
+ to man pages. Fixes #5598.
+ (do-install-nodoc, do-install-local, do-install-man,
+ dont-install-nodoc, dont-install-local, dont-install-man):
+ No longer needs --mantype.
-Sat Jun 6 01:00:06 2015 Naohisa Goto <ngotogenome@gmail.com>
+ Reported by Rainer Orth <ro AT cebitec.uni-bielefeld.de>,
+ patch by George Koehler <xkernigh AT netscape.net>.
- * ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments are
- parsed even on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL
- to prevent SEGV caused by passing Qnil to RARRAY_LENINT and
- to preserve behavior before r50776.
- [Bug #11224] [ruby-core:69468] [Bug #11225] [ruby-core:69469]
+Mon Nov 28 22:26:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jun 5 22:37:42 2015 Koichi Sasada <ko1@atdot.net>
+ * test/rake/test_rake_directory_task.rb
+ (TestRakeDirectoryTask#test_directory_win32): shouldn't create any
+ file/directory on root directory. create on @tempdir (= Dir.pwd).
+ see https://github.com/jimweirich/rake/issues/91
- * class.c (ins_methods_push): change 3rd parameter's type
- from long to rb_method_visibility_t.
+Mon Nov 28 12:57:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (ins_methods_i): catch up this fix.
+ * io.c (rb_write_error2): fwrite() returns ssize_t.
- * class.c (method_entry_i): cast to st_data_t instead of `long'.
+Mon Nov 28 12:47:19 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jun 5 20:37:10 2015 Koichi Sasada <ko1@atdot.net>
+ * parse.y (nodetype, nodeline): static. these functions are for
+ debugging, and not intend to be public.
- * internal.h: move definition of rb_cref_t to method.h.
+Mon Nov 28 12:37:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval_intern.h: move definition of rb_scope_visibility_t
- to method.h.
+ * gc.c (initial_params): static. it seems to be forgotten at r33501.
- * method.h: change rb_cref_t::scope_visi from VALUE to
- rb_scope_visibility_t.
- [Bug #11219]
+Mon Nov 28 12:32:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm.c (vm_cref_new): accept rb_method_visibility_t directly.
+ * include/ruby/win32.h, win32/win32.c (GetCurrentThreadHandle): remove
+ unused old API.
- * vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0,
- but METHOD_VISI_UNDEF.
+Mon Nov 28 12:29:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_method.c (rb_scope_visibility_set): don't need to use cast.
+ * win32/mkexports.rb (Exports#initialize): remove old symbol name.
- * vm_method.c (rb_scope_module_func_set): ditto.
+Mon Nov 28 12:15:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 5 17:27:30 2015 Eric Wong <e@80x24.org>
+ * win32/mkexports.rb (Exports#read_substitution): need to read
+ from subst.h too. [Bug #5675]
- * ext/socket/ancdata.c (bsock_sendmsg_internal): avoid msg_control
- ptr if msg_controllen is zero to fix portability problems.
+Mon Nov 28 11:46:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jun 5 09:17:45 2015 Eric Wong <e@80x24.org>
+ * io.c (rb_io_flush): release GVL during fsync() on Windows.
- * ext/socket/ancdata.c (bsock_sendmsg_internal): fix build error
- from r50776
+Mon Nov 28 11:00:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jun 5 07:05:58 2015 Eric Wong <e@80x24.org>
+ * include/ruby/subst.h: typo of r33876.
- * io.c (sym_wait_readable, sym_wait_writable): declare
- (io_getpartial): use sym_wait_readable
- (io_write_nonblock): use sym_wait_writable
- (Init_IO): initialize sym_wait_*able
+Mon Nov 28 10:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jun 5 06:43:00 2015 Eric Wong <e@80x24.org>
+ * include/ruby/subst.h: moved Windows specific substitutions from
+ win32.h.
- * doc/extension.rdoc: note rb_get_kwargs changes keywords_hash
- [ruby-core:68507]
+ * ext/socket/rubysocket.h: include ruby/subst.h. [Bug #5675]
-Fri Jun 5 05:50:29 2015 Eric Wong <e@80x24.org>
+Mon Nov 28 10:20:58 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_scan_args
- [ruby-core:69439] [Feature #11207]
+ * win32/{Makeilfe.sub,win32.c} (FILE_COUNT, FILE_READPTR): move the
+ definitions from config.h to win32.c. I dared to have left such
+ macros, for other future compiler support.
+ [ruby-core:41313] [Bug #5674]
-Fri Jun 5 02:20:06 2015 Koichi Sasada <ko1@atdot.net>
+Mon Nov 28 09:28:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/lib/envutil.rb (assert_no_memory_leak): change default value
- of limit from 1.5 to 2.0. It is ad-hoc fix to solve test failure
- in travis-ci.
+ * win32/win32.c (rb_w32_uchmod): typo. [Bug#5671] [ruby-dev:44898]
-Fri Jun 5 01:17:21 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_file.rb (TestFile#test_chmod_m17n): test of above bug.
- * vm_insnhelper.c (vm_defined): no need to use cast.
+Sun Nov 27 21:25:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jun 5 01:14:02 2015 Koichi Sasada <ko1@atdot.net>
+ * configure.in: added -fno-strict-overflow. it suppress annoying
+ -Wstrict-overflow warning.
- * vm_insnhelper.c (vm_defined): show additional messages on rb_bug().
+Sun Nov 27 20:58:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jun 5 01:06:02 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (rb_write_error2): get rid of warning on linux. fwrite
+ of glibc is tagged __attribute__ ((__warn_unused_result__))
+ if _FORTIFY_SOURCE != 0.
+ * vm_dump.c (rb_vm_bugreport): ditto.
- * vm_method.c (rb_add_method_iseq): use intermediate struct to
- avoid initializing struct with variables.
- [Bug #11217]
+Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * method.h: add a comment about it.
+ * configure.in (stack_protector): disable on mingw. [Bug#5676]
-Fri Jun 5 00:55:21 2015 Koichi Sasada <ko1@atdot.net>
+ * Makefile.in (DLDFLAGS): also needs -fstack-protector.
+ [Bug#5676]
- * method.h: constify rb_method_refined_t::orig_me.
+Sun Nov 27 14:13:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- Also constify the following functions.
+ * configure.in: add -fstack-protector into XLDFLAGS as well as
+ XCFLAGS if stack-protector is used.
- * rb_resolve_refined_method()
- * rb_method_entry_with_refinements()
- * rb_method_entry_without_refinements()
- * rb_method_entry_copy()'s parameter.
+Sun Nov 27 13:09:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * class.c: catch up this fix.
+ * configure.in: workaround to avoid MacOS X build error.
+ Maybe autoconf 2.61 is slightly buggy. [ruby-core:41316]
- * vm_insnhelper.c: ditto.
+Sun Nov 27 04:57:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_method.c: ditto.
+ * configure.in (--no-undefined): r33840 breaks FreeBSD and DragonFly
+ with gcc 4.4 or later. Their environ is in /usr/libexec/ld-elf.so.1,
+ so it will be false negative.
-Thu Jun 4 12:47:54 SGT 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Nov 27 04:55:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * array.c: Revert r50763. because "reentered" is not typo.
+ * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701.
+ SSL_ATTRIBUTES stores names for set_params, they are symbol.
+ SSL_IVNAMES stores instance variable names.
-Thu Jun 4 11:12:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Nov 27 00:16:07 2011 Tanaka Akira <akr@fsij.org>
- * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton
- [fix GH-923]
- * include/ruby/st.h: ditto.
- * include/ruby/util.h: ditto.
+ * io.c (copy_stream_body): use 0666 for permission argument for open.
+ [ruby-core:40865]
-Thu Jun 4 10:54:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sat Nov 26 23:01:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * array.c: fix a typo. Patch by @manish-shrivastava
- [fix GH-922]
+ * test/openssl/test_engine.rb: remove side effect of generic engine
+ load by explicitly loading software-based "openssl" engine for
+ all tests.
-Thu Jun 4 09:52:02 2015 Eric Wong <e@80x24.org>
+Sat Nov 26 20:41:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntl
- [ruby-core:69382] [Feature #11190]
+ * lib/net/http.rb (Net::HTTP.get_response): enable use_ssl
+ if given URI object is https.
+ patched by Mark Ferlatte [ruby-core:40665] [Bug #5545]
-Thu Jun 4 07:22:45 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/net/http.rb (Net::HTTP.post_form): ditto.
- * method.h: introduce rb_method_refined_t for refined method entry.
+Sat Nov 26 20:01:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c (move_refined_method): catch up this fix.
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): refix 33701.
+ store instance variable symbol names.
- * gc.c (mark_method_entry): ditto.
+Sat Nov 26 15:40:25 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * vm_eval.c (vm_call0_body): ditto.
+ * .travis.yml (script): should be ./configure
- * vm_insnhelper.c (vm_call_method): ditto.
+Sat Nov 26 15:39:18 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * vm_method.c: ditto.
+ * .travis.yml (before_script): wrong name, sorry.
-Thu Jun 4 07:12:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 26 15:31:34 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * dir.c (dirent_match): match short names only when FNM_SHORTNAME
- flag is given, for the backward compatibility, and the new
- behavior is often dangerous. [ruby-core:69435] [Bug #11206]
+ * .travis.yml (before-script): autoconf required.
-Thu Jun 4 05:44:01 2015 Eric Wong <e@80x24.org>
+Sat Nov 26 15:24:05 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * 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
- [ruby-core:69441] [Feature #11208]
+ * .travis.yml: Travis enable.
-Thu Jun 4 05:13:34 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 26 10:47:50 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_insnhelper.c (def_iseq_ptr): `iseqval' is not available any more.
+ * ext/openssl/extconf.rb: remove checks for available functions.
+ * ext/openssl/missing.h: ditto.
+ Thanks, Tim Mooney for reporting this!
+ [Bug #5432] [ruby-core:40088]
-Thu Jun 4 04:50:12 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 26 10:22:28 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * class.c (method_entry_i): mtbl should not have `me' as NULL.
+ * ext/openssl/ossl_ssl.c: add comment on where to find implementation
+ of OpenSSL::SSL::SSLSocket#session.
-Thu Jun 4 04:28:45 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 26 05:00:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (clone_method): do not use me->klass, but use explicitly
- passed argument.
+ * configure.in (--no-undefined): RUBY_TRY_CFLAGS does nothing for
+ linker flags. use RUBY_TRY_LDFLAGS.
-Thu Jun 4 04:10:43 2015 Koichi Sasada <ko1@atdot.net>
+Fri Nov 25 11:37:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
+ * io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linux
+ specific narg length calculation.
+ * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and
+ unstructured ioctl.
- * class.c (clone_method): use renamed name.
+Fri Nov 25 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable
- names.
+ * Makefile.in (EXTLDFLAGS): export it.
+ * configure.in: add --no-undefined if --enable-shared is specified.
+ Gentoo enabled this option long time. Also, export EXTLDFALGS.
-Wed Jun 3 23:03:50 2015 Koichi Sasada <ko1@atdot.net>
+Fri Nov 25 08:48:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
+ * configure.in: turn on PIE if --enable-shared is not specified.
- * eval_intern.h: move decl. of rb_scope_visibility_set() to method.h.
+Fri Nov 25 08:05:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * load.c: catch up this fix.
+ * configure.in: add -fstack-protector. It help to protect us from
+ stack smashing attack.
-Wed Jun 3 21:14:20 2015 Tanaka Akira <akr@fsij.org>
+Fri Nov 25 08:03:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types.
+ * configure.in: add -D_FORTIFY_SOURCE=2. It provide some compile
+ time and runtime check for security.
-Wed Jun 3 21:00:47 2015 Tanaka Akira <akr@fsij.org>
+Fri Nov 25 08:00:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * configure.in: Don't check __int128.
+ * lib/mkmf.rb: get rid of warnings of mkmf.rb if -Wmissing-declarations
+ and/or -Wold-style-definition warnings if specified.
+ Patch by Nikolai Weibull. Thank you! [Bug #5459] [ruby-core:40200]
- * ext/rbconfig/sizeof/extconf.rb: Check __int128.
+Fri Nov 25 07:46:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/rbconfig/sizeof/depend: sizes.c depends on
- ext/rbconfig/sizeof/extconf.rb.
+ * configure.in: add -Wall always.
- * template/sizes.c.tmpl: Detect check_sizeof.
+Thu Nov 24 20:02:40 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 3 20:07:07 2015 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_engine.rb: use IO#reopen to restore stderr.
- * class.c (clone_method): remove redundant check for me->def != NULL.
- Now, all `me` have `me->def`.
+Thu Nov 24 19:59:56 2011 Tanaka Akira <akr@fsij.org>
- * proc.c (rb_method_entry_location): ditto.
+ * io.c (rb_io_reopen): re-initialize buffering mode for stdout and
+ stderr.
- * vm.c (rb_vm_check_redefinition_opt_method): ditto.
+Thu Nov 24 11:12:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm.c (add_opt_method): ditto.
+ * io.c (rb_io_fsync,rb_io_fdatasync): release GVL during fsync().
+ fsync() and fdatasync() may take a long time on slow disks and/or
+ if there is much dirty data.
+ Patch by Eric Wong. [Feature #5665] [ruby-core:41247]
- * vm_eval.c (vm_call0_body): ditto.
+Thu Nov 24 10:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Jun 3 19:24:12 2015 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_engine.rb: Suppress output from 'openssl'
+ engine's RC4 cipher.
+ [Bug #5633] [ruby-core:41026]
- * vm_core.h: rename enum missing_reason to enum method_missing_reason.
+Thu Nov 24 08:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_core.h: use enum method_missing_reason for
- rb_thread_t::method_missing_reason.
+ * ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error
+ message.
+ * ext/openssl/ossl_ssl.c: ditto.
+ * ext/openssl/ossl_pkey_rsa: ditto.
+ patched by Eric Hodel [Bug #5604] [ruby-core:40896]
- * vm_eval.c: catch up this fix.
+Wed Nov 23 20:03:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c: ditto.
+ * io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.
+ On Linux some constants for ioctl(2) doesn't include the size of
+ its return value and 16bit value; for example FIONREAD 0x541B.
+ Moreover the manual, ioctl_list(2), says "Note that the size
+ bits are very unreliable: in lots of cases they are wrong,
+ either because of buggy macros using sizeof(sizeof(struct)),
+ or because of legacy values."
+ So we shouldn't use it.
-Wed Jun 3 16:17:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+Tue Nov 22 18:07:32 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm.c: eagerly allocate `loading_table`. This eliminates the need to
- do NULL checks when looking up the `loading_table` hash.
- https://github.com/ruby/ruby/pull/918
+ * win32/win32.c (_pioinfo): need to declare _pioinfo() before using
+ _osfhnd and other macros which uses _pioinfo() internally.
- * load.c: remove various NULL checks
+Tue Nov 22 17:49:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 3 11:47:15 2015 Koichi Sasada <ko1@atdot.net>
+ * win32/win32.c (_pioinfo): make an inline function.
- * method.h: change fields order to gather frequent access fields.
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c (vm_call_method): add LIKELY().
+Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 03 10:35:45 2015 Koichi Sasada <ko1@atdot.net>
+ * win32/win32.c (dupfd): argument of _osfhnd and so on should not
+ have side effect.
- * method.h: split rb_method_definition_t::flag to several flags.
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- `flag' contains several categories of attributes and it makes us
- confusion (at least, I had confused).
+ * bignum.c (rb_big_divide): refix of r33536. Don't change behavior of Bignum#/.
+ [ruby-core:40429] [Bug #5490]
- * rb_method_visibility_t (flags::visi)
- * NOEX_UNDEF -> METHOD_VISI_UNDEF = 0
- * NOEX_PUBLIC -> METHOD_VISI_PUBLIC = 1
- * NOEX_PRIVATE -> METHOD_VISI_PRIVATE = 2
- * NOEX_PROTECTED -> METHOD_VISI_PROTECTED = 3
- * NOEX_SAFE(flag) -> safe (flags::safe, 3 bits)
- * NOEX_BASIC -> basic (flags::basic, 1 bit)
- * NOEX_MODFUNC -> rb_scope_visibility_t in CREF
- * NOEX_SUPER -> MISSING_SUPER (enum missing_reason)
- * NOEX_VCALL -> MISSING_VCALL (enum missing_reason)
- * NOEX_RESPONDS -> BOUND_RESPONDS (macro)
+Tue Nov 22 10:46:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
- Now, NOEX_NOREDEF is not supported (I'm not sure it is needed).
+ * numeric.c (ruby_float_step): improve floating point calculations.
+ [ruby-core:35753] [Bug #4576]
- Background:
- I did not know what "NOEX" stands for.
- I asked Matz (who made this name) and his answer was "Nothing".
- "At first, it meant NO EXport (private), but the original
- meaning was gone."
- This is why I remove the mysterious word "NOEX" from MRI.
+ * numeric.c (ruby_float_step): correct the error of floating point
+ numbers on the excluding case.
+ patched by Masahiro Tanaka [ruby-core:39608]
- * vm_core.h: introduce `enum missing_reason' to represent
- method_missing (NoMethodError) reason.
+ * numeric.c (ruby_float_step): use the end value when the current
+ value is greater than or equal to the end value.
+ patched by Akira Tanaka [ruby-core:39612]
- * eval_intern.h: introduce rb_scope_visibility_t to represent
- scope visibility.
- It has 3 method visibilities (public/private/protected)
- and `module_function`.
+Tue Nov 22 06:59:21 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 3 08:06:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_io.rb (test_fcntl_dupfd): there is no known platform
+ which don't have F_DUPFD. [ruby-dev:44874]
- * gem/bundled_gems: updated to test-unit 3.1.1 and minitest 5.7.0.
+Tue Nov 22 04:46:22 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Jun 3 04:48:05 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych.rb: remove autoload from psych
+ * ext/psych/lib/psych/json.rb: ditto
- * vm_insnhelper.c (vm_defined): check respond_to_missing?
- at defined?(func()).
- [Bug #11212]
+Tue Nov 22 00:44:59 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_defined.rb: add a test for this fix.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): the argument of F_DUPFD is
+ minimum file descriptor.
-Wed Jun 3 04:34:39 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 22 00:25:17 2011 Tanaka Akira <akr@fsij.org>
- * vm_insnhelper.c (vm_defined): skip respond_to_missing? when
- a method is available.
- [Bug #11211]
+ * io.c (linux_get_maxfd): get rid of a warning.
- * test/ruby/test_defined.rb: add a test for this fix.
+Mon Nov 21 23:39:14 2011 Tanaka Akira <akr@fsij.org>
-Wed Jun 3 04:14:13 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (linux_get_maxfd): new function to find maximum fd on Linux.
+ (rb_close_before_exec): use linux_get_maxfd.
- * insns.def (defined), vm_insnhelper.c (vm_defined):
- move instruction body to the vm_defined() function.
+Mon Nov 21 06:16:24 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jun 3 02:29:25 2015 Benoit Daloze <eregontp@gmail.com>
+ * cont.c (fiber_switch): ignore fiber context switch
+ because destination fiber is same as current fiber.
+ With out this, it may segv on FreeBSD 9.
+ patched by Koichi Sasada.
- * test/ruby/test_module.rb: Do not assume class variable order.
- Patch by @enebo.
+Sun Nov 20 23:22:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 3 01:10:38 2015 Yusuke Endoh <mame@tsg.ne.jp>
+ * ext/extmk.rb (extract_makefile, extmake): regenerate makefiles
+ if globbed source file list is changed.
- * vm_method.c (rb_method_definition_set): remove a double assignment.
- Coverity Scan found this bug.
+ * lib/mkmf.rb (create_makefile): store ORIG_SRCS.
-Wed Jun 3 00:04:51 2015 Koichi Sasada <ko1@atdot.net>
+Sun Nov 20 22:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_method.c (rb_alias): rename parameter names.
+ * enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
+ reported by Ken Takata. [ruby-dev:44894][Bug #5652]
-Tue Jun 2 23:27:18 2015 Koichi Sasada <ko1@atdot.net>
+Sun Nov 20 11:01:28 2011 Tanaka Akira <akr@fsij.org>
- * method.h: remove rb_method_iseq_t::iseqval.
- While making a r50728, iseqval is needed (to mark correctly),
- but now just iseqptr is enough.
+ * lib/set.rb (SortedSet.setup): remove old_init after initialize
+ method is redefined. The remove before redefinition makes the
+ warning prevention fragile. [ruby-dev:44892]
- * class.c: catch up this fix.
+Sun Nov 20 04:01:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: ditto.
+ * Makefile.in (enc/unicode/name2ctype.h): remove duplicated
+ ifdefs.
- * proc.c: ditto.
+Sat Nov 19 19:31:47 2011 Tanaka Akira <akr@fsij.org>
- * vm_method.c: ditto.
+ * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.
+ patch by Tomoyuki Chikanaga.
+ [ruby-dev:44827] [Bug #5586]
-Tue Jun 2 21:29:28 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 19 16:36:57 2011 Tanaka Akira <akr@fsij.org>
- * proc.c (proc_curry): remove a debug line.
+ * test/net/http/test_http.rb: remove temporally files in ensure clause.
-Tue Jun 2 12:43:46 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 19 08:18:41 2011 Tanaka Akira <akr@fsij.org>
- * method.h: make rb_method_entry_t a VALUE.
- Motivation and new data structure are described in [Bug #11203].
+ * test/net/http/test_http.rb: remove temporally files.
- This patch also solve the following issues.
+Fri Nov 18 17:18:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * [Bug #11200] Memory leak of method entries
- * [Bug #11046] __callee__ returns incorrect method name in orphan
- proc
+ * ext/io/console/console.c (console_raw, console_set_raw)
+ (console_getch): optional parameters. [EXPERIMENTAL]
- * test/ruby/test_method.rb: add a test for [Bug #11046].
+Fri Nov 18 16:12:11 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: remove rb_control_frame_t::me. me is located at value
- stack.
+ * ext/io/console/console.c (console_cooked, console_set_cooked):
+ new methods to reset cooked mode. [EXPERIMENTAL]
- * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
- because method entries are simple VALUEs.
+Fri Nov 18 13:20:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * method.h: Now, all method entries has own independent method
- definitions. Strictly speaking, this change is not essential,
- but for future changes.
+ * test/unit/assertions.rb (MINI_DIR): quick dirty hack to get rid of
+ warnings when using assert/assert_respond_to.
- * rb_method_entry_t::flag is move to rb_method_definition_t::flag.
- * rb_method_definition_t::alias_count is now
- rb_method_definition_t::alias_count_ptr, a pointer to the counter.
+Fri Nov 18 13:03:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
- search the current method entry from value stack.
+ * io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
+ available (for Windows).
- * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
- assertions.
+ * win32/win32.c (fcntl): on F_DUPFD, determine the inheritance of the
+ new handle by O_NOINHERIT flag of original fd.
-Tue Jun 2 10:46:36 2015 Eric Wong <e@80x24.org>
+Fri Nov 18 08:00:41 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * test/socket/test_nonblock.rb: new test for sendmsg_nonblock
+ * lib/minitest/*: Imported minitest 2.8.1 (r6750)
+ * test/minitest/*: ditto
+ * configure.in: Improved gcc-llvm error message to help people migrate.
-Tue Jun 2 09:04:14 2015 Eric Wong <e@80x24.org>
+Thu Nov 17 20:43:34 2011 Tanaka Akira <akr@fsij.org>
- * lib/benchmark.rb: just use Process::CLOCK_MONOTONIC
- [ruby-core:69390]
+ * ext/dbm/extconf.rb: revert a part of the patch in [ruby-dev:41531].
+ don't use db.h with other headers. [ruby-dev:44884].
-Mon Jun 1 22:01:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 17 20:23:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (pkg_config): split --libs if --libs-only-l option
- is not available. patch in [ruby-core:69428] by Hans Mackowiak.
- [ruby-core:69421] [Bug #11201]
+ * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when
+ it is defined. if it is not defined, assume 64 as the max of fds.
-Mon Jun 1 21:18:24 2015 Koichi Sasada <ko1@atdot.net>
+Thu Nov 17 10:36:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * gc.c (gc_mark_children): remove a garbage character
- introduced at the last commit.
+ * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
+ also closed. [ruby-core:41088]
-Mon Jun 1 19:24:42 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 16 18:13:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_method.c (rb_method_entry_make): do not show warning message
- when method_entry is an alias.
+ * Makefile.in (LIBRUBY_A): check if generated linked library is
+ valid for extconf.
-Mon Jun 1 15:47:16 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 16 13:51:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * internal.h: move class related definitions.
+ * bignum.c (rb_big2ulong): need to calc in unsigned long, because
+ the range of VALUE is larger than it on LLP64 platform, such as Win64.
+ this change fixes the failures of test/-ext-/num2int.
-Mon Jun 1 15:43:03 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 16 12:02:47 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * class.c: remove needless include pragma for method.h.
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#start_cgi_server): there are
+ no guarantee of existence of RbConfig::CONFIG['LIBPATHENV'].
+ it only exists in Unix-like environments.
- * struct.c: ditto.
+ * test/webrick/test_filehandler.rb
+ (WEBrick::TestFileHandler#test_script_disclosure): ditto.
- * vm_method.c: ditto.
+Wed Nov 16 11:34:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jun 1 05:42:00 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (argf_next_argv): wrong timing of setting ecflags.
+ fixed the failure of TestArgf#test_textmode introduced at r33662.
- * eval_intern.h, vm_method.c: move macros to functions.
- * SCOPE_TEST(f) -> rb_frame_visibility_test(flag).
- * SCOPE_CHECK(f) -> rb_frame_visibility_check(flag).
- * SCOPE_SET(f) -> rb_frame_visibility_set(flag).
+Wed Nov 16 10:45:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * load.c (load_ext): use it.
+ * ext/-test-/num2int/num2int.c: remove an unnecessary and wrong decl
+ of rb_stdout. it's declared in ruby.h correctly.
-Mon Jun 1 04:47:37 2015 Zachary Scott <e@zzak.io>
+Wed Nov 16 10:26:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/date/date_core.c: [DOC] Add comparison of Time and DateTime
- Patch provided by @pixeltrix
+ * bignum.c (rb_big2ull): add a cast to get rid of a VC++ warning.
-Mon Jun 1 04:22:09 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 16 09:39:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h (VM_FRAME_MAGIC_DUMMY): introduce new frame type to
- recognize dummy frame.
+ * lib/minitest/unit.rb (assert_raises): experimental fix to run
+ correctly on chkbuild over 64bit linux. call exception_details only
+ when the detail is really needed to avoid create needless inspect
+ under ulimit-ed environment.
- * vm.c (th_init): use new frame type.
+Wed Nov 16 06:34:30 2011 Tanaka Akira <akr@fsij.org>
- * vm_args.c (raise_argument_error): ditto.
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): use
+ assert_operator.
-Mon Jun 1 04:15:42 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 15 21:56:25 2011 Tanaka Akira <akr@fsij.org>
- * class.c (rb_class_has_methods): added to reduce dependency
- to internal class data structure.
+ * test/ruby/test_sleep.rb (test_sleep_5sec): 0.1sec tolerance is too
+ small for busy environment.
- * internal.h: ditto.
+Tue Nov 15 20:08:55 2011 Tanaka Akira <akr@fsij.org>
- * hash.c (has_extra_methods): use added function.
+ * io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
+ __linux__ macro for consistency.
-Mon Jun 1 04:11:48 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 15 14:45:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c , gc.h (rb_obj_info): export obj_info(VALUE) for debugging.
+ * include/ruby/ruby.h(NUM2LONG, NUM2INT, NUM2SHORT, NUM2LL,
+ INT2NUM, UINT2NUM, LONG2NUM, ULONG2NUM, NUM2CHR): wrap by
+ macros.
-Mon Jun 1 03:52:55 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 15 13:38:14 2011 Naohisa Goto <ngotogenome@gmail.com>
- * test/ruby/test_gc.rb: increase timeout seconds for GC stressful
- debugging.
+ * include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm code
+ to a separate file sparc.c for preventing inlining optimization.
+ Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685]
+ * sparc.c (rb_sparc_flush_register_windows): ditto.
+ * configure.in: ditto.
-Sun May 31 04:18:06 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 15 13:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * method.h: fix typo of comments.
+ * include/ruby/ruby.h: get rid of gcc specific rb_long2int(),
+ NUM2LONG(), NUM2INT(), NUM2SHORT(), NUM2LL(), INT2NUM(),
+ UINT2NUM(), LONG2NUM(), ULONG2NUM() and NUM2CHR()
+ implementation. Because 1) They don't make any better code
+ at all. 2) Inline function have a better debugger supoort.
-Sun May 31 03:36:42 2015 Koichi Sasada <ko1@atdot.net>
+Tue Nov 15 09:58:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * method.h: add VM_METHOD_TYPE_ALIAS rb_method_definition_t::type
- to fix [Bug #11173].
+ * test/ruby/test_io.rb (TestIO#test_fcntl_dupfd): fix OpenBSD test
+ failure. [ruby-dev:44872]
- Now, inter class/method alias creates new method entry
- VM_METHOD_TYPE_ALIAS, which has an original method entry.
+Tue Nov 15 09:50:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c (find_defined_class_by_owner): added.
- Search corresponding defined_class from owner class/module.
+ * regcomp.c (print_indent_tree): fix double printing of ENCLOSE_OPTION
+ children bug. patched by Suraj Kurapati. [ruby-core:40964]
- * vm_method.c (rb_method_entry_get_without_cache): return me->klass
- directly for defined_class.
+Tue Nov 15 01:53:48 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- Now, no need to check me->klass any more.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): fix test error on
+ SnowLeopard. Pointed out by CHIKANAGA Tomoyuki. [ruby-dev:44866]
- * vm_method.c (method_entry_set0): separated from method_entry_set().
+Mon Nov 14 22:06:02 2011 Tanaka Akira <akr@fsij.org>
- * vm_method.c (rb_alias): make method entry has VM_METHOD_TYPE_ALIAS.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
+ flag.
- * vm_method.c (release_method_definition): support VM_METHOD_TYPE_ALIAS.
+ * ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.
- * vm_method.c (rb_hash_method_definition): ditto.
+Mon Nov 14 14:54:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_method.c (rb_method_definition_eq): ditto.
+ * bignum.c (rb_big2ull): fix 32bit platform breakage. we must
+ not assume sizeof(VALUE) == sizeof(LONG_LONG).
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix false assumption on 32bit platform.
- * vm_method.c (release_method_definition): ditto.
+Mon Nov 14 14:52:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_insnhelper.c (vm_call_method): ditto.
+ * numeric.c (rb_fix2ushort): fix typo. use num rb_num2ushort()
+ instead of num2uint().
- * vm_insnhelper.c (vm_method_cfunc_entry): ditto.
+Sun Nov 13 10:31:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm_eval.c (vm_call0_body): ditto.
+ * include/ruby/ruby.h: add #ifdef comment.
- * gc.c (mark_method_entry): ditto.
+Sun Nov 13 10:28:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * proc.c (method_def_iseq): ditto.
+ * include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
+ * numeric.c: ditto.
- * proc.c (method_cref): ditto.
+ * test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
+ * ext/-test-/num2int/num2int.c: ditto.
- * proc.c (rb_method_entry_min_max_arity): ditto.
+Sun Nov 13 10:23:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_alias.rb: add tests.
+ * bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix a testcase too.
- * test/ruby/test_module.rb: fix a test to catch up current behavior.
+Sun Nov 13 10:22:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun May 31 03:34:25 2015 Koichi Sasada <ko1@atdot.net>
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ add FIXNUM tests.
- * vm_method.c (rb_unlink_method_entry): make it static.
+Sun Nov 13 09:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun May 31 03:26:58 2015 Koichi Sasada <ko1@atdot.net>
+ * numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
+ * bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.
- * method.h, vm_method.c (rb_free_method_entry): constify a parameter.
+ * test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
+ NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
+ * ext/-test-/num2int/depend: ditto.
+ * ext/-test-/num2int/extconf.rb: ditto.
+ * ext/-test-/num2int/num2int.c: ditto.
- * vm_core.h: remove useless declaration about rb_unlink_method_entry().
+Sun Nov 13 23:47:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 30 18:05:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/dbm/extconf.rb: use convertible_int.
- * lib/tempfile.rb (Remover#call): fixed wrong condition. introduced at
- r50682.
+Sun Nov 13 23:45:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org>
+ * lib/mkmf.rb (checking_for): should not modify the result.
- * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
- [ruby-core:69419] [Feature #11198]
+ * lib/mkmf.rb (have_struct_member): accept compiler options.
-Sat May 30 15:59:10 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/mkmf.rb (convertible_int): add restricted support of struct
+ member, and TYPEOF_ macro.
- * lib/tempfile.rb (Tempfile#initialize): initialize @unlinked to fix
- test failures introduced at r50682. I hope that check the results of
- tests before committing, at least the tests about the changed feature.
+Sun Nov 13 23:21:24 2011 Tanaka Akira <akr@fsij.org>
-Sat May 30 11:02:55 2015 Martin Englund <martin@englund.nu>
+ * ext/gdbm/gdbm.c (fgdbm_reorganize): set close-on-exec flag after
+ gdbm_reorganize(). gdbm_reorganize() opens a new database internally.
- * doc/dtrace_probes.rdoc: change lingering dtrace probe documentation
- from function- to method-
+Sun Nov 13 19:57:18 2011 Tanaka Akira <akr@fsij.org>
-Sat May 30 10:26:09 2015 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/dbm/extconf.rb: rollback for each headers for each libraries.
- * lib/tempfile.rb: refactoring.
- * use warn instead of STDERR.print
- * remove @tmpname and use @tmpfile.path
- * introduce @unlinked flag
- * Remover takes only @tmpfile
- * mode will be modified just before file reopen
+Sun Nov 13 16:24:48 2011 Tanaka Akira <akr@fsij.org>
-Sat May 30 09:02:51 2015 Eric Wong <e@80x24.org>
+ * ext/dbm/extconf.rb: treat libc as a choice for a library which
+ provide ndbm API.
- * 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]
+Sun Nov 13 15:40:43 2011 Tanaka Akira <akr@fsij.org>
-Sat May 30 09:14:28 2015 Scott Francis <scott.francis@shopify.com>
+ * ext/dbm/extconf.rb: duplicate $libs and $defs when save them.
- * cont.c (cont_free): check if ruby_current_thread is still valid.
- [Fix GH-914]
+Sun Nov 13 12:43:48 2011 Tanaka Akira <akr@fsij.org>
-Sat May 30 08:36:04 2015 Eric Wong <e@80x24.org>
+ * ext/dbm/extconf.rb: rollback $libs and $defs when db detection is
+ failed. It fixes -lgdbm -lqdbm when the system has qdbm and gdbm
+ without gdbm_compat.
- * 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]
+Sat Nov 12 21:14:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat May 30 08:10:46 2015 Eric Wong <e@80x24.org>
+ * test/webrick/test_cgi.rb (class TestWEBrickCGI): respect
+ RbConfig::CONFIG["LIBPATHENV"]. [Bug #5135] [ruby-core:38653]
+ * test/webrick/test_filehandler.rb (class WEBrick): ditto.
- * 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)
+Sat Nov 12 20:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri May 29 17:39:14 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_io.rb (test_fcntl_dupfd): skip if Fcntl::DUPFD
+ is not defined. Pointed out by CHIKANAGA Tomoyuki. Thanks.
- * tool/make_hgraph.rb: added.
+Sat Nov 12 17:26:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 29 14:39:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (do_ioctl, ioctl_narg_len, setup_narg, rb_ioctl): use
+ ioctl_req_t.
- * compile.c (iseq_compile_each): out of range NTH_REF is always
- nil.
+Sat Nov 12 17:01:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parse_numvar): check overflow of NTH_REF and range.
- [ruby-core:69393] [Bug #11192]
+ * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
- * util.c (ruby_scan_digits): make public and add length parameter.
+Sat Nov 12 15:59:42 2011 Tanaka Akira <akr@fsij.org>
-Fri May 29 11:18:58 2015 Eric Wong <e@80x24.org>
+ * ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
+ implementation. If it is not available, it is caused by
+ header/library mismatch such that Berkeley DB header & gdbm library.
- * ext/socket/ancdata.c (bsock_sendmsg_internal,
- bsock_recvmsg_internal):
- avoid redundant fcntl on Linux
- [ruby-core:69154] [Feature #11145]
- * ext/socket/init.c (rsock_s_recvfrom_nonblock): ditto
- * ext/socket/rubysocket.h (MSG_DONTWAIT_RELIABLE): new macro
+ * ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally.
+ gdbm 1.9 provides it as a real function instead of a empty macro.
-Fri May 29 10:30:34 2015 Eric Wong <e@80x24.org>
+Sat Nov 12 13:35:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/net/resolv.rb (request): use monotonic clock
- * lib/net/http.rb (begin_transport, end_transport): ditto
- [ruby-core:69384] [Feature #11124]
+ * bootstraptest/runner.rb: don't suppress SIGINT.
+ [Feature #5612] [ruby-dev:44856]
-Fri May 29 04:37:38 2015 Koichi Sasada <ko1@atdot.net>
+Sat Nov 12 11:20:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/objspace/objspace.c: add two methods to debug internals.
+ * io.c (fcntl_narg_len): introduce narg calculation for fcntl instead
+ of hard coded 256.
+ * io.c (setup_narg): ditto.
- * ObjectSpace.internal_class_of: return RBASIC_CLASS(obj).
- * ObjectSpace.internal_super_of: return RCLASS_SUPER(cls).
+Sat Nov 12 11:19:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * NEWS: add information about both methods.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): add another fcntl test.
- * test/objspace/test_objspace.rb: add tests for both methods.
+Sat Nov 12 11:18:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu May 28 06:55:53 2015 Anton Davydov <antondavydov.o@gmail.com>
+ * test/ruby/test_io.rb (test_fcntl_lock_freebsd): add a testcase
+ of fcntl lock for freebsd.
- * ext/tk/sample/figmemo_sample.rb (open_file),
- ext/tk/sample/tktextio.rb (TkTextIO): fix typo in messages.
- [Fix GH-916]
+Sat Nov 12 11:16:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed May 27 09:50:51 2015 Eric Wong <e@80x24.org>
+ * io.c (ioctl_narg_len): Linux doesn't have IOCPARM_LEN macro, but
+ has _IOC_SIZE. support it.
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
- ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile
- [ruby-core:69371] [Bug #11185]
+Sat Nov 12 11:13:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed May 27 09:27:30 2015 Eric Wong <e@80x24.org>
+ * io.c (rb_ioctl): don't expose our sanity check value to ruby script.
+ It may change string value meaning if the value is string.
+ (e.g. MacOS X has F_GETPATH ioctl)
+ * io.c (rb_fcntl): ditto.
- * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call
- * lib/drb/unix.rb (set_sockopt): ditto
- [ruby-core:69128] [Feature #11137]
+Sat Nov 12 11:06:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue May 26 22:10:43 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.
+ Moreover almost all linux ioctl can't be represented by 32bit integer
+ (i.e. MSB is 1). We need wrap ioctl argument type.
+ [Bug #5429] [ruby-dev:44589]
+ * io.c (struct ioctl_arg): ditto.
+ * io.c (rb_ioctl): ditto.
+ * test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl
- * vm_method.c (rb_alias): should resolve refined methods.
- [ruby-core:69360] [Bug #11182]
+Sat Nov 12 11:00:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue May 26 21:35:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * io.c (struct io_cntl_arg): remove io_p member.
+ * io.c (nogvl_fcntl, do_fcntl, rb_fcntl): separated from ioctl functions.
+ * io.c (nogvl_io_cntl): remove fcntl depended logic.
+ * io.c (io_cntl): ditto.
+ * io.c (rb_io_ctl): ditto.
+ * io.c (rb_io_ioctl): ditto.
- * include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): fix condition.
+Sat Nov 12 10:59:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon May 25 22:35:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (setup_narg): fix off by one bug.
- * tool/redmine-backporter.rb (rel): after the relations is changed,
- @changesets is no longer right.
+Sat Nov 12 10:56:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon May 25 11:27:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (+setup_narg): factor out length calculation logic.
+ * io.c (rb_io_ctl): ditto.
- * win32/win32.c (setup_overlapped): seek to the file end only when
- writing (mode:a), not reading (mode:a+, read).
+Sat Nov 12 10:52:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon May 25 00:27:37 2015 Benoit Daloze <eregontp@gmail.com>
+ * io.c (+ioctl_narg_len) new helper function.
+ * io.c (rb_io_ctl): don't use ioctl specific length check
+ if caller is fcntl.
- * numeric.c (Numeric#negative?): [DOC] Fix call-seq.
- Patch by @yui-knk. [Fixes GH-908]
+Fri Nov 11 23:00:46 2011 Tanaka Akira <akr@fsij.org>
-Sun May 24 01:35:22 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/dbm/extconf.rb: db_prefix is not required now.
- * debug.c (ruby_debug_print_id): use rb_id2name() for fprintf().
+Fri Nov 11 21:13:30 2011 Tanaka Akira <akr@fsij.org>
-Sat May 23 18:38:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
- * man/*.1: updated dates in man pages.
- [ruby-dev:48988] [Bug #11171]
+Fri Nov 11 21:00:05 2011 Tanaka Akira <akr@fsij.org>
-Sat May 23 03:10:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
+ Berkeley DB. Macro definitions needs arguments to detect correctly.
+ SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type
+ only if DB_DBM_HSEARCH is defined.
- * win32/win32.c (rb_w32_write_console): should return the count of
- actually eaten characters, include escape sequences.
+Fri Nov 11 18:41:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 22 22:36:14 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * process.c (proc_seteuid): separate an internal wrapper function
+ from the method implementation.
- * lib/prime.rb: Remove obsolete Prime.new
- patch by Ajay Kumar. [Fixes GH-891]
+Fri Nov 11 17:21:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 22 21:13:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (have_library, find_library, have_func): allow
+ arguments of function to be checked.
- * include/ruby/intern.h (rb_sym_count): move `rb_sym_all_symbols`
- to a symbol.c specific section. a part of patch by Lourens
- Naude.
+Fri Nov 11 17:09:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 22 20:56:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_dump.c (HAVE_BACKTRACE): fallback to 0.
- * complex.c (f_complex_polar): simple bug reproduced only when y is
- a float but x is not a float.
+ * vm_dump.c (rb_vm_bugreport): show "Other runtime information"
+ header only when available.
-Fri May 22 19:42:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c (rb_vm_bugreport): get rid of modifying the content of
+ VM directly.
- * process.c (rb_spawn_process): do not discard global escape
- status. [ruby-core:69304] [Bug #11166]
+ * vm_dump.c (rb_vm_bugreport): check if vm is non-null.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * process.c (rb_execarg_spawn): extract the start procedure in a
- parent process with ensuring the end procedure.
+Fri Nov 11 12:36:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri May 22 16:48:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * io.c (pipe_open): Remove fflush(stdin). it's no effect.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * NEWS: added news for net-telnet and rake
+Fri Nov 11 07:33:30 2011 Eric Hodel <drbrain@segment7.net>
-Thu May 21 20:27:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): Use symbol keys instead
+ of string keys to avoid duplicating parameters in
+ OpenSSL::SSL:SSLContext#set_params.
- * configure.in (RUBY_DTRACE_POSTPROCESS): cmp -b is GNU extension.
- darwin uses GNU cmp, and FreeBSD and Solaris are not.
- Note that accidentally equals to expected result.
+Thu Nov 10 15:02:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 21 18:00:19 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/mkmf.rb (have_library, have_func, have_var, have_header):
+ add compiler option parameter.
- * iseq.c: constify.
+Thu Nov 10 07:45:16 2011 Eric Hodel <drbrain@segment7.net>
- * iseq.h: ditto.
+ * ext/openssl/lib/openssl/ssl.rb (class OpenSSL::SSL::SSLContext):
+ Document #set_params.
- * method.h: ditto.
+Wed Nov 9 11:36:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * proc.c: ditto.
+ * thread_pthread.c (gvl_yield): don't prevent concurrent sched_yield().
+ [Bug #5130] [ruby-core:38647]
- * vm_method.c: ditto.
+Wed Nov 9 23:20:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 21 17:44:53 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (rb_update_max_fd): fstat(2) can fail with other than
+ EBADF. [ruby-dev:44837] [Bug #5593]. Cf.
+ http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html
- * proc.c: fix issues caused by binding created from Method#to_proc.
- [Bug #11163]
+ * io.c (rb_sysopen): max fd is updated in rb_sysopen_internal()
+ already.
- * vm.c (vm_cref_new_toplevel): export as rb_vm_cref_new_toplevel().
+Wed Nov 9 22:13:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_method.rb: add some assertions.
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ fixed previous commit.
-Thu May 21 17:29:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Wed Nov 9 19:53:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/matrix.rb: added documentation for Matrix#empty and Matrix#/
- [Feature #10070][ruby-dev:48433] Patch by @gogotanaka
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ add test for r33685.
-Thu May 21 17:02:43 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 9 19:00:44 2011 Koichi Sasada <ko1@atdot.net>
- * proc.c: rename functions.
- * method_get_def() -> method_def()
- * method_get_iseq() -> method_def_iseq()
- * method_get_cref() -> method_cref()
+ * test/ruby/test_fiber.rb: add tests for r33684 (Fiber#resume).
-Thu May 21 16:52:44 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 9 16:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * proc.c (rb_method_get_iseq): rename to rb_method_iseq.
+ * win32/win32.c (unixtime_to_filetime): should check the return value
+ of localtime(). reported by snowjail at gmail.com.
+ [ruby-dev:44838] [Bug #5596]
- * iseq.c: catch up this fix.
+Thu Nov 9 13:17:25 2011 Koichi Sasada <ko1@atdot.net>
- * iseq.h: commit ditto.
+ * cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit using
+ "resume" after "transfer" method are used. You should not mix
+ "resume" fiber and "transfer" fiber.
+ [Bug #5526]
-Thu May 21 15:41:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * NEWS: add information about this change.
- * lib/net/telnet.rb: gemify net-telnet.
- [Feature #11083]
- * gems/bundled_gems: added net-telnet to bundled gems.
+Wed Nov 9 11:40:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 21 15:37:32 2015 Zachary Scott <e@zzak.io>
+ * template/Doxyfile.tmpl (INCLUDE_PATH): add srcdir and include.
+ [ruby-core:40843] [Bug #5597]
- * vm_method.c: Remove private attribute warning [Bug #10967]
- Patch by @spastorino [Fixes GH-849]
- https://github.com/ruby/ruby/pull/849
+Wed Nov 9 11:02:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_module.rb: Update test for changes
+ * thread.c (do_select): fix cast, tv_sec is time_t.
-Thu May 21 10:59:43 2015 Koichi Sasada <ko1@atdot.net>
+Wed Nov 9 10:32:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (method_proc): rename to method_to_proc.
+ * configure.in: should not use test -e for portability.
+ [ruby-core:40841] [Bug #5594]
-Thu May 21 10:51:54 2015 Jake Worth <jakeworth82@gmail.com>
+Wed Nov 9 04:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * io.c (rb_f_select): [DOC] Fixes for grammar and style.
- [Fix GH-906]
+ * ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
+ rationals, etc with reference ids.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
+ rationals, etc with reference ids.
+ * test/psych/test_object_references.rb: corresponding tests
-Thu May 21 08:25:19 2015 Eric Wong <e@80x24.org>
+Tue Nov 8 23:34:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * 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]
+ * ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)
+ (fdbm_has_key, fdbm_has_value): get rid of overflow.
-Thu May 21 04:11:03 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey)
+ (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto.
- * iseq.c (exception_type2symbol): show correct bug message.
+ * ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects.
-Wed May 20 23:19:05 2015 Yusuke Endoh <mame@ruby-lang.org>
+ * ext/gdbm/gdbm.c (fgdbm_delete_if): ditto.
- * lib/base64.rb: Fix rdoc-formatting for padding argument.
- [fix GH-905][ci skip] Patch by @davydovanton
+ * ext/dbm/extconf.rb: check size of datum.dsize to get rid of
+ overflow.
-Wed May 20 13:16:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 8 23:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (DEPRECATED_BY): deprecate warning with preferable
- alternative.
+ * addr2line.c (PATH_MAX): define if not defined. [ruby-core:40840]
- * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
- the macro.
+Tue Nov 8 23:26:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 20 11:23:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/tk/tcltklib.c (rb_thread_critical): fix type.
- * vm_dump.c (rb_print_backtrace): return value of libexec's backtrace
- is size_t, so simply cast as int.
+ * ext/tk/tcltklib.c (eventloop_sleep, lib_eventloop_core): int is
+ enough for micro seconds. may need to check overflow in the
+ setter though.
-Tue May 19 18:54:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/tk/tcltklib.c (RSTRING_LENINT): check overflow if necessary.
- * iseq.c (rb_iseq_compile_with_option): check source type, must be
- an IO or a String. [ruby-core:69219] [Bug #11159]
+ * ext/tk/tcltklib.c (RbTk_ALLOC_N): wrapper for ckalloc() which
+ takes an int.
-Tue May 19 17:15:03 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_get, tcltklib_compile_info):
+ get rid overflow.
- * lib/benchmark.rb: Update Benchmark documentation and formatting.
- [fix GH-903][ci skip] Patch by @davydovanton
+ * ext/tk/tcltklib.c (tcltklib_compile_info): constified.
-Tue May 19 13:10:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 8 20:50:45 2011 Tanaka Akira <akr@fsij.org>
- * numeric.c (num_positive_p): should false on Bignum 0.
- http://twitter.com/rafaelfranca/status/600509783427391488
- [ruby-core:69173] [Feature #11151]
+ * test/dbm/test_dbm.rb: split tests for read only database.
-Tue May 19 11:22:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/gdbm/test_gdbm.rb: ditto.
- * lib/uri/rfc2396_parser.rb (initialize_pattern):
- URI::Generic.build should accept port as a string.
- pattern[:PORT] is not defined for long.
- by Dave Slutzkin <daveslutzkin@fastmail.fm>
- https://github.com/ruby/ruby/pull/804 fix GH-804
+Tue Nov 8 18:59:07 2011 Tanaka Akira <akr@fsij.org>
-Tue May 19 11:18:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/pty/pty.c (MasterDevice): define only when used.
+ (SlaveDevice): ditto.
+ (deviceNo): ditto.
- * include/ruby/ruby.h (rb_data_typed_object_alloc),
- (rb_data_object_alloc): add old names for source level backward
- compatibilities.
+Tue Nov 8 17:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add
- aliases for binary level backward compatibilities.
+ * include/ruby/ruby.h (rb_long2int): define as a macro always, so
+ that cpp conditionals can tell if it is provided.
-Tue May 19 09:54:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 8 17:30:50 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
- casts to fix function overloading in C++.
+ * lib/mkmf.rb (cpp_command): remove multiple -arch flags since cpp
+ cannot work.
-Tue May 19 09:43:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 8 14:50:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):
- explicit cast from void* is necessary as implicit cast is
- disallowed in C++.
+ * io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
+ set. this is the one of the reason of IO writing slowness of Windows
+ in 1.9.3 or later.
-Mon May 18 15:31:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 8 11:01:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/intern.h (rb_f_notimplement): should not respond to
- not-implemented methods. as the address inside a DLL and the
- imported address are different on Windows, use an exported
- variable to share the same address.
+ * ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flag
+ for posix_openpt, but FreeBSD 9's posix_openpt doesn't support
+ O_CLOEXEC and fails if specified.
-Mon May 18 13:55:01 2015 Shugo Maeda <shugo@ruby-lang.org>
+Tue Nov 8 02:36:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count
- just in case the previous owner thread dies without mon_exit.
- [fix GH-874] Patch by @chrisberkhout
+ * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,
+ ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro.
-Sun May 17 17:21:29 2015 Eric Wong <e@80x24.org>
+ * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv):
+ set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO
+ if the flag is available.
- * lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
- * (set_close_on_exec): use IO#close_on_exec=
- [Feature #11136]
+ * io.c (make_writeconv): drop decorators for reading.
-Sun May 17 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (make_readconv): drop decorators for writing.
- * numeric.c (num_positive_p, num_negative_p): add methods
- Numeric#positive? and Numeric#negative?.
- [ruby-core:69173] [Feature #11151]
+ * io.c (do_writeconv): existing writeconv is not the condition to raise
+ ArgumentError. should check textmode or not.
- * numeric.c (flo_positive_p, flo_negative_p): specialized
- functions for Float.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above
+ changes.
- * complex.c (Init_Complex): Complex do not have positive? and
- negative? methods
+Mon Nov 7 22:03:47 2011 Tanaka Akira <akr@fsij.org>
-Sun May 17 14:57:42 2015 Eric Wong <e@80x24.org>
+ * ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag.
- * lib/webrick/server.rb (accept_client): avoid redundant fcntl call
- [Feature #11137]
+Mon Nov 7 20:31:52 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun May 17 12:13:33 2015 Eric Wong <e@80x24.org>
+ * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
+ like base 60 numbers are serialized as quoted strings.
+ * test/psych/test_string.rb: test for change.
- * ext/socket/init.c (cloexec_accept): support nonblock flag and
- use SOCK_NONBLOCK if possible
- * ext/socket/init.c (rsock_s_accept_nonblock):
- update cloexec_accept call
- * ext/socket/init.c (accept_blocking): ditto for blocking
- * test/socket/test_nonblock.rb: check nonblock? on accepted socket
- [Feature #11138]
+Mon Nov 7 20:26:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun May 17 03:58:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * test/psych/test_yamlstore.rb: make test case inherit from MiniTest,
+ load psych/helper so that psych is loaded.
- * load.c (loaded_feature_path): stop returning false negatives for
- filenames which are trailing substrings of file extensions. For
- example, 'b', which a trailing substring of ".rb" should not return
- false. [Bug #11155][ruby-core:69206]
+Mon Nov 7 20:18:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/ruby/test_autoload.rb: test for fix
+ * test/psych/test_yamldbm.rb: Test case should inherit from MiniTest,
+ load psych/helper so that psych and friends are loaded.
-Sat May 16 21:41:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Nov 7 20:15:44 2011 Tanaka Akira <akr@fsij.org>
- * string.c: added documentation for character sequence \' with String#sub
- [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127
+ * ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().
-Sat May 16 21:38:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dbm/dbm.c: use above to set close-on-exec flag.
- * enum.c: fix a sample code. Patch by @eagletmt
- [fix GH-901][ci skip]
+Mon Nov 7 20:05:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat May 16 21:17:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_fflush): remove fsync().
- * gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename
- alloc as wrap. these functions do not allocate data pointers
- but just wrap the given pointers.
+ * io.c (rb_io_flush, rb_io_rewind): fsync() here.
-Sat May 16 19:59:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ these changes reduces fsync() calls to improve performance.
+ first reported at [ruby-list:48515] by ak7 at mail.goo.ne.jp .
+ [Bug #5585]
- * win32/win32.c (rb_w32_accept): simplified.
+Mon Nov 7 19:43:10 2011 Tanaka Akira <akr@fsij.org>
-Fri May 15 18:28:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_close_before_exec): use F_MAXFD if available.
+ F_MAXFD is available on NetBSD since NetBSD 2.0.
- * array.c (rb_ary_assoc, rb_ary_rassoc): [DOC] the result when key
- was found is the existing element, not a new array. reported by
- Giau Nguyen <giaunv AT nustechnology.com>.
+Mon Nov 7 19:25:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 15 08:24:28 2015 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_default_stdout_stderr_mode): new test for
+ r33627-33629. see [backport #5565]
- * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.
- [fix GH-887] Patch by @martinpovolny
+Mon Nov 7 01:14:22 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri May 15 06:54:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
+ * lib/debug.rb: add help for 'pp' and 'r[estart]'. patch
+ from Sho Hashimoto. [Bug #5093] [ruby-dev:44222]
- * variable.c: Change autoload to call `require` through Ruby rather
- than directly calling `rb_require_safe`. This allows things like
- RubyGems to intercept file loading done though `autoload`.
- [Feature #11140]
+Sun Nov 6 14:49:58 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_autoload.rb: Test for change.
+ * ext/socket/rubysocket.h (rsock_recvmsg): declared.
-Wed Apr 8 19:18:02 2015 Shota Fukumori (sora_h) <her@sorah.jp>
+ * ext/socket/ancdata.c (rsock_recvmsg): extracted from
+ nogvl_recvmsg_func.
+ (nogvl_recvmsg_func): use rsock_recvmsg.
- * enum.c (enum_grep_v, grep_i, grep_iter_i, Init_enum):
- Implement Enumerable#grep_v. [Feature #11049]
+ * ext/socket/unixsocket.c (recvmsg_blocking): use rsock_recvmsg.
-Thu May 14 15:54:13 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Nov 6 03:22:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/pathname/lib/pathname.rb: Remove condition of RUBY_VERSION <= 1.9.
- [Feature #11082]
+ * test/openssl/test_engine.rb: add test for engine cipher. RC4 is used
+ because AES is not supported by the "openssl" engine currently.
-Wed May 13 17:10:37 2015 Masaki Matsushita <glass.saga@gmail.com>
+Sun Nov 6 00:11:52 2011 Tanaka Akira <akr@fsij.org>
- * enum.c (enum_to_a): revert r50457.
- it requires recursion check.
- then, it doesn't make performance improvement.
- [Bug #11130] [Feature #9118]
+ * lib/test/unit.rb (Test::Unit::Options#non_options): options[:ruby]
+ should be an array. This fixes
+ "./ruby test/runner.rb test/testunit/test_parallel.rb"
+ [ruby-dev:44782]
-Wed May 13 11:13:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 5 20:30:30 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
- * parse.y (parse_gvar): separate message for gvar without
- non-space characters from message for invalid identifiers.
+ * insns.def: Some fixes and tweaks to English explanations
-Tue May 12 22:18:27 2015 Masaki Matsushita <glass.saga@gmail.com>
+Sat Nov 5 19:11:50 2011 Tanaka Akira <akr@fsij.org>
- * enum.c (enum_to_a): fix incompatibility introduced in r50457.
- [Bug #11130]
+ * io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec if
+ fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC).
- * test/ruby/test_enum.rb: test for above.
+Sat Nov 5 18:05:12 2011 Tanaka Akira <akr@fsij.org>
-Tue May 12 17:08:03 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/socket/socket.c (rsock_socketpair0): refactored.
- * method.h: remove unused declaration.
+Sat Nov 5 17:55:52 2011 Tanaka Akira <akr@fsij.org>
-Mon May 11 10:58:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/socket/init.c (rsock_socket0): don't clear try_sock_cloexec if
+ SOCK_CLOEXEC is not a reason for EINVAL.
- * gems/bundled_gems: Update minitest-5.6.1 and power_assert-0.2.3.
+Sat Nov 5 16:27:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon May 11 00:20:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
+ ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
+ lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
+ lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
+ lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
+ lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
+ lib/shell/command-processor.rb, lib/shell/process-controller.rb,
+ lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
+ arguments to avoid creating Proc objects.
- * include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct):
- allocate wrapper data object before allocating DATA_PTR to get
- rid of possible memory leak when the former failed.
+Sat Nov 5 15:45:04 2011 Tanaka Akira <akr@fsij.org>
-Sun May 10 21:32:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/init.c (rsock_socket0): extract single socket() call with
+ CLOEXEC handling from rsock_socket.
- * gc.c (gc_mark_children): call dmark function for non-NULL
- pointers only, so that DATA_PTR can be NULL safely now.
+Sat Nov 5 13:49:40 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Sun May 10 16:23:58 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+ * lib/pathname.rb (Pathname#find): return an enumerator if
+ no block is given.
- * proc.c (proc_binding): fix segmentation fault on marking phase.
- envptr of newenvval should not be NULL.
+ * test/pathname/test_pathname.rb: add tests for above.
- You can reproduce by
- make test-all TESTS='--gc-stress -n test_to_proc_binding ruby/test_method.rb'
+ [ruby-dev:44797] [Feature #5572]
-Sun May 10 12:41:18 2015 Masaki Matsushita <glass.saga@gmail.com>
+Sat Nov 5 11:18:12 2011 Tanaka Akira <akr@fsij.org>
- * ext/zlib/zlib.c (rb_gzreader_external_encoding):
- define GzipReader#external_encoding.
- [Bug #10900]
+ * ext/socket/socket.c (rsock_socketpair0): don't clear
+ try_sock_cloexec if SOCK_CLOEXEC is not a reason for EINVAL.
- * test/zlib/test_zlib.rb: test for above.
+Fri Nov 4 14:08:19 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sun May 10 11:57:48 2015 Masaki Matsushita <glass.saga@gmail.com>
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): [SECURITY] Set RSA
+ exponent value correctly. Awful bug. This bug caused exponent of
+ generated key to be always '1'. By default, and regardless of e
+ given as a parameter.
- * ext/win32ole/win32ole_variant.c: fix typo "indicies".
- the patch is from davydovanton <antondavydov.o at gmail.com>.
- [fix GH-892]
+ !!! Keys generated by this code (trunk after 2011-09-01) must be
+ re-generated !!! (ruby_1_9_3 is safe)
- * lib/rubygems/indexer.rb: ditto.
+ * test/openssl/test_pkey_rsa.rb: Add tests for default exponent and
+ specifying exponent by a parameter.
- * test/rubygems/test_gem_indexer.rb: ditto.
+Fri Nov 4 01:31:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sun May 10 11:44:37 2015 Masaki Matsushita <glass.saga@gmail.com>
+ * test/openssl/test_engine.rb: add first tests for builtin "openssl"
+ engine.
- * string.c (rb_str_crypt): Raise ArgumentError when
- string passed to String#crypt contains null.
- the patch is from jrusnack <jrusnack at redhat.com>.
- [Bug #10988] [fix GH-853]
+Fri Nov 4 08:41:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/ruby/test_string.rb: test for above.
+ * ext/openssl/extconf.rb:
+ * ext/openssl/ossl_engine.c: add some missing OpenSSL engines.
+ Thanks, Yui Naruse, for providing the patch!
+ [Bug #5548] [ruby-core:40670]
-Sun May 10 11:23:03 2015 Masaki Matsushita <glass.saga@gmail.com>
+Fri Nov 4 04:54:10 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * enum.c (enum_to_a): Use size to set array capa when possible.
- the patch is from HonoreDB <aweiner at mdsol.com>.
- [fix GH-444]
+ * win32/configure.bat: disable delayed expansion of enironment variable.
+ [Bug #5517] [ruby-core:40531]
-Sat May 9 06:48:36 2015 Eric Wong <e@80x24.org>
+Fri Nov 4 03:45:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
- [Bug #11123]
+ * io.c (make_writeconv): fixed typo of previous commit.
-Fri May 8 22:57:24 2015 takiy33 <takiy33@gmail.com>
+Fri Nov 4 01:56:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/matrix/test_matrix.rb (test_determinant): refactor test on
- Matrix#determinant, by merging with test_det for an alias method
- det. [Fix GH-897]
+ * io.c (make_writeconv): unversal_newline converter is for reading.
+ so, if the io is text mode and has ECONV_UNIVERSAL_NEWLINE_DECORATOR
+ flag, use crlf_newline converter for writing.
+ this change fixes the problem about the luck of CR up Kernel.p and
+ Kernel.puts to stdout/stderr on Windows.
-Fri May 8 15:43:11 2015 Shugo Maeda <shugo@ruby-lang.org>
+Fri Nov 4 01:04:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
- is omitted. [ruby-core:69093] [Bug #11128]
+ * ext/readline/readline.c (Init_readline): like r18313, libedit's
+ replace_history_entry may use offset instead of which.
+ so introduce history_replace_offset_func and initialize it.
-Fri May 8 15:05:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/readline/readline.c (hist_set): use history_replace_offset_func.
- * doc/syntax/control_expressions.rdoc: fix a missing "a"
- [fix GH-888][ci skip] Patch by @riffraff
+Fri Nov 4 00:53:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri May 8 12:11:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/readline/readline.c (Init_readline): fix wrong condition.
- * vm_eval.c (rb_method_call_status): resolve refined method entry
- to check if undefined. [ruby-core:69064] [Bug #11117]
+Thu Nov 3 23:53:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu May 7 22:22:59 2015 Sho Hashimoto <sho-h@ruby-lang.org>
+ * encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset()
+ on Windows except cygwin. [experimental]
- * proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
+Thu Nov 3 22:45:09 2011 Tanaka Akira <akr@fsij.org>
-Thu May 7 11:32:57 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair0): extracted from
+ rsock_socketpair to set close-on-exec flag for each socketpair()
+ call.
- * Makefile.in (rbconfig.rb): add rule to make.
+Thu Nov 3 22:12:41 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu May 7 05:14:39 2015 Eric Wong <e@80x24.org>
+ * ext/socket/init.c (rsock_socket): set close-on-exec flag when
+ SOCK_CLOEXEC is not available.
- * ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable
- * lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable
- * lib/webrick/httpserver.rb (run): ditto
- * lib/resolv.rb (request): ditto for single socket case
- [ruby-core:68943] [Feature #11081]
+Thu Nov 3 08:36:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed May 6 22:49:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_engine.rb: call Engine::cleanup on exit.
+ Patch provided by Yui Naruse, thanks!
+ [Bug #5547] [ruby-core:40669]
- * vm_eval.c (rb_method_call_status): undefined refined method is
- not callable unless using. [ruby-core:69064] [Bug #11117]
+Wed Nov 2 21:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 3 22:40:06 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * complex.c (nucomp_rationalize): fix function. [ruby-core:40667]
+ [Bug #5546]
- * ext/-test-/file/fs.c: need to include sys/statvfs.h
- to use statvfs().
+Wed Nov 2 08:16:45 2011 Tanaka Akira <akr@fsij.org>
- * ext/-test-/file/extconf.rb: check the existence of
- sys/statvfs.h
+ * lib/webrick/utils.rb: fix fcntl call.
-Sun May 3 21:59:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * lib/drb/unix.rb: ditto.
- * lib/yaml.rb: fix typo. [ci skip][fix GH-890]
- Patch by @miketheman
+Wed Nov 2 00:43:59 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sun May 3 10:02:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/psych/test_yamldbm.rb: avoid platform dependency.
+ patch by Naohisa Goto. [ruby-dev:44763] [Bug #5535]
+ * test/syck/test_yamldbm.rb: ditto.
- * range.c (linear_object_p, range_include): test if covered for
- linear objects. [ruby-core:69052] [Bug #11113]
+Wed Nov 2 00:14:15 2011 Shugo Maeda <shugo@ruby-lang.org>
-Fri May 1 13:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_marshal.rb: renamed methods duplicated with those
+ of marshaltestlib.rb.
- * dln.c (dln_load): check if a different libruby is loaded by the
- extension library, and then bail out to get rid of very
- frequently reported stale bug reports.
+Tue Nov 1 22:08:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 30 19:51:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: reject llvm-gcc.
- * compile.c (iseq_compile_each): revert r46873 and r46875, not to
- allow to execute private readers by pretending op assign.
- [ruby-core:68984] [Bug #11096]
+Tue Nov 1 21:39:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Apr 30 17:02:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * io.c (rb_cloexec_pipe): remove workaround of r33587.
+ The bug of NetBSD is fixed on Mon Oct 31 21:31:29 UTC 2011.
+ http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45545
- * rational.c: Added documentation for rational literal.
- [Bug #11075][fix GH-885][ci skip] Patch by @shishir127
+Tue Nov 1 19:49:08 2011 Tanaka Akira <akr@fsij.org>
-Thu Apr 30 16:39:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_reopen): call rb_fd_fix_cloexec instead of
+ rb_maygvl_fd_fix_cloexec.
- * ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
- before other library calls and use rb_syserr_fail.
- [ruby-core:68531] [Bug #10975]
+Tue Nov 1 19:00:30 2011 Tanaka Akira <akr@fsij.org>
-Thu Apr 30 16:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_reopen): call rb_maygvl_fd_fix_cloexec after freopen().
- * parse.y (lambda): push and reset cmdarg_stack in lambda body.
- [ruby-core:69017] [Bug #11107]
+Tue Nov 1 17:17:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Apr 26 07:36:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (file_expand_path): reset coderange after expanding path.
- * enc/utf_8.c (code_to_mbclen, code_to_mbc): reject values larger
- than UTF-8 max codepoints. [Feature #11094]
+Tue Nov 1 14:55:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Apr 25 14:26:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (nogvl_io_cntl): rb_cloexec_fcntl_dupfd's 2nd argument is int.
- * string.c (str_buf_cat): expand later so that the buffer can be
- larger for further use. [Bug #11080] [Bug #11095]
+ * process.c (move_fds_to_avoid_crash): ditto.
-Fri Apr 24 23:48:45 2015 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 1 13:14:33 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * misc/ruby-electric.el: Import version 2.2.3 from
- https://github.com/knu/ruby-electric.el.
+ * vsnprintf.c (BSD_vfprintf): support 'll' prefix.
-Fri Apr 24 10:40:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
+ one.
- * win32/win32.c (rb_w32_{getc,putc}): removed. they are needed for old
- ruby (before 1.8), but not now.
+ * vsnprintf.c (__sferror): ditto.
-Fri Apr 24 08:40:13 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * vsnprintf.c (__sclearerr): ditto.
- * win32/win32.c: remove bcc related code.
+ * vsnprintf.c (__sfileno): ditto.
- * include/ruby/win32.h: ditto.
+Tue Nov 1 12:36:16 2011 Tanaka Akira <akr@fsij.org>
-Fri Apr 24 08:21:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h (rb_maygvl_fd_fix_cloexec): change the visibility for
+ ext/socket.
- * win32/win32.c (rb_acrt_lowio_lock_fh): wrap _pioinfo(i)->lock.
+Tue Nov 1 12:00:53 2011 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (rb_acrt_lowio_unlock_fh): ditto.
+ * io.c (rb_maygvl_fd_fix_cloexec): renamed from fd_set_cloexec.
-Fri Apr 24 06:47:19 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h (rb_maygvl_fd_fix_cloexec): declared.
- * win32/win32.c (_filbuf): msvc14 doesn't have it, use _fgetc_nolock.
+ * ext/socket/init.c (cloexec_accept): use rb_maygvl_fd_fix_cloexec.
+ (rsock_s_accept_nonblock): use rb_update_max_fd.
+ (rsock_s_accept): use rb_update_max_fd.
- * win32/win32.c (_flsbuf): msvc14 doesn't have it, use _fputc_nolock.
+Tue Nov 1 08:24:40 2011 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (vcruntime_file): define vcruntime_file on msvc14
- because it doesn't export FILE's internal structure.
+ * ext/socket/init.c (cloexec_accept): new function to use accept4 if
+ available.
+ (rsock_s_accept_nonblock): use cloexec_accept.
+ (accept_blocking): ditto.
- * win32/win32.c (FILE_COUNT): added to abstract FILE->_cnt.
+ * ext/socket/extconf.rb: check accept4.
- * win32/win32.c (FILE_READPTR): added to abstract FILE->_ptr.
+Tue Nov 1 07:31:55 2011 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (FILE_FILENO): added to abstract FILE->_file.
+ * ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
+ available.
- * win32/win32.c (init_stdhandle): use FILE_FILENO.
+ * ext/socket/unixsocket.c (recvmsg_blocking): ditto.
- * win32/win32.c (rb_w32_getc): use FILE_COUNT and FILE_READPTR.
+Tue Nov 1 05:59:41 2011 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (rb_w32_putc): ditto.
+ * ext/socket/socket.c (rsock_socketpair): use SOCK_CLOEXEC if
+ available.
-Fri Apr 24 06:37:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 1 02:56:17 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c (dupfd): use _set_osfhnd.
+ * ruby.c (load_file_internal): convert the encoding of load path if
+ needed by platform. calling open() was replaced by rb_cloexec_open()
+ at r33549, but the function expected UTF-8 pathname on Windows.
+ (open() expected "locale" pathname.)
+ reported by taco via IRC.
- * win32/win32.c (rb_w32_wopen): use _set_osflags.
+ * ruby.c (load_file): change the type of the 2nd parameter to pass its
+ encoding to load_file_internal().
-Thu Apr 24 05:38:01 2015 Koichi Sasada <ko1@atdot.net>
+ * ruby.c (process_options, rb_load_file): follow above change.
+ NOTE: we should pass encoding information to rb_load_file().
- * gc.c (gc_mark_roots): fox to work PRINT_ROOT_TICKS.
+Mon Oct 31 23:49:38 2011 Tanaka Akira <akr@fsij.org>
-Fri Apr 24 04:49:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair): extracted from
+ rsock_sock_s_socketpair.
- * win32/Makefile.sub: MSVC14 have struct timespec.
+Mon Oct 31 23:31:53 2011 Tanaka Akira <akr@fsij.org>
- * win32/rtname.cmd: support vcruntime140.dll.
+ * ext/socket/init.c (rsock_socket): use SOCK_CLOEXEC if available.
- * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and
- daylight but have _tzname and _daylight.
+Mon Oct 31 21:47:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Apr 23 11:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
+ but its return value is -1 or larger than 0.
- * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow
- symbols to just instance_eval/exec, except for definition of
- singletons. [ruby-core:68961] [Bug #11086]
+Mon Oct 31 22:04:54 2011 Tanaka Akira <akr@fsij.org>
-Thu Apr 23 10:01:36 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
- * lib/delegate.rb: fix a typo.
- [fix GH-881][ci skip] Patch by @Zorbash
+Mon Oct 31 21:47:48 2011 Tanaka Akira <akr@fsij.org>
-Wed Apr 22 18:36:50 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
+ rb_fd_set_cloexec.
- * lib/net/imap.rb (move, uid_move): support the MOVE command defined
- in RFC6851. Patch by ojab ojab.
- [ruby-core:68960] [Feature #11077]
+ * io.c: follow the above renaming.
-Tue Apr 22 12:42:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * ext/pty/pty.c: ditto.
- * test/ruby/test_object.rb: add tests for Kernel#String and Kernel#Array.
- [fix GH-879][fix GH-880] Patch by @yui-knk
+ * ext/socket/init.c: ditto.
-Tue Apr 21 20:46:02 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+ * ext/socket/socket.c: ditto.
- * test/ruby/test_object.rb: renamed tests to explicitly class name.
- [fix GH-877] Patch by @yui-knk
+ * ext/socket/ancdata.c: ditto.
-Tue Apr 21 05:31:00 2015 Eric Wong <e@80x24.org>
+ * ext/socket/unixsocket.c: ditto.
- * ext/socket/lib/socket.rb (connect_internal): avoid common exceptions
- from connect_nonblock. [ruby-core:68909]
+Mon Oct 31 21:02:43 2011 Tanaka Akira <akr@fsij.org>
-Mon Apr 20 23:46:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/resolv.rb (Resolv::DNS): retry IO.select for premature wakeup.
- * win32/win32.c (rb_w32_wreadlink): follow the official format of
- REPARSE_DATA_BUFFER structure.
+Mon Oct 31 20:14:22 2011 Tanaka Akira <akr@fsij.org>
-Mon Apr 20 20:23:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (fd_set_cloexec): clear CLOEXEC flag for standard file
+ descriptors.
+ (rb_cloexec_dup): use rb_cloexec_fcntl_dupfd.
+ (rb_cloexec_fcntl_dupfd): use F_DUPFD_CLOEXEC if available.
- * common.mk ($(arch)-fake.rb): revert r50354 because bsdmake seems not
- to handle such substitution.
+Mon Oct 31 19:14:11 2011 Tanaka Akira <akr@fsij.org>
- * tool/expand-config.rb: convert path separators here.
+ * test/resolv/test_dns.rb: don't check maximum slept time.
+ ruby doesn't guarantee the maximum time because it is not a
+ realtime application.
-Mon Apr 20 16:52:20 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 31 13:10:06 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * tool/fake.rb: don't fake libdir. use libdirname instead.
+ * win32/win32.c (setfl): extract from fcntl().
-Mon Apr 20 16:49:52 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/win32.c (dupfd): new function to support F_DUPFD. based on a
+ patch written by akr.
- * lib/mkmf.rb (MakeMakefile#configuration): DESTDIR should never affect
- top_srcdir and builddir.
+ * win32/win32.c (fcntl): use above functions.
-Mon Apr 20 16:18:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/win32.h (F_DUPFD): define. [experimental]
- * common.mk ($(arch)-fake.rb): fix the path separator up for Windows.
+ * include/ruby/win32.h (F_SETFL): change the value to correspond with
+ other platforms.
-Mon Apr 20 15:02:47 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 31 12:37:50 2011 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (rb_w32_wreadlink): fixed a bug that a junction misses
- its drive letter.
+ * ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt if
+ available.
-Mon Apr 20 12:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Oct 31 12:05:24 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/*: use license instead of licence.
- [fix GH-876][ci skip] Patch by @davydovanton
- * lib/net/https.rb: ditto.
+ * io.c (rb_cloexec_dup2): check oldfd == newfd at first.
+ pointed by KOSAKI Motohiro. [ruby-dev:44713]
-Mon Apr 20 12:42:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Mon Oct 31 10:50:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * benchmark/bm_so_meteor_contest.rb: fix a typo.
- [fix GH-876][ci skip] Patch by @davydovanton
- * tool/bisect.sh: ditto.
- * tool/update-deps: ditto.
+ * io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.
-Mon Apr 20 11:10:46 2015 Eric Wong <e@80x24.org>
+ * io.c (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd() only if the
+ platform has F_DUPFD.
- * ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN
- [ruby-core:68926] [Feature #11072]
- * test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect
+Mon Oct 31 00:50:00 2011 Luis Lavena <luislavena@gmail.com>
-Sun Apr 19 12:19:17 2015 Chad Brewbaker <crb002@gmail.com>
+ * configure.in: check -fno-omit-frame-pointer acceptance and usage
+ under MinGW. [ruby-core:39957] [Bug #5407]
- * ext/{etc,openssl,tk}: Adding parens and comparisons around
- assignments to get rid of Wparentheses warnings. [Fix GH-875]
+Mon Oct 31 00:16:11 2011 Tanaka Akira <akr@fsij.org>
-Sun Apr 19 10:42:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/intern.h (rb_cloexec_fcntl_dupfd): declared.
- * hash.c (get_env_cstr): environment variables must be ASCII
- compatible, as dummy encodings and wide char encodings are
- unsupported now.
+ * io.c (rb_cloexec_fcntl_dupfd): new function.
+ (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd.
-Sat Apr 18 15:18:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (move_fds_to_avoid_crash): use rb_cloexec_fcntl_dupfd.
- * ext/json/parser/parser.rl: raise with messages in UTF-8
- encoding. [ruby-core:67386] [Bug #10705]
+Sun Oct 30 22:46:46 2011 Tanaka Akira <akr@fsij.org>
-Fri Apr 17 11:58:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: check pipe2.
- * string.c (STR_SET_EMBED): clear NOFREE flag at embedding as
- embedded strings no longer refer static strings.
- [ruby-core:68436] [Bug #10942]
+ * io.c (rb_cloexec_pipe): use pipe2 if available.
-Thu Apr 16 05:15:50 2015 Eric Wong <e@80x24.org>
+Sun Oct 30 22:32:44 2011 Tanaka Akira <akr@fsij.org>
- * NEWS: note IO#wait_readable change in r50263
+ * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)
+ for MinGW. reported by Luis Lavena. [ruby-core:40526] [Bug #5516]
-Thu Apr 16 05:09:36 2015 Eric Wong <e@80x24.org>
+Sun Oct 30 21:12:47 2011 Tanaka Akira <akr@fsij.org>
- * lib/net/protocol.rb (rbuf_fill): use IO#wait_*able
- * lib/net/http/generic_request.rb (wait_for_continue): ditto
- [ruby-core:68891] [Feature #11056]
+ * include/ruby/intern.h (rb_cloexec_pipe): declared.
-Wed Apr 15 18:43:43 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (rb_cloexec_pipe): new function.
+ (rb_pipe): use rb_cloexec_pipe.
- * vm_trace.c (rb_tracepoint_new): fix documentation.
- Commented by @emilsoman.
+ * thread_pthread.c (rb_thread_create_timer_thread): use
+ rb_cloexec_pipe.
-Wed Apr 15 17:36:51 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 30 20:06:07 2011 Tanaka Akira <akr@fsij.org>
- * vm_trace.c (rb_tracepoint_new): Add documentation for
- rb_tracepoint_new C level API [ci skip]
- Provided by @emilsoman. [fix GH-869]
+ * io.c (rb_cloexec_dup): refine control flow.
+ (rb_cloexec_dup2): ditto.
-Wed Apr 15 10:37:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+Sun Oct 30 18:45:50 2011 Tanaka Akira <akr@fsij.org>
- * doc/contributors.rdoc: fix a typo. Patch by @davydovanton
- [fix GH-872][ci skip]
- * doc/syntax/methods.rdoc: ditto.
- * ext/digest/sha2/sha2.c: ditto.
- * ext/socket/ipsocket.c: ditto.
- * ext/tk/*: ditto.
+ * ruby.c (fill_standard_fds): new function to open closed standard
+ file descriptors.
+ (ruby_sysinit): call fill_standard_fds.
-Wed Apr 15 07:51:23 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+Sun Oct 30 10:50:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * doc/extension.ja.rdoc: Added description of TypedData_XXX.
- Deprecated the old DATA_XXX.
- Reviewed by ko1 and nobu.
- Fixes [ruby-dev:40881] #3064
+ * tool/rbinstall.rb (install_recursive, bin-comm): split mere
+ string not path name. [ruby-core:40462] [Bug #5492]
- * doc/extension.rdoc: ditto.
+Sun Oct 30 10:47:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 15 07:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_cloexec_dup, rb_cloexec_dup2): CLOEXEC has been set if
+ dup3 succeeded.
- * thread_pthread.c (reserve_stack): keep sp safe zone to get rid
- of crash by -fstack-check. [ruby-core:68740] [Bug #11030]
+Sun Oct 30 09:58:48 2011 Tanaka Akira <akr@fsij.org>
-Tue Apr 14 16:03:49 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (rb_cloexec_dup): don't allocate standard file descriptors.
- * tool/merger.rb (versionup): should also increment revision when
- changing teeny.
+Sun Oct 30 08:29:51 2011 Tanaka Akira <akr@fsij.org>
-Tue Apr 14 11:24:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file
+ descriptors.
- * ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
- conflict on cygwin. [ruby-core:68877] [Bug #11065]
+Sun Oct 30 07:47:10 2011 Tanaka Akira <akr@fsij.org>
-Tue Apr 14 08:59:04 2015 Zachary Scott <e@zzak.io>
+ * configure.in: check dup3.
- * gc.c: [DOC] Improve documentation for ObjectSpace.count_objects
- with regards to `:TOTAL` key, with patch by @schneems [Fixes GH-871]
- https://github.com/ruby/ruby/pull/871 [Bug #11067]
+ * io.c (rb_cloexec_dup2): use dup3 if available.
-Mon Apr 13 22:44:07 2015 Tanaka Akira <akr@fsij.org>
+Sat Oct 29 22:06:37 2011 Tanaka Akira <akr@fsij.org>
- * test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.
+ * include/ruby/intern.h (rb_cloexec_dup2): declared.
- * test/ruby/test_io.rb: Use File.mkfifo.
+ * io.c (rb_cloexec_dup2): new function.
+ (io_reopen): use rb_cloexec_dup2.
- * test/ruby/test_file_exhaustive.rb: Ditto.
+Sat Oct 20 21:08:18 2011 Tajima Akio <artonx@yahoo.co.jp>
- * test/ruby/test_process.rb: Ditto.
+ * win32/Makefile.sub (CONFIG_H): have stdint.h if VC2010.
+ [Bug #5243]
-Mon Apr 13 21:20:20 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+Sat Oct 29 20:59:08 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/ssl.rb: stricter hostname verification
- following RFC 6125. with the patch provided by Tony Arcieri and
- Hiroshi Nakamura [ruby-core:61545] [Bug #9644]
- * test/openssl/test_ssl.rb: add tests for above.
+ * io.c (rb_cloexec_dup): use F_DUPFD_CLOEXEC if available.
-Sun Apr 12 18:40:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Oct 29 20:00:26 2011 Tanaka Akira <akr@fsij.org>
- * ext/json/json.gemspec: bump version to 1.8.2.
- * ext/json/lib/json/version.rb: ditto.
+ * include/ruby/intern.h (rb_cloexec_dup): declared.
-Sun Apr 12 18:12:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * io.c (rb_cloexec_dup): new function.
+ (ruby_dup): use rb_cloexec_dup.
- * ext/json/json.gemspec, lib/rdoc/rdoc.gemspec: added gemspec directly.
- * defs/default_gems, tool/rbinstall.rb: removed default_gems definition.
- it make simple installation for default gems.
+ * ext/pty/pty.c (pty_getpty): use rb_cloexec_dup.
-Sun Apr 12 17:35:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
- * ext/json/*, test/json/*: Reverted r50231. Because it's not
- working with cross-compile environment.
+Sat Oct 29 16:11:34 2011 Tanaka Akira <akr@fsij.org>
-Sun Apr 12 15:34:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.
- * parse.y (arg): fix segfault by null caused by syntax error.
- [ruby-core:68851] [Bug #10957]
+Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
-Sun Apr 12 15:11:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * io.c (rb_cloexec_open): use O_CLOEXEC if available.
- * lib/rubygems/test_case.rb: use explicitly exception class and reverted
- to require JSON library for rubygems tests with Ruby 2.2.0 or earlier.
+Sat Oct 29 12:57:15 2011 Tanaka Akira <akr@fsij.org>
-Sun Apr 12 15:10:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (ruby_setsid): use rb_cloexec_open.
+ (rb_daemon): ditto.
- * ext/io/wait/wait.c (io_wait_readable): simply returns that IO is
- readable without blocking, but no longer returns EOF.
+ * ruby.c (load_file_internal): ditto.
- * ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling
- first and check FIONREAD optionally to see if EOF.
- [ruby-core:36805] [Feature #4849]
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
-Sun Apr 12 14:53:23 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * random.c (fill_random_seed): ditto.
- * lib/rubygems/test_case.rb: fixed json load error for rubygems tests.
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
-Sun Apr 12 14:13:28 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/io/console/console.c (console_dev): ditto.
- * gc.c: Document require name for ObjectSpace methods.
- [ci skip][fix GH-860] Patch by @schneems
+Sat Oct 29 10:40:19 2011 Tanaka Akira <akr@fsij.org>
-Sun Apr 12 13:54:05 2015 Tanaka Akira <akr@fsij.org>
+ * include/ruby/intern.h (rb_cloexec_open): declared.
- * test/ruby/test_io.rb: New test that open(fifo) doesn't block other
- threads.
+ * io.c (fd_set_cloexec): extracted from rb_fd_set_cloexec.
+ (rb_cloexec_open): new function.
+ (sysopen_func): use rb_cloexec_open.
+ (rb_sysopen_internal): use rb_update_max_fd instead of
+ rb_fd_set_cloexec.
-Sun Apr 12 13:52:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Oct 29 09:05:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/coverage/coverage.c: Remove extension from require argument.
- [ci skip][fix GH-870] Patch by @yui-knk
+ * thread_pthread.h: no Structured Exception Handling like macros.
+ [ruby-core:40432] [Bug #5491]
-Sun Apr 12 10:29:14 2015 Eric Wong <e@80x24.org>
+Fri Oct 28 22:05:34 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock):
- support `exception: false'
- * (get_no_exception): move function location
- * ext/socket/socket.c (sock_connect_nonblock):
- support `exception: false'
- * test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception):
- test `exception: false' on connect,
- rename from `test_accept_nonblock_no_exception'
- * test/socket/test_nonblock.rb (test_connect_nonblock_no_exception):
- new test
+ * ext/sdbm/_sdbm.c: RCS $Id$ removed.
-Sun Apr 12 09:57:16 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 27 18:58:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_file_exhaustive.rb: Test a block device on GNU/Linux.
+ * parse.y (parser_nextc): set encoding for the buffer of ripper.
-Sun Apr 12 09:24:03 2015 Tanaka Akira <akr@fsij.org>
+Fri Oct 28 06:06:08 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_file_exhaustive.rb: Test a file not owned.
+ * ext/sdbm/_sdbm.c (sdbm_prep): set FD_CLOEXEC flags for file
+ descriptors.
+ (fd_set_cloexec): new function.
-Sun Apr 12 09:05:44 2015 Tanaka Akira <akr@fsij.org>
+Fri Oct 28 03:01:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/fiddle/depend: Fix "Wrong mix of special targets" error with
- OpenBSD make.
+ * vm_insnhelper.c (vm_call_cfunc): adding back useless hack. For some
+ reason, this fixes CFP errors on OS X 10.7.
-Sun Apr 12 09:04:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 28 00:09:31 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_file_exhaustive.rb: Windows doesn't support Unix file
- modes.
+ * ext/sdbm/_sdbm.c (sdbm_prep): refactored for less nesting.
-Sun Apr 12 08:56:44 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 27 18:28:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/-test-/file/fs.c: OpenBSD needs sys/param.h before sys/mount.h.
+ * configure.in (RUBY_DEFINE_IF): revert r33534 partially to get
+ rid of AS_ECHO which is not available in autoconf 2.61.
+ [ruby-dev:44702]
-Sun Apr 12 08:52:01 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 27 16:10:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_file_exhaustive.rb: Test suid, sgid and sticky file.
+ * bignum.c (rb_big_divide): raise ZeroDivisionError if divisor is
+ zero, as well as Fixnum. [ruby-core:40429] [Bug #5490]
-Sat Apr 11 23:48:30 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Oct 27 14:56:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * template/fake.rb.in: Don't assign baseruby, Because it's affect to
- Makefile of native gem like json on bundled gems.
+ * configure.in (RUBY_FUNC_ATTRIBUTE): unset temporary variable.
-Sat Apr 11 23:33:22 2015 Tanaka Akira <akr@fsij.org>
+ * configure.in (RUBY_STACK_GROW_DIRECTION): substitute CPU name as
+ shell variable name. based on the patch by The Written Word Inc. at
+ [ruby-core:40421]. [Bug #5488]
- * file.c (rb_f_test): Consider nsec for "=", "<" and ">" for "test"
- method.
+Thu Oct 27 09:57:56 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Apr 11 23:26:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined.
+ patched by The Written Word Inc. [ruby-core:40422] [Bug #5489]
- * tool/rbinstall.rb: support destdir for native extension gem.
+Thu Oct 27 08:47:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Apr 11 21:02:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/psych/parser.c: remove unused variable.
- * test/ruby/test_file_exhaustive.rb
- (TestFileExhaustive#test_stat_socket_p): r50226 accidentally missed
- the guard for non-unix environments.
+Thu Oct 27 08:38:41 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Apr 11 20:14:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/openssl/extconf.rb: add -Wall flag by default when compiler is
+ GCC.
- * ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
- [fix GH-867][Feature #11057]
- * test/ruby/test_extlibs.rb: removed json gem from existence extensions.
- * gems/bundled_gems: added json gem into bundled gem.
- * lib/rdoc/rubygems_hook.rb: ignored no json environment.
- * lib/rubygems/test_case.rb, test/rubygems/*: ditto.
- * lib/rdoc/test_case.rb, test/rdoc/*: ditto.
+Wed Oct 26 15:24:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 11 15:56:58 2015 Tanaka Akira <akr@fsij.org>
+ * file.c (rb_file_join): honor input encodings than ASCII-8BIT.
+ [ruby-core:40338] [Bug #5483]
- * test/ruby/test_file_exhaustive.rb: Create sample files lazily.
+Tue Oct 25 21:52:31 2011 Tanaka Akira <akr@fsij.org>
-Sat Apr 11 14:03:47 2015 Tanaka Akira <akr@fsij.org>
+ * include/ruby/defines.h: use "__sparc" instead of "sparc" and
+ "__sparc__".
- * test/ruby/test_file_exhaustive.rb: Test character device using
- /dev/null.
+ * dln.c: ditto.
-Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ [ruby-dev:44694]
- * lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
- utility methods to append compiler options.
+Tue Oct 25 06:34:39 2011 Eric Hodel <drbrain@segment7.net>
-Sat Apr 11 08:22:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * re.c (match_aref): Use <code> around indexing examples to prevent
+ hyperlinks. [ruby-talk:389396]
- * lib/rdoc/text.rb: removed duplicated code.
+Mon Oct 24 23:55:31 2011 Tanaka Akira <akr@fsij.org>
-Sat Apr 11 04:46:42 2015 Eric Wong <e@80x24.org>
+ * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
- * lib/net/protocol.rb (rbuf_fill): avoid exception with read_nonblock
- [ruby-core:68787] [Feature #11044]
+ * math.c: ditto.
-Fri Apr 10 23:57:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c: ditto.
- * dir.c (need_normalization): use getattrlist() if fgetattrlist()
- is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054]
+ * atomic.h: ditto.
-Fri Apr 10 22:29:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/io/wait/wait.c: ditto.
- * lib/mkmf.rb (try_compile): pass the given werror flag to try_do
- to check if stderr is empty.
+ [ruby-dev:44693]
- * lib/mkmf.rb (try_cflags, try_ldflags): default werror to true.
+Mon Oct 24 22:45:37 2011 Tanaka Akira <akr@fsij.org>
- * win32/Makefile.sub (WERRORFLAG): remove useless option. VC does
- not make warnings of unknown command option an error.
+ * io.c: use "__sun" instead of "sun" to detect SunOS.
-Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
+ * dln.c: ditto.
- * test/ruby/test_file_exhaustive.rb: Test socket.
+ * cont.c: ditto.
-Fri Apr 10 19:38:46 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/sdbm/_sdbm.c: ditto.
- * test/objspace/test_objspace.rb: remove debug prints.
+ [ruby-dev:44693]
-Fri Apr 10 19:35:51 2015 Koichi Sasada <ko1@atdot.net>
+Mon Oct 24 22:38:08 2011 Tanaka Akira <akr@fsij.org>
- * ext/objspace/objspace.c: add ObjectSpace.count_imemo_objects method
- to count imemo objects for each type.
+ * ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
+ grantpt() on Solaris. grantpt() doesn't work with CLOEXEC on
+ Solaris 10.
+ reported by Naohisa GOTO. [ruby-dev:44688] [Bug #5475]
- * test/objspace/test_objspace.rb: add a test.
+Mon Oct 24 08:18:14 2011 Tanaka Akira <akr@fsij.org>
- * NEWS: describe about this addition.
+ * io.c (copy_stream_fallback_body): check nil for EOF of read method.
+ patch by Eric Wong. [ruby-core:39134] [Bug #5237]
-Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
+Sun Oct 23 18:21:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/ruby/test_file_exhaustive.rb: Test anonymous pipe.
+ * ext/tk/MANUAL_tcltklib.eng: fix typo.
-Fri Apr 10 19:31:56 2015 Tanaka Akira <akr@fsij.org>
+Sun Oct 23 18:03:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_file_exhaustive.rb: Test named pipe.
+ * numeric.c (rb_infinity, rb_nan): aggregated member initializers
+ need braces.
-Fri Apr 10 19:10:34 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 23 16:43:43 2011 Naohisa Goto <ngotogenome@gmail.com>
- * ext/objspace/objspace.c (setup_hash): unify common routine.
+ * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
-Fri Apr 10 18:29:49 2015 Tanaka Akira <akr@fsij.org>
+Sun Oct 23 16:33:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * process.c (rb_execarg_parent_start1): Handle EINTR.
+ * ext/tk/MANUAL_tcltklib.eng: fix typo. reported by Mimura-san.
+ [ruby-dev:44683] [Bug #5471]
-Fri Apr 10 17:27:58 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 23 08:01:29 2011 Tanaka Akira <akr@fsij.org>
- * vm.c (vm_exec): check other events when RETURN is thrown.
- [Bug #10724]
+ * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is
+ defined. reported by Luis Lavena. [ruby-core:40281] [Bug #5470]
- * test/ruby/test_settracefunc.rb: add a test.
+Sat Oct 22 19:48:50 2011 Tanaka Akira <akr@fsij.org>
-Fri Apr 10 11:44:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl.rb (test_multibyte_read_write): start server
+ for each length to avoid race condition.
- * ext/date/extconf.rb: check warnings.
+Sat Oct 22 18:49:24 2011 Tanaka Akira <akr@fsij.org>
- * lib/mkmf.rb (try_cflags): pass options to try_compile.
+ * include/ruby/intern.h (rb_fd_set_cloexec): declared.
- * win32/Makefile.sub (WERRORFLAG): make unknown command line
- options an error.
+ * io.c (rb_fd_set_cloexec): new function.
+ (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
+ (rb_sysopen_internal): ditto.
+ (rb_pipe): ditto.
+ (io_reopen): ditto.
+ (io_cntl): ditto.
-Fri Apr 10 08:00:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * process.c (rb_f_exec): change the default :close_others option to
+ true.
+ (rb_f_system): ditto.
+ (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
+ close-on-exec flag.
+ (ruby_setsid): ditto.
+ (rb_daemon): ditto.
- * test/ruby/test_process.rb: unfortunately, windows is not POSIX...
- cygwin has mkfifo command, but it does not affect system-wide.
+ * thread_pthread.c (rb_thread_create_timer_thread): call
+ rb_fd_set_cloexec to set close-on-exec flag.
-Fri Apr 10 02:18:53 2015 Tanaka Akira <akr@fsij.org>
+ * ruby.c (load_file_internal): ditto.
- * test/ruby/test_process.rb: Use mkfifo command instead of mknod
- command to create a named pipe. mkfifo command is defined by POSIX.
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
-Fri Apr 10 01:29:05 2015 Tanaka Akira <akr@fsij.org>
+ * random.c (fill_random_seed): ditto.
- * process.c: Release GVL when opening a file in spawn() to avoid whole
- process blocking when opening a named pipe.
- (open_func): New function.
- (rb_execarg_parent_start1): Extracted from rb_execarg_parent_start and
- use rb_thread_call_without_gvl2 to release GVL when opening a file.
- (rb_execarg_parent_start): Invoke rb_execarg_parent_start1 via
- rb_protect and invoke rb_execarg_parent_end when error.
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
-Thu Apr 9 22:19:19 2015 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
- * process.c (redirect_open): Removed.
+ * ext/socket/init.c (rsock_socket): ditto.
+ (rsock_s_accept_nonblock): ditto.
+ (rsock_s_accept): ditto.
-Thu Apr 9 21:38:20 2015 Tanaka Akira <akr@fsij.org>
+ * ext/socket/socket.c (rsock_sock_s_socketpair): ditto.
- * internal.h (rb_execarg_parent_end): Declared.
+ * ext/socket/ancdata.c (discard_cmsg): ditto.
+ (make_io_for_unix_rights): ditto.
- * process.c: "spawn" opens files in the parent process.
- (check_exec_redirect): Add an placeholder for fd in parameters
- for fd_open.
- (check_exec_fds_1): Delete fd_open condition.
- (check_exec_fds): Don't call check_exec_fds_1 with fd_open.
- (rb_execarg_parent_start): Open files specified as "spawn" options
- and add "dup2" options.
- (rb_execarg_parent_end): New function to close opened fds.
- (run_exec_open): Removed.
- (rb_execarg_run_options): Don't call run_exec_open.
- (rb_spawn_internal): Call rb_execarg_parent_end.
+ * ext/socket/unixsocket.c (unix_recv_io): ditto.
- * io.c (pipe_open): Call rb_execarg_parent_end.
+ * ext/io/console/console.c (console_dev): ditto.
- * ext/pty/pty.c (establishShell): Call rb_execarg_parent_end.
+ [ruby-core:38140] [Feature #5041]
-Thu Apr 9 20:52:31 2015 Tanaka Akira <akr@fsij.org>
+Sat Oct 22 17:46:27 2011 Tanaka Akira <akr@fsij.org>
- * internal.h (rb_execarg_parent_start): Renamed from rb_execarg_fixup.
+ * lib/resolv.rb: fix a exception name in previous patch.
- * process.c: Follows the above change.
+Sat Oct 22 17:43:33 2011 Tanaka Akira <akr@fsij.org>
- * io.c: Ditto.
+ * lib/resolv.rb: make timeout configurable for DNS query.
+ patch by Eric Wong. [ruby-core:38533] [Feature #5100]
- * ext/pty/pty.c: Ditto.
+Sat Oct 22 02:07:48 2011 Naohisa Goto <ngotogenome@gmail.com>
-Thu Apr 9 20:35:12 2015 Tanaka Akira <akr@fsij.org>
+ * numeric.c (rb_infinity, rb_nan): use union to prevent bus error
+ caused by misalignment. [Bug #5469] [ruby-dev:44657]
- * process.c (fd_clear_cloexec): Extracted from run_exec_dup2.
+ * include/ruby/missing.h (INFINITY, NAN): ditto
-Thu Apr 9 09:26:47 2015 Eric Wong <e@80x24.org>
+Fri Oct 21 22:02:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ccan/list/list.h: sync with ccan upstream
- [ccan commit c2fbfe5282ba264f3485586e7efa8a5967f2d386]
+ * gc.c (initial_params): pack in a struct.
-Thu Apr 9 08:24:03 2015 Masahiro Tomita <tommy@tmtm.org>
+ * gc.c (rb_gc_set_params): set parameters always.
+ [ruby-dev:44648] [Bug #5467]
- * ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of
- addrinfo. [ruby-dev:48923] [Bug #11051]
+Fri Oct 21 12:10:20 2011 Naohisa Goto <ngotogenome@gmail.com>
-Wed Apr 8 17:45:02 2015 Shannon Skipper <shannonskipper@gmail.com>
+ * atomic.h: change Solaris checking macro because atomic_ops can work
+ not only with Sun Studio but also with Fujitsu C Compiler.
- * version.c (Init_version): the version of the engine or
- interpreter. [Fix GH-858]
+Fri Oct 21 02:11:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Wed Apr 8 16:15:30 2015 Kenta Murata <mrkn@cookpad.com>
+ * ext/openssl/ossl_ns_spki.c: Complete documentation.
+ * test/openssl/test_ns_spki.rb: Integrate SPKI#to_text.
- * bigdecimal: conform to ruby's license. [ruby-core:68466] [Bug #10952]
+Thu Oct 20 22:47:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Apr 8 14:57:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/win32.c (socklist_insert, socklist_lookup, socklist_delete):
+ new functions to wrap of st_insert(), st_lookup() and st_delete() to
+ socklist.
+ allocating socklist is deferred until it is really needed.
- * win32/win32.c (rb_w32_wreadlink): should treat junctions like as
- symlinks.
+ * win32/win32.c (exit_handler): delete socklist only if it is
+ initialized.
-Wed Apr 8 14:03:47 2015 Koichi Sasada <ko1@atdot.net>
+ * win32/win32.c (rb_w32_sysinit, StartSockets): refactoring: move
+ initialization of select_mutex to StartSockets().
- * test/ruby/test_symbol.rb: fix syntax error.
+ * win32/win32.c (exit_handler): refactoring: delete select_mutex only
+ if winsock is used.
-Wed Apr 8 13:01:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 20 22:38:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * hash.c (rb_any_hash): Symbols are compared by the identities
- always. [ruby-core:68767] [Bug #11035]
+ * ext/openssl/ossl_pkcs5.c: add note on timing attacks and general
+ documentation.
-Tue Apr 7 10:22:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Oct 20 21:19:15 2011 Naohisa Goto <ngotogenome@gmail.com>
- * internal.h: fix typo. Patch by @sferik [fix GH-865]
+ * vm_eval.c (check_funcall): set array elements one-by-one to fix
+ compile error with Fujitsu C Compiler 5.6 on Solaris 10 on Sparc.
+ [Bug #5464] [ruby-dev:44632]
-Mon Apr 6 22:52:35 2015 Tanaka Akira <akr@fsij.org>
+Thu Oct 20 13:09:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c: Enumerable#chunk and Enumerable#slice_before no longer takes
- the initial_state argument. [Feature #10958]
+ * include/ruby/defines.h (flush_register_windows): use software
+ trap on Debian Sparc 32-bit userspace. [Bug #5244]
-Mon Apr 6 16:09:58 2015 Koichi Sasada <ko1@atdot.net>
+Thu Oct 20 12:28:22 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_args.c: protect value stack from calling other methods
- during complex parameter setting process (splat, kw, and so on).
- [Bug #11027]
+ * test/openssl/test_pkcs5.rb: add RFC 6070 tests for PBKDF2 with
+ HMAC-SHA1
- * vm_core.h: remove rb_thread_t::mark_stack_len.
- With this modification, we don't need to use th->mark_stack_len.
+Thu Oct 20 11:42:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_keyword.rb: add a test.
+ * util.c (mmprepare): fix for fragmental size.
- * cont.c (cont_capture): catch up this fix.
+ * util.c (mmswap_, mmrot3_): portability improvement.
- * vm.c (rb_thread_mark): ditto.
+Thu Oct 20 05:58:02 2011 Eric Hodel <drbrain@segment7.net>
-Mon Apr 6 11:26:42 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/openssl/ossl_ns_spki.c (Init_ossl_ns_spki): Stub documentation
+ for Netscape SPKI.
- * tool/downloader.rb (http_options): prevent content auto decoding
- because this is a downloader.
+Thu Oct 20 05:13:39 2011 Ryan Davis <ryand-ruby@zenspider.com>
-Sun Apr 5 09:55:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/minitest/*: Imported minitest 2.6.2 (r6712)
+ * test/minitest/*: ditto
- * doc/contributing.rdoc: update Maintainers list.
+Thu Oct 20 06:55:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sun Apr 5 09:11:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
+ binary data.
+ * test/openssl/test_ssl.rb: Add test for it.
- * tool/rbinstall.rb: fix bin script permission of bundled gems.
+ Thanks to Niklas Baumstark for reporting the issue!
-Sun Apr 5 08:46:08 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ [Ruby 1.9 - Bug #5233] [ruby-core:39120]
- * tool/rbinstall.rb: support --program-suffix option.
+Wed Oct 19 17:06:54 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Apr 4 21:31:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * version.h (RUBY_VERSION): finally declare start of 2.0 work!
- * lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
- * test/rake/*: ditto.
- * tool/rbinstall.rb: ditto.
+Wed Oct 19 11:48:44 2011 Eric Hodel <drbrain@segment7.net>
-Sat Apr 4 11:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (Init_Exception): Document $! and $@. Provide
+ recommendations for creating exceptions for a library.
- * string.c (rb_str_setbyte): check the argument first not to
- discard shared string and code range unnecessarily until
- actually changing the contents. pointed out by headius.
+Wed Oct 19 11:25:46 2011 Eric Hodel <drbrain@segment7.net>
-Sat Apr 4 08:16:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * error.c (Init_Exception): Add hierarchy of Exception subclasses.
+ Based on patch by Sylvain Daubert. [Ruby 1.9 - Bug #5438]
- * lib/net/http.rb (edit_path): use path which is absolute ftp url
- on using ftp_proxy.
+Wed Oct 19 11:04:47 2011 Eric Hodel <drbrain@segment7.net>
-Fri Apr 3 11:43:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c: Reformat block args to a single standard, { |args| ... }.
+ Patch by b t. [Ruby 1.9 - Bug #5393]
- * vm_eval.c (vm_call0_cfunc): update invoker arguments.
+Wed Oct 19 12:11:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_insnhelper.c (vm_call_cfunc_latter): ditto.
+ * ext/openssl/ossl_ssl.c: Remove set, but unused variables.
+ ext/openssl/ossl_pkey.c: ditto
- * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix
- with rb_.
+ * ext/openssl/ossl_pkey_dh.c: Make functions passed to
+ rb_thread_blocking_region return VALUE instead of void.
+ ext/openssl/ossl_pkey_dsa.c: ditto
+ ext/openssl/ossl_pkey_rsa.c: ditto
-Thu Apr 2 16:26:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 18 23:28:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk, tool/mkconfig.rb: check the running ruby version in
- rbconfig.rb with the program version, as RUBY_VERSION has never
- been affected by --with-ruby-version option.
- [ruby-core:68639] [Bug #11002]
+ * hash.c (identhash): share with type_numhash.
- * configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
- valid version numbers, not an arbitrary string.
+ * st.c (st_hashtype_num): rename from type_numhash.
-Wed Apr 1 11:09:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 18 23:07:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (push_glob): remove indirect links of arguments for
- trampoline.
+ * vm_core.h (ruby_current_thread): probeprofiler has been removed
+ long ago.
-Wed Apr 1 09:59:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 18 23:05:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (FileUtils#mv): show the exact target path in
- the error message instead of the destination parent directory
- name. patched by Joao Britto <jabcalves AT gmail.com> at
- [ruby-core:68706]. [Bug #11021]
+ * ext/ripper/eventids2.c (ripper_init_eventids2): separate
+ initializations of IDs and objects.
-Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/ripper/tools/generate.rb (generate_eventids1): ditto.
- * doc/ChangeLog-0.06_to_0.52: added archived Changelog.
- [ruby-list:50105]
- * doc/ChangeLog-0.50_to_0.60: ditto.
- * doc/ChangeLog-0.60_to_1.1: ditto.
+ * parse.y (Init_ripper, InitVM_ripper): fix inversed roles.
-Mon Mar 30 22:02:55 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sun Oct 16 19:46:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * README.EXT.ja: add redirect [ruby-core:68631]
+ * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
+ removed nonexistent file.
-Mon Mar 30 14:42:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.gemspec (homepage): added.
- * win32/win32.c (fileattr_to_unixmode, winnt_lstat): deal with
- symbolic link than directory, and set executable bits.
+ * ext/io/console/io-console.gemspec (homepage): ditto.
-Mon Mar 30 11:27:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 14 12:13:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (copy_stream_body): use the arguments without conversion if
- having read, readpartial, and write methods, than conversion by
- to_path method. [ruby-core:68676] [Bug #11015]
+ * ext/pty/pty.c (pty_check): should return nil until the child
+ terminates or stops. [ruby-dev:44600] [Bug #2642]
-Sun Mar 29 21:08:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Fri Oct 14 11:19:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (objspace_allrefs_destruct_i): fix a typo.
- [Bug #11013]
+ * include/ruby/intern.h (rb_ary_rotate): export.
-Sun Mar 29 11:51:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 14 05:58:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (proc_binding): replicate env from method object, and
- allocate the local variable area for the iseq local table.
- [ruby-core:68673] [Bug #11012]
+ * atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.
+ [ruby-dev:44596] [Bug #5439]
-Sat Mar 28 09:19:41 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * signal.c (ruby_atomic_exchange): no needs to define on the
+ platforms where atomic.h is available.
- * ext/date/extconf.rb: try_cflags("-std=iso9899:1999") [Bug #10906]
- ruby itself (including numeric.c) is built with strict compile
- options including -std=iso9899:1999, but ext/date is not.
- By the way -std=iso9899:1999 is not only a warning option but also
- changes behavior like MACRO definitions for example INFINITY.
- gcc on Solaris affect this.
+Thu Oct 13 19:29:40 2011 Naohisa Goto <ngotogenome@gmail.com>
-Fri Mar 27 16:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
+ [ruby-dev:44596] [Bug #5439]
- * common.mk: revert using BOOTSTRAPRUBY for enc.mk, as
- enc/depend uses CONFIG. [ruby-core:68647] [Bug #11004]
+Thu Oct 13 18:13:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Mar 26 10:05:13 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
+ [ruby-dev:44596] [Bug #5439]
- * test/test_observer.rb: add tests for Observable module.
- [fix GH-859] Patch by @brightbits
+Thu Oct 13 18:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 26 06:35:10 2015 Eric Wong <e@80x24.org>
+ * gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
+ should use ATOMIC_EXCHANGE() to check the previous value.
+ [ruby-dev:44596] [Bug #5439]
- * README.EXT: add redirect [ruby-core:68631]
+Wed Oct 12 23:39:58 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Wed Mar 25 16:46:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Move duplicated tests for SSL::Session to
+ test_ssl_session.rb
- * ext/socket/extconf.rb: Solaris 11 has struct tcp_info.tcpi_ca_state,
- but it is a dummy.
+Tue Oct 11 08:49:40 2011 Eric Hodel <drbrain@segment7.net>
- * ext/socket/option.c: Solaris 11 doesn't have u_intN_t.
+ * array.c (rb_ary_initialize): Improve explanation of Array.new
+ parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425]
+ * array.c (rb_ary_s_try_convert): Fix typo (try => tries)
+ * array.c (rb_ary_rindex): Add spacing for block.
+ * array.c (rb_ary_uniq_bang): Describe block
+ * array.c (rb_ary_uniq): ditto
- * ext/socket/option.c: Solaris 11 needs inspect_tcpi_msec.
+Tue Oct 11 07:55:38 2011 Eric Hodel <drbrain@segment7.net>
- * ext/socket/raddrinfo.c: Solaris 11 has AF_PACKET but doesn't have
- related macros.
+ * array.c: Add a description to Array, minor cleanups. Patch by
+ Andrea Singh. [Ruby 1.9 - Bug #5412]
-Wed Mar 25 17:03:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 11 06:09:52 2011 Eric Hodel <drbrain@segment7.net>
- * ext/-test-/file/fs.c (get_fsname): try magic number only if
- f_type is included. [ruby-dev:48913] [Bug #11000]
+ * lib/pp.rb: Move PP documentation to top of class PP. Patch by
+ Sylvain Daubert. [Ruby 1.9 - Bug #5430]
-Wed Mar 25 11:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 11 06:06:29 2011 Eric Hodel <drbrain@segment7.net>
- * benchmark/bm_hash_aref_flo.rb: make more realistic data.
- [ruby-core:68632] [[Bug #10999]
+ * ext/coverage/coverage.c (Init_coverage): Change list format and
+ describe Coverage.result output. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5428]
-Wed Mar 25 10:39:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Tue Oct 11 05:53:23 2011 Eric Hodel <drbrain@segment7.net>
- * .document: removed needless entries.
+ * object.c (Init_Object): Add reference to BasicObject, brief
+ explanation of constant lookup. Based on patch by Alvaro Pereyra
+ Rabanal.
+ [Ruby 1.9 - Bug #5426]
-Wed Mar 25 08:07:28 2015 Eric Wong <e@80x24.org>
+Sun Oct 9 11:06:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * doc/extension.rdoc: fix spelling of filename
- * doc/extension.ja.rdoc: ditto.
+ * test/psych/test_yamldbm.rb: don't run test if the system
+ don't support yaml/dbm.
-Tue Mar 25 06:55:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * test/syck/test_yamldbm.rb: ditto.
- * complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
- to remove k_inexact_p macro.
+Sat Oct 8 08:54:56 2011 Eric Hodel <drbrain@segment7.net>
- * complex.c (k_exact_one_p): remove unused macro k_exact_one_p.
+ * enum.c (group_by): Improve group_by description. Patch by b t.
+ [#5411]
-Tue Mar 24 22:23:33 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Oct 8 03:17:51 2011 Eric Hodel <drbrain@segment7.net>
- * doc/extension.rdoc: move from toplevel document and added extname.
- * doc/extension.ja.rdoc: ditto.
+ * lib/shell.rb: Document some methods of Shell. Patch by Carol
+ Nichols. [Ruby 1.9 - Bug #5417]
-Tue Mar 24 22:06:58 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Fri Oct 7 17:54:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * doc/standard_library.rdoc: strip.
+ * lib/test/unit/assertions.rb (assert_send, assert_not_send):
+ parenthesize non-empty arguments.
-Tue Mar 24 22:06:27 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Fri Oct 7 06:35:50 2011 Eric Hodel <drbrain@segment7.net>
- * doc/standard_library.rdoc: move Thread to Extensions.
+ * array.c: Use + for arguments described in documentation to allow
+ rdoc -C2 to work better. Remove <code> from method references to
+ allow cross-references in HTML documentation.
-Tue Mar 24 21:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Oct 6 18:46:23 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * doc/contributing.rdoc: update Maintainers list.
+ * vm_eval.c (make_no_method_exception): fix typo.
-Tue Mar 24 19:10:24 2015 Koichi Sasada <ko1@atdot.net>
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
- * gc.c (gc_writebarrier_generational): fix messages for rb_bug().
- Remove `rb_' prefix.
+Thu Oct 6 16:29:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (gc_writebarrier_incremental): ditto.
+ * vm_eval.c (make_no_method_execption): extract from
+ raise_method_missing().
-Tue Mar 24 17:34:01 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_eval.c (send_internal): remove inadvertent symbol creation
+ from public_send. based on a patch by Jeremy Evans <code AT
+ jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
- * README.ja.md: should be chunibyo.
+ * vm_insnhelper.c (vm_call_method): remove inadvertent symbol
+ creation from send and __send__, too.
-Tue Mar 24 17:30:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 6 14:59:11 2011 Eric Hodel <drbrain@segment7.net>
- * ext/-test-/file/fs.c (get_fsname): return filesystem name by
- statfs/statvfs. [ruby-core:68624] [Bug #10998]
+ * lib/time.rb: Clean up Time documentation. Patch by Jake Goulding.
+ [Ruby 1.9 - Bug #5416]
-Tue Mar 24 16:46:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 6 10:00:54 2011 Eric Hodel <drbrain@segment7.net>
- * tool/redmine-backporter.rb: now doesn't required spaces just after
- `!`.
+ * enum.c (group_by): Improve documentation based on patch by b t.
-Mon Mar 23 23:18:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 6 09:56:30 2011 Eric Hodel <drbrain@segment7.net>
- * dir.c (dir_close): don't raise on double close for consistent to
- IO#close. [Feature #10950]
+ * enum.c: Clean up wording in Enumerable documentation. Patch by b t.
+ [Ruby 1.9 - Bug #5411]
-Mon Mar 23 21:22:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 6 09:17:18 2011 Eric Hodel <drbrain@segment7.net>
- * win32/file.c (rb_readlink): move from file.c for better buffer
- allocation and the result encoding.
+ * time.c (Init_Time): Remove editorial comments from Time
+ documentation, fix link.
- * win32/win32.c (wreadlink, rb_w32_ureadlink): implement readlink().
+Thu Oct 6 09:14:20 2011 Eric Hodel <drbrain@segment7.net>
-Mon Mar 23 14:40:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * time.c (Init_Time): Improve Time documentation. Patch by Shane
+ Emmons. [Ruby 1.9 - Bug #5404]
+ * lib/time.rb: Improve time.rb documentation including Time.strptime.
+ Patch by Shane Emmons. [Ruby 1.9 - Bug #5402]
- * win32/win32.c (winnt_stat): stat with following symbolic links.
+Thu Oct 6 08:54:05 2011 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (winnt_lstat): rename old winnt_stat, which does
- not follow symbolic links.
+ * random.c: Improve documentation of Random. Patch by Gregory
+ Parkhurst. [Ruby 1.9 - Bug #5410]
-Mon Mar 23 01:44:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 6 01:44:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * marshal.c (r_symreal): register symbol names as strings first so
- that r_symlink always returns valid names.
- [ruby-core:68587] [Bug #10991]
+ * cont.c (cont_mark): mark original Thread object from saved_thread.
+ [ruby-dev:44571] [Bug #5386]
- * marshal.c (r_ivar, r_object0): now need to intern symbol names.
+Wed Oct 5 16:33:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * marshal.c (r_object0): compare with symbol names.
+ * vm_insnhelper.c (vm_call_cfunc): remove useless hack.
-Sun Mar 22 22:07:40 2015 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 5 05:56:39 2011 Eric Hodel <drbrain@segment7.net>
- * doc/etc.rd.ja: Fix wrong coding for Emacs.
+ * hash.c (Init_Hash): Improve Hash documentation. Patch by Alvaro
+ Pereyra Rabanal. [Ruby 1.9 - Bug #5405]
-Sun Mar 22 09:53:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 5 05:47:59 2011 Eric Hodel <drbrain@segment7.net>
- * tool/make-snapshot (package): add default CONFIGURE name to
- follow r50039.
+ * random.c (Init_Random): Add a top-level comment for Random. Patch
+ by Brett Bim. [Ruby 1.9 - Bug #5403]
- * tool/make-snapshot (package): substitute configuration variables
- in Makefile.in instead of passing by the command line, and make
- temporary Makefile instead of a pipe.
+Wed Oct 5 02:50:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Mar 22 08:09:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
+ message attributes during parse failure.
+ * ext/psych/parser.c: Update parser to raise exception with correct
+ values.
+ * test/psych/test_exception.rb: corresponding tests.
- * common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
- strip autogenerated dependencies which have invalid syntax in
- other than nmake.
+Wed Oct 5 01:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Mar 21 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/parser.c (parse): Use context_mark for indicating error
+ line and column.
- * ext/io/console/console.c (console_set_winsize): use handle for
- writing. GetConsoleScreenBufferInfo seems failing on a handle
- for reading.
+Wed Oct 5 01:22:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * io.c: [DOC] update the example of IO#winsize to use $stdout
- instead of $stdin, which does not work on Windows. a patch by
- Jan Lelis <mail AT janlelis.de> at [ruby-core:68574].
- [Bug #10986]
+ * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
+ since postfix rescue cannot receive the exception class. Thanks
+ nagachika!
-Fri Mar 20 18:41:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 4 21:10:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * proc.c (respond_to_missing_p): check if the receiver responds to
- the given method by respond_to_missing?.
+ * class.c (class_alloc): allocate extra memory after containing
+ object setup to get rid of rare-but-potential memory leak.
- * proc.c (mnew_missing): create Method object for method_missing.
- [ruby-core:68564] [Bug #10985]
+ * gc.c (gc_mark_children): skip marking extended members if ptr is
+ NULL.
-Fri Mar 20 17:43:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Tue Oct 4 16:17:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * .travis.yml: enabled email notification.
+ * lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.
+ Reported by Christopher Eberz. [ruby-core:39903] Bug #5399
-Fri Mar 20 17:39:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Tue Oct 4 11:44:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * .travis.yml: removed Ruby 1.9.3 build on Travis CI
+ * gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
-Fri Mar 20 12:38:36 2015 Koichi Sasada <ko1@atdot.net>
+Tue Oct 4 08:33:41 2011 Eric Hodel <drbrain@segment7.net>
- * gc.c (obj_info): obj_info() can receive internal objects.
+ * ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
+ by mathew murphy. [Ruby 1.9 - Bug #5396]
- * gc.c (check_rvalue_consistency): obj_info() returns const char *.
+Tue Oct 4 08:21:51 2011 Eric Hodel <drbrain@segment7.net>
-Fri Mar 20 12:14:37 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/shellwords.rb: Update toplevel comment with an example. Patch
+ by Samnang Chhun. [Ruby 1.9 - Bug #5388]
- * gc.c (obj_info): show class name and T_DATA type_name.
+Tue Oct 4 08:15:50 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 22:12:46 2015 Koichi Sasada <ko1@atdot.net>
+ * proc.c (proc_call): Update documentation to match argument handling
+ of proc/Proc.new/lambda/->()
- * gc.c (rb_copy_wb_protected_attribute): `dest' can be WB unprotected.
+Tue Oct 4 07:59:16 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 21:25:25 2015 Koichi Sasada <ko1@atdot.net>
+ * proc.c (proc_call): Fix documentation of Proc#call vs Proc#===.
+ [Ruby 1.9 - Bug #5349]
- * gc.c (rb_copy_wb_protected_attribute): demote `dest' object.
+Tue Oct 4 07:43:18 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 16:18:00 2015 Koichi Sasada <ko1@atdot.net>
+ * array.c (rb_ary_initialize): Make Array.new description match
+ call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344]
- * gc.c, internal.h: export rb_gc_verify_internal_consistency().
+Tue Oct 4 07:35:23 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 16:15:24 2015 Koichi Sasada <ko1@atdot.net>
+ * array.c (rb_ary_initialize): Add output for examples. Patch by
+ Jonathan Mukai. [Ruby 1.9 - Bug #5216]
- * gc.c (obj_info): show allocation site if GC_DEBUG is not 0.
+Tue Oct 4 07:30:50 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 16:12:01 2015 Koichi Sasada <ko1@atdot.net>
+ * array.c (rb_ary_s_create): Add example results for Array::[]. Patch
+ by Jonathan Mukai. [Ruby 1.9 - Bug #5215]
- * gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
- * skip on incremental marking because not sure what happen :p
- * rb_gc_writebarrier_remember() is enough to mark children.
+Tue Oct 4 07:15:17 2011 Eric Hodel <drbrain@segment7.net>
-Thu Mar 19 16:08:42 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the
+ Gem namespace.
- * gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
+Tue Oct 4 06:43:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Mar 19 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb: update psych version.
+ * ext/psych/psych.gemspec: generate new gemspec for new version.
- * random.c (fill_random_bytes): release the handle in the static
- variable, not a local variable.
+Tue Oct 4 06:29:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Mar 19 06:30:35 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
+ * ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
+ in order to avoid YAML::ENGINE switching from replacing this method.
+ * test/psych/helper.rb: fix tests for method name change.
+ * test/psych/test_document.rb: ditto
+ * test/psych/visitors/test_emitter.rb: ditto
- * object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
- rb_obj_alloc() can return old object in debug.
+Tue Oct 4 06:20:19 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Mar 19 06:29:28 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
+ floating point spec defined in YAML to avoid erroneous parses.
+ * test/psych/test_numeric.rb: corresponding test.
- * test/objspace/test_objspace.rb: flag name was changed
- (long_lived -> uncollectible).
+Tue Oct 4 05:59:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Mar 19 05:30:13 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
+ constructed with a ScalarScanner.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
+ passed to the YAMLTree visitor.
- * iseq.c (iseq_mark): skip some marking if iseq->orig is available.
+Tue Oct 4 05:47:23 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass
- (done in MEMCPY).
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
+ for 1.9.2 backwards compatibility.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Fix Date string
+ generation for 1.9.2 backwards compatibility.
-Thu Mar 19 04:55:53 2015 Koichi Sasada <ko1@atdot.net>
+Mon Oct 3 23:56:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * internal.h (IMEMO_DEBUG): added.
+ * gc.c (rb_gc_set_params): output GC parameter change messages only
+ if -w/-v options are specified. these messages are output to stderr,
+ not to stdout. [ruby-core:39795] [Bug #5380]
- * internal.h: remove unused FL_IMEMO_MARK_V[0-3].
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
- * gc.c (rb_imemo_new_debug): added.
+Sun Oct 2 20:05:32 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * gc.c (obj_info): show imemo type name.
+ * vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371
+ that may cause SEGV in certain environments.
-Thu Mar 19 04:52:26 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 2 12:14:06 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * gc.c (RGENGC_OLD_NEWOBJ_CHECK): add check mechanism.
+ * test/psych/test_yamldbm.rb: add test case.
+ * test/syck/test_yamldbm.rb: ditto.
- If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects
- (not new objects) periodically.
+Sun Oct 2 11:28:09 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are
- created.
+ * lib/yaml/store.rb: make initialize method signature match the
+ superclass signature.
-Thu Mar 19 04:46:36 2015 Koichi Sasada <ko1@atdot.net>
+Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * enum.c (enum_sort_by): add WBs.
+ * io.c: fix documentation of ARGF.lineno=.
-Thu Mar 19 03:37:52 2015 Koichi Sasada <ko1@atdot.net>
+Sat Oct 1 20:03:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (check_rvalue_consistency): refactoring.
- * not inline on RGENGC_CHECK_MODE > 0.
- * check SPECIAL_CONST_P(obj) first.
- * add a check that remembered_bit is only TRUE when old (age == 3).
+ * lib/mkmf.rb (have_framework): try as Objective-C.
+ https://twitter.com/nagachika/status/120294447660539904
- * gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit.
+Sun Oct 2 08:43:25 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- remembered_bit should be TRUE only for old (age == 3) objects.
+ * vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should not
+ be marked by itself. Patch by Koichi Sasada.
+ [ruby-dev:44567] [Bug #5386]
- Actually there are no effect because demoted objects will be
- uncollectible WB unprotected objects (marked at the beginning of
- every minor GC).
+Sun Oct 2 00:42:14 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Mar 19 02:52:48 2015 Koichi Sasada <ko1@atdot.net>
+ * vm.c (rb_thread_mark): rb_thread_t needs self to be marked.
+ [ruby-dev:44566] [Bug #5386]
- * gc.c: rename terminologies.
- * long_lived -> uncollectible:
- because this bitmap does not mean "long lived objects in past",
- but means "prohibit collection these objects until next major GC".
+Sat Oct 1 09:48:53 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- Uncollectible objects consist of two types objects, one is old
- objects (WB protected objects which age == 3) and another is
- uncollectible WB unprotected objects which are referred from old
- objects
+ * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when
+ heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.
+ [ruby-core:39777] [Bug #5380]
- * remembered_wb_unprotected_objects ->
- uncollectible_wb_unprotected_objects:
- because uncollectible objects does not mean remembered objects.
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
-Wed Mar 18 17:21:12 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to
+ enable pass environment variables to child process.
- * gc.c (gc_writebarrier_generational): add an alternative write
- barrier (WB) implementation.
- When finding reference from [Old obj] to [New obj] by WB, current
- implementation marks [Old obj] as remembered old objects and marks
- children of [Old obj] at the beginning of marking.
+Thu Sep 29 13:17:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Added (but disabled) code changes current behaviour. This fix promote
- [New obj] to old and marks as a remembered old object. We can assume
- "new objects referred from old objects are maybe long-lived old
- objects".
+ * array.c (ary_join_1): should not copy the encoding of non-string
+ element after string element. [ruby-core:39776] [Bug #5379]
- Disadvantage of added algorithm is we may promote unwilling
- short-lived objects. For example, consider many new objects push and
- pop to an old stack object. All of new objects (short-lived objects)
- promote to old objects unexpectedly.
+Thu Sep 29 11:53:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- To compare these behaviour, I add this new code (but disabled it).
+ * gc.c (slot_sweep, rb_gc_finalize_deferred)
+ (rb_objspace_call_finalizer, rb_gc): run finalizers
+ sequentially. [ruby-dev:44562]
-Wed Mar 18 17:14:39 2015 Koichi Sasada <ko1@atdot.net>
+Thu Sep 29 20:37:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (RVALUE_PROMOTE_RAW): rename to RVALUE_OLD_LONG_LIVED_SET()
- to make clear.
+ * ext/gdbm/gdbm.c (rb_gdbm_fatal): adjust argument type.
-Wed Mar 18 17:10:01 2015 Koichi Sasada <ko1@atdot.net>
+Thu Sep 29 20:10:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (check_rvalue_consistency): do not need to check is_sweeping().
+ * gc.c (is_id_value, is_live_object): extract from id2ref().
-Wed Mar 18 14:13:22 2015 Koichi Sasada <ko1@atdot.net>
+ * gc.c (run_finalizer): use object instead of object id.
- * benchmark/bm_vm1_gc_wb_ary.rb: run GC to finish "marking" phase.
+Thu Sep 29 20:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/bm_vm1_gc_wb_obj.rb: ditto.
+ * use RB_TYPE_P which is optimized for constant types, instead of
+ comparison with TYPE.
- * benchmark/bm_vm1_gc_wb_ary_promoted.rb: add parameter
- full_mark: false to invoke only minor GC.
+Wed Sep 28 09:20:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/bm_vm1_gc_wb_obj_promoted.rb: ditto.
+ * configure.in (pthread_np.h): needs pthread.h to be included
+ previously on OpenBSD. a patch by George Koehler <xkernigh AT
+ netscape.net> at [ruby-core:39752]. [Bug #5376]
-Wed Mar 18 12:07:36 2015 Koichi Sasada <ko1@atdot.net>
+Wed Sep 28 04:41:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * string.c: add a comment about RSTRING_FSTR.
+ * test/psych/test_yamlstore.rb: use tmpdir for tmpfile.
+ * test/syck/test_yamlstore.rb: ditto.
-Wed Mar 18 12:01:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 28 04:10:46 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * hash.c (rb_any_hash): use same hash values with Float#hash so
- that -0.0 and +0.0 will be identical.
- [ruby-core:68541] [Bug #10979]
+ * ext/bigdecimal/README: update report to.
-Wed Mar 18 05:34:32 2015 Koichi Sasada <ko1@atdot.net>
+Tue Sep 28 04:05:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * string.c: introduce STR_FAKESTR to show string is FAKESTR or not.
+ * ext/bigdecimal/bigdecimal_en.html: removed because this file isn't
+ maintained now.
- * string.c (STR_SET_SHARED): ignore FAKESTR because only Ruby objects
- can use write barrier.
+ * ext/bigdecimal/bigdecimal_ja.html: ditto.
-Tue Mar 17 18:59:16 2015 Koichi Sasada <ko1@atdot.net>
+Tue Sep 27 09:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * include/ruby/ruby.h: use rb_gc_writebrrier() simply.
- For incremental GC, we need to get a pointer to the objspace.
- We can share this pointer for the following WB process.
- And considering icache hit ratio, process in the GC.
+ * thread_pthread.c: make native_fd_select().
+ * thread.c (do_select): remove #ifdef _WIN32. Instead, use
+ native_fd_select() always.
- * gc.c (rb_gc_writebarrier): added.
+Tue Sep 27 09:44:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (gc_writebarrier_generational, gc_writebarrier_incremental):
- make them NOINLINE because inlining them into rb_gc_writebarrier()
- makes a prologue code of rb_gc_writebarrier() longer (storing callee
- save registers).
+ * thread.c (do_select): remove cygwin specific hack. It's layer
+ violation and too large hack.
+ * thread.c (cmp_tv, subtract_tv): removed.
- This patch improve the performance of WB on micro-benchmarks.
+Tue Sep 27 03:50:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- name ruby 2.1 trunk modified
- vm1_gc_wb_ary* 0.511 0.632 0.532
- vm1_gc_wb_ary_promoted* 0.578 0.701 0.674
- vm1_gc_wb_obj* 0.419 0.575 0.492
- vm1_gc_wb_obj_promoted* 0.537 0.664 0.618
- (sec)
+ * test/rexml/test_sax.rb: add require 'rexml/document'.
-Tue Mar 17 18:51:43 2015 Koichi Sasada <ko1@atdot.net>
+Tue Sep 27 03:32:27 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * benchmark/bm_vm1_gc_wb_ary(_promoted).rb: separate fastpath and
- slowpath for WB.
+ * test/psych/test_yamldbm.rb: fix #setup and #teardown.
+ [Bug #5370] [ruby-core:39730]
+ * test/syck/test_yamldbm.rb: ditto.
- Before this change bm_vm1_gc_wb_ary.rb tried to check the performance
- for WB slowpath (making a reference from oldobj to newobj). However,
- from Ruby 2.2, 3 GCs are needed to promote new objects because
- only 3 age objects are promoted objects.
+Mon Sep 26 11:27:38 2011 NARUSE, Yui <naruse@ruby-lang.org>
- To compare fastpath and slowpath, introduce new "promoted" version
- benchmark.
+ * lib/webrick/httputils.rb: Add MIME Type definition of .js and .svg.
+ patched by Hal Brodigan. [ruby-core:39704] [Bug #5365]
- bm_vm1_gc_wb_ary.rb is for fastpath and
- bm_vm1_gc_wb_ary_promoted.rb is for slowpath.
+Mon Sep 26 09:20:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * benchmark/bm_vm1_gc_wb_obj(_promoted).rb: ditto.
+ * configure.in: remove DJGPP support. It's not longer supported
+ since ruby 1.9.0.
-Tue Mar 17 17:23:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 26 09:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * dir.c (glob_helper): distinguish not-yet-stated and DT_UNKNOWN
- by readdir, and traverse recursively for the former. Linux
- readdir returns DT_UNKNOWN on some filesystems, e.g., smbfs,
- iso9660.
+ * include/ruby/defines.h: remove NextStep, OpenStep, Rhapsody
+ support. Last activity of their OSes are 7 years ago.
+ * configure.in: ditto.
+ * dir.c: ditto.
+ * ext/tk/extconf.rb: ditto.
-Mon Mar 16 17:43:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Mon Sep 26 09:02:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/webrick/server.rb: Fix regression bug in WEBrick's
- :DoNotReverseLookup config option implementation.
- [fix GH-731] Patch by @vais
- * test/webrick/test_do_not_reverse_lookup.rb: ditto.
+ * configure.in: remove a code for human68k. it's no longer
+ supported since r19677.
-Sat Mar 14 20:05:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+Sun Sep 25 23:43:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * math.c (math_gamma): optimization for passed small integer.
+ * ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when being
+ fed arbitrary string values.
+ Clearly distinguish between the cases "universal, infinite and
+ not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly
+ infinite". Raise error for universal tags that are not infinite.
+ * test/openssl/test_asn1.rb: add a test for this.
-Sat Mar 14 18:07:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ Thanks to Hiroshi Yoshida for reporting this bug.
+ [Bug #5363] [ruby-dev:44542]
- * enum.c: [DOC] Fixes Enumerable#member? documentation
- [fix GH-756][ci skip] Patch by @shamanime
+Sun Sep 25 20:57:18 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Mar 14 12:23:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/syck/test/yamldbm.rb: add test for Syck::DBM.
+ * test/psych/test_yamldbm.rb: add test for Psych::DBM.
+ * test/psych/test_yamlstore.rb: add test for Psych::PStore.
- * dir.c (glob_helper): use d_type to reduce lstat system calls.
+Sun Sep 25 20:54:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * win32/dir.h (struct direct): add d_type instead of d_isdir and
- d_isrep. SYMLINKD is unreliable, since the target can be
- replaced after a link was created.
+ * lib/yaml/dbm/dbm.rb: fix #update, add #key for using instead #index.
+ [Bug #5305][ruby-dev:44485]
- * win32/win32.c (readdir_internal): set d_type.
+Sun Sep 25 16:54:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Mar 14 02:14:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * encoding.c (require_enc): reject only loading from untrusted
+ load paths. [ruby-dev:44541] [Bug #5279]
- * parse.y (primary): empty parentheses at cmdarg can be null.
- [ruby-core:68477] [Bug #10957]
+ * transcode.c (load_transcoder_entry): ditto.
-Fri Mar 13 15:04:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 25 16:45:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/stringio/stringio.c (strio_close): don't raise on double
- close for consistent to IO#close.
+ * configure.in: ignore all warnings from an arbitrary
+ header in /usr/local/include.
-Fri Mar 13 15:03:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 25 03:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_close_read, rb_io_close_write): don't raise after
- close same as IO#close.
+ * enum.c (slice_before_i): use rb_attr_get to suppress wrong warning
+ for internal instance variable slicebefore_initial_state.
-Fri Mar 13 12:29:07 2015 Tanaka Akira <akr@fsij.org>
+Fri Sep 23 14:20:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/readline/test_readline.rb: Restore environment variables:
- COLUMNS LINES
+ * ext/openssl/ossl_asn1.c: remove unused variable.
-Fri Mar 13 11:37:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 23 13:46:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/fiddle/extconf.rb: needs --enable-shared when linked to
- libruby or fiddle.so. since --with-static-linked-ext does no
- longer link extensions to ruby program with --enable-shared, the
- only combination needs --enable-static is --disable-shared and
- --with-static-linked-ext. [ruby-dev:48901] [Bug #10960]
+ * test/openssl/test_ssl_session.rb: execute test_session_exts_read
+ only for OpenSSL versions >= 0.9.8k. Thanks, Eric Wong, for
+ reporting this.
+ [Bug #4961] [ruby-core:37726]
-Fri Mar 13 07:02:20 2015 Eric Wong <e@80x24.org>
+Fri Sep 23 11:59:08 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/socket/init.c (rsock_s_accept_nonblock): use rb_hash_lookup2
- * ext/openssl/ossl_ssl.c (get_no_exception): new function
- (ossl_ssl_accept_nonblock): use get_no_exception
- (ossl_ssl_read_internal): ditto
- (ossl_ssl_write_nonblock): ditto
- [ruby-core:68511]
+ * test/openssl/test_ssl_session.rb: ensure server calls callbacks in
+ test_ctx_server_session_cb. Thanks to Eric Wong for the patch.
+ [Bug #5336] [ruby-core:39619]
-Fri Mar 13 07:01:38 2015 Eric Wong <e@80x24.org>
+Thu Sep 22 02:53:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c: predefine wait_*able symbols
+ * vm_insnhelper.c (vm_call_cfunc): suppress a warning. note that
+ `volatile type *var' doesn't make var itself volatile.
-Thu Mar 12 22:59:53 2015 Tanaka Akira <akr@fsij.org>
+Thu Sep 22 01:52:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/lib/leakchecker.rb: Check environment variables.
+ * thread_pthread.c (ubf_select): activate timer thread when interrupt
+ blocking thread.
+ A patch created by Koichi Sasada. [ruby-core:39634] [Bug #5343]
+ to cover race condition, timer thread periodically send SIGVTARLM to
+ threads in signal thread list. so you should activate timer thread
+ when interrupt a thread.
-Thu Mar 12 05:54:27 2015 Eric Wong <e@80x24.org>
+Wed Sep 21 16:55:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/init.c (rsock_s_accept_nonblock):
- support exception: false
- [ruby-core:66385] [Feature #10532]
- * ext/socket/init.c (rsock_init_socket_init): define new symbols
- * ext/socket/rubysocket.h: adjust prototype
- * ext/socket/socket.c (sock_accept_nonblock): support exception: false
- * ext/openssl/ossl_ssl.c (ossl_ssl_accept_nonblock): ditto
- * ext/socket/socket.c (Init_socket): adjust accept_nonblock definition
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
- * ext/socket/tcpserver.c (rsock_init_tcpserver): ditto
- * ext/socket/unixserver.c (rsock_init_unixserver): ditto
- * ext/socket/tcpserver.c (tcp_accept_nonblock): adjust
- rsock_s_accept_nonblock call
- * ext/socket/unixserver.c (unix_accept_nonblock): ditto
- * ext/openssl/ossl_ssl.c (ossl_start_ssl): support no_exception
- * ext/openssl/ossl_ssl.c (ossl_ssl_connect): adjust ossl_start_ssl call
- * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): ditto
- * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto
- * test/socket/test_nonblock.rb (test_accept_nonblock): test for
- "exception :false"
- * test/socket/test_tcp.rb (test_accept_nonblock): new test
- * test/socket/test_unix.rb (test_accept_nonblock): ditto
- * test/openssl/test_pair.rb (test_accept_nonblock_no_exception): ditto
+ * test/io/wait/test_io_wait.rb (TestIOWait#setup): of course, the
+ behavior of mingw is just same with mswin.
-Thu Mar 12 10:53:06 2015 Koichi Sasada <ko1@atdot.net>
+Tue Sep 20 18:08:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h, node.h: move a definition of `struct rb_global_entry'
- and related functions from node.h to internal.h.
+ * vm_insnhelper.c (vm_get_cvar_base): reduce duplicated checks and
+ move a warning outside the loop.
- * variable.c: remove unused include pragma.
+Mon Sep 19 18:55:51 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * common.mk: remove unused dependency.
+ * lib/fileutils.rb (module FileUtils): improve performance of
+ FileUtils.compare_stream. a patch by Masaki Matsushita.
+ [Feature #5337] [ruby-core:39622]
-Thu Mar 12 10:32:39 2015 Koichi Sasada <ko1@atdot.net>
+Mon Sep 19 18:42:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * common.mk: remove unused dependency.
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ select() with timeout may return early in old Linux kernels
+ with 250 Hz tickrate and no dynticks, so skip everything older
+ than 2.6.32 (which has long term support).
+ And, Make the timing assertions consistently use assert_operator with
+ timing difference in error message
+ Patch by Eric Wong. [Bug #5335] [ruby-core:39618]
-Thu Mar 12 08:20:14 2015 Koichi Sasada <ko1@atdot.net>
+Mon Sep 19 09:28:06 2011 Eric Hodel <drbrain@segment7.net>
- * load.c: removed unused header file "node.h".
+ * test/openssl/test_ssl.rb (class OpenSSL): Test
+ OpenSSL::SSL::SSLSocket#session and #session=.
- * method.h: ditto.
+Mon Sep 19 07:54:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * symbol.c: ditto.
+ * object.c (rb_obj_clone): singleton class should be attached
+ singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp>
+ at [ruby-dev:44460]. [Bug #5274]
-Thu Mar 12 08:14:48 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 17 23:34:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: RGENGC_CHECK_MODE should be 0.
+ * parse.y (parser_data_type): inherit the core type in ripper so
+ that checks in core would work. [ruby-core:39591] [Bug #5331]
-Thu Mar 12 07:44:17 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 17 12:44:04 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * internal.h: use T_IMEMO to represent `struct MEMO' value.
- memo->v1 and memo->v2 is WB protected values.
- So use MEMO_V1/V2_SET() macros to set these values.
- memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer
- value), so use gc_mark_maybe() in gc.c to mark it.
+ * lib/find.rb (Find.find): add documentation that Find.find
+ without block returns an enumerator.
- Rename NEW_MEMO() to MEMO_NEW().
+Thu Sep 15 11:39:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Move MEMO_FOR and NEW_MEMO_FOR macros from node.h.
+ * gc.c (mark_entry, mark_key, mark_keyvalue): adjust callback
+ argument types.
- Export a rb_imemo_new() function for ext/ripper.
+Thu Sep 15 01:44:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * node.h: remove NODE_MEMO.
+ * ext/tk/*: Change encoding from EUC-JP to UTF-8
- * enum.c: catch up these change.
+Wed Sep 14 11:43:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * enumerator.c: ditto.
+ * thread.c (rb_fd_rcopy): added an argument guard.
+ Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]
- * load.c: ditto.
+Tue Sep 13 20:21:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace.c (count_nodes): ditto.
+ * lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
- * gc.c (gc_mark_children): mark imemo_memo type.
+ * lib/pstore.rb (PStore): always open in binary mode even if
+ default encodings are set. [Bug #5311] [ruby-core:39503]
- * parse.y (new_args_gen): use T_IMEMO.
- (I'm not sure it is working correctly...)
+Tue Sep 13 05:37:15 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
-Wed Mar 11 22:36:34 2015 Koichi Sasada <ko1@atdot.net>
+ * io.c (Init_IO): update BINARY comment. it should not change the
+ encoding of the result to ASCII-8BIT. [ruby-talk:387719]
- * eval.c (frame_called_id): it should use vm_ifunc type.
+Mon Sep 12 19:55:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * eval.c (frame_func_id): ditto.
+ * thread.c (rb_thread_select): fix to ignore an argument
+ modification of rb_thread_fd_select().
+ based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
+ * thread.c (rb_fd_rcopy): New. for reverse fd copy.
-Wed Mar 11 22:27:05 2015 Koichi Sasada <ko1@atdot.net>
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (test_old_select_false_positive): test for bug5306.
- * node.h: remove NODE_IFUNC, NEW_IFUNC.
+ * ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
+ New. convert fdsets to array.
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ return 'read', 'write', 'except' argument of rb_thread_select()
+ to ruby script.
- * internal.h: use T_IMEMO for IFUNC.
+Mon Sep 12 13:38:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- rename `struct IFUNC' to `struct vm_ifunc' and move the definition
- from vm_insnhelper.h. Add imemo_ifunc.
+ * README.EXT, README.EXT.ja (2.2.2), parse.y (rb_check_id): add
+ documents for rb_check_id().
- * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object.
+Mon Sep 12 12:53:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * compile.c: catch up these changes.
+ * lib/rake/file_list.rb (Rake::FileList#egrep): there is no need to
+ open files in binary mode.
+ see more details in https://github.com/jimweirich/rake/issues/74
- * proc.c: ditto.
+Mon Sep 12 12:42:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h (RUBY_VM_IFUNC_P): ditto.
+ * test/ruby/test_exception.rb (TestException#test_exit_success_p):
+ assert also the cases when exiting with true and false.
- * vm_eval.c (rb_iterate): ditto.
+ * lib/test/unit/assertions.rb (assert_send): make arguments in
+ the default message clearer.
- * vm_insnhelper.c: ditto.
+Sun Sep 11 05:23:14 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/objspace/objspace.c: ditto.
+ * lib/matrix.rb: Deal with subclasses of Matrix [redmine #5307]
-Wed Mar 11 21:53:43 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 10 13:38:20 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * internal.h, eval_intern.h: move CREF accessors.
+ * dir.c (dir_s_aref):
+ * dir.c (dir_entries): Two small documentation fixes.
+ A patch from Aaron Lerch. [Bug #5302] [ruby-core:39404]
- List IMEMO supported types in internal.h.
+Sat Sep 10 08:30:03 2011 Koichi Sasada <ko1@atdot.net>
-Wed Mar 11 21:45:36 2015 Koichi Sasada <ko1@atdot.net>
+ * gc.c (GC_PROFILE_MORE_DETAIL, CALC_EXACT_MALLOC_SIZE):
+ define macros only if they are not defined.
+ fixes: [Ruby 1.9 - Feature #5291]
- * vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
+Sat Sep 10 08:25:47 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- Add THROW_DATA_NEW().
+ * parse.y (bv_decls): parse.y relies on $$ = $1 before action
+ routines. a patch from Michael Edgar. [Bug #5303]
+ [ruby-core:39429]
- * internal.h: move definition of `struct THROW_DATA'
- from vm_insnhelper.h to internal.h.
+Sat Sep 10 01:37:55 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- Rename `THROW_DATA' to `vm_throw_data'.
+ * sample/drb/dhasenc.rb: coding cookie of Emacs is coding,
+ not encoding.
- * eval_intern.h (THROW_DATA_P): move to internal.h.
- THROW_DATA is no longer T_NODE, so check T_IMEMO.
+ * sample/mine.rb: ditto.
- * gc.c (gc_mark_children): mark THROW_DATA.
+Fri Sep 9 21:56:40 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * vm.c: catch up these changes.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix comment.
+ BigDecimal#sqrt requires argument. Reported by Makoto Kishimoto.
+ Thanks for your contribution. [Bug #5267] [ruby-dev:44452]
- * vm_eval.c: ditto.
+Fri Sep 9 11:00:55 2011 Shota Fukumori <sorah@tubusu.net>
- * vm_insnhelper.c: ditto.
+ * test/rubygems/test_gem_commands_help_command.rb: Add one
+ `require` because if run test-all with test/unit parallel
+ running, sometimes this test fails by some constants not found.
+ The error reason is some worker doesn't require the file needed by
+ this test. This issue is related to [ruby-core:36168].
-Wed Mar 11 21:21:56 2015 Koichi Sasada <ko1@atdot.net>
+Fri Sep 9 10:22:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c: use T_IMEMO to create SVAR.
+ * thread.c (rb_thread_select): fix a typo to initialize efds
+ properly. [Bug #5299] [ruby-core:39380]
- * internal.h, vm_insnhelper.h: move definition `struct SVAR'
- from vm_insnhelper.h to internal.h. And rename it to struct vm_svar.
+Fri Sep 9 02:02:09 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- new imemo_type imemo_svar is added.
+ * template/yarvarch.ja:
+ Change encoding from Shift_JIS to UTF-8
- * gc.c (gc_mark_children): mark imemo_svar.
+Thu Sep 9 01:14:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * node.c (rb_gc_mark_node): remove useless marking.
+ * sample/drb/README.rd.ja:
+ * sample/drb/dhasenc.rb:
+ * sample/mine.rb:
+ Change encoding from EUC-JP to UTF-8
-Wed Mar 11 19:35:46 2015 Koichi Sasada <ko1@atdot.net>
+Thu Sep 8 21:03:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/ruby.h: introduce new type T_IMEMO.
- T_IMEMO is Internal Memo type, internal use only.
- T_IMEMO has same purpose of NODE_MEMO.
+ * ext/nkf/nkf-utf8/nkf.c: import nkf 2.1.2 (be9c280)
+ Bump version number/release date only.
- To insert T_IMEMO, type numbers are modified a little.
+Thu Sep 8 12:43:18 2011 Narihiro Nakamura <authornari@gmail.com>
- * internal.h: define struct RIMemo. Each RIMemo objects
- has imemo_type. We can observe it by the imemo_type() function.
+ * gc.c (Init_GC): defined GC::Profiler.raw_data. based on the
+ patch by Eric Hodel. [ruby-core:37857] [Bug #4991]
- * gc.c (rb_imemo_new): added.
+Thu Sep 8 09:02:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * node.h: remove NODE_CREF and NEW_CREF().
+ * gc.c (id2ref): objects which are unmarked but not in sweep_slots
+ are not dead.
- * node.c (rb_gc_mark_node): ditto.
+Thu Sep 8 07:44:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm.c (vm_cref_new): use rb_imem_new().
+ * transcode.c (rb_declare_transcoder, load_transcoder_entry): no
+ longer need to limit the length of transcoder library name.
- * vm_eval.c: ditto.
+Thu Sep 8 07:36:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c: use RIMemo objects for CREF.
+ * ext/syck/lib/syck/types.rb: use toplevel Syck.
+ for the case someone define Syck::Syck (or YAML::Syck).
- * ext/objspace/objspace.c: support T_IMEMO.
+Thu Sep 8 07:33:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 11 17:03:20 2015 Koichi Sasada <ko1@atdot.net>
+ * gc.c (id2ref): unmarked object is already dead while lazy
+ sweeping, and to it cannot come back since other objects
+ referred from it might have been freed already.
- * gc.c: fix memory leak by prepend method.
+Wed Sep 8 03:48:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- It is easy to reproduce with such script:
+ * ext/readline/README.ja:
+ Change encoding from EUC-JP to UTF-8
- module M; def bar; end; end
- loop{
- Class.new do
- def foo; end
- prepend M
- end
- }
+Wed Sep 8 02:59:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * gc.c (obj_free): free T_ICLASS::m_tbl if it is created by prepend.
- To recognize it, check RICLASS_IS_ORIGIN flag.
+ * test/rexml/test_encoding.rb:
+ Add require 'require 'rexml/document'
- * gc.c (gc_mark_children): T_ICLASS objects only need to mark
- T_ICLASS::m_tbl if RICLASS_IS_ORIGIN is set.
+Wed Sep 8 02:53:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * gc.c (obj_memsize_of): count T_ICLASS if RICLASS_IS_ORIGIN is set.
+ * ext/nkf/nkf-utf8/nkf.c:
+ Change encoding from ISO-2022 to UTF-8
- * internal.h (RCLASS_SET_ORIGIN): add to set RCLASS_SET_ORIGIN.
+Wed Sep 7 23:41:24 2011 Kouhei Sutou <kou@cozmixng.org>
- TODO: The word `origin' seems not good name. We need to invent
- another good name.
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
+ allow a single hyphen in comment. [Bug #5278] [ruby-core:39289]
+ Reported by Thomas Fritzsche. Thanks!!!
- * class.c: use RCLASS_SET_ORIGIN().
+Wed Sep 7 17:27:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c (class_alloc): zero clear rb_classext_t.
+ * lib/yaml.rb: explicitly specify ::Object to avoid the collision with
+ Syck::Object.
-Wed Mar 11 13:28:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 6 21:06:49 2011 Shota Fukumori <sorah@tubusu.net>
- * configure.in: check also procstat_getvmmap, which is not
- available on FreeBSD 9. [ruby-core:68468] [Bug #10954]
+ * lib/test/unit.rb (_run_suites): Now reports are written the
+ following order: Skip, Failure, Error. [Feature #5282]
- * vm_dump.c (procstat_vm): use kinfo_getvmmap instead if
- procstat_getvmmap is not available.
+ * test_sorting.rb: test for above.
-Wed Mar 11 09:15:21 2015 Koichi Sasada <ko1@atdot.net>
+ * test4test_sorting.rb: Ditto.
- * internal.h: define struct MEMO.
+ * lib/test/unit.rb (run): Put RUBY_DESCRIPTION before quitting.
+ [Feature #5282]
- * enum.c: use MEMO.
+Tue Sep 6 21:13:47 2011 Masaya Tarui <tarui@ruby-lang.org>
- * enumerator.c: ditto.
+ * win32/Makefile.sub (INSNS): change command line option -Ks to -Ku
+ for generate *.inc. because insns.def encoding has been changed SJIS
+ to UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
+ (same as r33194)
- * load.c: ditto.
+Tue Sep 6 15:55:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * node.h: return (struct MEMO *) pointer.
+ * transcode.c (load_transcoder_entry): concatenate paths directly.
-Wed Mar 11 06:26:21 2015 Koichi Sasada <ko1@atdot.net>
+ * encoding.c (load_encoding): predefined encoding names are safe.
+ [ruby-dev:44469] [Bug #5279]
- * vm_insnhelper.h (THROW_DATA_STATE): return int, not VALUE.
+ * transcode.c (load_transcoder_entry): ditto.
- * vm_insnhelper.h (THROW_DATA_STATE_SET): accept int value.
+Tue Sep 6 12:07:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 11 05:06:46 2015 Koichi Sasada <ko1@atdot.net>
+ * transcode.c: enabled econv newline option.
- * vm_eval.c (rb_catch_protect): use THROW_DATA_VAL().
+Tue Sep 6 06:44:57 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Mar 11 04:56:04 2015 Koichi Sasada <ko1@atdot.net>
+ * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
+ platform. part 1 of [bug #5276]
- * vm_insnhelper.h: define struct IFUNC.
+Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * vm_eval.c (rb_iterate): use it.
+ * numeric.c (flo_round): Fix criteria for 32 bits platform
+ part 2 of [bug #5276]
- * vm_insnhelper.c (vm_yield_with_cfunc): ditto.
+Tue Sep 6 05:37:11 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Wed Mar 11 03:52:12 2015 Koichi Sasada <ko1@atdot.net>
+ * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures
+ [ruby-dev:44430] [Ruby 1.9 - Bug #372]
- * eval_intern.h (THROW_DATA_P): use RB_TYPE_P() instead of
- BUILTIN_TYPE().
+Mon Sep 5 20:59:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * thread.c (thread_join): use THROW_DATA_P().
+ * insns.def: change encoding pragma for emacs (shift_jis to utf-8).
-Wed Mar 11 03:48:01 2015 Koichi Sasada <ko1@atdot.net>
+Mon Sep 5 19:32:15 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.
+ * Makefile.in (INSNS): change command line option -Ks to -Ku for
+ generate *.inc. because insns.def encoding has been changed SJIS to
+ UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
- * vm.c: ditto.
+Mon Sep 5 18:10:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_dump.c: ditto.
+ * transcode.c (rb_econv_binmode): newline decorators are
+ exclusive.
- * vm_insnhelper.c: ditto.
+Mon Sep 5 15:03:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h (RUBY_VM_IFUNC_P): use RB_TYPE_P() instead of
- BUILTIN_TYPE().
+ * test/rubygems/test_gem_security.rb
+ (test_class_build_self_signed_cert): reset opt[:trust_dir] to apply
+ temporary Gem.user_home.
-Wed Mar 11 03:21:37 2015 Koichi Sasada <ko1@atdot.net>
+Mon Sep 5 10:04:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * vm_insnhelper.h: define struct THROW_DATA to represent
- throwing data. Also define accessor functions.
+ * README.ja, README.EXT.ja: resolve conflicts. [ruby-dev:44459]
- * eval_intern.h: move related changes into vm_insnhelper.h.
- Now these MACROs (functions) are only used in vm*.c.
+Mon Sep 5 05:13:22 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- There is only THROW_DATA_P(err) to check this data type or not.
+ * numeric.c (flo_round): Make Float#round round big values [bug
+ #5272]
- * vm.c: catch up these changes.
+Mon Sep 5 04:28:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * vm_eval.c: ditto.
+ * numeric.c (int_round): Integer#round always returns an Integer [Bug
+ #5271]
- * vm_insnhelper.c: ditto.
+Sun Sep 4 22:28:50 2011 Shugo Maeda <shugo@ruby-lang.org>
-Wed Mar 11 00:57:00 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * lib/net/imap.rb (default_port, default_imap_port,
+ default_tls_port, default_ssl_port, default_imaps_port):
+ added methods for consistency with Net::POP.
+ based on the patch by art lussos. [ruby-core:38997] [Bug #5198]
- * test/rubygems/test_gem_security_trust_dir.rb: The return value of
- File::Stat#mode is OS dependent. In AIX, 0200000 is set.
+Sun Sep 4 21:19:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Mar 10 20:03:41 2015 Tanaka Akira <akr@fsij.org>
+ * Change encoding from EUC-JP to UTF-8. [Feature #5128]
- * lib/webrick/server.rb: Invoke setup_shutdown_pipe in start method
- instead of listen method.
- [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima.
+Sun Sep 4 00:47:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Mar 10 17:27:27 2015 Koichi Sasada <ko1@atdot.net>
+ * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
+ add a test. Unlike TestThread#test_no_valid_cfp,
+ this test succeeds even if win32ole is required (see r33153).
- * thread.c (thread_join): Fixnum (except TAG_FATAL) and
- NODE should not be reached here.
+Sun Sep 4 00:11:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 9 21:42:10 2015 Koichi Sasada <ko1@atdot.net>
+ * variable.c (rb_const_set): show the previous definition
+ location. [EXPERIMENTAL]
- * vm_insnhelper.c (ep_cref): rename to lep_cref() because it should be
- local ep.
+Sat Sep 3 23:56:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 9 16:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (sizeof_struct_dirent_too_small): check if struct
+ dirent.d_name is too small.
- * ext/stringio/stringio.c (strio_close): don't raise on double
- close for consistent to IO#close.
+ * configure.in (RUBY_MINGW32): take tool prefix from CC.
-Mon Mar 09 06:44:48 2015 Koichi Sasada <ko1@atdot.net>
+Sat Sep 3 23:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.h: define struct SVAR for SVAR.
- This data type is also same layout of NODE (NODE_IF).
+ * io.c (argf_next_argv): open in default text mode.
+ [ruby-core:39234] [Bug #5268]
- * vm_insnhelper.c: catch up this change.
+Sat Sep 3 18:40:57 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Mon Mar 9 06:43:21 2015 Koichi Sasada <ko1@atdot.net>
+ * lib/thread.rb (SizedQueue#max=): raise ArgumentError if max is not
+ positive number. patch by Masaki Matsushita.
+ [ruby-dev:44449] [Bug #5259]
- * vm_insnhelper.c (lep_svar_set): add WBs.
+ * test/thread/test_queue.rb (test_sized_queue_initialize,
+ test_sized_queue_assign_max): add tests for it.
-Mon Mar 9 06:19:06 2015 Koichi Sasada <ko1@atdot.net>
+Fri Sep 2 21:11:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: define rb_cref_t and change to use it.
+ * io.c (validate_enc_binmode, prep_stdio): default to text mode on
+ dosish platforms. [ruby-core:38822] [Bug #5164]
- rb_cref_t is data type of CREF. Now, the body is still NODE.
- It is easy to understand what is CREF and what is pure NODE.
+ * transcode.c (rb_econv_prepare_options): keep default ecflags
+ unchanged if no options.
-Mon Mar 9 06:00:37 2015 Koichi Sasada <ko1@atdot.net>
+Fri Sep 2 14:36:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.h (COPY_CREF_OMOD): fix translation miss.
+ * vm_insnhelper.c (vm_search_const_defined_class): search
+ ancestors only when global scope. [ruby-core:39227] [Bug #5264]
-Mon Mar 9 04:47:58 2015 Koichi Sasada <ko1@atdot.net>
+Fri Sep 2 09:58:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: define CREF accessor macros.
- * CREF_CLASS(cref)
- * CREF_NEXT(cref)
- * CREF_VISI(cref)
- * CREF_VISI_SET(cref, v)
- * CREF_REFINEMENTS(cref)
- * CREF_PUSHED_BY_EVAL(cref)
- * CREF_PUSHED_BY_EVAL_SET(cref)
- * CREF_OMOD_SHARED(cref)
- * CREF_OMOD_SHARED_SET(cref)
- * CREF_OMOD_SHARED_UNSET(cref)
+ * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
+ which prefixes an non-ascii character, which has no escape
+ syntax. [ruby-core:39222] [Ruby 1.9 - Bug #5262]
- This is process to change CREF data type from NODE.
+Fri Sep 2 04:05:25 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Mar 8 22:50:57 2015 Tanaka Akira <akr@fsij.org>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
+ ascii-8bit as binary in YAML.
+ * test/psych/test_string.rb: corresponding test.
- * ext/zlib/zlib.c (rb_gzfile_close): Don't raise on double
- close for consistent to IO#close.
+Fri Sep 2 01:07:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 8 16:57:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (flo_round): substitute machine dependent magic number.
- * dir.c (glob_helper): match patterns against legacy short names
- too, not only ordinary names. [ruby-core:67954] [Bug #10819]
+Thu Sep 1 17:31:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/dir.h (struct direct): add short name members.
+ * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see
+ also inherited constants for classes without superclass and
+ modules. [ruby-core:37698] [Bug #3423]
- * win32/win32.c (opendir_internal, readdir_internal): ditto.
+Thu Sep 1 16:18:44 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sat Mar 7 09:36:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * Release GVL while OpenSSL's public key generation.
- * array.c: document that first element is kept when using
- Array#uniq and #uniq! [fix GH-845][ci skip]
- Patch by @riffraff
+ t = Thread.new { print "."; sleep 0.1 }
+ key = OpenSSL::PKey::RSA.new(2048)
+ #=> Thread t works in parallel with public key generation if
+ OS/machine allows it.
-Sat Mar 7 09:28:02 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ This works with OpenSSL >= 0.9.8. From this version, it has new
+ public key generation function which allows us to interrupt the
+ execution while pkey generation iterations.
- * thread.c: Mutex#owned? is no longer experimental since 2.1.0
- [fix GH-839][ci skip] Patch by @takiy33
+ * ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
+ generation function. (DH_generate_parameters_ex,
+ DSA_generate_parameters_ex and RSA_generate_key_ex.
-Sat Mar 7 09:18:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
+ ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
+ generation which handles Thread interruption by Ruby.
+ ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
+ sets a stop flag. New pkey generation callback ossl_generate_cb_2
+ checks the stop flag at each iterations of OpenSSL and interrupts
+ pkey generation when the flag is set.
- * tool/merger.rb: Added documentation to version method.
- [fix GH-847][ci skip] Patch by @magikid
+ * ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
+ rb_thread_blocking_region with the above unblock function to release
+ GVL while pkey generation.
-Fri Mar 6 22:50:36 2015 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.
- * class.c (rb_prepend_module): need a WB for klass -> origin.
+ * ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.
-Fri Mar 6 20:18:38 2015 Koichi Sasada <ko1@atdot.net>
+ * test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.
- * fix namespace issue on singleton class expressions. [Bug #10943]
+Thu Sep 1 14:06:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored
- to rb_method_definition_t::body.iseq_body.cref.
+ * test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip when
+ win32ole is required. in such case, win32ole redefines
+ Thread#initialize, and the block argument becomes to be not the top
+ of the thread, then this testcase always fails.
- * vm_insnhelper.c: modify SVAR usage.
- When calling ISEQ type method, push CREF information onto method
- frame, SVAR located place. Before this fix, SVAR is simply nil.
- After this patch, CREF (or NULL == Qfalse for not iseq methods)
- is stored at the method invocation.
+Thu Sep 1 10:20:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- When SVAR is required, then put NODE_IF onto SVAR location,
- and NDOE_IF::nd_reserved points CREF itself.
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
+ committed in r33144. I'd misunderstood the spec of ruby's universal
+ newline.
- * vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added.
+Thu Sep 1 09:27:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c (vm_push_frame): accept CREF.
+ * variable.c (rb_autoloading_value): Fix the order of definitions.
+ It is used by autoload_defined_p.
- * method.h, vm_method.c (rb_add_method_iseq): added. This function
- accepts iseq and CREF.
+Wed Aug 31 17:28:23 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * class.c (clone_method): use rb_add_method_iseq().
+ * variable.c (rb_autoload): There was a chance to run GC (from
+ rb_str_new2()) before finishing autoload_data_i construction. It
+ caused SEGV at rb_gc_mark() at autoload_i_mark.
- * gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref.
+ * variable.c (rb_autoload_load): Move RB_GC_GUARD() to proper
+ position based on suggestion by CHIKANAGA Tomoyuki at
+ http://d.hatena.ne.jp/nagachika/20110826/ruby_trunk_changes_33070_33078
- * iseq.c: remove CREF related codes.
+ * variable.c (autoload_defined_p): Fix incompatible autoload behavior
+ that causes Rails crash. Class definition instruction defined in
+ 'defineclass' in insns.def always invokes rb_autoload_load for a
+ constant. It's invoked for every class definition regardless of
+ existence of autoload definition. rb_autoload_load checks if a
+ constant is defined as autoloaded, but new thread-safe autoload
+ returned different value if the constant is under autoloading.
- * insns.def (getinlinecache/setinlinecache): CREF should be cache key
- because a different CREF has a different namespace.
+Wed Aug 31 17:20:56 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR.
+ * Re-apply r33078, thread-safe autoload which is reverted at r33093.
- * proc.c: catch up changes.
+Wed Aug 31 16:28:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * struct.c: ditto.
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): tests for [Bug #5164].
- * insns.def: ditto.
+Wed Aug 31 15:54:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_args.c (raise_argument_error): ditto.
+ * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
- * vm_eval.c: ditto.
+Wed Aug 31 13:09:41 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * test/ruby/test_class.rb: add a test.
+ * numeric.c (flo_round): Avoid overflow by optimizing for trivial
+ cases [Bug #5227]
-Fri Mar 6 18:19:13 2015 Koichi Sasada <ko1@atdot.net>
+Wed Aug 31 00:50:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/webrick/test_filehandler.rb: on vboxsf (on VirtualBox
- on Windows 7), file name and permissions are strange (can access
- by short file name and so on).
+ * win32/win32.c (rb_w32_select_with_thread): and my typo. we all must
+ be more careful.
- Simply skip on such tests on such FS. To detect strange FS, this
- patch use a part of code `File.executable?(__FILE__)`.
- Please correct them if there are better ways.
+Wed Aug 31 00:48:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Mar 6 17:31:29 2015 Koichi Sasada <ko1@atdot.net>
+ * thread.c (rb_thread_select): critical typo in r33117.
- * test/ruby/test_beginendblock.rb: do not change directory.
+Wed Aug 31 00:30:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- Run system command in the directory mounted by vboxsf on Windows 7
- and get warning like that "warning: Insecure world writable dir...".
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_read_timeout): if the machine
+ is fast enough, the time used by code around IO.select may be smaller
+ than Time implement threshold.
-Fri Mar 6 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 31 00:04:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_eval.c (vm_call_super): search next super class from the
- original class, to get rid of infinite recursion with
- prepending. a patch by Seiei Higa <hanachin AT gmail.com> at
- [ruby-core:68434]. [ruby-core:68093] [Bug #10847]
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ typo.
-Fri Mar 6 08:45:26 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
+ of SIGUSR1 because the former is general and the latter is platform
+ dependent.
- * lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.
- [Fixes GH-802]
+Tue Aug 30 23:59:36 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Mar 6 07:33:03 2015 Koichi Sasada <ko1@atdot.net>
+ * win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
+ for rb_thread_select() in thread.c. the use of rb_fd_copy() is
+ introduced in r33117.
+ [Bug #5251] [ruby-core:39195]
- * gc.c (obj_info): show node name too.
+ * thread.c (rb_thread_select): must call rb_fd_init() before using
+ rb_fdset_t. see the implementations of rb_fd_init()s if you want to
+ know the reason.
-Fri Mar 6 07:00:44 2015 Koichi Sasada <ko1@atdot.net>
+Tue Aug 30 22:34:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * internal.h: remove struct method_table_wrapper.
- struct method_table_wrapper was introduced to avoid duplicate marking
- for method tables.
+ * test/dl/test_callback.rb (test_callback_with_string): prevents
+ temporary string from GC.
- For example, `module M1; def foo; end; end` make one method table
- (mtbl) contains a method `foo`. M1 (T_MODULE) points mtbl.
- Classes C1 and C2 includes M1, then two T_ICLASS objects are created
- and they points mtbl too. In this case, three objects (one T_MODULE
- and two T_ICLASS objects) points same mtbl. On marking phase, these
- three objects mark same mtbl. To avoid such duplication, struct
- method_table_wrapper was introduced.
+Tue Aug 30 22:25:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- However, created two T_ICLASS objects have same or shorter lifetime
- than M1 (T_MODULE) object. So that we only need to mark mtbl from M1,
- not from T_ICLASS objects. This patch tries marking only from M1.
- In other words, original module (M1) has responsibility to mark mtbl.
- Because of no duplicate marking, we don't need method_table_wrapper
- any more.
+ * vm_insnhelper.c (vm_call_cfunc): revert r33112. RB_GC_GUARD macro
+ protect a VALUE from GC. It's not for general anti-optimizing
+ purpose.
- Note that one `Module#prepend` call creates two T_ICLASS objects.
- One for referring to a prepending Module object, same as
- `Module#include`. We don't need to care this T_ICLASS.
- One for moving original mtbl from a prepending class. We need to
- mark such mtbl from this T_ICLASS object. To mark the mtbl,
- we need to use `RCLASS_ORIGIN(klass)` on marking from a prepended
- class `klass`.
+Tue Aug 30 11:06:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c: ditto.
+ * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
+ [Bug #5173] [ruby-core:38866]
- * eval.c (rb_using_refinement): ditto.
+Tue Aug 30 09:57:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c: ditto.
+ * lib/thread.rb (Queue#pop): fix a race against Thread.wakeup.
+ Patch by Masaki Matsushita <glass.saga at gmail dot com>
+ [Bug #5195] [ruby-dev:44400]
- * include/ruby/ruby.h: define m_tbl directly. The definition of
- struct RClass should be moved to (srcdir)/internal.h.
+Tue Aug 30 09:48:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * method.h: remove decl of rb_free_m_tbl_wrapper().
+ * cont.c (fiber_entry): fix stack allocation failure on Debian
+ GNU/kFreeBSD.
+ Patch by Lucas Nussbaum <lucas at lucas-nussbaum dot net>.
+ [Bug #5241] [ruby-core:39147]
- * object.c: use RCLASS_M_TBL() directly.
+Tue Aug 30 09:28:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Mar 6 02:50:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread.c (rb_thread_select): rewrite by using
+ rb_thread_fd_select(). old one is EINTR unsafe.
+ Patch by Eric Wong. [Bug #5229] [ruby-core:39102]
- * dir.c (replace_real_basename): need to check the return value of
- GLOB_REALLOC().
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ a testcase for rb_thread_select().
+ * ext/-test-/old_thread_select/old_thread_select.c: ditto.
+ * ext/-test-/old_thread_select/depend: ditto.
+ * ext/-test-/old_thread_select/extconf.rb: ditto.
-Fri Mar 6 02:26:03 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Aug 30 09:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * dir.c (replace_real_basename): shouldn't create Ruby object before
- the object system is loaded.
- [ruby-core:68430] [Bug #10941]
+ * configure.in: fix a build failure on GNU Hurd.
+ Patch by Samuel Thibault <sthibault at debian dot org>. Thank you!
+ [Bug #5250] [ruby-core:39185]
-Wed Mar 5 16:58:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+Sun Aug 29 23:22:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * hash.c: [DOC] #delete method actually returns nil, if the key
- is not found. [fix GH-844][ci skip] Patch by @ivdma
+ * test/ruby/test_numeric.rb (test_num2long): modify a test against the
+ change by r33108.
-Wed Mar 5 12:22:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+Sun Aug 29 09:58:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * math.c: refactoring: remove unnecessary variable d0 to unify code
- appearance.
+ * numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Fixnum. #1792
-Thu Mar 5 11:50:54 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_fixnum.rb: add tests for the above change.
- * vm_eval.c (eval_string_with_cref): A binding should keep
- refinements activation information and the refinements should be
- activated in subsequent eval calls with the binding.
- [ruby-core:67945] [Bug #10818]
+ * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Bignum. #1792
-Thu Mar 5 11:16:55 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_bignum.rb: add tests for the above change.
- * test/ruby/test_refinement.rb: There is no need anymore to suppress
- warnings.
+Sun Aug 28 15:38:17 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Mar 5 08:31:02 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * ext/date/date_parse.c (date_zone_to_diff): keep a temporary string
+ stored in variable while the contents buffer is being used.
- * random.c (random_raw_seed): Avoid calling fill_random_bytes()
- if the requested size is 0. AIX returns -1 for 0-byte read from
- /dev/urandom, while other UNIX returns 0. With this change,
- Random.raw_seed(0) consistently returns "" in any UNIX.
+ * ext/date/date_parse.c (date_zone_to_diff): get rid of out of bounds
+ memory read. [ruby-dev:44409] [Bug #5213]
-Wed Mar 4 12:43:32 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+Sun Aug 28 05:29:50 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * test/ruby/test_math.rb (assert_float_and_int): Refactor test cases
- by introducing assert_float_and_int. [misc #10810]
+ * lib/minitest/*: Imported minitest 2.5.1 (r6596)
+ * test/minitest/*: ditto
-Wed Mar 4 11:52:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 27 20:46:05 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * 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]
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): change return type
+ to suppress a warning.
-Wed Mar 4 10:16:57 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm_core.h: ditto.
- * enum.c: Fix typo in slice_after's exception message.
- [fix GH-842][ci skip] Patch by @jsyeo
+Sat Aug 27 19:04:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Mar 4 10:15:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * internal.h (rb_strftime_timespec): moved from time.c and define only
+ if ruby/encoding.h is included.
- * doc/syntax/methods.rdoc: add some missing spaces and
- fix a grammatical error in method docs.
- [fix GH-843][ci skip] Patch by @nikolas
+ * internal.h (rb_strftime): ditto.
-Wed Mar 4 02:13:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Aug 27 18:53:51 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * tool/redmine-backporter.rb (backport_command_string): pick up only
- when the revision exists in trunk.
+ * proc.c (proc_new): force to rewrite errinfo when calling Proc.new in ensure.
+ [Bug #5234] [ruby-core:39125]
+ This code will be removed after changing throw mechanism (see r33064).
-Wed Mar 4 00:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): new function.
- * thread.c (rb_thread_io_blocking_region): assigned variables
- inside EXEC_TAG() should be volatile.
+ * vm.c (vm_make_env_each): changed accordingly.
- * thread.c (rb_thread_s_handle_interrupt): ditto.
+ * vm_core.h: ditto.
- * thread.c (exec_recursive): ditto.
+ * bootstraptest/test_flow.rb: add tests for above.
-Wed Mar 4 00:29:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Aug 27 18:44:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/redmine-backporter.rb: now can specify shorten form of commands.
+ * internal.h (rb_strftime_timespec): move to time.c because it depends
+ encoding.h.
-Tue Mar 3 23:41:42 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Aug 27 18:17:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/redmine-backporter.rb (Readline.readline): drop untreated control
- characters.
+ * strftime.c (rb_strftime_with_timespec): get enc argument to specify
+ the encoding of the format. On Windows (at least Japanese Windows),
+ Time#strftime("%Z") includes non ASCII in locale encoding (CP932).
+ So convert locale to default internal. [ruby-core:39092] [Bug #5226]
-Tue Mar 3 22:25:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * strftime.c (rb_strftime): ditto.
- * test/lib/envutil.rb (EnvUtil.invoke_ruby): need to rescue because
- Signal.signame may raise exception.
+ * strftime.c (rb_strftime_timespec): ditto.
-Tue Mar 3 16:57:39 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * internal.h (rb_strftime_timespec): follow above.
- * tool/redmine-backporter.rb: use 'b' instead of 's' for showing
- Backport options for merger.rb.
+ * time.c (rb_strftime_alloc): ditto.
-Tue Mar 3 16:55:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * time.c (strftimev): ditto.
- * tool/redmine-backporter.rb: show selected ticket number at prompt.
+ * time.c (time_strftime): ditto.
-Tue Mar 3 14:47:30 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * time.c (time_to_s): the resulted string of Time#to_s is always
+ ascii only, so this should be US-ASCII.
- * math.c (num2dbl_with_to_f): direct casting from Rational to double.
- [Feature #10909]
+ * time.c (time_asctime): ditto.
- * test/ruby/test_math.rb: add tests for the above change.
+Sat Aug 27 11:18:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Tue Mar 3 07:52:20 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * Revert r33078. It caused a Rails application NoMethodError.
- * test/ruby/test_symbol.rb: avoid a false positive in AIX.
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/utils.rb:157: warning: toplevel constant ScanError referenced by Regin::Parser::ScanError
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/vendor/regin/regin/parser.rb:17:in `parse_regexp': undefined method `scan_str' for #<Regin::Parser:0x00000002344548> (NoMethodError)
-Tue Mar 3 00:59:39 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sat Aug 27 08:44:58 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in: set PRELOADENV in Solaris to avoid "wrong ELF class"
- error. [Bug #10926] [ruby-dev:48888]
- * configure.in: set LIBPATHENV for 32-bit compile in Solaris
- in addition to 64-bit.
+ * lib/rdoc: Import RDoc 3.9.4. Typo and grammar fixes by Luke Gruber.
+ [Ruby 1.9 - Bug #5203]
-Mon Mar 2 15:36:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 27 07:53:34 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in: do not check _setjmp unless _longjmp is available,
- so that configure results will not be changed by cache.
+ * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++
+ instead of `' for method arguments in open-uri.rb
-Mon Mar 2 14:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 27 07:22:07 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
- cached variable only if the target type is not available.
+ * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch
+ by Luke Gruber. [#5203]
+ * ext/pty/lib/expect.rb: ditto
+ * lib/mathn.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/open-uri.rb: ditto
+ * lib/ostruct.rb: ditto
+ * lib/tempfile.rb: ditto
+ * lib/thread.rb: ditto
+ * lib/weakref.rb: ditto
+ * sample/webrick/httpproxy.rb: ditto
-Mon Mar 2 13:04:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 27 04:03:18 2011 Koichi Sasada <ko1@atdot.net>
- * signal.c (sig_signame): return nil if the argument is a valid
- signal number.
+ * iseq.c (iseq_data_to_ary): fix type of variable
+ (long -> unsigned long) to suppress a warning.
-Mon Mar 2 12:05:04 2015 Naohisa Goto <ngotogenome@gmail.com>
+Sat Aug 27 04:02:11 2011 Koichi Sasada <ko1@atdot.net>
- * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE
- for receiving OOB data which is sent with MSG_OOB flag in
- portable way. [Bug #10915] [ruby-dev:48885]
- * test/net/ftp/test_ftp.rb (test_abort, test_status): use gets
- for receiving OOB data in portable way.
+ * vm_core.h: add a decl. of rb_autoloading_value().
-Mon Mar 2 11:43:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 26 19:12:08 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
- cached variable.
+ * variable.c: Make autoload thread-safe. See #921.
-Mon Mar 2 06:01:41 2015 Eric Wong <e@80x24.org>
+ What's the problem?
+ autoload is thread unsafe. When we define a constant to be
+ autoloaded, we expect the constant construction is invariant. But
+ current autoload implementation allows other threads to access the
+ constant while the first thread is loading a file.
- * ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX
- Thanks to Yura Sokolov <funny.falcon@gmail.com>
- [ruby-core:68369] [Bug#10923]
- * test/io/wait/test_io_wait.rb (test_nread_buffered):
- fix broken test
+ What's happening inside?
+ The current implementation uses Qundef as a marker of autoload in
+ Constant table. Once the first thread find Qundef as a value at
+ constant lookup, it starts loading a defined feature. Generally a
+ loaded file overrides the Qundef in Constant table by module/class
+ declaration at very beginning lines of the file, so other threads
+ can see the new Module/Class object before feature loading is
+ finished. It breaks invariant construction.
-Sun Mar 1 20:21:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ How to solve?
+ To ensure invariant constant construction, we need to override
+ Qundef with defined Object after the feature loading. For keeping
+ Qundef in Constant table, I expanded autoload_data struct in
+ Module to have a slot for keeping the defined object while feature
+ loading. And changed Module's constant lookup/update logic a
+ little so that the slot is only visible from the thread which
+ invokes feature loading. (== the first thread which accessed the
+ autoload constant)
- * configure.in (RUBY_REPLACE_TYPE): restore convertible type from
- cached variable, so that configured results will be stable.
+ Evaluation?
+ All test passes (bootstrap test, test-all and RubySpec) and added
+ 8 tests for threading behavior. Extra logics are executed only
+ when Qundef is found, so no perf drop should happen except
+ autoloading.
-Sun Mar 1 18:10:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (rb_autoload): Prepare new autoload_data struct.
- * configure.in (rb_cv_broken_memmem): check before adding the
- result HAVE_MEMMEM macro to confdefs.h, so that configured
- results will be stable.
+ * variable.c (rb_autoload_load): Load feature and update Constant
+ table after feature loading is finished.
-Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (rb_const_get_0): When the fetched constant is under
+ autoloading, it returns the object only for the thread which starts
+ autoloading.
- * gc.c (id2ref): prohibit from accessing internal objects.
- [ruby-core:68348] [Bug #10918]
+ * variable.c (rb_const_defined_0): Ditto.
-Sun Mar 1 09:06:11 2015 Tanaka Akira <akr@fsij.org>
+ * variable.c (rb_const_set): When the specified constant is under
+ autoloading, it sets the object only for the thread which starts
+ autoloading. Otherwise, simply overrides Qundef with constant
+ override warning.
- * lib/time.rb (strptime): Support %s.%N.
- [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi.
+ * vm_insnhelper.c (vm_get_ev_const): Apply same change as
+ rb_const_get_0 in variable.c.
-Sat Feb 28 17:18:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_autoload.rb: Added tests for threading behavior.
- * enum.c (enum_each_slice, enum_each_cons): limit elements size by
- the enumerator size. suggested by Hans Mackowiak <hanmac AT
- gmx.de> at [ruby-core:68335]
+Fri Aug 26 10:10:37 2011 Eric Hodel <drbrain@segment7.net>
-Sat Feb 28 15:44:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems: Update to RubyGems 1.8.10. Fixes security issue in
+ creating ruby-format gemspecs. Fixes Gem.dir not being at the front
+ of Gem.path to fix uninstall and cleanup commands. Fixes gem
+ uninstall stopping on the first missing gem.
- * vm_dump.c (rb_vm_bugreport): get rid of making new strings
- inside signal context.
+Fri Aug 26 08:21:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * variable.c (rb_tmp_class_path): defer making temporary class
- path string.
+ * time.c (strftimev): Make Time#to_s default to US-ASCII encoding but
+ respect Encoding.default_internal. [ruby-core:39092]
+ * test/ruby/test_time.rb (class TestTime): Corresponding test.
- * variable.c (rb_search_class_path): search class path or return
- Qnil or Qfalse if unnamed, not creating a temporary path.
+Thu Aug 25 09:43:16 2011 Eric Hodel <drbrain@segment7.net>
-Sat Feb 28 15:02:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/bn.rb: Hide copyright info from RDoc.
+ * ext/openssl/lib/openssl/digest.rb: ditto
+ * ext/openssl/lib/openssl/x509.rb: ditto
+ * ext/openssl/lib/openssl/cipher.rb: ditto
- * variable.c (rb_tmp_class_path): preserve name encoding of an
- anonymous instance of module/class subclass.
+Thu Aug 25 09:25:48 2011 Eric Hodel <drbrain@segment7.net>
-Sat Feb 28 08:24:30 2015 Rei Odaira <Rei.Odaira@gmail.com>
+ * ext/openssl/ossl_digest.c: Document OpenSSL::Digest::digest and add
+ an example to OpenSSL::Digest. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5166]
+ * ext/openssl/lib/openssl/digest.rb (module OpenSSL): ditto
- * ext/pty/pty.c: AIX supports autopush.
- Patch by Perry Smith [ruby-core:58539] [Bug #9144]
+Thu Aug 25 08:19:43 2011 Koichi Sasada <ko1@atdot.net>
-Fri Feb 27 22:00:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm.c (vm_make_env_each): work around to solve Bug #2729.
+ fixes: Bug #2729
+ a patch from Kazuki Tsujimoto <kazuki@callcc.net>
+ This problem is caused by changing dfp (dynamic env pointer)
+ from saved dfp. Saved dfp is pointed env in VM stack. However,
+ the dfp can be moved because VM copies env from VM stack to
+ the heap. At this copying, dfp was also changed. To solve this
+ problem, I'll try to change throw mechanism (not save target dfp,
+ but save target cfp).
- * lib/rubygems: Update to RubyGems 2.4.6 and HEAD(800f2e6).
- Fixed #1159, #1171, #1173 on rubygems/rubygems
- * test/rubygems: ditto.
+ * bootstraptest/test_flow.rb: add a test for above.
-Fri Feb 27 20:55:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Aug 25 07:57:33 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/rake: Update to rake (9237e74), typo fix and remove needless
- private syntax.
- * test/rake: ditto.
+ * numeric.c (int_round): Fix Integer#round [ruby-core:39096]
-Fri Feb 27 17:06:44 2015 Koichi Sasada <ko1@atdot.net>
+Thu Aug 25 07:00:00 2011 Koichi Sasada <ko1@atdot.net>
- * vm_core.h: define vm_svar_index.
+ * vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:
+ Manage a redefinition of special methods for each classes.
+ A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks!
- * vm_insnhelper.c, vm.c, compile.c: use vm_svar_index names.
+Thu Aug 25 06:51:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * iseq.h: remove DEFAULT_SPECIAL_VAR_COUNT.
- use VM_SVAR_FLIPFLOP_START instead.
+ * ext/psych/lib/psych.rb: Fixing psych version number.
+ * ext/psych/psych.gemspec: updating the gemspec.
-Fri Feb 27 13:57:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 25 06:11:35 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * io.c (setup_narg): wipe away expanded part of buffer to get rid
- of revealing uncleaned data. reported by Dongkwan Kim <dkay AT
- kaist.ac.kr>.
+ * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
+ UTF-8.
+ * test/psych/test_encoding.rb: test yaml dump encoding.
-Wed Feb 25 22:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Aug 25 01:24:33 2011 Naohisa Goto <ngotogenome@gmail.com>
- * spec/default.mspec: use default configuration file name.
- https://github.com/ruby/rubyspec/commit/cc69f337b06362e5607ffa3e3ad40ef7494960cf
+ * test/fileutils/test_fileutils.rb (test_chmod_symbol_mode): Solaris
+ seems to behave the same as FreeBSD.
-Wed Feb 25 22:21:56 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Aug 25 01:11:36 2011 Naohisa Goto <ngotogenome@gmail.com>
- * spec/default.mspec: remove specific version number.
- https://github.com/ruby/rubyspec/commit/7a909e925c1baa9c700bd44af9241aef6e596714
+ * test/ruby/test_rubyoptions.rb (test_script_from_stdin): slave pty
+ should be manipulated because master pty may not be a tty on some
+ environment (e.g. Solaris). [Bug:#5222] [ruby-dev:44420]
-Wed Feb 25 22:04:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 24 15:13:56 2011 Koichi Sasada <ko1@atdot.net>
- * ext/win32/Win32API.rb (initialize): accept both a string and an array
- for the arguments of the imported function.
- reported by Aaron Stone [ruby-core:68208] [Bug #10876] [Fixes GH-835]
+ * iseq.h, iseq.c, compile.c: Change the line number data structure
+ to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217].
+ Before this fix, each instruction has an information including
+ line number (iseq::iseq_insn_info_table). Instead of this data
+ structure, recording only line number changing places
+ (iseq::iseq_line_info_table).
+ The order of entries in iseq_line_info_table is ascending order of
+ iseq_line_info_table_entry::position. You can get a line number
+ by an iseq and a program counter with this data structure.
+ This fix reduces memory consumption of iseq (bytecode).
+ On my measurement, a rails application consumes 21.8MB for
+ iseq with this fix on the 32bit CPU. Without this fix, it
+ consumes 24.7MB for iseq [ruby-dev:44415].
-Wed Feb 25 18:12:11 2015 Eric Wong <e@80x24.org>
+ * proc.c: ditto.
- * signal.c (sighandler): preserve errno
- Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
- [ruby-core:68172] [Bug #10866]
+ * vm_insnhelper.c: ditto.
-Wed Feb 25 15:59:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c: ditto.
- * dir.c (push_pattern, push_glob): make globbed file names same
- encoding to the given pattern.
+ * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no().
-Wed Feb 25 15:27:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Aug 24 09:49:10 2011 Koichi Sasada <ko1@atdot.net>
- * tool/merger.rb: support 2.1+ versioning scheme.
+ * insns.def (defined): fix to checking class variable.
+ A patch by Magnus Holm <judofyr@gmail.com>. Thanks!
-Tue Feb 25 08:49:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * test/ruby/test_variable.rb: add a test for above.
- * lib/cmath.rb (log): raise ArgumentError when more than 2 arguments
- are passed. [ruby-core:66143] [Bug #10487]
+Wed Aug 24 08:53:06 2011 Eric Hodel <drbrain@segment7.net>
-Tue Feb 25 02:15:17 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * lib/rdoc: Update to RDoc 3.9.3. Fixes RDoc with `ruby -Ku`. Allows
+ HTTPS image paths to be turned into <img> tags. Prevents special
+ markup inside <tt> from being processed.
- * test/ruby/test_math.rb: Use assert_infinity instead of assert_equal(1.0/0, ...).
+Wed Aug 24 07:57:43 2011 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_math.rb: Add tests for overriding Integer#to_f.
- [ruby-core:67919] [Misc #10809]
+ * lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple
+ gems and gem cleanup.
-Tue Feb 24 22:58:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 24 06:45:20 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * complex.c (nucomp_mul): calculate as rotation in complex plane
- if matrix calculation resulted in NaN.
+ * lib/minitest/*: Imported minitest 2.5.0 (r6557)
+ * test/minitest/*: ditto
-Tue Feb 24 21:45:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+Wed Aug 24 00:38:22 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
- and move #test_cbrt to more proper place.
+ * thread.c (update_coverage): skip coverage count up if the current
+ line is out of the way. rb_sourceline() is unreliable when source
+ code is big. [ruby-dev:44413]
-Tue Feb 24 19:09:25 2015 Koichi Sasada <ko1@atdot.net>
+ * test/coverage/test_coverage.rb: add a test for above.
- * vm_insnhelper.c (lep_svar_place, lep_svar_get): do not create
- additional T_NODE object (svars holder) when only getting
- svars.
+Tue Aug 23 15:23:56 2011 Eric Hodel <drbrain@segment7.net>
-Tue Feb 24 11:49:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (rb_f_require): Improve documentation of Kernel#require.
+ [Ruby 1.9 - Bug #5210]
- * time.c (time_zone_name): should be US-ASCII only if all 7-bits,
- otherwise locale encoding. [ruby-core:68230] [Bug #10887]
+Tue Aug 23 11:27:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Tue Feb 24 09:47:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
+ gzip header is readable to avoid SEGV.
- * string.c (chompped_length): enable smart chomp for all non-dummy
- encoding strings, not only default_rs.
- [ruby-core:68258] [Bug #10893]
+ * test/zlib/test_zlib.rb (test_corrupted_header): Test it.
-Mon Feb 23 23:19:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Aug 22 23:43:33 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * tool/vcs.rb (IO.popen): support :chdir option.
+ * sprintf.c (rb_str_format): add RB_GC_GUARD to prevent temporary
+ strings from GC.
- * tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead
- of -C option which is not supported by older git.
- [ruby-dev:48880] [Bug #10890]
+Sun Aug 21 17:49:53 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon Feb 23 15:26:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (iseq_s_disasm): remove variable which is no longer used
+ since r33013.
- * string.c (rb_str_split_m): raise ArgumentError at broken string
- not RegexpError, as Regexp is not involved in.
- [ruby-core:68229] [Bug #10886]
+Sun Aug 21 14:20:58 2011 Naohisa Goto <ngotogenome@gmail.com>
-Mon Feb 23 07:25:29 2015 Benoit Daloze <eregontp@gmail.com>
+ * configure.in: use LD_LIBRARY_PATH_64 on 64-bit Solaris.
- * time.c: Zone encoding should be US-ASCII if all 7-bits. Fix r46907.
+Sat Aug 20 13:19:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests.
+ * iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
-Sun Feb 22 18:33:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * test/ruby/test_method.rb (test_body): add a test for the above change.
- * common.mk: use ruby organization for rubyspec.
+Sat Aug 20 10:43:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 22 15:56:06 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+ * ext/stringio/stringio.c (strio_read): return new string if nil
+ is explicitly given as a buffer ([Bug #5207]), otherwise set the
+ encoding. also removed dead code.
- * vm_insnhelper.c (rb_vm_rewrite_cref_stack): copy nd_refinements
- of original crefs. It fixes segmentation fault when calling
- refined method in duplicate module. [ruby-dev:48878] [Bug #10885]
+Fri Aug 19 14:25:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h, class.c: change accordingly.
+ * process.c (proc_spawn_v, proc_spawn): should not wait the
+ spawned process.
- * test/ruby/test_refinement.rb: add a test for above.
+ * process.c (proc_spawn_v): fix missing argument, and try with
+ /bin/sh only if failed with ENOEXEC.
-Sun Feb 22 10:43:37 2015 Koichi Sasada <ko1@atdot.net>
+Fri Aug 19 14:12:57 2011 Shugo Maeda <shugo@ruby-lang.org>
- * gc.c (rb_objspace_call_finalizer): control GC execution during
- force firnalizations at the end of interpreter process.
- [Bug #10768]
+ * lib/net/imap.rb (idle): raises a Net::IMAP::Error when the
+ connection is closed. based on the patch by Hugo Barauna.
+ [Bug #5190] [ruby-core:38930]
- 1) Prohibit incremental GC while running Ruby-level finalizers
- to avoid any danger.
- 2) Prohibit GC while invoking T_DATA/T_FILE data structure
- because these operations break object relations consistency.
+Fri Aug 19 13:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
- This patch can introduce another memory consuming issue because
- Ruby-level finalizers can run after (2), GC is disabled.
- However, basically object consistency was broken at (2) as I
- described above. So that running Ruby-level finalizers contains
- danger originally. Because of this point, I need to suggest to
- remove these 3 lines (invoking remaining finalizers). And add a
- rule to add that finalizers should not add new finalizers, or
- say there is no guarantee to invoke finalizers that added by
- another finalizer.
+ * configure.in: defines _DARWIN_UNLIMITED_SELECT if the target_os
+ is darwin.
-Sun Feb 22 04:07:05 2015 Zachary Scott <e@zzak.io>
+Fri Aug 19 13:14:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * ext/openssl/ossl_asn1.c: [DOC] RDoc formatting fixes for
- ASN1::ObjectId with patch from @vbatts [Fixes GH-834]
+ * thread.c: add a description for the behavior of select(2) on
+ Mac OS X 10.7 (Lion).
- * ext/openssl/ossl_bn.c: ditto.
+Fri Aug 19 11:28:58 2011 Shugo Maeda <shugo@ruby-lang.org>
-Sat Feb 21 19:51:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/imap.rb (msg_att): accepts extra space before ')'.
+ based on the patch by art lussos. [Bug #5163] [ruby-core:38820]
- * re.c (match_aref): RMatch::regexp is Qnil after matching by a
- string since r45451. [ruby-core:68209] [Bug #10877]
+Wed Aug 17 23:01:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Sat Feb 21 16:18:42 2015 Stefan Schuler <mail@stefanschuessler.de>
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ remove duplication.
- * compar.c (Init_Comparable): [DOC] Replace camelcase variable name.
- [Fix GH-833]
+Wed Aug 17 15:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Fri Feb 20 17:27:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ add a new function for raising error when an object cannot coerce
+ into BigDecimal. [Bug #5172]
- * file.c (rb_file_identical_p): fix handle leak, ensure to close
- the handle of the first argument.
+ * ext/bigdecimal/bigdecimal.c (BigDecimalValueWithPrec): use
+ cannot_be_coerced_into_BigDecimal function.
-Fri Feb 20 17:19:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
- * win32/win32.c (different_device_p): compare by volume serial
- numbers, not by path names. [ruby-core:68162] [Bug #10865]
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
-Thu Feb 19 01:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal.rb: test for the above changes.
- * win32/file.c (rb_file_expand_path_internal): neither the drive
- of base directory nor the current drive are involved in the
- result if different than the drive of path.
- [ruby-core:68130] [Bug #10858]
+ * test/bigdecimal/testbase.rb (under_gc_stress): add a new utility
+ method to run tests under the condition of GC.stress = true.
-Wed Feb 18 10:48:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 17 10:16:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * win32/win32.c (wrename): return EXDEV if moving a directory to
- another drive, since MoveFileExW does not set proper error code.
- [ruby-core:68162] [Bug #10865]
+ * rational.c (nurat_coerce): Rational#coerce should converts itself
+ into Complex if the argument is a Complex with non-zero imaginary
+ part. [Bug #5020] [ruby-dev:44088]
-Wed Feb 18 03:13:52 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+ * test/ruby/test_rational.rb (test_coerce): test for the above change.
- * ext/psych/lib/psych.rb: bump psych version.
- * ext/psych/psych.gemspec: ditto
- * ext/psych/yaml/scanner.c: add latest libyaml change.
- * test/psych/helper.rb: support newer minitest
- * test/psych/test_to_yaml_properties.rb: ditto
+Wed Aug 17 06:33:19 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Feb 17 11:47:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509cert.c: Add class documentation for
+ OpenSSL::X509::Certificate.
- * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
- returned by Kernel#instance_variables are Symbols now.
- [ruby-core:68128] [Bug #10857]
+Wed Aug 17 04:54:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Feb 17 10:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/openssl/ossl_pkey.c: corrected docs, OpenSSL::PKey::DH does
+ *not* support #sign/verify.
- * doc/syntax/calling_methods.rdoc: Fix documentation for "calling_methods"
- Patch by @sos4nt [fix GH-830][ci skip]
+Tue Aug 16 18:56:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 17 10:53:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (ruby_threadptr_data_type): rename to hide.
+ [ruby-core:38972]
- * win32/file.c (rb_file_expand_path_internal): do not make invalid
- (or ADS) path if the path has a drive letter, the result also
- should have be under it. [ruby-core:68130] [Bug #10858]
+Tue Aug 16 18:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 17 10:47:20 2015 Iain Beeston <iain.beeston@gmail.com>
+ * win32/mkexports.rb (Exports::Mswin#each_export): exclude Init_
+ and _threadptr_ functions, as well as mingw.
- * hash.c: Added docs to explain that #include? and #member? do not
- check member equality
- * lib/set.rb: ditto
+Tue Aug 16 09:31:44 2011 Eric Hodel <drbrain@segment7.net>
-Mon Feb 16 20:58:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl: Add documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #5192]
- * compile.c (compile_massign): optimization for special case,
- assignments by aset or attrset.
- http://kokizzu.blogspot.jp/2015/02/c-java-hhvm-ruby-nodejsrhinojscspidermo.html
- http://www.atdot.net/~ko1/diary/201502.html#d16
+Tue Aug 16 08:48:26 2011 Eric Hodel <drbrain@segment7.net>
-Sun Feb 15 10:41:23 2015 Sho Hashimoto <sho-h@ruby-lang.org>
+ * ext/.document (fiddle): Remove duplicate entry
+ * ext/fiddle: Complete documentation of Fiddle. Patch by Vincent
+ Batts. [#5192]
- * doc/standard_library.rdoc: [DOC] delete removed libraries.
- [misc #10843] [ci skip]
+Tue Aug 16 08:00:15 2011 Eric Hodel <drbrain@segment7.net>
-Sat Feb 14 12:20:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket: Make Socket documentation appear. Add documentation for
+ Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Feature #5182]
- * random.c (rand_random_number): add a method to return a random
- number like SecureRandom to Random::Formatter.
+Mon Aug 15 09:58:55 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * lib/securerandom.rb (random_bytes): move to Random::Formatter,
- the base method of the module.
+ * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
-Sat Feb 14 12:01:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Add a test for it.
+ Thanks to Eric Wong for the patch.
+ [Ruby 1.9 - Feature #5183] [ruby-core:38911]
- * random.c (random_raw_seed): extract platform dependent random
- seed initialization function as a new method Random.raw_seed.
+Sun Aug 14 05:57:01 2011 Tanaka Akira <akr@fsij.org>
- * lib/securerandom.rb (SecureRandom): use Random.raw_seed.
+ * test/socket/test_socket.rb (test_connect_timeout): added a test
+ based on a patch by Eric Wong. [ruby-core:38910]
-Sat Feb 14 00:49:37 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Aug 13 22:17:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/coverage/coverage.c: Add Coverage.peek_result. Allows you to
- capture coverage information without stopping the coverage tool.
- [ruby-core:67940] [Feature #10816]
+ * tool/mkconfig.rb: do not make the entries related to sitedir and
+ verdordir if disabled by --without options. [ruby-core:38922]
+ [Bug #5187]
- * test/coverage/test_coverage.rb: test for change.
+Sat Aug 13 17:03:22 2011 Tadayoshi Funaba <tadf@dotrb.org>
-Fri Feb 13 21:52:05 2015 Yusuke Endoh <mame@tsg.ne.jp>
+ * ext/date/date_core.c: [ruby-core:38861]
- * string.c (str_discard): does not free for STR_NOFREE string.
- [Bug #10853][ruby-core:68110]
+Sat Aug 13 09:39:07 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * bootstraptest/test_string.rb: test for above.
+ * test/date/test_*.rb: added tests.
-Fri Feb 13 21:16:00 2015 Yusuke Endoh <mame@tsg.ne.jp>
+Sat Aug 13 09:36:19 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/base64.rb: make urlsafe mode user-friendly.
+ * ext/date/date_parse.c (parse_ddd_cb): fix r32896. RB_GC_GUARD
+ insertion position was mistaken. [ruby-dev:44337] [Bug #5152]
- * lib/base64.rb (Base64.urlsafe_encode64): a new option "padding" to
- suppress the padding character ("=").
+Sat Aug 13 09:26:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/base64.rb (Base64.urlsafe_decode64): now it accepts not only
- correctly-padded input but also unpadded input.
- [Feature #10740][ruby-core:67570]
+ * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
+ [ruby-core:38913]
- * test/base64/test_base64.rb: Test for above
+ * test/psych/test_yaml.rb: corresponding test.
-Fri Feb 13 14:19:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Aug 13 09:05:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/json: merge upstream from flori/json
- change usage of TypedData. [Feature #10739][ruby-core:67564]
+ * ext/date/date_core.c (date_strftime_alloc): followed the change
+ of r32885.
-Thu Feb 12 18:34:01 2015 multisnow <infinity.blick.winkel@gmail.com>
+ * doc/NEWS-1.9.3: followed the above change.
- * ext/openssl/extconf.rb: check RAND_edg to support libressl.
+Sat Aug 13 08:55:38 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
- is available. [Fix GH-829]
+ * ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
+ with fewer than 2 dots to be numbers. [ruby-core:38915]
-Thu Feb 12 10:46:14 2015 Eric Hodel <drbrain@segment7.net>
+Sat Aug 13 08:47:20 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * proc.c (proc_call): Improve Proc#call documentation. Patch by
- Hsing-Hui Hsu. [fix GH-761]
+ * ext/date/date_core.c: [ruby-core:38855].
-Thu Feb 12 04:33:02 2015 Benoit Daloze <eregontp@gmail.com>
+Sat Aug 13 03:41:37 2011 Eric Hodel <drbrain@segment7.net>
- * compar.c (cmp_equal): no more error hiding for Comparable#==.
- It now behaves as other Comparable methods. See #7688.
+ * lib/uri/common.rb: Fix documentation of URI::Parser.new. Patch by
+ Steve Klabnik. [Ruby 1.9 - Bug #5177]
- * test/ruby/test_comparable.rb: update related test.
+Sat Aug 13 02:19:57 2011 Eric Hodel <drbrain@segment7.net>
-Thu Feb 12 03:28:05 2015 Eric Wong <e@80x24.org>
+ * ext/digest/digest.c: Add documentation for the Digest module. Patch
+ by Sylvain Daubert. [Ruby 1.9 - Bug #5167]
- * lib/set.rb (initialize): internal hash defaults to false
+Sat Aug 13 01:56:11 2011 Eric Hodel <drbrain@segment7.net>
- * lib/set.rb (include?): use Hash#[] for optimized dispatch.
- Patch by Ismael Abreu <ismaelga@gmail.com>
- [ruby-core:67664] [Misc #10754]
+ * lib/rake: Update to Rake 0.9.2.2. Prevent pollution of toplevel
+ namespace by Commands. Remove unused variable and debugging
+ statement in tests.
-Wed Feb 11 11:09:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 12 11:39:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/digest/digest_conf.rb (digest_conf): check for CommonDigest.
+ * configure.in: Describe "no" configure option for site_ruby
+ and vendor_ruby. Patch by Vit Ondruch. [Bug #5187][ruby-core:38921]
- * ext/digest/*/*cc.h: for Apple CommonCrypto/CommonDigest.h.
+Fri Aug 12 09:00:24 2011 Eric Hodel <drbrain@segment7.net>
- * ext/digest/digest.h (DEFINE_FINISH_FUNC_FROM_FINAL): macro for
- finish functions, by inverting arguments order.
+ * lib/rubygems: Import RubyGems 1.8.8. Fixes encoding of YAML gemspec
+ from gems. Github Issue #149
- * ext/digest/digest_conf.rb (digest_conf): extract common
- configurations.
+Fri Aug 12 08:17:46 2011 Tanaka Akira <akr@fsij.org>
-Wed Feb 11 11:01:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/ipsocket.c (init_inetsock_internal): use SOMAXCONN for
+ listen backlog.
- * ext/json/generator/generator.c (generate_json): get rid of
- unnecessary recursive calls which can cause infinite recursion.
- T_STRING may not have rb_cString.
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
-Wed Feb 11 07:53:35 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/socket/lib/socket.rb (Addrinfo#listen): ditto.
+ (Socket.tcp_server_sockets_port0): ditto.
- * test/win32ole/test_word.rb: use skip method to skip test.
+ * ext/socket/mkconstants.rb: define SOMAXCONN as 5 if not available.
-Tue Feb 10 11:38:28 2015 Shugo Maeda <shugo@ruby-lang.org>
+ [ruby-core:38493]
- * vm_insnhelper.c (vm_call_method): stop method search when a method
- is not found in a refinement, to support undef in refinements.
- [ruby-core:66741] [Bug #10578]
+Fri Aug 12 03:24:35 2011 Eric Hodel <drbrain@segment7.net>
-Tue Feb 10 11:19:11 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * lib/rdoc: Import RDoc 3.9.2. Fixes TIDYLINK for HTML output.
- * lib/net/ftp.rb (chdir, delete, gettextfile, mdtm, mkdir, nlst,
- putbinaryfile, puttextfile, rename, rmdir, size): support
- Pathname. Patch by Joe Rafaniello. [fix GH-828]
+Thu Aug 11 15:37:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Mon Feb 9 16:36:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (autoload_delete): An autoload entry is still in a
+ RCLASS_IV_TBL, not in a RCLASS_CONST_TBL, so take back the table
+ changed in r29600. And an autoload entry keeps not a
+ rb_const_entry_t but a NODE so remove rb_const_entry_t thing added
+ in r29602.
- * tool/make-snapshot (package): get rid of loading unbundled and
- unexpected libraries. [ruby-core:67977] [Bug #10822]
+Thu Aug 11 15:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 8 20:09:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * lib/mkmf.rb (link_command): use LIBRUBYARG in rbconfig for
+ unbundled extensions. [ruby-core:38802] [Bug #5147]
- * lib/net/http/header.rb: pass header names as symbols.
- Patch by @DamirSvrtan [fix GH-805]
- * test/net/http/test_httpheader.rb: added test.
+ * lib/mkmf.rb (init_mkmf): revert r32902. [ruby-core:38903]
-Sun Feb 8 13:04:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 10 23:03:55 2011 Tanaka Akira <akr@fsij.org>
- * ext/socket/getaddrinfo.c (get_addr): reject too long hostname to
- get rid of GHOST vulnerability on very old platforms.
+ * ext/socket/lib/socket.rb: fix argument check in the previous commit.
- * ext/socket/raddrinfo.c (make_hostent_internal): ditto, paranoic
- check for the canonical name.
+Wed Aug 10 22:12:28 2011 Tanaka Akira <akr@fsij.org>
-Sun Feb 8 12:48:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
+ (Addrinfo#connect_from): add :timeout option.
+ (Addrinfo#connect): ditto.
+ (Addrinfo#connect_to): ditto.
+ [ruby-core:38538]
- * ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide
- versions of RegDeleteValue and RegDeleteKey.
- [ruby-core:67958] [Bug #10820]
+Wed Aug 10 21:27:19 2011 Tanaka Akira <akr@fsij.org>
-Sat Feb 7 22:13:08 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/net/pop.rb: fix typo in document.
- * test/win32ole/test_win32ole_record.rb: remove test using .NET
- Framework 3.5 because it is not included in Windows 8/8.1.
+ * lib/net/http.rb: ditto.
-Sat Feb 7 19:25:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/imap.rb: ditto.
- * dir.c (has_magic): always get long path name on Windows even if
- no tilde is there. [ruby-core:68011] [Bug #10819]
+Wed Aug 10 19:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * dir.c (replace_real_basename): FindFirstFile ignore redirection
- character, check if exists before call it. cf. [Bug #8597]
+ * complex.c (nucomp_rationalize): calls rationalize of real part if
+ imaginary part is exactly zero. The patch is made by Marc-Andre
+ Lafortune. fixes [Bug #5178] [ruby-core:38885]
-Sat Feb 7 13:30:11 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * test/ruby/test_complex.rb (test_rationalize): add a test for the
+ above change.
- * test/win32ole/test_win32ole_record.rb
- (test_ole_instance_variable_get): correct VT_RECORD type and
- instance variables.
+ * complex.c (nucomp_to_r): fix RDoc comment. The patch is made by
+ Marc-Andre Lafortune.
-Fri Feb 6 17:47:05 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Wed Aug 10 14:11:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes when
- dumping objects with custom coders. [ruby-core:66215] [Bug #10496]
+ * lib/mkmf.rb (init_mkmf): set $LIBRUBYARG regardless of shared
+ option. [ruby-core:38802] [Bug #5147]
- * test/psych/test_coder.rb: test for fix
+Wed Aug 10 02:53:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Feb 6 16:58:31 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/net/http.rb: come back autoload. OpenSSL constant is used
+ some places, so it leads mistakes like HTTP.start.
- * ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
- expressions with newlines. tenderlove/psych#222
+Tue Aug 9 22:57:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/psych/test_yaml.rb: test for change.
+ * ext/date/date_parse.c (date_zone_to_diff): add RB_GC_GUARD.
+ [ruby-dev:44337] [Bug #5152]
-Fri Feb 6 10:31:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/date/data_parse.c (parse_ddd_cb): ditto.
- * vm_core.h (rb_call_info_kw_arg_struct): make keywords a symbols
- list to get rid of inadvertent creation by variable keyword
- arguments. [ruby-core:68031] [Bug #10831]
+Tue Aug 9 14:25:47 2011 Naohisa Goto <ngotogenome@gmail.com>
-Thu Feb 5 22:42:34 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
+ should be used to handle shorter return value. fix [Bug #3861]
+ [ruby-core:32504]
- * lib/rubygems: Update to RubyGems HEAD(5c3b6f3).
- Fixed #1156, #1142, #1115, #1142, #1139 on rubygems/rubygems
- * test/rubygems: ditto.
+ * ext/fiddle/closure.c (callback): ditto
-Thu Feb 5 13:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/conversions.h (fiddle_generic): ditto
- * vm_eval.c (send_internal), vm_insnhelper.c (vm_call_opt_send):
- convert String method name into a Symbol, as method_missing
- method expects its first argument to be a Symbol. [Bug #10828]
+ * ext/fiddle/conversions.c (value_to_generic): char, short and int
+ are strictly distinguished on big-endian CPU, e.g. sparc64.
- * vm_insnhelper.c (ci_missing_reason): return the reason of method
- missing in call info.
+Tue Aug 9 11:21:08 2011 Narihiro Nakamura <authornari@gmail.com>
- * vm_insnhelper.c (vm_call_opt_send): re-apply r49500 with the
- proper missing reason. [Bug #10828]
+ * gc.c (gc_lazy_sweep): if sweep target slots are not found, we
+ try heap_increment() because it might be able to expand the
+ heap. [Bug #5127] [ruby-dev:44285]
-Thu Feb 5 10:31:46 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was
+ interrupted, we expand the heap if at all possible.
- * class.c (rb_obj_singleton_methods): should use RTEST() to convert
- VALUE to int.
+Tue Aug 9 12:20:33 2011 Naohisa Goto <ngotogenome@gmail.com>
-Thu Feb 5 03:59:33 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.
+ [ruby-core:38853] [Bug #5168]
- * vm_insnhelper.c: Fix symbol leak with +send+ [Bug #10828]
+ * test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
+ and libm version numbers for detecting default libc and libm.
-Wed Feb 4 20:26:54 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Tue Aug 9 09:18:04 2011 Eric Hodel <drbrain@segment7.net>
- * ext/win32ole/win32ole.c (Init_win32ole): should not use atexit to
- free allocated hash table to avoid error on Cygwin.
+ * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.
-Wed Feb 4 15:34:25 2015 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
- * class.c (method_entry_i, class_instance_method_list,
- rb_obj_singleton_methods): should not include methods of
- superclasses if recur is false. [ruby-dev:48854] [Bug #10826]
+ * ext/zlib/zlib.c (rb_gzreader_s_open): ditto
-Wed Feb 4 16:32:40 2015 Matt Hoyle <matt@deployable.co>
+Sun Aug 7 23:31:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix a typo, 'expoennt'
- to 'exponent'. [ruby-core:67980] [Bug #10823] [Fix GH-825]
+ * time.c (rb_strftime_alloc): raise ERANGE if width is too large.
+ Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285]
-Wed Feb 4 15:55:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_time.rb (class TestTime): add a test for the
+ above change.
- * ext/sdbm/_sdbm.c: include ruby/ruby.h for PRIdPTRDIFF when a
- macro `DEBUG` is defined. based on the patch by Owen Rodley in
- [ruby-core:67987]. [Bug #10825]
+Sun Aug 7 22:51:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Feb 4 11:12:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
- * Makefile.in (probes.stamp): rebuild dtrace dependent objects
- only when `dtrace -G` modifies its input files.
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
-Tue Feb 3 19:27:16 2015 Naohisa Goto <ngotogenome@gmail.com>
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.
- * common.mk (ruby-glommed.o): dependency on $(OBJ) should be written
- in common.mk (in which OBJ is defined) because of Makefile include
- and parse order. This partly reverts r49419.
- [ruby-dev:48849] [Bug #10808]
+Sun Aug 7 22:37:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * Makefile.in (ruby-glommed.o): ditto.
+ * configure.in: add -Wunused-variable to default CFLAGS.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
- * Makefile.in (ruby-glommed.o): remove excess $(DTRACE_OBJ) because
- it is included in $(OBJS) since r49451.
+Sun Aug 7 15:37:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * Makefile.in (probes.o): should depend on $(DTRACE_DEPENDENT_OBJS)
+ * ext/digest/sha2/sha2ossl.c: use original SHA384_Final on DragonFly.
-Tue Feb 3 17:15:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Aug 7 14:08:16 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of
- interference by modifying global variables in have_devel? method.
- [ruby-core:67962] [Bug #10821]
+ * ext/objspace/objspace.c: fix typos in a document.
-Tue Feb 3 15:23:58 2015 Shugo Maeda <shugo@ruby-lang.org>
+Sun Aug 7 07:14:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_method.c (remove_method): When remove refined
- method, raise a NameError if the method is not
- defined in refined class.
+ * cont.c (HAVE_GETCONTEXT): see getcontext(3) because DragonFly BSD
+ x64 port doesn't have it.
- But if the method is defined in refined class,
- it should keep refined method and remove original
- method.
+Sun Aug 7 00:42:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
- Patch by Seiei Higa. [ruby-core:67722] [Bug #10765]
+ * ext/tk/lib/tk/wm.rb (Tk::Wm.command): Add the missing receiver
+ before calling epath. patched by flori
+ https://github.com/flori/ruby/commit/aa9474d32e5f2c57f8b0e2e0c528a03f06a4d433
-Tue Feb 3 14:04:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 6 07:06:34 2011 Eric Hodel <drbrain@segment7.net>
- * dir.c (glob_helper): obtain real name with FindFirstFile API
- instead of matching all entries, on Windows.
- [ruby-core:67954] [Bug #10819]
+ * marshal.c (w_object): Fix exception message when _dump_data is not
+ defined on a T_DATA object.
-Tue Feb 3 12:26:35 2015 Katsuhiko Nishimra <ktns.87@gmail.com>
+Fri Aug 5 22:16:20 2011 Naohisa Goto <ngotogenome@gmail.com>
- * lib/mkmf.rb (configuration): set the default cxxflags, which is
- referred from the default CXXFLAGS, for extension libraries.
- [Fix GH-823]
+ * numeric.c (rb_infinity, rb_nan): use WORDS_BIGENDIAN to get endian.
+ fix [Bug #5160] [ruby-dev:44356]
-Tue Feb 3 05:52:00 2015 Aman Gupta <ruby@tmm1.net>
+Fri Aug 5 17:14:11 2011 Akinori MUSHA <knu@iDaemons.org>
- * gc.c (rb_objspace_free): cause rb_bug if lazy sweep is in progress
- during rb_objspace_free. Adds extra protection for r46340.
- Patch by Vicent Marti. [Bug #10768] [ruby-core:67734]
- * gc.c (rb_objspace_call_finalizer): Ensure GC is completed after
- finalizers have run. We already call gc_rest() before invoking
- finalizers, but finalizer can allocate new objects and start new GC
- cycle, so we call gc_rest() again after finalizers are complete.
+ * test/test_syslog.rb (TestSyslog#test_log): Do not be too
+ specific about the log line format. Fixes #5081.
-Mon Feb 2 10:51:34 2015 Ari Pollak <ajp@aripollak.com>
+Fri Aug 5 15:57:10 2011 Naohisa Goto <ngotogenome@gmail.com>
- * doc/security.rdoc (Symbols): update about Symbol GC. Symbols
- explicitly converted from Strings now can be collected, but
- reflection/metaprogramming still can cause memory flooding.
- [Fix GH-725]
+ * complex.c (f_signbit): fix compile error in gcc4 on Solaris with
+ CFLAGS="-std=gnu99". [ruby-dev:44355] fix [Bug #5159]
-Sun Feb 1 13:46:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * math.c: ditto.
- * tool/rbinstall.rb (bin-comm): drop batch file installation.
- Windows 95 support has not been supported already.
- [Feature #10806]
+Fri Aug 5 15:55:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 31 12:06:23 2015 Scott Francis <scott.francis@shopify.com>
+ * test/ruby/test_object.rb: tests that respond_to? returns false.
- * thread_pthread.c (reserve_stack): fix intermittent SIGBUS on
- Linux, by reserving the stack virtual address space at process
- start up so that it will not clash with the heap space.
- [Fix GH-822]
+Fri Aug 5 13:32:43 2011 Shugo Maeda <shugo@ruby-lang.org>
-Fri Jan 30 17:28:29 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ * lib/xmlrpc/client.rb, lib/xmlrpc/server.rb: should use
+ String#bytesize instead of String#size.
- * math.c (num2dbl_with_to_f): make faster when Bignum passed by
- direct conversion using rb_big2dbl(). [Feature #10800]
+Fri Aug 5 12:18:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 29 23:30:00 2015 Kenta Murata <mrkn@mrkn.jp>
+ * vm_eval.c (check_funcall): try respond_to? first if redefined.
+ [Bug #5158]
- * ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback function
- for rubies lower than 2.2.0.
+Fri Aug 5 09:48:22 2011 Eric Hodel <drbrain@segment7.net>
- * ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto.
+ * lib/rubygems: Import RubyGems 1.8.7:
+ Added missing require for `gem uninstall --format-executable`.
- * ext/bigdecimal/extconf.rb: check the existences of struct RRational,
- rb_rational_num, and rb_rational_den.
+ The correct name of the executable being uninstalled is now displayed
+ with --format-executable.
- * ext/bigdecimal/bigdecimal.bundle: bump version.
+ Fixed `gem unpack uninstalled_gem` default version picker.
-Thu Jan 29 20:28:25 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ RubyGems no longer claims a nonexistent gem can be uninstalled.
- * tool/make-snapshot: removed md5 digest with package information
+ `gem which` no longer claims directories are requirable files.
-Thu Jan 29 10:41:52 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
+ `gem cleanup` continues cleaning up gems if one can't be uninstalled
+ due to permissions. Issue #82.
- * math.c (Get_Double): direct casting from Fixnum to double.
- [Feature #10785]
+ Gem repository directories are no longer created world-writable.
+ Patch by Sakuro OZAWA. [Ruby 1.9 - Bug #4930]
-Thu Jan 29 02:34:27 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Fri Aug 5 07:00:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes with
- instance variables when it is referenced multiple times.
- * ext/psych/lib/psych.rb: bump version
- * ext/psych/psych.gemspec: bump version
- * test/psych/test_hash.rb: test for fix
+ * test/io/console/test_io_console.rb (test_noctty): daemon() on
+ Fedora Rawhide seems not to detach the controlling terminal,
+ when the argument noclose is non-zero. ref: [Bug #5135]
-Thu Jan 29 02:06:09 2015 Eric Wong <e@80x24.org>
+Thu Aug 4 23:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * thread.c (struct join_arg): restructure and make smaller
- (thread_join_sleep): avoid timeofday() call if forever
- (thread_join): pass join_arg.delay directly
- (rb_thread_inspect_msg): remove, inline into rb_thread_inspect
- (rb_thread_inspect): reduce branching and string creation
- * thread_pthread.c (native_set_thread_name): create string directly
- to avoid reparsing. [Misc #10723]
+ * thread_pthread.c (native_cond_signal): retry to call pthread_cond_signal
+ and pthread_cond_broadcast if they return EAGAIN in
+ native_cond_signal and native_cond_broadcast, respectively.
+ It is for the pthread implementation of Mac OS X 10.7 (Lion).
+ fixes #5155. [ruby-dev:44342].
-Wed Jan 28 21:32:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * thread_pthread.c (native_cond_broadcast): ditto.
- * thread.c: Improve documentation for Thread#value
- [Bug #10694][ruby-core:67324][ci skip]
+ * thread_pthread.c (struct cached_thread_entry): stop using
+ pthread_cond_t and its functions directly.
-Tue Jan 27 16:04:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread_pthread.c (register_cached_thread_and_wait): ditto.
- * tool/redmine-backporter.rb: added `!` command.
+ * thread_pthread.c (use_cached_thread): ditto.
-Tue Jan 27 15:58:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Aug 4 20:29:41 2011 Naohisa Goto <ngotogenome@gmail.com>
- * tool/redmine-backporter.rb: added history feature for platforms which
- lack readline.
+ * configure.in: when Solaris cc, use $(CC) to link shared libs.
-Mon Jan 26 22:09:35 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Thu Aug 4 20:19:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * .gitignore: ignored temporary file with git.
+ * error.c (report_bug): use a small message buffer instead of BUFSIZ.
+ It is needed for avoiding nested SIGSEGV on Linux.
+ Note: BUFSIZ is not proper buffer size. It's unrelated with maximum
+ filename length. :-/
+ [Bug #5139] [ruby-dev:44315]
-Mon Jan 26 18:06:03 2015 Akinori MUSHA <knu@iDaemons.org>
+Thu Aug 4 16:08:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * misc/ruby-electric.el: Import version 2.2.2 from
- https://github.com/knu/ruby-electric.el.
+ * tool/rbinstall.rb (gem): install all gemspecs under lib and ext.
-Mon Jan 26 11:37:49 2015 Dave Stevens <dave@crowdlab.com>
+ * tool/rbinstall.rb (Gem::Specification): may not be defined when
+ cross-compiling and BASERUBY is 1.8.
- * string.c (str_make_independent_expand): terminate String when
- moved from heap to embedded. [Fix GH-821].
+Thu Aug 4 11:30:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jan 25 12:04:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/missing.h: define __syscall on OpenBSD as r32702.
- * array.c (flatten): no need to call to_ary method on elements
- beyond the given level. [ruby-core:67637] [Bug #10748]
+Thu Aug 4 03:02:54 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jan 25 00:42:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/rbinstall.rb: use rubygems to load gemspecs, copy actual
+ gemspecs on install rather than generate fake ones for all gems.
- * ext/fiddle/win32/libffi.mk.tmpl: assemble without directory prefix.
- workaround of a bug of VC12 ml, by unak at [ruby-core:67792].
- [ruby-core:67789] [Bug #10780]
+Thu Aug 4 02:45:10 2011 Kenta Murata <mrkn@mrkn.jp>
-Sat Jan 24 19:56:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: set CXX variable to the C++ compiler that matches the
+ C compiler specified by CC variable (e.g. use g++-4.2 for gcc-4.2).
- * dln_find.c (dln_find_1): search regular files only. based on
- the patch by Alex Coomans in [ruby-core:67766]. [Bug #10776]
+Thu Aug 4 02:21:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 23 23:57:05 2015 Misumi Rize <r@ayase-e.li>
+ * lib/mkmf.rb (link_command): use static library only for bundled
+ extensions. [Bug #5147]
- * vm_insnhelper.c (vm_throw_start): search the target to break
- from a block with nested rescue, from the nested blocks.
- [ruby-core:67765] [Bug #10775] [Fix GH-820]
+Thu Aug 4 02:02:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Jan 23 20:00:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/psych.gemspec: installing psych as a gem.
- * marshal.c (w_object, marshal_dump): use identity tables for
- arbitrary VALUE keys, because of performance of FLONUM.
- [Bug #10761]
+Wed Aug 3 16:01:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * marshal.c (obj_alloc_by_klass, marshal_load): ditto.
+ * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
+ [Bug #5153] [ruby-core:38736]
-Fri Jan 23 17:12:33 2015 Eric Wong <e@80x24.org>
+ * io.c (argf_next_argv): remove the call of above function.
- * benchmark/bm_marshal_dump_flo.rb: new benchmark for [Bug #10761]
+ * ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
+ extension module because this is only for testing ruby_add_suffix().
-Thu Jan 22 18:03:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * LEGAL: remove the mention about a part of util.c, because now we
+ removed the part.
- * tool/redmine-backporter.rb (find_svn_log): use double quotes instead
- of single quotes because cmd.exe doesn't handle them.
+ * io.c (argf_next_argv): now the new filename is not guaranteed to
+ use, so should check the return value of rename(2).
- * tool/redmine-backporter.rb (done): the 2nd element of matched data
- is the offset of the end of matched string, not length.
+ * test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
+ now we expect same result with other platforms on no_safe_rename
+ platforms (=Windows).
-Thu Jan 22 16:45:24 2015 Eric Wong <e@80x24.org>
+Wed Aug 3 09:18:08 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * st.c (st_numhash): mix float value for flonum
- * hash.c (rb_any_hash): ditto
- * benchmark/bm_hash_aref_flo.rb: new benchmark
- * benchmark/bm_hash_ident_flo.rb: ditto
- [Bug #10761]
+ * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
+ Like r32795, bind address should be specified.
-Wed Jan 21 22:33:51 2015 Akinori MUSHA <knu@iDaemons.org>
+Wed Aug 3 07:46:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * misc/ruby-electric.el: Import version 2.2.1 from
- https://github.com/knu/ruby-electric.el. Improve compatibility
- with and optimize for Emacs 24.4.
+ * encoding.c (enc_find): mistakenly remained !. [Bug #5150]
-Wed Jan 21 09:40:52 2015 Zachary Scott <e@zzak.io>
+Wed Aug 3 00:11:08 2011 Tanaka Akira <akr@fsij.org>
- * file.c: Document other cases of missing birthtime on OS with patch
- provided by @sho-h similar to GH-817. [ci skip] [DOC]
+ * lib/prettyprint.rb: update document. [ruby-core:36776]
-Wed Jan 21 09:09:19 2015 Tanaka Akira <akr@fsij.org>
+Tue Aug 2 22:04:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * NEWS: References to tickets added.
- [ruby-core:67701] [Bug #10760] Suggested by Zachary Scott.
+ * gc.c (init_heap): allocate sigaltstack after heaps are allocated.
+ [ruby-dev:44315] [Bug #5139]
-Tue Jan 20 22:59:54 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm.c (thread_free): use free because objspace is not ready.
- * tool/vcs.rb: fix the exception given remote-url of svn.
+ * vm.c (th_init): use malloc because objspace is not ready.
-Tue Jan 20 12:58:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Aug 2 20:10:16 2011 Shota Fukumori <sorah@tubusu.net>
- * tool/redmine-backporter.rb: now can change the page of `ls`.
+ * test/testunit/test_parallel.rb: pass "--ruby" option to
+ test/testunit/tests_for_parallel/runner.rb. [Bug #5132] [ruby-dev:44303]
-Tue Jan 20 12:28:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Aug 2 15:53:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/redmine-backporter.rb (readline): fallback to normal gets on
- Windows because IO.console.getch is not always do as expected.
+ * encoding.c (str_to_encoding): rename from to_encoding and
+ use str_to_encindex.
-Tue Jan 20 11:31:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * encoding.c (str_to_encindex): split from to_encoding.
- * tool/redmine-backporter.rb: update usage.
+ * encoding.c (rb_to_encoding): use str_to_encoding.
-Tue Jan 20 11:23:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
+ * encoding.c (rb_obj_encoding): don't bypass rb_encoding*.
+ If it uses rb_encoding*, it bypass encindex. If it uses encindex,
+ it doesn't bypass.
- * tool/redmine-backporter.rb (mygets): to support Backspace
- implement gets by itself.
+ * encoding.c (enc_find): add shortcut for encoding object, use
+ str_to_encindex, and avoid bypass rb_encoding*.
-Tue Jan 20 02:54:11 2015 Zachary Scott <e@zzak.io>
+Tue Aug 2 12:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c: NotImplementedError is raised if birthtime is unavailable.
- Patch by @y-yagi san and [Fixes GH-817] [ci skip] [DOC]
+ * hash.c (recursive_hash): hash value of emptied hash should be
+ equal to an empty hash. [ruby-core:38650]
- * ext/pathname/pathname.c: ditto.
+Tue Aug 2 11:42:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]
-Mon Jan 19 22:08:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 2 07:33:29 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * class.c (include_modules_at): allow to prepend each module up to
- once for each classe. [EXPERIMENTAL]
+ * test/net/http/test_http.rb (TestNetHTTP_version_1_1_methods#test_timeout_during_HTTP_session):
+ If you connect to localhost, you should listen localhost.
-Sun Jan 18 18:32:20 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
+ ditto.
- * math.c (math_atan2): revive documentation before r49220.
- http://d.hatena.ne.jp/nagachika/20150112/ruby_trunk_changes_49213_49226
+Tue Aug 2 06:18:15 2011 Luis Lavena <luislavena@gmail.com>
-Sun Jan 18 15:57:32 2015 Seiei Higa <hanachin@gmail.com>
+ * lib/rubygems/installer.rb (class Gem): Correct path check on Windows
+ Possible fix for [Ruby 1.9 - Bug #5111]
+ * test/rubygems/test_gem_installer.rb (load Gem): ditto
- * vm_method.c (check_definition): Module#public_method_defined?,
- Module#private_method_defined?, Module#protected_method_defined?
- should not use refinements. [ruby-core:67656] [Bug #10753]
+Mon Aug 1 20:12:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jan 18 15:50:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_process.rb (TestProcess#windows?): new method.
- * vm_dump.c (rb_vm_bugreport): check by configured result instead
- of system name for old FreeBSD. based on a patch by Steve Wills
- at [ruby-core:67655]. [Bug #10752]
+ * test/ruby/test_process.rb (TestProcess#*): use above method.
-Sun Jan 18 12:56:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_process.rb (TestProcess#test_execopts_redirect):
+ windows doesn't support FD_CLOEXEC.
- * Makefile.in (VPATH, NEWLINE_C), common.mk (common-srcs): make
- and use newline.c under enc/trans directory, not toplevel. no
- longer search enc directory implicitly.
+Mon Aug 1 15:45:23 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in, enc/Makefile.in (BUILTIN_ENCS, BUILTIN_TRANSES):
- prefix respective directory names to builtin encodings and
- transcoder source names.
+ * test/rake/test_rake_functional.rb: Don't assume the binary name of
+ ruby is "ruby". [Ruby 1.9 - Bug #5114]
+ * test/rake/helper.rb: ditto
-Sun Jan 18 11:49:46 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Mon Aug 1 15:31:14 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
- variable is passed by reference. [ruby-dev:48803] [Bug #10697]
+ * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
+ Skip when PTY allocation failed (that's not our fault).
-Sat Jan 17 23:59:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Aug 1 15:04:12 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
- anchors like `\Z` are not valid inside character class. use
- negative-lookahead instead.
- Fixes: https://github.com/tenderlove/psych/issues/221
+ * test/xmlrpc/test_webrick_server.rb (Test_Webrick#setup_http_server):
+ XMLRPC::Client.new3(), when called without host: argument, tries
+ to connect to a host where "localhost" resolves to. On the
+ other hand a WEBrick::HTTPServer.new(), when called without
+ BindAddress: argument, tries to listen all the address where
+ getaddrinfo(AF_UNSPEC) resolves to. This is a mismatch because
+ "localhost" might not resolve to one of those listening sockets.
+ We would better explicitly specify "localhost" here and if
+ failed, just skip the whole test.
-Sat Jan 17 23:42:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Aug 1 14:24:56 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in: get rid of pattern substitution, which is not
- supported by ash, and ash on NetBSD parses whole source first
- and fails to start. [ruby-dev:48823] [Bug #10750]
+ * lib/rdoc.rb: Import RDoc 3.9.1. Fixes bugs in the RDoc::Markup
+ parser.
-Fri Jan 16 18:42:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Aug 1 12:00:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * tool/redmine-backporter.rb: support adding related revisions
- to issues.
+ * insns.def (concatstrings): don't use initial ASCII-8BIT string.
+ [ruby-core:38635] [Bug #5126]
-Fri Jan 16 17:20:33 2015 Koichi Sasada <ko1@atdot.net>
+Sun Jul 31 22:57:16 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- vm.c, vm_core.h: constify VM_CF_LEP, VM_CF_PREV_EP, VM_CF_BLOCK_PTR
- and rb_vm_control_frame_block_ptr.
+ * enc/Makefile.in (ECHO1): Same as the recent fix in common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
-Fri Jan 16 15:41:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Jul 31 21:16:02 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ext/psych/lib/psych.rb: bump version
+ * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does
+ not have it on header.
- * ext/psych/psych.gemspec: ditto
+ * math.c: ditto.
-Fri Jan 16 15:37:49 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Jul 31 21:09:04 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: only dump hash
- subclasses. Thanks Joe Eli McIlvain <joe.eli.mac@gmail.com>
+ * common.mk (node_name.inc): Use $(Q) for consistency.
- * test/psych/test_hash.rb: test for change
+ * Makefile.in (INSNS): ditto.
-Fri Jan 16 15:35:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Jul 31 21:19:51 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ext/psych/lib/psych.rb: bump version
+ * lib/mkmf.rb (configuration:ECHO1): Same as the recent fix in
+ common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: fix line width wrapping
- for long strings. Thanks Jakub Jirutka <jakub@jirutka.cz>
+Sun Jul 31 20:39:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * test/psych/test_string.rb: test for change
+ * common.mk (ECHO1): nmake does not allow parenthesis in make variable
+ replacement.
-Fri Jan 16 11:44:44 2015 Kazuki Tsujimoto <kazuki@callcc.net>
+Sun Jul 31 23:06:57 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * eval_intern.h, vm.c, vm_eval.c, vm_insnhelper.c:
- change throw mechanism (not save target ep, but save target cfp).
- It fixes `unexpected break' bug that occurs when
- TracePoint#binding is called.
- [ruby-dev:48797] [Bug #10689]
+ * vm.c (check_env): print debug messages to stderr.
+ [Feature #4871] [ruby-dev:43743]
- * test/ruby/test_settracefunc.rb: add a test.
+Sun Jul 31 22:50:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Jan 15 23:55:15 2015 Tanaka Akira <akr@fsij.org>
+ * vm.c (vm_make_env_each): don't save prev env value.
+ It is no longer used. [Feature #4871] [ruby-dev:43743]
- * io.c (rb_io_close_m): Don't raise when the IO object is closed.
- [ruby-core:67444] [Feature #10718]
+ * vm.c (check_env): changed accordingly.
-Thu Jan 15 21:34:57 2015 Seiei Higa <hanachin@gmail.com>
+Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" <yugui@yugui.jp>
- * proc.c (rb_obj_singleton_method): Kernel#singleton_method should
- not use refinements, as well as Kernel#method.
- [ruby-core:67603] [Bug #10744]
+ * common.mk (ECHO1): ":" in a make variable replacement cause a syntax
+ error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
-Thu Jan 15 10:45:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (NULLCMD): new check.
- * array.c (rb_ary_select_bang, ary_reject_bang): linear
- performance. [ruby-core:67418] [Feature #10714]
+ * Makefile.in (NULLCMD): Reflects checking in configure.
-Wed Jan 14 18:06:06 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * win32/Makefile.sub (NULLCMD): new assignment.
- * lib/uri/mailto.rb: raising URI::InvalidComponentError instead
- of failing with undefined method `split' for nil:NilClass for
- mailto: URIs without opaque part. [Bug #10738]
- * test/uri/testuri.rb: Test for above
+Sun Jul 31 18:58:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 14 16:45:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_pipe): pipe on cygwin can succeed half but fail
+ half.
- * tool/downloader.rb (RubyGems.download): verify downloaded gem
- packages. LowSecurity to allow untrusted certificates now.
+Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jan 14 15:43:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
- * ext/readline/readline.c (readline_s_refresh_line): initialize
- before rl_refresh_line(), as some function make the internal
- state non-clean but rl_refresh_line() does not re-initialize it.
- [ruby-core:43957] [Bug #6232]
+Sun Jul 31 09:18:28 2011 Eric Hodel <drbrain@segment7.net>
-Tue Jan 13 21:59:24 2015 Michal Papis <mpapis@gmail.com>
+ * lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
+ object reference, nodoc for class aliases, verbatim === lines.
- * tool/rbinstall.rb (gem): fix changing permissions of installed
- bundled gems. [Fix GH-812]
+Sun Jul 31 01:29:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jan 13 21:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_each_byte): remove unused variable e.
- * common.mk (distclean-local): remove autom4te.cache generated by
- autoconf.
+Sat Jul 31 01:23:45 2011 Kenta Murata <mrkn@mrkn.jp>
- * common.mk (realclean-local): remove id sources and dummy header
- for dtrace. [ruby-core:67562] [Bug #10737]
+ * test/bigdecimal/test_bigdecimal.rb (test_version): removed.
-Tue Jan 13 21:08:22 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/json, test/json: merge JSON HEAD(259dee6)
- separate implementation of Typed_Data macro.
- https://github.com/flori/json/compare/v1.8.1...v1.8.2
+ * defs/default_gems: separate from tool/rbinstall.rb.
-Tue Jan 13 14:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jul 30 23:14:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/net/http/test_http.rb: get rid of accessing DNS actually
- for some servers returning wrong results.
- [ruby-core:67454] [Bug #10721]
+ * io.c (rb_io_each_byte): rbuf can be refreshed during yield.
+ [Bug #5119]
-Mon Jan 12 23:21:57 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jul 30 22:35:50 2011 Naohisa Goto <ngotogenome@gmail.com>
- * gems/bundled_gems: update test-unit to 3.0.9.
+ * strftime.c (NEEDS): avoid SEGV due to integer overflow in
+ sparc-solaris2.10 and i686-linux. fix [Bug #4456] [ruby-dev:43284]
-Mon Jan 12 18:35:44 2015 Eric Wong <e@80x24.org>
+Sat Jul 30 17:26:26 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * numeric.c (bit_coerce): use original value for error message
- [ruby-core:67405] [Bug #10711]
- * test/ruby/test_numeric.rb (test_coerce): check error message
+ * test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
-Mon Jan 12 18:01:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/win32ole/test_win32ole_variant_outarg.rb: ditto.
- * lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
- CR. should check if substitution occurred too.
- [ruby-dev:48813] [Bug #10732]
+Sat Jul 30 14:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Mon Jan 12 16:45:46 2015 Seiei Higa <hanachin@gmail.com>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_version): version 1.1.0.
- * vm_method.c (rb_alias): raise a NameError when creating alias to
- a refined method if the original method of the refined method is
- not defined. [ruby-core:67523] [Bug #10731]
+ * ext/bigdecimal/bigdecimal.gemspec: turn into a default gem.
-Mon Jan 12 13:53:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * tool/rbinstall.rb: ditto.
- * math.c (math_atan2): improve documentation.
- [Feature #10323][ruby-core:65400][ci skip]
+Sat Jul 30 11:21:55 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jan 12 13:50:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm_core.h (ALT_STACK_SIZE): use MINSIGSTKSZ*2 instead of SIGSTKSZ*2.
+ [ruby-core:38607]
- * ext/bigdecimal/bigdecimal.c: fixes documentation like labeled lists,
- code examples etc. [ruby-core:66730][Bug #10576][ci skip]
+Sat Jul 30 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jan 12 13:36:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm.c (th_init): preallocate alternative stack.
+ NoMemoryError is better than rb_bug, of course.
+ Patch by Eric Wong. [ruby-core:38572][ruby-core:38594].
- * lib/optparse.rb: improvements for OptionParser documentation.
- [misc #10608][ruby-core:66901][ci skip]
+ * signal.c (rb_register_sigaltstack): ditto.
-Mon Jan 12 13:33:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm_core.h: moved ALT_STACK_SIZE definition from signal.c.
+ * vm.c (thread_free): use xfree() instead of free().
- * array.c (rb_ary_each): documented return value.
- [misc #10469][ruby-core:66063]
+Sat Jul 30 07:20:49 2011 Tanaka Akira <akr@fsij.org>
-Sun Jan 11 15:11:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/lib/socket.rb (udp_server_sockets): unused variable
+ removed.
+ patch by Jeremy Evans. [ruby-core:38600]
- * test/webrick/test_utils.rb (test_create_listeners): use
- dynamically chosen port number, not hardcoded port number.
- [ruby-core:67508]
+Fri Jul 29 23:56:32 2011 Tanaka Akira <akr@fsij.org>
-Sat Jan 10 12:57:12 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * lib/securerandom.rb: call OpenSSL::Random.seed at the
+ SecureRandom.random_bytes call.
+ based on the patch by Masahiro Tomita. [ruby-dev:44270]
- * ext/zlib/zlib.c: fix document of method signatures.
- [Bug #10668][ruby-core:67186][ci skip]
+Fri Jul 29 23:53:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 10 12:32:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+ * array.c (rb_ary_set_len): new function to set array length.
- * eval_error.c (error_print): pos and len parameters of rb_str_substr()
- are counted by characters, not bytes. use rb_str_subseq() instead.
- [Bug #10727] [ruby-core:67473]
+ * vm_eval.c (method_missing): set the length of argv array, to mark
+ arguments.
-Sat Jan 10 10:58:55 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * vm_eval.c (rb_apply): get rid of too large alloca.
- * complex.c: removed commented-out code.
+Fri Jul 29 20:48:39 2011 Tanaka Akira <akr@fsij.org>
-Sat Jan 10 10:57:19 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/mkconstants.rb: fix typos.
- * rational.c: removed commented-out code.
- [Feature #10376][ruby-core:65643]
+Fri Jul 29 20:28:56 2011 Tanaka Akira <akr@fsij.org>
-Sat Jan 10 10:12:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/mkconstants.rb: use whitespaces as a separator.
- * array.c (rb_ary_select_bang): keep the array consistent by
- removing unselected values soon. [ruby-dev:48805] [Bug #10722]
+Fri Jul 29 18:59:07 2011 Tanaka Akira <akr@fsij.org>
-Fri Jan 9 23:20:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/mkconstants.rb: add documents for constants.
+ patch by Eric Hodel. [ruby-core:37853] [Bug #4989]
- * lib/rubygems: Update to RubyGems HEAD(e53c54a).
- * test/rubygems: ditto.
+Fri Jul 29 16:00:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (enable_pthread): use -pthread on OpenBSD without
+ explicit option. patched by Jeremy Evans. [ruby-core:38572]
+
+Thu Jul 28 23:36:28 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
+ xmalloc() to allocate an array for arguments of callback procedure,
+ to prevent arguments from being swept by GC. [ruby-core:38546]
+ [Bug #4929]
+
+Thu Jul 28 22:36:06 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Fri Jan 9 11:13:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
+ SEGV from AES encryption/decryption. Processing data by
+ Cipher#update without initializing key (meaningless usage of Cipher
+ object since we don't offer a way to export a key) could cause SEGV.
- * parse.y (assocs, assoc): eliminate splatting empty literal
- hashes. [ruby-core:67446] [Bug #10719]
+ In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3)
+ allows uninitialized key, but other EVPs (such as AES) does not
+ allow it. Calling EVP_CipherUpdate() without initializing key causes
+ SEGV so we set the data filled with "\0" as the key by default. See
+ #2768.
- * compile.c (compile_array_): support splatted hash in hash type.
+ * test/openssl/test_cipher.rb: test it.
-Fri Jan 9 10:57:09 2015 Vit Ondruch <vondruch@redhat.com>
+Thu Jul 28 14:25:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (RUBY_SETJMP_TYPE): Remove superfluous semicolon
- which causes a syntax error with autoconf 2.63.
- [ruby-core:67429] [Bug #10716]
+ * lib/rubygems/user_interaction.rb (Gem::StreamUI#tty?): typo.
-Fri Jan 9 07:23:32 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+Thu Jul 28 12:32:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: correctly quote non-ascii
- letters. Thanks @jirutka for the patch.
+ * ext/dl/callback/mkcallback.rb (gencallback): use PTR2NUM.
- * test/psych/test_string.rb: test for change
+ * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
+ dereference.
-Fri Jan 9 07:13:55 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): use rb_check_funcall.
- * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
- subclasses. Fixes github.com/tenderlove/psych/issues/196
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.
- * test/psych/test_hash.rb: test for change
+Thu Jul 28 04:53:31 2011 Eric Hodel <drbrain@segment7.net>
-Fri Jan 9 06:58:43 2015 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/delegate.rb: Move file-level documentation to the appropriate
+ classes.
- * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
+Thu Jul 28 02:15:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
- Fixes github.com/psych/issues/43
+ * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
+ workaround to mark wrapped object. this is not a true fix,
+ because [Bug #4929] is caused by the interface design of DL.
- * test/psych/test_hash.rb: test for change
+Thu Jul 28 00:28:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 8 17:05:00 2015 Seiei Higa <hanachin@gmail.com>
+ * test/fileutils/test_fileutils.rb: add OpenBSD case.
+ patched by Jeremy Evans [ruby-core:38530] see #5097
- * vm_method.c (rb_method_entry): if no super class, no original
- method entry. [ruby-core:67389] [Bug #10707]
+ * test/ruby/test_process.rb: ditto.
-Thu Jan 8 16:31:43 2015 Seiei Higa <hanachin@gmail.com>
+Wed Jul 27 22:46:59 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * vm_method.c (rb_export_method): bail out if the original method
- is undefined when the method is refined.
- [ruby-core:67387] [Bug #10706]
+ * test/rinda/test_rinda.rb (test_remote_array_and_hash):
+ add local variables to protect objects from GC. [ruby-dev:44253]
+ [Bug #5104]
-Thu Jan 8 12:53:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 27 17:55:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * dir.c (glob_helper): match in case-folding only if the directory
- resides on a case-insensitive file system, on OSX.
- [ruby-core:67364] [Bug #10700]
+ * include/ruby/missing.h: define __syscall if the platform has
+ __syscall in the library but doesn't define it in headers
+ for example Mac OS X.
-Thu Jan 8 11:39:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Wed Jul 27 15:39:14 2011 Eric Hodel <drbrain@segment7.net>
- * .travis.yml: Remove redundant configuration option.
- [fix GH-809] Patch by @gxworld
+ * object.c: Add usage documentation for BasicObject. Based on patch
+ by Thomas Sawyer. [Ruby 1.9 - Bug #5067]
-Thu Jan 8 07:17:14 2015 Eric Wong <e@80x24.org>
+Wed Jul 27 12:24:17 2011 Eric Hodel <drbrain@segment7.net>
- * lib/resolv.rb: consider ENETUNREACH as ResolvTimeout
- [ruby-core:67411] [Bug #10712]
+ * lib/rubygems/uninstaller.rb: Add missing require and update
+ messaging to avoid confusion with uninstall --format-executable.
+ [Ruby 1.9 - Bug #4062]
-Thu Jan 8 00:13:52 2015 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 09:34:24 2011 Eric Hodel <drbrain@segment7.net>
- * lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.
- Fixed by Josh Cheek. [Fix GH-808]
- Related to [ruby-core:67347] [Bug #10699]
+ * lib/rubygems: Update to RubyGems 1.8.6.1.
-Wed Jan 7 19:19:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 27 09:27:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * dir.c (dir_initialize): workaround of opendir failure at symlink
- directories on Windows via CIFS.
+ * test/openssl/test_pkcs12.rb: Add test and intermediate certificates.
+ [ Ruby 1.9 - Feature #3793 ] [ruby-core:32088]
-Wed Jan 7 18:52:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 27 01:05:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
- decomposed. [Bug #10704]
+ * eval_error.c (rb_print_undef_str): new function to raise
+ NameError for undefined method.
- * dir.c (NORMALIZE_UTF8PATH): Unicode decomposition seems to
- perform in an upper layer than file systems on OSX, as all path
- names are always decomposed regardless of file system types.
+ * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get),
+ variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c
+ (rb_mod_{remove,undef,alias}_method, set_method_visibility):
+ remove inadvertent symbol creation. based on the first patch by
+ Jeremy Evans at [ruby-core:38447]. [Feature #5089]
-Tue Jan 6 21:41:04 2015 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (obj_respond_to): fix the respond_to_missing? override
+ case. based on the patch by Jeremy Evans at [ruby-core:38417].
+ [Feature #5072]
- * time.c (timelocalw): Set tm_isdst field -1 if vtm->isdst is
- VTM_ISDST_INITVAL. This bug is introduced at packing struct
- vtm (r45155).
- [ruby-core:67345] [Bug #10698] Reported by Boris Ruf.
+ * parse.y (rb_check_id): make the given name a symbol or a string.
+ based on the second patch by Jeremy Evans at [ruby-core:38447]
-Tue Jan 6 03:10:54 2015 Koichi Sasada <ko1@atdot.net>
+Wed Jul 27 00:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * test/fiddle/test_handle.rb: fix syntax.
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
+ zero or negative precision is error. fixes #5098.
+ [ruby-dev:44210]
-Tue Jan 6 00:16:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
- * test/fiddle/test_handle.rb (test_NEXT): use -test-/dln/empty
- which is always a shared object and is not used by others.
- [ruby-dev:48629] [Bug #10384]
+Wed Jul 27 00:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Mon Jan 5 14:58:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
+ specifying precision. fixes #5098. [ruby-dev:44210]
- * test/ruby/test_io.rb: added timeout for AIX environment.
- [ruby-core:62983][Bug #9917]
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
-Sun Jan 4 22:33:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 27 00:45:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * test/lib/test/unit.rb (ExcludesOption): add "excludes" support
- to test suite, for alternative implementations and platforms.
- [Feature #10682]
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
+ for symmetry to BigDecimal() function with an Integer.
+ fixes #5098. [ruby-dev:44210]
-Sun Jan 4 22:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
- * test/lib/test/unit.rb (Test::Unit): reorder modules and merge
- each modules.
+Wed Jul 27 00:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * test/lib/test/unit.rb (Test::Unit): split the large class into
- each modules.
+ * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
+ for adapting other Numeric subclasses. [ruby-dev:44245]
-Sun Jan 4 21:32:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: test for the above change.
- * parse.y (f_label): return tLABEL value as it is.
- [ruby-core:67315] [Bug #10693]
+Wed Jul 27 00:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Sun Jan 4 14:02:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
+ a BigDecimal.
- * test/lib/test/unit/parallel.rb (run): expand the file name to be
- loaded, so that relative paths work in parallel mode.
+ * bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
+ BigDecimal from another BigDecimal using BigDecimal global function
+ or constructor. [ruby-dev:44245]
-Sun Jan 4 13:36:56 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Tue Jul 26 23:33:24 2011 Igor Zubkov <igor.zubkov@gmail.com>
- * test/test_tempfile.rb: use assert_file for more descriptive message.
- following r49131.
+ * array.c: Fix typo. https://github.com/ruby/ruby/pull/36
-Sun Jan 4 13:05:09 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Mon Jul 25 23:51:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * string.c: improve docs for String#<=>. [ruby-core:65399][Feature #10322]
- Patch by gogo tanaka.
+ * proc.c: pre-allocate the unlinked_method_entry_list_entry struct to
+ avoid memory allocation during GC. based on a patch from Eric Wong.
+ [ruby-core:38498]
-Sun Jan 4 12:42:24 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Mon Jul 25 23:39:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c: improve docs for Array#reject. [ruby-core:65324][misc #10307]
- Patched by Nebu Pookins.
+ * test/rake/test_rake_directory_task.rb (TestRakeDirectoryTask#
+ test_directory_win32): fixed wrong test.
-Sun Jan 4 12:24:11 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+Mon Jul 25 22:36:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * string.c: improve docs for String#strip and variations.
- [ruby-core:66081][Bug #10476]
+ * proc.c (struct METHOD), gc.c (gc_marks), vm_method.c
+ (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug.
+ rb_method_entry_t was free'd even when the method is still on the
+ stack if it is BMETHOD (i.e., Method#call). This is because
+ rb_method_entry_t is embedded in struct METHOD. This commit
+ separates them and marks the live method entries.
+ See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171]
-Sun Jan 4 09:21:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Mon Jul 25 22:14:37 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/drb/drb.rb: removed unused argument. Patch by @vipulnsward
- [fix GH-515]
+ * lib/xmlrpc/client.rb: Fix possible HTTP header formatting failure by
+ 'Basic' header. Long username caused the base64 String truncation in
+ HTTP header which is not allowed. See #5046.
-Sun Jan 4 09:18:31 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * test/xmlrpc/test_webrick_server.rb: test it.
- * lib/tempfile.rb: provide default basename parameter.
- [fix GH-523] Patch by @dissolved
- * test/test_tempfile.rb: ditto.
+Mon Jul 25 15:04:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sun Jan 4 00:43:41 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * ext/openssl/lib/openssl.rb: End of transition period introduced by
+ [ruby-dev:38018]. From the next version of 1.9.3, you should use
+ require "openssl"
+ instead of
+ require "openssl/ssl"
+ and
+ require "openssl/x509"
- * README.ja.md: add guidance of mailing list and bugs.r-l.o.
+Mon Jul 25 13:46:38 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sat Jan 3 23:56:28 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+ * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
+ introduced in r30152 to x509-internal.rb.
- * hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]
+Mon Jul 25 13:09:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Avoid randomly generated
+ SSLError from SSLSocket just after invoking SSLSocket#close.
+ OpenSSL's SSL_shutdown could try to send alert packet and it might
+ set SSLerr(global error stack) as the result. It causes the next
+ SSL read/write operation to fail by unrelated reason.
- * include/ruby/intern.h (rb_str_new_literal): define on all
- platforms, not only gcc.
+ By design, we're ignoring any error at SSL_shutdown() so we clear
+ global error stack after SSL_shutdown is called. See #5039.
-Sat Jan 3 18:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 24 20:29:53 2011 Tanaka Akira <akr@fsij.org>
- * ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
- number as the rest are not used.
+ * ext/socket/extconf.rb: refine the recvmsg test.
-Sat Jan 3 18:19:50 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sun Jul 24 20:02:31 2011 Tanaka Akira <akr@fsij.org>
- * ext/fiddle/lib/fiddle/cparser.rb: r49110 broke Fiddle::Import with
- type_alias.
- * test/fiddle/test_cparser.rb: added type_alias test for parse_ctype
- and parse_struct_signature.
+ * ext/socket/extconf.rb: fix the recvmsg test.
-Sat Jan 3 11:50:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sun Jul 24 08:42:51 2011 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl.h: avoid to build failure of Windows environment.
- * ext/openssl/ossl_ssl_session.c: ditto.
+ * ext/socket/extconf.rb: test recvmsg allocates file descriptors for
+ fd passing even with MSG_PEEK.
-Sat Jan 3 11:27:46 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/ancdata.c: use the above test result.
- * array.c: Improve performance of Array#shift. use shared instead of
- MEMMOVE if with arguments. Patch by @ksss [fix GH-537]
- * test/ruby/test_array.rb: ditto.
- * benchmark/bm_array_shift.rb: Added benchmark of GH-537 issue.
+Sun Jul 24 01:04:50 2011 Eric Hodel <drbrain@segment7.net>
-Sat Jan 3 10:38:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * lib/rubygems/specification.rb: Restore behavior of
+ Gem::Specification#loaded. [Ruby 1.9 - Bug #5032]
- * lib/net/http.rb: More descriptive error message when net/http fails
- to connect to a server. Patch by @xaviershay [fix GH-700]
- * test/net/http/test_http.rb: ditto.
+Sun Jul 24 00:05:00 2011 Jeremy Evans <merch-redmine@jeremyevans.net>
-Sat Jan 3 10:14:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * error.c (rb_name_error_str): new function to raise NameError
+ with the name string but not ID.
- * ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`
- [fix GH-591] Patch by @PiPeep
- * ext/openssl/ossl_ssl_session.c: ditto.
+ * object.c, proc.c, variable.c: more removal of inadvertent symbol
+ creation. [Feature #5079]
-Sat Jan 3 09:54:32 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 23 21:14:00 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/fiddle/lib/fiddle/cparser.rb: Support for Fiddle::CParser
- to handle rich signatures including parameter names and function
- pointer types. Patch by @theryan [fix GH-590]
- * test/fiddle/test_cparser.rb: ditto.
+ * lib/cmath.rb (cbrt): should return a real number if possible.
-Sat Jan 3 09:01:43 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 23 20:12:52 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * NEWS: added compatibility entry of r49101.
+ * test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
+ directory. Current directory is not the top source directory when
+ the building process runs on other than there.
-Fri Jan 2 21:06:59 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * test/rake/test_rake_rake_test_loader.rb: ditto.
- * lib/net/http.rb (Net::HTTP#send_request): there is no response body
- with HEAD request. Patch by @rodrigosaito [fix GH-520]
+ * test/rake/test_rake_task_argument_parsing.rb
+ (test_terminal_width_using_hardcoded_80): hardcoded 80 is used
+ when app.unix? is false.
-Fri Jan 2 21:04:36 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 23 20:11:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * test/net/http/test_http.rb (_test_send_request__HEAD): Added
- failing test for send_request with HEAD method.
+ * ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
+ * ext/date/date_strftime.c: identical to [ruby-dev:44112].
-Fri Jan 2 18:41:20 2015 Tanaka Akira <akr@fsij.org>
+Sat Jul 23 19:12:53 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * eval.c (ruby_init): Print ruby_setup() error only in debug mode.
- Unsuppressable error message is not a good idea.
- Note that the message is printed sometimes with following
- code (highly timing dependent, though):
- pid = spawn("ruby -e ''"); Process.kill(:TERM, pid)
+ * test/win32ole/test_err_in_callback.rb (test_err_in_callback):
+ skip test if ADODB.connection is not available.
-Fri Jan 2 16:18:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 23 15:37:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_module.rb: Refactor invalid testcase.
- [fix GH-472][ruby-core:59035][Bug #9240]
+ * parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
+ valid symbols, so they should be inspected with quotes.
-Fri Jan 2 15:53:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+Sat Jul 23 17:06:25 2011 Tanaka Akira <akr@fsij.org>
- * lib/webrick/utils.rb: removed unused argument variable.
- [fix GH-356] Patch by @vipulnsward
- * lib/webrick/server.rb: ditto.
- * lib/webrick/ssl.rb: ditto.
- * test/webrick/test_utils.rb: added test for WEBrick::Utils#create_listeners.
+ * io.c (rb_update_max_fd): validate fd.
-Fri Jan 2 15:35:53 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
+ msg_peek_p argument for the declaration.
- * lib/securerandom.rb: improve syntax and grammar of documentation.
- [fix GH-796][ci skip] Patch by @Erol
+ * ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
+ assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
+ when MSG_PEEK.
+ (rsock_discard_cmsg_resource): add msg_peek_p argument.
+ (bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
+ msg_peek_p argument.
-Fri Jan 2 15:10:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/unixsocket.c (unix_recv_io): call
+ rsock_discard_cmsg_resource with msg_peek_p argument.
- * test/openssl/test_ssl_session.rb (OpenSSL#test_ctx_client_session_cb):
- fix test failure with OpenSSL disabled SSLv3 protocol.
- [ruby-core:63772] [Bug #10046]
+Sat Jul 23 14:38:28 2011 Eric Hodel <drbrain@segment7.net>
-Fri Jan 2 09:08:31 2015 Tanaka Akira <akr@fsij.org>
+ * test/rake*: Remove dependencies on flexmock and session gems.
+ [Ruby 1.9 - Bug #4987]
- * lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
- (Resolv::DNS::Name#initialize): Normalize labels as
- Resolv::DNS::Label::Str objects.
+Sat Jul 23 12:19:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 1 21:41:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * parse.y (rb_check_id): take care of attrset ID created
+ implicitly by local ID. [Bug #5084]
- * doc/regexp.rdoc: fix regexp docs for whitespace character.
- [ruby-dev:48765] [Bug #10624]
+ * parse.y (rb_check_id): conversion condition was inverse.
+ [Bug #5084]
-Thu Jan 1 17:50:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_rubyoptions.rb: try locale encoding name.
- [ruby-core:67109] [Bug #10643]
+ * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
+ of cfp consistency error problem on OS X 10.7 (Lion). It's
+ suspected llvm optimization bug.
+ [Bug #5074] [ruby-dev:44185]
-Thu Jan 1 11:07:12 2015 Eric Wong <e@80x24.org>
+Fri Jul 22 21:18:20 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * 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]
+ * lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
-Thu Jan 1 09:14:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb (URI.decode_www_form_component): ditto.
- * vm_args.c (keyword_hash_p): fix non-symbol keys hash.
- rb_extract_keywords() returns 0 not Qnil when no symbol keys is
- included. [ruby-core:67264] [Bug #10685]
+Fri Jul 22 21:06:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 31 17:48:43 2014 Tanaka Akira <akr@fsij.org>
+ * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
+ avoid inadvertent symbol creation in reflection methods. based
+ on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072]
- * lib/resolv.rb (Resolv::DNS::Label::Str#initialize): Set encoding
- ASCII-8BIT before downcase. case insensitivity of DNS labels doesn't
- apply non-ASCII characters. [RFC 4343]
+ * vm_method.c (rb_mod_method_defined)
+ (rb_mod_{public,private,protected}_method_defined)
+ (obj_respond_to): ditto.
-Wed Dec 31 16:48:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (rb_check_id): new function returns already interned ID
+ or 0.
- * parse.y (gettable_gen): disable warnings of possible reference
- to a local variable defined in a past scope.
- [ruby-core:67162] [Bug #10661]
+Fri Jul 22 20:44:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 31 13:43:48 2014 Tanaka Akira <akr@fsij.org>
+ * parse.y (rb_is_global_id, rb_is_attrset_id): add missing
+ predicates.
- * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
- objects. Label#Str#== is case-insensitive.
+Fri Jul 22 20:24:38 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Dec 30 16:16:12 2014 Ben Miller <bmiller@rackspace.com>
+ * test/ruby/test_object.rb (TestObject#test_respond_to_missing):
+ 2nd argument of respond_to_missing? is not optional.
- * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
- comparison should be case-insensitive as well.
- [ruby-core:66498] [Bug #10550]
+Fri Jul 22 19:05:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 30 16:03:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
+ access.
- * lib/resolv.rb (Resolv::DNS::Name): names with different dots
- should be different.
+Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
-Tue Dec 30 13:16:56 2014 Martin Duerst <bernhard+git@lsmod.de>
+ * lib/net/http.rb: Net::HTTP#finish is used to manually close
+ connections. [Ruby 1.9 - Bug #5045]
- * lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Array
- to avoid error during bootstrap when encodings are not yet defined.
- [Bug #10678]
+Fri Jul 22 13:51:29 2011 Eric Hodel <drbrain@segment7.net>
-Tue Dec 30 09:29:26 2014 Bernhard M. Wiedemann <bernhard+git@lsmod.de>
+ * ext/readline/readline.c: Add examples for Readline.completion_proc=.
+ [Ruby 1.9 - Bug #5057]
- * ext/dbm/dbm.c (Init_dbm): [DOC] as UNIX permissions are octal
- numbers, needs to be prefixed by 0. [Fix GH-800]
+Fri Jul 22 13:03:12 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Dec 30 08:57:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/openssl/ossl_hmac.c: Revert checking return type of
+ HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
- * lib/unicode_normalize.rb: typo fix. [ci skip]
- [ruby-dev:48794][misc #10675]
+Fri Jul 22 12:10:21 2011 Eric Hodel <drbrain@segment7.net>
-Mon Dec 29 19:38:01 2014 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/rbinstall.rb (default gems): Install executables into the fake
+ gem dir for Gem.bin_path. [#4485]
- * version.h (RUBY_VERSION): 2.3.0 development has started.
+Fri Jul 22 11:20:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Dec 29 18:58:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
+ * ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
+ Thanks, Jared Jennings, for the patch.
+ [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]
- * re.c (unescape_nonascii): append escape sequence as-is not
- unescaped character, to get rid of unexpected meta-character.
- [ruby-core:67193] [Bug #10670]
+Fri Jul 22 09:09:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Dec 29 14:27:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
+ * test/openssl/test_engine.rb: Add a test for it.
+ Thanks to Ippei Obayashi for providing the patch.
+ [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]
- * doc/syntax/literals.rdoc (Symbols): now Symbols created by
- interpolation can be garbage collected. patch by Yihang Ho in
- [ruby-core:67194]. [Bug #10671]
+Fri Jul 22 06:37:13 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Dec 29 11:18:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
- * thread.c (rb_thread_variable_get): fix dynamic symbol keys.
- rb_check_id() returns non-zero only for static symbols, whereas
- thread local variable keys can be dynamic symbols.
- [ruby-core:67185] [Bug #10667]
+Thu Jul 21 20:59:59 2011 Tanaka Akira <akr@fsij.org>
-Mon Dec 29 10:37:27 2014 Thiago Lewin <thiago_lewin@yahoo.com.br>
+ * ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
- * io.c (rb_f_select): [DOC] workaround for YARD doc. [Fix GH-799]
+Thu Jul 21 20:02:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * process.c (proc_detach): [DOC] fix missing closing parenthesis.
- [Fix GH-799]
+ * thread.c (set_trace_func, thread_set_trace_func_m): reset tracing
+ state when set_trace_func hook is removed. This is workaround patch
+ to force to reset tracing state that is broken by continuation call.
+ a patch from James M. Lawrence. [Feature #4347] [ruby-core:34998]
-Mon Dec 29 07:27:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * test/ruby/test_continuation.rb (class TestContinuation): add a test
+ for above. a patch from James M. Lawrence.
- * ext/json, test/json: merge JSON HEAD(17fe8e7)
- https://github.com/flori/json/compare/v1.8.1...17fe8e7
+Thu Jul 21 19:27:19 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Sun Dec 28 23:49:37 2014 Michal Papis <mpapis@gmail.com>
+ * node.c (dump_node): add today's knowledge. "init arguments (m)" and
+ "init arguments (p)" of compile.c indicates a Ruby code that
+ evaluates multiple assignments that is in method or block
+ parameters: def foo((m1,m2), (m3,m4), *r, (p1,p2), (p3,p4)); end
+ The former (init arguments (m)) evaluates the multiple assignments
+ before rest argument, that are (m1,m2) and (m3,m4). The letter
+ (init arguments (p)) does ones after rest argument, that are
+ (p1,p2) and (p3, p4).
- * rbinstall.rb: fix target location for installing bundled gems.
- install to the prepared directory instead of default Gem.dir,
- not to be affected GEM_HOME environment variable. [Fix GH-798]
+Thu Jul 21 18:11:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 28 18:19:28 2014 Eric Wong <e@80x24.org>
+ * enum.c (enum_inject): remove empty line to notify rdoc
+ Enumerable#reduce is alias. patched by milki@github.
+ https://github.com/ruby/ruby/pull/26
- * test/-ext-/iseq_load/test_iseq_load.rb
- (test_next_in_block_in_block): test using ISeq#eval
- (test_break_ensure): ditto
- [ruby-core:66988]
+Thu Jul 21 17:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 28 16:25:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_delete_at_m): use simple array literal in rdoc.
+ patched by samuel tonini. [ruby-core:38310] [Bug #5066]
- * cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
- always. [ruby-core:67153] [Bug #10657]
+Thu Jul 21 17:14:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 28 13:54:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
+ Allow HTTP/0.9 request which doesn't has any header or body.
+ patched by Felix Jodoin. [ruby-core:38040] [Bug #5022]
- * parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and
- keywords bits arguments should be unique. since internal IDs
- depend on the local variable index in the current scope, new ID
- should be made before popping those vtables.
- [ruby-core:67157] [Bug #10659]
+Wed Jul 20 23:02:18 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Dec 27 20:12:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_update_max_fd): remove parentheses. they are not in
+ macro.
- * ext/json/generator/generator.c (JSON_Generator_State_type): add
- #ifdef for backward compatibility.
+Wed Jul 20 22:22:23 2011 Tanaka Akira <akr@fsij.org>
- * ext/json/parser/parser.rl (JSON_Parser_type): ditto.
+ * include/ruby/intern.h (rb_update_max_fd): declaration moved from
+ internal.h.
- * ext/json/generator/generator.h (ZALLOC): add fallback definition.
+ * file.c: ditto.
+
+ * io.c: call rb_update_max_fd for each new fds.
+
+ * process.c: ditto.
+
+ * random.c: ditto.
- * ext/json/parser/parser.h (ZALLOC): ditto.
+ * ruby.c: ditto.
-Sat Dec 27 16:54:05 2014 Tanaka Akira <akr@fsij.org>
+ * ext/io/console/console.c: ditto.
- * process.c: Unused code removed.
- It seems waitpid() is universally available on POSIX platforms.
+ * ext/openssl/ossl_bio.c: ditto.
-Sat Dec 27 15:08:27 2014 Eric Wong <e@80x24.org>
+ * ext/pty/pty.c: ditto.
- * vm_core.h (rb_vm_living_threads_insert): preserve order
- [Bug #10660] [ruby-core:67154] [ruby-core:67159]
+ * ext/socket/init.c: ditto.
-Sat Dec 27 13:08:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/socket.c: ditto.
- * ext/socket/socket.c: improved document for YARD doc.
- [fix GH-795][ci skip] Patch by @tlewin
+ * ext/socket/ancdata.c: ditto.
-Sat Dec 27 10:11:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/socket/unixsocket.c: ditto.
- * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix to invoke correct function
- of tcllib. Patch by @zalt50 [fix GH-787]
+Wed Jul 20 15:16:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Dec 27 10:03:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
+ before calling dlsym(). [ruby-dev:44091] [Bug #5021]
- * tool/make-snapshot: show sha1 digest when making packages.
- it's request from https://github.com/ruby/www.ruby-lang.org/issues/921
- [fix GH-794]
+Wed Jul 20 07:16:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Fri Dec 26 15:32:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: mention Kernel#warn. [ruby-core:38119] [Feature #5029]
- * ext/tk/tcltklib.c (ip_invoke_core): remove probably duplicate
- dead code.
+Tue Jul 19 16:40:45 2011 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-Fri Dec 26 15:28:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (cont_save_thread): fix missing semicolon.
- * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_const_get): simply use
- rb_path2class() to get a class/module from its name.
+Tue Jul 19 16:25:15 2011 Tanaka Akira <akr@fsij.org>
-Fri Dec 26 15:20:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (UPDATE_MAXFD): removed.
- * marshal.c (w_long): append at once by w_nbyte() instead of
- appending byte by byte.
+Tue Jul 19 16:07:45 2011 Tanaka Akira <akr@fsij.org>
-Fri Dec 26 15:13:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_update_max_fd): new function.
- * ext/json/parser/parser.rl (unescape_unicode): check if valid
- before bit-or assignments.
- reported by Denis Denisov <denji0k AT gmail.com>.
+ * internal.h (rb_update_max_fd): declare rb_update_max_fd.
- * ext/nkf/nkf-utf8/nkf.c (nkf_iconv_t): fix a missing semicolon.
- reported by Denis Denisov <denji0k AT gmail.com>.
+ * thread_pthread.c (rb_thread_create_timer_thread): update max fd when
+ timer thread pipe is created.
- * process.c (rb_spawn_process): get rid of usage of uninitialized
- variable.
- reported by Denis Denisov <denji0k AT gmail.com>.
+Mon Jul 18 13:36:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * regexec.c (match_at): ditto.
+ * ext/psych/lib/psych.rb: define a new BadAlias error class.
- * ext/win32ole/win32ole.c (ole_wc2mb_alloc, ole_vstr2wc, ole_mb2wc):
+ * ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
+ deserializing an alias that does not exist.
+
+ * test/psych/test_merge_keys.rb: corresponding test.
+
+Mon Jul 18 00:00:46 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * ext/curses/curses.c: added the new class Curses::Pad, which
+ supports scrolling. patch by Eric Hodel. [Feature #4896]
+ [ruby-core:37206]
+
+Sun Jul 17 16:26:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_check_trusted): new function to check an object is
+ trusted.
+
+ * struct.c (rb_struct_modify), time.c (time_modify): check by the
+ above function to show proper class names. [Bug #5036]
+
+Sun Jul 17 15:30:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_warn_m): accept multiple args in like puts. rdoc
+ patch by Erik Price at [ruby-core:38119]. [Feature #5029]
+
+Sun Jul 17 07:56:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS
+ extensions. Use this as the default for the tests to ensure
+ compatibility with OpenSSL 0.9.7.
+ [ Ruby 1.9 - Bug #4961 ] [ruby-core:37726]
+
+Sat Jul 16 17:29:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_UNIVERSAL_ARCH): restore arch flag.
+ Bug #4977
+
+Sat Jul 16 06:27:51 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/uri/common.rb (module): Remove optional parser argument to
+ Kernel#URI
+ [ruby-core:38061]
+
+ * lib/uri/generic.rb (module): ditto
+
+Sat Jul 16 03:19:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (is_socket, is_console): add prototypes to fix compile
+ problem with gcc introduced at r32549.
+ reported by Jon Forums. [Bug #5030] [ruby-core:38079]
+
+Sat Jul 16 00:55:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().
+ The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071]
+
+ * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass):
+ added a new test for eigenclass of time object.
+
+Fri Jul 15 19:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by
+ Makoto Kishimoto. fixes #4223 [ruby-dev:42907]
+
+ * bignum.c (bigadd_int): ditto.
+
+Fri Jul 15 14:27:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamed
+ from rb_w32_has_cancel_io(). now it takes a parameter as fd to check
+ the fd is console or not, because we cannot cancel console input even
+ if we have cancel_io function.
+
+ * io.c (WAIT_FD_IN_WIN32): call above function instead of the old one,
+ so now we can kill the thread which calls STDIN.gets.
+ the problem was reported by ko1 via IRC.
+
+Fri Jul 15 09:10:41 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
+ Error caused by unalignment access on Sparc-Solaris (and possibly on
+ other similar environment.) This patch just do memcpy always instead
+ of checking architecture. I see no perf drop on my 64bit env. For
+ more details, see #4320.
+
+ * test/digest/test_digest.rb: add test for unalignment access.
+
+Fri Jul 15 01:51:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): Power PC does not
+ allow unaligned word access.
+
+ * st.c (UNALIGNED_WORD_ACCESS): x86_64 allows unaligned word
+ access as well as i386.
+
+Thu Jul 14 12:19:34 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
+ verify callback of SSLContext and X509Store and make the
+ verification fail normally. Raising exception directly from callback
+ causes orphan resources in OpenSSL stack. Patched by Ippei Obayashi.
+ See #4445.
+
+ * test/openssl/test_ssl.rb
+ (test_exception_in_verify_callback_is_ignored): test it.
+
+Tue Jul 12 23:41:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * NEWS: add a description of Signal.trap change.
+
+Tue Jul 12 20:02:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (reserved_signal_p): reverted a part of r32523.
+ chikanaga noticed trap(:CHLD) has some realworld usecase.
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
ditto.
- * dir.c (ruby_glob0): no need to check never-NULL pointer.
- reported by Denis Denisov <denji0k AT gmail.com>.
+Tue Jul 12 17:12:45 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * vm_method.c (rb_add_method): should not call method_added hook
+ for undef operation. [Bug #5015]
+
+Tue Jul 12 16:58:44 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
+ Fix process_args didn't return `@option` after r30939.
+
+Tue Jul 12 14:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (install_sighandler): fixed a race.
+
+Tue Jul 12 13:49:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sig_trap): don't permit to change a signal handler which
+ the interpreter reserved.
+ * signal.c (reserved_signal_p): ditto.
+ [Bug #2616] [ruby-core:27625]
+
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
+ added a test for reserved signal.
+
+Tue Jul 12 11:58:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/file.c (rb_file_expand_path_internal): ditto.
+ * win32/setup.mak: support x86-amd64 cross compile environment.
- * win32/file.c (code_page_i): handle realloc failure.
- reported by Denis Denisov <denji0k AT gmail.com>.
+Mon Jul 11 23:22:28 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * win32/stub.c (stub_sysinit): ditto.
+ * time.c: can't compile time.c on AIX due to missing declaration for
+ ffs(). It is declared in strings.h on AIX.
- * fix printf format conversion specifiers.
- reported by Denis Denisov <denji0k AT gmail.com>.
+Mon Jul 11 15:54:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 26 01:41:40 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+ * process.c: removed signal() macro. It's no longer used.
- * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
- [Bug #10647] [ruby-dev:48787]
+Mon Jul 11 15:02:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Dec 26 01:24:42 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+ * numeric.c (rb_num2ull): use FIX2LONG instead of FIX2ULONG. see
+ rb_num2ulong(). fixed the problem of ObjectSpace._id2ref of IL32LLP64
+ platforms, introduced at r32433.
- * tool/downloader.rb: support old versions of ruby.
+Mon Jul 11 05:38:05 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * tool/downloader.rb: now can download gems by http if openssl is not
- available (this may be danger!)
+ * thread_pthread.c (get_stack): need to adjust stack addr for
+ [Bug #1813] on AIX.
-Fri Dec 26 00:13:48 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 11 01:16:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_extlibs.rb: check existence of extension libraries
- which not depend on outer libraries. (experimental)
+ * thread_pthread.c (rb_thread_create_timer_thread): removed
+ rb_disable_interrupt()/rb_enable_interrupt().
+ * vm_core.h: ditto.
+ * process.c (static void before_exec): ditto.
+ * process.c (static void after_exec): ditto.
+ [Bug #4765] [ruby-dev:43571]
-Thu Dec 25 21:58:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval_intern.h: removed rb_trap_restore_mask().
+ * vm_eval.c (rb_throw_obj): ditto.
+ * eval.c (setup_exception): ditto.
- * ext/fiddle/extconf.rb: make PIC objects if it will be linked as
- a shared object eventually. [ruby-core:67128]
+ * signal.c: removed trap_last_mask.
+ * signal.c (trap_restore_mask): removed.
+ * signal.c (init_sigchld): comment clarification why signal block
+ is needed. and removed trap_last_mask operation.
+ * signal.c (trap_ensure): removed trap_last_mask operation.
-Thu Dec 25 19:01:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): made
+ static and removed sigdelset(SIGVTALRM) and sigdelset(SIGSEGV).
- * ext/fiddle/win32/libffi-3.2.1-mswin.patch: support mswin32.
+ * process.c (rb_syswait): removed implicit signal handler change.
-Thu Dec 25 17:30:40 2014 Naohisa Goto <ngotogenome@gmail.com>
+Sun Jul 10 23:49:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * gc.c (wmap_final_func): fix memory size shortage when realloc wmap.
- Fix SEGV during finalize of WeakRef on Solaris (though the SEGV
- could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]
+ * docs/NEWS-1.9.3: moved from NEWS.
-Thu Dec 25 17:27:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * docs/ChangeLog-1.9.3: merged ChangeLog for 1.9.3.
- * configure.in (NET_LUID): include winsock2.h instead of windows.h.
- patch by Jon Forums in [ruby-core:67125]. [Bug #10640]
+ * NEWS: NEWS for 1.9.4 that describes changes since 1.9.3
-Thu Dec 25 16:14:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ChangeLog: new ChangeLog for 1.9.4.
- * ext/io/console/console.c (console_dev): send the given arguments
- to the opened console. as a special case, do nothing if :close
- is given.
+Sun Jul 10 23:30:52 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if
- console.
+ * version.h (RUBY_VERSION): ruby_1_9_3 branch was forked.
-For the changes before 2.2.0, see doc/ChangeLog-2.2.0
-For the changes before 2.1.0, see doc/ChangeLog-2.1.0
-For the changes before 2.0.0, see doc/ChangeLog-2.0.0
For the changes before 1.9.3, see doc/ChangeLog-1.9.3
For the changes before 1.8.0, see doc/ChangeLog-1.8.0
diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb
index 35a8e75876..b97a08d928 100644
--- a/KNOWNBUGS.rb
+++ b/KNOWNBUGS.rb
@@ -1,7 +1,5 @@
#
-# IMPORTANT: Always keep the first 7 lines (comments),
-# even if this file is otherwise empty.
-#
-# This test file includes tests which point out known bugs.
+# This test file concludes tests which point out known bugs.
# So all tests will cause failure.
#
+
diff --git a/LEGAL b/LEGAL
index 2607f0082a..65706459cd 100644
--- a/LEGAL
+++ b/LEGAL
@@ -5,37 +5,6 @@ All the files in this distribution are covered under either the Ruby's
license (see the file COPYING) or public-domain except some files
mentioned below.
-ccan/build_assert/build_assert.h
-ccan/check_type/check_type.h
-ccan/container_of/container_of.h
-ccan/str/str.h
-
- These files are licensed under the CC0.
-
- http://creativecommons.org/choose/zero/
-
-ccan/list/list.h
-
- This file is licensed under the MIT License.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
include/ruby/oniguruma.h:
regcomp.c:
regenc.[ch]:
@@ -87,7 +56,7 @@ http://www.geocities.jp/kosako3/oniguruma/
http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/
http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
- When this software is partly used or it is distributed with Ruby,
+ When this software is partly used or it is distributed with Ruby,
this of Ruby follows the license of Ruby.
configure:
@@ -129,7 +98,7 @@ tool/config.sub:
parse.c:
- This file is licensed under the GPL, but is incorporated into Ruby and
+ This file is licensed under the GPL, but is incorporated into Ruby and
redistributed under the terms of the Ruby license, as permitted by the
exception to the GPL below.
@@ -224,11 +193,11 @@ random.c
This is a faster version by taking Shawn Cokus's optimization,
Matthe Bellew's simplification, Isaku Wada's real version.
- Before using, initialize the state by using init_genrand(seed)
+ Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
+ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -241,8 +210,8 @@ random.c
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -262,36 +231,6 @@ random.c
http://www.math.keio.ac.jp/matumoto/emt.html
email: matumoto@math.keio.ac.jp
-vm_dump.c:procstat_vm
-
- This file is under the new-style BSD license.
-
- Copyright (c) 2007 Robert N. M. Watson
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- $FreeBSD: head/usr.bin/procstat/procstat_vm.c 261780 2014-02-11 21:57:37Z jhb $
-
vsnprintf.c:
This file is under the old-style BSD license. Note that the
@@ -425,30 +364,30 @@ missing/strlcpy.c
These files are under the new-style BSD license.
- Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ All rights reserved.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
missing/langinfo.c
@@ -537,7 +476,7 @@ ext/nkf/nkf-utf8/utf8tbl.c:
copyrighted semi-public-domain software.
Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA)
- Everyone is permitted to do anything on this program
+ Everyone is permitted to do anything on this program
including copying, modifying, improving,
as long as you don't try to pretend that you wrote it.
i.e., the above copyright notice has to appear in all copies.
@@ -588,7 +527,7 @@ ext/win32ole/win32ole.c:
Other modifications Copyright (c) 1997, 1998 by Gurusamy Sarathy
<gsar@umich.edu> and Jan Dubois <jan.dubois@ibm.net>
-
+
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the README file
of the Perl distribution.
diff --git a/Makefile.in b/Makefile.in
index ff475091ab..e68976257b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
SHELL = /bin/sh
NULLCMD = @NULLCMD@
n=$(NULLCMD)
-ECHO1 = $(V:1=$n)
+ECHO1 = $(V:1=@$n)
RUNCMD = $(SHELL)
CDPATH = .
CHDIR = @CHDIR@
@@ -22,11 +22,9 @@ LD = @LD@
YACC = bison
PURIFY =
AUTOCONF = autoconf
-CONFIGURE = @CONFIGURE@
@SET_MAKE@
MKFILES = @MAKEFILES@
BASERUBY = @BASERUBY@
-HAVE_BASERUBY = @HAVE_BASERUBY@
TEST_RUNNABLE = @TEST_RUNNABLE@
CROSS_COMPILING = @CROSS_COMPILING@
DOXYGEN = @DOXYGEN@
@@ -42,7 +40,6 @@ datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
-archlibdir = @archlibdir@
ruby_version = @ruby_version@
TESTUI = console
@@ -52,20 +49,17 @@ DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
arch_hdrdir = $(EXTOUT)/include/$(arch)
-VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
empty =
-CC_VERSION = @CC_VERSION@
OUTFLAG = @OUTFLAG@$(empty)
COUTFLAG = @COUTFLAG@$(empty)
ARCH_FLAG = @ARCH_FLAG@
-CFLAGS_NO_ARCH = @CFLAGS@
-CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
+CFLAGS = @CFLAGS@ $(ARCH_FLAG)
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
warnflags = @warnflags@ @strict_warnflags@
-cppflags = @cppflags@
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
XCFLAGS = @XCFLAGS@
CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
@@ -92,17 +86,15 @@ RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
+RUBY_RELEASE_DATE=@RUBY_RELEASE_DATE@
EXEEXT = @EXEEXT@
LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
MINIRUBY = @MINIRUBY@\
$(MINIRUBYOPT)
-# RUNRUBY_COMMAND:: runruby.rb or baseruby. do not append options directly
-RUNRUBY_COMMAND = @RUNRUBY_COMMAND@
-# RUNRUBY:: run ruby with RUN_OPTS which is passed to ruby
-RUNRUBY = @RUNRUBY@ $(RUN_OPTS)
-# RUNRUBY_DEBUGGER:: debugging option for runruby.rb
+RUNRUBY_COMMAND = @RUNRUBY@ $(RUNRUBYOPT)
+RUNRUBY = $(RUNRUBY_COMMAND) -- $(RUN_OPTS)
RUNRUBY_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args'
XRUBY = @XRUBY@
BTESTRUBY = @BTESTRUBY@\
@@ -114,7 +106,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
XRUBY_LIBDIR = @XRUBY_LIBDIR@
XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
-BOOTSTRAPRUBY = @BOOTSTRAPRUBY@
+
+DEFAULT_PRELUDES = $(@USE_RUBYGEMS@_GEM_PRELUDE)
#### End of system configuration section. ####
@@ -132,26 +125,12 @@ LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
LIBRUBY_RELATIVE = @LIBRUBY_RELATIVE@
LIBRUBY_A_OBJS = @LIBRUBY_A_OBJS@
-DTRACE_REBUILD_OBJS = $(DTRACE_REBUILD:yes=$(DTRACE_DEPENDENT_OBJS))
-
-DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
- eval.$(OBJEXT) \
- gc.$(OBJEXT) \
- hash.$(OBJEXT) \
- load.$(OBJEXT) \
- object.$(OBJEXT) \
- parse.$(OBJEXT) \
- string.$(OBJEXT) \
- symbol.$(OBJEXT) \
- vm.$(OBJEXT)
-
THREAD_MODEL = @THREAD_MODEL@
PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
-ENCSTATIC = @ENCSTATIC@
SET_LC_MESSAGES = env LC_MESSAGES=C
MAKEDIRS = @MKDIR_P@
@@ -175,9 +154,8 @@ VCS = @VCS@
VCSUP = @VCSUP@
DTRACE = @DTRACE@
DTRACE_EXT = @DTRACE_EXT@
-DTRACE_OBJ = @DTRACE_OBJ@
-DTRACE_REBUILD= @DTRACE_REBUILD@
-DTRACE_GLOMMED_OBJ = $(DTRACE_REBUILD:yes=ruby-glommed.$(OBJEXT))
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_GLOMMED_OBJ = @DTRACE_GLOMMED_OBJ@
OBJEXT = @OBJEXT@
ASMEXT = S
@@ -187,9 +165,10 @@ SYMBOL_PREFIX = @SYMBOL_PREFIX@
INSTALLED_LIST= .installed.list
-NEWLINE_C = enc/trans/newline.c
+MKMAIN_CMD = mkmain.sh
+
+NEWLINE_C = newline.c
MINIPRELUDE_C = miniprelude.c
-PRELUDE_C = prelude.c
RBCONFIG = .rbconfig.time
SRC_FILE = $<
@@ -199,10 +178,6 @@ OS_DEST_FILE = $@
MESSAGE_BEGIN = @for line in
MESSAGE_END = ; do echo "$$line"; done
-ECHO_BEGIN = @sep=''; for word in
-ECHO_END = ; do echo @ECHO_N@ "$$sep'$$word'@ECHO_C@"; sep=' '; done; echo
-
-DESTDIR = @DESTDIR@
configure_args = @configure_args@
#### End of variables
@@ -211,18 +186,20 @@ configure_args = @configure_args@
all:
+.DEFAULT: all
+
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)
# We must `rm' the library each time this rule is invoked because "updating" a
@@ -231,37 +208,29 @@ $(PROGRAM):
$(LIBRUBY_A):
@$(RM) $@
$(ECHO) linking static-library $@
- $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(INITOBJS)
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)
@-$(RANLIB) $@ 2> /dev/null || true
$(ECHO) verifying static-library $@
- @$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
+ @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS)
@$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
- $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
- -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \
- -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(DTRACE_OBJ) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
$(Q) $(POSTLINK)
- @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link rescue nil; \
+ @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
+$(arch)-fake.rb: config.status $(srcdir)/template/fake.rb.in
+ @./config.status --file=$@:$(srcdir)/template/fake.rb.in
+ @chmod +x $@
ruby_pc = @ruby_pc@
$(ruby_pc):
@./config.status --file=$@:$(srcdir)/template/ruby.pc.in
-ruby-runner.c: template/ruby-runner.c.in
- @./config.status --file=$@:$(srcdir)/template/$(@F).in
-
-ruby-runner$(EXEEXT): ruby-runner.c
- $(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(RUBY_INSTALL_NAME) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ ruby-runner.c
-
-$(RBCONFIG): $(PREP)
-
-rbconfig.rb: $(RBCONFIG)
-
install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
$(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
$(ECHO) installing cross-compiling stuff
@@ -281,34 +250,32 @@ install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/confi
Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
-$(MKFILES): config.status $(srcdir)/version.h
- @[ -f $@ ] && mv $@ $@.old
- MAKE=$(MAKE) $(SHELL) ./config.status $@
- @cmp $@ $@.old > /dev/null 2>&1 && echo $@ unchanged && exit 0; \
- { \
+$(MKFILES): config.status
+ MAKE=$(MAKE) $(SHELL) ./config.status
+ @{ \
echo "all:; -@rm -f conftest.mk"; \
echo "conftest.mk: .force; @echo AUTO_REMAKE"; \
echo ".force:"; \
} > conftest.mk || exit 1; \
$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
- { echo "$@ updated, restart."; exit 1; }
+ { echo "Makefile updated, restart."; exit 1; }
uncommon.mk: $(srcdir)/common.mk
sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
.PHONY: reconfig
-reconfig-args = $(srcdir)/$(CONFIGURE) $(configure_args)
+reconfig-args = $(srcdir)/configure $(configure_args)
config.status-args = ./config.status --recheck
-reconfig-exec-0 = test -t 1 && { CONFIGURE_TTY=yes; export CONFIGURE_TTY; }; exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3 3>&- 4>&-`
+reconfig-exec-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
reconfig-exec-1 = set -x; "$$@"
-reconfig config.status: $(srcdir)/$(CONFIGURE) $(srcdir)/enc/Makefile.in \
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
$(srcdir)/include/ruby/version.h
@PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
set $(SHELL) $($@-args); $(reconfig-exec-$(V))
-$(srcdir)/$(CONFIGURE): $(srcdir)/configure.in $(srcdir)/aclocal.m4
- $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F)
+$(srcdir)/configure: $(srcdir)/configure.in
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF)
incs: id.h
all-incs: probes.h
@@ -327,9 +294,7 @@ lex.c: defs/keywords
$(CP) $(srcdir)/lex.c.blt $@; \
else \
[ $(Q) ] && echo generating $@ || set -x; \
- gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \
- | sed 's/(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \
- > $@.tmp && \
+ gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
$(MV) $@.tmp $@ && \
$(CP) $? $(srcdir)/defs/lex.c.src && \
$(CP) $@ $(srcdir)/lex.c.blt; \
@@ -354,22 +319,6 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
$(CP) $@ $(?:.kwd=.h.blt); \
fi
-JIS_PROPS_OPTIONS = -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property
-
-enc/jis/props.h: enc/jis/props.kwd
- $(MAKEDIRS) $(@D)
- @set +e; \
- if cmp -s $(?:.kwd=.src) $?; then \
- set -x; \
- $(CP) $(?:.kwd=.h.blt) $@; \
- else \
- set -x; \
- gperf $(JIS_PROPS_OPTIONS) $? | \
- sed 's/(int)(long)&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\1, \2),/g' > $@ && \
- $(CP) $? $(?:.kwd=.src) && \
- $(CP) $@ $(?:.kwd=.h.blt); \
- fi
-
.c.@OBJEXT@:
@$(ECHO) compiling $<
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
@@ -389,31 +338,32 @@ enc/jis/props.h: enc/jis/props.kwd
.d.h:
@$(ECHO) translating probes $<
$(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
- $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
+ $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp
.dmyh.h:
@$(ECHO) copying dummy $(DEST_FILE)
$(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE)
-probes.stamp: $(DTRACE_REBUILD_OBJS)
- $(Q) if test -f $@ -o -f probes.$(OBJEXT); then \
- $(RM) $(DTRACE_REBUILD_OBJS) $@; \
- $(ECHO0) "rebuilding objects which were modified by \"dtrace -G\""; \
- $(MAKE) $(DTRACE_REBUILD_OBJS); \
- fi
- $(Q) touch $@
-
-probes.@OBJEXT@: $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp)
+probes.@OBJEXT@: $(srcdir)/probes.d
@$(ECHO) processing probes in object files
- $(Q) $(RM) $@
- $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
+ $(Q) stamp="$*.stamp"; \
+ if test -f "$$stamp" -o -f "$@"; then \
+ $(RM) $(DTRACE_DEPENDENT_OBJS) "$$stamp"; \
+ for o in $(DTRACE_DEPENDENT_OBJS); do \
+ echo "rebuilding $$o which was modified by \"dtrace -G\""; \
+ $(MAKE) "$$o"; \
+ done; \
+ fi; \
+ touch "$$stamp"
+ $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS)
# DTrace static library hacks described here:
# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
ruby-glommed.$(OBJEXT):
@$(ECHO) generating a glommed object with DTrace probes for static library
- $(Q) $(LD) -r -o $@ $(OBJS)
+ $(Q) $(LD) -r -o $@ $(OBJS) $(DTRACE_OBJ)
clean-local::
$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
@@ -430,7 +380,7 @@ clean-ext distclean-ext realclean-ext::
@cd ext 2>/dev/null || exit 0; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
test "$$#" = 0 && set .; \
set dummy `\
- find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$::' | sort; \
+ find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
`; shift; \
cd ..; \
for dir do \
@@ -448,12 +398,24 @@ distclean-ext realclean-ext::
-$(Q)$(RMDIR) ext 2> /dev/null || true
clean-extout:
+ -$(Q)$(RMDIRS) $(EXTOUT) 2> /dev/null || true
clean-enc distclean-enc realclean-enc:
@test -f "$(ENC_MK)" || exit 0; \
echo $(@:-enc=ing) encodings; \
exec $(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
+clean-rdoc distclean-rdoc realclean-rdoc:
+ @echo $(@:-rdoc=ing) rdoc
+ $(Q)$(RMALL) $(RDOCOUT)
+clean-capi distclean-capi realclean-capi:
+ @echo $(@:-capi=ing) capi
+ $(Q)$(RMALL) $(CAPIOUT)
+
+clean-platform:
+ @$(RM) $(PLATFORM_D)
+ -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> /dev/null || true
+
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(ECHO) compiling $@
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
@@ -463,80 +425,31 @@ enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
up::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
-after-update:: update-config_files common-srcs
-
update-mspec:
@$(CHDIR) $(srcdir); \
if [ -d spec/mspec ]; then \
+ cd spec/mspec; \
echo updating mspec ...; \
- $(Q1:0=:) set -x; \
- cd spec/mspec && \
exec git pull; \
else \
echo retrieving mspec ...; \
- $(Q1:0=:) set -x; \
exec git clone $(MSPEC_GIT_URL) spec/mspec; \
fi
update-rubyspec: update-mspec
@$(CHDIR) $(srcdir); \
if [ -d spec/rubyspec ]; then \
+ cd spec/rubyspec; \
echo updating rubyspec ...; \
- $(Q1:0=:) set -x; \
- cd spec/rubyspec && \
exec git pull; \
else \
echo retrieving rubyspec ...; \
- $(Q1:0=:) set -x; \
exec git clone $(RUBYSPEC_GIT_URL) spec/rubyspec; \
fi
test-rubyspec-precheck:
@if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
-update-doclie:
- @$(CHDIR) $(srcdir); \
- if [ -d coverage/doclie ]; then \
- echo updating doclie ...; \
- $(Q1:0=:) set -x; \
- cd coverage/doclie && \
- git fetch && \
- exec git checkout $(DOCLIE_GIT_REF); \
- else \
- echo retrieving doclie ...; \
- $(Q1:0=:) set -x; \
- exec git clone --branch $(DOCLIE_GIT_REF) $(DOCLIE_GIT_URL) coverage/doclie; \
- fi
-
-update-simplecov-html:
- @$(CHDIR) $(srcdir); \
- if [ -d coverage/simplecov-html ]; then \
- echo updating simplecov-html ...; \
- $(Q1:0=:) set -x; \
- cd coverage/simplecov-html && \
- git fetch && \
- exec git checkout $(SIMPLECOV_HTML_GIT_REF); \
- else \
- echo retrieving simplecov-html ...; \
- exec git clone --branch $(SIMPLECOV_HTML_GIT_REF) $(SIMPLECOV_HTML_GIT_URL) coverage/simplecov-html; \
- fi
-
-update-simplecov:
- @$(CHDIR) $(srcdir); \
- if [ -d coverage/simplecov ]; then \
- echo updating simplecov ...; \
- $(Q1:0=:) set -x; \
- cd coverage/simplecov && \
- git fetch && \
- exec git checkout $(SIMPLECOV_GIT_REF); \
- else \
- echo retrieving simplecov ...; \
- $(Q1:0=:) set -x; \
- exec git clone --branch $(SIMPLECOV_GIT_REF) $(SIMPLECOV_GIT_URL) coverage/simplecov; \
- fi
-
-update-coverage: update-simplecov update-simplecov-html update-doclie
-
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc
@@ -545,10 +458,3 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(srcdir)/tool/instruction.rb $(srcdir)/tool/insns2vm.rb
$(ECHO) generating $@
$(Q) $(BASERUBY) -Ku $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
-
-verconf.h: $(RBCONFIG)
-
-loadpath: verconf.h
- @$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \
- sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \
- -e '/^ /!d;s/ *"\\0"$$//;s/" *"//g'
diff --git a/NEWS b/NEWS
index be722bc9de..2b81356fd0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,404 +1,454 @@
# -*- rdoc -*-
-= NEWS for Ruby 2.3.0
+= NEWS for Ruby 2.0.0
This document is a list of user visible feature changes made between
releases except for bug fixes.
Note that each entry is kept so brief that no reason behind or
reference information is supplied with. For a full list of changes
-with all sufficient information, see the ChangeLog file or Redmine
-(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
+with all sufficient information, see the ChangeLog file.
-== Changes since the 2.2.0 release
+== Changes since the 1.9.3 release
-=== Language changes
-
-* frozen-string-literal pragma:
-
- * new pragma, frozen-string-literal has been experimentally introduced.
- [Feature #8976]
- * besides, --enable/--disable=frozen-string-literal options also have
- been introduced. [Feature #8976]
- * command line options --debug or --debug=frozen-string-literal enable
- additional debugging mode which shows created location with at frozen
- object error (RuntimeError).
- [Feature #11725]
-
-* safe navigation operator:
-
- * new method call syntax, `object&.foo', method #foo is called on
- `object' if it is not nil.
- this is similar to `try!' in Active Support, except:
- * method name is syntactically required
- obj.try! {} # valid
- obj&. {} # syntax error
- * arguments are evaluated only if a call is made:
- obj.try!(:foo, bar()) # bar() is always evaluated
- obj&.foo(bar()) # bar() is conditionally evaluated
- * attribute assignment is valid
- obj&.attr += 1
- [Feature #11537]
-
-* the did_you_mean gem:
-
- * When a NameError or NoMethodError occurs because of a typo in the name,
- the did_you_mean gem automatically suggests other names similar to the
- method name.
-
- "Yuki".starts_with?("Y")
- # => NoMethodError: undefined method `starts_with?' for "Yuki":String
- # Did you mean? start_with?
-
-* indented here document:
-
- * new string literal, here document starts with `<<~`.
- refer doc/syntax/literals.rdoc for more details.
- [Feature #9098]
-
-=== Core classes updates (outstanding ones only)
-
-* ARGF
-
- * ARGF.read_nonblock supports `exception: false' like IO#read_nonblock.
- [Feature #11358]
-
-* Array
-
- * Array#bsearch_index [Feature #10730]
- * Array#dig [Feature #11643]
-
-* Comparable
-
- * Comparable#== no longer rescues exceptions [Feature #7688]
-
-* Encoding
-
- * new Encoding::IBM037 (alias ebcdic-cp-us; dummy)
-
-* Enumerable
-
- * Enumerable#grep_v is added as inverse version of Enumerable#grep.
- [Feature #11049]
- * Enumerable#chunk_while [Feature #10769]
-
-* Enumerator::Lazy
-
- * Enumerator::Lazy#grep_v [Feature #11773]
-
-* File
-
- * File.mkfifo [Feature #11536]
- * Add File::TMPFILE corresponding to O_TMPFILE
-
-* Hash
-
- * Hash#fetch_values [Feature #10017]
- * Hash#dig [Feature #11643]
- * Hash#<=, Hash#<, Hash#>=, Hash#> [Feature #10984]
- * Hash#to_proc [Feature #11653]
-
-* IO
-
- * new mode flag File::SHARE_DELETE is available.
- this flag means to permit deleting opened file on Windows, but currently
- this affect only files opened as binary. [Feature #11218]
-
- * new option parameter `flags' is added.
- this parameter is bitwise-ORed to oflags generated by normal mode argument.
- [Feature #11253]
-
- * IO#advise no longer raises Errno::ENOSYS in cases where it was
- detected at build time but not available at runtime. [Feature #11806]
-
-* Kernel
-
- * Kernel#loop, when stopped by a StopIteration exception, returns
- what the enumerator has returned instead of nil. [Feature #11498]
-
-* Module
- * Module#deprecate_constant [Feature #11398]
-
-* NameError
- * NameError#receiver is added to take the receiver object. [Feature #10881]
-
-* Numeric
-
- * Numeric#positive? and Numeric#negative? are added, which return
- true when the receiver is positive and negative respectively.
- [Feature #11151]
-
-* Proc
-
- * Proc#call (and also #[], #===, #yield) are optimized.
- Backtrace doesn't show each method (show block lines directly).
- TracePoint also ignores these calls. [Feature #11569]
-
-* Queue (Thread::Queue)
-
- * Queue#close is added to notice a termination. [Feature #10600]
-
-* Regexp/String: Updated Unicode version from 7.0.0 to 8.0.0
-
-* RubyVM::InstructionSequence
- * add the following methods as a primitive tool of iseq loader.
- See sample/iseq_loader.rb for usage.
- Note that loader does not have verifier so it is easy to cause
- critical problem by loading modified/broken binary data.
- See [Feature #11788] for more details. (experimental feature)
- * RubyVM::InstructionSequence#to_binary(extra_data = nil)
- * RubyVM::InstructionSequence.load_from_binary(binary)
- * RubyVM::InstructionSequence.load_from_binary_extra_data(binary)
-
-* String
-
- * String#+@ and String#-@ are added to get mutable/frozen strings.
- [Feature #11782]
-
- * String.new now accepts new option parameter `encoding'.
- [Feature #11785]
-
-* Struct
- * Struct#dig [Feature #11688]
-
-* Thread
- * Thread#name, Thread#name= are added to handle thread names [Feature #11251]
-
-=== Core classes compatibility issues (excluding feature bug fixes)
-
-* Array
- * Array#select!, Array#keep_if, Array#reject!, and Array#delete_if
- no longer changes the receiver array instantly every time the
- block is called. [Feature #10714]
-
- * Array#flatten and Array#flatten! no longer try to call #to_ary
- method on elements beyond the given level. [Bug #10748]
-
- * Array#inspect doesn't raise error even if its content returns
- a string which is not compatible with Encoding.default_external
- as inspected result. [Feature #11801]
-
-* Enumerable
- * Enumerable#chunk and Enumerable#slice_before no longer takes the
- initial_state argument. [Feature #10958]
- Use a local variable instead to maintain a state.
-
-* File::Stat
- * On Windows File::Stat#ino always returned 0, but now returns
- BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low. [Feature #11216]
-
-* Hash
- * Hash#inspect doesn't raise error even if its content returns
- a string which is not compatible with Encoding.default_external
- as inspected result. [Feature #11801]
-
-* IO
- * IO#close doesn't raise when the IO object is closed. [Feature #10718]
- * IO#each_codepoint raises an exception at incomplete character
- before EOF when conversion takes place. [Bug #11444]
-
-* Module
- * Module#define_method and Object.define_singleton_method now
- require method body, Proc, Method, or a block, and raise
- ArgumentError if no block is given directly. [Bug #11283]
-
-* pack/unpack (Array/String)
- * j and J directives for pointer width integer type. [Feature #11215]
-
-
-=== Stdlib updates (outstanding ones only)
-
-* Logger
-
- * Logger#level= now supports symbol and string levels such as :debug, :info,
- :warn, :error, :fatal (case insensitive) [Feature #11695]
- * Logger#reopen is added to reopen a log device. [Feature #11696]
+=== C API updates
+* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
+* rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.
+
+=== Library updates (outstanding ones only)
+
+* builtin classes
+
+ * Array
+ * added method:
+ * added Array#bsearch for binary search.
+ * incompatible changes:
+ * random parameter of Array#shuffle! and Array#sample now
+ will be called with one argument, maximum value.
+ * when given Range arguments, Array#values_at now returns nil for each
+ value that is out-of-range.
+
+ * Enumerable
+ * added method:
+ * added Enumerable#lazy method for lazy enumeration.
+
+ * Enumerator
+ * added method:
+ * added Enumerator#size for lazy size evaluation.
+ * extended method:
+ * Enumerator.new accept an argument for lazy size evaluation.
+
+ * ENV
+ * aliased method:
+ * ENV.to_h is a new alias for ENV.to_hash
+
+ * Fiber
+ * incompatible changes:
+ * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
+
+ * File
+ * extended method:
+ * File.fnmatch? now expands braces in the pattern if
+ File::FNM_EXTGLOB option is given.
+
+ * GC
+ * improvements:
+ * introduced the bitmap marking which suppresses to copy a memory page
+ with Copy-on-Write.
+ * introduced the non-recursive marking which avoids unexpected stack overflow.
+
+ * GC::Profiler
+ * added method:
+ * added GC::Profiler.raw_data which returns raw profile data for GC.
+
+ * Hash
+ * added method:
+ * added Hash#to_h as explicit conversion method, like Array#to_a.
+ * extended method:
+ * Hash#default_proc= can be passed nil to clear the default proc.
+
+ * IO
+ * deprecated methods:
+ * IO#lines, #bytes, #chars and #codepoints are deprecated.
+
+ * Kernel
+ * added method:
+ * added Kernel#Hash conversion method like Array() or Float().
+ * added Kernel#__dir__ which returns a current dirname.
+ * added Kernel#caller_locations which returns an array of
+ frame information objects.
+ * extended method:
+ * Kernel#warn accepts multiple args in like puts.
+ * Kernel#caller accepts second optional argument `n' which specify
+ required caller size.
+ * Kernel#to_enum and enum_for accept a block for lazy size evaluation.
+ * incompatible changes:
+ * system() and exec() closes non-standard file descriptors
+ (The default of :close_others option is changed to true by default.)
+ * respond_to? against a protected method now returns false unless
+ the second argument is true.
+ * __callee__ has returned to the original behavior, and now
+ returns the called name but not the original name in an
+ aliased method.
+ * Kernel#inspect does not call #to_s anymore
+ (it used to call redefined #to_s).
+
+ * LoadError
+ * added method:
+ * added LoadError#path method to return the file name that could not be
+ loaded.
+
+ * Module
+ * added method:
+ * added Module#prepend which is similar to Module#include,
+ however a method in the prepended module overrides the
+ corresponding method in the prepending module.
+ * added Module#refine, which extends a class or module locally.
+ [experimental]
+ * extended method:
+ * Module#define_method accepts a UnboundMethod from a Module.
+ * Module#const_get accepts a qualified constant string, e.g.
+ Object.const_get("Foo::Bar::Baz")
+
+ * Mutex
+ * added method:
+ * added Mutex#owned? which returns the mutex is held by current
+ thread or not. [experimental]
+ * incompatible changes:
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize
+ and Mutex#sleep are no longer allowed to be used from trap handler
+ and raise a ThreadError in such case.
+ * Mutex#sleep may spurious wakeup. Check after wakeup.
+
+ * NilClass
+ * added method:
+ * added nil.to_h which returns {}
+
+ * Process
+ * added method:
+ * added getsid for getting session id (unix only).
+
+ * Range
+ * added method:
+ * added Range#size for lazy size evaluation.
+ * added Range#bsearch for binary search.
+
+ * RubyVM (MRI specific)
+ * added Environment variables to specify stack usage:
+ * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
+ default: 128KB (32bit CPU) or 256KB (64bit CPU).
+ * RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
+ creation. default: 512KB or 1024KB.
+ * RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
+ default: 64KB or 128KB.
+ * RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
+ creation. default: 256KB or 256KB.
+ These variables are checked only at launched time.
+ * added constant DEFAULT_PARAMS to get above default parameters.
+
+ * Signal
+ * added method:
+ * added Signal.signame which returns signal name
+
+ * incompatible changes:
+ * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
+ are specified.
+
+ * String
+ * added method:
+ * added String#b returning a copied string whose encoding is ASCII-8BIT.
+ * change return value:
+ * String#lines now returns an array instead of an enumerator.
+ * String#chars now returns an array instead of an enumerator.
+ * String#codepoints now returns an array instead of an enumerator.
+ * String#bytes now returns an array instead of an enumerator.
+
+ * Struct
+ * added method:
+ * added Struct#to_h returning values with keys corresponding to the
+ instance variable names.
+
+ * Thread
+ * added method:
+ * added Thread#thread_variable_get for getting thread local variables
+ (these are different than Fiber local variables).
+ * added Thread#thread_variable_set for setting thread local variables.
+ * added Thread#thread_variables for getting a list of the thread local
+ variable keys.
+ * added Thread#thread_variable? for testing to see if a particular thread
+ variable has been set.
+ * added Thread#backtrace_locations which returns similar information of
+ Kernel#caller_locations.
+ * incompatible changes:
+ * Thread#join and Thread#value now raises a ThreadError if target thread
+ is the current or main thread.
+
+ * Time
+ * change return value:
+ * Time#to_s returned encoding defaults to US-ASCII but automatically
+ transcodes to Encoding.default_internal if it is set.
+
+ * TracePoint
+ * new class. This class is replacement of set_trace_func.
+ Easy to use and efficient implementation.
+
+ * toplevel
+ * added method:
+ * added main.define_method which defines a global function.
+ * added main.using, which imports refinements into the current file or
+ eval string. [experimental]
+
+* cgi
+ * Add HTML5 tag maker.
+ * CGI#header has been renamed to CGI#http_header and
+ aliased to CGI#header.
+ * When HTML5 tagmaker called, overwrite CGI#header,
+ CGI#header function is to create a <header> element.
+
+* iconv
+ * Iconv has been removed. Use String#encode instead.
* io/wait
- * IO#wait_readable no longer checks FIONREAD, it may be used for
- non-bytestream IO such as listen sockets.
-
-* Net::FTP
- * Net::FTP#mlst is added.
- * Net::FTP#mlsd is added.
-
-* nkf
- * Merge nkf 2.1.4.
-
-* ObjectSpace (objspace)
- * ObjectSpace.count_symbols is added.
- * ObjectSpace.count_imemo_objects is added.
- * ObjectSpace.internal_class_of is added.
- * ObjectSpace.internal_super_of is added.
-
-* OpenSSL
- * OpenSSL::SSL::SSLSocket#accept_nonblock and
- OpenSSL::SSL::SSLSocket#connect_nonblock supports `exception: false`.
- [Feature #10532]
-
-* Pathname
- * Pathname#descend and Pathname#ascend supported blockless form.
- [Feature #11052]
-
-* Socket
- * Socket#connect_nonblock, Socket#accept_nonblock,
- TCPServer#accept_nonblock, UNIXServer#accept_nonblock,
- BasicSocket#recv_nonblock, BasicSocket#recvmsg_nonblock,
- BasicSocket#sendmsg_nonblock all support `exception: false` to return
- :wait_readable or :wait_writable symbols instead of raising
- IO::WaitReadable or IO::WaitWritable exceptions
- [Feature #10532] [Feature #11229]
- * BasicSocket#recv and BasicSocket#recv_nonblock allow an output
- String buffer argument like IO#read and IO#read_nonblock to reduce
- GC overhead [Feature #11242]
-
-* StringIO
- * In read-only mode, StringIO#set_encoding no longer sets the encoding
- of its buffer string. Setting the encoding of the string directly
- without StringIO#set_encoding may cause unpredictable behavior now.
- [Bug #11827]
-
-* timeout
- * Object#timeout is now warned as deprecated when called.
-
-=== Stdlib compatibility issues (excluding feature bug fixes)
-
-* ext/coverage/coverage.c
- * Coverage.peek_result: new method to allow coverage to be captured without
- stopping the coverage tool. [Feature #10816]
-
-* Fiddle
- * Fiddle::Function#call releases the GVL. [Feature #11607]
-
-* io-console
- * Update to io-console 0.4.5, and change the license to BSD 2-clause
- "Simplified" License.
-
-* lib/base64.rb
- * Base64.urlsafe_encode64: added a "padding" option to suppress
- the padding character ("="). [Feature #10740]
- * Base64.urlsafe_decode64: now it accepts not only correctly-padded
- input but also unpadded input. [Feature #10740]
-
-* lib/drb/drb.rb
- * removed unused argument. https://github.com/ruby/ruby/pull/515
-
-* lib/matrix.rb
- * Add Vector#round. https://github.com/ruby/ruby/pull/802
-
-* lib/webrick/utils.rb
- * removed unused argument. https://github.com/ruby/ruby/pull/356
-
-* Net::FTP
- * Connections are in passive mode per default now. The default mode can
- be changed by Net::FTP.default_passive=. [Feature #11612]
-
-* Net::HTTP
- * default value of Net::HTTP#open_timeout is now 60 (was nil).
-
-* Net::Telnet
- * Net::Telnet is extracted to net-telnet gem. It's unmaintain code.
- [Feature #11083]
-
-* Psych
- * Updated to Psych 2.0.17
-
-* Rake
- * Rake is removed from stdlib. [Feature #11025]
-
-* RDoc
- * Updated to RDoc 4.2.1. For full release notes see:
-
- https://github.com/rdoc/rdoc/blob/master/History.rdoc#421--2015-12-22
+ * new features:
+ * added IO#wait_writable method.
+ * added IO#wait_readable method as alias of IO#wait.
+
+* net/http
+ * new features:
+ * Proxies are now automatically detected from the http_proxy environment
+ variable. See Net::HTTP::new for details.
+ * gzip and deflate compression are now requested for all requests by
+ default. See Net::HTTP for details.
+ * SSL sessions are now reused across connections for a single instance.
+ This speeds up connection by using a previously negotiated session.
+ * Requests may be created from a URI which sets the request_uri and host
+ header of the request (but does not change the host connected to).
+ * Responses contain the URI requested which allows easier implementation of
+ redirect following.
+ * new methods:
+ * Net::HTTP#local_host
+ * Net::HTTP#local_host=
+ * Net::HTTP#local_port
+ * Net::HTTP#local_port=
+ * extended method:
+ * Net::HTTP#connect uses local_host and local_port if specified.
+
+* net/imap
+ * new methods:
+ * Net::IMAP.default_port
+ * Net::IMAP.default_imap_port
+ * Net::IMAP.default_tls_port
+ * Net::IMAP.default_ssl_port
+ * Net::IMAP.default_imaps_port
+
+* objspace
+ * new method:
+ * ObjectSpace.reachable_objects_from(obj)
+
+* openssl
+ * Consistently raise an error when trying to encode nil values. All instances
+ of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
+ instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
+ raise NoMethodError in the same case. Constructing such values is still
+ permitted.
+ * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to
+ :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server
+ :TLSv1_1_client. The version being effectively used can be queried
+ with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to
+ blacklist the new TLS versions with OpenSSL::SSL:OP_NO_TLSv1_1 and
+ OpenSSL::SSL::OP_NO_TLSv1_2.
+ * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback
+ may be set which gets called whenever a new handshake is negotiated. This
+ also allows to programmatically decline (client) renegotiation attempts.
+ * Support for "0/n" splitting of records as BEAST mitigation via
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
+ * The default options for OpenSSL::SSL::SSLContext have changed to
+ OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
+ instead of OpenSSL::SSL::OP_ALL only. This enables the countermeasure for
+ the BEAST attack by default.
+ * OpenSSL requires passwords for decrypting PEM-encoded files to be at least
+ four characters long. This led to awkward situations where an export with
+ a password with fewer than four characters was possible, but accessing the
+ file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
+ OpenSSL::PKey::EC therefore now enforce the same check when exporting a
+ private key to PEM with a password - it has to be at least four characters
+ long.
+ * SSL/TLS support for the Next Protocol Negotiation extension. Supported
+ with OpenSSL 1.0.1 and higher.
+ * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL
+ is FIPS-enabled. OpenSSL.fips_mode= allows turning on and off FIPS mode
+ manually in order to adapt to situations where FIPS mode would be an
+ explicit requirement.
+ * Authenticated Encryption with Associated Data (AEAD) is supported via
+ Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=.
+ Currently (OpenSSL 1.0.1c), only GCM mode is supported.
+
+* ostruct
+ * new methods:
+ * OpenStruct#[], []=
+ * OpenStruct#each_pair
+ * OpenStruct#eql?
+ * OpenStruct#hash
+ * OpenStruct#to_h converts the struct to a hash.
+ * extended method:
+ * OpenStruct.new also accepts an OpenStruct / Struct.
+
+* pathname
+ * extended method:
+ * Pathname#find returns an enumerator if no block is given.
+
+* rake
+ * rake has been updated to version 0.9.5.
+
+ This version is backwards-compatible with previous rake versions and
+ contains many bug fixes.
+
+ See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list
+ of changes in rake 0.9.3, 0.9.4 and 0.9.5.
+
+* rdoc
+ * rdoc has been updated to version 4.0
+
+ This version is largely backwards-compatible with previous rdoc versions.
+ The most notable change is an update to the ri data format (ri data must
+ be regenerated for gems shared across rdoc versions). Further API changes
+ are internal and won't affect most users.
+
+ See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a list of
+ changes in rdoc 4.0.
+
+* resolv
+ * new methods:
+ * Resolv::DNS#timeouts=
+ * Resolv::DNS::Config#timeouts=
+
+* rexml
+ * REXML::Document#write supports Hash arguments.
+ * REXML::Document#write supports new :encoding option. It changes
+ XML document encoding. Without :encoding option, encoding in
+ XML declaration is used for XML document encoding.
* RubyGems
- * Updated to RubyGems 2.5.1. For full release notes see:
-
- http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.0+-2F+2015-11-03
- and
- http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.1+-2F+2015-12-10
-
-=== Built-in global variables compatibility issues
-
-* $SAFE
- * $SAFE=2 and $SAFE=3 are obsolete. If $SAFE is set to 2 or larger,
- an ArgumentError is raised. [Feature #5455]
+ * Updated to 2.0.0.preview2
+
+ RubyGems 2.0.0 features the following improvements:
+
+ * Improved support for default gems shipping with ruby 2.0.0+
+ * A gem can have arbitrary metadata through Gem::Specification#metadata
+ * `gem search` now defaults to --remote and is anchored like gem list.
+ * Added --document to replace --rdoc and --ri. Use --no-document to
+ disable documentation, --document=rdoc to only generate rdoc.
+ * Only ri-format documentation is generated by default.
+ * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML
+ documentation.
+
+ For an expanded list of updates and bug fixes see:
+ https://github.com/rubygems/rubygems/blob/master/History.txt
+
+* shellwords
+ * Shellwords#shellescape() now stringifies the given object using to_s.
+ * Shellwords#shelljoin() accepts non-string objects in the given
+ array, each of which is stringified using to_s.
+
+* stringio
+ * deprecated methods:
+ * StringIO#lines, #bytes, #chars and #codepoints are deprecated.
+
+* syslog
+ * Added Syslog::Logger which provides a Logger API atop Syslog.
+ * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
+ are introduced for easy detection of available constants on a
+ running system.
+
+* tmpdir
+ * incompatible changes:
+ * Dir.mktmpdir uses FileUtils.remove_entry instead of
+ FileUtils.remove_entry_secure. This means that applications should not
+ change the permission of the created temporary directory to make
+ accessible from other users.
+
+* yaml
+ * Syck has been removed. YAML now completely depends on libyaml being
+ installed.
+
+* zlib
+ * Added streaming support for Zlib::Inflate and Zlib::Deflate. This allows
+ processing of a stream without the use of large amounts of memory.
+ * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
+ * Zlib streams are now processed without the GVL. This allows gzip, zlib and
+ deflate streams to be processed in parallel.
+ * deprecated methods:
+ * Zlib::GzipReader#lines and #bytes are deprecated.
-=== C API updates
-
-* rb_define_class_id_under() now raises a TypeError exception when the
- class is already defined but its superclass does not match the given
- superclass, as well as definitions in ruby level.
-
-* rb_timespec_now() is added to fetch current datetime as struct timespec.
- [Feature #11558]
-
-* rb_time_timespec_new() is added to create a time object with epoch,
- nanosecond, and UTC/localtime/time offset arguments. [Feature #11558]
+=== Language changes
-* rb_autoload() deprecated, use rb_funcall() instead. [Feature #11664]
+ * Added %i and %I for symbol list creation (similar to %w and %W).
-* rb_compile_error_with_enc(), rb_compile_error(), and rb_compile_bug()
- deprecated. these functions are exposed but only for internal use.
- external libraries should not use them.
+ * Default source encoding is changed to UTF-8. (was US-ASCII)
-=== Supported platform changes
+=== Compatibility issues (excluding feature bug fixes)
-* OS/2 is no longer supported
+ * Array#values_at
-* BeOS is no longer supported
+ See above.
-* Borland-C is no longer supported
+ * String#lines
+ * String#chars
+ * String#codepoints
+ * String#bytes
-* Haiku now stable and best effort
+ These methods no longer return an Enumerator, although passing a
+ block is still supported for backwards compatibility.
-=== Implementation improvements
+ Code like str.lines.with_index(1) { |line, lineno| ... } no longer
+ works because str.lines returns an array. Replace lines with
+ each_line in such cases.
-* Optimize Proc#call to eliminate method frame construction.
- [Feature #11569]
+ * IO#lines
+ * IO#chars
+ * IO#codepoints
+ * IO#bytes
+ * ARGF#lines
+ * ARGF#chars
+ * ARGF#codepoints
+ * ARGF#bytes
+ * StringIO#lines
+ * StringIO#chars
+ * StringIO#codepoints
+ * StringIO#bytes
+ * Zlib::GzipReader#lines
+ * Zlib::GzipReader#bytes
-* Reconsidering method entry data structure.
- [Bug #11278]
+ These methods are deprecated in favor of each_line, each_byte,
+ each_char and each_codepoint.
-* Introducing new table data structure for ID keys tables used by
- method table and so on. New table structure is simple and fast
- than st_table. [Feature #11420]
+ * Signal.trap
-* Machine code level tuning for object allocation and method calling
- code. r52099, r52254
+ See above.
-* RubyVM::InstructionSequence is extended for future improvement.
- [Feature #11788]
+ * Merge Onigmo.
+ https://github.com/k-takata/Onigmo
-* Case dispatch is now optimized for all special constant literals
- including nil, true, and false. Previously, only literal strings,
- symbols, integers and floats compiled to optimized case dispatch.
- [Feature #11769]
+ * The :close_others option is true by default for system() and exec().
+ Also, the close-on-exec flag is set by default for all new file descriptors.
+ This means file descriptors doesn't inherit to spawned process unless
+ explicitly requested such as system(..., fd=>fd).
-* Instance variables on non-pure Ruby classes (T_DATA, T_FILE,
- etc..) is less expensive to store than before. [Feature #11170]
+ * Kernel#respond_to? against a protected method now returns false
+ unless the second argument is true.
-* All accesses to members of big Struct objects are performed in
- constant-time. Previously, Struct elements beyond the first 10
- 10 elements used a linear scan. [Feature #10585]
+ * Dir.mktmpdir in lib/tmpdir.rb
-* The Set class got several speed up.
- [Misc #10754], [r52591]
+ See above.
-* Socket and I/O-related improvements
+ * OpenStruct new methods can conflict with custom attributes named
+ "each_pair", "eql?", "hash" or "to_h".
- * Calling overhead of most of new keyword-using I/O methods in
- [Feature #11229] is reduced by avoiding the inefficient C API
- to parse keywords. [Feature #11339]
+ * Thread#join, Thread#value
- * The standard library is updated to use the improved
- exception-free non-blocking I/O from [Feature #11229].
- This has the additional benefit of quieter $DEBUG output in
- addition to reducing expensive exceptions. [Feature #11044]
+ See above.
- * (Linux-only) waiting on a single FD anywhere in the stdlib no longer
- uses select(2), making it immune to slowdowns with high-numbered FDs.
- [Feature #11081] [Feature #11377]
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep
-* CGI.escapeHTML is optimized with C extention.
- https://github.com/ruby/ruby/pull/1164
+ See above.
diff --git a/README b/README
new file mode 100644
index 0000000000..2de785d86e
--- /dev/null
+++ b/README
@@ -0,0 +1,153 @@
+= What's Ruby
+
+Ruby is the interpreted scripting language for quick and
+easy object-oriented programming. It has many features to
+process text files and to do system management tasks (as in
+Perl). It is simple, straight-forward, and extensible.
+
+
+== Features of Ruby
+
+* Simple Syntax
+* *Normal* Object-Oriented features(ex. class, method calls)
+* *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+* Operator Overloading
+* Exception Handling
+* Iterators and Closures
+* Garbage Collection
+* Dynamic Loading of Object files(on some architecture)
+* Highly Portable (works on many Unix-like/POSIX compatible platforms
+ as well as Windows, Mac OS X, BeOS etc.)
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
+
+
+== How to get Ruby
+
+The Ruby distribution files can be found in the following FTP site:
+
+ftp://ftp.ruby-lang.org/pub/ruby/
+
+The trunk of the Ruby source tree can be checked out with the
+following command:
+
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+
+Or if you are using git then use following command:
+
+ $ git clone git://github.com/ruby/ruby.git
+
+There are some other branches under development. Try the following
+command and see the list of branches:
+
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+
+Or if you are using git then use following command:
+
+ $ git ls-remote git://github.com/ruby/ruby.git
+
+== Ruby home-page
+
+The URL of the Ruby home-page is:
+
+http://www.ruby-lang.org/
+
+
+== Mailing list
+
+There is a mailing list to talk about Ruby.
+To subscribe this list, please send the following phrase
+
+ subscribe YourFirstName YourFamilyName
+e.g.
+ subscribe Joseph Smith
+
+in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.
+
+
+== How to compile and install
+
+This is what you need to do to compile and install Ruby:
+
+0. If you want to use Microsoft Visual C++ to compile ruby,
+ read win32/README.win32 instead of this document.
+
+1. If +./configure+ does not exist or is older than configure.in,
+ run autoconf to (re)generate configure.
+
+2. Run +./configure+, which will generate config.h and Makefile.
+
+ Some C compiler flags may be added by default depending on your
+ environment. Specify <tt>optflags=..</tt> and <tt>warnflags=..</tt> as
+ necessary to override them.
+
+3. Edit +defines.h+ if you need. Usually this step will not be needed.
+
+4. Remove comment mark(<tt>#</tt>) before the module names from +ext/Setup+
+ (or add module names if not present), if you want to link modules
+ statically.
+
+ If you don't want to compile non static extension modules
+ (probably on architectures which does not allow dynamic loading),
+ remove comment mark from the line "<tt>#option nodynamic</tt>" in
+ +ext/Setup+.
+
+ Usually this step will not be needed.
+
+5. Run +make+.
+
+6. Optionally, run '<tt>make check</tt>' to check whether the compiled Ruby
+ interpreter works well. If you see the message "<tt>check succeeded</tt>",
+ your ruby works as it should (hopefully).
+
+7. Run '<tt>make install</tt>'
+
+ This command will create following directories and install files
+ onto them.
+
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ If Ruby's API version is '_x.y.z_', the <tt>${MAJOR}</tt> is '_x_', the
+ <tt>${MINOR}</tt> is '_y_', and the <tt>${TEENY}</tt> is '_z_'.
+
+ *NOTE*: teeny of the API version may be different from one of
+ Ruby's program version
+
+ You may have to be a super user to install ruby.
+
+If you fail to compile ruby, please send the detailed error report with
+the error log and machine/OS type, to help others.
+
+
+== Copying
+
+See the file +COPYING+.
+
+
+== The Author
+
+Feel free to send comments and bug reports to the author. Here is the
+author's latest mail address:
+
+<mailto:matz@ruby-lang.org>
+
+-------------------------------------------------------
+created at: Thu Aug 3 11:57:36 JST 1995
+--
+Local variables:
+mode: rdoc
+end:
diff --git a/README.EXT b/README.EXT
index 48b8d964c4..ba74e5c8d2 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1 +1,1464 @@
-Moved to doc/extension.rdoc
+# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
+
+This document explains how to make extension libraries for Ruby.
+
+= Basic Knowledge
+
+In C, variables have types and data do not have types. In contrast,
+Ruby variables do not have a static type, and data themselves have
+types, so data will need to be converted between the languages.
+
+Data in Ruby are represented by the C type `VALUE'. Each VALUE data
+has its data-type.
+
+To retrieve C data from a VALUE, you need to:
+
+1. Identify the VALUE's data type
+2. Convert the VALUE into C data
+
+Converting to the wrong data type may cause serious problems.
+
+== Data-Types
+
+The Ruby interpreter has the following data types:
+
+T_NIL :: nil
+T_OBJECT :: ordinary object
+T_CLASS :: class
+T_MODULE :: module
+T_FLOAT :: floating point number
+T_STRING :: string
+T_REGEXP :: regular expression
+T_ARRAY :: array
+T_HASH :: associative array
+T_STRUCT :: (Ruby) structure
+T_BIGNUM :: multi precision integer
+T_FIXNUM :: Fixnum(31bit or 63bit integer)
+T_COMPLEX :: complex number
+T_RATIONAL :: rational number
+T_FILE :: IO
+T_TRUE :: true
+T_FALSE :: false
+T_DATA :: data
+T_SYMBOL :: symbol
+
+In addition, there are several other types used internally:
+
+T_ICLASS :: included module
+T_MATCH :: MatchData object
+T_UNDEF :: undefined
+T_NODE :: syntax tree node
+T_ZOMBIE :: object awaiting finalization
+
+Most of the types are represented by C structures.
+
+== Check Data Type of the VALUE
+
+The macro TYPE() defined in ruby.h shows the data type of the VALUE.
+TYPE() returns the constant number T_XXXX described above. To handle
+data types, your code will look something like this:
+
+ switch (TYPE(obj)) {
+ case T_FIXNUM:
+ /* process Fixnum */
+ break;
+ case T_STRING:
+ /* process String */
+ break;
+ case T_ARRAY:
+ /* process Array */
+ break;
+ default:
+ /* raise exception */
+ rb_raise(rb_eTypeError, "not valid value");
+ break;
+ }
+
+There is the data-type check function
+
+ void Check_Type(VALUE value, int type)
+
+which raises an exception if the VALUE does not have the type
+specified.
+
+There are also faster check macros for fixnums and nil.
+
+ FIXNUM_P(obj)
+ NIL_P(obj)
+
+== Convert VALUE into C Data
+
+The data for type T_NIL, T_FALSE, T_TRUE are nil, false, true
+respectively. They are singletons for the data type.
+The equivalent C constants are: Qnil, Qfalse, Qtrue.
+Note that Qfalse is false in C also (i.e. 0), but not Qnil.
+
+The T_FIXNUM data is a 31bit or 63bit length fixed integer.
+This size is depend on the size of long: if long is 32bit then
+T_FIXNUM is 31bit, if long is 64bit then T_FIXNUM is 63bit.
+T_FIXNUM can be converted to a C integer by using the
+FIX2INT() macro or FIX2LONG(). Though you have to check that the
+data is really FIXNUM before using them, they are faster. FIX2LONG()
+never raises exceptions, but FIX2INT() raises RangeError if the
+result is bigger or smaller than the size of int.
+There are also NUM2INT() and NUM2LONG() which converts any Ruby
+numbers into C integers. These macros includes a type check,
+so an exception will be raised if the conversion failed. NUM2DBL()
+can be used to retrieve the double float value in the same way.
+
+You can use the macros
+StringValue() and StringValuePtr() to get a char* from a VALUE.
+StringValue(var) replaces var's value with the result of "var.to_str()".
+StringValuePtr(var) does same replacement and returns char*
+representation of var. These macros will skip the replacement if var
+is a String. Notice that the macros take only the lvalue as their
+argument, to change the value of var in place.
+
+You can also use the macro named StringValueCStr(). This is just
+like StringValuePtr(), but always add nul character at the end of
+the result. If the result contains nul character, this macro causes
+the ArgumentError exception.
+StringValuePtr() doesn't guarantee the existence of a nul at the end
+of the result, and the result may contain nul.
+
+Other data types have corresponding C structures, e.g. struct RArray
+for T_ARRAY etc. The VALUE of the type which has the corresponding
+structure can be cast to retrieve the pointer to the struct. The
+casting macro will be of the form RXXXX for each data type; for
+instance, RARRAY(obj). See "ruby.h".
+
+There are some accessing macros for structure members, for example
+`RSTRING_LEN(str)' to get the size of the Ruby String object. The
+allocated region can be accessed by `RSTRING_PTR(str)'. For arrays,
+use `RARRAY_LEN(ary)' and `RARRAY_PTR(ary)' respectively.
+
+Notice: Do not change the value of the structure directly, unless you
+are responsible for the result. This ends up being the cause of
+interesting bugs.
+
+== Convert C Data into VALUE
+
+To convert C data to Ruby values:
+
+FIXNUM ::
+
+ left shift 1 bit, and turn on LSB.
+
+Other pointer values::
+
+ cast to VALUE.
+
+You can determine whether a VALUE is pointer or not by checking its LSB.
+
+Notice Ruby does not allow arbitrary pointer values to be a VALUE. They
+should be pointers to the structures which Ruby knows about. The known
+structures are defined in <ruby.h>.
+
+To convert C numbers to Ruby values, use these macros.
+
+INT2FIX() :: for integers within 31bits.
+INT2NUM() :: for arbitrary sized integer.
+
+INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
+range, but is a bit slower.
+
+== Manipulating Ruby Data
+
+As I already mentioned, it is not recommended to modify an object's
+internal structure. To manipulate objects, use the functions supplied
+by the Ruby interpreter. Some (not all) of the useful functions are
+listed below:
+
+=== String Functions
+
+rb_str_new(const char *ptr, long len) ::
+
+ Creates a new Ruby string.
+
+rb_str_new2(const char *ptr) ::
+rb_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string from a C string. This is equivalent to
+ rb_str_new(ptr, strlen(ptr)).
+
+rb_tainted_str_new(const char *ptr, long len) ::
+
+ Creates a new tainted Ruby string. Strings from external data
+ sources should be tainted.
+
+rb_tainted_str_new2(const char *ptr) ::
+rb_tainted_str_new_cstr(const char *ptr) ::
+
+ Creates a new tainted Ruby string from a C string.
+
+rb_sprintf(const char *format, ...) ::
+rb_vsprintf(const char *format, va_list ap) ::
+
+ Creates a new Ruby string with printf(3) format.
+
+rb_str_cat(VALUE str, const char *ptr, long len) ::
+
+ Appends len bytes of data from ptr to the Ruby string.
+
+rb_str_cat2(VALUE str, const char* ptr) ::
+
+ Appends C string ptr to Ruby string str. This function is
+ equivalent to rb_str_cat(str, ptr, strlen(ptr)).
+
+rb_str_catf(VALUE str, const char* format, ...) ::
+rb_str_vcatf(VALUE str, const char* format, va_list ap) ::
+
+ Appends C string format and successive arguments to Ruby string
+ str according to a printf-like format. These functions are
+ equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
+ rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
+
+ Creates a new Ruby string with the specified encoding.
+
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string with encoding US-ASCII.
+
+rb_str_resize(VALUE str, long len) ::
+
+ Resizes Ruby string to len bytes. If str is not modifiable, this
+ function raises an exception. The length of str must be set in
+ advance. If len is less than the old length the content beyond
+ len bytes is discarded, else if len is greater than the old length
+ the content beyond the old length bytes will not be preserved but
+ will be garbage. Note that RSTRING_PTR(str) may change by calling
+ this function.
+
+rb_str_set_len(VALUE str, long len) ::
+
+ Sets the length of Ruby string. If str is not modifiable, this
+ function raises an exception. This function preserves the content
+ upto len bytes, regardless RSTRING_LEN(str). len must not exceed
+ the capacity of str.
+
+=== Array Functions
+
+rb_ary_new() ::
+
+ Creates an array with no elements.
+
+rb_ary_new2(long len) ::
+
+ Creates an array with no elements, allocating internal buffer
+ for len elements.
+
+rb_ary_new3(long n, ...) ::
+
+ Creates an n-element array from the arguments.
+
+rb_ary_new4(long n, VALUE *elts) ::
+
+ Creates an n-element array from a C array.
+
+rb_ary_to_ary(VALUE obj) ::
+
+ Converts the object into an array.
+ Equivalent to Object#to_ary.
+
+There are many functions to operate an array. They may dump core if other
+types are given.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
+
+ Equivaelent to Array#[].
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ ary[offset]
+
+rb_ary_subseq(VALUE ary, long beg, long len) ::
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val) ::
+rb_ary_pop(VALUE ary) ::
+rb_ary_shift(VALUE ary) ::
+rb_ary_unshift(VALUE ary, VALUE val) ::
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len) ::
+
+ Appends len elements of objects from ptr to the array.
+
+= Extending Ruby with C
+
+== Adding New Features to Ruby
+
+You can add new features (classes, methods, etc.) to the Ruby
+interpreter. Ruby provides APIs for defining the following things:
+
+* Classes, Modules
+* Methods, Singleton Methods
+* Constants
+
+=== Class and Module Definition
+
+To define a class or module, use the functions below:
+
+ VALUE rb_define_class(const char *name, VALUE super)
+ VALUE rb_define_module(const char *name)
+
+These functions return the newly created class or module. You may
+want to save this reference into a variable to use later.
+
+To define nested classes or modules, use the functions below:
+
+ VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
+ VALUE rb_define_module_under(VALUE outer, const char *name)
+
+=== Method and Singleton Method Definition
+
+To define methods or singleton methods, use these functions:
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
+
+The `argc' represents the number of the arguments to the C function,
+which must be less than 17. But I doubt you'll need that many.
+
+If `argc' is negative, it specifies the calling sequence, not number of
+the arguments.
+
+If argc is -1, the function will be called as:
+
+ VALUE func(int argc, VALUE *argv, VALUE obj)
+
+where argc is the actual number of arguments, argv is the C array of
+the arguments, and obj is the receiver.
+
+If argc is -2, the arguments are passed in a Ruby array. The function
+will be called like:
+
+ VALUE func(VALUE obj, VALUE args)
+
+where obj is the receiver, and args is the Ruby array containing
+actual arguments.
+
+There are some more functions to define methods. One takes an ID
+as the name of method to be defined. See also ID or Symbol below.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+There are two functions to define private/protected methods:
+
+ void rb_define_private_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+At last, rb_define_module_function defines a module functions,
+which are private AND singleton methods of the module.
+For example, sqrt is the module function defined in Math module.
+It can be called in the following way:
+
+ Math.sqrt(4)
+
+or
+
+ include Math
+ sqrt(4)
+
+To define module functions, use:
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+In addition, function-like methods, which are private methods defined
+in the Kernel module, can be defined using:
+
+ void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
+
+To define an alias for the method,
+
+ void rb_define_alias(VALUE module, const char* new, const char* old);
+
+To define a reader/writer for an attribute,
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+To define and undefine the `allocate' class method,
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+func has to take the klass as the argument and return a newly
+allocated instance. This instance should be as empty as possible,
+without any expensive (including external) resources.
+
+=== Constant Definition
+
+We have 2 functions to define constants:
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+The former is to define a constant under specified class/module. The
+latter is to define a global constant.
+
+== Use Ruby Features from C
+
+There are several ways to invoke Ruby's features from C code.
+
+=== Evaluate Ruby Programs in a String
+
+The easiest way to use Ruby's functionality from a C program is to
+evaluate the string as Ruby program. This function will do the job:
+
+ VALUE rb_eval_string(const char *str)
+
+Evaluation is done under the current context, thus current local variables
+of the innermost method (which is defined by Ruby) can be accessed.
+
+Note that the evaluation can raise an exception. There is a safer
+function:
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+It returns nil when an error occur. Moreover, *state is zero if str was
+successfully evaluated, or nonzero otherwise.
+
+=== ID or Symbol
+
+You can invoke methods directly, without parsing the string. First I
+need to explain about ID. ID is the integer number to represent
+Ruby's identifiers such as variable names. The Ruby data type
+corresponding to ID is Symbol. It can be accessed from Ruby in the
+form:
+
+ :Identifier
+
+or
+
+ :"any kind of string"
+
+You can get the ID value from a string within C code by using
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
+
+You can retrieve ID from Ruby object (Symbol or String) given as an
+argument by using
+
+ rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+These functions try to convert the argument to a String if it was not
+a Symbol nor a String. The second function stores the converted
+result into *name, and returns 0 if the string is not a known symbol.
+After this function returned a non-zero value, *name is always a
+Symbol or a String, otherwise it is a String if the result is 0.
+The third function takes NUL-terminated C string, not Ruby VALUE.
+
+You can convert C ID to Ruby Symbol by using
+
+ VALUE ID2SYM(ID id)
+
+and to convert Ruby Symbol object to ID, use
+
+ ID SYM2ID(VALUE symbol)
+
+=== Invoke Ruby Method from C
+
+To invoke methods directly, you can use the function below
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+This function invokes a method on the recv, with the method name
+specified by the symbol mid.
+
+=== Accessing the Variables and Constants
+
+You can access class variables and instance variables using access
+functions. Also, global variables can be shared between both
+environments. There's no way to access Ruby's local variables.
+
+The functions to access/modify instance variables are below:
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+id must be the symbol, which can be retrieved by rb_intern().
+
+To access the constants of the class/module:
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+See also Constant Definition above.
+
+= Information Sharing Between Ruby and C
+
+=== Ruby Constants That C Can Be Accessed From C
+
+As stated in section 1.3,
+the following Ruby constants can be referred from C.
+
+ Qtrue
+ Qfalse
+
+Boolean values. Qfalse is false in C also (i.e. 0).
+
+ Qnil
+
+Ruby nil in C scope.
+
+== Global Variables Shared Between C and Ruby
+
+Information can be shared between the two environments using shared global
+variables. To define them, you can use functions listed below:
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+This function defines the variable which is shared by both environments.
+The value of the global variable pointed to by `var' can be accessed
+through Ruby's global variable named `name'.
+
+You can define read-only (from Ruby, of course) variables using the
+function below.
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+You can defined hooked variables. The accessor functions (getter and
+setter) are called on access to the hooked variables.
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+If you need to supply either setter or getter, just supply 0 for the
+hook you don't need. If both hooks are 0, rb_define_hooked_variable()
+works just like rb_define_variable().
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+
+Also you can define a Ruby global variable without a corresponding C
+variable. The value of the variable will be set/get only by hooks.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id);
+ void (*setter)(VALUE val, ID id);
+
+
+== Encapsulate C Data into a Ruby Object
+
+To wrap and objectify a C pointer as a Ruby object (so called
+DATA), use Data_Wrap_Struct().
+
+ Data_Wrap_Struct(klass, mark, free, sval)
+
+Data_Wrap_Struct() returns a created DATA object. The klass argument
+is the class for the DATA object. The mark argument is the function
+to mark Ruby objects pointed by this data. The free argument is the
+function to free the pointer allocation. If this is -1, the pointer
+will be just freed. The functions mark and free will be called from
+garbage collector.
+
+These mark / free functions are invoked during GC execution. No
+object allocations are allowed during it, so do not allocate ruby
+objects inside them.
+
+You can allocate and wrap the structure in one step.
+
+ Data_Make_Struct(klass, type, mark, free, sval)
+
+This macro returns an allocated Data object, wrapping the pointer to
+the structure, which is also allocated. This macro works like:
+
+ (sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval))
+
+Arguments klass, mark, and free work like their counterparts in
+Data_Wrap_Struct(). A pointer to the allocated structure will be
+assigned to sval, which should be a pointer of the type specified.
+
+To retrieve the C pointer from the Data object, use the macro
+Data_Get_Struct().
+
+ Data_Get_Struct(obj, type, sval)
+
+A pointer to the structure will be assigned to the variable sval.
+
+See the example below for details.
+
+= Example - Creating dbm Extension
+
+OK, here's the example of making an extension library. This is the
+extension to access DBMs. The full source is included in the ext/
+directory in the Ruby's source tree.
+
+== Make the Directory
+
+ % mkdir ext/dbm
+
+Make a directory for the extension library under ext directory.
+
+== Design the Library
+
+You need to design the library features, before making it.
+
+== Write the C Code
+
+You need to write C code for your extension library. If your library
+has only one source file, choosing ``LIBRARY.c'' as a file name is
+preferred. On the other hand, in case your library has multiple source
+files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
+with an intermediate file ``LIBRARY.o'' on some platforms.
+Note that some functions in mkmf library described below generate
+a file ``conftest.c'' for checking with compilation. You shouldn't
+choose ``conftest.c'' as a name of a source file.
+
+Ruby will execute the initializing function named ``Init_LIBRARY'' in
+the library. For example, ``Init_dbm()'' will be executed when loading
+the library.
+
+Here's the example of an initializing function.
+
+ void
+ Init_dbm(void)
+ {
+ /* define DBM class */
+ cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBM includes Enumerate module */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBM has class method open(): arguments are received as C array */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBM instance method close(): no args */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBM instance method []: 1 argument */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* ID for a instance variable to store DBM data */
+ id_dbm = rb_intern("dbm");
+ }
+
+The dbm extension wraps the dbm struct in the C environment using
+Data_Make_Struct.
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+ obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
+
+This code wraps the dbmdata structure into a Ruby object. We avoid
+wrapping DBM* directly, because we want to cache size information.
+
+To retrieve the dbmdata structure from a Ruby object, we define the
+following macro:
+
+ #define GetDBM(obj, dbmp) {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ if (dbmp->di_dbm == 0) closed_dbm();\
+ }
+
+This sort of complicated macro does the retrieving and close checking for
+the DBM.
+
+There are three kinds of way to receive method arguments. First,
+methods with a fixed number of arguments receive arguments like this:
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+The first argument of the C function is the self, the rest are the
+arguments to the method.
+
+Second, methods with an arbitrary number of arguments receive
+arguments like this:
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+ /* ... */
+ }
+
+The first argument is the number of method arguments, the second
+argument is the C array of the method arguments, and the third
+argument is the receiver of the method.
+
+You can use the function rb_scan_args() to check and retrieve the
+arguments. The third argument is a string that specifies how to
+capture method arguments and assign them to the following VALUE
+references.
+
+
+The following is an example of a method that takes arguments by Ruby's
+array:
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+The first argument is the receiver, the second one is the Ruby array
+which contains the arguments to the method.
+
+*Notice*: GC should know about global variables which refer to Ruby's objects,
+but are not exported to the Ruby world. You need to protect them by
+
+ void rb_global_variable(VALUE *var)
+
+== Prepare extconf.rb
+
+If the file named extconf.rb exists, it will be executed to generate
+Makefile.
+
+extconf.rb is the file for checking compilation conditions etc. You
+need to put
+
+ require 'mkmf'
+
+at the top of the file. You can use the functions below to check
+various conditions.
+
+ have_macro(macro[, headers[, opt]]): check whether macro is defined
+ have_library(lib[, func[, headers[, opt]]]): check whether library containing function exists
+ find_library(lib[, func, *paths]): find library from paths
+ have_func(func[, headers[, opt]): check whether function exists
+ have_var(var[, headers[, opt]]): check whether variable exists
+ have_header(header[, preheaders[, opt]]): check whether header file exists
+ find_header(header, *paths): find header from paths
+ have_framework(fw): check whether framework exists (for MacOS X)
+ have_struct_member(type, member[, headers[, opt]]): check whether struct has member
+ have_type(type[, headers[, opt]]): check whether type exists
+ find_type(type, opt, *headers): check whether type exists in headers
+ have_const(const[, headers[, opt]]): check whether constant is defined
+ check_sizeof(type[, headers[, opts]]): check size of type
+ check_signedness(type[, headers[, opts]]): check signedness of type
+ convertible_int(type[, headers[, opts]]): find convertible integer type
+ find_executable(bin[, path]): find excutable file path
+ create_header(header): generate configured header
+ create_makefile(target[, target_prefix]): generate Makefile
+
+See MakeMakefile for full documentation of these functions.
+
+The value of the variables below will affect the Makefile.
+
+ $CFLAGS: included in CFLAGS make variable (such as -O)
+ $CPPFLAGS: included in CPPFLAGS make variable (such as -I, -D)
+ $LDFLAGS: included in LDFLAGS make variable (such as -L)
+ $objs: list of object file names
+
+Normally, the object files list is automatically generated by searching
+source files, but you must define them explicitly if any sources will
+be generated while building.
+
+If a compilation condition is not fulfilled, you should not call
+``create_makefile''. The Makefile will not be generated, compilation will
+not be done.
+
+== Prepare Depend (Optional)
+
+If the file named depend exists, Makefile will include that file to
+check dependencies. You can make this file by invoking
+
+ % gcc -MM *.c > depend
+
+It's harmless. Prepare it.
+
+== Generate Makefile
+
+Try generating the Makefile by:
+
+ ruby extconf.rb
+
+If the library should be installed under vendor_ruby directory
+instead of site_ruby directory, use --vendor option as follows.
+
+ ruby extconf.rb --vendor
+
+You don't need this step if you put the extension library under the ext
+directory of the ruby source tree. In that case, compilation of the
+interpreter will do this step for you.
+
+== Run make
+
+Type
+
+ make
+
+to compile your extension. You don't need this step either if you have
+put the extension library under the ext directory of the ruby source tree.
+
+== Debug
+
+You may need to rb_debug the extension. Extensions can be linked
+statically by adding the directory name in the ext/Setup file so that
+you can inspect the extension with the debugger.
+
+== Done! Now You Have the Extension Library
+
+You can do anything you want with your library. The author of Ruby
+will not claim any restrictions on your code depending on the Ruby API.
+Feel free to use, modify, distribute or sell your program.
+
+= Appendix A. Ruby Source Files Overview
+
+== Ruby Language Core
+
+class.c :: classes and modules
+error.c :: exception classes and exception mechanism
+gc.c :: memory management
+load.c :: library loading
+object.c :: objects
+variable.c :: variables and constants
+
+== Ruby Syntax Parser
+
+parse.y :: grammar definition
+parse.c :: automatically generated from parse.y
+keywords :: reserved keywords
+lex.c :: automatically generated from keywords
+
+== Ruby Evaluator (a.k.a. YARV)
+
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : definition of VM instructions
+ iseq.c : implementation of VM::ISeq
+ thread.c : thread management and context swiching
+ thread_win32.c : thread implementation
+ thread_pthread.c : ditto
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ opt_insns_unif.def : instruction unification
+ opt_operand.def : definitions for optimization
+
+ -> insn*.inc : automatically generated
+ -> opt*.inc : automatically generated
+ -> vm.inc : automatically generated
+
+== Regular Expression Engine (Oniguruma)
+
+ regex.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== Utility Functions
+
+debug.c :: debug symbols for C debuggger
+dln.c :: dynamic loading
+st.c :: general purpose hash table
+strftime.c :: formatting times
+util.c :: misc utilities
+
+== Ruby Interpreter Implementation
+
+ dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
+ inits.c
+ main.c
+ ruby.c
+ version.c
+
+ gem_prelude.rb
+ prelude.rb
+
+== Class Library
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: random number
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+
+defs/known_errors.def :: Errno::* exception classes
+-> known_errors.inc :: automatically generated
+
+== Multilingualization
+
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: encoding classes
+enc/trans/* :: codepoint mapping tables
+
+== goruby Interpreter Implementation
+
+ goruby.c
+ golf_prelude.rb : goruby specific libraries.
+ -> golf_prelude.c : automatically generated
+
+
+= Appendix B. Ruby Extension API Reference
+
+== Types
+
+VALUE ::
+
+ The type for the Ruby object. Actual structures are defined in ruby.h,
+ such as struct RString, etc. To refer the values in structures, use
+ casting macros like RSTRING(obj).
+
+== Variables and Constants
+
+Qnil::
+ nil object
+
+Qtrue::
+ true object (default true value)
+
+Qfalse::
+ false object
+
+== C Pointer Wrapping
+
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
+
+ Wrap a C pointer into a Ruby object. If object has references to other
+ Ruby objects, they should be marked by using the mark function during
+ the GC process. Otherwise, mark should be 0. When this object is no
+ longer referred by anywhere, the pointer will be discarded by free
+ function.
+
+Data_Make_Struct(klass, type, mark, free, sval) ::
+
+ This macro allocates memory using malloc(), assigns it to the variable
+ sval, and returns the DATA encapsulating the pointer to memory region.
+
+Data_Get_Struct(data, type, sval) ::
+
+ This macro retrieves the pointer value from DATA, and assigns it to
+ the variable sval.
+
+== Checking Data Types
+
+TYPE(value) ::
+
+ Internal type (T_NIL, T_FIXNUM, etc.)
+
+FIXNUM_P(value) ::
+
+ Is +value+ a Fixnum?
+
+NIL_P(value) ::
+
+ Is +value+ nil?
+
+void Check_Type(VALUE value, int type) ::
+
+ Ensures +value+ is of the given internal +type+ or raises a TypeError
+
+SaveStringValue(value) ::
+
+ Checks that +value+ is a String and is not tainted
+
+== Data Type Conversion
+
+FIX2INT(value), INT2FIX(i) ::
+
+ Fixnum <-> integer
+
+FIX2LONG(value), LONG2FIX(l) ::
+
+ Fixnum <-> long
+
+NUM2INT(value), INT2NUM(i) ::
+
+ Numeric <-> integer
+
+NUM2UINT(value), UINT2NUM(ui) ::
+
+ Numeric <-> unsigned integer
+
+NUM2LONG(value), LONG2NUM(l) ::
+
+ Numeric <-> long
+
+NUM2ULONG(value), ULONG2NUM(ul) ::
+
+ Numeric <-> unsigned long
+
+NUM2LL(value), LL2NUM(ll) ::
+
+ Numeric <-> long long
+
+NUM2ULL(value), ULL2NUM(ull) ::
+
+ Numeric <-> unsigned long long
+
+NUM2OFFT(value), OFFT2NUM(off) ::
+
+ Numeric <-> off_t
+
+NUM2SIZET(value), SIZET2NUM(size) ::
+
+ Numeric <-> size_t
+
+NUM2SSIZET(value), SSIZET2NUM(ssize) ::
+
+ Numeric <-> ssize_t
+
+NUM2DBL(value) ::
+
+ Numeric -> double
+
+rb_float_new(f) ::
+
+ double -> Float
+
+StringValue(value) ::
+
+ Object with #to_str -> String
+
+StringValuePtr(value) ::
+
+ Object with #to_str -> pointer to String data
+
+StringValueCStr(value) ::
+
+ Object with #to_str -> pointer to String data without NULL bytes
+
+rb_str_new2(s) ::
+
+ char * -> String
+
+== Defining Class and Module
+
+VALUE rb_define_class(const char *name, VALUE super) ::
+
+ Defines a new Ruby class as a subclass of super.
+
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
+
+ Creates a new Ruby class as a subclass of super, under the module's
+ namespace.
+
+VALUE rb_define_module(const char *name) ::
+
+ Defines a new Ruby module.
+
+VALUE rb_define_module_under(VALUE module, const char *name) ::
+
+ Defines a new Ruby module under the module's namespace.
+
+void rb_include_module(VALUE klass, VALUE module) ::
+
+ Includes module into class. If class already includes it, just ignored.
+
+void rb_extend_object(VALUE object, VALUE module) ::
+
+ Extend the object with the module's attributes.
+
+== Defining Global Variables
+
+void rb_define_variable(const char *name, VALUE *var) ::
+
+ Defines a global variable which is shared between C and Ruby. If name
+ contains a character which is not allowed to be part of the symbol,
+ it can't be seen from Ruby programs.
+
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
+
+ Defines a read-only global variable. Works just like
+ rb_define_variable(), except the defined variable is read-only.
+
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*setter)()) ::
+
+ Defines a virtual variable, whose behavior is defined by a pair of C
+ functions. The getter function is called when the variable is
+ referenced. The setter function is called when the variable is set to a
+ value. The prototype for getter/setter functions are:
+
+ VALUE getter(ID id)
+ void setter(VALUE val, ID id)
+
+ The getter function must return the value for the access.
+
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), VALUE (*setter)()) ::
+
+ Defines hooked variable. It's a virtual variable with a C variable.
+ The getter is called as
+
+ VALUE getter(ID id, VALUE *var)
+
+ returning a new value. The setter is called as
+
+ void setter(VALUE val, ID id, VALUE *var)
+
+ GC requires C global variables which hold Ruby values to be marked.
+
+void rb_global_variable(VALUE *var)
+
+ Tells GC to protect these variables.
+
+== Constant Definition
+
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
+
+ Defines a new constant under the class/module.
+
+void rb_define_global_const(const char *name, VALUE val) ::
+
+ Defines a global constant. This is just the same as
+
+ rb_define_const(cKernal, name, val)
+
+== Method Definition
+
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a method for the class. func is the function pointer. argc
+ is the number of arguments. if argc is -1, the function will receive
+ 3 arguments: argc, argv, and self. if argc is -2, the function will
+ receive 2 arguments, self and args, where args is a Ruby array of
+ the method arguments.
+
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a private method for the class. Arguments are same as
+ rb_define_method().
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a singleton method. Arguments are same as rb_define_method().
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ Retrieve argument from argc and argv to given VALUE references
+ according to the format string. The format can be described in ABNF
+ as follows:
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; The number of leading
+ ; mandatory arguments
+ num-of-optional-args := DIGIT ; The number of optional
+ ; arguments
+ sym-for-variable-length-args := "*" ; Indicates that variable
+ ; length arguments are
+ ; captured as a ruby array
+ num-of-trailing-mandatory-args := DIGIT ; The number of trailing
+ ; mandatory arguments
+ sym-for-option-hash-arg := ":" ; Indicates that an option
+ ; hash is captured if the last
+ ; argument is a hash or can be
+ ; converted to a hash with
+ ; #to_hash. When the last
+ ; argument is nil, it is
+ ; captured if it is not
+ ; ambiguous to take it as
+ ; empty option hash; i.e. '*'
+ ; is not specified and
+ ; arguments are given more
+ ; than sufficient.
+ sym-for-block-arg := "&" ; Indicates that an iterator
+ ; block should be captured if
+ ; given
+
+ For example, "12" means that the method requires at least one
+ argument, and at most receives three (1+2) arguments. So, the format
+ string must be followed by three variable references, which are to be
+ assigned to captured arguments. For omitted arguments, variables are
+ set to Qnil. NULL can be put in place of a variable reference, which
+ means the corresponding captured argument(s) should be just dropped.
+
+ The number of given arguments, excluding an option hash or iterator
+ block, is returned.
+
+== Invoking Ruby method
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ Invokes a method. To retrieve mid from a method name, use rb_intern().
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments by an array of values.
+
+VALUE rb_eval_string(const char *str) ::
+
+ Compiles and executes the string as a Ruby program.
+
+ID rb_intern(const char *name) ::
+
+ Returns ID corresponding to the name.
+
+char *rb_id2name(ID id) ::
+
+ Returns the name corresponding ID.
+
+char *rb_class2name(VALUE klass) ::
+
+ Returns the name of the class.
+
+int rb_respond_to(VALUE object, ID id) ::
+
+ Returns true if the object responds to the message specified by id.
+
+== Instance Variables
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ Retrieve the value of the instance variable. If the name is not
+ prefixed by `@', that variable shall be inaccessible from Ruby.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ Sets the value of the instance variable.
+
+== Control Structure
+
+VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ Calls a method on the recv, with the method name specified by the
+ symbol mid, with argc arguments in argv, supplying func as the
+ block. When func is called as the block, it will receive the value
+ from yield as the first argument, and data2 as the second argument.
+ When yielded with multiple values (in C, rb_yield_values(),
+ rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
+ whereas yielded values can be gotten via argc/argv of the third/fourth
+ arguments.
+
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) ::
+
+ Calls the function func1, supplying func2 as the block. func1 will be
+ called with the argument arg1. func2 receives the value from yield as
+ the first argument, arg2 as the second argument.
+
+ When rb_iterate is used in 1.9, func1 has to call some Ruby-level method.
+ This function is obsolete since 1.9; use rb_block_call instead.
+
+VALUE rb_yield(VALUE val) ::
+
+ Evaluates the block with value val.
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1, with arg1 as the argument. If an exception
+ occurs during func1, it calls func2 with arg2 as the argument. The
+ return value of rb_rescue() is the return value from func1 if no
+ exception occurs, from func2 otherwise.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1 with arg1 as the argument, then calls func2
+ with arg2 if execution terminated. The return value from
+ rb_ensure() is that of func1 when no exception occured.
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ Calls the function func with arg as the argument. If no exception
+ occured during func, it returns the result of func and *state is zero.
+ Otherwise, it returns Qnil and sets *state to nonzero. If state is
+ NULL, it is not set in both cases.
+ You have to clear the error info with rb_set_errinfo(Qnil) when
+ ignoring the caught exception.
+
+void rb_jump_tag(int state) ::
+
+ Continues the exception caught by rb_protect() and rb_eval_string_protect().
+ state must be the returned value from those functions. This function
+ never return to the caller.
+
+void rb_iter_break() ::
+
+ Exits from the current innermost block. This function never return to
+ the caller.
+
+void rb_iter_break_value(VALUE value) ::
+
+ Exits from the current innermost block with the value. The block will
+ return the given argument value. This function never return to the
+ caller.
+
+== Exceptions and Errors
+
+void rb_warn(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format.
+
+void rb_warning(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format, if
+ $VERBOSE is true.
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ Raises RuntimeError. The fmt is a format string just like printf().
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ Raises a class exception. The fmt is a format string just like printf().
+
+void rb_fatal(const char *fmt, ...) ::
+
+ Raises a fatal error, terminates the interpreter. No exception handling
+ will be done for fatal errors, but ensure blocks will be executed.
+
+void rb_bug(const char *fmt, ...) ::
+
+ Terminates the interpreter immediately. This function should be
+ called under the situation caused by the bug in the interpreter. No
+ exception handling nor ensure execution will be done.
+
+== Initialize and Start the Interpreter
+
+The embedding API functions are below (not needed for extension libraries):
+
+void ruby_init() ::
+
+ Initializes the interpreter.
+
+void ruby_options(int argc, char **argv) ::
+
+ Process command line arguments for the interpreter.
+
+void ruby_run() ::
+
+ Starts execution of the interpreter.
+
+void ruby_script(char *name) ::
+
+ Specifies the name of the script ($0).
+
+== Hooks for the Interpreter Events
+
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
+
+Adds a hook function for the specified interpreter events.
+events should be OR'ed value of:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+The definition of rb_event_hook_func_t is below:
+
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
+
+The third argument `data' to rb_add_event_hook() is passed to the hook
+function as the second argument, which was the pointer to the current
+NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below.
+
+ int rb_remove_event_hook(rb_event_hook_func_t func)
+
+Removes the specified hook function.
+
+== Macros for Compatibility
+
+Some macros to check API compatibilities are available by default.
+
+NORETURN_STYLE_NEW ::
+
+ Means that NORETURN macro is functional style instead of prefix.
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ Means that function rb_define_alloc_func() is provided, that means the
+ allocation framework is used. This is same as the result of
+ have_func("rb_define_alloc_func", "ruby.h").
+
+HAVE_RB_REG_NEW_STR ::
+
+ Means that function rb_reg_new_str() is provided, that creates Regexp
+ object from String object. This is same as the result of
+ have_func("rb_reg_new_str", "ruby.h").
+
+HAVE_RB_IO_T ::
+
+ Means that type rb_io_t is provided.
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ Means that Symbols will be returned as method names, e.g.,
+ Module#methods, #singleton_methods and so on.
+
+HAVE_RUBY_*_H ::
+
+ Defined in ruby.h and means corresponding header is available. For
+ instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not
+ mere st.h.
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ Means that rb_add_event_hook() takes the third argument `data', to be
+ passed to the given event hook function.
+
+/*
+ * Local variables:
+ * fill-column: 70
+ * end:
+ */
diff --git a/README.EXT.ja b/README.EXT.ja
index f884ecbb0e..7b008b952e 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1 +1,1587 @@
-doc/extension.ja.rdocに移動しました
+# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
+
+Rubyの拡張ライブラリの作り方を説明します.
+
+= 基礎知識
+
+Cの変数には型があり,データには型がありません.ですから,た
+とえばポインタをintの変数に代入すると,その値は整数として取
+り扱われます.逆にRubyの変数には型がなく,データに型がありま
+す.この違いのため,CとRubyは相互に変換しなければ,お互いの
+データをアクセスできません.
+
+RubyのデータはVALUEというCの型で表現されます.VALUE型のデー
+タはそのデータタイプを自分で知っています.このデータタイプと
+いうのはデータ(オブジェクト)の実際の構造を意味していて,Ruby
+のクラスとはまた違ったものです.
+
+VALUEからCにとって意味のあるデータを取り出すためには
+
+1. VALUEのデータタイプを知る
+2. VALUEをCのデータに変換する
+
+の両方が必要です.(1)を忘れると間違ったデータの変換が行われ
+て,最悪プログラムがcore dumpします.
+
+== データタイプ
+
+Rubyにはユーザが使う可能性のある以下のタイプがあります.
+
+T_NIL :: nil
+T_OBJECT :: 通常のオブジェクト
+T_CLASS :: クラス
+T_MODULE :: モジュール
+T_FLOAT :: 浮動小数点数
+T_STRING :: 文字列
+T_REGEXP :: 正規表現
+T_ARRAY :: 配列
+T_HASH :: 連想配列
+T_STRUCT :: (Rubyの)構造体
+T_BIGNUM :: 多倍長整数
+T_FIXNUM :: Fixnum(31bitまたは63bit長整数)
+T_COMPLEX :: 複素数
+T_RATIONAL :: 有理数
+T_FILE :: 入出力
+T_TRUE :: 真
+T_FALSE :: 偽
+T_DATA :: データ
+T_SYMBOL :: シンボル
+
+その他に内部で利用されている以下のタイプがあります.
+
+ T_ICLASS
+ T_MATCH
+ T_UNDEF
+ T_NODE
+ T_ZOMBIE
+
+ほとんどのタイプはCの構造体で実装されています.
+
+== VALUEのデータタイプをチェックする
+
+ruby.hではTYPE()というマクロが定義されていて,VALUEのデータ
+タイプを知ることが出来ます.TYPE()マクロは上で紹介したT_XXXX
+の形式の定数を返します.VALUEのデータタイプに応じて処理する
+場合には,TYPE()の値で分岐することになります.
+
+ switch (TYPE(obj)) {
+ case T_FIXNUM:
+ /* FIXNUMの処理 */
+ break;
+ case T_STRING:
+ /* 文字列の処理 */
+ break;
+ case T_ARRAY:
+ /* 配列の処理 */
+ break;
+ default:
+ /* 例外を発生させる */
+ rb_raise(rb_eTypeError, "not valid value");
+ break;
+ }
+
+それとデータタイプをチェックして,正しくなければ例外を発生す
+る関数が用意されています.
+
+ void Check_Type(VALUE value, int type)
+
+この関数はvalueがtypeで無ければ,例外を発生させます.引数と
+して与えられたVALUEのデータタイプが正しいかどうかチェックす
+るためには,この関数を使います.
+
+FIXNUMとNILに関してはより高速な判別マクロが用意されています.
+
+ FIXNUM_P(obj)
+ NIL_P(obj)
+
+== VALUEをCのデータに変換する
+
+データタイプがT_NIL,T_FALSE,T_TRUEである時,データはそれぞ
+れnil,false,trueです.このデータタイプのオブジェクトはひと
+つずつしか存在しません.
+
+データタイプがT_FIXNUMの時,これは31bitまたは63bitのサイズを
+持つ整数です.longのサイズが32bitのプラットフォームであれば
+31bitに,longのサイズが64bitのプラットフォームであれば63bit
+になります. FIXNUM を C の整数に変換するためにはマクロ
+「FIX2INT()」または「FIX2LONG()」を使います.これらのマクロ
+を使用する際には事前にデータタイプがFIXNUMであることを確認す
+る必要がありますが,比較的高速に変換を行うことができます.ま
+た,「FIX2LONG()」は例外を発生しませんが,「FIX2INT()」は変
+換結果がintのサイズに収まらない場合には例外を発生します.
+それから,FIXNUMに限らずRubyのデータを整数に変換する
+「NUM2INT()」および「NUM2LONG()」というマクロがあります.こ
+れらのマクロはマクロはデータタイプのチェック無しで使えます
+(整数に変換できない場合には例外が発生する).同様にチェック無
+で使える変換マクロはdoubleを取り出す「NUM2DBL()」があります.
+
+char* を取り出す場合, StringValue() と StringValuePtr()
+を使います.
+StringValue(var) は var が String
+であれば何もせず,そうでなければ var を var.to_str() の結果
+に置き換えるマクロ,StringValuePtr(var) は同様に var を
+String に置き換えてから var のバイト列表現に対する char* を
+返すマクロです.var の内容を直接置き換える処理が入るので,
+var は lvalue である必要があります.
+また,StringValuePtr() に類似した StringValueCStr() というマ
+クロもあります.StringValueCStr(var) は var を String に置き
+換えてから var の文字列表現に対する char* を返します.返され
+る文字列の末尾には nul 文字が付加されます.なお,途中に nul
+文字が含まれる場合は ArgumentError が発生します.
+一方,StringValuePtr() では,末尾に nul 文字がある保証はなく,
+途中に nul 文字が含まれている可能性もあります.
+
+それ以外のデータタイプは対応するCの構造体があります.対応す
+る構造体のあるVALUEはそのままキャスト(型変換)すれば構造体の
+ポインタに変換できます.
+
+構造体は「struct RXxxxx」という名前でruby.hで定義されていま
+す.例えば文字列は「struct RString」です.実際に使う可能性が
+あるのは文字列と配列くらいだと思います.
+
+ruby.hでは構造体へキャストするマクロも「RXXXXX()」(全部大文
+字にしたもの)という名前で提供されています(例: RSTRING()).
+
+構造体からデータを取り出すマクロが提供されています.文字列
+strの長さを得るためには「RSTRING_LEN(str)」とし,文字列strを
+char*として得るためには「RSTRING_PTR(str)」とします.配列の
+場合には,それぞれ「RARRAY_LEN(ary)」,「RARRAY_PTR(ary)」と
+なります.
+
+Rubyの構造体を直接アクセスする時に気をつけなければならないこ
+とは,配列や文字列の構造体の中身は参照するだけで,直接変更し
+ないことです.直接変更した場合,オブジェクトの内容の整合性が
+とれなくなって,思わぬバグの原因になります.
+
+== CのデータをVALUEに変換する
+
+VALUEの実際の構造は
+
+FIXNUMの場合 ::
+
+ 1bit左シフトして,LSBを立てる.
+
+その他のポインタの場合 ::
+
+ そのままVALUEにキャストする.
+
+となっています.よって,LSBをチェックすればVALUEがFIXNUMかど
+うかわかるわけです(ポインタのLSBが立っていないことを仮定して
+いる).
+
+ですから,FIXNUM以外のRubyのオブジェクトの構造体は単にVALUE
+にキャストするだけでVALUEに変換出来ます.ただし,任意の構造
+体がVALUEにキャスト出来るわけではありません.キャストするの
+はRubyの知っている構造体(ruby.hで定義されているstruct RXxxx
+のもの)だけです.
+
+FIXNUMに関しては変換マクロを経由する必要があります.Cの整数
+からVALUEに変換するマクロは以下のものがあります.必要に応じ
+て使い分けてください.
+
+INT2FIX() :: もとの整数が31bitまたは63bit以内に収まる自信
+ がある時
+INT2NUM() :: 任意の整数からVALUEへ
+
+INT2NUM()は整数がFIXNUMの範囲に収まらない場合,Bignumに変換
+してくれます(が,少し遅い).
+
+== Rubyのデータを操作する
+
+先程も述べた通り,Rubyの構造体をアクセスする時に内容の更新を
+行うことは勧められません.で,Rubyのデータを操作する時には
+Rubyが用意している関数を用いてください.
+
+ここではもっとも使われるであろう文字列と配列の生成/操作を行
+い関数をあげます(全部ではないです).
+
+=== 文字列に対する関数
+
+rb_str_new(const char *ptr, long len) ::
+
+ 新しいRubyの文字列を生成する.
+
+rb_str_new2(const char *ptr)
+rb_str_new_cstr(const char *ptr)
+
+ Cの文字列からRubyの文字列を生成する.この関数の機能は
+ rb_str_new(ptr, strlen(ptr))と同等である.
+
+rb_tainted_str_new(const char *ptr, long len)
+
+ 汚染マークが付加された新しいRubyの文字列を生成する.外部
+ からのデータに基づく文字列には汚染マークが付加されるべき
+ である.
+
+rb_tainted_str_new2(const char *ptr)
+rb_tainted_str_new_cstr(const char *ptr)
+
+ Cの文字列から汚染マークが付加されたRubyの文字列を生成する.
+
+rb_sprintf(const char *format, ...)
+rb_vsprintf(const char *format, va_list ap)
+
+ Cの文字列formatと続く引数をprintf(3)のフォーマットにしたがって
+ 整形し,Rubyの文字列を生成する.
+
+rb_str_cat(VALUE str, const char *ptr, long len)
+
+ Rubyの文字列strにlenバイトの文字列ptrを追加する.
+
+rb_str_cat2(VALUE str, const char* ptr)
+
+ Rubyの文字列strにCの文字列ptrを追加する.この関数の機能は
+ rb_str_cat(str, ptr, strlen(ptr))と同等である.
+
+rb_str_catf(VALUE str, const char* format, ...)
+rb_str_vcatf(VALUE str, const char* format, va_list ap)
+
+ Cの文字列formatと続く引数をprintf(3)のフォーマットにしたがって
+ 整形し,Rubyの文字列strに追加する.この関数の機能は,それぞれ
+ rb_str_cat2(str, rb_sprintf(format, ...)) や
+ rb_str_cat2(str, rb_vsprintf(format, ap)) と同等である.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
+
+ 指定されたエンコーディングでRubyの文字列を生成する.
+
+rb_usascii_str_new(const char *ptr, long len)
+rb_usascii_str_new_cstr(const char *ptr)
+
+ エンコーディングがUS-ASCIIのRubyの文字列を生成する.
+
+rb_str_resize(VALUE str, long len)
+
+ Rubyの文字列のサイズをlenバイトに変更する.strの長さは前
+ 以てセットされていなければならない.lenが元の長さよりも短
+ い時は,lenバイトを越えた部分の内容は捨てられる.lenが元
+ の長さよりも長い時は,元の長さを越えた部分の内容は保存さ
+ れないでゴミになるだろう.この関数の呼び出しによって
+ RSTRING_PTR(str)が変更されるかもしれないことに注意.
+
+rb_str_set_len(VALUE str, long len)
+
+ Rubyの文字列のサイズをlenバイトにセットする.strが変更可
+ 能でなければ例外が発生する.RSTRING_LEN(str)とは無関係に,
+ lenバイトまでの内容は保存される.lenはstrの容量を越えてい
+ てはならない.
+
+
+== 配列に対する関数
+
+rb_ary_new()
+
+ 要素が0の配列を生成する.
+
+rb_ary_new2(long len)
+
+ 要素が0の配列を生成する.len要素分の領域をあらかじめ割り
+ 当てておく.
+
+rb_ary_new3(long n, ...)
+
+ 引数で指定したn要素を含む配列を生成する.
+
+rb_ary_new4(long n, VALUE *elts)
+
+ 配列で与えたn要素の配列を生成する.
+
+rb_ary_to_ary(VALUE obj)
+
+ オブジェクトを配列に変換する.
+ Object#to_aryと同等である.
+
+他にも配列を操作する関数が多数ある. これらは
+引数aryに配列を渡さなければならない. さもないと
+コアを吐く.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary)
+
+ Array#[]と同等.
+
+rb_ary_entry(VALUE ary, long offset)
+
+ ary[offset]
+
+rb_ary_subseq(VALUE ary, long beg, long len)
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val)
+rb_ary_pop(VALUE ary)
+rb_ary_shift(VALUE ary)
+rb_ary_unshift(VALUE ary, VALUE val)
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ 配列aryにptrからlen個のオブジェクトを追加する.
+
+= Rubyの機能を使う
+
+原理的にRubyで書けることはCでも書けます.RubyそのものがCで記
+述されているんですから,当然といえば当然なんですけど.ここで
+はRubyの拡張に使うことが多いだろうと予測される機能を中心に紹
+介します.
+
+== Rubyに機能を追加する
+
+Rubyで提供されている関数を使えばRubyインタプリタに新しい機能
+を追加することができます.Rubyでは以下の機能を追加する関数が
+提供されています.
+
+* クラス,モジュール
+* メソッド,特異メソッドなど
+* 定数
+
+では順に紹介します.
+
+=== クラス/モジュール定義
+
+クラスやモジュールを定義するためには,以下の関数を使います.
+
+ VALUE rb_define_class(const char *name, VALUE super)
+ VALUE rb_define_module(const char *name)
+
+これらの関数は新しく定義されたクラスやモジュールを返します.
+メソッドや定数の定義にこれらの値が必要なので,ほとんどの場合
+は戻り値を変数に格納しておく必要があるでしょう.
+
+クラスやモジュールを他のクラスの内部にネストして定義する時に
+は以下の関数を使います.
+
+ VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
+ VALUE rb_define_module_under(VALUE outer, const char *name)
+
+=== メソッド/特異メソッド定義
+
+メソッドや特異メソッドを定義するには以下の関数を使います.
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
+
+
+念のため説明すると「特異メソッド」とは,その特定のオブジェク
+トに対してだけ有効なメソッドです.RubyではよくSmalltalkにお
+けるクラスメソッドとして,クラスに対する特異メソッドが使われ
+ます.
+
+これらの関数の argcという引数はCの関数へ渡される引数の数(と
+形式)を決めます.argcが0以上の時は関数に引き渡す引数の数を意
+味します.16個以上の引数は使えません(が,要りませんよね,そ
+んなに).実際の関数には先頭の引数としてselfが与えられますの
+で,指定した数より1多い引数を持つことになります.
+
+argcが負の時は引数の数ではなく,形式を指定したことになります.
+argcが-1の時は引数を配列に入れて渡されます.argcが-2の時は引
+数はRubyの配列として渡されます.
+
+メソッドを定義する関数はまだいくつかあります. ひとつはメソッド
+名としてIDを取ります. IDについては2.2.2を参照.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+private/protectedなメソッドを定義するふたつの関数があります.
+
+ void rb_define_private_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ
+ドです.
+
+最後に, rb_define_module関数はモジュール関数を定義します.
+モジュール関数とはモジュールの特異メソッドであり,同時に
+privateメソッドでもあるものです.例をあげるとMathモジュール
+のsqrt()などがあげられます.このメソッドは
+
+ Math.sqrt(4)
+
+という形式でも
+
+ include Math
+ sqrt(4)
+
+という形式でも使えます.モジュール関数を定義する関数は以下の
+通りです.
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+関数的メソッド(Kernelモジュールのprivate method)を定義するた
+めの関数は以下の通りです.
+
+ void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
+
+
+メソッドの別名を定義するための関数は以下の通りです.
+
+ void rb_define_alias(VALUE module, const char* new, const char* old);
+
+属性の取得・設定メソッドを定義するには
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+クラスメソッドallocateを定義したり削除したりするための関数は
+以下の通りです.
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+funcはクラスを引数として受け取って,新しく割り当てられたイン
+スタンスを返さなくてはなりません.このインスタンスは,外部リ
+ソースなどを含まない,できるだけ「空」のままにしておいたほう
+がよいでしょう.
+
+=== 定数定義
+
+拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い
+でしょう.定数を定義する関数は二つあります.
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+前者は特定のクラス/モジュールに属する定数を定義するもの,後
+者はグローバルな定数を定義するものです.
+
+== Rubyの機能をCから呼び出す
+
+既に『1.5 Rubyのデータを操作する』で一部紹介したような関数を
+使えば,Rubyの機能を実現している関数を直接呼び出すことが出来
+ます.
+
+# このような関数の一覧表はいまのところありません.ソースを見
+# るしかないですね.
+
+それ以外にもRubyの機能を呼び出す方法はいくつかあります.
+
+=== Rubyのプログラムをevalする
+
+CからRubyの機能を呼び出すもっとも簡単な方法として,文字列で
+与えられたRubyのプログラムを評価する以下の関数があります.
+
+ VALUE rb_eval_string(const char *str)
+
+この評価は現在の環境で行われます.つまり,現在のローカル変数
+などを受け継ぎます.
+
+評価は例外を発生するかもしれないことに注意しましょう. より安全
+な関数もあります.
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+この関数はエラーが発生するとnilを返します.そして,成功時には
+*stateはゼロに,さもなくば非ゼロになります.
+
+=== IDまたはシンボル
+
+Cから文字列を経由せずにRubyのメソッドを呼び出すこともできま
+す.その前に,Rubyインタプリタ内でメソッドや変数名を指定する
+時に使われているIDについて説明しておきましょう.
+
+IDとは変数名,メソッド名を表す整数です.Rubyの中では
+
+ :識別子
+
+または
+
+ :"任意の文字列"
+
+でアクセスできます.Cからこの整数を得るためには関数
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
+
+を使います.Rubyから引数として与えられたシンボル(または文字
+列)をIDに変換するには以下の関数を使います.
+
+ rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+もし引数がシンボルでも文字列でもなければ、to_strメソッドで文
+字列に変換しようとします.第二の関数はその変換結果を*nameに保
+存し,その名前が既知のシンボルでない場合は0を返します.この関
+数が0以外を返した場合は*nameは常にシンボルか文字列であり、0を
+返した場合は常に文字列です.第三の関数はRubyの文字列ではなく
+NUL終端されたCの文字列を使います.
+
+=== CからRubyのメソッドを呼び出す
+
+Cから文字列を経由せずにRubyのメソッドを呼び出すためには以下
+の関数を使います.
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+この関数はオブジェクトrecvのmidで指定されるメソッドを呼び出
+します.その他に引数の指定の仕方が違う以下の関数もあります.
+
+ VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_apply(VALUE recv, ID mid, VALUE args)
+
+applyには引数としてRubyの配列を与えます.
+
+=== 変数/定数を参照/更新する
+
+Cから関数を使って参照・更新できるのは,定数,インスタンス変
+数です.大域変数は一部のものはCの大域変数としてアクセスでき
+ます.ローカル変数を参照する方法は公開していません.
+
+オブジェクトのインスタンス変数を参照・更新する関数は以下の通
+りです.
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+idはrb_intern()で得られるものを使ってください.
+
+定数を参照するには以下の関数を使ってください.
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+定数を新しく定義するためには『2.1.3 定数定義』で紹介さ
+れている関数を使ってください.
+
+= RubyとCとの情報共有
+
+C言語とRubyの間で情報を共有する方法について解説します.
+
+== Cから参照できるRubyの定数
+
+以下のRubyの定数はCのレベルから参照できます.
+
+ Qtrue
+ Qfalse
+
+真偽値.QfalseはC言語でも偽とみなされます(つまり0).
+
+ Qnil
+
+C言語から見た「nil」.
+
+== CとRubyで共有される大域変数
+
+CとRubyで大域変数を使って情報を共有できます.共有できる大域
+変数にはいくつかの種類があります.そのなかでもっとも良く使わ
+れると思われるのはrb_define_variable()です.
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+この関数はRubyとCとで共有する大域変数を定義します.変数名が
+`$'で始まらない時には自動的に追加されます.この変数の値を変
+更すると自動的にRubyの対応する変数の値も変わります.
+
+またRuby側からは更新できない変数もあります.このread onlyの
+変数は以下の関数で定義します.
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+これら変数の他にhookをつけた大域変数を定義できます.hook付き
+の大域変数は以下の関数を用いて定義します.hook付き大域変数の
+値の参照や設定はhookで行う必要があります.
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+この関数はCの関数によってhookのつけられた大域変数を定義しま
+す.変数が参照された時には関数getterが,変数に値がセットされ
+た時には関数setterが呼ばれる.hookを指定しない場合はgetterや
+setterに0を指定します.
+# getterもsetterも0ならばrb_define_variable()と同じになる.
+
+getterとsetterの仕様は次の通りです.
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+
+それから,対応するCの変数を持たないRubyの大域変数を定義する
+こともできます. その変数の値はフック関数のみによって取得・設定
+されます.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+この関数によって定義されたRubyの大域変数が参照された時には
+getterが,変数に値がセットされた時にはsetterが呼ばれます.
+
+getterとsetterの仕様は以下の通りです.
+
+ (*getter)(ID id);
+ (*setter)(VALUE val, ID id);
+
+== CのデータをRubyオブジェクトにする
+
+Cの世界で定義されたデータ(構造体)をRubyのオブジェクトとして
+取り扱いたい場合がありえます.このような場合には,Dataという
+RubyオブジェクトにCの構造体(へのポインタ)をくるむことでRuby
+オブジェクトとして取り扱えるようになります.
+
+Dataオブジェクトを生成して構造体をRubyオブジェクトにカプセル
+化するためには,以下のマクロを使います.
+
+ Data_Wrap_Struct(klass, mark, free, sval)
+
+このマクロの戻り値は生成されたDataオブジェクトです.
+
+klassはこのDataオブジェクトのクラスです.ptrはカプセル化する
+Cの構造体へのポインタです.markはこの構造体がRubyのオブジェ
+クトへの参照がある時に使う関数です.そのような参照を含まない
+時には0を指定します.
+
+# そのような参照は勧められません.
+
+freeはこの構造体がもう不要になった時に呼ばれる関数です.この
+関数がガーベージコレクタから呼ばれます.これが-1の場合は,単
+純に開放されます.
+
+markおよびfree関数はGC実行中に呼び出されます.
+なお, GC実行中はRubyオブジェクトのアロケーションは禁止されま
+す. よって, markおよびfree関数でRubyオブジェクトのアロケーシ
+ョンは行わないでください.
+
+Cの構造体の割当とDataオブジェクトの生成を同時に行うマクロと
+して以下のものが提供されています.
+
+ Data_Make_Struct(klass, type, mark, free, sval)
+
+このマクロの戻り値は生成されたDataオブジェクトです.
+
+klass, mark, freeはData_Wrap_Structと同じ働きをします.type
+は割り当てるC構造体の型です.割り当てられた構造体は変数sval
+に代入されます.この変数の型は (type*) である必要があります.
+
+Dataオブジェクトからポインタを取り出すのは以下のマクロを用い
+ます.
+
+ Data_Get_Struct(obj, type, sval)
+
+Cの構造体へのポインタは変数svalに代入されます.
+
+これらのDataの使い方はちょっと分かりにくいので,後で説明する
+例題を参照してください.
+
+= 例題 - dbmパッケージを作る
+
+ここまでの説明でとりあえず拡張ライブラリは作れるはずです.
+Rubyのextディレクトリにすでに含まれているdbmライブラリを例に
+して段階的に説明します.
+
+== ディレクトリを作る
+
+ % mkdir ext/dbm
+
+Ruby 1.1からは任意のディレクトリでダイナミックライブラリを作
+ることができるようになりました.Rubyに静的にリンクする場合に
+はRubyを展開したディレクトリの下,extディレクトリの中に拡張
+ライブラリ用のディレクトリを作る必要があります.名前は適当に
+選んで構いません.
+
+== 設計する
+
+まあ,当然なんですけど,どういう機能を実現するかどうかまず設
+計する必要があります.どんなクラスをつくるか,そのクラスには
+どんなメソッドがあるか,クラスが提供する定数などについて設計
+します.
+
+== Cコードを書く
+
+拡張ライブラリ本体となるC言語のソースを書きます.C言語のソー
+スがひとつの時には「ライブラリ名.c」を選ぶと良いでしょう.C
+言語のソースが複数の場合には逆に「ライブラリ名.c」というファ
+イル名は避ける必要があります.オブジェクトファイルとモジュー
+ル生成時に中間的に生成される「ライブラリ名.o」というファイル
+とが衝突するからです.また,後述する mkmf ライブラリのいくつ
+かの関数がコンパイルを要するテストのために「conftest.c」とい
+うファイル名を使用することに注意してください.ソースファイル
+名として「conftest.c」を使用してはなりません.
+
+Rubyは拡張ライブラリをロードする時に「Init_ライブラリ名」と
+いう関数を自動的に実行します.dbmライブラリの場合「Init_dbm」
+です.この関数の中でクラス,モジュール,メソッド,定数などの
+定義を行います.dbm.cから一部引用します.
+
+ void
+ Init_dbm(void)
+ {
+ /* DBMクラスを定義する */
+ cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBMはEnumerateモジュールをインクルードする */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBMクラスのクラスメソッドopen(): 引数はCの配列で受ける */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBMクラスのメソッドclose(): 引数はなし */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBMクラスのメソッド[]: 引数は1個 */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* DBMデータを格納するインスタンス変数名のためのID */
+ id_dbm = rb_intern("dbm");
+ }
+
+DBMライブラリはdbmのデータと対応するオブジェクトになるはずで
+すから,Cの世界のdbmをRubyの世界に取り込む必要があります.
+
+dbm.cではData_Make_Structを以下のように使っています.
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+
+ obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
+
+ここではdbmstruct構造体へのポインタをDataにカプセル化してい
+ます.DBM*を直接カプセル化しないのはclose()した時の処理を考
+えてのことです.
+
+Dataオブジェクトからdbmstruct構造体のポインタを取り出すため
+に以下のマクロを使っています.
+
+ #define GetDBM(obj, dbmp) {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ if (dbmp->di_dbm == 0) closed_dbm();\
+ }
+
+ちょっと複雑なマクロですが,要するにdbmdata構造体のポインタ
+の取り出しと,closeされているかどうかのチェックをまとめてい
+るだけです.
+
+DBMクラスにはたくさんメソッドがありますが,分類すると3種類の
+引数の受け方があります.ひとつは引数の数が固定のもので,例と
+してはdeleteメソッドがあります.deleteメソッドを実装している
+fdbm_delete()はこのようになっています.
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+引数の数が固定のタイプは第1引数がself,第2引数以降がメソッド
+の引数となります.
+
+引数の数が不定のものはCの配列で受けるものとRubyの配列で受け
+るものとがあります.dbmライブラリの中で,Cの配列で受けるもの
+はDBMのクラスメソッドであるopen()です.これを実装している関
+数fdbm_s_open()はこうなっています.
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+
+ /* ... */
+ }
+
+このタイプの関数は第1引数が与えられた引数の数,第2引数が与え
+られた引数の入っている配列になります.selfは第3引数として与
+えられます.
+
+この配列で与えられた引数を解析するための関数がopen()でも使わ
+れているrb_scan_args()です.第3引数に指定したフォーマットに従
+い,第4変数以降に指定したVALUEへの参照に値を代入してくれま
+す.
+
+
+引数をRubyの配列として受け取るメソッドの例には
+Thread#initializeがあります.実装はこうです.
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+第1引数はself,第2引数はRubyの配列です.
+
+*注意事項*
+
+Rubyと共有はしないがRubyのオブジェクトを格納する可能性のある
+Cの大域変数は以下の関数を使ってRubyインタプリタに変数の存在
+を教えてあげてください.でないとGCでトラブルを起こします.
+
+ void rb_global_variable(VALUE *var)
+
+== extconf.rbを用意する
+
+Makefileを作る場合の雛型になるextconf.rbというファイルを作り
+ます.extconf.rbはライブラリのコンパイルに必要な条件のチェッ
+クなどを行うことが目的です.まず,
+
+ require 'mkmf'
+
+をextconf.rbの先頭に置きます.extconf.rbの中では以下のRuby関
+数を使うことが出来ます.
+
+ have_library(lib, func): ライブラリの存在チェック
+ have_func(func, header): 関数の存在チェック
+ have_header(header): ヘッダファイルの存在チェック
+ create_makefile(target[, target_prefix]): Makefileの生成
+
+以下の変数を使うことができます.
+
+ $CFLAGS: コンパイル時に追加的に指定するフラグ(-Oなど)
+ $CPPFLAGS: プリプロセッサに追加的に指定するフラグ(-Iや-Dなど)
+ $LDFLAGS: リンク時に追加的に指定するフラグ(-Lなど)
+ $objs: リンクされるオブジェクトファイル名のリスト
+
+オブジェクトファイルのリストは,通常はソースファイルを検索し
+て自動的に生成されますが,makeの途中でソースを生成するような
+場合は明示的に指定する必要があります.
+
+ライブラリをコンパイルする条件が揃わず,そのライブラリをコン
+パイルしない時にはcreate_makefileを呼ばなければMakefileは生
+成されず,コンパイルも行われません.
+
+== dependを用意する
+
+もし,ディレクトリにdependというファイルが存在すれば,
+Makefileが依存関係をチェックしてくれます.
+
+ % gcc -MM *.c > depend
+
+などで作ることが出来ます.あって損は無いでしょう.
+
+== Makefileを生成する
+
+Makefileを実際に生成するためには
+
+ ruby extconf.rb
+
+とします.extconf.rbに require 'mkmf' の行がない場合にはエラー
+になりますので,引数を追加して
+
+ ruby -r mkmf extconf.rb
+
+としてください.
+
+site_ruby ディレクトリでなく,
+vendor_ruby ディレクトリにインストールする場合には
+以下のように --vendor オプションを加えてください.
+
+ ruby extconf.rb --vendor
+
+ディレクトリをext以下に用意した場合にはRuby全体のmakeの時に
+自動的にMakefileが生成されますので,このステップは不要です.
+
+== makeする
+
+動的リンクライブラリを生成する場合にはその場でmakeしてくださ
+い.必要であれば make install でインストールされます.
+
+ext以下にディレクトリを用意した場合は,Rubyのディレクトリで
+makeを実行するとMakefileを生成からmake,必要によってはそのモ
+ジュールのRubyへのリンクまで自動的に実行してくれます.
+extconf.rbを書き換えるなどしてMakefileの再生成が必要な時はま
+たRubyディレクトリでmakeしてください.
+
+拡張ライブラリはmake installでRubyライブラリのディレクトリの
+下にコピーされます.もし拡張ライブラリと協調して使うRubyで記
+述されたプログラムがあり,Rubyライブラリに置きたい場合には,
+拡張ライブラリ用のディレクトリの下に lib というディレクトリ
+を作り,そこに 拡張子 .rb のファイルを置いておけば同時にイン
+ストールされます.
+
+== デバッグ
+
+まあ,デバッグしないと動かないでしょうね.ext/Setupにディレ
+クトリ名を書くと静的にリンクするのでデバッガが使えるようにな
+ります.その分コンパイルが遅くなりますけど.
+
+== できあがり
+
+後はこっそり使うなり,広く公開するなり,売るなり,ご自由にお
+使いください.Rubyの作者は拡張ライブラリに関して一切の権利を
+主張しません.
+
+= Appendix A. Rubyのソースコードの分類
+
+Rubyのソースはいくつかに分類することが出来ます.このうちクラ
+スライブラリの部分は基本的に拡張ライブラリと同じ作り方になっ
+ています.これらのソースは今までの説明でほとんど理解できると
+思います.
+
+== Ruby言語のコア
+
+class.c :: クラスとモジュール
+error.c :: 例外クラスと例外機構
+gc.c :: 記憶領域管理
+load.c :: ライブラリのロード
+object.c :: オブジェクト
+variable.c :: 変数と定数
+
+== Rubyの構文解析器
+
+ parse.y : 字句解析器と構文定義
+ -> parse.c : 自動生成
+ keywords : 予約語
+ -> lex.c : 自動生成
+
+== Rubyの評価器 (通称YARV)
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : 仮想機械語の定義
+ iseq.c : VM::ISeqの実装
+ thread.c : スレッド管理とコンテキスト切り替え
+ thread_win32.c : スレッド実装
+ thread_pthread.c : 同上
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ opt_insns_unif.def : 命令融合
+ opt_operand.def : 最適化のための定義
+
+ -> insn*.inc : 自動生成
+ -> opt*.inc : 自動生成
+ -> vm.inc : 自動生成
+
+== 正規表現エンジン (鬼車)
+
+ regex.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== ユーティリティ関数
+
+debug.c :: Cデバッガ用のデバッグシンボル
+dln.c :: 動的ローディング
+st.c :: 汎用ハッシュ表
+strftime.c :: 時刻整形
+util.c :: その他のユーティリティ
+
+== Rubyコマンドの実装
+
+ dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
+ inits.c
+ main.c
+ ruby.c
+ version.c
+
+ gem_prelude.rb
+ prelude.rb
+
+== クラスライブラリ
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: 乱数
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+defs/known_errors.def :: 例外クラス Errno::*
+-> known_errors.inc :: 自動生成
+
+== 多言語化
+
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: エンコーディングクラス群
+enc/trans/* :: コードポイント対応表
+
+== gorubyコマンドの実装
+
+ goruby.c
+ golf_prelude.rb : goruby固有のライブラリ
+ -> golf_prelude.c : 自動生成
+
+= Appendix B. 拡張用関数リファレンス
+
+C言語からRubyの機能を利用するAPIは以下の通りである.
+
+== 型
+
+VALUE ::
+
+ Rubyオブジェクトを表現する型.必要に応じてキャストして用いる.
+ 組み込み型を表現するCの型はruby.hに記述してあるRで始まる構造
+ 体である.VALUE型をこれらにキャストするためにRで始まる構造体
+ 名を全て大文字にした名前のマクロが用意されている.
+
+== 変数・定数
+
+Qnil ::
+
+ 定数: nilオブジェクト
+
+Qtrue ::
+
+ 定数: trueオブジェクト(真のデフォルト値)
+
+Qfalse ::
+
+ 定数: falseオブジェクト
+
+== Cデータのカプセル化
+
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
+
+ Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
+ のポインタがRubyからアクセスされなくなった時,freeで指定した
+ 関数が呼ばれる.また,このポインタの指すデータが他のRubyオブ
+ ジェクトを指している場合,markに指定する関数でマークする必要
+ がある.
+
+Data_Make_Struct(klass, type, mark, free, sval) ::
+
+ type型のメモリをmallocし,変数svalに代入した後,それをカプセ
+ ル化したデータを返すマクロ.
+
+Data_Get_Struct(data, type, sval) ::
+
+ dataからtype型のポインタを取り出し変数svalに代入するマクロ.
+
+== 型チェック
+
+ TYPE(value)
+ FIXNUM_P(value)
+ NIL_P(value)
+ void Check_Type(VALUE value, int type)
+ SafeStringValue(value)
+
+== 型変換
+
+ FIX2INT(value), INT2FIX(i)
+ FIX2LONG(value), LONG2FIX(l)
+ NUM2INT(value), INT2NUM(i)
+ NUM2UINT(value), UINT2NUM(ui)
+ NUM2LONG(value), LONG2NUM(l)
+ NUM2ULONG(value), ULONG2NUM(ul)
+ NUM2LL(value), LL2NUM(ll)
+ NUM2ULL(value), ULL2NUM(ull)
+ NUM2OFFT(value), OFFT2NUM(off)
+ NUM2SIZET(value), SIZET2NUM(size)
+ NUM2SSIZET(value), SSIZET2NUM(ssize)
+ NUM2DBL(value)
+ rb_float_new(f)
+ StringValue(value)
+ StringValuePtr(value)
+ StringValueCStr(value)
+ rb_str_new2(s)
+
+== クラス/モジュール定義
+
+VALUE rb_define_class(const char *name, VALUE super) ::
+
+ superのサブクラスとして新しいRubyクラスを定義する.
+
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
+
+ superのサブクラスとして新しいRubyクラスを定義し,moduleの
+ 定数として定義する.
+
+VALUE rb_define_module(const char *name) ::
+
+ 新しいRubyモジュールを定義する.
+
+VALUE rb_define_module_under(VALUE module, const char *name) ::
+
+ 新しいRubyモジュールを定義し,moduleの定数として定義する.
+
+void rb_include_module(VALUE klass, VALUE module) ::
+
+ モジュールをインクルードする.classがすでにmoduleをインク
+ ルードしている時には何もしない(多重インクルードの禁止).
+
+void rb_extend_object(VALUE object, VALUE module) ::
+
+ オブジェクトをモジュール(で定義されているメソッド)で拡張する.
+
+== 大域変数定義
+
+void rb_define_variable(const char *name, VALUE *var) ::
+
+ RubyとCとで共有するグローバル変数を定義する.変数名が`$'で
+ 始まらない時には自動的に追加される.nameとしてRubyの識別子
+ として許されない文字(例えば` ')を含む場合にはRubyプログラ
+ ムからは見えなくなる.
+
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
+
+ RubyとCとで共有するread onlyのグローバル変数を定義する.
+ read onlyであること以外はrb_define_variable()と同じ.
+
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数によって実現されるRuby変数を定義する.変数が参照された
+ 時にはgetterが,変数に値がセットされた時にはsetterが呼ばれ
+ る.
+
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数によってhookのつけられたグローバル変数を定義する.変数
+ が参照された時にはgetterが,関数に値がセットされた時には
+ setterが呼ばれる.getterやsetterに0を指定した時にはhookを
+ 指定しないのと同じ事になる.
+
+void rb_global_variable(VALUE *var)
+
+ GCのため,Rubyプログラムからはアクセスされないが, Rubyオブ
+ ジェクトを含む大域変数をマークする.
+
+== 定数
+
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
+
+ 定数を定義する.
+
+void rb_define_global_const(const char *name, VALUE val) ::
+
+ 大域定数を定義する.
+
+ rb_define_const(rb_cObject, name, val)
+
+ と同じ意味.
+
+== メソッド定義
+
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
+ 関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2
+ 引数とする形式で与えられる(第3引数はself).argcが-2の時,
+ 第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と
+ いう形式で与えられる.
+
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ privateメソッドを定義する.引数はrb_define_method()と同じ.
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ 特異メソッドを定義する.引数はrb_define_method()と同じ.
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ argc, argv形式で与えられた指定されたフォーマットに従って引
+ 数を分解し,続くVALUEへの参照にセットします.このフォーマッ
+ トは,ABNFで記述すると以下の通りです.
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; 先頭に置かれる省略不能な引数の数
+ num-of-optional-args := DIGIT ; 続いて置かれる省略可能な引数の数
+ sym-for-variable-length-args := "*" ; 続いて置かれる可変長引数を
+ ; Rubyの配列で取得するための指定
+ num-of-trailing-mandatory-args := DIGIT ; 終端に置かれる省略不能な引数の数
+ sym-for-option-hash-arg := ":" ; オプションハッシュを取得する
+ ; ための指定; 省略不能な引数の
+ ; 数よりも多くの引数が指定され,
+ ; 最後の引数がハッシュ(または
+ ; #to_hashで変換可能)の場合に
+ ; 取得される.最後の引数がnilの
+ ; 場合,可変長引数指定がなく,
+ ; 省略不能引数の数よりも多くの
+ ; 引数が指定された場合に取得される
+ sym-for-block-arg := "&" ; イテレータブロックを取得するための
+ ; 指定
+
+ フォーマットが"12"の場合,引数は最低1つで,3つ(1+2)まで許さ
+ れるという意味になります.従って,フォーマット文字列に続い
+ て3つのVALUEへの参照を置く必要があります.それらには取得した
+ 変数がセットされます.変数への参照の代わりにNULLを指定する
+ こともでき,その場合は取得した引数の値は捨てられます.なお,
+ 省略可能引数が省略された時の変数の値はnil(C言語のレベルでは
+ Qnil)になります.
+
+ 返り値は与えられた引数の数です.オプションハッシュおよびイ
+ テレータブロックは数えません.
+
+== Rubyメソッド呼び出し
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ メソッド呼び出し.文字列からmidを得るためにはrb_intern()を
+ 使う.
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼び出し.引数をargc, argv形式で渡す.
+
+VALUE rb_eval_string(const char *str)
+
+ 文字列をRubyスクリプトとしてコンパイル・実行する.
+
+ID rb_intern(const char *name) ::
+
+ 文字列に対応するIDを返す.
+
+char *rb_id2name(ID id) ::
+
+ IDに対応する文字列を返す(デバッグ用).
+
+char *rb_class2name(VALUE klass) ::
+
+ クラスの名前を返す(デバッグ用).クラスが名前を持たない時に
+ は, 祖先を遡って名前を持つクラスの名前を返す.
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ objがidで示されるメソッドを持つかどうかを返す.
+
+== インスタンス変数
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ objのインスタンス変数の値を得る.`@'で始まらないインスタン
+ ス変数は Rubyプログラムからアクセスできない「隠れた」イン
+ スタンス変数になる.定数は大文字の名前を持つクラス(または
+ モジュール)のインスタンス変数として実装されている.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ objのインスタンス変数をvalにセットする.
+
+== 制御構造
+
+VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ funcをブロックとして設定し,objをレシーバ,argcとargvを引数
+ としてmidメソッドを呼び出す.funcは第一引数にyieldされた値,
+ 第二引数にdata2を受け取る.複数の値がyieldされた場合(Cでは
+ rb_yield_values()とrb_yield_values2(), rb_yield_splat()),
+ data2はArrayとしてパックされている.第三, 第四引数のargcと
+ argvによってyieldされた値を取り出すことができる.
+
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ func2をブロックとして設定し, func1をイテレータとして呼ぶ.
+ func1には arg1が引数として渡され, func2には第1引数にイテレー
+ タから与えられた値, 第2引数にarg2が渡される.
+
+ 1.9でrb_iterateを使う場合は, func1の中でRubyレベルのメソッド
+ を呼び出さなければならない.
+ 1.9でobsoleteとなった. 代わりにrb_block_callが用意された.
+
+VALUE rb_yield(VALUE val) ::
+
+ valを値としてイテレータブロックを呼び出す.
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生
+ した時には func2をarg2を引数として呼ぶ.戻り値は例外が発生
+ しなかった時はfunc1の戻り値, 例外が発生した時にはfunc2の戻
+ り値である.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1をarg1を引数として実行し, 実行終了後(たとえ例外が
+ 発生しても) func2をarg2を引数として実行する.戻り値はfunc1
+ の戻り値である(例外が発生した時は戻らない).
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ 関数funcをargを引数として実行し, 例外が発生しなければその戻
+ り値を返す.例外が発生した場合は, *stateに非0をセットして
+ Qnilを返す.
+ rb_jump_tag()を呼ばずに捕捉した例外を無視する場合には,
+ rb_set_errinfo(Qnil)でエラー情報をクリアしなければならない.
+
+void rb_jump_tag(int state) ::
+
+ rb_protect()やrb_eval_string_protect()で捕捉された例外を再
+ 送する.stateはそれらの関数から返された値でなければならない.
+ この関数は直接の呼び出し元に戻らない.
+
+void rb_iter_break() ::
+
+ 現在の最も内側のブロックを終了する.この関数は直接の呼び出
+ し元に戻らない.
+
+void rb_iter_break_value(VALUE value) ::
+
+ 現在の最も内側のブロックをvalueで終了する.ブロックは引数で
+ 与えられたvalueを返す.この関数は直接の呼び出し元に戻らない.
+
+== 例外・エラー
+
+void rb_warning(const char *fmt, ...) ::
+
+ rb_verbose時に標準エラー出力に警告情報を表示する.引数は
+ printf()と同じ.
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ RuntimeError例外を発生させる.引数はprintf()と同じ.
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ exceptionで指定した例外を発生させる.fmt以下の引数は
+ printf()と同じ.
+
+void rb_fatal(const char *fmt, ...) ::
+
+ 致命的例外を発生させる.通常の例外処理は行なわれず, インター
+ プリタが終了する(ただしensureで指定されたコードは終了前に
+ 実行される).
+
+void rb_bug(const char *fmt, ...) ::
+
+ インタープリタなどプログラムのバグでしか発生するはずのない
+ 状況の時呼ぶ.インタープリタはコアダンプし直ちに終了する.
+ 例外処理は一切行なわれない.
+
+== Rubyの初期化・実行
+
+Rubyをアプリケーションに埋め込む場合には以下のインタフェース
+を使う.通常の拡張ライブラリには必要ない.
+
+void ruby_init() ::
+
+ Rubyインタプリタの初期化を行なう.
+
+void ruby_options(int argc, char **argv) ::
+
+ Rubyインタプリタのコマンドライン引数の処理を行なう.
+
+void ruby_run() ::
+
+ Rubyインタプリタを実行する.
+
+void ruby_script(char *name) ::
+
+ Rubyのスクリプト名($0)を設定する.
+
+== インタプリタのイベントのフック
+
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
+
+指定されたインタプリタのイベントに対するフック関数を追加します.
+eventsは以下の値のorでなければなりません:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+rb_event_hook_func_tの定義は以下の通りです:
+
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
+
+rb_add_event_hook() の第3引数 data は,フック関数の第2引数と
+して渡されます.これは1.8では現在のNODEへのポインタでした.以
+下の RB_EVENT_HOOKS_HAVE_CALLBACK_DATA も参照してください.
+
+ int rb_remove_event_hook(rb_event_hook_func_t func)
+
+指定されたフック関数を削除します.
+
+== 互換性のためのマクロ
+
+APIの互換性をチェックするために以下のマクロがデフォルトで定義されています.
+
+NORETURN_STYLE_NEW ::
+
+ NORETURN マクロが関数型マクロとして定義されていることを意味する.
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ rb_define_alloc_func() 関数が提供されていること,つまり
+ allocation framework が使われることを意味する.
+ have_func("rb_define_alloc_func", "ruby.h")
+ の結果と同じ.
+
+HAVE_RB_REG_NEW_STR ::
+
+ StringオブジェクトからRegexpオブジェクトを作る
+ rb_reg_new_str() 関数が提供されていることを意味する.
+ have_func("rb_reg_new_str", "ruby.h").
+ の結果と同じ.
+
+HAVE_RB_IO_T ::
+
+ rb_io_t 型が提供されていることを意味する.
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ メソッド名を返すメソッド,Module#methods, #singleton_methods
+ などがSymbolを返すことを意味する.
+
+HAVE_RUBY_*_H ::
+
+ ruby.h で定義されている.対応するヘッダが提供されていること
+ を意味する.たとえば,HAVE_RUBY_ST_H が定義されている場合は
+ 単なる st.h ではなく ruby/st.h を使用する.
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ rb_add_event_hook() がフック関数に渡す data を第3引数として
+ 受け取ることを意味する.
+
+= Appendix C. extconf.rbで使える関数たち
+
+extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
+下の通りである.
+
+have_macro(macro, headers) ::
+
+ ヘッダファイルheaderをインクルードしてマクロmacroが定義さ
+ れているかどうかチェックする.マクロが定義されている時true
+ を返す.
+
+have_library(lib, func) ::
+
+ 関数funcを定義しているライブラリlibの存在をチェックする.
+ ライブラリが存在する時,trueを返す.
+
+find_library(lib, func, path...) ::
+
+ 関数funcを定義しているライブラリlibの存在を -Lpath を追加
+ しながらチェックする.ライブラリが見付かった時,trueを返す.
+
+have_func(func, header) ::
+
+ ヘッダファイルheaderをインクルードして関数funcの存在をチェ
+ ックする.funcが標準ではリンクされないライブラリ内のもので
+ ある時には先にhave_libraryでそのライブラリをチェックしてお
+ く事.関数が存在する時trueを返す.
+
+have_var(var, header) ::
+
+ ヘッダファイルheaderをインクルードして変数varの存在をチェッ
+ クする.varが標準ではリンクされないライブラリ内のものであ
+ る時には先にhave_libraryでそのライブラリをチェックしておく
+ 事.変数が存在する時trueを返す.
+
+have_header(header) ::
+
+ ヘッダファイルの存在をチェックする.ヘッダファイルが存在す
+ る時trueを返す.
+
+find_header(header, path...) ::
+
+ ヘッダファイルheaderの存在を -Ipath を追加しながらチェック
+ する.ヘッダファイルが見付かった時,trueを返す.
+
+have_struct_member(type, member[, header[, opt]]) ::
+
+ ヘッダファイルheaderをインクルードして型typeにメンバmember
+ が存在するかをチェックする.typeが定義されていて,memberを
+ 持つする時trueを返す.
+
+have_type(type, header, opt) ::
+
+ ヘッダファイルheaderをインクルードして型typeが存在するかを
+ チェックする.typeが定義されている時trueを返す.
+
+check_sizeof(type, header) ::
+
+ ヘッダファイルheaderをインクルードして型typeのchar単位サイ
+ ズを調べる.typeが定義されている時そのサイズを返す.定義さ
+ れていないときはnilを返す.
+
+create_makefile(target[, target_prefix]) ::
+
+ 拡張ライブラリ用のMakefileを生成する.この関数を呼ばなけれ
+ ばそのライブラリはコンパイルされない.targetはモジュール名
+ を表す.
+
+find_executable(command, path) ::
+
+ コマンドcommandをFile::PATH_SEPARATORで区切られたパス名の
+ リストpathから探す.pathがnilまたは省略された場合は,環境
+ 変数PATHの値を使用する.実行可能なコマンドが見つかった場合
+ はパスを含むファイル名,見つからなかった場合はnilを返す.
+
+with_config(withval[, default=nil]) ::
+
+ コマンドライン上の--with-<withval>で指定されたオプション値
+ を得る.
+
+enable_config(config, *defaults) ::
+disable_config(config, *defaults) ::
+
+ コマンドライン上の--enable-<config>または
+ --disable-<config>で指定された真偽値を得る.
+ --enable-<config>が指定されていた場合はtrue,
+ --disable-<config>が指定されていた場合はfalseを返す.
+ どちらも指定されていない場合は,ブロックつきで呼び出されて
+ いる場合は*defaultsをyieldした結果,ブロックなしなら
+ *defaultsを返す.
+
+dir_config(target[, default_dir]) ::
+dir_config(target[, default_include, default_lib]) ::
+
+ コマンドライン上の--with-<target>-dir, --with-<target>-include,
+ --with-<target>-libのいずれかで指定されるディレクトリを
+ $CFLAGS や $LDFLAGS に追加する.--with-<target>-dir=/pathは
+ --with-<target>-include=/path/include --with-<target>-lib=/path/lib
+ と等価である.追加された include ディレクトリと lib ディレ
+ クトリの配列を返す. ([include_dir, lib_dir])
+
+pkg_config(pkg) ::
+
+ pkg-configコマンドからパッケージpkgの情報を得る.
+ pkg-configの実際のコマンド名は,--with-pkg-configコマンド
+ ラインオプションで指定可能.
+
+/*
+ * Local variables:
+ * fill-column: 60
+ * end:
+ */
diff --git a/README.ja b/README.ja
new file mode 100644
index 0000000000..03c007af7c
--- /dev/null
+++ b/README.ja
@@ -0,0 +1,192 @@
+= Rubyとは
+
+Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です.
+Rubyは最初から純粋なオブジェクト指向言語として設計されていま
+すから,オブジェクト指向プログラミングを手軽に行う事が出来ま
+す.もちろん通常の手続き型のプログラミングも可能です.
+
+Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい強力
+です.さらにシンプルな文法と,例外処理やイテレータなどの機構
+によって,より分かりやすいプログラミングが出来ます.
+
+
+== Rubyの特長
+
+* シンプルな文法
+* 普通のオブジェクト指向機能(クラス,メソッドコールなど)
+* 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
+* 演算子オーバーロード
+* 例外処理機能
+* イテレータとクロージャ
+* ガーベージコレクタ
+* ダイナミックローディング (アーキテクチャによる)
+* 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で
+ 動くだけでなく,Windows, Mac OS X,BeOSなどの上でも動く
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
+
+== 入手法
+
+=== FTPで
+
+以下の場所においてあります.
+
+ftp://ftp.ruby-lang.org/pub/ruby/
+
+=== Subversionで
+
+開発先端のソースコードは次のコマンドで取得できます.
+
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+
+他に開発中のブランチの一覧は次のコマンドで見られます.
+
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+
+=== Gitで
+
+SubversionのミラーをGitHubに公開しています.
+以下のコマンドでリポジトリを取得できます.
+
+ $ git clone git://github.com/ruby/ruby.git
+
+== ホームページ
+
+RubyのホームページのURLは
+
+http://www.ruby-lang.org/
+
+です.
+
+
+== メーリングリスト
+
+Rubyのメーリングリストがあります。参加希望の方は
+
+mailto:ruby-list-ctl@ruby-lang.org
+
+まで本文に
+
+ subscribe YourFirstName YourFamilyName
+
+と書いて送って下さい。
+
+Ruby開発者向けメーリングリストもあります。こちらではrubyのバ
+グ、将来の仕様拡張など実装上の問題について議論されています。
+参加希望の方は
+
+mailto:ruby-dev-ctl@ruby-lang.org
+
+までruby-listと同様の方法でメールしてください。
+
+Ruby拡張モジュールについて話し合うruby-extメーリングリストと
+数学関係の話題について話し合うruby-mathメーリングリストと
+英語で話し合うruby-talkメーリングリストもあります。参加方法
+はどれも同じです。
+
+
+== コンパイル・インストール
+
+以下の手順で行ってください.
+
+1. もし +configure+ ファイルが見つからない、もしくは
+ +configure.in+ より古いようなら、 +autoconf+ を実行して
+ 新しく +configure+ を生成する
+
+2. +configure+ を実行して +Makefile+ などを生成する
+
+ 環境によってはデフォルトのCコンパイラ用オプションが付き
+ ます. +configure+ オプションで <tt>optflags=..</tt> <tt>warnflags=..</tt> 等
+ で上書きできます.
+
+3. (必要ならば)+defines.h+ を編集する
+
+ 多分,必要無いと思います.
+
+4. (必要ならば)+ext/Setup+ に静的にリンクする拡張モジュールを
+ 指定する
+
+ +ext/Setup+ に記述したモジュールは静的にリンクされます.
+
+ ダイナミックローディングをサポートしていないアーキテク
+ チャでは +Setup+ の1行目の「<tt>option nodynamic</tt>」という行のコ
+ メントを外す必要があります.また,このアーキテクチャで
+ 拡張モジュールを利用するためには,あらかじめ静的にリン
+ クしておく必要があります.
+
+5. +make+ を実行してコンパイルする
+
+6. <tt>make check</tt>でテストを行う.
+
+ 「<tt>check succeeded</tt>」と表示されれば成功です.ただしテスト
+ に成功しても完璧だと保証されている訳ではありません.
+
+7. <tt>make install</tt>
+
+ 以下のディレクトリを作って,そこにファイルをインストー
+ ルします.
+
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ RubyのAPIバージョンが'_x.y.z_'であれば,<tt>${MAJOR}</tt>は
+ '_x_'で,<tt>${MINOR}</tt>は'_y_',<tt>${TEENY}</tt>は'_z_'です.
+
+ <b>注意</b>: APIバージョンの +teeny+ は,Rubyプログラムのバージョ
+ ンとは異なることがあります.
+
+ +root+ で作業する必要があるかもしれません.
+
+もし,コンパイル時にエラーが発生した場合にはエラーのログとマ
+シン,OSの種類を含むできるだけ詳しいレポートを作者に送ってく
+ださると他の方のためにもなります.
+
+
+== 移植
+
+UNIXであれば +configure+ がほとんどの差異を吸収してくれるはずで
+すが,思わぬ見落としがあった場合(あるに違いない),作者にその
+ことをレポートすれば,解決できるかも知れません.
+
+アーキテクチャにもっとも依存するのはGC部です.RubyのGCは対象
+のアーキテクチャが<tt>setjmp()</tt>または<tt>getcontext()</tt>によって全てのレ
+ジスタを +jmp_buf+ や +ucontext_t+ に格納することと, +jmp_buf+ や
++ucontext_t+ とスタックが32bitアラインメントされていることを仮定
+しています.特に前者が成立しない場合の対応は非常に困難でしょう.
+後者の解決は比較的簡単で, +gc.c+ でスタックをマークしている
+部分にアラインメントのバイト数だけずらしてマークするコードを
+追加するだけで済みます.<tt>defined(\_\_mc68000\_\_)</tt>で括られてい
+る部分を参考にしてください.
+
+レジスタウィンドウを持つCPUでは,レジスタウィンドウをスタッ
+クにフラッシュするアセンブラコードを追加する必要があるかも知
+れません.
+
+
+== 配布条件
+
++COPYING.ja+ ファイルを参照してください。
+
+
+== 著者
+
+コメント,バグレポートその他は mailto:matz@ruby-lang.jp まで.
+-------------------------------------------------------
+created at: Thu Aug 3 11:57:36 JST 1995
+--
+Local variables:
+mode: rdoc
+end:
diff --git a/README.ja.md b/README.ja.md
deleted file mode 100644
index eee54a9171..0000000000
--- a/README.ja.md
+++ /dev/null
@@ -1,171 +0,0 @@
-# Rubyとは
-
-Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です. Rubyは純粋なオブジェクト指向言語として設計されているので,
-オブジェクト指向プログラミングを手軽に行う事が出来ます.もちろん普通の手続き型のプログラミングも可能です.
-
-Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい強力です.さらにシンプルな文法と,
-例外処理やイテレータなどの機構によって,より分かりやすいプログラミングが出来ます.
-
-## Rubyの特長
-
-* シンプルな文法
-* 普通のオブジェクト指向機能(クラス,メソッドコールなど)
-* 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
-* 演算子オーバーロード
-* 例外処理機能
-* イテレータとクロージャ
-* ガーベージコレクタ
-* ダイナミックローディング (アーキテクチャによる)
-* 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で動くだけでなく,Windows, Mac OS
- X,BeOSなどの上でも動く cf.
- http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
-
-
-## 入手法
-
-### FTPで
-
-以下の場所においてあります.
-
-ftp://ftp.ruby-lang.org/pub/ruby/
-
-### Subversionで
-
-開発先端のソースコードは次のコマンドで取得できます.
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-
-他に開発中のブランチの一覧は次のコマンドで見られます.
-
- $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
-
-### Gitで
-
-SubversionのミラーをGitHubに公開しています. 以下のコマンドでリポジトリを取得できます.
-
- $ git clone git://github.com/ruby/ruby.git
-
-## ホームページ
-
-RubyのホームページのURLは
-
-http://www.ruby-lang.org/
-
-です.
-
-## メーリングリスト
-
-Rubyのメーリングリストがあります.参加希望の方は
-
-mailto:ruby-list-request@ruby-lang.org
-
-まで本文に
-
- subscribe
-
-と書いて送って下さい.
-
-Ruby開発者向けメーリングリストもあります.こちらではrubyのバグ,将来の仕様拡張など実装上の問題について議論されています. 参加希望の方は
-
-mailto:ruby-dev-request@ruby-lang.org
-
-までruby-listと同様の方法でメールしてください.
-
-Ruby拡張モジュールについて話し合うruby-extメーリングリストと数学関係の話題について話し合うruby-mathメーリングリストと
-英語でrubyについて話し合うruby-talkメーリングリストもあります.参加方法はどれも同じです.
-
-## コンパイル・インストール
-
-以下の手順で行ってください.
-
-1. もし `configure` ファイルが見つからない,もしくは `configure.in` より古いようなら, `autoconf` を実行して
- 新しく `configure` を生成する
-
-2. `configure` を実行して `Makefile` などを生成する
-
- 環境によってはデフォルトのCコンパイラ用オプションが付きます. `configure` オプションで `optflags=..`
- `warnflags=..` 等で上書きできます.
-
-3. (必要ならば)`defines.h` を編集する
-
- 多分,必要無いと思います.
-
-4. (必要ならば)`ext/Setup` に静的にリンクする拡張モジュールを指定する
-
- `ext/Setup` に記述したモジュールは静的にリンクされます.
-
- ダイナミックローディングをサポートしていないアーキテクチャでは `Setup` の1行目の「`option nodynamic`」という行のコ
- メントを外す必要があります.また,このアーキテクチャで拡張モジュールを利用するためには,あらかじめ静的にリンクをしておく必要があります.
-
-5. `make` を実行してコンパイルする
-
-6. `make check`でテストを行う.
-
- 「`check succeeded`」と表示されれば成功です.ただしテストに成功しても完璧だと保証されている訳ではありません.
-
-7. `make install`
-
- 以下のディレクトリを作って,そこにファイルをインストー ルします.
-
- * `${DESTDIR}${prefix}/bin`
- * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib`
- * `${DESTDIR}${prefix}/lib/ruby`
- * `${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/share/man/man1`
- * `${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system`
-
-
- RubyのAPIバージョンが'*x.y.z*'であれば,`${MAJOR}`は
- '*x*'で,`${MINOR}`は'*y*',`${TEENY}`は'*z*'です.
-
- **注意**: APIバージョンの `teeny` は,Rubyプログラムのバージョンとは異なることがあります.
-
- `root` で作業する必要があるかもしれません.
-
-
-もし,コンパイル時にエラーが発生した場合にはエラーのログとマシン,OSの種類を含むできるだけ詳しいレポートを作者に送って下さると他の方のためにもなります.
-
-## 移植
-
-UNIXであれば `configure` がほとんどの差異を吸収してくれるはずですが,思わぬ見落としがあった場合(ある事が多い),作者にその
-ことを報告すれば,解決できる可能性があります.
-
-アーキテクチャにもっとも依存するのはGC部です.RubyのGCは対象
-のアーキテクチャが`setjmp()`または`getcontext()`によって全てのレジスタを `jmp_buf` や `ucontext_t`
-に格納することと, `jmp_buf` や `ucontext_t` とスタックが32bitアラインメントされていることを仮定
-しています.特に前者が成立しない場合の対応は非常に困難でしょう. 後者の解決は比較的簡単で, `gc.c` でスタックをマークしている
-部分にアラインメントのバイト数だけずらしてマークするコードを追加するだけで済みます.`defined(__mc68000__)`で括られてい
-る部分を参考にしてください.
-
-レジスタウィンドウを持つCPUでは,レジスタウィンドウをスタックにフラッシュするアセンブラコードを追加する必要があるかもしれません.
-
-## 配布条件
-
-`COPYING.ja` ファイルを参照してください.
-
-## フィードバック
-
-Rubyに関する質問は Ruby-Talk(英語)や Ruby-List(日本語) (https://www.ruby-lang.org/ja/community/mailing-lists) や,
-stackoverflow (http://ja.stackoverflow.com/) などのWebサイトに投稿してください.
-
-バグ報告は http://bugs.ruby-lang.org で受け付けています.
-
-
-## 著者
-
-Rubyのオリジナル版は,1995年にまつもとゆきひろ氏によって設計・開発されました.
-
-<mailto:matz@ruby-lang.org>
-
----
-created at: Thu Aug 3 11:57:36 JST 1995
diff --git a/README.md b/README.md
deleted file mode 100644
index 14fb7aa213..0000000000
--- a/README.md
+++ /dev/null
@@ -1,164 +0,0 @@
-# What's Ruby
-
-Ruby is the interpreted scripting language for quick and easy object-oriented
-programming. It has many features to process text files and to do system
-management tasks (as in Perl). It is simple, straight-forward, and
-extensible.
-
-## Features of Ruby
-
-* Simple Syntax
-* **Normal** Object-oriented Features (e.g. class, method calls)
-* **Advanced** Object-oriented Features (e.g. Mix-in, Singleton-method)
-* Operator Overloading
-* Exception Handling
-* Iterators and Closures
-* Garbage Collection
-* Dynamic Loading of Object Files (on some architectures)
-* Highly Portable (works on many Unix-like/POSIX compatible platforms as
- well as Windows, Mac OS X, BeOS, etc.) cf.
- http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
-
-
-## How to get Ruby
-
-For a complete list of ways to install Ruby, including using third-party tools
-like rvm, see:
-
-http://www.ruby-lang.org/en/downloads/
-
-The Ruby distribution files can be found on the following FTP site:
-
-ftp://ftp.ruby-lang.org/pub/ruby/
-
-The trunk of the Ruby source tree can be checked out with the following
-command:
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-
-Or if you are using git then use the following command:
-
- $ git clone git://github.com/ruby/ruby.git
-
-There are some other branches under development. Try the following command
-to see the list of branches:
-
- $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
-
-Or if you are using git then use the following command:
-
- $ git ls-remote git://github.com/ruby/ruby.git
-
-## Ruby home page
-
-The URL of the Ruby home page is:
-
-http://www.ruby-lang.org/
-
-## Mailing list
-
-There is a mailing list to talk about Ruby. To subscribe this list, please
-send the following phrase:
-
- subscribe
-
-in the mail body (not subject) to the address
-<mailto:ruby-talk-request@ruby-lang.org>.
-
-## How to compile and install
-
-This is what you need to do to compile and install Ruby:
-
-1. If you want to use Microsoft Visual C++ to compile ruby, read
- win32/README.win32 instead of this document.
-
-2. If `./configure` does not exist or is older than configure.in, run
- `autoconf` to (re)generate configure.
-
-3. Run `./configure`, which will generate `config.h` and `Makefile`.
-
- Some C compiler flags may be added by default depending on your
- environment. Specify `optflags=..` and `warnflags=..` as necessary to
- override them.
-
-4. Edit `defines.h` if you need. Usually this step will not be needed.
-
-5. Remove comment mark(`#`) before the module names from `ext/Setup` (or add
- module names if not present), if you want to link modules statically.
-
- If you don't want to compile non static extension modules (probably on
- architectures which do not allow dynamic loading), remove comment mark
- from the line "`#option nodynamic`" in `ext/Setup`.
-
- Usually this step will not be needed.
-
-6. Run `make`.
-
-7. Optionally, run '`make check`' to check whether the compiled Ruby
- interpreter works well. If you see the message "`check succeeded`", your
- ruby works as it should (hopefully).
-
-8. Run '`make install`'
-
- This command will create following directories and install files onto
- them.
-
- * `${DESTDIR}${prefix}/bin`
- * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib`
- * `${DESTDIR}${prefix}/lib/ruby`
- * `${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
- * `${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/share/man/man1`
- * `${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system`
-
-
- If Ruby's API version is '*x.y.z*', the `${MAJOR}` is '*x*', the
- `${MINOR}` is '*y*', and the `${TEENY}` is '*z*'.
-
- **NOTE**: teeny of the API version may be different from one of Ruby's
- program version
-
- You may have to be a super user to install ruby.
-
-
-If you fail to compile ruby, please send the detailed error report with the
-error log and machine/OS type, to help others.
-
-Some extension libraries may not get compiled because of lack of necessary
-external libraries and/or headers, then you will need to run '`make distclean-ext`'
-to remove old configuration after installing them in such case.
-
-## Copying
-
-See the file `COPYING`.
-
-## Feedback
-
-Questions about the Ruby language can be asked on the Ruby-Talk mailing list
-(http://www.ruby-lang.org/en/community/mailing-lists) or on websites like
-(http://stackoverflow.com).
-
-Bug reports should be filed at http://bugs.ruby-lang.org. Read [HowToReport] for more information.
-
-[HowToReport]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport
-
-##Contributing
-
-See the file `CONTRIBUTING.md`
-
-
-## The Author
-
-Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in
-1995.
-
-<mailto:matz@ruby-lang.org>
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index 30fccd52fe..0000000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- autoconf -*-
-
-AC_DEFUN([_COLORIZE_RESULT_PREPARE], [
- msg_checking= msg_result_yes= msg_result_no= msg_result_other= msg_reset=
- AS_IF([test "x${CONFIGURE_TTY}" = xyes -o -t 1], [
- msg_begin="`tput smso 2>/dev/null`"
- AS_CASE(["$msg_begin"], ['@<:@'*m],
- [msg_begin="`echo "$msg_begin" | sed ['s/[0-9]*m$//']`"
- msg_checking="${msg_begin}33m"
- AS_IF([test ${TEST_COLORS:+set}], [
- msg_result_yes=[`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`]
- msg_result_no=[`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`]
- msg_result_other=[`expr ":$TEST_COLORS:" : ".*:skip=\([^:]*\):"`]
- ])
- msg_result_yes="${msg_begin}${msg_result_yes:-32;1}m"
- msg_result_no="${msg_begin}${msg_result_no:-31;1}m"
- msg_result_other="${msg_begin}${msg_result_other:-33;1}m"
- msg_reset="${msg_begin}m"
- ])
- AS_UNSET(msg_begin)
- ])
- AS_REQUIRE_SHELL_FN([colorize_result],
- [AS_FUNCTION_DESCRIBE([colorize_result], [MSG], [Colorize result])],
- [AS_CASE(["$[]1"],
- [yes], [AS_ECHO(["${msg_result_yes}$[]1${msg_reset}]")],
- [no], [AS_ECHO(["${msg_result_no}$[]1${msg_reset}]")],
- [AS_ECHO(["${msg_result_other}$[]1${msg_reset}]")])])
-])
-
-AC_DEFUN([COLORIZE_RESULT], [AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
- AS_LITERAL_IF([$1],
- [m4_case([$1],
- [yes], [AS_ECHO(["${msg_result_yes}$1${msg_reset}"])],
- [no], [AS_ECHO(["${msg_result_no}$1${msg_reset}"])],
- [AS_ECHO(["${msg_result_other}$1${msg_reset}"])])],
- [colorize_result "$1"]) dnl
-])
-
-AC_DEFUN([AC_CHECKING],[dnl
-AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
-AS_MESSAGE([checking ${msg_checking}$1${msg_reset}...])])
-
-AC_DEFUN([AC_MSG_RESULT], [dnl
-{ _AS_ECHO_LOG([result: $1])
-COLORIZE_RESULT([$1]); dnl
-}])
diff --git a/addr2line.c b/addr2line.c
index c8faf48d62..04a48e751d 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -9,7 +9,6 @@
**********************************************************************/
#include "ruby/config.h"
-#include "ruby/missing.h"
#include "addr2line.h"
#include <stdio.h>
@@ -17,6 +16,11 @@
#ifdef USE_ELF
+#ifdef __OpenBSD__
+#include <elf_abi.h>
+#else
+#include <elf.h>
+#endif
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
@@ -28,12 +32,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#ifdef __OpenBSD__
-#include <elf_abi.h>
-#else
-#include <elf.h>
-#endif
-
/* Make alloca work the best possible way. */
#ifdef __GNUC__
# ifndef atarist
@@ -55,8 +53,11 @@ void *alloca();
# endif /* HAVE_ALLOCA_H */
#endif /* __GNUC__ */
-#ifdef HAVE_DLADDR
-# include <dlfcn.h>
+#ifdef HAVE_DL_ITERATE_PHDR
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+# endif
+# include <link.h>
#endif
#define DW_LNS_copy 0x01
@@ -85,38 +86,20 @@ void *alloca();
# define ElfW(x) Elf32##_##x
# endif
#endif
-#ifndef ELF_ST_TYPE
-# if SIZEOF_VOIDP == 8
-# define ELF_ST_TYPE ELF64_ST_TYPE
-# else
-# define ELF_ST_TYPE ELF32_ST_TYPE
-# endif
-#endif
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
-int kprintf(const char *fmt, ...);
-
typedef struct {
const char *dirname;
const char *filename;
- const char *path; /* object path */
int line;
- uintptr_t base_addr;
- uintptr_t saddr;
- const char *sname; /* function name */
-} line_info_t;
-typedef struct obj_info obj_info_t;
-struct obj_info {
- const char *path; /* object path */
int fd;
void *mapped;
size_t mapped_size;
- uintptr_t base_addr;
- obj_info_t *next;
-};
+ unsigned long base_addr;
+} line_info_t;
/* Avoid consuming stack as this module may be used from signal handler */
static char binary_filename[PATH_MAX];
@@ -170,7 +153,7 @@ get_nth_dirname(unsigned long dir, char *p)
while (*p) p++;
p++;
if (!*p) {
- kprintf("Unexpected directory number %lu in %s\n",
+ fprintf(stderr, "Unexpected directory number %lu in %s\n",
dir, binary_filename);
return "";
}
@@ -190,7 +173,7 @@ fill_filename(int file, char *include_directories, char *filenames,
filename = p;
if (!*p) {
/* Need to output binary file name? */
- kprintf("Unexpected file number %d in %s\n",
+ fprintf(stderr, "Unexpected file number %d in %s\n",
file, binary_filename);
return;
}
@@ -209,15 +192,34 @@ fill_filename(int file, char *include_directories, char *filenames,
}
}
+static int
+get_path_from_symbol(const char *symbol, const char **p, size_t *len)
+{
+ if (symbol[0] == '0') {
+ /* libexecinfo */
+ *p = strchr(symbol, '/');
+ if (*p == NULL) return 0;
+ *len = strlen(*p);
+ }
+ else {
+ /* glibc */
+ const char *q;
+ *p = symbol;
+ q = strchr(symbol, '(');
+ if (q == NULL) return 0;
+ *len = q - symbol;
+ }
+ return 1;
+}
+
static void
-fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
- char *include_directories, char *filenames,
- obj_info_t *obj, line_info_t *lines, int offset)
+fill_line(int num_traces, void **traces,
+ unsigned long addr, int file, int line,
+ char *include_directories, char *filenames, line_info_t *lines)
{
int i;
- addr += obj->base_addr;
- for (i = offset; i < num_traces; i++) {
- uintptr_t a = (uintptr_t)traces[i];
+ for (i = 0; i < num_traces; i++) {
+ unsigned long a = (unsigned long)traces[i] - lines[i].base_addr;
/* We assume one line code doesn't result >100 bytes of native code.
We may want more reliable way eventually... */
if (addr < a && a < addr + 100) {
@@ -228,8 +230,8 @@ fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
}
static void
-parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
- obj_info_t *obj, line_info_t *lines, int offset)
+parse_debug_line_cu(int num_traces, void **traces,
+ char **debug_line, line_info_t *lines)
{
char *p, *cu_end, *cu_start, *include_directories, *filenames;
unsigned long unit_length;
@@ -275,7 +277,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
is_stmt = default_is_stmt = *(unsigned char *)p;
p++;
- line_base = *(signed char *)p;
+ line_base = *(char *)p;
p++;
line_range = *(unsigned char *)p;
@@ -303,8 +305,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
#define FILL_LINE() \
do { \
fill_line(num_traces, traces, addr, file, line, \
- include_directories, filenames, \
- obj, lines, offset); \
+ include_directories, filenames, lines); \
/*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
@@ -374,7 +375,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
p += sizeof(unsigned long);
break;
case DW_LNE_define_file:
- kprintf("Unsupported operation in %s\n",
+ fprintf(stderr, "Unsupported operation in %s\n",
binary_filename);
break;
case DW_LNE_set_discriminator:
@@ -382,7 +383,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
uleb128(&p);
break;
default:
- kprintf("Unknown extended opcode: %d in %s\n",
+ fprintf(stderr, "Unknown extended opcode: %d in %s\n",
op, binary_filename);
}
break;
@@ -403,41 +404,32 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
static void
parse_debug_line(int num_traces, void **traces,
- char *debug_line, unsigned long size,
- obj_info_t *obj, line_info_t *lines, int offset)
+ char *debug_line, unsigned long size, line_info_t *lines)
{
char *debug_line_end = debug_line + size;
while (debug_line < debug_line_end) {
- parse_debug_line_cu(num_traces, traces, &debug_line, obj, lines, offset);
+ parse_debug_line_cu(num_traces, traces, &debug_line, lines);
}
if (debug_line != debug_line_end) {
- kprintf("Unexpected size of .debug_line in %s\n",
+ fprintf(stderr, "Unexpected size of .debug_line in %s\n",
binary_filename);
}
}
/* read file and fill lines */
-static uintptr_t
-fill_lines(int num_traces, void **traces, int check_debuglink,
- obj_info_t **objp, line_info_t *lines, int offset);
-
static void
-append_obj(obj_info_t **objp) {
- obj_info_t *newobj = calloc(1, sizeof(obj_info_t));
- if (*objp) (*objp)->next = newobj;
- *objp = newobj;
-}
+fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
+ line_info_t *current_line, line_info_t *lines);
static void
-follow_debuglink(char *debuglink, int num_traces, void **traces,
- obj_info_t **objp, line_info_t *lines, int offset)
+follow_debuglink(char *debuglink, int num_traces, void **traces, char **syms,
+ line_info_t *current_line, line_info_t *lines)
{
/* Ideally we should check 4 paths to follow gnu_debuglink,
but we handle only one case for now as this format is used
by some linux distributions. See GDB's info for detail. */
static const char global_debug_dir[] = "/usr/lib/debug";
char *p, *subdir;
- obj_info_t *o1 = *objp, *o2;
p = strrchr(binary_filename, '/');
if (!p) {
@@ -448,22 +440,22 @@ follow_debuglink(char *debuglink, int num_traces, void **traces,
subdir = (char *)alloca(strlen(binary_filename) + 1);
strcpy(subdir, binary_filename);
strcpy(binary_filename, global_debug_dir);
- strlcat(binary_filename, subdir, PATH_MAX);
- strlcat(binary_filename, debuglink, PATH_MAX);
-
- append_obj(objp);
- o2 = *objp;
- o2->base_addr = o1->base_addr;
- o2->path = o1->path;
- fill_lines(num_traces, traces, 0, objp, lines, offset);
+ strncat(binary_filename, subdir,
+ PATH_MAX - strlen(binary_filename) - 1);
+ strncat(binary_filename, debuglink,
+ PATH_MAX - strlen(binary_filename) - 1);
+
+ munmap(current_line->mapped, current_line->mapped_size);
+ close(current_line->fd);
+ fill_lines(num_traces, traces, syms, 0, current_line, lines);
}
/* read file and fill lines */
-static uintptr_t
-fill_lines(int num_traces, void **traces, int check_debuglink,
- obj_info_t **objp, line_info_t *lines, int offset)
+static void
+fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
+ line_info_t *current_line, line_info_t *lines)
{
- int i, j;
+ int i;
char *shstr;
char *section_name;
ElfW(Ehdr) *ehdr;
@@ -472,27 +464,23 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
int fd;
off_t filesize;
char *file;
- ElfW(Shdr) *symtab_shdr = NULL, *strtab_shdr = NULL;
- ElfW(Shdr) *dynsym_shdr = NULL, *dynstr_shdr = NULL;
- obj_info_t *obj = *objp;
- uintptr_t dladdr_fbase = 0;
fd = open(binary_filename, O_RDONLY);
if (fd < 0) {
- goto fail;
+ return;
}
filesize = lseek(fd, 0, SEEK_END);
if (filesize < 0) {
int e = errno;
close(fd);
- kprintf("lseek: %s\n", strerror(e));
- goto fail;
+ fprintf(stderr, "lseek: %s\n", strerror(e));
+ return;
}
#if SIZEOF_OFF_T > SIZEOF_SIZE_T
if (filesize > (off_t)SIZE_MAX) {
close(fd);
- kprintf("Too large file %s\n", binary_filename);
- goto fail;
+ fprintf(stderr, "Too large file %s\n", binary_filename);
+ return;
}
#endif
lseek(fd, 0, SEEK_SET);
@@ -501,8 +489,8 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
if (file == MAP_FAILED) {
int e = errno;
close(fd);
- kprintf("mmap: %s\n", strerror(e));
- goto fail;
+ fprintf(stderr, "mmap: %s\n", strerror(e));
+ return;
}
ehdr = (ElfW(Ehdr) *)file;
@@ -512,12 +500,21 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
* it match non-elf file.
*/
close(fd);
- goto fail;
+ return;
}
- obj->fd = fd;
- obj->mapped = file;
- obj->mapped_size = (size_t)filesize;
+ current_line->fd = fd;
+ current_line->mapped = file;
+ current_line->mapped_size = (size_t)filesize;
+
+ for (i = 0; i < num_traces; i++) {
+ const char *path;
+ size_t len;
+ if (get_path_from_symbol(syms[i], &path, &len) &&
+ !strncmp(path, binary_filename, len)) {
+ lines[i].line = -1;
+ }
+ }
shdr = (ElfW(Shdr) *)(file + ehdr->e_shoff);
@@ -526,88 +523,11 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
for (i = 0; i < ehdr->e_shnum; i++) {
section_name = shstr + shdr[i].sh_name;
- switch (shdr[i].sh_type) {
- case SHT_STRTAB:
- if (!strcmp(section_name, ".strtab")) {
- strtab_shdr = shdr + i;
- }
- else if (!strcmp(section_name, ".dynstr")) {
- dynstr_shdr = shdr + i;
- }
- break;
- case SHT_SYMTAB:
- /* if (!strcmp(section_name, ".symtab")) */
- symtab_shdr = shdr + i;
+ if (!strcmp(section_name, ".debug_line")) {
+ debug_line_shdr = shdr + i;
break;
- case SHT_DYNSYM:
- /* if (!strcmp(section_name, ".dynsym")) */
- dynsym_shdr = shdr + i;
- break;
- case SHT_PROGBITS:
- if (!strcmp(section_name, ".debug_line")) {
- debug_line_shdr = shdr + i;
- }
- else if (!strcmp(section_name, ".gnu_debuglink")) {
- gnu_debuglink_shdr = shdr + i;
- }
- break;
- }
- }
-
- if (offset == -1) {
- /* main executable */
- offset = 0;
- if (dynsym_shdr && dynstr_shdr) {
- char *strtab = file + dynstr_shdr->sh_offset;
- ElfW(Sym) *symtab = (ElfW(Sym) *)(file + dynsym_shdr->sh_offset);
- int symtab_count = (int)(dynsym_shdr->sh_size / sizeof(ElfW(Sym)));
- for (j = 0; j < symtab_count; j++) {
- ElfW(Sym) *sym = &symtab[j];
- Dl_info info;
- void *h, *s;
- if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
- h = dlopen(NULL, RTLD_NOW|RTLD_LOCAL);
- if (!h) continue;
- s = dlsym(h, strtab + sym->st_name);
- if (!s) continue;
- if (dladdr(s, &info)) {
- dladdr_fbase = (uintptr_t)info.dli_fbase;
- break;
- }
- }
- if (ehdr->e_type == ET_EXEC) {
- obj->base_addr = 0;
- }
- else {
- /* PIE (position-independent executable) */
- obj->base_addr = dladdr_fbase;
- }
- }
- }
-
- if (!symtab_shdr) {
- symtab_shdr = dynsym_shdr;
- strtab_shdr = dynstr_shdr;
- }
-
- if (symtab_shdr && strtab_shdr) {
- char *strtab = file + strtab_shdr->sh_offset;
- ElfW(Sym) *symtab = (ElfW(Sym) *)(file + symtab_shdr->sh_offset);
- int symtab_count = (int)(symtab_shdr->sh_size / sizeof(ElfW(Sym)));
- for (j = 0; j < symtab_count; j++) {
- ElfW(Sym) *sym = &symtab[j];
- uintptr_t saddr = (uintptr_t)sym->st_value + obj->base_addr;
- if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
- for (i = offset; i < num_traces; i++) {
- uintptr_t d = (uintptr_t)traces[i] - saddr;
- if (lines[i].line > 0 || d <= 0 || d > (uintptr_t)sym->st_size)
- continue;
- /* fill symbol name and addr from .symtab */
- lines[i].sname = strtab + sym->st_name;
- lines[i].saddr = saddr;
- lines[i].path = obj->path;
- lines[i].base_addr = obj->base_addr;
- }
+ } else if (!strcmp(section_name, ".gnu_debuglink")) {
+ gnu_debuglink_shdr = shdr + i;
}
}
@@ -616,593 +536,114 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
let's check .gnu_debuglink section instead. */
if (gnu_debuglink_shdr && check_debuglink) {
follow_debuglink(file + gnu_debuglink_shdr->sh_offset,
- num_traces, traces,
- objp, lines, offset);
+ num_traces, traces, syms,
+ current_line, lines);
}
- goto finish;
+ return;
}
parse_debug_line(num_traces, traces,
file + debug_line_shdr->sh_offset,
debug_line_shdr->sh_size,
- obj, lines, offset);
-finish:
- return dladdr_fbase;
-fail:
- return (uintptr_t)-1;
+ lines);
}
-#define HAVE_MAIN_EXE_PATH
-#if defined(__FreeBSD__)
-# include <sys/sysctl.h>
-#endif
-/* ssize_t main_exe_path(void)
- *
- * store the path of the main executable to `binary_filename`,
- * and returns strlen(binary_filename).
- * it is NUL terminated.
- */
-#if defined(__linux__)
-ssize_t
-main_exe_path(void)
-{
-# define PROC_SELF_EXE "/proc/self/exe"
- ssize_t len = readlink(PROC_SELF_EXE, binary_filename, PATH_MAX);
- binary_filename[len] = 0;
- return len;
-}
-#elif defined(__FreeBSD__)
-ssize_t
-main_exe_path(void)
+#ifdef HAVE_DL_ITERATE_PHDR
+
+typedef struct {
+ int num_traces;
+ char **syms;
+ line_info_t *lines;
+} fill_base_addr_state_t;
+
+static int
+fill_base_addr(struct dl_phdr_info *info, size_t size, void *data)
{
- int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
- size_t len = PATH_MAX;
- int err = sysctl(mib, 4, binary_filename, &len, NULL, 0);
- if (err) {
- kprintf("Can't get the path of ruby");
- return -1;
+ int i;
+ fill_base_addr_state_t *st = (fill_base_addr_state_t *)data;
+ for (i = 0; i < st->num_traces; i++) {
+ const char *path;
+ size_t len;
+ size_t name_len = strlen(info->dlpi_name);
+
+ if (get_path_from_symbol(st->syms[i], &path, &len) &&
+ (len == name_len || (len > name_len && path[len-name_len-1] == '/')) &&
+ !strncmp(path+len-name_len, info->dlpi_name, name_len)) {
+ st->lines[i].base_addr = info->dlpi_addr;
+ }
}
- len--; /* sysctl sets strlen+1 */
- return len;
+ return 0;
}
-#else
-#undef HAVE_MAIN_EXE_PATH
-#endif
+
+#endif /* HAVE_DL_ITERATE_PHDR */
void
-rb_dump_backtrace_with_lines(int num_traces, void **traces)
+rb_dump_backtrace_with_lines(int num_traces, void **trace, char **syms)
{
int i;
/* async-signal unsafe */
- line_info_t *lines = (line_info_t *)calloc(num_traces, sizeof(line_info_t));
- obj_info_t *obj = NULL;
- /* 2 is NULL + main executable */
- void **dladdr_fbases = (void **)calloc(num_traces+2, sizeof(void *));
-#ifdef HAVE_MAIN_EXE_PATH
- char *main_path = NULL; /* used on printing backtrace */
- ssize_t len;
- if ((len = main_exe_path()) > 0) {
- main_path = (char *)alloca(len + 1);
- if (main_path) {
- uintptr_t addr;
- memcpy(main_path, binary_filename, len+1);
- append_obj(&obj);
- obj->path = main_path;
- addr = fill_lines(num_traces, traces, 1, &obj, lines, -1);
- if (addr != (uintptr_t)-1) {
- dladdr_fbases[0] = (void *)addr;
- }
+ line_info_t *lines = (line_info_t *)calloc(num_traces,
+ sizeof(line_info_t));
+
+ /* Note that line info of shared objects might not be shown
+ if we don't have dl_iterate_phdr */
+#ifdef HAVE_DL_ITERATE_PHDR
+ fill_base_addr_state_t fill_base_addr_state;
+
+ fill_base_addr_state.num_traces = num_traces;
+ fill_base_addr_state.syms = syms;
+ fill_base_addr_state.lines = lines;
+ /* maybe async-signal unsafe */
+ dl_iterate_phdr(fill_base_addr, &fill_base_addr_state);
+#endif /* HAVE_DL_ITERATE_PHDR */
+
+ for (i = 0; i < num_traces; i++) {
+ const char *path;
+ size_t len;
+ if (lines[i].line) {
+ continue;
+ }
+
+ if (!get_path_from_symbol(syms[i], &path, &len)) {
+ continue;
}
+
+ strncpy(binary_filename, path, len);
+ binary_filename[len] = '\0';
+
+ fill_lines(num_traces, trace, syms, 1, &lines[i], lines);
}
-#endif
- /* fill source lines by reading dwarf */
+ /* fprintf may not be async-signal safe */
for (i = 0; i < num_traces; i++) {
- Dl_info info;
- if (lines[i].line) continue;
- if (dladdr(traces[i], &info)) {
- const char *path;
- void **p;
-
- /* skip symbols which is in already checked objects */
- /* if the binary is strip-ed, this may effect */
- for (p=dladdr_fbases; *p; p++) {
- if (*p == info.dli_fbase) {
- lines[i].path = info.dli_fname;
- lines[i].sname = info.dli_sname;
- goto next_line;
+ line_info_t *line = &lines[i];
+
+ if (line->line > 0) {
+ fprintf(stderr, "%s ", syms[i]);
+ if (line->filename) {
+ if (line->dirname && line->dirname[0]) {
+ fprintf(stderr, "%s/", line->dirname);
}
+ fprintf(stderr, "%s", line->filename);
+ } else {
+ fprintf(stderr, "???");
}
- *p = info.dli_fbase;
-
- append_obj(&obj);
- obj->base_addr = (uintptr_t)info.dli_fbase;
- path = info.dli_fname;
- obj->path = path;
- lines[i].path = path;
- strcpy(binary_filename, path);
- fill_lines(num_traces, traces, 1, &obj, lines, i);
+ fprintf(stderr, ":%d\n", line->line);
+ } else {
+ fprintf(stderr, "%s\n", syms[i]);
}
-next_line:
- continue;
}
- /* output */
for (i = 0; i < num_traces; i++) {
line_info_t *line = &lines[i];
- uintptr_t addr = (uintptr_t)traces[i];
- uintptr_t d = addr - line->saddr;
- if (!line->path) {
- kprintf("[0x%lx]\n", addr);
- }
- else if (!line->saddr || !line->sname) {
- kprintf("%s [0x%lx]\n", line->path, addr);
- }
- else if (line->line <= 0) {
- kprintf("%s(%s+0x%lx) [0x%lx]\n", line->path, line->sname,
- d, addr);
- }
- else if (!line->filename) {
- kprintf("%s(%s+0x%lx) [0x%lx] ???:%d\n", line->path, line->sname,
- d, addr, line->line);
- }
- else if (line->dirname && line->dirname[0]) {
- kprintf("%s(%s+0x%lx) [0x%lx] %s/%s:%d\n", line->path, line->sname,
- d, addr, line->dirname, line->filename, line->line);
- }
- else {
- kprintf("%s(%s+0x%lx) [0x%lx] %s:%d\n", line->path, line->sname,
- d, addr, line->filename, line->line);
- }
- /* FreeBSD's backtrace may show _start and so on */
- if (line->sname && strcmp("main", line->sname) == 0)
- break;
- }
-
- /* free */
- while (obj) {
- obj_info_t *o = obj;
- obj = o->next;
- if (o->fd) {
- munmap(o->mapped, o->mapped_size);
- close(o->fd);
+ if (line->fd) {
+ munmap(line->mapped, line->mapped_size);
+ close(line->fd);
}
- free(o);
}
free(lines);
- free(dladdr_fbases);
-}
-
-/* From FreeBSD's lib/libstand/printf.c */
-/*-
- * Copyright (c) 1986, 1988, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- */
-
-#include <stdarg.h>
-#define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1)
-extern int rb_toupper(int c);
-#define toupper(c) rb_toupper(c)
-#define hex2ascii(hex) (hex2ascii_data[hex])
-char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-static inline int imax(int a, int b) { return (a > b ? a : b); }
-static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap);
-
-static void putce(int c)
-{
- char s[1];
- ssize_t ret;
-
- s[0] = (char)c;
- ret = write(2, s, 1);
- (void)ret;
}
-int
-kprintf(const char *fmt, ...)
-{
- va_list ap;
- int retval;
-
- va_start(ap, fmt);
- retval = kvprintf(fmt, putce, NULL, 10, ap);
- va_end(ap);
- return retval;
-}
-
-/*
- * Put a NUL-terminated ASCII number (base <= 36) in a buffer in reverse
- * order; return an optional length and a pointer to the last character
- * written in the buffer (i.e., the first character of the string).
- * The buffer pointed to by `nbuf' must have length >= MAXNBUF.
- */
-static char *
-ksprintn(char *nbuf, uintmax_t num, int base, int *lenp, int upper)
-{
- char *p, c;
-
- p = nbuf;
- *p = '\0';
- do {
- c = hex2ascii(num % base);
- *++p = upper ? toupper(c) : c;
- } while (num /= base);
- if (lenp)
- *lenp = (int)(p - nbuf);
- return (p);
-}
-
-/*
- * Scaled down version of printf(3).
- *
- * Two additional formats:
- *
- * The format %b is supported to decode error registers.
- * Its usage is:
- *
- * printf("reg=%b\n", regval, "<base><arg>*");
- *
- * where <base> is the output base expressed as a control character, e.g.
- * \10 gives octal; \20 gives hex. Each arg is a sequence of characters,
- * the first of which gives the bit number to be inspected (origin 1), and
- * the next characters (up to a control character, i.e. a character <= 32),
- * give the name of the register. Thus:
- *
- * kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n");
- *
- * would produce output:
- *
- * reg=3<BITTWO,BITONE>
- *
- * XXX: %D -- Hexdump, takes pointer and separator string:
- * ("%6D", ptr, ":") -> XX:XX:XX:XX:XX:XX
- * ("%*D", len, ptr, " " -> XX XX XX XX ...
- */
-static int
-kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap)
-{
-#define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; }
- char nbuf[MAXNBUF];
- char *d;
- const char *p, *percent, *q;
- unsigned char *up;
- int ch, n;
- uintmax_t num;
- int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot;
- int cflag, hflag, jflag, tflag, zflag;
- int dwidth, upper;
- char padc;
- int stop = 0, retval = 0;
-
- num = 0;
- if (!func)
- d = (char *) arg;
- else
- d = NULL;
-
- if (fmt == NULL)
- fmt = "(fmt null)\n";
-
- if (radix < 2 || radix > 36)
- radix = 10;
-
- for (;;) {
- padc = ' ';
- width = 0;
- while ((ch = (unsigned char)*fmt++) != '%' || stop) {
- if (ch == '\0')
- return (retval);
- PCHAR(ch);
- }
- percent = fmt - 1;
- qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0;
- sign = 0; dot = 0; dwidth = 0; upper = 0;
- cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0;
-reswitch: switch (ch = (unsigned char)*fmt++) {
- case '.':
- dot = 1;
- goto reswitch;
- case '#':
- sharpflag = 1;
- goto reswitch;
- case '+':
- sign = 1;
- goto reswitch;
- case '-':
- ladjust = 1;
- goto reswitch;
- case '%':
- PCHAR(ch);
- break;
- case '*':
- if (!dot) {
- width = va_arg(ap, int);
- if (width < 0) {
- ladjust = !ladjust;
- width = -width;
- }
- } else {
- dwidth = va_arg(ap, int);
- }
- goto reswitch;
- case '0':
- if (!dot) {
- padc = '0';
- goto reswitch;
- }
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- for (n = 0;; ++fmt) {
- n = n * 10 + ch - '0';
- ch = *fmt;
- if (ch < '0' || ch > '9')
- break;
- }
- if (dot)
- dwidth = n;
- else
- width = n;
- goto reswitch;
- case 'b':
- num = (unsigned int)va_arg(ap, int);
- p = va_arg(ap, char *);
- for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;)
- PCHAR(*q--);
-
- if (num == 0)
- break;
-
- for (tmp = 0; *p;) {
- n = *p++;
- if (num & (1 << (n - 1))) {
- PCHAR(tmp ? ',' : '<');
- for (; (n = *p) > ' '; ++p)
- PCHAR(n);
- tmp = 1;
- } else
- for (; *p > ' '; ++p)
- continue;
- }
- if (tmp)
- PCHAR('>');
- break;
- case 'c':
- PCHAR(va_arg(ap, int));
- break;
- case 'D':
- up = va_arg(ap, unsigned char *);
- p = va_arg(ap, char *);
- if (!width)
- width = 16;
- while(width--) {
- PCHAR(hex2ascii(*up >> 4));
- PCHAR(hex2ascii(*up & 0x0f));
- up++;
- if (width)
- for (q=p;*q;q++)
- PCHAR(*q);
- }
- break;
- case 'd':
- case 'i':
- base = 10;
- sign = 1;
- goto handle_sign;
- case 'h':
- if (hflag) {
- hflag = 0;
- cflag = 1;
- } else
- hflag = 1;
- goto reswitch;
- case 'j':
- jflag = 1;
- goto reswitch;
- case 'l':
- if (lflag) {
- lflag = 0;
- qflag = 1;
- } else
- lflag = 1;
- goto reswitch;
- case 'n':
- if (jflag)
- *(va_arg(ap, intmax_t *)) = retval;
- else if (qflag)
- *(va_arg(ap, int64_t *)) = retval;
- else if (lflag)
- *(va_arg(ap, long *)) = retval;
- else if (zflag)
- *(va_arg(ap, size_t *)) = retval;
- else if (hflag)
- *(va_arg(ap, short *)) = retval;
- else if (cflag)
- *(va_arg(ap, char *)) = retval;
- else
- *(va_arg(ap, int *)) = retval;
- break;
- case 'o':
- base = 8;
- goto handle_nosign;
- case 'p':
- base = 16;
- sharpflag = (width == 0);
- sign = 0;
- num = (uintptr_t)va_arg(ap, void *);
- goto number;
- case 'q':
- qflag = 1;
- goto reswitch;
- case 'r':
- base = radix;
- if (sign)
- goto handle_sign;
- goto handle_nosign;
- case 's':
- p = va_arg(ap, char *);
- if (p == NULL)
- p = "(null)";
- if (!dot)
- n = (int)strlen (p);
- else
- for (n = 0; n < dwidth && p[n]; n++)
- continue;
-
- width -= n;
-
- if (!ladjust && width > 0)
- while (width--)
- PCHAR(padc);
- while (n--)
- PCHAR(*p++);
- if (ladjust && width > 0)
- while (width--)
- PCHAR(padc);
- break;
- case 't':
- tflag = 1;
- goto reswitch;
- case 'u':
- base = 10;
- goto handle_nosign;
- case 'X':
- upper = 1;
- case 'x':
- base = 16;
- goto handle_nosign;
- case 'y':
- base = 16;
- sign = 1;
- goto handle_sign;
- case 'z':
- zflag = 1;
- goto reswitch;
-handle_nosign:
- sign = 0;
- if (jflag)
- num = va_arg(ap, uintmax_t);
- else if (qflag)
- num = va_arg(ap, uint64_t);
- else if (tflag)
- num = va_arg(ap, ptrdiff_t);
- else if (lflag)
- num = va_arg(ap, unsigned long);
- else if (zflag)
- num = va_arg(ap, size_t);
- else if (hflag)
- num = (unsigned short)va_arg(ap, int);
- else if (cflag)
- num = (unsigned char)va_arg(ap, int);
- else
- num = va_arg(ap, unsigned int);
- goto number;
-handle_sign:
- if (jflag)
- num = va_arg(ap, intmax_t);
- else if (qflag)
- num = va_arg(ap, int64_t);
- else if (tflag)
- num = va_arg(ap, ptrdiff_t);
- else if (lflag)
- num = va_arg(ap, long);
- else if (zflag)
- num = va_arg(ap, ssize_t);
- else if (hflag)
- num = (short)va_arg(ap, int);
- else if (cflag)
- num = (char)va_arg(ap, int);
- else
- num = va_arg(ap, int);
-number:
- if (sign && (intmax_t)num < 0) {
- neg = 1;
- num = -(intmax_t)num;
- }
- p = ksprintn(nbuf, num, base, &n, upper);
- tmp = 0;
- if (sharpflag && num != 0) {
- if (base == 8)
- tmp++;
- else if (base == 16)
- tmp += 2;
- }
- if (neg)
- tmp++;
-
- if (!ladjust && padc == '0')
- dwidth = width - tmp;
- width -= tmp + imax(dwidth, n);
- dwidth -= n;
- if (!ladjust)
- while (width-- > 0)
- PCHAR(' ');
- if (neg)
- PCHAR('-');
- if (sharpflag && num != 0) {
- if (base == 8) {
- PCHAR('0');
- } else if (base == 16) {
- PCHAR('0');
- PCHAR('x');
- }
- }
- while (dwidth-- > 0)
- PCHAR('0');
-
- while (*p)
- PCHAR(*p--);
-
- if (ladjust)
- while (width-- > 0)
- PCHAR(' ');
-
- break;
- default:
- while (percent < fmt)
- PCHAR(*percent++);
- /*
- * Since we ignore an formatting argument it is no
- * longer safe to obey the remaining formatting
- * arguments as the arguments will no longer match
- * the format specs.
- */
- stop = 1;
- break;
- }
- }
-#undef PCHAR
-}
#else /* defined(USE_ELF) */
#error not supported
#endif
diff --git a/addr2line.h b/addr2line.h
index d99f010934..3782d89e07 100644
--- a/addr2line.h
+++ b/addr2line.h
@@ -14,7 +14,7 @@
#ifdef USE_ELF
void
-rb_dump_backtrace_with_lines(int num_traces, void **traces);
+rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms);
#endif /* USE_ELF */
diff --git a/array.c b/array.c
index 729de9c081..6f14b99933 100644
--- a/array.c
+++ b/array.c
@@ -11,9 +11,11 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/util.h"
#include "ruby/st.h"
+#include "ruby/encoding.h"
+#include "internal.h"
#include "probes.h"
#include "id.h"
@@ -22,6 +24,8 @@
#endif
#include <assert.h>
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+
VALUE rb_cArray;
static ID id_cmp, id_div, id_power;
@@ -29,6 +33,22 @@ static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
+void
+rb_mem_clear(register VALUE *mem, register long size)
+{
+ while (size--) {
+ *mem++ = Qnil;
+ }
+}
+
+static inline void
+memfill(register VALUE *mem, register long size, register VALUE val)
+{
+ while (size--) {
+ *mem++ = val;
+ }
+}
+
# define ARY_SHARED_P(ary) \
(assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
FL_TEST((ary),ELTS_SHARED)!=0)
@@ -43,11 +63,11 @@ static ID id_cmp, id_div, id_power;
(assert(ARY_EMBED_P(a)), \
(long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
(RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)))
-#define ARY_HEAP_SIZE(a) (assert(!ARY_EMBED_P(a)), assert(ARY_OWNS_HEAP_P(a)), RARRAY(a)->as.heap.aux.capa * sizeof(VALUE))
#define ARY_OWNS_HEAP_P(a) (!FL_TEST((a), ELTS_SHARED|RARRAY_EMBED_FLAG))
#define FL_SET_EMBED(a) do { \
assert(!ARY_SHARED_P(a)); \
+ assert(!OBJ_FROZEN(a)); \
FL_SET((a), RARRAY_EMBED_FLAG); \
} while (0)
#define FL_UNSET_EMBED(ary) FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
@@ -108,18 +128,15 @@ static ID id_cmp, id_div, id_power;
#define ARY_SHARED(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared)
#define ARY_SET_SHARED(ary, value) do { \
- const VALUE _ary_ = (ary); \
- const VALUE _value_ = (value); \
- assert(!ARY_EMBED_P(_ary_)); \
- assert(ARY_SHARED_P(_ary_)); \
- assert(ARY_SHARED_ROOT_P(_value_)); \
- RB_OBJ_WRITE(_ary_, &RARRAY(_ary_)->as.heap.aux.shared, _value_); \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(ARY_SHARED_P(ary)); \
+ assert(ARY_SHARED_ROOT_P(value)); \
+ RARRAY(ary)->as.heap.aux.shared = (value); \
} while (0)
#define RARRAY_SHARED_ROOT_FLAG FL_USER5
#define ARY_SHARED_ROOT_P(ary) (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG))
#define ARY_SHARED_NUM(ary) \
(assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
-#define ARY_SHARED_OCCUPIED(ary) (ARY_SHARED_NUM(ary) == 1)
#define ARY_SET_SHARED_NUM(ary, value) do { \
assert(ARY_SHARED_ROOT_P(ary)); \
RARRAY(ary)->as.heap.aux.capa = (value); \
@@ -129,74 +146,6 @@ static ID id_cmp, id_div, id_power;
FL_SET((ary), RARRAY_SHARED_ROOT_FLAG); \
} while (0)
-#define ARY_SET(a, i, v) RARRAY_ASET((assert(!ARY_SHARED_P(a)), (a)), (i), (v))
-
-void
-rb_mem_clear(register VALUE *mem, register long size)
-{
- while (size--) {
- *mem++ = Qnil;
- }
-}
-
-static void
-ary_mem_clear(VALUE ary, long beg, long size)
-{
- RARRAY_PTR_USE(ary, ptr, {
- rb_mem_clear(ptr + beg, size);
- });
-}
-
-static inline void
-memfill(register VALUE *mem, register long size, register VALUE val)
-{
- while (size--) {
- *mem++ = val;
- }
-}
-
-static void
-ary_memfill(VALUE ary, long beg, long size, VALUE val)
-{
- RARRAY_PTR_USE(ary, ptr, {
- memfill(ptr + beg, size, val);
- RB_OBJ_WRITTEN(ary, Qundef, val);
- });
-}
-
-static void
-ary_memcpy0(VALUE ary, long beg, long argc, const VALUE *argv, VALUE buff_owner_ary)
-{
-#if 1
- assert(!ARY_SHARED_P(buff_owner_ary));
-
- if (argc > (int)(128/sizeof(VALUE)) /* is magic number (cache line size) */) {
- rb_gc_writebarrier_remember(buff_owner_ary);
- RARRAY_PTR_USE(ary, ptr, {
- MEMCPY(ptr+beg, argv, VALUE, argc);
- });
- }
- else {
- int i;
- RARRAY_PTR_USE(ary, ptr, {
- for (i=0; i<argc; i++) {
- RB_OBJ_WRITE(buff_owner_ary, &ptr[i+beg], argv[i]);
- }
- });
- }
-#else
- /* giveup write barrier (traditional way) */
- RARRAY_PTR(buff_owner_ary);
- MEMCPY(RARRAY_PTR(ary)+beg, argv, VALUE, argc);
-#endif
-}
-
-static void
-ary_memcpy(VALUE ary, long beg, long argc, const VALUE *argv)
-{
- ary_memcpy0(ary, beg, argc, argv, ary);
-}
-
static void
ary_resize_capa(VALUE ary, long capacity)
{
@@ -213,35 +162,23 @@ ary_resize_capa(VALUE ary, long capacity)
ARY_SET_HEAP_LEN(ary, len);
}
else {
- SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity, RARRAY(ary)->as.heap.aux.capa);
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, (capacity));
}
ARY_SET_CAPA(ary, (capacity));
}
else {
if (!ARY_EMBED_P(ary)) {
long len = RARRAY_LEN(ary);
- const VALUE *ptr = RARRAY_CONST_PTR(ary);
-
- if (len > capacity) len = capacity;
- MEMCPY((VALUE *)RARRAY(ary)->as.ary, ptr, VALUE, len);
+ VALUE *ptr = RARRAY_PTR(ary);
+ if (len > capacity) len = capacity;
+ MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len);
FL_SET_EMBED(ary);
ARY_SET_LEN(ary, len);
- ruby_xfree((VALUE *)ptr);
+ xfree(ptr);
}
}
}
-static inline void
-ary_shrink_capa(VALUE ary)
-{
- long capacity = ARY_HEAP_LEN(ary);
- long old_capa = RARRAY(ary)->as.heap.aux.capa;
- assert(!ARY_SHARED_P(ary));
- assert(old_capa >= capacity);
- if (old_capa > capacity)
- REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity);
-}
-
static void
ary_double_capa(VALUE ary, long min)
{
@@ -310,6 +247,8 @@ static inline void
rb_ary_modify_check(VALUE ary)
{
rb_check_frozen(ary);
+ if (!OBJ_UNTRUSTED(ary) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: can't modify array");
}
void
@@ -317,66 +256,57 @@ rb_ary_modify(VALUE ary)
{
rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
- long shared_len, len = RARRAY_LEN(ary);
+ long len = RARRAY_LEN(ary);
VALUE shared = ARY_SHARED(ary);
if (len <= RARRAY_EMBED_LEN_MAX) {
- const VALUE *ptr = ARY_HEAP_PTR(ary);
+ VALUE *ptr = ARY_HEAP_PTR(ary);
FL_UNSET_SHARED(ary);
FL_SET_EMBED(ary);
- MEMCPY((VALUE *)ARY_EMBED_PTR(ary), ptr, VALUE, len);
+ MEMCPY(ARY_EMBED_PTR(ary), ptr, VALUE, len);
rb_ary_decrement_share(shared);
ARY_SET_EMBED_LEN(ary, len);
}
- else if (ARY_SHARED_OCCUPIED(shared) && len > ((shared_len = RARRAY_LEN(shared))>>1)) {
- long shift = RARRAY_CONST_PTR(ary) - RARRAY_CONST_PTR(shared);
+ else if (ARY_SHARED_NUM(shared) == 1 && len > (RARRAY_LEN(shared)>>1)) {
+ long shift = RARRAY_PTR(ary) - RARRAY_PTR(shared);
+ ARY_SET_PTR(ary, RARRAY_PTR(shared));
+ ARY_SET_CAPA(ary, RARRAY_LEN(shared));
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+shift, VALUE, len);
FL_UNSET_SHARED(ary);
- ARY_SET_PTR(ary, RARRAY_CONST_PTR(shared));
- ARY_SET_CAPA(ary, shared_len);
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr, ptr+shift, VALUE, len);
- });
FL_SET_EMBED(shared);
rb_ary_decrement_share(shared);
}
else {
VALUE *ptr = ALLOC_N(VALUE, len);
- MEMCPY(ptr, RARRAY_CONST_PTR(ary), VALUE, len);
+ MEMCPY(ptr, RARRAY_PTR(ary), VALUE, len);
rb_ary_unshare(ary);
ARY_SET_CAPA(ary, len);
ARY_SET_PTR(ary, ptr);
}
-
- rb_gc_writebarrier_remember(ary);
}
}
-static VALUE
+static void
ary_ensure_room_for_push(VALUE ary, long add_len)
{
- long old_len = RARRAY_LEN(ary);
- long new_len = old_len + add_len;
+ long new_len = RARRAY_LEN(ary) + add_len;
long capa;
- if (old_len > ARY_MAX_SIZE - add_len) {
- rb_raise(rb_eIndexError, "index %ld too big", new_len);
- }
if (ARY_SHARED_P(ary)) {
if (new_len > RARRAY_EMBED_LEN_MAX) {
VALUE shared = ARY_SHARED(ary);
- if (ARY_SHARED_OCCUPIED(shared)) {
- if (RARRAY_CONST_PTR(ary) - RARRAY_CONST_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
+ if (ARY_SHARED_NUM(shared) == 1) {
+ if (RARRAY_PTR(ary) - RARRAY_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
rb_ary_modify_check(ary);
- return shared;
}
else {
- /* if array is shared, then it is likely it participate in push/shift pattern */
+ /* if array is shared, than it is likely it participate in push/shift pattern */
rb_ary_modify(ary);
capa = ARY_CAPA(ary);
if (new_len > capa - (capa >> 6)) {
ary_double_capa(ary, new_len);
}
- return ary;
}
+ return;
}
}
}
@@ -385,8 +315,6 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
if (new_len > capa) {
ary_double_capa(ary, new_len);
}
-
- return ary;
}
/*
@@ -442,25 +370,27 @@ rb_ary_shared_with_p(VALUE ary1, VALUE ary2)
static VALUE
ary_alloc(VALUE klass)
{
- NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY | RARRAY_EMBED_FLAG | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0));
- /* Created array is:
- * FL_SET_EMBED((VALUE)ary);
- * ARY_SET_EMBED_LEN((VALUE)ary, 0);
- */
+ NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY);
+ FL_SET_EMBED((VALUE)ary);
+ ARY_SET_EMBED_LEN((VALUE)ary, 0);
+
return (VALUE)ary;
}
static VALUE
empty_ary_alloc(VALUE klass)
{
- RUBY_DTRACE_CREATE_HOOK(ARRAY, 0);
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
+
return ary_alloc(klass);
}
static VALUE
ary_new(VALUE klass, long capa)
{
- VALUE ary,*ptr;
+ VALUE ary;
if (capa < 0) {
rb_raise(rb_eArgError, "negative array size (or size too big)");
@@ -469,13 +399,14 @@ ary_new(VALUE klass, long capa)
rb_raise(rb_eArgError, "array size too big");
}
- RUBY_DTRACE_CREATE_HOOK(ARRAY, capa);
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
+ }
ary = ary_alloc(klass);
if (capa > RARRAY_EMBED_LEN_MAX) {
- ptr = ALLOC_N(VALUE, capa);
FL_UNSET_EMBED(ary);
- ARY_SET_PTR(ary, ptr);
+ ARY_SET_PTR(ary, ALLOC_N(VALUE, capa));
ARY_SET_CAPA(ary, capa);
ARY_SET_HEAP_LEN(ary, 0);
}
@@ -484,19 +415,22 @@ ary_new(VALUE klass, long capa)
}
VALUE
-rb_ary_new_capa(long capa)
+rb_ary_new2(long capa)
{
return ary_new(rb_cArray, capa);
}
+
VALUE
rb_ary_new(void)
{
return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
}
+#include <stdarg.h>
+
VALUE
-(rb_ary_new_from_args)(long n, ...)
+rb_ary_new3(long n, ...)
{
va_list ar;
VALUE ary;
@@ -506,7 +440,7 @@ VALUE
va_start(ar, n);
for (i=0; i<n; i++) {
- ARY_SET(ary, i, va_arg(ar, VALUE));
+ RARRAY_PTR(ary)[i] = va_arg(ar, VALUE);
}
va_end(ar);
@@ -515,13 +449,13 @@ VALUE
}
VALUE
-rb_ary_new_from_values(long n, const VALUE *elts)
+rb_ary_new4(long n, const VALUE *elts)
{
VALUE ary;
ary = rb_ary_new2(n);
if (n > 0 && elts) {
- ary_memcpy(ary, 0, n, elts);
+ MEMCPY(RARRAY_PTR(ary), elts, VALUE, n);
ARY_SET_LEN(ary, n);
}
@@ -534,20 +468,11 @@ rb_ary_tmp_new(long capa)
return ary_new(0, capa);
}
-VALUE
-rb_ary_tmp_new_fill(long capa)
-{
- VALUE ary = ary_new(0, capa);
- ary_memfill(ary, 0, capa, Qnil);
- ARY_SET_LEN(ary, capa);
- return ary;
-}
-
void
rb_ary_free(VALUE ary)
{
if (ARY_OWNS_HEAP_P(ary)) {
- ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
+ xfree(ARY_HEAP_PTR(ary));
}
}
@@ -581,19 +506,18 @@ ary_make_shared(VALUE ary)
return ary;
}
else if (OBJ_FROZEN(ary)) {
- ary_shrink_capa(ary);
+ ary_resize_capa(ary, ARY_HEAP_LEN(ary));
FL_SET_SHARED_ROOT(ary);
ARY_SET_SHARED_NUM(ary, 1);
return ary;
}
else {
- long capa = ARY_CAPA(ary), len = RARRAY_LEN(ary);
- NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0));
+ NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY);
FL_UNSET_EMBED(shared);
- ARY_SET_LEN((VALUE)shared, capa);
- ARY_SET_PTR((VALUE)shared, RARRAY_CONST_PTR(ary));
- ary_mem_clear((VALUE)shared, len, capa - len);
+ ARY_SET_LEN((VALUE)shared, ARY_CAPA(ary));
+ ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
+ rb_mem_clear(RARRAY_PTR(shared) + RARRAY_LEN(ary), ARY_CAPA(ary) - RARRAY_LEN(ary));
FL_SET_SHARED_ROOT(shared);
ARY_SET_SHARED_NUM((VALUE)shared, 1);
FL_SET_SHARED(ary);
@@ -603,15 +527,14 @@ ary_make_shared(VALUE ary)
}
}
+
static VALUE
ary_make_substitution(VALUE ary)
{
- long len = RARRAY_LEN(ary);
-
- if (len <= RARRAY_EMBED_LEN_MAX) {
- VALUE subst = rb_ary_new2(len);
- ary_memcpy(subst, 0, len, RARRAY_CONST_PTR(ary));
- ARY_SET_EMBED_LEN(subst, len);
+ if (RARRAY_LEN(ary) <= RARRAY_EMBED_LEN_MAX) {
+ VALUE subst = rb_ary_new2(RARRAY_LEN(ary));
+ MEMCPY(ARY_EMBED_PTR(subst), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
+ ARY_SET_EMBED_LEN(subst, RARRAY_LEN(ary));
return subst;
}
else {
@@ -664,16 +587,16 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
/*
* call-seq:
- * Array.new(size=0, default=nil)
+ * Array.new(size=0, obj=nil)
* Array.new(array)
* Array.new(size) {|index| block }
*
* Returns a new array.
*
* In the first form, if no arguments are sent, the new array will be empty.
- * When a +size+ and an optional +default+ are sent, an array is created with
- * +size+ copies of +default+. Take notice that all elements will reference the
- * same object +default+.
+ * When a +size+ and an optional +obj+ are sent, an array is created with
+ * +size+ copies of +obj+. Take notice that all elements will reference the
+ * same object +obj+.
*
* The second form creates a copy of the array passed as a parameter (the
* array is generated by calling to_ary on the parameter).
@@ -726,8 +649,8 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
rb_ary_modify(ary);
if (argc == 0) {
- if (ARY_OWNS_HEAP_P(ary) && RARRAY_CONST_PTR(ary) != 0) {
- ruby_sized_xfree((void *)RARRAY_CONST_PTR(ary), ARY_HEAP_SIZE(ary));
+ if (ARY_OWNS_HEAP_P(ary) && RARRAY_PTR(ary)) {
+ xfree(RARRAY_PTR(ary));
}
rb_ary_unshare_safe(ary);
FL_SET_EMBED(ary);
@@ -747,14 +670,12 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
}
len = NUM2LONG(size);
- /* NUM2LONG() may call size.to_int, ary can be frozen, modified, etc */
if (len < 0) {
rb_raise(rb_eArgError, "negative array size");
}
if (len > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- /* recheck after argument conversion */
rb_ary_modify(ary);
ary_resize_capa(ary, len);
if (rb_block_given_p()) {
@@ -769,7 +690,7 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
}
}
else {
- ary_memfill(ary, 0, len, val);
+ memfill(RARRAY_PTR(ary), len, val);
ARY_SET_LEN(ary, len);
}
return ary;
@@ -788,7 +709,7 @@ rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
{
VALUE ary = ary_new(klass, argc);
if (argc > 0 && argv) {
- ary_memcpy(ary, 0, argc, argv);
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
ARY_SET_LEN(ary, argc);
}
@@ -798,13 +719,11 @@ rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
void
rb_ary_store(VALUE ary, long idx, VALUE val)
{
- long len = RARRAY_LEN(ary);
-
if (idx < 0) {
- idx += len;
+ idx += RARRAY_LEN(ary);
if (idx < 0) {
rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
- idx - len, -len);
+ idx - RARRAY_LEN(ary), -RARRAY_LEN(ary));
}
}
else if (idx >= ARY_MAX_SIZE) {
@@ -815,14 +734,15 @@ rb_ary_store(VALUE ary, long idx, VALUE val)
if (idx >= ARY_CAPA(ary)) {
ary_double_capa(ary, idx);
}
- if (idx > len) {
- ary_mem_clear(ary, len, idx - len + 1);
+ if (idx > RARRAY_LEN(ary)) {
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary),
+ idx-RARRAY_LEN(ary) + 1);
}
- if (idx >= len) {
+ if (idx >= RARRAY_LEN(ary)) {
ARY_SET_LEN(ary, idx + 1);
}
- ARY_SET(ary, idx, val);
+ RARRAY_PTR(ary)[idx] = val;
}
static VALUE
@@ -834,7 +754,7 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
if (len <= RARRAY_EMBED_LEN_MAX) {
VALUE result = ary_alloc(klass);
- ary_memcpy(result, 0, len, RARRAY_CONST_PTR(ary) + offset);
+ MEMCPY(ARY_EMBED_PTR(result), RARRAY_PTR(ary) + offset, VALUE, len);
ARY_SET_EMBED_LEN(result, len);
return result;
}
@@ -843,7 +763,7 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
FL_UNSET_EMBED(result);
shared = ary_make_shared(ary);
- ARY_SET_PTR(result, RARRAY_CONST_PTR(ary));
+ ARY_SET_PTR(result, RARRAY_PTR(ary));
ARY_SET_LEN(result, RARRAY_LEN(ary));
rb_ary_set_shared(result, shared);
@@ -866,24 +786,22 @@ enum ary_take_pos_flags
};
static VALUE
-ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
+ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
{
VALUE nv;
long n;
- long len;
long offset = 0;
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
- len = RARRAY_LEN(ary);
- if (n > len) {
- n = len;
+ if (n > RARRAY_LEN(ary)) {
+ n = RARRAY_LEN(ary);
}
else if (n < 0) {
rb_raise(rb_eArgError, "negative array size");
}
if (last) {
- offset = len - n;
+ offset = RARRAY_LEN(ary) - n;
}
return ary_make_partial(ary, rb_cArray, offset, n);
}
@@ -905,20 +823,33 @@ VALUE
rb_ary_push(VALUE ary, VALUE item)
{
long idx = RARRAY_LEN(ary);
- VALUE target_ary = ary_ensure_room_for_push(ary, 1);
- RARRAY_PTR_USE(ary, ptr, {
- RB_OBJ_WRITE(target_ary, &ptr[idx], item);
- });
+
+ ary_ensure_room_for_push(ary, 1);
+ RARRAY_PTR(ary)[idx] = item;
+ ARY_SET_LEN(ary, idx + 1);
+ return ary;
+}
+
+static VALUE
+rb_ary_push_1(VALUE ary, VALUE item)
+{
+ long idx = RARRAY_LEN(ary);
+
+ if (idx >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, idx);
+ }
+ RARRAY_PTR(ary)[idx] = item;
ARY_SET_LEN(ary, idx + 1);
return ary;
}
VALUE
-rb_ary_cat(VALUE ary, const VALUE *argv, long len)
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
{
long oldlen = RARRAY_LEN(ary);
- VALUE target_ary = ary_ensure_room_for_push(ary, len);
- ary_memcpy0(ary, oldlen, len, argv, target_ary);
+
+ ary_ensure_room_for_push(ary, len);
+ MEMCPY(RARRAY_PTR(ary) + oldlen, ptr, VALUE, len);
ARY_SET_LEN(ary, oldlen + len);
return ary;
}
@@ -950,17 +881,16 @@ rb_ary_pop(VALUE ary)
{
long n;
rb_ary_modify_check(ary);
- n = RARRAY_LEN(ary);
- if (n == 0) return Qnil;
+ if (RARRAY_LEN(ary) == 0) return Qnil;
if (ARY_OWNS_HEAP_P(ary) &&
- n * 3 < ARY_CAPA(ary) &&
+ RARRAY_LEN(ary) * 3 < ARY_CAPA(ary) &&
ARY_CAPA(ary) > ARY_DEFAULT_SIZE)
{
- ary_resize_capa(ary, n * 2);
+ ary_resize_capa(ary, RARRAY_LEN(ary) * 2);
}
- --n;
+ n = RARRAY_LEN(ary)-1;
ARY_SET_LEN(ary, n);
- return RARRAY_AREF(ary, n);
+ return RARRAY_PTR(ary)[n];
}
/*
@@ -1000,26 +930,23 @@ VALUE
rb_ary_shift(VALUE ary)
{
VALUE top;
- long len = RARRAY_LEN(ary);
rb_ary_modify_check(ary);
- if (len == 0) return Qnil;
- top = RARRAY_AREF(ary, 0);
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ top = RARRAY_PTR(ary)[0];
if (!ARY_SHARED_P(ary)) {
- if (len < ARY_DEFAULT_SIZE) {
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr, ptr+1, VALUE, len-1);
- }); /* WB: no new reference */
+ if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary)-1);
ARY_INCREASE_LEN(ary, -1);
return top;
}
assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
- ARY_SET(ary, 0, Qnil);
+ RARRAY_PTR(ary)[0] = Qnil;
ary_make_shared(ary);
}
- else if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
- RARRAY_PTR_USE(ary, ptr, ptr[0] = Qnil);
+ else if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
+ RARRAY_PTR(ary)[0] = Qnil;
}
ARY_INCREASE_PTR(ary, 1); /* shift ptr */
ARY_INCREASE_LEN(ary, -1);
@@ -1064,46 +991,33 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
n = RARRAY_LEN(result);
if (ARY_SHARED_P(ary)) {
- if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
- setup_occupied_shared:
- ary_mem_clear(ary, 0, n);
+ if (ARY_SHARED_NUM(ARY_SHARED(ary)) == 1) {
+ rb_mem_clear(RARRAY_PTR(ary), n);
}
ARY_INCREASE_PTR(ary, n);
}
else {
- if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr, ptr+n, VALUE, RARRAY_LEN(ary)-n);
- }); /* WB: no new reference */
- }
- else {
- ary_make_shared(ary);
- goto setup_occupied_shared;
- }
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+n, VALUE, RARRAY_LEN(ary)-n);
}
ARY_INCREASE_LEN(ary, -n);
return result;
}
-static VALUE
+static void
ary_ensure_room_for_unshift(VALUE ary, int argc)
{
long len = RARRAY_LEN(ary);
long new_len = len + argc;
long capa;
- const VALUE *head, *sharedp;
-
- if (len > ARY_MAX_SIZE - argc) {
- rb_raise(rb_eIndexError, "index %ld too big", new_len);
- }
+ VALUE *head, *sharedp;
if (ARY_SHARED_P(ary)) {
VALUE shared = ARY_SHARED(ary);
capa = RARRAY_LEN(shared);
- if (ARY_SHARED_OCCUPIED(shared) && capa > new_len) {
- head = RARRAY_CONST_PTR(ary);
- sharedp = RARRAY_CONST_PTR(shared);
+ if (ARY_SHARED_NUM(shared) == 1 && capa > new_len) {
+ head = RARRAY_PTR(ary);
+ sharedp = RARRAY_PTR(shared);
goto makeroom_if_need;
}
}
@@ -1120,7 +1034,7 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
capa = ARY_CAPA(ary);
ary_make_shared(ary);
- head = sharedp = RARRAY_CONST_PTR(ary);
+ head = sharedp = RARRAY_PTR(ary);
goto makeroom;
makeroom_if_need:
if (head - sharedp < argc) {
@@ -1128,20 +1042,14 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
makeroom:
room = capa - new_len;
room -= room >> 4;
- MEMMOVE((VALUE *)sharedp + argc + room, head, VALUE, len);
+ MEMMOVE(sharedp + argc + room, head, VALUE, len);
head = sharedp + argc + room;
}
ARY_SET_PTR(ary, head - argc);
- assert(ARY_SHARED_OCCUPIED(ARY_SHARED(ary)));
- return ARY_SHARED(ary);
}
else {
/* sliding items */
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr + argc, ptr, VALUE, len);
- });
-
- return ary;
+ MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
}
}
@@ -1161,15 +1069,14 @@ static VALUE
rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
long len = RARRAY_LEN(ary);
- VALUE target_ary;
if (argc == 0) {
rb_ary_modify_check(ary);
return ary;
}
- target_ary = ary_ensure_room_for_unshift(ary, argc);
- ary_memcpy0(ary, 0, argc, argv, target_ary);
+ ary_ensure_room_for_unshift(ary, argc);
+ MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
ARY_SET_LEN(ary, len + argc);
return ary;
}
@@ -1184,12 +1091,11 @@ rb_ary_unshift(VALUE ary, VALUE item)
static inline VALUE
rb_ary_elt(VALUE ary, long offset)
{
- long len = RARRAY_LEN(ary);
- if (len == 0) return Qnil;
- if (offset < 0 || len <= offset) {
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ if (offset < 0 || RARRAY_LEN(ary) <= offset) {
return Qnil;
}
- return RARRAY_AREF(ary, offset);
+ return RARRAY_PTR(ary)[offset];
}
VALUE
@@ -1205,13 +1111,12 @@ VALUE
rb_ary_subseq(VALUE ary, long beg, long len)
{
VALUE klass;
- long alen = RARRAY_LEN(ary);
- if (beg > alen) return Qnil;
+ if (beg > RARRAY_LEN(ary)) return Qnil;
if (beg < 0 || len < 0) return Qnil;
- if (alen < len || alen < beg + len) {
- len = alen - beg;
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
+ len = RARRAY_LEN(ary) - beg;
}
klass = rb_obj_class(ary);
if (len == 0) return ary_new(klass, 0);
@@ -1256,7 +1161,7 @@ rb_ary_subseq(VALUE ary, long beg, long len)
*/
VALUE
-rb_ary_aref(int argc, const VALUE *argv, VALUE ary)
+rb_ary_aref(int argc, VALUE *argv, VALUE ary)
{
VALUE arg;
long beg, len;
@@ -1302,7 +1207,7 @@ rb_ary_aref(int argc, const VALUE *argv, VALUE ary)
* a.at(-1) #=> "e"
*/
-VALUE
+static VALUE
rb_ary_at(VALUE ary, VALUE pos)
{
return rb_ary_entry(ary, NUM2LONG(pos));
@@ -1328,7 +1233,7 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary)
{
if (argc == 0) {
if (RARRAY_LEN(ary) == 0) return Qnil;
- return RARRAY_AREF(ary, 0);
+ return RARRAY_PTR(ary)[0];
}
else {
return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
@@ -1351,12 +1256,11 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary)
*/
VALUE
-rb_ary_last(int argc, const VALUE *argv, VALUE ary)
+rb_ary_last(int argc, VALUE *argv, VALUE ary)
{
if (argc == 0) {
- long len = RARRAY_LEN(ary);
- if (len == 0) return Qnil;
- return RARRAY_AREF(ary, len-1);
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ return RARRAY_PTR(ary)[RARRAY_LEN(ary)-1];
}
else {
return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
@@ -1411,14 +1315,11 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
}
return ifnone;
}
- return RARRAY_AREF(ary, idx);
+ return RARRAY_PTR(ary)[idx];
}
/*
* call-seq:
- * ary.find_index(obj) -> int or nil
- * ary.find_index { |item| block } -> int or nil
- * ary.find_index -> Enumerator
* ary.index(obj) -> int or nil
* ary.index { |item| block } -> int or nil
* ary.index -> Enumerator
@@ -1438,42 +1339,31 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
* a.index("b") #=> 1
* a.index("z") #=> nil
* a.index { |x| x == "b" } #=> 1
+ *
+ * This is an alias of Array#find_index.
*/
static VALUE
rb_ary_index(int argc, VALUE *argv, VALUE ary)
{
- const VALUE *ptr;
VALUE val;
- long i, len;
+ long i;
if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
for (i=0; i<RARRAY_LEN(ary); i++) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
return LONG2NUM(i);
}
}
return Qnil;
}
- rb_check_arity(argc, 0, 1);
- val = argv[0];
+ rb_scan_args(argc, argv, "1", &val);
if (rb_block_given_p())
rb_warn("given block not used");
- len = RARRAY_LEN(ary);
- ptr = RARRAY_CONST_PTR(ary);
- for (i=0; i<len; i++) {
- VALUE e = ptr[i];
- switch (rb_equal_opt(e, val)) {
- case Qundef:
- if (!rb_equal(e, val)) break;
- case Qtrue:
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);
- case Qfalse:
- continue;
- }
- len = RARRAY_LEN(ary);
- ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
@@ -1505,40 +1395,29 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
{
- const VALUE *ptr;
VALUE val;
- long i = RARRAY_LEN(ary), len;
+ long i = RARRAY_LEN(ary);
if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
while (i--) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i))))
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i])))
return LONG2NUM(i);
- if (i > (len = RARRAY_LEN(ary))) {
- i = len;
+ if (i > RARRAY_LEN(ary)) {
+ i = RARRAY_LEN(ary);
}
}
return Qnil;
}
- rb_check_arity(argc, 0, 1);
- val = argv[0];
+ rb_scan_args(argc, argv, "1", &val);
if (rb_block_given_p())
rb_warn("given block not used");
- ptr = RARRAY_CONST_PTR(ary);
while (i--) {
- VALUE e = ptr[i];
- switch (rb_equal_opt(e, val)) {
- case Qundef:
- if (!rb_equal(e, val)) break;
- case Qtrue:
+ if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);
- case Qfalse:
- continue;
- }
- if (i > (len = RARRAY_LEN(ary))) {
- i = len;
+ if (i > RARRAY_LEN(ary)) {
+ i = RARRAY_LEN(ary);
}
- ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
@@ -1556,19 +1435,17 @@ static void
rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
{
long rlen;
- long olen;
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
- olen = RARRAY_LEN(ary);
if (beg < 0) {
- beg += olen;
+ beg += RARRAY_LEN(ary);
if (beg < 0) {
rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
- beg - olen, -olen);
+ beg - RARRAY_LEN(ary), -RARRAY_LEN(ary));
}
}
- if (olen < len || olen < beg + len) {
- len = olen - beg;
+ if (RARRAY_LEN(ary) < len || RARRAY_LEN(ary) < beg + len) {
+ len = RARRAY_LEN(ary) - beg;
}
if (rpl == Qundef) {
@@ -1577,44 +1454,37 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
else {
rpl = rb_ary_to_ary(rpl);
rlen = RARRAY_LEN(rpl);
- olen = RARRAY_LEN(ary); /* ary may be resized in rpl.to_ary too */
}
- if (beg >= olen) {
- VALUE target_ary;
+ if (beg >= RARRAY_LEN(ary)) {
if (beg > ARY_MAX_SIZE - rlen) {
rb_raise(rb_eIndexError, "index %ld too big", beg);
}
- target_ary = ary_ensure_room_for_push(ary, rlen-len); /* len is 0 or negative */
+ ary_ensure_room_for_push(ary, rlen-len); /* len is 0 or negative */
len = beg + rlen;
- ary_mem_clear(ary, olen, beg - olen);
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), beg - RARRAY_LEN(ary));
if (rlen > 0) {
- ary_memcpy0(ary, beg, rlen, RARRAY_CONST_PTR(rpl), target_ary);
+ MEMCPY(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
}
ARY_SET_LEN(ary, len);
}
else {
long alen;
- if (olen - len > ARY_MAX_SIZE - rlen) {
- rb_raise(rb_eIndexError, "index %ld too big", olen + rlen - len);
- }
rb_ary_modify(ary);
- alen = olen + rlen - len;
+ alen = RARRAY_LEN(ary) + rlen - len;
if (alen >= ARY_CAPA(ary)) {
ary_double_capa(ary, alen);
}
if (len != rlen) {
- RARRAY_PTR_USE(ary, ptr,
- MEMMOVE(ptr + beg + rlen, ptr + beg + len,
- VALUE, olen - (beg + len)));
+ MEMMOVE(RARRAY_PTR(ary) + beg + rlen, RARRAY_PTR(ary) + beg + len,
+ VALUE, RARRAY_LEN(ary) - (beg + len));
ARY_SET_LEN(ary, alen);
}
if (rlen > 0) {
- MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_CONST_PTR(rpl), VALUE, rlen);
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
}
}
- RB_GC_GUARD(rpl);
}
void
@@ -1655,8 +1525,8 @@ rb_ary_resize(VALUE ary, long len)
if (len >= ARY_CAPA(ary)) {
ary_double_capa(ary, len);
}
- ary_mem_clear(ary, olen, len - olen);
- ARY_SET_LEN(ary, len);
+ rb_mem_clear(RARRAY_PTR(ary) + olen, len - olen);
+ ARY_SET_LEN(ary, len);
}
else if (ARY_EMBED_P(ary)) {
ARY_SET_EMBED_LEN(ary, len);
@@ -1665,12 +1535,12 @@ rb_ary_resize(VALUE ary, long len)
VALUE tmp[RARRAY_EMBED_LEN_MAX];
MEMCPY(tmp, ARY_HEAP_PTR(ary), VALUE, len);
ary_discard(ary);
- MEMCPY((VALUE *)ARY_EMBED_PTR(ary), tmp, VALUE, len); /* WB: no new reference */
+ MEMCPY(ARY_EMBED_PTR(ary), tmp, VALUE, len);
ARY_SET_EMBED_LEN(ary, len);
}
else {
if (olen > len + ARY_DEFAULT_SIZE) {
- SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, len, RARRAY(ary)->as.heap.aux.capa);
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, len);
ARY_SET_CAPA(ary, len);
}
ARY_SET_HEAP_LEN(ary, len);
@@ -1750,9 +1620,7 @@ fixnum:
* Inserts the given values before the element with the given +index+.
*
* Negative indices count backwards from the end of the array, where +-1+ is
- * the last element. If a negative index is used, the given values will be
- * inserted after that element, so using an index of +-1+ will insert the
- * values at the end of the array.
+ * the last element.
*
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
@@ -1781,21 +1649,15 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_length(VALUE ary);
-static VALUE
-ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
-{
- return rb_ary_length(ary);
-}
-
/*
* call-seq:
* ary.each { |item| block } -> ary
* ary.each -> Enumerator
*
* Calls the given block once for each element in +self+, passing that element
- * as a parameter. Returns the array itself.
+ * as a parameter.
*
- * If no block is given, an Enumerator is returned.
+ * An Enumerator is returned if no block is given.
*
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
@@ -1806,13 +1668,14 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
*/
VALUE
-rb_ary_each(VALUE ary)
+rb_ary_each(VALUE array)
{
long i;
+ volatile VALUE ary = array;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_AREF(ary, i));
+ rb_yield(RARRAY_PTR(ary)[i]);
}
return ary;
}
@@ -1839,7 +1702,7 @@ static VALUE
rb_ary_each_index(VALUE ary)
{
long i;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(LONG2NUM(i));
@@ -1867,14 +1730,12 @@ rb_ary_reverse_each(VALUE ary)
{
long len;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
len = RARRAY_LEN(ary);
while (len--) {
- long nlen;
- rb_yield(RARRAY_AREF(ary, len));
- nlen = RARRAY_LEN(ary);
- if (nlen < len) {
- len = nlen;
+ rb_yield(RARRAY_PTR(ary)[len]);
+ if (RARRAY_LEN(ary) < len) {
+ len = RARRAY_LEN(ary);
}
}
return ary;
@@ -1917,17 +1778,16 @@ rb_ary_empty_p(VALUE ary)
VALUE
rb_ary_dup(VALUE ary)
{
- long len = RARRAY_LEN(ary);
- VALUE dup = rb_ary_new2(len);
- ary_memcpy(dup, 0, len, RARRAY_CONST_PTR(ary));
- ARY_SET_LEN(dup, len);
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
+ MEMCPY(RARRAY_PTR(dup), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary));
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
return dup;
}
VALUE
rb_ary_resurrect(VALUE ary)
{
- return rb_ary_new4(RARRAY_LEN(ary), RARRAY_CONST_PTR(ary));
+ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_PTR(ary));
}
extern VALUE rb_output_fs;
@@ -1958,13 +1818,14 @@ ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
long i;
VALUE val;
- if (max > 0) rb_enc_copy(result, RARRAY_AREF(ary, 0));
+ if (max > 0) rb_enc_copy(result, RARRAY_PTR(ary)[0]);
for (i=0; i<max; i++) {
- val = RARRAY_AREF(ary, i);
+ val = RARRAY_PTR(ary)[i];
if (i > 0 && !NIL_P(sep))
rb_str_buf_append(result, sep);
rb_str_buf_append(result, val);
if (OBJ_TAINTED(val)) OBJ_TAINT(result);
+ if (OBJ_UNTRUSTED(val)) OBJ_TAINT(result);
}
}
@@ -1977,13 +1838,14 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
if (i > 0 && !NIL_P(sep))
rb_str_buf_append(result, sep);
- val = RARRAY_AREF(ary, i);
- if (RB_TYPE_P(val, T_STRING)) {
+ val = RARRAY_PTR(ary)[i];
+ switch (TYPE(val)) {
+ case T_STRING:
str_join:
rb_str_buf_append(result, val);
*first = FALSE;
- }
- else if (RB_TYPE_P(val, T_ARRAY)) {
+ break;
+ case T_ARRAY:
obj = val;
ary_join:
if (val == ary) {
@@ -1998,8 +1860,8 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
args[3] = (VALUE)first;
rb_exec_recursive(recursive_join, obj, (VALUE)args);
}
- }
- else {
+ break;
+ default:
tmp = rb_check_string_type(val);
if (!NIL_P(tmp)) {
val = tmp;
@@ -2026,17 +1888,19 @@ rb_ary_join(VALUE ary, VALUE sep)
{
long len = 1, i;
int taint = FALSE;
+ int untrust = FALSE;
VALUE val, tmp, result;
if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
if (OBJ_TAINTED(ary)) taint = TRUE;
+ if (OBJ_UNTRUSTED(ary)) untrust = TRUE;
if (!NIL_P(sep)) {
StringValue(sep);
len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
}
for (i=0; i<RARRAY_LEN(ary); i++) {
- val = RARRAY_AREF(ary, i);
+ val = RARRAY_PTR(ary)[i];
tmp = rb_check_string_type(val);
if (NIL_P(tmp) || tmp != val) {
@@ -2044,6 +1908,7 @@ rb_ary_join(VALUE ary, VALUE sep)
result = rb_str_buf_new(len + (RARRAY_LEN(ary)-i)*10);
rb_enc_associate(result, rb_usascii_encoding());
if (taint) OBJ_TAINT(result);
+ if (untrust) OBJ_UNTRUST(result);
ary_join_0(ary, sep, i, result);
first = i == 0;
ary_join_1(ary, ary, sep, i, result, &first);
@@ -2055,6 +1920,7 @@ rb_ary_join(VALUE ary, VALUE sep)
result = rb_str_buf_new(len);
if (taint) OBJ_TAINT(result);
+ if (untrust) OBJ_UNTRUST(result);
ary_join_0(ary, sep, RARRAY_LEN(ary), result);
return result;
@@ -2088,20 +1954,23 @@ static VALUE
inspect_ary(VALUE ary, VALUE dummy, int recur)
{
int tainted = OBJ_TAINTED(ary);
+ int untrust = OBJ_UNTRUSTED(ary);
long i;
VALUE s, str;
if (recur) return rb_usascii_str_new_cstr("[...]");
str = rb_str_buf_new2("[");
for (i=0; i<RARRAY_LEN(ary); i++) {
- s = rb_inspect(RARRAY_AREF(ary, i));
+ s = rb_inspect(RARRAY_PTR(ary)[i]);
if (OBJ_TAINTED(s)) tainted = TRUE;
+ if (OBJ_UNTRUSTED(s)) untrust = TRUE;
if (i > 0) rb_str_buf_cat2(str, ", ");
else rb_enc_copy(str, s);
rb_str_buf_append(str, s);
}
rb_str_buf_cat2(str, "]");
if (tainted) OBJ_TAINT(str);
+ if (untrust) OBJ_UNTRUST(str);
return str;
}
@@ -2150,38 +2019,6 @@ rb_ary_to_a(VALUE ary)
/*
* call-seq:
- * ary.to_h -> hash
- *
- * Returns the result of interpreting <i>ary</i> as an array of
- * <tt>[key, value]</tt> pairs.
- *
- * [[:foo, :bar], [1, 2]].to_h
- * # => {:foo => :bar, 1 => 2}
- */
-
-static VALUE
-rb_ary_to_h(VALUE ary)
-{
- long i;
- VALUE hash = rb_hash_new();
- for (i=0; i<RARRAY_LEN(ary); i++) {
- const VALUE elt = rb_ary_elt(ary, i);
- const VALUE key_value_pair = rb_check_array_type(elt);
- if (NIL_P(key_value_pair)) {
- rb_raise(rb_eTypeError, "wrong element type %"PRIsVALUE" at %ld (expected array)",
- rb_obj_class(elt), i);
- }
- if (RARRAY_LEN(key_value_pair) != 2) {
- rb_raise(rb_eArgError, "wrong array length at %ld (expected 2, was %ld)",
- i, RARRAY_LEN(key_value_pair));
- }
- rb_hash_aset(hash, RARRAY_AREF(key_value_pair, 0), RARRAY_AREF(key_value_pair, 1));
- }
- return hash;
-}
-
-/*
- * call-seq:
* ary.to_ary -> ary
*
* Returns +self+.
@@ -2206,15 +2043,13 @@ ary_reverse(VALUE *p1, VALUE *p2)
VALUE
rb_ary_reverse(VALUE ary)
{
- VALUE *p2;
- long len = RARRAY_LEN(ary);
+ VALUE *p1, *p2;
rb_ary_modify(ary);
- if (len > 1) {
- RARRAY_PTR_USE(ary, p1, {
- p2 = p1 + len - 1; /* points last item */
- ary_reverse(p1, p2);
- }); /* WB: no new reference */
+ if (RARRAY_LEN(ary) > 1) {
+ p1 = RARRAY_PTR(ary);
+ p2 = p1 + RARRAY_LEN(ary) - 1; /* points last item */
+ ary_reverse(p1, p2);
}
return ary;
}
@@ -2253,8 +2088,8 @@ rb_ary_reverse_m(VALUE ary)
VALUE dup = rb_ary_new2(len);
if (len > 0) {
- const VALUE *p1 = RARRAY_CONST_PTR(ary);
- VALUE *p2 = (VALUE *)RARRAY_CONST_PTR(dup) + len - 1;
+ VALUE *p1 = RARRAY_PTR(ary);
+ VALUE *p2 = RARRAY_PTR(dup) + len - 1;
do *p2-- = *p1++; while (--len > 0);
}
ARY_SET_LEN(dup, RARRAY_LEN(ary));
@@ -2339,8 +2174,7 @@ rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
{
- VALUE rotated;
- const VALUE *ptr;
+ VALUE rotated, *ptr, *ptr2;
long len, cnt = 1;
switch (argc) {
@@ -2353,10 +2187,11 @@ rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
rotated = rb_ary_new2(len);
if (len > 0) {
cnt = rotate_count(cnt, len);
- ptr = RARRAY_CONST_PTR(ary);
+ ptr = RARRAY_PTR(ary);
+ ptr2 = RARRAY_PTR(rotated);
len -= cnt;
- ary_memcpy(rotated, 0, len, ptr + cnt);
- ary_memcpy(rotated, len, cnt, ptr);
+ MEMCPY(ptr2, ptr + cnt, VALUE, len);
+ MEMCPY(ptr2 + len, ptr, VALUE, cnt);
}
ARY_SET_LEN(rotated, RARRAY_LEN(ary));
return rotated;
@@ -2424,7 +2259,7 @@ sort_2(const void *ap, const void *bp, void *dummy)
return rb_str_cmp(a, b);
}
- retval = rb_funcallv(a, id_cmp, 1, &b);
+ retval = rb_funcall(a, id_cmp, 1, b);
n = rb_cmpint(retval, a, b);
sort_reentered(data->ary);
@@ -2441,9 +2276,9 @@ sort_2(const void *ap, const void *bp, void *dummy)
* Comparisons for the sort will be done using the <code><=></code> operator
* or using an optional code block.
*
- * The block must implement a comparison between +a+ and +b+ and return
- * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
- * are equivalent, or an integer greater than 0 when +a+ follows +b+.
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
*
* See also Enumerable#sort_by.
*
@@ -2462,25 +2297,26 @@ rb_ary_sort_bang(VALUE ary)
struct ary_sort_data data;
long len = RARRAY_LEN(ary);
- RBASIC_CLEAR_CLASS(tmp);
+ RBASIC(tmp)->klass = 0;
data.ary = tmp;
data.opt_methods = 0;
data.opt_inited = 0;
- RARRAY_PTR_USE(tmp, ptr, {
- ruby_qsort(ptr, len, sizeof(VALUE),
- rb_block_given_p()?sort_1:sort_2, &data);
- }); /* WB: no new reference */
- rb_ary_modify(ary);
+ ruby_qsort(RARRAY_PTR(tmp), len, sizeof(VALUE),
+ rb_block_given_p()?sort_1:sort_2, &data);
+
if (ARY_EMBED_P(tmp)) {
+ assert(ARY_EMBED_P(tmp));
if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */
rb_ary_unshare(ary);
- FL_SET_EMBED(ary);
}
- ary_memcpy(ary, 0, ARY_EMBED_LEN(tmp), ARY_EMBED_PTR(tmp));
+ FL_SET_EMBED(ary);
+ MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp));
ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
}
else {
- if (!ARY_EMBED_P(ary) && ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
+ assert(!ARY_EMBED_P(tmp));
+ if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
+ assert(!ARY_EMBED_P(ary));
FL_UNSET_SHARED(ary);
ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}
@@ -2494,9 +2330,9 @@ rb_ary_sort_bang(VALUE ary)
rb_ary_unshare(ary);
}
else {
- ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
+ xfree(ARY_HEAP_PTR(ary));
}
- ARY_SET_PTR(ary, RARRAY_CONST_PTR(tmp));
+ ARY_SET_PTR(ary, RARRAY_PTR(tmp));
ARY_SET_HEAP_LEN(ary, len);
ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}
@@ -2507,7 +2343,7 @@ rb_ary_sort_bang(VALUE ary)
FL_SET(tmp, FL_FREEZE);
}
/* tmp will be GC'ed. */
- RBASIC_SET_CLASS_RAW(tmp, rb_cArray); /* rb_cArray must be marked */
+ RBASIC(tmp)->klass = rb_cArray;
}
return ary;
}
@@ -2522,9 +2358,9 @@ rb_ary_sort_bang(VALUE ary)
* Comparisons for the sort will be done using the <code><=></code> operator
* or using an optional code block.
*
- * The block must implement a comparison between +a+ and +b+ and return
- * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+
- * are equivalent, or an integer greater than 0 when +a+ follows +b+.
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
*
*
* See also Enumerable#sort_by.
@@ -2542,8 +2378,6 @@ rb_ary_sort(VALUE ary)
return ary;
}
-static VALUE rb_ary_bsearch_index(VALUE ary);
-
/*
* call-seq:
* ary.bsearch {|x| block } -> elem
@@ -2600,42 +2434,17 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
static VALUE
rb_ary_bsearch(VALUE ary)
{
- VALUE index_result = rb_ary_bsearch_index(ary);
-
- if (FIXNUM_P(index_result)) {
- return rb_ary_entry(ary, FIX2LONG(index_result));
- }
- return index_result;
-}
-
-/*
- * call-seq:
- * ary.bsearch_index {|x| block } -> int or nil
- *
- * By using binary search, finds an index of a value from this array which
- * meets the given condition in O(log n) where n is the size of the array.
- *
- * It supports two modes, depending on the nature of the block and they are
- * exactly the same as in the case of #bsearch method with the only difference
- * being that this method returns the index of the element instead of the
- * element itself. For more details consult the documentation for #bsearch.
- */
-
-static VALUE
-rb_ary_bsearch_index(VALUE ary)
-{
long low = 0, high = RARRAY_LEN(ary), mid;
int smaller = 0, satisfied = 0;
VALUE v, val;
- RETURN_ENUMERATOR(ary, 0, 0);
while (low < high) {
mid = low + ((high - low) / 2);
val = rb_ary_entry(ary, mid);
v = rb_yield(val);
if (FIXNUM_P(v)) {
- if (v == INT2FIX(0)) return INT2FIX(mid);
- smaller = (SIGNED_VALUE)v < 0; /* Fixnum preserves its sign-bit */
+ if (FIX2INT(v) == 0) return val;
+ smaller = FIX2INT(v) < 0;
}
else if (v == Qtrue) {
satisfied = 1;
@@ -2645,17 +2454,14 @@ rb_ary_bsearch_index(VALUE ary)
smaller = 0;
}
else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
- const VALUE zero = INT2FIX(0);
- switch (rb_cmpint(rb_funcallv(v, id_cmp, 1, &zero), v, zero)) {
- case 0: return INT2FIX(mid);
- case 1: smaller = 1; break;
- case -1: smaller = 0;
+ switch (rb_cmpint(rb_funcall(v, id_cmp, 1, INT2FIX(0)), v, INT2FIX(0))) {
+ case 0: return val;
+ case 1: smaller = 1; break;
+ case -1: smaller = 0;
}
}
else {
- rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE
- " (must be numeric, true, false or nil)",
- rb_obj_class(v));
+ smaller = RTEST(v);
}
if (smaller) {
high = mid;
@@ -2664,13 +2470,14 @@ rb_ary_bsearch_index(VALUE ary)
low = mid + 1;
}
}
+ if (low == RARRAY_LEN(ary)) return Qnil;
if (!satisfied) return Qnil;
- return INT2FIX(low);
+ return rb_ary_entry(ary, low);
}
static VALUE
-sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
+sort_by_i(VALUE i)
{
return rb_yield(i);
}
@@ -2692,7 +2499,7 @@ rb_ary_sort_by_bang(VALUE ary)
{
VALUE sorted;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
sorted = rb_block_call(ary, rb_intern("sort_by"), 0, 0, sort_by_i, 0);
rb_ary_replace(ary, sorted);
@@ -2716,9 +2523,8 @@ rb_ary_sort_by_bang(VALUE ary)
* If no block is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "c", "d" ]
- * a.collect { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * a.map.with_index { |x, i| x * i } #=> ["", "b", "cc", "ddd"]
- * a #=> ["a", "b", "c", "d"]
+ * a.map { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
+ * a #=> ["a", "b", "c", "d"]
*/
static VALUE
@@ -2727,10 +2533,10 @@ rb_ary_collect(VALUE ary)
long i;
VALUE collect;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
collect = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_push(collect, rb_yield(RARRAY_AREF(ary, i)));
+ rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i]));
}
return collect;
}
@@ -2753,8 +2559,6 @@ rb_ary_collect(VALUE ary)
* a = [ "a", "b", "c", "d" ]
* a.map! {|x| x + "!" }
* a #=> [ "a!", "b!", "c!", "d!" ]
- * a.collect!.with_index {|x, i| x[0...i] }
- * a #=> ["", "b", "c!", "d!"]
*/
static VALUE
@@ -2762,16 +2566,16 @@ rb_ary_collect_bang(VALUE ary)
{
long i;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_store(ary, i, rb_yield(RARRAY_AREF(ary, i)));
+ rb_ary_store(ary, i, rb_yield(RARRAY_PTR(ary)[i]));
}
return ary;
}
VALUE
-rb_get_values_at(VALUE obj, long olen, int argc, const VALUE *argv, VALUE (*func) (VALUE, long))
+rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VALUE, long))
{
VALUE result = rb_ary_new2(argc);
long beg, len, i, j;
@@ -2845,58 +2649,16 @@ rb_ary_select(VALUE ary)
VALUE result;
long i;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
result = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
+ if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
rb_ary_push(result, rb_ary_elt(ary, i));
}
}
return result;
}
-struct select_bang_arg {
- VALUE ary;
- long len[2];
-};
-
-static VALUE
-select_bang_i(VALUE a)
-{
- volatile struct select_bang_arg *arg = (void *)a;
- VALUE ary = arg->ary;
- long i1, i2;
-
- for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); arg->len[0] = ++i1) {
- VALUE v = RARRAY_AREF(ary, i1);
- if (!RTEST(rb_yield(v))) continue;
- if (i1 != i2) {
- rb_ary_store(ary, i2, v);
- }
- arg->len[1] = ++i2;
- }
- return (i1 == i2) ? Qnil : ary;
-}
-
-static VALUE
-select_bang_ensure(VALUE a)
-{
- volatile struct select_bang_arg *arg = (void *)a;
- VALUE ary = arg->ary;
- long len = RARRAY_LEN(ary);
- long i1 = arg->len[0], i2 = arg->len[1];
-
- if (i2 < i1) {
- if (i1 < len) {
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr + i2, ptr + i1, VALUE, len - i1);
- });
- }
- ARY_SET_LEN(ary, len - i1 + i2);
- }
- return ary;
-}
-
/*
* call-seq:
* ary.select! {|item| block } -> ary or nil
@@ -2905,8 +2667,6 @@ select_bang_ensure(VALUE a)
* Invokes the given block passing in successive elements from +self+,
* deleting elements for which the block returns a +false+ value.
*
- * The array may not be changed instantly every time the block is called.
- *
* If changes were made, it will return +self+, otherwise it returns +nil+.
*
* See also Array#keep_if
@@ -2918,14 +2678,23 @@ select_bang_ensure(VALUE a)
static VALUE
rb_ary_select_bang(VALUE ary)
{
- struct select_bang_arg args;
+ long i1, i2;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE v = RARRAY_PTR(ary)[i1];
+ if (!RTEST(rb_yield(v))) continue;
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, v);
+ }
+ i2++;
+ }
- args.ary = ary;
- args.len[0] = args.len[1] = 0;
- return rb_ensure(select_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
+ if (RARRAY_LEN(ary) == i2) return Qnil;
+ if (i2 < RARRAY_LEN(ary))
+ ARY_SET_LEN(ary, i2);
+ return ary;
}
/*
@@ -2947,7 +2716,7 @@ rb_ary_select_bang(VALUE ary)
static VALUE
rb_ary_keep_if(VALUE ary)
{
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_select_bang(ary);
return ary;
}
@@ -2992,7 +2761,7 @@ rb_ary_delete(VALUE ary, VALUE item)
long i1, i2;
for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
- VALUE e = RARRAY_AREF(ary, i1);
+ VALUE e = RARRAY_PTR(ary)[i1];
if (rb_equal(e, item)) {
v = e;
@@ -3021,7 +2790,7 @@ rb_ary_delete_same(VALUE ary, VALUE item)
long i1, i2;
for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
- VALUE e = RARRAY_AREF(ary, i1);
+ VALUE e = RARRAY_PTR(ary)[i1];
if (e == item) {
continue;
@@ -3051,10 +2820,9 @@ rb_ary_delete_at(VALUE ary, long pos)
}
rb_ary_modify(ary);
- del = RARRAY_AREF(ary, pos);
- RARRAY_PTR_USE(ary, ptr, {
- MEMMOVE(ptr+pos, ptr+pos+1, VALUE, len-pos-1);
- });
+ del = RARRAY_PTR(ary)[pos];
+ MEMMOVE(RARRAY_PTR(ary)+pos, RARRAY_PTR(ary)+pos+1, VALUE,
+ RARRAY_LEN(ary)-pos-1);
ARY_INCREASE_LEN(ary, -1);
return del;
@@ -3124,8 +2892,8 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
len = orig_len - pos;
}
if (len == 0) return rb_ary_new2(0);
- arg2 = rb_ary_new4(len, RARRAY_CONST_PTR(ary)+pos);
- RBASIC_SET_CLASS(arg2, rb_obj_class(ary));
+ arg2 = rb_ary_new4(len, RARRAY_PTR(ary)+pos);
+ RBASIC(arg2)->klass = rb_obj_class(ary);
rb_ary_splice(ary, pos, len, Qundef);
return arg2;
}
@@ -3159,41 +2927,32 @@ ary_reject(VALUE orig, VALUE result)
long i;
for (i = 0; i < RARRAY_LEN(orig); i++) {
- VALUE v = RARRAY_AREF(orig, i);
+ VALUE v = RARRAY_PTR(orig)[i];
if (!RTEST(rb_yield(v))) {
- rb_ary_push(result, v);
+ rb_ary_push_1(result, v);
}
}
return result;
}
static VALUE
-reject_bang_i(VALUE a)
-{
- volatile struct select_bang_arg *arg = (void *)a;
- VALUE ary = arg->ary;
- long i1, i2;
-
- for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); arg->len[0] = ++i1) {
- VALUE v = RARRAY_AREF(ary, i1);
- if (RTEST(rb_yield(v))) continue;
- if (i1 != i2) {
- rb_ary_store(ary, i2, v);
- }
- arg->len[1] = ++i2;
- }
- return (i1 == i2) ? Qnil : ary;
-}
-
-static VALUE
ary_reject_bang(VALUE ary)
{
- struct select_bang_arg args;
+ long i;
+ VALUE result = Qnil;
rb_ary_modify_check(ary);
- args.ary = ary;
- args.len[0] = args.len[1] = 0;
- return rb_ensure(reject_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
+ for (i = 0; i < RARRAY_LEN(ary); ) {
+ VALUE v = RARRAY_PTR(ary)[i];
+ if (RTEST(rb_yield(v))) {
+ rb_ary_delete_at(ary, i);
+ result = ary;
+ }
+ else {
+ i++;
+ }
+ }
+ return result;
}
/*
@@ -3201,10 +2960,11 @@ ary_reject_bang(VALUE ary)
* ary.reject! { |item| block } -> ary or nil
* ary.reject! -> Enumerator
*
- * Deletes every element of +self+ for which the block evaluates to +true+,
- * if no changes were made returns +nil+.
+ * Equivalent to Array#delete_if, deleting elements from +self+ for which the
+ * block evaluates to +true+, but returns +nil+ if no changes were made.
*
- * The array may not be changed instantly every time the block is called.
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
*
* See also Enumerable#reject and Array#delete_if.
*
@@ -3214,7 +2974,7 @@ ary_reject_bang(VALUE ary)
static VALUE
rb_ary_reject_bang(VALUE ary)
{
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
return ary_reject_bang(ary);
}
@@ -3224,7 +2984,7 @@ rb_ary_reject_bang(VALUE ary)
* ary.reject -> Enumerator
*
* Returns a new array containing the items in +self+ for which the given
- * block is not +true+. The ordering of non-rejected elements is maintained.
+ * block is not +true+.
*
* See also Array#delete_if
*
@@ -3236,7 +2996,7 @@ rb_ary_reject(VALUE ary)
{
VALUE rejected_ary;
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rejected_ary = rb_ary_new();
ary_reject(ary, rejected_ary);
return rejected_ary;
@@ -3256,22 +3016,21 @@ rb_ary_reject(VALUE ary)
*
* If no block is given, an Enumerator is returned instead.
*
- * scores = [ 97, 42, 75 ]
- * scores.delete_if {|score| score < 80 } #=> [97]
+ * a = [ "a", "b", "c" ]
+ * a.delete_if {|x| x >= "b" } #=> ["a"]
*/
static VALUE
rb_ary_delete_if(VALUE ary)
{
- RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
ary_reject_bang(ary);
return ary;
}
static VALUE
-take_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, cbarg))
+take_i(VALUE val, VALUE *args, int argc, VALUE *argv)
{
- VALUE *args = (VALUE *)cbarg;
if (args[1]-- == 0) rb_iter_break();
if (argc > 1) val = rb_ary_new4(argc, argv);
rb_ary_push(args[0], val);
@@ -3288,8 +3047,7 @@ take_items(VALUE obj, long n)
result = rb_ary_new2(n);
args[0] = result; args[1] = (VALUE)n;
if (rb_check_block_call(obj, idEach, 0, 0, take_i, (VALUE)args) == Qundef)
- rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (must respond to :each)",
- rb_obj_class(obj));
+ Check_Type(obj, T_ARRAY);
return result;
}
@@ -3303,7 +3061,7 @@ take_items(VALUE obj, long n)
* corresponding elements from each argument.
*
* This generates a sequence of <code>ary.size</code> _n_-element arrays,
- * where _n_ is one more than the count of arguments.
+ * where _n_ is one more that the count of arguments.
*
* If the size of any argument is less than the size of the initial array,
* +nil+ values are supplied.
@@ -3322,57 +3080,31 @@ static VALUE
rb_ary_zip(int argc, VALUE *argv, VALUE ary)
{
int i, j;
- long len = RARRAY_LEN(ary);
+ long len;
VALUE result = Qnil;
+ len = RARRAY_LEN(ary);
for (i=0; i<argc; i++) {
argv[i] = take_items(argv[i], len);
}
+ if (!rb_block_given_p()) {
+ result = rb_ary_new2(len);
+ }
- if (rb_block_given_p()) {
- int arity = rb_block_arity();
-
- if (arity > 1) {
- VALUE work, *tmp;
-
- tmp = ALLOCV_N(VALUE, work, argc+1);
-
- for (i=0; i<RARRAY_LEN(ary); i++) {
- tmp[0] = RARRAY_AREF(ary, i);
- for (j=0; j<argc; j++) {
- tmp[j+1] = rb_ary_elt(argv[j], i);
- }
- rb_yield_values2(argc+1, tmp);
- }
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ VALUE tmp = rb_ary_new2(argc+1);
- if (work) ALLOCV_END(work);
+ rb_ary_push(tmp, rb_ary_elt(ary, i));
+ for (j=0; j<argc; j++) {
+ rb_ary_push(tmp, rb_ary_elt(argv[j], i));
}
- else {
- for (i=0; i<RARRAY_LEN(ary); i++) {
- VALUE tmp = rb_ary_new2(argc+1);
-
- rb_ary_push(tmp, RARRAY_AREF(ary, i));
- for (j=0; j<argc; j++) {
- rb_ary_push(tmp, rb_ary_elt(argv[j], i));
- }
- rb_yield(tmp);
- }
+ if (NIL_P(result)) {
+ rb_yield(tmp);
}
- }
- else {
- result = rb_ary_new_capa(len);
-
- for (i=0; i<len; i++) {
- VALUE tmp = rb_ary_new_capa(argc+1);
-
- rb_ary_push(tmp, RARRAY_AREF(ary, i));
- for (j=0; j<argc; j++) {
- rb_ary_push(tmp, rb_ary_elt(argv[j], i));
- }
+ else {
rb_ary_push(result, tmp);
}
}
-
return result;
}
@@ -3420,7 +3152,6 @@ rb_ary_transpose(VALUE ary)
/*
* call-seq:
* ary.replace(other_ary) -> ary
- * ary.initialize_copy(other_ary) -> ary
*
* Replaces the contents of +self+ with the contents of +other_ary+,
* truncating or expanding if necessary.
@@ -3438,17 +3169,19 @@ rb_ary_replace(VALUE copy, VALUE orig)
if (copy == orig) return copy;
if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
+ VALUE *ptr;
VALUE shared = 0;
if (ARY_OWNS_HEAP_P(copy)) {
- RARRAY_PTR_USE(copy, ptr, ruby_sized_xfree(ptr, ARY_HEAP_SIZE(copy)));
- }
+ xfree(RARRAY_PTR(copy));
+ }
else if (ARY_SHARED_P(copy)) {
shared = ARY_SHARED(copy);
FL_UNSET_SHARED(copy);
}
FL_SET_EMBED(copy);
- ary_memcpy(copy, 0, RARRAY_LEN(orig), RARRAY_CONST_PTR(orig));
+ ptr = RARRAY_PTR(orig);
+ MEMCPY(RARRAY_PTR(copy), ptr, VALUE, RARRAY_LEN(orig));
if (shared) {
rb_ary_decrement_share(shared);
}
@@ -3457,13 +3190,13 @@ rb_ary_replace(VALUE copy, VALUE orig)
else {
VALUE shared = ary_make_shared(orig);
if (ARY_OWNS_HEAP_P(copy)) {
- RARRAY_PTR_USE(copy, ptr, ruby_sized_xfree(ptr, ARY_HEAP_SIZE(copy)));
+ xfree(RARRAY_PTR(copy));
}
else {
rb_ary_unshare_safe(copy);
}
FL_UNSET_EMBED(copy);
- ARY_SET_PTR(copy, RARRAY_CONST_PTR(orig));
+ ARY_SET_PTR(copy, RARRAY_PTR(orig));
ARY_SET_LEN(copy, RARRAY_LEN(orig));
rb_ary_set_shared(copy, shared);
}
@@ -3532,6 +3265,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
VALUE item, arg1, arg2;
long beg = 0, end = 0, len = 0;
+ VALUE *p, *pend;
int block_p = FALSE;
if (rb_block_given_p()) {
@@ -3573,7 +3307,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
if (end >= ARY_CAPA(ary)) {
ary_resize_capa(ary, end);
}
- ary_mem_clear(ary, RARRAY_LEN(ary), end - RARRAY_LEN(ary));
+ rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), end - RARRAY_LEN(ary));
ARY_SET_LEN(ary, end);
}
@@ -3584,11 +3318,15 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
for (i=beg; i<end; i++) {
v = rb_yield(LONG2NUM(i));
if (i>=RARRAY_LEN(ary)) break;
- ARY_SET(ary, i, v);
+ RARRAY_PTR(ary)[i] = v;
}
}
else {
- ary_memfill(ary, beg, len, item);
+ p = RARRAY_PTR(ary) + beg;
+ pend = p + len;
+ while (p < pend) {
+ *p++ = item;
+ }
}
return ary;
}
@@ -3602,16 +3340,8 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
*
* [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ]
* a = [ "a", "b", "c" ]
- * c = a + [ "d", "e", "f" ]
- * c #=> [ "a", "b", "c", "d", "e", "f" ]
- * a #=> [ "a", "b", "c" ]
- *
- * Note that
- * x += y
- * is the same as
- * x = x + y
- * This means that it produces a new array. As a consequence,
- * repeated use of <code>+=</code> on arrays can be quite inefficient.
+ * a + [ "d", "e", "f" ]
+ * a #=> [ "a", "b", "c", "d", "e", "f" ]
*
* See also Array#concat.
*/
@@ -3620,16 +3350,13 @@ VALUE
rb_ary_plus(VALUE x, VALUE y)
{
VALUE z;
- long len, xlen, ylen;
+ long len;
y = to_ary(y);
- xlen = RARRAY_LEN(x);
- ylen = RARRAY_LEN(y);
- len = xlen + ylen;
+ len = RARRAY_LEN(x) + RARRAY_LEN(y);
z = rb_ary_new2(len);
-
- ary_memcpy(z, 0, xlen, RARRAY_CONST_PTR(x));
- ary_memcpy(z, xlen, ylen, RARRAY_CONST_PTR(y));
+ MEMCPY(RARRAY_PTR(z), RARRAY_PTR(x), VALUE, RARRAY_LEN(x));
+ MEMCPY(RARRAY_PTR(z) + RARRAY_LEN(x), RARRAY_PTR(y), VALUE, RARRAY_LEN(y));
ARY_SET_LEN(z, len);
return z;
}
@@ -3680,8 +3407,7 @@ rb_ary_concat(VALUE x, VALUE y)
static VALUE
rb_ary_times(VALUE ary, VALUE times)
{
- VALUE ary2, tmp;
- const VALUE *ptr;
+ VALUE ary2, tmp, *ptr, *ptr2;
long t, len;
tmp = rb_check_string_type(times);
@@ -3705,16 +3431,17 @@ rb_ary_times(VALUE ary, VALUE times)
ary2 = ary_new(rb_obj_class(ary), len);
ARY_SET_LEN(ary2, len);
- ptr = RARRAY_CONST_PTR(ary);
+ ptr = RARRAY_PTR(ary);
+ ptr2 = RARRAY_PTR(ary2);
t = RARRAY_LEN(ary);
if (0 < t) {
- ary_memcpy(ary2, 0, t, ptr);
- while (t <= len/2) {
- ary_memcpy(ary2, t, t, RARRAY_CONST_PTR(ary2));
+ MEMCPY(ptr2, ptr, VALUE, t);
+ while (t <= len/2) {
+ MEMCPY(ptr2+t, ptr2, VALUE, t);
t *= 2;
}
if (t < len) {
- ary_memcpy(ary2, t, len-t, RARRAY_CONST_PTR(ary2));
+ MEMCPY(ptr2+t, ptr2, VALUE, len-t);
}
}
out:
@@ -3725,7 +3452,7 @@ rb_ary_times(VALUE ary, VALUE times)
/*
* call-seq:
- * ary.assoc(obj) -> element_ary or nil
+ * ary.assoc(obj) -> new_ary or nil
*
* Searches through an array whose elements are also arrays comparing +obj+
* with the first element of each contained array using <code>obj.==</code>.
@@ -3750,9 +3477,9 @@ rb_ary_assoc(VALUE ary, VALUE key)
VALUE v;
for (i = 0; i < RARRAY_LEN(ary); ++i) {
- v = rb_check_array_type(RARRAY_AREF(ary, i));
+ v = rb_check_array_type(RARRAY_PTR(ary)[i]);
if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
- rb_equal(RARRAY_AREF(v, 0), key))
+ rb_equal(RARRAY_PTR(v)[0], key))
return v;
}
return Qnil;
@@ -3760,7 +3487,7 @@ rb_ary_assoc(VALUE ary, VALUE key)
/*
* call-seq:
- * ary.rassoc(obj) -> element_ary or nil
+ * ary.rassoc(obj) -> new_ary or nil
*
* Searches through the array whose elements are also arrays.
*
@@ -3783,10 +3510,10 @@ rb_ary_rassoc(VALUE ary, VALUE value)
VALUE v;
for (i = 0; i < RARRAY_LEN(ary); ++i) {
- v = RARRAY_AREF(ary, i);
+ v = RARRAY_PTR(ary)[i];
if (RB_TYPE_P(v, T_ARRAY) &&
RARRAY_LEN(v) > 1 &&
- rb_equal(RARRAY_AREF(v, 1), value))
+ rb_equal(RARRAY_PTR(v)[1], value))
return v;
}
return Qnil;
@@ -3796,12 +3523,12 @@ static VALUE
recursive_equal(VALUE ary1, VALUE ary2, int recur)
{
long i, len1;
- const VALUE *p1, *p2;
+ VALUE *p1, *p2;
if (recur) return Qtrue; /* Subtle! */
- p1 = RARRAY_CONST_PTR(ary1);
- p2 = RARRAY_CONST_PTR(ary2);
+ p1 = RARRAY_PTR(ary1);
+ p2 = RARRAY_PTR(ary2);
len1 = RARRAY_LEN(ary1);
for (i = 0; i < len1; i++) {
@@ -3812,8 +3539,8 @@ recursive_equal(VALUE ary1, VALUE ary2, int recur)
return Qfalse;
if (len1 < i)
return Qtrue;
- p1 = RARRAY_CONST_PTR(ary1) + i;
- p2 = RARRAY_CONST_PTR(ary2) + i;
+ p1 = RARRAY_PTR(ary1) + i;
+ p2 = RARRAY_PTR(ary2) + i;
}
else {
return Qfalse;
@@ -3844,13 +3571,12 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) {
- if (!rb_respond_to(ary2, idTo_ary)) {
+ if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
return Qfalse;
}
return rb_equal(ary2, ary1);
}
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- if (RARRAY_CONST_PTR(ary1) == RARRAY_CONST_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
}
@@ -3872,7 +3598,7 @@ recursive_eql(VALUE ary1, VALUE ary2, int recur)
* ary.eql?(other) -> true or false
*
* Returns +true+ if +self+ and +other+ are the same object,
- * or are both arrays with the same content (according to Object#eql?).
+ * or are both arrays with the same content.
*/
static VALUE
@@ -3881,10 +3607,30 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) return Qfalse;
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- if (RARRAY_CONST_PTR(ary1) == RARRAY_CONST_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
}
+static VALUE
+recursive_hash(VALUE ary, VALUE dummy, int recur)
+{
+ long i;
+ st_index_t h;
+ VALUE n;
+
+ h = rb_hash_start(RARRAY_LEN(ary));
+ if (recur) {
+ h = rb_hash_uint(h, NUM2LONG(rb_hash(rb_cArray)));
+ }
+ else {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ n = rb_hash(RARRAY_PTR(ary)[i]);
+ h = rb_hash_uint(h, NUM2LONG(n));
+ }
+ }
+ h = rb_hash_end(h);
+ return LONG2FIX(h);
+}
+
/*
* call-seq:
* ary.hash -> fixnum
@@ -3893,25 +3639,12 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
*
* Two arrays with the same content will have the same hash code (and will
* compare using #eql?).
- *
- * See also Object#hash.
*/
static VALUE
rb_ary_hash(VALUE ary)
{
- long i;
- st_index_t h;
- VALUE n;
-
- h = rb_hash_start(RARRAY_LEN(ary));
- h = rb_hash_uint(h, (st_index_t)rb_ary_hash);
- for (i=0; i<RARRAY_LEN(ary); i++) {
- n = rb_hash(RARRAY_AREF(ary, i));
- h = rb_hash_uint(h, NUM2LONG(n));
- }
- h = rb_hash_end(h);
- return LONG2FIX(h);
+ return rb_exec_recursive_outer(recursive_hash, ary, 0);
}
/*
@@ -3919,7 +3652,7 @@ rb_ary_hash(VALUE ary)
* ary.include?(object) -> true or false
*
* Returns +true+ if the given +object+ is present in +self+ (that is, if any
- * element <code>==</code> +object+), otherwise returns +false+.
+ * object <code>==</code> +object+), otherwise returns +false+.
*
* a = [ "a", "b", "c" ]
* a.include?("b") #=> true
@@ -3930,15 +3663,9 @@ VALUE
rb_ary_includes(VALUE ary, VALUE item)
{
long i;
- VALUE e;
for (i=0; i<RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- switch (rb_equal_opt(e, item)) {
- case Qundef:
- if (rb_equal(e, item)) return Qtrue;
- break;
- case Qtrue:
+ if (rb_equal(RARRAY_PTR(ary)[i], item)) {
return Qtrue;
}
}
@@ -3957,8 +3684,7 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
len = RARRAY_LEN(ary2);
}
for (i=0; i<len; i++) {
- VALUE e1 = rb_ary_elt(ary1, i), e2 = rb_ary_elt(ary2, i);
- VALUE v = rb_funcallv(e1, id_cmp, 1, &e2);
+ VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
if (v != INT2FIX(0)) {
return v;
}
@@ -3975,24 +3701,17 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
*
* Each object in each array is compared (using the <=> operator).
*
- * Arrays are compared in an "element-wise" manner; the first element of +ary+
- * is compared with the first one of +other_ary+ using the <=> operator, then
- * each of the second elements, etc...
- * As soon as the result of any such comparison is non zero (i.e. the two
- * corresponding elements are not equal), that result is returned for the
- * whole array comparison.
+ * Arrays are compared in an "element-wise" manner; the first two elements
+ * that are not equal will determine the return value for the whole
+ * comparison.
*
- * If all the elements are equal, then the result is based on a comparison of
+ * If all the values are equal, then the return is based on a comparison of
* the array lengths. Thus, two arrays are "equal" according to Array#<=> if,
* and only if, they have the same length and the value of each element is
* equal to the value of the corresponding element in the other array.
*
- * +nil+ is returned if the +other_ary+ is not an array or if the comparison
- * of two elements returned +nil+.
- *
* [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
* [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
- * [ 1, 2 ] <=> [ 1, :two ] #=> nil
*
*/
@@ -4019,10 +3738,7 @@ ary_add_hash(VALUE hash, VALUE ary)
long i;
for (i=0; i<RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_AREF(ary, i);
- if (rb_hash_lookup2(hash, elt, Qundef) == Qundef) {
- rb_hash_aset(hash, elt, elt);
- }
+ rb_hash_aset(hash, RARRAY_PTR(ary)[i], Qtrue);
}
return hash;
}
@@ -4032,7 +3748,7 @@ ary_tmp_hash_new(void)
{
VALUE hash = rb_hash_new();
- RBASIC_CLEAR_CLASS(hash);
+ RBASIC(hash)->klass = 0;
return hash;
}
@@ -4072,7 +3788,6 @@ ary_recycle_hash(VALUE hash)
RHASH(hash)->ntbl = 0;
st_free_table(tbl);
}
- RB_GC_GUARD(hash);
}
/*
@@ -4082,10 +3797,9 @@ ary_recycle_hash(VALUE hash)
* Array Difference
*
* Returns a new array that is a copy of the original array, removing any
- * items that also appear in +other_ary+. The order is preserved from the
- * original array.
+ * items that also appear in +other_ary+.
*
- * It compares elements using their #hash and #eql? methods for efficiency.
+ * It compares elements using their hash (returned by the Object#hash method).
*
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
*
@@ -4096,14 +3810,14 @@ static VALUE
rb_ary_diff(VALUE ary1, VALUE ary2)
{
VALUE ary3;
- VALUE hash;
+ volatile VALUE hash;
long i;
hash = ary_make_hash(to_ary(ary2));
ary3 = rb_ary_new();
for (i=0; i<RARRAY_LEN(ary1); i++) {
- if (st_lookup(rb_hash_tbl_raw(hash), RARRAY_AREF(ary1, i), 0)) continue;
+ if (st_lookup(RHASH_TBL(hash), RARRAY_PTR(ary1)[i], 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
ary_recycle_hash(hash);
@@ -4115,10 +3829,7 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
* ary & other_ary -> new_ary
*
* Set Intersection --- Returns a new array containing elements common to the
- * two arrays, excluding any duplicates. The order is preserved from the
- * original array.
- *
- * It compares elements using their #hash and #eql? methods for efficiency.
+ * two arrays, excluding any duplicates.
*
* [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
* [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
@@ -4131,20 +3842,20 @@ static VALUE
rb_ary_and(VALUE ary1, VALUE ary2)
{
VALUE hash, ary3, v;
- st_table *table;
st_data_t vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new();
- if (RARRAY_LEN(ary2) == 0) return ary3;
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1) < RARRAY_LEN(ary2) ?
+ RARRAY_LEN(ary1) : RARRAY_LEN(ary2));
hash = ary_make_hash(ary2);
- table = rb_hash_tbl_raw(hash);
+
+ if (RHASH_EMPTY_P(hash))
+ return ary3;
for (i=0; i<RARRAY_LEN(ary1); i++) {
- v = RARRAY_AREF(ary1, i);
- vv = (st_data_t)v;
- if (st_delete(table, &vv, 0)) {
+ vv = (st_data_t)(v = rb_ary_elt(ary1, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
@@ -4153,22 +3864,12 @@ rb_ary_and(VALUE ary1, VALUE ary2)
return ary3;
}
-static int
-ary_hash_orset(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
-{
- if (existing) return ST_STOP;
- *key = *value = (VALUE)arg;
- return ST_CONTINUE;
-}
-
/*
* call-seq:
* ary | other_ary -> new_ary
*
* Set Union --- Returns a new array by joining +ary+ with +other_ary+,
- * excluding any duplicates and preserving the order from the original array.
- *
- * It compares elements using their #hash and #eql? methods for efficiency.
+ * excluding any duplicates.
*
* [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
*
@@ -4178,19 +3879,26 @@ ary_hash_orset(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
static VALUE
rb_ary_or(VALUE ary1, VALUE ary2)
{
- VALUE hash, ary3;
+ VALUE hash, ary3, v;
+ st_data_t vv;
long i;
ary2 = to_ary(ary2);
- hash = ary_make_hash(ary1);
+ ary3 = rb_ary_new2(RARRAY_LEN(ary1)+RARRAY_LEN(ary2));
+ hash = ary_add_hash(ary_make_hash(ary1), ary2);
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ vv = (st_data_t)(v = rb_ary_elt(ary1, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_push(ary3, v);
+ }
+ }
for (i=0; i<RARRAY_LEN(ary2); i++) {
- VALUE elt = RARRAY_AREF(ary2, i);
- if (!st_update(RHASH_TBL_RAW(hash), (st_data_t)elt, ary_hash_orset, (st_data_t)elt)) {
- RB_OBJ_WRITTEN(hash, Qundef, elt);
+ vv = (st_data_t)(v = rb_ary_elt(ary2, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_push(ary3, v);
}
}
- ary3 = rb_hash_values(hash);
ary_recycle_hash(hash);
return ary3;
}
@@ -4212,10 +3920,6 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
* If a block is given, it will use the return value of the block for
* comparison.
*
- * It compares values using their #hash and #eql? methods for efficiency.
- *
- * +self+ is traversed in order, and the first occurrence is kept.
- *
* Returns +nil+ if no changes are made (that is, no duplicates are found).
*
* a = [ "a", "a", "b", "b", "c" ]
@@ -4232,29 +3936,38 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
static VALUE
rb_ary_uniq_bang(VALUE ary)
{
- VALUE hash;
- long hash_size;
+ VALUE hash, v;
+ long i, j;
rb_ary_modify_check(ary);
if (RARRAY_LEN(ary) <= 1)
return Qnil;
- if (rb_block_given_p())
+ if (rb_block_given_p()) {
hash = ary_make_hash_by(ary);
- else
- hash = ary_make_hash(ary);
-
- hash_size = RHASH_SIZE(hash);
- if (RARRAY_LEN(ary) == hash_size) {
- return Qnil;
+ if (RARRAY_LEN(ary) == (i = RHASH_SIZE(hash))) {
+ return Qnil;
+ }
+ ARY_SET_LEN(ary, 0);
+ if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ FL_SET_EMBED(ary);
+ }
+ ary_resize_capa(ary, i);
+ st_foreach(RHASH_TBL(hash), push_value, ary);
}
- rb_ary_modify_check(ary);
- ARY_SET_LEN(ary, 0);
- if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
- rb_ary_unshare(ary);
- FL_SET_EMBED(ary);
+ else {
+ hash = ary_make_hash(ary);
+ if (RARRAY_LEN(ary) == (long)RHASH_SIZE(hash)) {
+ return Qnil;
+ }
+ for (i=j=0; i<RARRAY_LEN(ary); i++) {
+ st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_store(ary, j++, v);
+ }
+ }
+ ARY_SET_LEN(ary, j);
}
- ary_resize_capa(ary, hash_size);
- st_foreach(rb_hash_tbl_raw(hash), push_value, ary);
ary_recycle_hash(hash);
return ary;
@@ -4269,9 +3982,8 @@ rb_ary_uniq_bang(VALUE ary)
*
* If a block is given, it will use the return value of the block for comparison.
*
- * It compares values using their #hash and #eql? methods for efficiency.
- *
- * +self+ is traversed in order, and the first occurrence is kept.
+ * It compares elements using their hash (provided by the Object#hash method)
+ * then compares hashes with Object#eql?.
*
* a = [ "a", "a", "b", "b", "c" ]
* a.uniq # => ["a", "b", "c"]
@@ -4284,19 +3996,26 @@ rb_ary_uniq_bang(VALUE ary)
static VALUE
rb_ary_uniq(VALUE ary)
{
- VALUE hash, uniq;
+ VALUE hash, uniq, v;
+ long i;
if (RARRAY_LEN(ary) <= 1)
return rb_ary_dup(ary);
if (rb_block_given_p()) {
hash = ary_make_hash_by(ary);
- uniq = rb_hash_values(hash);
+ uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
+ st_foreach(RHASH_TBL(hash), push_value, uniq);
}
else {
hash = ary_make_hash(ary);
- uniq = rb_hash_values(hash);
+ uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
+ if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ rb_ary_push(uniq, v);
+ }
+ }
}
- RBASIC_SET_CLASS(uniq, rb_obj_class(ary));
ary_recycle_hash(hash);
return uniq;
@@ -4321,18 +4040,21 @@ rb_ary_compact_bang(VALUE ary)
long n;
rb_ary_modify(ary);
- p = t = (VALUE *)RARRAY_CONST_PTR(ary); /* WB: no new reference */
+ p = t = RARRAY_PTR(ary);
end = p + RARRAY_LEN(ary);
while (t < end) {
if (NIL_P(*t)) t++;
else *p++ = *t++;
}
- n = p - RARRAY_CONST_PTR(ary);
+ n = p - RARRAY_PTR(ary);
if (RARRAY_LEN(ary) == n) {
return Qnil;
}
- ary_resize_smaller(ary, n);
+ ARY_SET_LEN(ary, n);
+ if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
+ ary_resize_capa(ary, n * 2);
+ }
return ary;
}
@@ -4364,7 +4086,7 @@ rb_ary_compact(VALUE ary)
* Returns the number of elements.
*
* If an argument is given, counts the number of elements which equal +obj+
- * using <code>==</code>.
+ * using <code>===</code>.
*
* If a block is given, counts the number of elements for which the block
* returns a true value.
@@ -4379,28 +4101,27 @@ rb_ary_compact(VALUE ary)
static VALUE
rb_ary_count(int argc, VALUE *argv, VALUE ary)
{
- long i, n = 0;
+ long n = 0;
if (argc == 0) {
- VALUE v;
+ VALUE *p, *pend;
if (!rb_block_given_p())
return LONG2NUM(RARRAY_LEN(ary));
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- v = RARRAY_AREF(ary, i);
- if (RTEST(rb_yield(v))) n++;
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
+ if (RTEST(rb_yield(*p))) n++;
}
}
else {
- VALUE obj;
+ VALUE obj, *p, *pend;
rb_scan_args(argc, argv, "1", &obj);
if (rb_block_given_p()) {
rb_warn("given block not used");
}
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (rb_equal(RARRAY_AREF(ary, i), obj)) n++;
+ for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
+ if (rb_equal(*p, obj)) n++;
}
}
@@ -4423,16 +4144,12 @@ flatten(VALUE ary, int level, int *modified)
while (1) {
while (i < RARRAY_LEN(ary)) {
- elt = RARRAY_AREF(ary, i++);
- if (level >= 0 && RARRAY_LEN(stack) / 2 >= level) {
- rb_ary_push(result, elt);
- continue;
- }
+ elt = RARRAY_PTR(ary)[i++];
tmp = rb_check_array_type(elt);
if (RBASIC(result)->klass) {
rb_raise(rb_eRuntimeError, "flatten reentered");
}
- if (NIL_P(tmp)) {
+ if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
rb_ary_push(result, elt);
}
else {
@@ -4461,14 +4178,14 @@ flatten(VALUE ary, int level, int *modified)
st_free_table(memo);
- RBASIC_SET_CLASS(result, rb_obj_class(ary));
+ RBASIC(result)->klass = rb_class_of(ary);
return result;
}
/*
* call-seq:
- * ary.flatten! -> ary or nil
- * ary.flatten!(level) -> ary or nil
+ * ary.flatten! -> Array or nil
+ * ary.flatten!(level) -> Array or nil
*
* Flattens +self+ in place.
*
@@ -4548,7 +4265,7 @@ rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
#define OPTHASH_GIVEN_P(opts) \
(argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
-static ID id_random;
+static VALUE sym_random;
#define RAND_UPTO(max) (long)rb_random_ulong_limited((randgen), (max)-1)
@@ -4559,46 +4276,34 @@ static ID id_random;
*
* Shuffles elements in +self+ in place.
*
- * a = [ 1, 2, 3 ] #=> [1, 2, 3]
- * a.shuffle! #=> [2, 3, 1]
- * a #=> [2, 3, 1]
- *
* The optional +rng+ argument will be used as the random number generator.
- *
- * a.shuffle!(random: Random.new(1)) #=> [1, 3, 2]
*/
static VALUE
rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
{
- VALUE opts, randgen = rb_cRandom;
- long i, len;
+ VALUE *ptr, opts, *snap_ptr, randgen = rb_cRandom;
+ long i, snap_len;
if (OPTHASH_GIVEN_P(opts)) {
- VALUE rnd;
- ID keyword_ids[1];
-
- keyword_ids[0] = id_random;
- rb_get_kwargs(opts, keyword_ids, 0, 1, &rnd);
- if (rnd != Qundef) {
- randgen = rnd;
- }
+ randgen = rb_hash_lookup2(opts, sym_random, randgen);
}
rb_check_arity(argc, 0, 0);
rb_ary_modify(ary);
- i = len = RARRAY_LEN(ary);
- RARRAY_PTR_USE(ary, ptr, {
- while (i) {
- long j = RAND_UPTO(i);
- VALUE tmp;
- if (len != RARRAY_LEN(ary) || ptr != RARRAY_CONST_PTR(ary)) {
- rb_raise(rb_eRuntimeError, "modified during shuffle");
- }
- tmp = ptr[--i];
- ptr[i] = ptr[j];
- ptr[j] = tmp;
+ i = RARRAY_LEN(ary);
+ ptr = RARRAY_PTR(ary);
+ snap_len = i;
+ snap_ptr = ptr;
+ while (i) {
+ long j = RAND_UPTO(i);
+ VALUE tmp;
+ if (snap_len != RARRAY_LEN(ary) || snap_ptr != RARRAY_PTR(ary)) {
+ rb_raise(rb_eRuntimeError, "modified during shuffle");
}
- }); /* WB: no new reference */
+ tmp = ptr[--i];
+ ptr[i] = ptr[j];
+ ptr[j] = tmp;
+ }
return ary;
}
@@ -4612,7 +4317,6 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
*
* a = [ 1, 2, 3 ] #=> [1, 2, 3]
* a.shuffle #=> [2, 3, 1]
- * a #=> [1, 2, 3]
*
* The optional +rng+ argument will be used as the random number generator.
*
@@ -4655,29 +4359,27 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_sample(int argc, VALUE *argv, VALUE ary)
{
- VALUE nv, result;
+ VALUE nv, result, *ptr;
VALUE opts, randgen = rb_cRandom;
long n, len, i, j, k, idx[10];
long rnds[numberof(idx)];
if (OPTHASH_GIVEN_P(opts)) {
- VALUE rnd;
- ID keyword_ids[1];
-
- keyword_ids[0] = id_random;
- rb_get_kwargs(opts, keyword_ids, 0, 1, &rnd);
- if (rnd != Qundef) {
- randgen = rnd;
- }
+ randgen = rb_hash_lookup2(opts, sym_random, randgen);
}
+ ptr = RARRAY_PTR(ary);
len = RARRAY_LEN(ary);
if (argc == 0) {
- if (len < 2)
+ if (len == 0) return Qnil;
+ if (len == 1) {
i = 0;
- else
+ }
+ else {
i = RAND_UPTO(len);
-
- return rb_ary_elt(ary, i);
+ if ((len = RARRAY_LEN(ary)) <= i) return Qnil;
+ ptr = RARRAY_PTR(ary);
+ }
+ return ptr[i];
}
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
@@ -4690,23 +4392,28 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
}
k = len;
len = RARRAY_LEN(ary);
- if (len < k && n <= numberof(idx)) {
- for (i = 0; i < n; ++i) {
- if (rnds[i] >= len) return rb_ary_new_capa(0);
+ ptr = RARRAY_PTR(ary);
+ if (len < k) {
+ if (n <= numberof(idx)) {
+ for (i = 0; i < n; ++i) {
+ if (rnds[i] >= len) {
+ return rb_ary_new2(0);
+ }
+ }
}
}
if (n > len) n = len;
switch (n) {
case 0:
- return rb_ary_new_capa(0);
+ return rb_ary_new2(0);
case 1:
i = rnds[0];
- return rb_ary_new_from_values(1, &RARRAY_AREF(ary, i));
+ return rb_ary_new4(1, &ptr[i]);
case 2:
i = rnds[0];
j = rnds[1];
if (j >= i) j++;
- return rb_ary_new_from_args(2, RARRAY_AREF(ary, i), RARRAY_AREF(ary, j));
+ return rb_ary_new3(2, ptr[i], ptr[j]);
case 3:
i = rnds[0];
j = rnds[1];
@@ -4716,9 +4423,10 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
if (j >= i) l = i, g = ++j;
if (k >= l && (++k >= g)) ++k;
}
- return rb_ary_new_from_args(3, RARRAY_AREF(ary, i), RARRAY_AREF(ary, j), RARRAY_AREF(ary, k));
+ return rb_ary_new3(3, ptr[i], ptr[j], ptr[k]);
}
if (n <= numberof(idx)) {
+ VALUE *ptr_result;
long sorted[numberof(idx)];
sorted[0] = idx[0] = rnds[0];
for (i=1; i<n; i++) {
@@ -4730,26 +4438,25 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
memmove(&sorted[j+1], &sorted[j], sizeof(sorted[0])*(i-j));
sorted[j] = idx[i] = k;
}
- result = rb_ary_new_capa(n);
- RARRAY_PTR_USE(result, ptr_result, {
- for (i=0; i<n; i++) {
- ptr_result[i] = RARRAY_AREF(ary, idx[i]);
- }
- });
+ result = rb_ary_new2(n);
+ ptr_result = RARRAY_PTR(result);
+ for (i=0; i<n; i++) {
+ ptr_result[i] = ptr[idx[i]];
+ }
}
else {
- result = rb_ary_dup(ary);
- RBASIC_CLEAR_CLASS(result);
+ VALUE *ptr_result;
+ result = rb_ary_new4(len, ptr);
+ RBASIC(result)->klass = 0;
+ ptr_result = RARRAY_PTR(result);
RB_GC_GUARD(ary);
- RARRAY_PTR_USE(result, ptr_result, {
- for (i=0; i<n; i++) {
- j = RAND_UPTO(len-i) + i;
- nv = ptr_result[j];
- ptr_result[j] = ptr_result[i];
- ptr_result[i] = nv;
- }
- });
- RBASIC_SET_CLASS_RAW(result, rb_cArray);
+ for (i=0; i<n; i++) {
+ j = RAND_UPTO(len-i) + i;
+ nv = ptr_result[j];
+ ptr_result[j] = ptr_result[i];
+ ptr_result[i] = nv;
+ }
+ RBASIC(result)->klass = rb_cArray;
}
ARY_SET_LEN(result, n);
@@ -4757,19 +4464,18 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
}
static VALUE
-rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
+rb_ary_cycle_size(VALUE self, VALUE args)
{
long mul;
VALUE n = Qnil;
if (args && (RARRAY_LEN(args) > 0)) {
- n = RARRAY_AREF(args, 0);
+ n = RARRAY_PTR(args)[0];
}
if (RARRAY_LEN(self) == 0) return INT2FIX(0);
if (n == Qnil) return DBL2NUM(INFINITY);
mul = NUM2LONG(n);
if (mul <= 0) return INT2FIX(0);
- n = LONG2FIX(mul);
- return rb_funcallv(rb_ary_length(self), '*', 1, &n);
+ return rb_funcall(rb_ary_length(self), '*', 1, LONG2FIX(mul));
}
/*
@@ -4811,38 +4517,20 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
while (RARRAY_LEN(ary) > 0 && (n < 0 || 0 < n--)) {
for (i=0; i<RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_AREF(ary, i));
+ rb_yield(RARRAY_PTR(ary)[i]);
}
}
return Qnil;
}
#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
-#define tmpbuf_discard(s) (rb_str_resize((s), 0L), RBASIC_SET_CLASS_RAW(s, rb_cString))
+#define tmpbuf_discard(s) (rb_str_resize((s), 0L), RBASIC(s)->klass = rb_cString)
#define tmpary(n) rb_ary_tmp_new(n)
-#define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))
+#define tmpary_discard(a) (ary_discard(a), RBASIC(a)->klass = rb_cArray)
/*
- * Build a ruby array of the corresponding values and yield it to the
- * associated block.
- * Return the class of +values+ for reentry check.
- */
-static int
-yield_indexed_values(const VALUE values, const long r, const long *const p)
-{
- const VALUE result = rb_ary_new2(r);
- VALUE *const result_array = RARRAY_PTR(result);
- const VALUE *const values_array = RARRAY_CONST_PTR(values);
- long i;
-
- for (i = 0; i < r; i++) result_array[i] = values_array[p[i]];
- ARY_SET_LEN(result, r);
- rb_yield(result);
- return !RBASIC(values)->klass;
-}
-
-/*
- * Compute permutations of +r+ elements of the set <code>[0..n-1]</code>.
+ * Recursively compute permutations of +r+ elements of the set
+ * <code>[0..n-1]</code>.
*
* When we have a complete permutation of array indexes, copy the values
* at those indexes into a new array and yield that array.
@@ -4850,40 +4538,38 @@ yield_indexed_values(const VALUE values, const long r, const long *const p)
* n: the size of the set
* r: the number of elements in each permutation
* p: the array (of size r) that we're filling in
+ * index: what index we're filling in now
* used: an array of booleans: whether a given index is already used
* values: the Ruby array that holds the actual values to permute
*/
static void
-permute0(const long n, const long r, long *const p, char *const used, const VALUE values)
+permute0(long n, long r, long *p, long index, char *used, VALUE values)
{
- long i = 0, index = 0;
-
- for (;;) {
- const char *const unused = memchr(&used[i], 0, n-i);
- if (!unused) {
- if (!index) break;
- i = p[--index]; /* pop index */
- used[i++] = 0; /* index unused */
- }
- else {
- i = unused - used;
+ long i,j;
+ for (i = 0; i < n; i++) {
+ if (used[i] == 0) {
p[index] = i;
- used[i] = 1; /* mark index used */
- ++index;
if (index < r-1) { /* if not done yet */
- p[index] = i = 0;
- continue;
+ used[i] = 1; /* mark index used */
+ permute0(n, r, p, index+1, /* recurse */
+ used, values);
+ used[i] = 0; /* index unused */
}
- for (i = 0; i < n; ++i) {
- if (used[i]) continue;
- p[index] = i;
- if (!yield_indexed_values(values, r, p)) {
+ else {
+ /* We have a complete permutation of array indexes */
+ /* Build a ruby array of the corresponding values */
+ /* And yield it to the associated block */
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
rb_raise(rb_eRuntimeError, "permute reentered");
}
}
- i = p[--index]; /* pop index */
- used[i] = 0; /* index unused */
- p[index] = ++i;
}
}
}
@@ -4897,8 +4583,7 @@ descending_factorial(long from, long how_many)
{
VALUE cnt = LONG2FIX(how_many >= 0);
while (how_many-- > 0) {
- VALUE v = LONG2FIX(from--);
- cnt = rb_funcallv(cnt, '*', 1, &v);
+ cnt = rb_funcall(cnt, '*', 1, LONG2FIX(from--));
}
return cnt;
}
@@ -4906,23 +4591,20 @@ descending_factorial(long from, long how_many)
static VALUE
binomial_coefficient(long comb, long size)
{
- VALUE r, v;
if (comb > size-comb) {
comb = size-comb;
}
if (comb < 0) {
return LONG2FIX(0);
}
- r = descending_factorial(size, comb);
- v = descending_factorial(comb, comb);
- return rb_funcallv(r, id_div, 1, &v);
+ return rb_funcall(descending_factorial(size, comb), id_div, 1, descending_factorial(comb, comb));
}
static VALUE
-rb_ary_permutation_size(VALUE ary, VALUE args, VALUE eobj)
+rb_ary_permutation_size(VALUE ary, VALUE args)
{
long n = RARRAY_LEN(ary);
- long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_AREF(args, 0)) : n;
+ long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_PTR(args)[0]) : n;
return descending_factorial(n, k);
}
@@ -4974,51 +4656,32 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
}
else if (r == 1) { /* this is a special, easy case */
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
}
}
else { /* this is the general case */
- volatile VALUE t0;
- long *p = ALLOCV_N(long, t0, r+roomof(n, sizeof(long)));
- char *used = (char*)(p + r);
+ volatile VALUE t0 = tmpbuf(n,sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
+ volatile VALUE t1 = tmpbuf(n,sizeof(char));
+ char *used = (char*)RSTRING_PTR(t1);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
- RBASIC_CLEAR_CLASS(ary0);
+ RBASIC(ary0)->klass = 0;
MEMZERO(used, char, n); /* initialize array */
- permute0(n, r, p, used, ary0); /* compute and yield permutations */
- ALLOCV_END(t0);
- RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
+ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
+ tmpbuf_discard(t0);
+ tmpbuf_discard(t1);
+ RBASIC(ary0)->klass = rb_cArray;
}
return ary;
}
-static void
-combinate0(const long len, const long n, long *const stack, const VALUE values)
-{
- long lev = 0;
-
- MEMZERO(stack+1, long, n);
- stack[0] = -1;
- for (;;) {
- for (lev++; lev < n; lev++) {
- stack[lev+1] = stack[lev]+1;
- }
- if (!yield_indexed_values(values, n, stack+1)) {
- rb_raise(rb_eRuntimeError, "combination reentered");
- }
- do {
- if (lev == 0) return;
- stack[lev--]++;
- } while (stack[lev+1]+n == len+lev+1);
- }
-}
-
static VALUE
-rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
+rb_ary_combination_size(VALUE ary, VALUE args)
{
long n = RARRAY_LEN(ary);
- long k = NUM2LONG(RARRAY_AREF(args, 0));
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
return binomial_coefficient(k, n);
}
@@ -5051,7 +4714,7 @@ rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
static VALUE
rb_ary_combination(VALUE ary, VALUE num)
{
- long i, n, len;
+ long n, i, len;
n = NUM2LONG(num);
RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_combination_size);
@@ -5064,24 +4727,41 @@ rb_ary_combination(VALUE ary, VALUE num)
}
else if (n == 1) {
for (i = 0; i < len; i++) {
- rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
}
}
else {
- VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
- volatile VALUE t0;
- long *stack = ALLOCV_N(long, t0, n+1);
-
- RBASIC_CLEAR_CLASS(ary0);
- combinate0(len, n, stack, ary0);
- ALLOCV_END(t0);
- RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
+ volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
+ long *stack = (long*)RSTRING_PTR(t0);
+ volatile VALUE cc = tmpary(n);
+ VALUE *chosen = RARRAY_PTR(cc);
+ long lev = 0;
+
+ MEMZERO(stack, long, n);
+ stack[0] = -1;
+ for (;;) {
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1]];
+ for (lev++; lev < n; lev++) {
+ chosen[lev] = RARRAY_PTR(ary)[stack[lev+1] = stack[lev]+1];
+ }
+ rb_yield(rb_ary_new4(n, chosen));
+ if (RBASIC(t0)->klass) {
+ rb_raise(rb_eRuntimeError, "combination reentered");
+ }
+ do {
+ if (lev == 0) goto done;
+ stack[lev--]++;
+ } while (stack[lev+1]+n == len+lev+1);
+ }
+ done:
+ tmpbuf_discard(t0);
+ tmpary_discard(cc);
}
return ary;
}
/*
- * Compute repeated permutations of +r+ elements of the set
+ * Recursively compute repeated permutations of +r+ elements of the set
* <code>[0..n-1]</code>.
*
* When we have a complete repeated permutation of array indexes, copy the
@@ -5090,44 +4770,47 @@ rb_ary_combination(VALUE ary, VALUE num)
* n: the size of the set
* r: the number of elements in each permutation
* p: the array (of size r) that we're filling in
+ * index: what index we're filling in now
* values: the Ruby array that holds the actual values to permute
*/
static void
-rpermute0(const long n, const long r, long *const p, const VALUE values)
+rpermute0(long n, long r, long *p, long index, VALUE values)
{
- long i = 0, index = 0;
-
- p[index] = i;
- for (;;) {
- if (++index < r-1) {
- p[index] = i = 0;
- continue;
+ long i, j;
+ for (i = 0; i < n; i++) {
+ p[index] = i;
+ if (index < r-1) { /* if not done yet */
+ rpermute0(n, r, p, index+1, values); /* recurse */
}
- for (i = 0; i < n; ++i) {
- p[index] = i;
- if (!yield_indexed_values(values, r, p)) {
+ else {
+ /* We have a complete permutation of array indexes */
+ /* Build a ruby array of the corresponding values */
+ /* And yield it to the associated block */
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
rb_raise(rb_eRuntimeError, "repeated permute reentered");
}
}
- do {
- if (index <= 0) return;
- } while ((i = ++p[--index]) >= n);
}
}
static VALUE
-rb_ary_repeated_permutation_size(VALUE ary, VALUE args, VALUE eobj)
+rb_ary_repeated_permutation_size(VALUE ary, VALUE args)
{
long n = RARRAY_LEN(ary);
- long k = NUM2LONG(RARRAY_AREF(args, 0));
- VALUE v;
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
if (k < 0) {
return LONG2FIX(0);
}
- v = LONG2NUM(k);
- return rb_funcallv(LONG2NUM(n), id_power, 1, &v);
+ return rb_funcall(LONG2NUM(n), id_power, 1, LONG2NUM(k));
}
/*
@@ -5170,50 +4853,51 @@ rb_ary_repeated_permutation(VALUE ary, VALUE num)
}
else if (r == 1) { /* this is a special, easy case */
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
}
}
else { /* this is the general case */
- volatile VALUE t0;
- long *p = ALLOCV_N(long, t0, r);
+ volatile VALUE t0 = tmpbuf(r, sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
- RBASIC_CLEAR_CLASS(ary0);
+ RBASIC(ary0)->klass = 0;
- rpermute0(n, r, p, ary0); /* compute and yield repeated permutations */
- ALLOCV_END(t0);
- RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
+ rpermute0(n, r, p, 0, ary0); /* compute and yield repeated permutations */
+ tmpbuf_discard(t0);
+ RBASIC(ary0)->klass = rb_cArray;
}
return ary;
}
static void
-rcombinate0(const long n, const long r, long *const p, const long rest, const VALUE values)
+rcombinate0(long n, long r, long *p, long index, long rest, VALUE values)
{
- long i = 0, index = 0;
-
- p[index] = i;
- for (;;) {
- if (++index < r-1) {
- p[index] = i;
- continue;
+ long j;
+ if (rest > 0) {
+ for (; index < n; ++index) {
+ p[r-rest] = index;
+ rcombinate0(n, r, p, index, rest-1, values);
}
- for (; i < n; ++i) {
- p[index] = i;
- if (!yield_indexed_values(values, r, p)) {
- rb_raise(rb_eRuntimeError, "repeated combination reentered");
- }
+ }
+ else {
+ VALUE result = rb_ary_new2(r);
+ VALUE *result_array = RARRAY_PTR(result);
+ const VALUE *values_array = RARRAY_PTR(values);
+
+ for (j = 0; j < r; ++j) result_array[j] = values_array[p[j]];
+ ARY_SET_LEN(result, r);
+ rb_yield(result);
+ if (RBASIC(values)->klass) {
+ rb_raise(rb_eRuntimeError, "repeated combination reentered");
}
- do {
- if (index <= 0) return;
- } while ((i = ++p[--index]) >= n);
}
}
static VALUE
-rb_ary_repeated_combination_size(VALUE ary, VALUE args, VALUE eobj)
+rb_ary_repeated_combination_size(VALUE ary, VALUE args)
{
long n = RARRAY_LEN(ary);
- long k = NUM2LONG(RARRAY_AREF(args, 0));
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
if (k == 0) {
return LONG2FIX(1);
}
@@ -5263,21 +4947,21 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
}
else if (n == 1) {
for (i = 0; i < len; i++) {
- rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
+ rb_yield(rb_ary_new3(1, RARRAY_PTR(ary)[i]));
}
}
else if (len == 0) {
/* yield nothing */
}
else {
- volatile VALUE t0;
- long *p = ALLOCV_N(long, t0, n);
+ volatile VALUE t0 = tmpbuf(n, sizeof(long));
+ long *p = (long*)RSTRING_PTR(t0);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
- RBASIC_CLEAR_CLASS(ary0);
+ RBASIC(ary0)->klass = 0;
- rcombinate0(len, n, p, n, ary0); /* compute and yield repeated combinations */
- ALLOCV_END(t0);
- RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
+ rcombinate0(len, n, p, 0, n, ary0); /* compute and yield repeated combinations */
+ tmpbuf_discard(t0);
+ RBASIC(ary0)->klass = rb_cArray;
}
return ary;
}
@@ -5315,8 +4999,8 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
long i,j;
long resultlen = 1;
- RBASIC_CLEAR_CLASS(t0);
- RBASIC_CLEAR_CLASS(t1);
+ RBASIC(t0)->klass = 0;
+ RBASIC(t1)->klass = 0;
/* initialize the arrays of arrays */
ARY_SET_LEN(t0, n);
@@ -5338,14 +5022,15 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
else {
/* Compute the length of the result array; return [] if any is empty */
for (i = 0; i < n; i++) {
- long k = RARRAY_LEN(arrays[i]);
+ long k = RARRAY_LEN(arrays[i]), l = resultlen;
if (k == 0) {
result = rb_ary_new2(0);
goto done;
}
- if (MUL_OVERFLOW_LONG_P(resultlen, k))
- rb_raise(rb_eRangeError, "too big to product");
resultlen *= k;
+ if (resultlen < k || resultlen < l || resultlen / k != l) {
+ rb_raise(rb_eRangeError, "too big to product");
+ }
}
result = rb_ary_new2(resultlen);
}
@@ -5419,7 +5104,7 @@ rb_ary_take(VALUE obj, VALUE n)
/*
* call-seq:
- * ary.take_while { |obj| block } -> new_ary
+ * ary.take_while { |arr| block } -> new_ary
* ary.take_while -> Enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+, then
@@ -5441,7 +5126,7 @@ rb_ary_take_while(VALUE ary)
RETURN_ENUMERATOR(ary, 0, 0);
for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (!RTEST(rb_yield(RARRAY_AREF(ary, i)))) break;
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
}
return rb_ary_take(ary, LONG2FIX(i));
}
@@ -5478,7 +5163,7 @@ rb_ary_drop(VALUE ary, VALUE n)
/*
* call-seq:
- * ary.drop_while { |obj| block } -> new_ary
+ * ary.drop_while { |arr| block } -> new_ary
* ary.drop_while -> Enumerator
*
* Drops elements up to, but not including, the first element for which the
@@ -5501,63 +5186,12 @@ rb_ary_drop_while(VALUE ary)
RETURN_ENUMERATOR(ary, 0, 0);
for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (!RTEST(rb_yield(RARRAY_AREF(ary, i)))) break;
+ if (!RTEST(rb_yield(RARRAY_PTR(ary)[i]))) break;
}
return rb_ary_drop(ary, LONG2FIX(i));
}
/*
- * call-seq:
- * ary.any? [{ |obj| block }] -> true or false
- *
- * See also Enumerable#any?
- */
-
-static VALUE
-rb_ary_any_p(VALUE ary)
-{
- long i, len = RARRAY_LEN(ary);
- const VALUE *ptr = RARRAY_CONST_PTR(ary);
-
- if (!len) return Qfalse;
- if (!rb_block_given_p()) {
- for (i = 0; i < len; ++i) if (RTEST(ptr[i])) return Qtrue;
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) return Qtrue;
- }
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * ary.dig(idx, ...) -> object
- *
- * Extracts the nested value specified by the sequence of <i>idx</i>
- * objects by calling +dig+ at each step, returning +nil+ if any
- * intermediate step is +nil+.
- *
- * a = [[1, [2, 3]]]
- *
- * a.dig(0, 1, 1) #=> 3
- * a.dig(1, 2, 3) #=> nil
- * a.dig(0, 0, 0) #=> NoMethodError, undefined method `dig' for 1:Fixnum
- * [42, {foo: :bar}].dig(1, :foo) #=> :bar
- */
-
-VALUE
-rb_ary_dig(int argc, VALUE *argv, VALUE self)
-{
- rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
- self = rb_ary_at(self, *argv);
- if (!--argc) return self;
- ++argv;
- return rb_obj_dig(argc, argv, self, Qnil);
-}
-
-/*
* Arrays are ordered, integer-indexed collections of any object.
*
* Array indexing starts at 0, as in C or Java. A negative index is assumed
@@ -5579,7 +5213,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
*
* ary = Array.new #=> []
* Array.new(3) #=> [nil, nil, nil]
- * Array.new(3, true) #=> [true, true, true]
+ * Array.new(3, true) #=> [0, 0, 0]
*
* Note that the second argument populates the array with references to the
* same object. Therefore, it is only recommended in cases when you need to
@@ -5597,11 +5231,6 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
* empty_table = Array.new(3) { Array.new(3) }
* #=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
*
- * An array can also be created by using the Array() method, provided by
- * Kernel, which tries to call #to_ary, then #to_a on its argument.
- *
- * Array({:a => "a", :b => "b"}) #=> [[:a, "a"], [:b, "b"]]
- *
* == Example Usage
*
* In addition to the methods it mixes in through the Enumerable module, the
@@ -5614,8 +5243,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
*
* Elements in an array can be retrieved using the Array#[] method. It can
* take a single integer argument (a numeric index), a pair of arguments
- * (start and length) or a range. Negative indices start counting from the end,
- * with -1 being the last element.
+ * (start and length) or a range.
*
* arr = [1, 2, 3, 4, 5, 6]
* arr[2] #=> 3
@@ -5623,7 +5251,6 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
* arr[-3] #=> 4
* arr[2, 3] #=> [3, 4, 5]
* arr[1..4] #=> [2, 3, 4, 5]
- * arr[1..-3] #=> [2, 3, 4]
*
* Another way to access a particular array element is by using the #at method
*
@@ -5712,8 +5339,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
* To delete a particular element anywhere in an array, use #delete:
*
* arr = [1, 2, 2, 3]
- * arr.delete(2) #=> 2
- * arr #=> [1,3]
+ * arr.delete(2) #=> [1, 3]
*
* A useful method if you need to remove +nil+ values from an array is
* #compact:
@@ -5748,10 +5374,10 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
* Another sometimes useful iterator is #reverse_each which will iterate over
* the elements in the array in reverse order.
*
- * words = %w[first second third fourth fifth sixth]
+ * words = %w[rats live on no evil star]
* str = ""
- * words.reverse_each { |word| str += "#{word} " }
- * p str #=> "sixth fifth fourth third second first "
+ * words.reverse_each { |word| str += "#{word.reverse} " }
+ * str #=> "rats live on no evil star "
*
* The #map method can be used to create a new array based on the original
* array, but with the values modified by the supplied block:
@@ -5773,7 +5399,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
*
* arr = [1, 2, 3, 4, 5, 6]
* arr.select { |a| a > 3 } #=> [4, 5, 6]
- * arr.reject { |a| a < 3 } #=> [3, 4, 5, 6]
+ * arr.reject { |a| a < 3 } #=> [4, 5, 6]
* arr.drop_while { |a| a < 4 } #=> [4, 5, 6]
* arr #=> [1, 2, 3, 4, 5, 6]
*
@@ -5812,7 +5438,6 @@ Init_Array(void)
rb_define_method(rb_cArray, "inspect", rb_ary_inspect, 0);
rb_define_alias(rb_cArray, "to_s", "inspect");
rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0);
- rb_define_method(rb_cArray, "to_h", rb_ary_to_h, 0);
rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0);
rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0);
@@ -5906,12 +5531,9 @@ Init_Array(void)
rb_define_method(rb_cArray, "drop", rb_ary_drop, 1);
rb_define_method(rb_cArray, "drop_while", rb_ary_drop_while, 0);
rb_define_method(rb_cArray, "bsearch", rb_ary_bsearch, 0);
- rb_define_method(rb_cArray, "bsearch_index", rb_ary_bsearch_index, 0);
- rb_define_method(rb_cArray, "any?", rb_ary_any_p, 0);
- rb_define_method(rb_cArray, "dig", rb_ary_dig, -1);
id_cmp = rb_intern("<=>");
- id_random = rb_intern("random");
+ sym_random = ID2SYM(rb_intern("random"));
id_div = rb_intern("div");
id_power = rb_intern("**");
}
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
new file mode 100644
index 0000000000..1cd26a8643
--- /dev/null
+++ b/bcc32/Makefile.sub
@@ -0,0 +1,617 @@
+# -*- makefile -*-
+
+SHELL = $(COMSPEC)
+MKFILES = Makefile
+
+!ifndef MFLAGS
+MFLAGS=-
+!endif
+
+#### Start of system configuration section. ####
+!ifndef OS
+OS = bccwin32
+!endif
+!if !defined(RT)
+!error RT not defined. Retry from configure pass.
+!endif
+
+arch = $(ARCH)-$(OS)
+
+## variables may be overridden by $(compile_dir)/Makefile
+!ifndef srcdir
+srcdir = ..
+!endif
+!ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = ruby
+!endif
+!ifndef RUBYW_INSTALL_NAME
+RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
+!elif "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
+RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
+!endif
+!if "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
+RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
+!endif
+!ifndef RUBY_SO_NAME
+RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY)
+!endif
+!ifndef icondirs
+!ifdef ICONDIRS
+icondirs=$(ICONDIRS)
+!endif
+!endif
+!ifdef icondirs
+icondirs=$(icondirs:\=/)
+iconinc=-I$(icondirs: = -I)
+!endif
+###############
+
+.SUFFIXES: .y
+
+!ifndef CC
+CC = bcc32
+!endif
+!ifndef CPP
+CPP = cpp32
+!endif
+!ifndef RC
+RC = brcc32
+!endif
+!ifndef YACC
+YACC = bison
+!endif
+!ifndef AR
+AR = tlib
+!endif
+!ifndef BASERUBY
+BASERUBY = ruby
+!endif
+
+PURIFY =
+AUTOCONF = autoconf
+IFCHANGE = $(srcdir:/=\)\win32\ifchange.bat
+RM = $(srcdir:/=\)\win32\rm.bat
+CP = copy > nul
+MV = move > nul
+
+!if !defined(PROCESSOR_ARCHITECTURE)
+PROCESSOR_ARCHITECTURE = x86
+!endif
+MACHINE = $(PROCESSOR_ARCHITECTURE)
+!if "$(PROCESSOR_ARCHITECTURE)" == "x86"
+!ifndef PROCESSOR_LEVEL
+PROCESSOR_LEVEL = 5
+!endif
+!if 6 < $(PROCESSOR_LEVEL)
+PROCESSOR_LEVEL = 6
+!endif
+PROCESSOR_FLAG = -$(PROCESSOR_LEVEL)
+CPU = i$(PROCESSOR_LEVEL)86
+ARCH = i386
+!else
+CPU = $(PROCESSOR_ARCHITECTURE)
+ARCH = $(PROCESSOR_ARCHITECTURE)
+!endif
+!ifndef DEBUGFLAGS
+DEBUGFLAGS =
+!endif
+!ifndef OPTFLAGS
+OPTFLAGS = -O
+!endif
+
+!ifndef prefix
+prefix = /usr
+!endif
+!ifndef exec_prefix
+exec_prefix = $(prefix)
+!endif
+!ifndef libdir
+libdir = $(exec_prefix)/lib
+!endif
+!if !defined(datadir)
+datadir = $(prefix)/share
+!endif
+!ifndef EXTOUT
+EXTOUT = .ext
+!endif
+!ifndef TESTUI
+TESTUI = console
+!endif
+!ifndef TESTS
+TESTS =
+!endif
+!ifndef RDOCTARGET
+RDOCTARGET = install-doc
+!endif
+
+OUTFLAG = -o
+COUTFLAG = -o
+!ifndef CFLAGS
+CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
+!endif
+!ifndef DEFS
+DEFS =
+!endif
+!ifndef CPPFLAGS
+CPPFLAGS =
+!endif
+CPPFLAGS = $(DEFS) $(CPPFLAGS)
+!ifndef CXXFLAGS
+CXXFLAGS = $(CFLAGS)
+!endif
+!ifndef LDFLAGS
+LDFLAGS = -S:$(STACK)
+!endif
+!ifndef RFLAGS
+RFLAGS = $(iconinc)
+!endif
+!ifndef EXTLIBS
+EXTLIBS =
+!endif
+!ifndef MEMLIB
+MEMLIB =
+!endif
+LIBS = $(MEMLIB) cw32i.lib import32.lib ws2_32.lib $(EXTLIBS)
+MISSING = acosh.obj cbrt.obj crypt.obj erf.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32.obj
+
+!ifndef STACK
+STACK = 0x2000000
+!endif
+
+XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing
+
+ARFLAGS = /a /p32
+LD = ilink32 -q -Gn
+LDSHARED = $(LD)
+XLDFLAGS = -Tpe c0x32.obj
+WLDFLAGS = -aa -Tpe c0w32.obj
+DLDFLAGS = -Tpd c0d32.obj
+LIBRUBY_LDSHARED = $(LDSHARED)
+LIBRUBY_DLDFLAGS = -Gi $(DLDFLAGS) $(EXTLDFLAGS)
+LDOBJECTS = $(MAINOBJ)
+
+SOLIBS =
+
+EXEEXT = .exe
+PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
+WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
+RUBYDEF = $(RUBY_SO_NAME).def
+MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib $(MINIRUBYOPT)
+RUNRUBY = .\$(PROGRAM) -i"$(EXTOUT)/$(arch)" "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
+
+ORGLIBPATH = $(LIB)
+
+#### End of system configuration section. ####
+
+LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
+LIBRUBY_SO = $(RUBY_SO_NAME).dll
+LIBRUBY = $(RUBY_SO_NAME).lib
+LIBRUBYARG = $(LIBRUBY)
+THREAD_MODEL = win32
+
+PREP = miniruby$(EXEEXT)
+
+OBJEXT = obj
+ASMEXT = asm
+
+INSTALLED_LIST= .installed.list
+
+MKMAIN_CMD = mkmain.bat
+
+SRC_FILE = $(<:\=/)
+
+WINMAINOBJ = winmain.$(OBJEXT)
+ARCHMINIOBJS = dmydln.$(OBJEXT)
+
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+hdrdir = $(srcdir)/include
+VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/enc;$(srcdir)/missing;$(srcdir)/win32
+
+.path.c = .;$(srcdir);$(srcdir)/enc;$(srcdir)/win32;$(srcdir)/missing
+.path.ci = $(srcdir)
+.path.inc = .;$(srcdir)
+.path.def = .;$(srcdir)
+.path.h = .;$(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
+.path.y = $(srcdir)
+.path. = $(srcdir)
+
+.c.obj:
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:/=\)
+
+.c.asm:
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) $(COUTFLAG)$@ -S $(<:\=/)
+
+.rc.res:
+ $(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:/=\)
+
+all: $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
+
+ruby: $(PROGRAM)
+rubyw: $(WPROGRAM)
+
+!include $(srcdir)/common.mk
+
+$(MKFILES): $(srcdir)/bcc32/Makefile.sub $(srcdir)/bcc32/configure.bat $(srcdir)/bcc32/setup.mak
+ $(COMSPEC) /C $(srcdir:/=\)\bcc32\configure.bat $(configure_args)
+ @echo $(MKFILES) should be updated, re-run $(MAKE).
+ @$(MAKE) > nul -q -f &&|
+PHONY: nul
+ @exit
+|
+
+PHONY: nul
+
+RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
+CONFIG_H = ./.config.h.time
+
+config: config.status
+
+config.status: $(CONFIG_H)
+
+guard = INCLUDE_RUBY_CONFIG_H
+
+$(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
+ @if not exist $(arch_hdrdir:/=\) md $(arch_hdrdir:/=\)
+ @if not exist $(arch_hdrdir:/=\)\ruby md $(arch_hdrdir:/=\)\ruby
+ @$(IFCHANGE) $(RUBY_CONFIG_H:/=\) &&|
+\#ifndef $(guard)
+\#define $(guard) 1
+\#define NO_BIG_INLINE 1
+\#define HAVE_SYS_TYPES_H 1
+\#define HAVE_SYS_STAT_H 1
+\#define HAVE_STDLIB_H 1
+\#define HAVE_STRING_H 1
+\#define HAVE_MEMORY_H 1
+\#define HAVE_LONG_LONG 1
+\#define HAVE_OFF_T 1
+\#define SIZEOF_INT 4
+\#define SIZEOF_SHORT 2
+\#define SIZEOF_LONG 4
+\#define SIZEOF_LONG_LONG 0
+\#define SIZEOF___INT64 8
+\#define SIZEOF_OFF_T 8
+\#define SIZEOF_VOIDP 4
+\#define SIZEOF_FLOAT 4
+\#define SIZEOF_DOUBLE 8
+\#define SIZEOF_TIME_T 4
+\#define SIZEOF_RLIM_T 0
+\#define SIZEOF_SIZE_T 4
+\#define SIZEOF_PTRDIFF_T 4
+\#define HAVE_PROTOTYPES 1
+\#define TOKEN_PASTE(x,y) x\#\#y
+\#define HAVE_STDARG_PROTOTYPES 1
+\#define NORETURN(x) x
+\#define RUBY_EXTERN extern __declspec(dllimport)
+\#define HAVE_DECL_SYS_NERR 1
+\#define HAVE_LIMITS_H 1
+\#define HAVE_FCNTL_H 1
+\#define HAVE_UTIME_H 1
+\#define HAVE_FLOAT_H 1
+\#define rb_uid_t uid_t
+\#define rb_gid_t gid_t
+\#define rb_pid_t int
+\#define HAVE_STRUCT_STAT_ST_RDEV 1
+\#define HAVE_ST_RDEV 1
+!if $(BORLANDC) < 0x0580
+\#define int8_t signed char
+\#define uint8_t unsigned char
+\#define int16_t short
+\#define uint16_t unsigned short
+\#define int32_t int
+\#define uint32_t unsigned int
+\#define int64_t __int64
+\#define uint64_t unsigned __int64
+\#define ssize_t int
+!endif
+\#define HAVE_INT8_T 1
+\#define HAVE_UINT8_T 1
+\#define SIZEOF_INT8_T 1
+\#define HAVE_INT16_T 1
+\#define HAVE_UINT16_T 1
+\#define SIZEOF_INT32_T 2
+\#define HAVE_INT32_T 1
+\#define HAVE_UINT32_T 1
+\#define SIZEOF_INT32_T 4
+\#define HAVE_INT64_T 1
+\#define HAVE_UINT64_T 1
+\#define SIZEOF_INT64_T 8
+\#define HAVE_INTPTR_T 1
+\#define HAVE_UINTPTR_T 1
+\#define HAVE_SSIZE_T 1
+\#define GETGROUPS_T int
+\#define RETSIGTYPE void
+\#define HAVE_ALLOCA 1
+\#define HAVE_DUP2 1
+\#define HAVE_MEMMOVE 1
+\#define HAVE_MKDIR 1
+\#define HAVE_STRCASECMP 1
+\#define HAVE_STRNCASECMP 1
+\#define HAVE_STRERROR 1
+\#define HAVE_STRFTIME 1
+\#define HAVE_STRCHR 1
+\#define HAVE_STRSTR 1
+\#define HAVE_STRTOD 1
+\#define HAVE_STRTOL 1
+\#define HAVE_STRTOUL 1
+\#define HAVE_SNPRINTF 1
+\#define HAVE_VSNPRINTF 1
+\#define HAVE_ISNAN 1
+\#define HAVE_FINITE 1
+\#define HAVE_HYPOT 1
+\#define HAVE_FMOD 1
+\#define HAVE_WAITPID 1
+\#define HAVE_FSYNC 1
+\#define HAVE_GETCWD 1
+\#define HAVE_TRUNCATE 1
+\#define HAVE_FTRUNCATE 1
+\#define HAVE_FSEEKO 1
+\#define HAVE_FTELLO 1
+\#define HAVE_TIMES 1
+\#define HAVE_FCNTL 1
+\#define HAVE_LINK 1
+\#define HAVE_TELLDIR 1
+\#define HAVE_SEEKDIR 1
+\#define HAVE_COSH 1
+\#define HAVE_SINH 1
+\#define HAVE_TANH 1
+\#define RSHIFT(x,y) ((x)>>(int)y)
+\#define FILE_COUNT level
+\#define FILE_READPTR curp
+\#define RUBY_SETJMP(env) setjmp(env)
+\#define RUBY_LONGJMP(env,val) longjmp(env,val)
+\#define RUBY_JMP_BUF jmp_buf
+\#define inline __inline
+\#define NEED_IO_SEEK_BETWEEN_RW 1
+\#define STACK_GROW_DIRECTION -1
+\#define DEFAULT_KCODE KCODE_NONE
+\#define LOAD_RELATIVE 1
+\#define DLEXT ".so"
+\#define RUBY_LIB_PREFIX "/lib/ruby"
+\#define RUBY_PLATFORM "$(ARCH)-$(OS)"
+\#endif /* $(guard) */
+|
+ @exit > $(@:/=\)
+
+config.status: $(MKFILES) $(srcdir)/bcc32/Makefile.sub $(srcdir)/common.mk
+ @echo Creating $@
+ @type > $@ &&|
+# Generated automatically by Makefile.sub.
+s,@SHELL@,$$(COMSPEC),;t t
+s,@BUILD_FILE_SEPARATOR@,\,;t t
+s,@PATH_SEPARATOR@,;,;t t
+s,@CFLAGS@,$(CFLAGS),;t t
+s,@DEFS@,$(DEFS),;t t
+s,@CPPFLAGS@,$(CPPFLAGS),;t t
+s,@CXXFLAGS@,$(CXXFLAGS),;t t
+s,@FFLAGS@,$(FFLAGS),;t t
+s,@LDFLAGS@,,;t t
+s,@LIBS@,$(LIBS),;t t
+s,@exec_prefix@,$${prefix},;t t
+s,@prefix@,$(prefix),;t t
+s,@program_transform_name@,s,,,,;t t
+s,@bindir@,$${exec_prefix}/bin,;t t
+s,@sbindir@,$${exec_prefix}/sbin,;t t
+s,@libexecdir@,$${exec_prefix}/libexec,;t t
+s,@datadir@,$${prefix}/share,;t t
+s,@sysconfdir@,$${prefix}/etc,;t t
+s,@sharedstatedir@,/etc,;t t
+s,@localstatedir@,/var,;t t
+s,@libdir@,$${exec_prefix}/lib,;t t
+s,@includedir@,$${prefix}/include,;t t
+s,@oldincludedir@,/usr/include,;t t
+s,@infodir@,$${prefix}/info,;t t
+s,@mandir@,$${prefix}/man,;t t
+s,@ridir@,$${prefix}/share/ri,;t t
+s,@build@,$(CPU)-pc-$(OS),;t t
+s,@build_alias@,$(CPU)-$(OS),;t t
+s,@build_cpu@,$(CPU),;t t
+s,@build_vendor@,pc,;t t
+s,@build_os@,$(OS),;t t
+s,@host@,$(CPU)-pc-$(OS),;t t
+s,@host_alias@,$(CPU)-$(OS),;t t
+s,@host_cpu@,$(CPU),;t t
+s,@host_vendor@,pc,;t t
+s,@host_os@,$(OS),;t t
+s,@target@,$(ARCH)-pc-$(OS),;t t
+s,@target_alias@,$(ARCH)-$(OS),;t t
+s,@target_cpu@,$(ARCH),;t t
+s,@target_vendor@,pc,;t t
+s,@target_os@,$(OS),;t t
+s,@CC@,$(CC),;t t
+s,@CPP@,cpp32,;t t
+s,@CXX@,$$(CC),;t t
+s,@LD@,$(LD),;t t
+s,@YACC@,$(YACC),;t t
+s,@RANLIB@,,;t t
+s,@AR@,$(AR),;t t
+s,@ARFLAGS@,$(ARFLAGS) ,;t t
+s,@LN_S@,$(LN_S),;t t
+s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
+s,@RM@,$$(top_srcdir:/=\)\win32\rm.bat,;t t
+s,@CP@,copy > nul,;t t
+s,@LIBOBJS@, $(MISSING),;t t
+s,@ALLOCA@,$(ALLOCA),;t t
+s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
+s,@EXEEXT@,.exe,;t t
+s,@OBJEXT@,obj,;t t
+s,@XCFLAGS@,$(XCFLAGS),;t t
+s,@XLDFLAGS@,$(XLDFLAGS),;t t
+s,@DLDFLAGS@,$(DLDFLAGS),;t t
+s,@ARCH_FLAG@,$(ARCH_FLAG),;t t
+s,@STATIC@,$(STATIC),;t t
+s,@CCDLFLAGS@,,;t t
+s,@LDSHARED@,$(LDSHARED),;t t
+s,@DLEXT@,so,;t t
+s,@LIBEXT@,lib,;t t
+s,@STRIP@,$(STRIP),;t t
+s,@EXTSTATIC@,$(EXTSTATIC),;t t
+s,@setup@,Setup,;t t
+s,@MINIRUBY@,$(MINIRUBY),;t t
+s,@PREP@,miniruby$(EXEEXT),;t t
+s,@RUNRUBY@,$(RUNRUBY),;t t
+s,@EXTOUT@,$(EXTOUT),;t t
+s,@ARCHFILE@,,;t t
+s,@RDOCTARGET@,,;t t
+s,@LIBRUBY_LDSHARED@,$$(LDSHARED),;t t
+s,@LIBRUBY_DLDFLAGS@,-Gi $$(DLDFLAGS),;t t
+s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
+s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
+s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
+s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
+s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t
+s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
+s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t
+s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t
+s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t
+s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A),;t t
+s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
+s,@SOLIBS@,$(SOLIBS),;t t
+s,@DLDLIBS@,$(DLDLIBS),;t t
+s,@ENABLE_SHARED@,yes,;t t
+s,@OUTFLAG@,$(OUTFLAG),;t t
+s,@COUTFLAG@,$(COUTFLAG),;t t
+s,@CPPOUTFILE@,,;t t
+s,@LIBPATHFLAG@, -L"%s",;t t
+s,@RPATHFLAG@,,;t t
+s,@LIBARG@,%s.lib,;t t
+s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS:/=\), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE:/=\), $$(RESFILE:/=\),;t t
+s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
+s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P $(COUTFLAG)$$(@) -c $$(<:/=\),;t t
+s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
+s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
+s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t
+s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN WIN32,;t t
+s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
+s,@cleanlibs@,$$*.tds,;t t
+s,@cleanobjs@,$$*-$$(arch).def $$*.il? $$*.lib,;t t
+s,@TRY_LINK@,$$(CC) -oconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(LIBPATH) $$(LDFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS),;t t
+s,@EXPORT_PREFIX@,_,;t t
+s,@arch@,$(ARCH)-$(OS),;t t
+s,@sitearch@,$(ARCH)-$(OS),;t t
+s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
+s,@vendordir@,$${prefix}/lib/ruby/vendor_ruby,;t t
+s,@rubyhdrdir@,$$(includedir)/ruby-$$(MAJOR).$$(MINOR).$$(TEENY),;t t
+s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
+s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t
+s,@configure_args@,--enable-shared $(configure_args),;t t
+s,@configure_input@,$$configure_input,;t t
+s,@srcdir@,$(srcdir),;t t
+s,@top_srcdir@,$(srcdir),;t t
+|
+
+miniruby$(EXEEXT):
+ @echo $(LIBS)
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS:/=\) $(DMYEXT),$@,nul,$(LIBS)
+
+$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
+
+$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
+ $(LD) $(LDFLAGS) $(WLDFLAGS) $(MAINOBJ) $(WINMAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBYW_INSTALL_NAME).res
+
+$(LIBRUBY_A): $(OBJS) $(DMYEXT)
+ @-if exist $@ del $@
+ $(AR) $(ARFLAGS) "$@" $(OBJS) $(DMYEXT)
+
+# $(LIBRUBY): $(LIBRUBY_SO)
+# implib $@ $(LIBRUBY_SO)
+
+$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
+ @echo $(DLDOBJS)
+ @$(PRE_LIBRUBY_UPDATE)
+ $(LIBRUBY_LDSHARED) $(LIBRUBY_DLDFLAGS) $(DLDOBJS:/=\),$(LIBRUBY_SO),nul,$(LIBRUBY_A) $(LIBS),$(RUBYDEF),$(RUBY_SO_NAME).res
+
+$(LIBRUBY): $(LIBRUBY_SO)
+
+$(RUBYDEF): $(LIBRUBY_A) $(PREP)
+ $(MINIRUBY) $(srcdir)/bcc32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A)
+
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb $(srcdir)/revision.h $(srcdir)/win32/resource.rb
+ @$(MINIRUBY) $(srcdir)/win32/resource.rb \
+ -ruby_name=$(RUBY_INSTALL_NAME) \
+ -rubyw_name=$(RUBYW_INSTALL_NAME) \
+ -so_name=$(RUBY_SO_NAME) \
+ . $(icondirs) $(srcdir)/win32
+
+lex.c: {$(srcdir)}lex.c.blt
+ copy "$(?:/=\)" $@
+
+post-install-bin::
+ @$(NULLCMD)
+post-install-lib::
+ @$(NULLCMD)
+post-install-ext-comm::
+ @$(NULLCMD)
+post-install-ext-arch::
+ @$(NULLCMD)
+post-install-man::
+ @$(NULLCMD)
+post-install-doc::
+ @$(NULLCMD)
+
+clean-local::
+ @$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
+ @$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
+ @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
+
+distclean-local::
+ @$(RM) ext\config.cache $(RBCONFIG:/=\)
+ @$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
+
+clean-ext distclean-ext realclean-ext::
+ @for /R ext %I in (.) do @if exist %I\Makefile ( \
+ echo $(@:-ext=)ing %~nI & \
+ cd %I & \
+ $(MAKE) $(MFLAGS) $(@:-ext=) & \
+ cd %CD% \
+ )
+
+ext/extinit.obj: ext/extinit.c $(SETUP)
+ $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+
+main.$(OBJEXT): win32.h
+ascii.$(OBJEXT): win32.h
+array.$(OBJEXT): win32.h
+bignum.$(OBJEXT): win32.h
+class.$(OBJEXT): win32.h
+compar.$(OBJEXT): win32.h
+dir.$(OBJEXT): dir.h win32.h
+dln.$(OBJEXT): win32.h
+enum.$(OBJEXT): win32.h
+error.$(OBJEXT): win32.h
+euc_jp.$(OBJEXT): win32.h
+eval.$(OBJEXT): win32.h
+file.$(OBJEXT): win32.h
+gc.$(OBJEXT): win32.h
+hash.$(OBJEXT): win32.h
+inits.$(OBJEXT): win32.h
+io.$(OBJEXT): win32.h
+marshal.$(OBJEXT): win32.h
+math.$(OBJEXT): win32.h
+numeric.$(OBJEXT): win32.h
+object.$(OBJEXT): win32.h
+pack.$(OBJEXT): win32.h
+parse.$(OBJEXT): win32.h
+process.$(OBJEXT): win32.h
+prec.$(OBJEXT): win32.h
+random.$(OBJEXT): win32.h
+range.$(OBJEXT): win32.h
+re.$(OBJEXT): win32.h
+regcomp.$(OBJEXT): win32.h
+regenc.$(OBJEXT): win32.h
+regerror.$(OBJEXT): win32.h
+regexec.$(OBJEXT): win32.h
+reggnu.$(OBJEXT): win32.h
+regparse.$(OBJEXT): win32.h
+ruby.$(OBJEXT): win32.h
+signal.$(OBJEXT): win32.h
+sjis.$(OBJEXT): win32.h
+sprintf.$(OBJEXT): win32.h
+st.$(OBJEXT): win32.h
+string.$(OBJEXT): win32.h
+struct.$(OBJEXT): win32.h
+time.$(OBJEXT): win32.h
+utf_8.$(OBJEXT): win32.h
+util.$(OBJEXT): win32.h
+variable.$(OBJEXT): win32.h
+version.$(OBJEXT): win32.h
diff --git a/bcc32/README.bcc32 b/bcc32/README.bcc32
new file mode 100644
index 0000000000..cd33eec0a1
--- /dev/null
+++ b/bcc32/README.bcc32
@@ -0,0 +1,130 @@
+=begin
+
+= How to build ruby using Borland C++
+
+== Requirement
+
+(1) Borland C++ 5.0 or later.
+
+(2) Please set environment variable (({PATH}))
+ to run required commands properly from the command line.
+
+ Note: building ruby requires following commands.
+ * make
+ * bcc32
+ * tlib
+ * ilink32
+
+(3) If you want to build from CVS source, following commands are required.
+ * bison ((<URL:http://gnuwin32.sourceforge.net/packages/bison.htm>))
+ * sed ((<URL:http://gnuwin32.sourceforge.net/packages/sed.htm>))
+
+(4) We strongly recommend to build ruby on C++Builder, to link following files.
+ * usebormm.lib
+ * memmgr.lib
+
+ RTL's internal memory manager cannot handle large memory block properly,
+ so we should use borlndmm.dll instead.
+ 10000.times { "" << "." * 529671; GC.start } # crash
+
+== How to compile and install
+
+(1) Execute bcc32\configure.bat on your build directory.
+ ex. c:\src\ruby> bcc32\configure.bat
+ You can specify the target platform as an argument.
+ For example, run `((%configure i686-bccwin32%))'
+ You can also specify the install directory.
+ For example, run `((%configure --prefix=<install_directory>%))'
+ Default of the install directory is /usr .
+ The default ((|<PLATFORM>|)) is `(({i386-bccwin32}))'.
+
+(2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile}))
+ if you want to change the name of the executable files.
+ And add ((|RUBYW_INSTALL_NAME|)) to change the name of the
+ executable without console window if also you want.
+
+(3) Run `((%make%))'
+
+(4) Run `((%make test%))'
+
+(5) Run `((%make install%))'
+
+(6) Requires dynamic RTL (cc3250.dll on C++Builder5) and borlndmm.dll (If built with
+ usebormm.lib) to use installed binary. These files are ordinary in bcc32's bin
+ directory.
+
+== Icons
+
+Any icon files(*.ico) in the build directory, directories specified with
+((|icondirs|)) make variable and (({win32})) directory under the ruby
+source directory will be included in DLL or executable files, according
+to their base names.
+ $(RUBY_INSTALL_NAME).ico or ruby.ico --> $(RUBY_INSTALL_NAME).exe
+ $(RUBYW_INSTALL_NAME).ico or rubyw.ico --> $(RUBYW_INSTALL_NAME).exe
+ the others --> $(RUBY_SO_NAME).dll
+
+Although no icons are distributed with the ruby source or in the official
+site, you can use anything you like. For example, followings are written
+in Japanese, but you can download at least.
+
+* ((<URL:http://member.nifty.ne.jp/ueivu/rubyico.html>)) or
+ ((<zipped icons|URL:http://member.nifty.ne.jp/ueivu/Ruby_ico.zip>))
+* ((<URL:http://homepage1.nifty.com/a_nakata/ruby/>)) or
+ ((<icon itself|URL:http://homepage1.nifty.com/a_nakata/ruby/RubyIcon.ico>))
+
+== Build examples
+
+* Build on the ruby source directory.
+
+ ex.)
+ ruby source directory: C:\ruby
+ build directory: C:\ruby
+ install directory: C:\usr\local
+
+ C:
+ cd \ruby
+ bcc32\configure --prefix=/usr/local
+ make
+ make test
+ make install
+
+* Build on the relative directory from the ruby source directory and CPU type
+ i386.
+
+ ex.)
+ ruby source directory: C:\ruby
+ build directory: C:\ruby\bccwin32
+ install directory: C:\usr\local
+ CPU i386
+
+ C:
+ cd \ruby
+ mkdir bccwin32
+ cd bccwin32
+ ..\bcc32\configure --prefix=/usr/local
+ make
+ make test
+ make install
+
+* Build on the different drive.
+
+ ex.)
+ ruby source directory: C:\src\ruby
+ build directory: D:\build\ruby
+ install directory: C:\usr\local
+
+ D:
+ cd D:\build\ruby
+ C:\src\ruby\bcc32\configure --prefix=C:/usr/local
+ make
+ make test
+ make install
+
+== Bugs
+
+You can ((*NOT*)) use a path name contains any white space characters as
+the ruby source directory, this restriction comes from the behavior of
+(({!INCLUDE})) directives of (({MAKE})).
+((- you may call it a bug. -))
+
+=end
diff --git a/bcc32/configure.bat b/bcc32/configure.bat
new file mode 100755
index 0000000000..8cdfc64b03
--- /dev/null
+++ b/bcc32/configure.bat
@@ -0,0 +1,163 @@
+@echo off
+::: Don't set environment variable in batch file other than autoexec.bat
+::: to avoid "Out of environment space" problem on Windows 95/98.
+::: set TMPMAKE=~tmp~.mak
+
+echo> ~tmp~.mak ####
+echo>> ~tmp~.mak conf = %0
+echo>> ~tmp~.mak $(conf:\=/): nul
+echo>> ~tmp~.mak @del ~setup~.mak
+echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)setup.mak \
+if exist pathlist.tmp del pathlist.tmp
+if exist confargs.mk del confargs.mk
+:loop
+if "%1" == "" goto :end
+if "%1" == "--prefix" goto :prefix
+if "%1" == "prefix" goto :prefix
+if "%1" == "--srcdir" goto :srcdir
+if "%1" == "srcdir" goto :srcdir
+if "%1" == "--target" goto :target
+if "%1" == "target" goto :target
+if "%1" == "--with-static-linked-ext" goto :extstatic
+if "%1" == "--program-suffix" goto :suffix
+if "%1" == "RUBY_SUFFIX" goto :suffix
+if "%1" == "--program-name" goto :installname
+if "%1" == "--install-name" goto :installname
+if "%1" == "RUBY_INSTALL_NAME" goto :installname
+if "%1" == "--so-name" goto :soname
+if "%1" == "RUBY_SO_NAME" goto :soname
+if "%1" == "--enable-install-doc" goto :enable-rdoc
+if "%1" == "--disable-install-doc" goto :disable-rdoc
+if "%1" == "--extout" goto :extout
+if "%1" == "EXTOUT" goto :extout
+if "%1" == "--with-baseruby" goto :baseruby
+if "%1" == "BASERUBY" goto :baseruby
+if "%1" == "--path" goto :path
+if "%1" == "-h" goto :help
+if "%1" == "--help" goto :help
+ echo>>confargs.tmp %1 \
+ shift
+goto :loop
+:srcdir
+ echo>> ~tmp~.mak -Dsrcdir=%2 \
+ echo>>confargs.tmp --srcdir=%2 \
+ shift
+ shift
+goto :loop
+:prefix
+ echo>> ~tmp~.mak -Dprefix=%2 \
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:suffix
+ echo>>confargs.mk !ifndef RUBY_SUFFIX
+ echo>>confargs.mk RUBY_SUFFIX = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:installname
+ echo>>confargs.mk !ifndef RUBY_INSTALL_NAME
+ echo>>confargs.mk RUBY_INSTALL_NAME = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:soname
+ echo>>confargs.mk !ifndef RUBY_SO_NAME
+ echo>>confargs.mk RUBY_SO_NAME = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:target
+ echo>> ~tmp~.mak %2 \
+ echo>>confargs.tmp --target=%2 \
+ shift
+ shift
+goto :loop
+:extstatic
+ echo>>confargs.mk !ifndef EXTSTATIC
+ echo>>confargs.mk EXTSTATIC = static
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
+ shift
+goto :loop
+:enable-rdoc
+ echo>>confargs.mk !ifndef RDOCTARGET
+ echo>>confargs.mk RDOCTARGET = install-doc
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
+ shift
+goto :loop
+:disable-rdoc
+ echo>>confargs.mk !ifndef RDOCTARGET
+ echo>>confargs.mk RDOCTARGET = install-nodoc
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1 \
+ shift
+goto :loop
+:extout
+ echo>>confargs.mk !ifndef EXTOUT
+ echo>>confargs.mk EXTOUT = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:baseruby
+ echo>>confargs.mk !ifndef BASERUBY
+ echo>>confargs.mk BASERUBY = %2
+ echo>>confargs.mk !endif
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:path
+ echo>>pathlist.tmp %2;\
+ echo>>confargs.tmp %1=%2 \
+ shift
+ shift
+goto :loop
+:help
+ echo Configuration:
+ echo --help display this help
+ echo --srcdir=DIR find the sources in DIR [configure dir or `..']
+ echo Installation directories:
+ echo --prefix=PREFIX install files in PREFIX (ignored currently)
+ echo System types:
+ echo --target=TARGET configure for TARGET [i386-bccwin32]
+ echo Optional Package:
+ echo --with-baseruby=RUBY use RUBY as baseruby [ruby]
+ echo --with-static-linked-ext link external modules statically
+ echo --enable-install-doc install rdoc indexes during install
+ del *.tmp
+ del ~tmp~.mak
+goto :exit
+:end
+echo>> ~tmp~.mak -Dbcc32dir=$(@D)
+if not exist confargs.tmp goto :noconfargs
+ echo>>confargs.mk configure_args = \
+ type>>confargs.mk confargs.tmp
+ echo.>>confargs.mk
+ echo>>confargs.mk ####
+:noconfargs
+if not exist pathlist.tmp goto :nopathlist
+ echo>>confargs.mk pathlist = \
+ type>>confargs.mk pathlist.tmp
+ echo.>>confargs.mk
+ echo>>confargs.mk ####
+ echo>>confargs.mk PATH = $(pathlist:;=/bin;)$(PATH)
+ echo>>confargs.mk INCLUDE = $(pathlist:;=/include;)
+ echo>>confargs.mk LIB = $(pathlist:;=/lib;)
+:nopathlist
+if exist confargs.mk copy confargs.mk ~setup~.mak > nul
+type>>~setup~.mak ~tmp~.mak
+del *.tmp > nul
+del ~tmp~.mak > nul
+make -s -f ~setup~.mak
+:exit
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
new file mode 100755
index 0000000000..888ab2e2a6
--- /dev/null
+++ b/bcc32/mkexports.rb
@@ -0,0 +1,26 @@
+#!./miniruby -s
+
+$:.unshift(File.expand_path("../..", __FILE__))
+require 'win32/mkexports'
+
+class Exports::Bcc < Exports
+ def forwarding(internal, export)
+ internal[/\A_?/]+export
+ end
+
+ def each_line(objs, &block)
+ objs.each do |obj|
+ opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
+ IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
+ end
+ end
+
+ def each_export(objs)
+ objdump(objs) do |l|
+ next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
+ yield $1 if /'(.*?)'/ =~ l
+ end
+ yield "_strcasecmp", "_stricmp"
+ yield "_strncasecmp", "_strnicmp"
+ end
+end
diff --git a/bcc32/setup.mak b/bcc32/setup.mak
new file mode 100644
index 0000000000..df2fd3c128
--- /dev/null
+++ b/bcc32/setup.mak
@@ -0,0 +1,179 @@
+# -*- makefile -*-
+
+!if "$(srcdir)" != ""
+bcc32dir = $(srcdir)/bcc32
+!elseif "$(bcc32dir)" == "bcc32/"
+srcdir = .
+!elseif "$(bcc32dir:/bcc32/=)/bcc32/" == "$(bcc32dir)"
+srcdir = $(bcc32dir:/bcc32/=)
+!else
+srcdir = $(bcc32dir)/..
+!endif
+!ifndef prefix
+prefix = /usr
+!endif
+OS = bccwin32
+RT = $(OS)
+BANG = !
+APPEND = echo.>>$(MAKEFILE)
+!ifdef MAKEFILE
+MAKE = $(MAKE) -f $(MAKEFILE)
+!else
+MAKEFILE = Makefile
+!endif
+
+all: Makefile
+Makefile: -prologue- -generic- -epilogue-
+i386-$(OS): -prologue- -i386- -epilogue-
+i486-$(OS): -prologue- -i486- -epilogue-
+i586-$(OS): -prologue- -i586- -epilogue-
+i686-$(OS): -prologue- -i686- -epilogue-
+alpha-$(OS): -prologue- -alpha- -epilogue-
+
+-prologue-: -basic-vars- -version- -system-vars-
+
+-basic-vars-: nul
+ @echo Creating $(MAKEFILE)
+ @type > $(MAKEFILE) &&|
+\#\#\# Makefile for ruby $(OS) \#\#\#
+$(BANG)ifndef srcdir
+srcdir = $(srcdir:\=/)
+$(BANG)endif
+$(BANG)ifndef prefix
+prefix = $(prefix:\=/)
+$(BANG)endif
+$(BANG)if !defined(BASERUBY)
+!if defined(BASERUBY)
+BASERUBY = $(BASERUBY)
+!endif
+|
+!if !defined(BASERUBY)
+ @for %I in (ruby.exe) do @echo BASERUBY = "%~$$PATH:I" >> $(MAKEFILE)
+!endif
+ @type >> $(MAKEFILE) &&|
+$(BANG)endif
+|
+!if exist(confargs.mk)
+ @type confargs.mk >> $(MAKEFILE)
+ @del confargs.mk
+!endif
+
+-system-vars-: -runtime- -bormm-
+
+-bormm-: nul
+ @-ilink32 -q -Gn -x usebormm.lib > nul
+ @-if exist usebormm.tds $(APPEND) MEMLIB = usebormm.lib
+ @if exist usebormm.* del usebormm.*
+
+-osname-: nul
+ @echo OS = >>$(MAKEFILE)
+
+-runtime-: nul
+ type > conftest.c &&|
+\#include <stdio.h>
+int main(){printf("");return 0;}
+|
+ bcc32 conftest.c cw32i.lib > nul
+ tdump conftest.exe < nul > conftest.i
+ grep "^Imports from CC" conftest.i > conftest.c
+ cpp32 -P- -DFile=\# -DImports=RTNAME -Dfrom== conftest.c > nul
+ $(MAKE) > nul -DBANG=$(BANG) -f &&|
+-runtime-: nul
+$(BANG)include conftest.i
+RT = $$(RTNAME:.DLL=)
+OS = $$(RT:CC32=)
+-runtime-:
+ del conftest.*
+$(BANG)if "$$(OS)" == "50"
+ echo OS = bccwin32 >> $(MAKEFILE)
+$(BANG)else
+ echo OS = bccwin32_$$(OS) >> $(MAKEFILE)
+$(BANG)endif
+|
+ @echo RT = $$(OS) >> $(MAKEFILE)
+
+-version-: nul
+ @cpp32 -I$(srcdir) -P- -o$(MAKEFILE) > nul &&|
+\#define RUBY_REVISION 0
+\#include "version.h"
+MAJOR = RUBY_API_VERSION_MAJOR
+MINOR = RUBY_API_VERSION_MINOR
+TEENY = RUBY_API_VERSION_TEENY
+
+BORLANDC = __BORLANDC__
+|
+ @$(MAKE) > nul -DBANG=$(BANG) -f &&,
+-version-: nul
+$(BANG)include $(MAKEFILE)
+$(BANG)include $(MAKEFILE).i
+-version-:
+ @del $(MAKEFILE).i
+ @type >> $(MAKEFILE) &&|
+MAJOR = $$(MAJOR)
+MINOR = $$(MINOR)
+TEENY = $$(TEENY)
+BORLANDC = $$(BORLANDC)
+|
+,
+
+-generic-: nul
+!if defined(PROCESSOR_ARCHITECTURE) || defined(PROCESSOR_LEVEL)
+ @type >> $(MAKEFILE) &&|
+!if defined(PROCESSOR_ARCHITECTURE)
+$(BANG)ifndef PROCESSOR_ARCHITECTURE
+PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
+$(BANG)endif
+!endif
+!if defined(PROCESSOR_LEVEL)
+$(BANG)ifndef PROCESSOR_LEVEL
+PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
+$(BANG)endif
+!endif
+|
+!endif
+
+-alpha-: nul
+ @$(APPEND) !ifndef PROCESSOR_ARCHITECTURE
+ @$(APPEND) PROCESSOR_ARCHITECTURE = alpha
+ @$(APPEND) !endif
+-ix86-: nul
+ @$(APPEND) !ifndef PROCESSOR_ARCHITECTURE
+ @$(APPEND) PROCESSOR_ARCHITECTURE = x86
+ @$(APPEND) !endif
+
+-i386-: -ix86-
+ @$(APPEND) !ifndef PROCESSOR_LEVEL
+ @$(APPEND) PROCESSOR_LEVEL = 3
+ @$(APPEND) !endif
+-i486-: -ix86-
+ @$(APPEND) !ifndef PROCESSOR_LEVEL
+ @$(APPEND) PROCESSOR_LEVEL = 4
+ @$(APPEND) !endif
+-i586-: -ix86-
+ @$(APPEND) !ifndef PROCESSOR_LEVEL
+ @$(APPEND) PROCESSOR_LEVEL = 5
+ @$(APPEND) !endif
+-i686-: -ix86-
+ @$(APPEND) !ifndef PROCESSOR_LEVEL
+ @$(APPEND) PROCESSOR_LEVEL = 6
+ @$(APPEND) !endif
+
+-epilogue-: -encs-
+
+-encs-: nul
+ @$(MAKE) -f $(srcdir)/win32/enc-setup.mak srcdir="$(srcdir)" MAKEFILE=$(MAKEFILE)
+
+-epilogue-: nul
+ @type >> $(MAKEFILE) &&|
+
+\# RUBY_INSTALL_NAME = ruby
+\# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR)
+\# CFLAGS = -q $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
+\# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
+\# STACK = 0x2000000
+\# LDFLAGS = -S:$$(STACK)
+\# RFLAGS = $$(iconinc)
+\# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib
+$(BANG)include $$(srcdir)/bcc32/Makefile.sub
+|
+ @echo type "`$(MAKE)'" to make ruby for $(OS).
diff --git a/benchmark/bm_app_aobench.rb b/benchmark/bm_app_aobench.rb
deleted file mode 100644
index 2bd6acfaf8..0000000000
--- a/benchmark/bm_app_aobench.rb
+++ /dev/null
@@ -1,291 +0,0 @@
-# AO render benchmark
-# Original program (C) Syoyo Fujita in Javascript (and other languages)
-# https://code.google.com/p/aobench/
-# Ruby(yarv2llvm) version by Hideki Miura
-#
-
-IMAGE_WIDTH = 256
-IMAGE_HEIGHT = 256
-NSUBSAMPLES = 2
-NAO_SAMPLES = 8
-
-class Vec
- def initialize(x, y, z)
- @x = x
- @y = y
- @z = z
- end
-
- attr_accessor :x, :y, :z
-
- def vadd(b)
- Vec.new(@x + b.x, @y + b.y, @z + b.z)
- end
-
- def vsub(b)
- Vec.new(@x - b.x, @y - b.y, @z - b.z)
- end
-
- def vcross(b)
- Vec.new(@y * b.z - @z * b.y,
- @z * b.x - @x * b.z,
- @x * b.y - @y * b.x)
- end
-
- def vdot(b)
- @x * b.x + @y * b.y + @z * b.z
- end
-
- def vlength
- Math.sqrt(@x * @x + @y * @y + @z * @z)
- end
-
- def vnormalize
- len = vlength
- v = Vec.new(@x, @y, @z)
- if len > 1.0e-17 then
- v.x = v.x / len
- v.y = v.y / len
- v.z = v.z / len
- end
- v
- end
-end
-
-
-class Sphere
- def initialize(center, radius)
- @center = center
- @radius = radius
- end
-
- attr_reader :center, :radius
-
- def intersect(ray, isect)
- rs = ray.org.vsub(@center)
- b = rs.vdot(ray.dir)
- c = rs.vdot(rs) - (@radius * @radius)
- d = b * b - c
- if d > 0.0 then
- t = - b - Math.sqrt(d)
-
- if t > 0.0 and t < isect.t then
- isect.t = t
- isect.hit = true
- isect.pl = Vec.new(ray.org.x + ray.dir.x * t,
- ray.org.y + ray.dir.y * t,
- ray.org.z + ray.dir.z * t)
- n = isect.pl.vsub(@center)
- isect.n = n.vnormalize
- else
- 0.0
- end
- end
- nil
- end
-end
-
-class Plane
- def initialize(p, n)
- @p = p
- @n = n
- end
-
- def intersect(ray, isect)
- d = -@p.vdot(@n)
- v = ray.dir.vdot(@n)
- v0 = v
- if v < 0.0 then
- v0 = -v
- end
- if v0 < 1.0e-17 then
- return
- end
-
- t = -(ray.org.vdot(@n) + d) / v
-
- if t > 0.0 and t < isect.t then
- isect.hit = true
- isect.t = t
- isect.n = @n
- isect.pl = Vec.new(ray.org.x + t * ray.dir.x,
- ray.org.y + t * ray.dir.y,
- ray.org.z + t * ray.dir.z)
- end
- nil
- end
-end
-
-class Ray
- def initialize(org, dir)
- @org = org
- @dir = dir
- end
-
- attr_accessor :org, :dir
-end
-
-class Isect
- def initialize
- @t = 10000000.0
- @hit = false
- @pl = Vec.new(0.0, 0.0, 0.0)
- @n = Vec.new(0.0, 0.0, 0.0)
- end
-
- attr_accessor :t, :hit, :pl, :n
-end
-
-def clamp(f)
- i = f * 255.5
- if i > 255.0 then
- i = 255.0
- end
- if i < 0.0 then
- i = 0.0
- end
- i.to_i
-end
-
-def otherBasis(basis, n)
- basis[2] = Vec.new(n.x, n.y, n.z)
- basis[1] = Vec.new(0.0, 0.0, 0.0)
-
- if n.x < 0.6 and n.x > -0.6 then
- basis[1].x = 1.0
- elsif n.y < 0.6 and n.y > -0.6 then
- basis[1].y = 1.0
- elsif n.z < 0.6 and n.z > -0.6 then
- basis[1].z = 1.0
- else
- basis[1].x = 1.0
- end
-
- basis[0] = basis[1].vcross(basis[2])
- basis[0] = basis[0].vnormalize
-
- basis[1] = basis[2].vcross(basis[0])
- basis[1] = basis[1].vnormalize
-end
-
-class Scene
- def initialize
- @spheres = Array.new
- @spheres[0] = Sphere.new(Vec.new(-2.0, 0.0, -3.5), 0.5)
- @spheres[1] = Sphere.new(Vec.new(-0.5, 0.0, -3.0), 0.5)
- @spheres[2] = Sphere.new(Vec.new(1.0, 0.0, -2.2), 0.5)
- @plane = Plane.new(Vec.new(0.0, -0.5, 0.0), Vec.new(0.0, 1.0, 0.0))
- end
-
- def ambient_occlusion(isect)
- basis = Array.new
- otherBasis(basis, isect.n)
-
- ntheta = NAO_SAMPLES
- nphi = NAO_SAMPLES
- eps = 0.0001
- occlusion = 0.0
-
- p0 = Vec.new(isect.pl.x + eps * isect.n.x,
- isect.pl.y + eps * isect.n.y,
- isect.pl.z + eps * isect.n.z)
- nphi.times do |j|
- ntheta.times do |i|
- r = rand
- phi = 2.0 * 3.14159265 * rand
- x = Math.cos(phi) * Math.sqrt(1.0 - r)
- y = Math.sin(phi) * Math.sqrt(1.0 - r)
- z = Math.sqrt(r)
-
- rx = x * basis[0].x + y * basis[1].x + z * basis[2].x
- ry = x * basis[0].y + y * basis[1].y + z * basis[2].y
- rz = x * basis[0].z + y * basis[1].z + z * basis[2].z
-
- raydir = Vec.new(rx, ry, rz)
- ray = Ray.new(p0, raydir)
-
- occisect = Isect.new
- @spheres[0].intersect(ray, occisect)
- @spheres[1].intersect(ray, occisect)
- @spheres[2].intersect(ray, occisect)
- @plane.intersect(ray, occisect)
- if occisect.hit then
- occlusion = occlusion + 1.0
- else
- 0.0
- end
- end
- end
-
- occlusion = (ntheta.to_f * nphi.to_f - occlusion) / (ntheta.to_f * nphi.to_f)
-
- Vec.new(occlusion, occlusion, occlusion)
- end
-
- def render(w, h, nsubsamples)
- cnt = 0
- nsf = nsubsamples.to_f
- h.times do |y|
- w.times do |x|
- rad = Vec.new(0.0, 0.0, 0.0)
-
- # Subsampling
- nsubsamples.times do |v|
- nsubsamples.times do |u|
-
- cnt = cnt + 1
- wf = w.to_f
- hf = h.to_f
- xf = x.to_f
- yf = y.to_f
- uf = u.to_f
- vf = v.to_f
-
- px = (xf + (uf / nsf) - (wf / 2.0)) / (wf / 2.0)
- py = -(yf + (vf / nsf) - (hf / 2.0)) / (hf / 2.0)
-
- eye = Vec.new(px, py, -1.0).vnormalize
-
- ray = Ray.new(Vec.new(0.0, 0.0, 0.0), eye)
-
- isect = Isect.new
- @spheres[0].intersect(ray, isect)
- @spheres[1].intersect(ray, isect)
- @spheres[2].intersect(ray, isect)
- @plane.intersect(ray, isect)
- if isect.hit then
- col = ambient_occlusion(isect)
- rad.x = rad.x + col.x
- rad.y = rad.y + col.y
- rad.z = rad.z + col.z
- end
- end
- end
-
- r = rad.x / (nsf * nsf)
- g = rad.y / (nsf * nsf)
- b = rad.z / (nsf * nsf)
- printf("%c", clamp(r))
- printf("%c", clamp(g))
- printf("%c", clamp(b))
- end
- nil
- end
-
- nil
- end
-end
-
-alias printf_orig printf
-def printf *args
-end
-
-# File.open("ao.ppm", "w") do |fp|
- printf("P6\n")
- printf("%d %d\n", IMAGE_WIDTH, IMAGE_HEIGHT)
- printf("255\n", IMAGE_WIDTH, IMAGE_HEIGHT)
- Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES)
-# end
-
-undef printf
-alias printf printf_orig
diff --git a/benchmark/bm_app_lc_fizzbuzz.rb b/benchmark/bm_app_lc_fizzbuzz.rb
deleted file mode 100644
index f09574bbeb..0000000000
--- a/benchmark/bm_app_lc_fizzbuzz.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# FizzBuzz program using only lambda calculus
-#
-# This program is quoted from
-# "Understanding Computation" by Tom Stuart
-# http://computationbook.com/
-#
-# You can understand why this program works fine by reading this book.
-#
-
-solution = -> k { -> f { -> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> l { -> x { -> g { -> b { b }[-> p { p[-> x { -> y { x } }] }[l]][x][-> y { g[f[-> l { -> p { p[-> x { -> y { y } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][x][g]][-> l { -> p { p[-> x { -> y { x } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][y] }] } } } }][k][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> l { -> x { -> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[l][f[x]] } }] } }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[m][n]][-> x { -> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[f[-> n { -> p { -> x { p[n[p][x]] } } }[m]][n]][m][x] }][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]] } } }][-> p { -> x { p[x] } }][-> p { -> x { p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] } }]][-> n { -> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[p[p[p[p[p[p[p[p[p[p[p[p[x]]]]]]]]]]]]]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[x]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> b { b }[-> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]]][-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> n { -> p { -> x { p[n[p][x]] } } }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]]]][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> n { -> l { -> x { -> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> l { -> x { -> g { -> b { b }[-> p { p[-> x { -> y { x } }] }[l]][x][-> y { g[f[-> l { -> p { p[-> x { -> y { y } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][x][g]][-> l { -> p { p[-> x { -> y { x } }] }[-> p { p[-> x { -> y { y } }] }[l]] }[l]][y] }] } } } }][l][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }[-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][x]][-> l { -> x { -> x { -> y { -> f { f[x][y] } } }[-> x { -> y { y } }][-> x { -> y { -> f { f[x][y] } } }[x][l]] } }] } }[-> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }[-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]]][-> x { -> y { -> f { f[x][y] } } }[-> x { -> y { x } }][-> x { -> y { x } }]][-> x { f[-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { -> n { -> p { -> x { p[n[p][x]] } } }[f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n]][x] }][-> p { -> x { x } }] } } }][n][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]][x] }]][-> f { -> x { f[-> y { x[x][y] }] }[-> x { f[-> y { x[x][y] }] }] }[-> f { -> m { -> n { -> b { b }[-> m { -> n { -> n { n[-> x { -> x { -> y { y } } }][-> x { -> y { x } }] }[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]] } }[n][m]][-> x { f[-> m { -> n { n[-> n { -> p { p[-> x { -> y { x } }] }[n[-> p { -> x { -> y { -> f { f[x][y] } } }[-> p { p[-> x { -> y { y } }] }[p]][-> n { -> p { -> x { p[n[p][x]] } } }[-> p { p[-> x { -> y { y } }] }[p]]] }][-> x { -> y { -> f { f[x][y] } } }[-> p { -> x { x } }][-> p { -> x { x } }]]] }][m] } }[m][n]][n][x] }][m] } } }][n][-> m { -> n { n[-> m { -> n { n[-> n { -> p { -> x { p[n[p][x]] } } }][m] } }[m]][-> p { -> x { x } }] } }[-> p { -> x { p[p[x]] } }][-> p { -> x { p[p[p[p[p[x]]]]] } }]]] } }][n]]]] }]
-
-FIRST = -> l { LEFT[RIGHT[l]] }
-IF = -> b { b }
-LEFT = -> p { p[-> x { -> y { x } } ] }
-RIGHT = -> p { p[-> x { -> y { y } } ] }
-IS_EMPTY = LEFT
-REST = -> l { RIGHT[RIGHT[l]] }
-
-def to_integer(proc)
- proc[-> n { n + 1 }][0]
-end
-
-def to_boolean(proc)
- IF[proc][true][false]
-end
-
-def to_array(proc)
- array = []
-
- until to_boolean(IS_EMPTY[proc])
- array.push(FIRST[proc])
- proc = REST[proc]
- end
-
- array
-end
-
-def to_char(c)
- '0123456789BFiuz'.slice(to_integer(c))
-end
-
-def to_string(s)
- to_array(s).map { |c| to_char(c) }.join
-end
-
-answer = to_array(solution).map do |p|
- to_string(p)
-end
-
-answer_ary = answer.to_a
-# puts answer_ary
diff --git a/benchmark/bm_array_shift.rb b/benchmark/bm_array_shift.rb
deleted file mode 100644
index 798bb9e3f4..0000000000
--- a/benchmark/bm_array_shift.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'benchmark'
-
-Benchmark.bm do |x|
- [10_000,1_000_000,100_000_000].each do |n|
- ary = Array.new(n,0)
- GC.start
- x.report("#{n}:shift"){ ary.shift }
- (0..4).each do |i|
- ary = Array.new(n,0)
- GC.start
- x.report("#{n}:shift(#{i})"){ ary.shift(i) }
- end
- end
-end
diff --git a/benchmark/bm_hash_aref_dsym.rb b/benchmark/bm_hash_aref_dsym.rb
deleted file mode 100644
index af4f8c36d4..0000000000
--- a/benchmark/bm_hash_aref_dsym.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}
-syms = ('a'..'z').map { |s| s.to_sym }
-syms.each { |s| h[s] = 1 }
-200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_dsym_long.rb b/benchmark/bm_hash_aref_dsym_long.rb
deleted file mode 100644
index 9d7759379e..0000000000
--- a/benchmark/bm_hash_aref_dsym_long.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# [ruby-core:70129] [Bug #11396]
-collection_size = 200000
-sample_size = 10000
-
-values = (1..collection_size).to_a.map do |x|
- "THIS IS A LONGER STRING THAT IS ALSO UNIQUE #{x}"
-end
-
-symbol_hash = {}
-
-values.each do |x|
- symbol_hash[x.to_sym] = 1
-end
-
-# use the same samples each time to minimize deviations
-rng = Random.new(0)
-symbol_sample_array = values.sample(sample_size, random: rng).map(&:to_sym)
-
-3000.times do
- symbol_sample_array.each { |x| symbol_hash[x] }
-end
diff --git a/benchmark/bm_hash_aref_fix.rb b/benchmark/bm_hash_aref_fix.rb
deleted file mode 100644
index 1346890582..0000000000
--- a/benchmark/bm_hash_aref_fix.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}
-nums = (1..26).to_a
-nums.each { |i| h[i] = i }
-200_000.times { nums.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_flo.rb b/benchmark/bm_hash_aref_flo.rb
deleted file mode 100644
index 2217274c82..0000000000
--- a/benchmark/bm_hash_aref_flo.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}
-strs = [*1..10000].map! {|i| i.fdiv(10)}
-strs.each { |s| h[s] = s }
-50.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_miss.rb b/benchmark/bm_hash_aref_miss.rb
deleted file mode 100644
index b0913dd4bb..0000000000
--- a/benchmark/bm_hash_aref_miss.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-h = {}
-strs = ('a'..'z').to_a.map!(&:freeze)
-strs.each { |s| h[s] = s }
-strs = ('A'..'Z').to_a
-200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_str.rb b/benchmark/bm_hash_aref_str.rb
deleted file mode 100644
index 19439b061b..0000000000
--- a/benchmark/bm_hash_aref_str.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}
-strs = ('a'..'z').to_a.map!(&:freeze)
-strs.each { |s| h[s] = s }
-200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_sym.rb b/benchmark/bm_hash_aref_sym.rb
deleted file mode 100644
index f75d163fe6..0000000000
--- a/benchmark/bm_hash_aref_sym.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-syms = ('a'..'z').to_a
-begin
- syms = eval("%i[#{syms.join(' ')}]")
-rescue SyntaxError # <= 1.9.3
- syms.map!(&:to_sym)
-end
-syms.each { |s| h[s] = s }
-200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_aref_sym_long.rb b/benchmark/bm_hash_aref_sym_long.rb
deleted file mode 100644
index 9dab8df7be..0000000000
--- a/benchmark/bm_hash_aref_sym_long.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-h = {}
-syms = %w[puts warn syswrite write stat bacon lettuce tomato
-some symbols in this array may already be interned others should not be
-hash browns make good breakfast but not cooked using prime numbers
-shift for division entries delete_if keys exist?
-]
-begin
- syms = eval("%i[#{syms.join(' ')}]")
-rescue SyntaxError # <= 1.9.3
- syms.map!(&:to_sym)
-end
-syms.each { |s| h[s] = s }
-200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_flatten.rb b/benchmark/bm_hash_flatten.rb
deleted file mode 100644
index e944aae9f2..0000000000
--- a/benchmark/bm_hash_flatten.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-1000.times do
- h.flatten
-end
diff --git a/benchmark/bm_hash_ident_flo.rb b/benchmark/bm_hash_ident_flo.rb
deleted file mode 100644
index 0c7edfed3e..0000000000
--- a/benchmark/bm_hash_ident_flo.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}.compare_by_identity
-strs = (1..10000).to_a.map!(&:to_f)
-strs.each { |s| h[s] = s }
-50.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_ident_num.rb b/benchmark/bm_hash_ident_num.rb
deleted file mode 100644
index b226736c6f..0000000000
--- a/benchmark/bm_hash_ident_num.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}.compare_by_identity
-nums = (1..26).to_a
-nums.each { |n| h[n] = n }
-200_000.times { nums.each { |n| h[n] } }
diff --git a/benchmark/bm_hash_ident_obj.rb b/benchmark/bm_hash_ident_obj.rb
deleted file mode 100644
index 4b3b58edec..0000000000
--- a/benchmark/bm_hash_ident_obj.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}.compare_by_identity
-objs = 26.times.map { Object.new }
-objs.each { |o| h[o] = o }
-200_000.times { objs.each { |o| h[o] } }
diff --git a/benchmark/bm_hash_ident_str.rb b/benchmark/bm_hash_ident_str.rb
deleted file mode 100644
index 8582b38e31..0000000000
--- a/benchmark/bm_hash_ident_str.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}.compare_by_identity
-strs = ('a'..'z').to_a
-strs.each { |s| h[s] = s }
-200_000.times { strs.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_ident_sym.rb b/benchmark/bm_hash_ident_sym.rb
deleted file mode 100644
index 4c81e3d28e..0000000000
--- a/benchmark/bm_hash_ident_sym.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-h = {}.compare_by_identity
-syms = ('a'..'z').to_a.map(&:to_sym)
-syms.each { |s| h[s] = s }
-200_000.times { syms.each { |s| h[s] } }
diff --git a/benchmark/bm_hash_keys.rb b/benchmark/bm_hash_keys.rb
deleted file mode 100644
index 6863cd01f9..0000000000
--- a/benchmark/bm_hash_keys.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-5000.times do
- h.keys
-end
diff --git a/benchmark/bm_hash_shift.rb b/benchmark/bm_hash_shift.rb
deleted file mode 100644
index a645671a5b..0000000000
--- a/benchmark/bm_hash_shift.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-50000.times do
- k, v = h.shift
- h[k] = v
-end
diff --git a/benchmark/bm_hash_shift_u16.rb b/benchmark/bm_hash_shift_u16.rb
deleted file mode 100644
index ec800d0342..0000000000
--- a/benchmark/bm_hash_shift_u16.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-h = {}
-
-(16384..65536).each do |i|
- h[i] = nil
-end
-
-300000.times do
- k, v = h.shift
- h[k] = v
-end
diff --git a/benchmark/bm_hash_shift_u24.rb b/benchmark/bm_hash_shift_u24.rb
deleted file mode 100644
index de4e0fa696..0000000000
--- a/benchmark/bm_hash_shift_u24.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-h = {}
-
-(0xff4000..0xffffff).each do |i|
- h[i] = nil
-end
-
-300000.times do
- k, v = h.shift
- h[k] = v
-end
diff --git a/benchmark/bm_hash_shift_u32.rb b/benchmark/bm_hash_shift_u32.rb
deleted file mode 100644
index 656aa55583..0000000000
--- a/benchmark/bm_hash_shift_u32.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-h = {}
-
-(0xffff4000..0xffffffff).each do |i|
- h[i] = nil
-end
-
-300000.times do
- k, v = h.shift
- h[k] = v
-end
diff --git a/benchmark/bm_hash_to_proc.rb b/benchmark/bm_hash_to_proc.rb
deleted file mode 100644
index 2b675bf509..0000000000
--- a/benchmark/bm_hash_to_proc.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-5000.times do |i|
- [i].map(&h)
-end
diff --git a/benchmark/bm_hash_values.rb b/benchmark/bm_hash_values.rb
deleted file mode 100644
index 069441302f..0000000000
--- a/benchmark/bm_hash_values.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-5000.times do
- h.values
-end
diff --git a/benchmark/bm_io_nonblock_noex.rb b/benchmark/bm_io_nonblock_noex.rb
deleted file mode 100644
index da9357fdc6..0000000000
--- a/benchmark/bm_io_nonblock_noex.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-nr = 1_000_000
-i = 0
-msg = '.'
-buf = '.'
-noex = { exception: false }
-begin
- r, w = IO.pipe
- while i < nr
- i += 1
- w.write_nonblock(msg, noex)
- r.read_nonblock(1, buf, noex)
- end
-rescue ArgumentError # old Rubies
- while i < nr
- i += 1
- w.write_nonblock(msg)
- r.read_nonblock(1, buf)
- end
-ensure
- r.close
- w.close
-end
diff --git a/benchmark/bm_io_nonblock_noex2.rb b/benchmark/bm_io_nonblock_noex2.rb
deleted file mode 100644
index 56819d049b..0000000000
--- a/benchmark/bm_io_nonblock_noex2.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-nr = 1_000_000
-i = 0
-msg = '.'
-buf = '.'
-begin
- r, w = IO.pipe
- while i < nr
- i += 1
- w.write_nonblock(msg, exception: false)
- r.read_nonblock(1, buf, exception: false)
- end
-rescue ArgumentError # old Rubies
- while i < nr
- i += 1
- w.write_nonblock(msg)
- r.read_nonblock(1, buf)
- end
-ensure
- r.close
- w.close
-end
diff --git a/benchmark/bm_marshal_dump_flo.rb b/benchmark/bm_marshal_dump_flo.rb
deleted file mode 100644
index 9b8d0c6afb..0000000000
--- a/benchmark/bm_marshal_dump_flo.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-bug10761 = 10000.times.map { |x| x.to_f }
-100.times { Marshal.dump(bug10761) }
diff --git a/benchmark/bm_marshal_dump_load_geniv.rb b/benchmark/bm_marshal_dump_load_geniv.rb
deleted file mode 100644
index 8252ad90fa..0000000000
--- a/benchmark/bm_marshal_dump_load_geniv.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-a = ''
-a.instance_eval do
- @a = :a
- @b = :b
- @c = :c
-end
-100000.times do
- a = Marshal.load(Marshal.dump(a))
-end
-#p(a.instance_eval { @a == :a && @b == :b && @c == :c })
diff --git a/benchmark/bm_marshal_dump_load_time.rb b/benchmark/bm_marshal_dump_load_time.rb
deleted file mode 100644
index e29743b791..0000000000
--- a/benchmark/bm_marshal_dump_load_time.rb
+++ /dev/null
@@ -1 +0,0 @@
-100000.times { Marshal.load(Marshal.dump(Time.now)) }
diff --git a/benchmark/bm_require.rb b/benchmark/bm_require.rb
deleted file mode 100644
index b8abc88f41..0000000000
--- a/benchmark/bm_require.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-$:.push File.join(File.dirname(__FILE__), "bm_require.data")
-
-1.upto(10000) do |i|
- require "c#{i}"
-end
-
-$:.pop
diff --git a/benchmark/bm_require_thread.rb b/benchmark/bm_require_thread.rb
deleted file mode 100644
index e54db6c6e5..0000000000
--- a/benchmark/bm_require_thread.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-$:.push File.join(File.dirname(__FILE__), "bm_require.data")
-
-i=0
-t = Thread.new do
- while true
- i = i+1 # dummy loop
- end
-end
-
-1.upto(100) do |i|
- require "c#{i}"
-end
-
-$:.pop
-t.kill
diff --git a/benchmark/bm_securerandom.rb b/benchmark/bm_securerandom.rb
deleted file mode 100644
index a082ea6d5b..0000000000
--- a/benchmark/bm_securerandom.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require "securerandom"
-
-20_0000.times do
- SecureRandom.random_number(100)
-end
diff --git a/benchmark/bm_so_binary_trees.rb b/benchmark/bm_so_binary_trees.rb
index b1693e4109..6a26465578 100644
--- a/benchmark/bm_so_binary_trees.rb
+++ b/benchmark/bm_so_binary_trees.rb
@@ -4,9 +4,7 @@
# contributed by Jesse Millikan
# disable output
-alias puts_orig puts
-def puts str
- # disable puts
+def STDOUT.write_ *args
end
def item_check(tree)
@@ -27,7 +25,7 @@ def bottom_up_tree(item, depth)
end
end
-max_depth = 16 # ARGV[0].to_i
+max_depth = 12 # 16 # ARGV[0].to_i
min_depth = 4
max_depth = min_depth + 2 if min_depth + 2 > max_depth
@@ -57,6 +55,3 @@ min_depth.step(max_depth + 1, 2) do |depth|
end
puts "long lived tree of depth #{max_depth}\t check: #{item_check(long_lived_tree)}"
-
-undef puts
-alias puts puts_orig
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
index 17e9c046a8..99cf6a91cc 100644
--- a/benchmark/bm_so_meteor_contest.rb
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -32,7 +32,7 @@ class Rotation
@start_masks = Array.new(60)
# create the rotational masks by placing the base mask at the location and seeing if
- # 1) it overlaps the boundaries and 2) it produces a prunable board. if either of these
+ # 1) it overlaps the boundries and 2) it produces a prunable board. if either of these
# is true the piece cannot be placed
0.upto(59) do | offset |
mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
@@ -326,9 +326,9 @@ end
# The exact procedure is described in-code
def prunable( board, location, slotting = false)
collectors = []
- # loop across the rows
+ # loop accross the rows
(location / 6).to_i.upto(9) do | row_on |
- # obtain a set of regions representing the bits of the current row.
+ # obtain a set of regions representing the bits of the curent row.
regions = $regions[(board >> (row_on * 6)) & 0b11111]
converter = $converter[row_on]
@@ -370,7 +370,7 @@ def prunable( board, location, slotting = false)
end
# check the existing collectors, if any collector overlapped no bits in the region its [2] value will
- # be zero. The size of any such reaason is tested if it is not a multiple of five true is returned since
+ # be zero. The size of any such reaason is tested if it is not a muliple of five true is returned since
# the board is prunable. if it is a multiple of five it is removed.
# Collector that are still active have a new adjacent value [0] set based n the matched bits
# and have [2] cleared out for the next cycle.
@@ -382,7 +382,7 @@ def prunable( board, location, slotting = false)
collectors[collector_num] = nil
else
# if a collector matches all bits in the row then we can return unprunable early for the
- # following reasons:
+ # follwing reasons:
# 1) there can be no more unavailable bits bince we fill from the top left downward
# 2) all previous regions have been closed or joined so only this region can fail
# 3) this region must be good since there can never be only 1 region that is nuot
@@ -467,7 +467,7 @@ def find_top( rotation_skip)
end
# the normail find routine, iterates through the available pieces, checks all rotations at the current location
-# and adds any boards found. depth is achieved via recursion. the overall approach is described
+# and adds any boards found. depth is acheived via recursion. the overall approach is described
# here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
# parameters:
# start_location -- where to start looking for place for the next piece at
@@ -526,7 +526,7 @@ def save( board_string)
@boards_found += 1
# the exit motif is a time saver. Ideally the function should return, but those tests
- # take noticeable time (performance).
+ # take noticable time (performance).
if (@boards_found == @stop_count) then
print_results
exit(0)
diff --git a/benchmark/bm_vm1_gc_short_lived.rb b/benchmark/bm_vm1_gc_short_lived.rb
deleted file mode 100644
index e78bca5668..0000000000
--- a/benchmark/bm_vm1_gc_short_lived.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-i = 0
-while i<30_000_000 # while loop 1
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_short_with_complex_long.rb b/benchmark/bm_vm1_gc_short_with_complex_long.rb
deleted file mode 100644
index b66052dee0..0000000000
--- a/benchmark/bm_vm1_gc_short_with_complex_long.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-def nested_hash h, n
- if n == 0
- ''
- else
- 10.times{
- h[Object.new] = nested_hash(h, n-1)
- }
- end
-end
-
-long_lived = Hash.new
-nested_hash long_lived, 6
-
-GC.start
-GC.start
-
-i = 0
-while i<30_000_000 # while loop 1
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
- i+=1
-end
-
diff --git a/benchmark/bm_vm1_gc_short_with_long.rb b/benchmark/bm_vm1_gc_short_with_long.rb
deleted file mode 100644
index 298dbc845b..0000000000
--- a/benchmark/bm_vm1_gc_short_with_long.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-long_lived = Array.new(1_000_000){|i| "#{i}"}
-GC.start
-GC.start
-i = 0
-while i<30_000_000 # while loop 1
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_short_with_symbol.rb b/benchmark/bm_vm1_gc_short_with_symbol.rb
deleted file mode 100644
index 6b15c1b7bf..0000000000
--- a/benchmark/bm_vm1_gc_short_with_symbol.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# make many symbols
-50_000.times{|i| sym = "sym#{i}".to_sym}
-GC.start
-GC.start
-
-i = 0
-while i<30_000_000 # while loop 1
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_wb_ary.rb b/benchmark/bm_vm1_gc_wb_ary.rb
deleted file mode 100644
index 881528845b..0000000000
--- a/benchmark/bm_vm1_gc_wb_ary.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-short_lived_ary = []
-
-if RUBY_VERSION >= "2.2.0"
- GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false)
-end
-
-i = 0
-short_lived = ''
-while i<30_000_000 # while loop 1
- short_lived_ary[0] = short_lived # write barrier
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_wb_ary_promoted.rb b/benchmark/bm_vm1_gc_wb_ary_promoted.rb
deleted file mode 100644
index 3c8279c956..0000000000
--- a/benchmark/bm_vm1_gc_wb_ary_promoted.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-long_lived = []
-
-if RUBY_VERSION > "2.2.0"
- 3.times{ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false) }
-elsif
- GC.start
-end
-
-i = 0
-short_lived = ''
-while i<30_000_000 # while loop 1
- long_lived[0] = short_lived # write barrier
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_wb_obj.rb b/benchmark/bm_vm1_gc_wb_obj.rb
deleted file mode 100644
index a4067af36b..0000000000
--- a/benchmark/bm_vm1_gc_wb_obj.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class C
- attr_accessor :foo
-end
-short_lived_obj = C.new
-
-if RUBY_VERSION >= "2.2.0"
- GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false)
-end
-
-i = 0
-short_lived = ''
-while i<30_000_000 # while loop 1
- short_lived_obj.foo = short_lived # write barrier
- i+=1
-end
diff --git a/benchmark/bm_vm1_gc_wb_obj_promoted.rb b/benchmark/bm_vm1_gc_wb_obj_promoted.rb
deleted file mode 100644
index eee07a0248..0000000000
--- a/benchmark/bm_vm1_gc_wb_obj_promoted.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class C
- attr_accessor :foo
-end
-long_lived = C.new
-
-if RUBY_VERSION >= "2.2.0"
- 3.times{ GC.start(full_mark: false, immediate_mark: true, lazy_sweep: false) }
-elsif
- GC.start
-end
-
-i = 0
-short_lived = ''
-while i<30_000_000 # while loop 1
- long_lived.foo = short_lived # write barrier
- i+=1
-end
diff --git a/benchmark/bm_vm2_case_lit.rb b/benchmark/bm_vm2_case_lit.rb
deleted file mode 100644
index c62b294e0e..0000000000
--- a/benchmark/bm_vm2_case_lit.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-i = 0
-@ret = [ "foo", true, false, :sym, 6, nil, 0.1, 0xffffffffffffffff ]
-def foo(i)
- @ret[i % @ret.size]
-end
-
-while i<6_000_000 # while loop 2
- case foo(i)
- when "foo" then :foo
- when true then true
- when false then false
- when :sym then :sym
- when 6 then :fix
- when nil then nil
- when 0.1 then :float
- when 0xffffffffffffffff then :big
- end
- i += 1
-end
diff --git a/benchmark/bm_vm2_newlambda.rb b/benchmark/bm_vm2_newlambda.rb
deleted file mode 100644
index 6422c9b0d0..0000000000
--- a/benchmark/bm_vm2_newlambda.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- lambda {}
-end
diff --git a/benchmark/bm_vm2_string_literal.rb b/benchmark/bm_vm2_string_literal.rb
deleted file mode 100644
index 1d73036849..0000000000
--- a/benchmark/bm_vm2_string_literal.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-end
diff --git a/benchmark/bm_vm2_struct_big_aref_hi.rb b/benchmark/bm_vm2_struct_big_aref_hi.rb
deleted file mode 100644
index 22cb26b0a5..0000000000
--- a/benchmark/bm_vm2_struct_big_aref_hi.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x.z # x[25]
-end
diff --git a/benchmark/bm_vm2_struct_big_aref_lo.rb b/benchmark/bm_vm2_struct_big_aref_lo.rb
deleted file mode 100644
index 5e61a7087e..0000000000
--- a/benchmark/bm_vm2_struct_big_aref_lo.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x.k # x[10]
-end
diff --git a/benchmark/bm_vm2_struct_big_aset.rb b/benchmark/bm_vm2_struct_big_aset.rb
deleted file mode 100644
index 5a1c3d16f3..0000000000
--- a/benchmark/bm_vm2_struct_big_aset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x.k = i # x[10] = i
-end
diff --git a/benchmark/bm_vm2_struct_big_href_hi.rb b/benchmark/bm_vm2_struct_big_href_hi.rb
deleted file mode 100644
index fff940a80a..0000000000
--- a/benchmark/bm_vm2_struct_big_href_hi.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x[:z]
-end
diff --git a/benchmark/bm_vm2_struct_big_href_lo.rb b/benchmark/bm_vm2_struct_big_href_lo.rb
deleted file mode 100644
index 5e4085d59d..0000000000
--- a/benchmark/bm_vm2_struct_big_href_lo.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x[:k]
-end
diff --git a/benchmark/bm_vm2_struct_big_hset.rb b/benchmark/bm_vm2_struct_big_hset.rb
deleted file mode 100644
index 9c0cee4141..0000000000
--- a/benchmark/bm_vm2_struct_big_hset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(*('a'..'z').map { |x| x.to_sym })
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x[:k] = i
-end
diff --git a/benchmark/bm_vm2_struct_small_aref.rb b/benchmark/bm_vm2_struct_small_aref.rb
deleted file mode 100644
index 8eaa555b41..0000000000
--- a/benchmark/bm_vm2_struct_small_aref.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(:a, :b, :c)
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x.a
-end
diff --git a/benchmark/bm_vm2_struct_small_aset.rb b/benchmark/bm_vm2_struct_small_aset.rb
deleted file mode 100644
index ecd0f95669..0000000000
--- a/benchmark/bm_vm2_struct_small_aset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(:a, :b, :c)
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x.a = i
-end
diff --git a/benchmark/bm_vm2_struct_small_href.rb b/benchmark/bm_vm2_struct_small_href.rb
deleted file mode 100644
index 2c88fee6bf..0000000000
--- a/benchmark/bm_vm2_struct_small_href.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(:a, :b, :c)
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x[:a]
-end
diff --git a/benchmark/bm_vm2_struct_small_hset.rb b/benchmark/bm_vm2_struct_small_hset.rb
deleted file mode 100644
index 33c36d20f1..0000000000
--- a/benchmark/bm_vm2_struct_small_hset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-s = Struct.new(:a, :b, :c)
-x = s.new
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- x[:a] = 1
-end
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
index e668026915..7db9829d44 100644..100755
--- a/benchmark/bm_vm3_gc.rb
+++ b/benchmark/bm_vm3_gc.rb
@@ -1,3 +1,4 @@
+#! /usr/bin/ruby
5000.times do
100.times do
{"xxxx"=>"yyyy"}
diff --git a/benchmark/bm_vm_symbol_block_pass.rb b/benchmark/bm_vm_symbol_block_pass.rb
deleted file mode 100644
index 1d433353e1..0000000000
--- a/benchmark/bm_vm_symbol_block_pass.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class C
- 1000.times {|i|
- eval("def i#{i};end")
- }
-end
-
-c = C.new
-m = C.instance_methods(false)
-5_000.times do
- m.each do |n|
- c.tap(&n)
- end
-end
diff --git a/benchmark/bm_vm_thread_close.rb b/benchmark/bm_vm_thread_close.rb
deleted file mode 100644
index 3e9a265ce8..0000000000
--- a/benchmark/bm_vm_thread_close.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-1000.times { Thread.new { sleep } }
-i = 0
-while i<100_000 # benchmark loop 3
- i += 1
- IO.pipe.each(&:close)
-end
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
index 112a621905..272d231eba 100644
--- a/benchmark/bm_vm_thread_pipe.rb
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -1,4 +1,4 @@
-# Measure small and plenty pipe read/write.
+# Mesure small and plenty pipe read/write.
# A performance may depend on GVL implementation.
lmax = 100_000
diff --git a/benchmark/bm_vm_thread_queue.rb b/benchmark/bm_vm_thread_queue.rb
deleted file mode 100644
index 37381ae62b..0000000000
--- a/benchmark/bm_vm_thread_queue.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'thread'
-
-n = 1_000_000
-q = Queue.new
-consumer = Thread.new{
- while q.pop
- # consuming
- end
-}
-
-producer = Thread.new{
- n.times{
- q.push true
- }
- q.push nil
-}
-
-consumer.join
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index defe3c30be..695dc41aff 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -29,25 +29,6 @@ class BenchmarkDriver
end
end
- def self.load(input, type, opt)
- attrs = [:executables, :results]
- case type
- when 'yaml'
- require 'yaml'
- h = YAML.load(input)
- when 'json'
- require 'json'
- h = JSON.load(input)
- else
- h = eval(input.read)
- end
- obj = allocate
- obj.instance_variable_set("@execs", h[:executables] || h["executables"])
- obj.instance_variable_set("@results", h[:results] || h["results"])
- obj.instance_variable_set("@opt", opt)
- obj
- end
-
def output *args
puts(*args)
@output and @output.puts(*args)
@@ -136,25 +117,6 @@ class BenchmarkDriver
end
def show_results
- case @opt[:format]
- when :tsv
- strformat = "\t%1$s"
- numformat = "\t%1$*2$.3f"
- minwidth = 0
- name_width = 0
- when :markdown
- markdown = true
- strformat = "|%1$-*2$s"
- numformat = "|%1$*2$.3f"
- when :plain
- strformat = " %1$-*2$s"
- numformat = " %1$*2$.3f"
- end
-
- name_width ||= @results.map {|v,*| v.size}.max
- minwidth ||= 7
- width = @execs.map{|(_, v)| [v.size, minwidth].max}
-
output
if @verbose
@@ -166,29 +128,6 @@ class BenchmarkDriver
message "Elapsed time: #{Time.now - @start_time} (sec)"
end
- if rawdata_output = @opt[:rawdata_output]
- h = {}
- h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
- h[:executables] = @execs
- h[:results] = @results
- if (type = File.extname(rawdata_output)).empty?
- type = rawdata_output
- rawdata_output = @output.path.sub(/\.[^.\/]+\z/, '') << '.' << rawdata_output
- end
- case type
- when 'yaml'
- require 'yaml'
- h = YAML.dump(h)
- when 'json'
- require 'json'
- h = JSON.pretty_generate(h)
- else
- require 'pp'
- h = h.pretty_inspect
- end
- open(rawdata_output, 'w') {|f| f.puts h}
- end
-
output '-----------------------------------------------------------'
output 'benchmark results:'
@@ -197,24 +136,19 @@ class BenchmarkDriver
end
output "Execution time (sec)"
- output if markdown
- output ["name".ljust(name_width), @execs.map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
- output ["-"*name_width, width.map{|n|":".rjust(n, "-")}].join("|") if markdown
+ output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
@results.each{|v, result|
rets = []
s = adjusted_results(v, result){|r|
- rets << sprintf(numformat, r, width[rets.size])
+ rets << sprintf("%.3f", r)
}
- v += s if s
- output [v.ljust(name_width), rets].join("")
+ output "#{v}#{s}\t#{rets.join("\t")}"
}
if @execs.size > 1
output
output "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)"
- output if markdown
- output ["name".ljust(name_width), @execs[1..-1].map.with_index{|(_, v), i| sprintf(strformat, v, width[i])}].join("").rstrip
- output ["-"*name_width, width[1..-1].map{|n|":".rjust(n, "-")}].join("|") if markdown
+ output "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
@results.each{|v, result|
rets = []
first_value = nil
@@ -223,14 +157,13 @@ class BenchmarkDriver
if r == 0
rets << "Error"
else
- rets << sprintf(numformat, first_value/r, width[rets.size+1])
+ rets << sprintf("%.3f", first_value/r)
end
else
first_value = r
end
}
- v += s if s
- output [v.ljust(name_width), rets].join("")
+ output "#{v}#{s}\t#{rets.join("\t")}"
}
end
@@ -305,17 +238,11 @@ class BenchmarkDriver
result
end
- unless defined?(File::NULL)
- if File.exist?('/dev/null')
- File::NULL = '/dev/null'
- end
- end
-
def measure executable, file
cmd = "#{executable} #{@ruby_arg} #{file}"
m = Benchmark.measure{
- system(cmd, out: File::NULL)
+ `#{cmd}`
}
if $? != 0
@@ -332,14 +259,7 @@ if __FILE__ == $0
:execs => [],
:dir => File.dirname(__FILE__),
:repeat => 1,
- :output => nil,
- :raw_output => nil,
- :format => :tsv,
- }
- formats = {
- :tsv => ".tsv",
- :markdown => ".md",
- :plain => ".txt",
+ :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
}
parser = OptionParser.new{|o|
@@ -367,34 +287,15 @@ if __FILE__ == $0
o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
opt[:ruby_arg] = a
}
- o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
- opt[:rawdata_output] = r
- }
- o.on('--load-rawdata=FILE', 'input rawdata'){|r|
- opt[:rawdata_input] = r
- }
- o.on('-f', "--format=FORMAT", "output format (#{formats.keys.join(",")})", formats.keys){|r|
- opt[:format] = r
+ o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+ opt[:quiet] = q
}
o.on('-v', '--verbose'){|v|
opt[:verbose] = v
}
- o.on('-q', '--quiet', "Run without notify information except result table."){|q|
- opt[:quiet] = q
- opt[:verbose] = false
- }
}
parser.parse!(ARGV)
- opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
-
- if input = opt[:rawdata_input]
- b = open(input) {|f|
- BenchmarkDriver.load(f, File.extname(input)[1..-1], opt)
- }
- b.show_results
- else
- BenchmarkDriver.benchmark(opt)
- end
+ BenchmarkDriver.benchmark(opt)
end
diff --git a/benchmark/gc/aobench.rb b/benchmark/gc/aobench.rb
deleted file mode 100644
index 2eed7abc83..0000000000
--- a/benchmark/gc/aobench.rb
+++ /dev/null
@@ -1 +0,0 @@
-require_relative '../bm_app_aobench.rb'
diff --git a/benchmark/gc/binary_trees.rb b/benchmark/gc/binary_trees.rb
deleted file mode 100644
index af8ea722aa..0000000000
--- a/benchmark/gc/binary_trees.rb
+++ /dev/null
@@ -1 +0,0 @@
-require_relative '../bm_so_binary_trees.rb'
diff --git a/benchmark/gc/gcbench.rb b/benchmark/gc/gcbench.rb
deleted file mode 100644
index 09a404466a..0000000000
--- a/benchmark/gc/gcbench.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'benchmark'
-require 'pp'
-require 'optparse'
-
-$list = true
-$gcprof = true
-
-opt = OptionParser.new
-opt.on('-q'){$list = false}
-opt.on('-d'){$gcprof = false}
-opt.parse!(ARGV)
-
-script = File.join(File.dirname(__FILE__), ARGV.shift)
-script += '.rb' unless FileTest.exist?(script)
-raise "#{script} not found" unless FileTest.exist?(script)
-
-puts "Script: #{script}"
-
-if $gcprof
- GC::Profiler.enable
-end
-
-tms = Benchmark.measure{|x|
- load script
-}
-
-gc_time = 0
-
-if $gcprof
- gc_time = GC::Profiler.total_time
- GC::Profiler.report if $list and RUBY_VERSION >= '2.0.0' # before 1.9.3, report() may run infinite loop
- GC::Profiler.disable
-end
-
-pp GC.stat
-
-puts "#{RUBY_DESCRIPTION} #{GC::OPTS.inspect}" if defined?(GC::OPTS)
-
-desc = "#{RUBY_VERSION}#{RUBY_PATCHLEVEL >= 0 ? "p#{RUBY_PATCHLEVEL}" : "dev"}"
-name = File.basename(script, '.rb')
-
-puts
-puts script
-puts Benchmark::CAPTION
-puts tms
-puts "GC total time (sec): #{gc_time}"
-
-# show High-Water Mark on Linux
-if File.exist?('/proc/self/status') && /VmHWM:\s*(\d+.+)/ =~ File.read('/proc/self/status')
- puts
- puts "VmHWM: #{$1.chomp}"
-end
-
-puts
-puts "Summary of #{name} on #{desc}\t#{tms.real}\t#{gc_time}\t#{GC.count}"
-puts " (real time in sec, GC time in sec, GC count)"
diff --git a/benchmark/gc/hash1.rb b/benchmark/gc/hash1.rb
deleted file mode 100644
index cb030d458d..0000000000
--- a/benchmark/gc/hash1.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-value = 0.01
-h = {}
-n = 50_000
-
-1.upto(n){|i|
- h["%020d" % i] = "v-#{i}"
-}
-
-(n * 1_000).times{
- ''
-}
diff --git a/benchmark/gc/hash2.rb b/benchmark/gc/hash2.rb
deleted file mode 100644
index e8c943fb21..0000000000
--- a/benchmark/gc/hash2.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-value = 0.01
-h = {}
-n = 4*(10**6)
-
-1.upto(n){|i|
- h["%020d" % i] = value * i
-}
diff --git a/benchmark/gc/null.rb b/benchmark/gc/null.rb
deleted file mode 100644
index c05a79f561..0000000000
--- a/benchmark/gc/null.rb
+++ /dev/null
@@ -1 +0,0 @@
-# null
diff --git a/benchmark/gc/pentomino.rb b/benchmark/gc/pentomino.rb
deleted file mode 100644
index 94ba74be89..0000000000
--- a/benchmark/gc/pentomino.rb
+++ /dev/null
@@ -1 +0,0 @@
-require_relative '../bm_app_pentomino.rb'
diff --git a/benchmark/gc/rdoc.rb b/benchmark/gc/rdoc.rb
deleted file mode 100644
index 14c89f5611..0000000000
--- a/benchmark/gc/rdoc.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rdoc/rdoc'
-require 'tmpdir'
-
-srcdir = File.expand_path('../..', __dir__)
-
-Dir.mktmpdir('rdocbench-'){|d|
- dir = File.join(d, 'rdocbench')
- args = %W(--root #{srcdir} --page-dir #{srcdir}/doc --encoding=UTF-8 --no-force-update --all --ri --debug --quiet #{srcdir})
- args << '--op' << dir
-
- r = RDoc::RDoc.new
- r.document args
-}
diff --git a/benchmark/gc/redblack.rb b/benchmark/gc/redblack.rb
deleted file mode 100644
index c66290140a..0000000000
--- a/benchmark/gc/redblack.rb
+++ /dev/null
@@ -1,366 +0,0 @@
-# This benchmark is imported from https://github.com/jruby/rubybench/blob/master/time/bench_red_black.rb
-# License is License is Apache-2
-
-require 'benchmark'
-
-# Algorithm based on "Introduction to Algorithms" by Cormen and others
-class RedBlackTree
- class Node
- attr_accessor :color
- attr_accessor :key
- attr_accessor :left
- attr_accessor :right
- attr_accessor :parent
-
- RED = :red
- BLACK = :black
- COLORS = [RED, BLACK].freeze
-
- def initialize(key, color = RED)
- raise ArgumentError, "Bad value for color parameter" unless COLORS.include?(color)
- @color = color
- @key = key
- @left = @right = @parent = NilNode.instance
- end
-
- def black?
- return color == BLACK
- end
-
- def red?
- return color == RED
- end
- end
-
- class NilNode < Node
- class << self
- private :new
-
- # it's not thread safe
- def instance
- @instance ||= begin
- def instance
- return @instance
- end
-
- new
- end
- end
- end
-
- def initialize
- self.color = BLACK
- self.key = 0
- self.left = nil
- self.right = nil
- self.parent = nil
- end
-
- def nil?
- return true
- end
- end
-
- include Enumerable
-
- attr_accessor :root
- attr_accessor :size
-
- def initialize
- self.root = NilNode.instance
- self.size = 0
- end
-
- def add(key)
- insert(Node.new(key))
- end
-
- def insert(x)
- insert_helper(x)
-
- x.color = Node::RED
- while x != root && x.parent.color == Node::RED
- if x.parent == x.parent.parent.left
- y = x.parent.parent.right
- if !y.nil? && y.color == Node::RED
- x.parent.color = Node::BLACK
- y.color = Node::BLACK
- x.parent.parent.color = Node::RED
- x = x.parent.parent
- else
- if x == x.parent.right
- x = x.parent
- left_rotate(x)
- end
- x.parent.color = Node::BLACK
- x.parent.parent.color = Node::RED
- right_rotate(x.parent.parent)
- end
- else
- y = x.parent.parent.left
- if !y.nil? && y.color == Node::RED
- x.parent.color = Node::BLACK
- y.color = Node::BLACK
- x.parent.parent.color = Node::RED
- x = x.parent.parent
- else
- if x == x.parent.left
- x = x.parent
- right_rotate(x)
- end
- x.parent.color = Node::BLACK
- x.parent.parent.color = Node::RED
- left_rotate(x.parent.parent)
- end
- end
- end
- root.color = Node::BLACK
- end
-
- alias << insert
-
- def delete(z)
- y = (z.left.nil? || z.right.nil?) ? z : successor(z)
- x = y.left.nil? ? y.right : y.left
- x.parent = y.parent
-
- if y.parent.nil?
- self.root = x
- else
- if y == y.parent.left
- y.parent.left = x
- else
- y.parent.right = x
- end
- end
-
- z.key = y.key if y != z
-
- if y.color == Node::BLACK
- delete_fixup(x)
- end
-
- self.size -= 1
- return y
- end
-
- def minimum(x = root)
- while !x.left.nil?
- x = x.left
- end
- return x
- end
-
- def maximum(x = root)
- while !x.right.nil?
- x = x.right
- end
- return x
- end
-
- def successor(x)
- if !x.right.nil?
- return minimum(x.right)
- end
- y = x.parent
- while !y.nil? && x == y.right
- x = y
- y = y.parent
- end
- return y
- end
-
- def predecessor(x)
- if !x.left.nil?
- return maximum(x.left)
- end
- y = x.parent
- while !y.nil? && x == y.left
- x = y
- y = y.parent
- end
- return y
- end
-
- def inorder_walk(x = root)
- x = self.minimum
- while !x.nil?
- yield x.key
- x = successor(x)
- end
- end
-
- alias each inorder_walk
-
- def reverse_inorder_walk(x = root)
- x = self.maximum
- while !x.nil?
- yield x.key
- x = predecessor(x)
- end
- end
-
- alias reverse_each reverse_inorder_walk
-
- def search(key, x = root)
- while !x.nil? && x.key != key
- key < x.key ? x = x.left : x = x.right
- end
- return x
- end
-
- def empty?
- return self.root.nil?
- end
-
- def black_height(x = root)
- height = 0
- while !x.nil?
- x = x.left
- height +=1 if x.nil? || x.black?
- end
- return height
- end
-
-private
-
- def left_rotate(x)
- raise "x.right is nil!" if x.right.nil?
- y = x.right
- x.right = y.left
- y.left.parent = x if !y.left.nil?
- y.parent = x.parent
- if x.parent.nil?
- self.root = y
- else
- if x == x.parent.left
- x.parent.left = y
- else
- x.parent.right = y
- end
- end
- y.left = x
- x.parent = y
- end
-
- def right_rotate(x)
- raise "x.left is nil!" if x.left.nil?
- y = x.left
- x.left = y.right
- y.right.parent = x if !y.right.nil?
- y.parent = x.parent
- if x.parent.nil?
- self.root = y
- else
- if x == x.parent.left
- x.parent.left = y
- else
- x.parent.right = y
- end
- end
- y.right = x
- x.parent = y
- end
-
- def insert_helper(z)
- y = NilNode.instance
- x = root
- while !x.nil?
- y = x
- z.key < x.key ? x = x.left : x = x.right
- end
- z.parent = y
- if y.nil?
- self.root = z
- else
- z.key < y.key ? y.left = z : y.right = z
- end
- self.size += 1
- end
-
- def delete_fixup(x)
- while x != root && x.color == Node::BLACK
- if x == x.parent.left
- w = x.parent.right
- if w.color == Node::RED
- w.color = Node::BLACK
- x.parent.color = Node::RED
- left_rotate(x.parent)
- w = x.parent.right
- end
- if w.left.color == Node::BLACK && w.right.color == Node::BLACK
- w.color = Node::RED
- x = x.parent
- else
- if w.right.color == Node::BLACK
- w.left.color = Node::BLACK
- w.color = Node::RED
- right_rotate(w)
- w = x.parent.right
- end
- w.color = x.parent.color
- x.parent.color = Node::BLACK
- w.right.color = Node::BLACK
- left_rotate(x.parent)
- x = root
- end
- else
- w = x.parent.left
- if w.color == Node::RED
- w.color = Node::BLACK
- x.parent.color = Node::RED
- right_rotate(x.parent)
- w = x.parent.left
- end
- if w.right.color == Node::BLACK && w.left.color == Node::BLACK
- w.color = Node::RED
- x = x.parent
- else
- if w.left.color == Node::BLACK
- w.right.color = Node::BLACK
- w.color = Node::RED
- left_rotate(w)
- w = x.parent.left
- end
- w.color = x.parent.color
- x.parent.color = Node::BLACK
- w.left.color = Node::BLACK
- right_rotate(x.parent)
- x = root
- end
- end
- end
- x.color = Node::BLACK
- end
-end
-
-def rbt_bm
- n = 100_000
- a1 = []; n.times { a1 << rand(999_999) }
- a2 = []; n.times { a2 << rand(999_999) }
-
- start = Time.now
-
- tree = RedBlackTree.new
-
- n.times {|i| tree.add(i) }
- n.times { tree.delete(tree.root) }
-
- tree = RedBlackTree.new
- a1.each {|e| tree.add(e) }
- a2.each {|e| tree.search(e) }
- tree.inorder_walk {|key| key + 1 }
- tree.reverse_inorder_walk {|key| key + 1 }
- n.times { tree.minimum }
- n.times { tree.maximum }
-
- return Time.now - start
-end
-
-N = (ARGV[0] || 10).to_i
-
-N.times do
- # puts rbt_bm.to_f
- rbt_bm.to_f
- # puts "GC.count = #{GC.count}" if GC.respond_to?(:count)
-end
diff --git a/benchmark/gc/ring.rb b/benchmark/gc/ring.rb
deleted file mode 100644
index be2c7b7250..0000000000
--- a/benchmark/gc/ring.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# create many old objects
-
-max = 30_000_000
-
-class Ring
- attr_reader :next_ring
- def initialize n = nil
- @next_ring = n
- end
-
-
- def size
- s = 1
- ring = self
- while ring.next_ring
- s += 1
- ring = ring.next_ring
- end
- s
- end
-end
-
-ring = Ring.new
-
-max.times{
- ring = Ring.new(ring)
-}
-
-# p ring.size
diff --git a/benchmark/prepare_require.rb b/benchmark/prepare_require.rb
deleted file mode 100644
index c4786f04ad..0000000000
--- a/benchmark/prepare_require.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require "fileutils"
-
-def prepare
- num_files = 10000
-
- basename = File.dirname($0)
- data_dir = File.join(basename, "bm_require.data")
-
- # skip if all of files exists
- if File.exist?(File.join(data_dir, "c#{num_files}.rb"))
- return
- end
-
- FileUtils.mkdir_p(data_dir)
-
- 1.upto(num_files) do |i|
- f = File.open("#{data_dir}/c#{i}.rb", "w")
- f.puts <<-END
- class C#{i}
- end
- END
- end
-end
-
-prepare
diff --git a/benchmark/prepare_require_thread.rb b/benchmark/prepare_require_thread.rb
deleted file mode 100644
index 339ecb8b39..0000000000
--- a/benchmark/prepare_require_thread.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-load File.join(File.dirname(__FILE__), "prepare_require.rb")
-
diff --git a/benchmark/prepare_so_k_nucleotide.rb b/benchmark/prepare_so_k_nucleotide.rb
index d83aeb7a7e..f28f4460a1 100644
--- a/benchmark/prepare_so_k_nucleotide.rb
+++ b/benchmark/prepare_so_k_nucleotide.rb
@@ -1,2 +1,2 @@
-require_relative 'make_fasta_output'
+require File.join(File.dirname(__FILE__), 'make_fasta_output')
prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
index da3ec2df14..7f089109de 100644
--- a/benchmark/prepare_so_reverse_complement.rb
+++ b/benchmark/prepare_so_reverse_complement.rb
@@ -1,2 +1,2 @@
-require_relative 'make_fasta_output'
+require File.join(File.dirname(__FILE__), 'make_fasta_output')
prepare_fasta_output(2_500_000)
diff --git a/bignum.c b/bignum.c
index 38380f6c4e..8601d80342 100644
--- a/bignum.c
+++ b/bignum.c
@@ -9,9 +9,10 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/thread.h"
#include "ruby/util.h"
+#include "internal.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -24,2847 +25,30 @@
#endif
#include <assert.h>
-#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
-#define USE_GMP
-#include <gmp.h>
-#endif
-
-#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
-
VALUE rb_cBignum;
-const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-#ifndef SIZEOF_BDIGIT_DBL
-# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
-# define SIZEOF_BDIGIT_DBL SIZEOF_LONG_LONG
-# else
-# define SIZEOF_BDIGIT_DBL SIZEOF_LONG
-# endif
-#endif
+static VALUE big_three = Qnil;
-STATIC_ASSERT(sizeof_bdigit_dbl, sizeof(BDIGIT_DBL) == SIZEOF_BDIGIT_DBL);
-STATIC_ASSERT(sizeof_bdigit_dbl_signed, sizeof(BDIGIT_DBL_SIGNED) == SIZEOF_BDIGIT_DBL);
-STATIC_ASSERT(sizeof_bdigit, SIZEOF_BDIGIT <= sizeof(BDIGIT));
-STATIC_ASSERT(sizeof_bdigit_and_dbl, SIZEOF_BDIGIT*2 <= SIZEOF_BDIGIT_DBL);
-STATIC_ASSERT(bdigit_signedness, 0 < (BDIGIT)-1);
-STATIC_ASSERT(bdigit_dbl_signedness, 0 < (BDIGIT_DBL)-1);
-STATIC_ASSERT(bdigit_dbl_signed_signedness, 0 > (BDIGIT_DBL_SIGNED)-1);
-STATIC_ASSERT(rbignum_embed_len_max, BIGNUM_EMBED_LEN_MAX <= (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT));
-
-#if SIZEOF_BDIGIT < SIZEOF_LONG
-STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_LONG % SIZEOF_BDIGIT == 0);
-#else
-STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
+#if defined __MINGW32__
+#define USHORT _USHORT
#endif
-#ifdef WORDS_BIGENDIAN
-# define HOST_BIGENDIAN_P 1
-#else
-# define HOST_BIGENDIAN_P 0
-#endif
-#define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
-/* (!LSHIFTABLE(d, n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */
-#define LSHIFTABLE(d, n) ((n) < sizeof(d) * CHAR_BIT)
-#define LSHIFTX(d, n) (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n))))
-#define CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits)))
-#define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))
-#define POW2_P(x) (((x)&((x)-1))==0)
-
-#define BDIGITS(x) (BIGNUM_DIGITS(x))
-#define BITSPERDIG (SIZEOF_BDIGIT*CHAR_BIT)
+#define BDIGITS(x) (RBIGNUM_DIGITS(x))
+#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
#define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
#define BIGRAD_HALF ((BDIGIT)(BIGRAD >> 1))
-#define BDIGIT_MSB(d) (((d) & BIGRAD_HALF) != 0)
-#define BIGUP(x) LSHIFTX(((x) + (BDIGIT_DBL)0), BITSPERDIG)
-#define BIGDN(x) RSHIFT((x),BITSPERDIG)
-#define BIGLO(x) ((BDIGIT)((x) & BDIGMAX))
-#define BDIGMAX ((BDIGIT)(BIGRAD-1))
-#define BDIGIT_DBL_MAX (~(BDIGIT_DBL)0)
-
-#if SIZEOF_BDIGIT == 2
-# define swap_bdigit(x) swap16(x)
-#elif SIZEOF_BDIGIT == 4
-# define swap_bdigit(x) swap32(x)
-#elif SIZEOF_BDIGIT == 8
-# define swap_bdigit(x) swap64(x)
+#define DIGSPERLONG (SIZEOF_LONG/SIZEOF_BDIGITS)
+#if HAVE_LONG_LONG
+# define DIGSPERLL (SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
#endif
+#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
+#define BIGDN(x) RSHIFT((x),BITSPERDIG)
+#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
+#define BDIGMAX ((BDIGIT)-1)
-#define BIGZEROP(x) (BIGNUM_LEN(x) == 0 || \
+#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || \
(BDIGITS(x)[0] == 0 && \
- (BIGNUM_LEN(x) == 1 || bigzero_p(x))))
-#define BIGSIZE(x) (BIGNUM_LEN(x) == 0 ? (size_t)0 : \
- BDIGITS(x)[BIGNUM_LEN(x)-1] ? \
- (size_t)(BIGNUM_LEN(x)*SIZEOF_BDIGIT - nlz(BDIGITS(x)[BIGNUM_LEN(x)-1])/CHAR_BIT) : \
- rb_absint_size(x, NULL))
-
-#define BIGDIVREM_EXTRA_WORDS 1
-#define bdigit_roomof(n) roomof(n, SIZEOF_BDIGIT)
-#define BARY_ARGS(ary) ary, numberof(ary)
-
-#define BARY_ADD(z, x, y) bary_add(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y))
-#define BARY_SUB(z, x, y) bary_sub(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y))
-#define BARY_SHORT_MUL(z, x, y) bary_short_mul(BARY_ARGS(z), BARY_ARGS(x), BARY_ARGS(y))
-#define BARY_DIVMOD(q, r, x, y) bary_divmod(BARY_ARGS(q), BARY_ARGS(r), BARY_ARGS(x), BARY_ARGS(y))
-#define BARY_ZERO_P(x) bary_zero_p(BARY_ARGS(x))
-
-#define BIGNUM_SET_NEGATIVE_SIGN(b) BIGNUM_SET_SIGN(b, 0)
-#define BIGNUM_SET_POSITIVE_SIGN(b) BIGNUM_SET_SIGN(b, 1)
-
-#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
-
-#define BDIGITS_ZERO(ptr, n) do { \
- BDIGIT *bdigitz_zero_ptr = (ptr); \
- size_t bdigitz_zero_n = (n); \
- while (bdigitz_zero_n) { \
- *bdigitz_zero_ptr++ = 0; \
- bdigitz_zero_n--; \
- } \
-} while (0)
-
-#define BARY_TRUNC(ds, n) do { \
- while (0 < (n) && (ds)[(n)-1] == 0) \
- (n)--; \
- } while (0)
-
-#define KARATSUBA_BALANCED(xn, yn) ((yn)/2 < (xn))
-#define TOOM3_BALANCED(xn, yn) (((yn)+2)/3 * 2 < (xn))
-
-#define GMP_MUL_DIGITS 20
-#define KARATSUBA_MUL_DIGITS 70
-#define TOOM3_MUL_DIGITS 150
-
-#define GMP_DIV_DIGITS 20
-#define GMP_BIG2STR_DIGITS 20
-#define GMP_STR2BIG_DIGITS 20
-
-typedef void (mulfunc_t)(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn);
-
-static mulfunc_t bary_mul_toom3_start;
-static mulfunc_t bary_mul_karatsuba_start;
-static BDIGIT bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT y);
-static void bary_divmod(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn);
-
-static VALUE bigmul0(VALUE x, VALUE y);
-static void bary_mul_toom3(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn);
-static VALUE bignew_1(VALUE klass, size_t len, int sign);
-static inline VALUE bigtrunc(VALUE x);
-
-static VALUE bigsq(VALUE x);
-static void bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp);
-static inline VALUE power_cache_get_power(int base, int power_level, size_t *numdigits_ret);
-
-#if SIZEOF_BDIGIT <= SIZEOF_INT
-static int nlz(BDIGIT x) { return nlz_int((unsigned int)x) - (SIZEOF_INT-SIZEOF_BDIGIT) * CHAR_BIT; }
-#elif SIZEOF_BDIGIT <= SIZEOF_LONG
-static int nlz(BDIGIT x) { return nlz_long((unsigned long)x) - (SIZEOF_LONG-SIZEOF_BDIGIT) * CHAR_BIT; }
-#elif SIZEOF_BDIGIT <= SIZEOF_LONG_LONG
-static int nlz(BDIGIT x) { return nlz_long_long((unsigned LONG_LONG)x) - (SIZEOF_LONG_LONG-SIZEOF_BDIGIT) * CHAR_BIT; }
-#elif SIZEOF_BDIGIT <= SIZEOF_INT128_T
-static int nlz(BDIGIT x) { return nlz_int128((uint128_t)x) - (SIZEOF_INT128_T-SIZEOF_BDIGIT) * CHAR_BIT; }
-#endif
-
-#define U16(a) ((uint16_t)(a))
-#define U32(a) ((uint32_t)(a))
-#ifdef HAVE_UINT64_T
-#define U64(a,b) (((uint64_t)(a) << 32) | (b))
-#endif
-#ifdef HAVE_UINT128_T
-#define U128(a,b,c,d) (((uint128_t)U64(a,b) << 64) | U64(c,d))
-#endif
-
-/* The following script, maxpow.rb, generates the tables follows.
-
-def big(n, bits)
- ns = []
- ((bits+31)/32).times {
- ns << sprintf("0x%08x", n & 0xffff_ffff)
- n >>= 32
- }
- "U#{bits}(" + ns.reverse.join(",") + ")"
-end
-def values(ary, width, indent)
- lines = [""]
- ary.each {|e|
- lines << "" if !ary.last.empty? && width < (lines.last + e + ", ").length
- lines.last << e + ", "
- }
- lines.map {|line| " " * indent + line.chomp(" ") + "\n" }.join
-end
-[16,32,64,128].each {|bits|
- max = 2**bits-1
- exps = []
- nums = []
- 2.upto(36) {|base|
- exp = 0
- n = 1
- while n * base <= max
- exp += 1
- n *= base
- end
- exps << exp.to_s
- nums << big(n, bits)
- }
- puts "#ifdef HAVE_UINT#{bits}_T"
- puts "static const int maxpow#{bits}_exp[35] = {"
- print values(exps, 70, 4)
- puts "};"
- puts "static const uint#{bits}_t maxpow#{bits}_num[35] = {"
- print values(nums, 70, 4)
- puts "};"
- puts "#endif"
-}
-
- */
-
-#if SIZEOF_BDIGIT_DBL == 2
-static const int maxpow16_exp[35] = {
- 15, 10, 7, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-};
-static const uint16_t maxpow16_num[35] = {
- U16(0x00008000), U16(0x0000e6a9), U16(0x00004000), U16(0x00003d09),
- U16(0x0000b640), U16(0x000041a7), U16(0x00008000), U16(0x0000e6a9),
- U16(0x00002710), U16(0x00003931), U16(0x00005100), U16(0x00006f91),
- U16(0x00009610), U16(0x0000c5c1), U16(0x00001000), U16(0x00001331),
- U16(0x000016c8), U16(0x00001acb), U16(0x00001f40), U16(0x0000242d),
- U16(0x00002998), U16(0x00002f87), U16(0x00003600), U16(0x00003d09),
- U16(0x000044a8), U16(0x00004ce3), U16(0x000055c0), U16(0x00005f45),
- U16(0x00006978), U16(0x0000745f), U16(0x00008000), U16(0x00008c61),
- U16(0x00009988), U16(0x0000a77b), U16(0x0000b640),
-};
-#elif SIZEOF_BDIGIT_DBL == 4
-static const int maxpow32_exp[35] = {
- 31, 20, 15, 13, 12, 11, 10, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7,
- 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-};
-static const uint32_t maxpow32_num[35] = {
- U32(0x80000000), U32(0xcfd41b91), U32(0x40000000), U32(0x48c27395),
- U32(0x81bf1000), U32(0x75db9c97), U32(0x40000000), U32(0xcfd41b91),
- U32(0x3b9aca00), U32(0x8c8b6d2b), U32(0x19a10000), U32(0x309f1021),
- U32(0x57f6c100), U32(0x98c29b81), U32(0x10000000), U32(0x18754571),
- U32(0x247dbc80), U32(0x3547667b), U32(0x4c4b4000), U32(0x6b5a6e1d),
- U32(0x94ace180), U32(0xcaf18367), U32(0x0b640000), U32(0x0e8d4a51),
- U32(0x1269ae40), U32(0x17179149), U32(0x1cb91000), U32(0x23744899),
- U32(0x2b73a840), U32(0x34e63b41), U32(0x40000000), U32(0x4cfa3cc1),
- U32(0x5c13d840), U32(0x6d91b519), U32(0x81bf1000),
-};
-#elif SIZEOF_BDIGIT_DBL == 8 && defined HAVE_UINT64_T
-static const int maxpow64_exp[35] = {
- 63, 40, 31, 27, 24, 22, 21, 20, 19, 18, 17, 17, 16, 16, 15, 15, 15,
- 15, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12,
- 12,
-};
-static const uint64_t maxpow64_num[35] = {
- U64(0x80000000,0x00000000), U64(0xa8b8b452,0x291fe821),
- U64(0x40000000,0x00000000), U64(0x6765c793,0xfa10079d),
- U64(0x41c21cb8,0xe1000000), U64(0x36427987,0x50226111),
- U64(0x80000000,0x00000000), U64(0xa8b8b452,0x291fe821),
- U64(0x8ac72304,0x89e80000), U64(0x4d28cb56,0xc33fa539),
- U64(0x1eca170c,0x00000000), U64(0x780c7372,0x621bd74d),
- U64(0x1e39a505,0x7d810000), U64(0x5b27ac99,0x3df97701),
- U64(0x10000000,0x00000000), U64(0x27b95e99,0x7e21d9f1),
- U64(0x5da0e1e5,0x3c5c8000), U64(0xd2ae3299,0xc1c4aedb),
- U64(0x16bcc41e,0x90000000), U64(0x2d04b7fd,0xd9c0ef49),
- U64(0x5658597b,0xcaa24000), U64(0xa0e20737,0x37609371),
- U64(0x0c29e980,0x00000000), U64(0x14adf4b7,0x320334b9),
- U64(0x226ed364,0x78bfa000), U64(0x383d9170,0xb85ff80b),
- U64(0x5a3c23e3,0x9c000000), U64(0x8e651373,0x88122bcd),
- U64(0xdd41bb36,0xd259e000), U64(0x0aee5720,0xee830681),
- U64(0x10000000,0x00000000), U64(0x172588ad,0x4f5f0981),
- U64(0x211e44f7,0xd02c1000), U64(0x2ee56725,0xf06e5c71),
- U64(0x41c21cb8,0xe1000000),
-};
-#elif SIZEOF_BDIGIT_DBL == 16 && defined HAVE_UINT128_T
-static const int maxpow128_exp[35] = {
- 127, 80, 63, 55, 49, 45, 42, 40, 38, 37, 35, 34, 33, 32, 31, 31, 30,
- 30, 29, 29, 28, 28, 27, 27, 27, 26, 26, 26, 26, 25, 25, 25, 25, 24,
- 24,
-};
-static const uint128_t maxpow128_num[35] = {
- U128(0x80000000,0x00000000,0x00000000,0x00000000),
- U128(0x6f32f1ef,0x8b18a2bc,0x3cea5978,0x9c79d441),
- U128(0x40000000,0x00000000,0x00000000,0x00000000),
- U128(0xd0cf4b50,0xcfe20765,0xfff4b4e3,0xf741cf6d),
- U128(0x6558e2a0,0x921fe069,0x42860000,0x00000000),
- U128(0x5080c7b7,0xd0e31ba7,0x5911a67d,0xdd3d35e7),
- U128(0x40000000,0x00000000,0x00000000,0x00000000),
- U128(0x6f32f1ef,0x8b18a2bc,0x3cea5978,0x9c79d441),
- U128(0x4b3b4ca8,0x5a86c47a,0x098a2240,0x00000000),
- U128(0xffd1390a,0x0adc2fb8,0xdabbb817,0x4d95c99b),
- U128(0x2c6fdb36,0x4c25e6c0,0x00000000,0x00000000),
- U128(0x384bacd6,0x42c343b4,0xe90c4272,0x13506d29),
- U128(0x31f5db32,0xa34aced6,0x0bf13a0e,0x00000000),
- U128(0x20753ada,0xfd1e839f,0x53686d01,0x3143ee01),
- U128(0x10000000,0x00000000,0x00000000,0x00000000),
- U128(0x68ca11d6,0xb4f6d1d1,0xfaa82667,0x8073c2f1),
- U128(0x223e493b,0xb3bb69ff,0xa4b87d6c,0x40000000),
- U128(0xad62418d,0x14ea8247,0x01c4b488,0x6cc66f59),
- U128(0x2863c1f5,0xcdae42f9,0x54000000,0x00000000),
- U128(0xa63fd833,0xb9386b07,0x36039e82,0xbe651b25),
- U128(0x1d1f7a9c,0xd087a14d,0x28cdf3d5,0x10000000),
- U128(0x651b5095,0xc2ea8fc1,0xb30e2c57,0x77aaf7e1),
- U128(0x0ddef20e,0xff760000,0x00000000,0x00000000),
- U128(0x29c30f10,0x29939b14,0x6664242d,0x97d9f649),
- U128(0x786a435a,0xe9558b0e,0x6aaf6d63,0xa8000000),
- U128(0x0c5afe6f,0xf302bcbf,0x94fd9829,0xd87f5079),
- U128(0x1fce575c,0xe1692706,0x07100000,0x00000000),
- U128(0x4f34497c,0x8597e144,0x36e91802,0x00528229),
- U128(0xbf3a8e1d,0x41ef2170,0x7802130d,0x84000000),
- U128(0x0e7819e1,0x7f1eb0fb,0x6ee4fb89,0x01d9531f),
- U128(0x20000000,0x00000000,0x00000000,0x00000000),
- U128(0x4510460d,0xd9e879c0,0x14a82375,0x2f22b321),
- U128(0x91abce3c,0x4b4117ad,0xe76d35db,0x22000000),
- U128(0x08973ea3,0x55d75bc2,0x2e42c391,0x727d69e1),
- U128(0x10e425c5,0x6daffabc,0x35c10000,0x00000000),
-};
-#endif
-
-static BDIGIT_DBL
-maxpow_in_bdigit_dbl(int base, int *exp_ret)
-{
- BDIGIT_DBL maxpow;
- int exponent;
-
- assert(2 <= base && base <= 36);
-
- {
-#if SIZEOF_BDIGIT_DBL == 2
- maxpow = maxpow16_num[base-2];
- exponent = maxpow16_exp[base-2];
-#elif SIZEOF_BDIGIT_DBL == 4
- maxpow = maxpow32_num[base-2];
- exponent = maxpow32_exp[base-2];
-#elif SIZEOF_BDIGIT_DBL == 8 && defined HAVE_UINT64_T
- maxpow = maxpow64_num[base-2];
- exponent = maxpow64_exp[base-2];
-#elif SIZEOF_BDIGIT_DBL == 16 && defined HAVE_UINT128_T
- maxpow = maxpow128_num[base-2];
- exponent = maxpow128_exp[base-2];
-#else
- maxpow = base;
- exponent = 1;
- while (maxpow <= BDIGIT_DBL_MAX / base) {
- maxpow *= base;
- exponent++;
- }
-#endif
- }
-
- *exp_ret = exponent;
- return maxpow;
-}
-
-static inline BDIGIT_DBL
-bary2bdigitdbl(const BDIGIT *ds, size_t n)
-{
- assert(n <= 2);
-
- if (n == 2)
- return ds[0] | BIGUP(ds[1]);
- if (n == 1)
- return ds[0];
- return 0;
-}
-
-static inline void
-bdigitdbl2bary(BDIGIT *ds, size_t n, BDIGIT_DBL num)
-{
- assert(n == 2);
-
- ds[0] = BIGLO(num);
- ds[1] = (BDIGIT)BIGDN(num);
-}
-
-static int
-bary_cmp(const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- BARY_TRUNC(xds, xn);
- BARY_TRUNC(yds, yn);
-
- if (xn < yn)
- return -1;
- if (xn > yn)
- return 1;
-
- while (xn-- && xds[xn] == yds[xn])
- ;
- if (xn == (size_t)-1)
- return 0;
- return xds[xn] < yds[xn] ? -1 : 1;
-}
-
-static BDIGIT
-bary_small_lshift(BDIGIT *zds, const BDIGIT *xds, size_t n, int shift)
-{
- size_t i;
- BDIGIT_DBL num = 0;
- assert(0 <= shift && shift < BITSPERDIG);
-
- for (i=0; i<n; i++) {
- num = num | (BDIGIT_DBL)*xds++ << shift;
- *zds++ = BIGLO(num);
- num = BIGDN(num);
- }
- return BIGLO(num);
-}
-
-static void
-bary_small_rshift(BDIGIT *zds, const BDIGIT *xds, size_t n, int shift, BDIGIT higher_bdigit)
-{
- BDIGIT_DBL num = 0;
- BDIGIT x;
-
- assert(0 <= shift && shift < BITSPERDIG);
-
- num = BIGUP(higher_bdigit);
- while (n--) {
- num = (num | xds[n]) >> shift;
- x = xds[n];
- zds[n] = BIGLO(num);
- num = BIGUP(x);
- }
-}
-
-static int
-bary_zero_p(BDIGIT *xds, size_t xn)
-{
- if (xn == 0)
- return 1;
- do {
- if (xds[--xn]) return 0;
- } while (xn);
- return 1;
-}
-
-static void
-bary_neg(BDIGIT *ds, size_t n)
-{
- while (n--)
- ds[n] = BIGLO(~ds[n]);
-}
-
-static int
-bary_2comp(BDIGIT *ds, size_t n)
-{
- size_t i;
- i = 0;
- for (i = 0; i < n; i++) {
- if (ds[i] != 0) {
- goto non_zero;
- }
- }
- return 1;
-
- non_zero:
- ds[i] = BIGLO(~ds[i] + 1);
- i++;
- for (; i < n; i++) {
- ds[i] = BIGLO(~ds[i]);
- }
- return 0;
-}
-
-static void
-bary_swap(BDIGIT *ds, size_t num_bdigits)
-{
- BDIGIT *p1 = ds;
- BDIGIT *p2 = ds + num_bdigits - 1;
- for (; p1 < p2; p1++, p2--) {
- BDIGIT tmp = *p1;
- *p1 = *p2;
- *p2 = tmp;
- }
-}
-
-#define INTEGER_PACK_WORDORDER_MASK \
- (INTEGER_PACK_MSWORD_FIRST | \
- INTEGER_PACK_LSWORD_FIRST)
-#define INTEGER_PACK_BYTEORDER_MASK \
- (INTEGER_PACK_MSBYTE_FIRST | \
- INTEGER_PACK_LSBYTE_FIRST | \
- INTEGER_PACK_NATIVE_BYTE_ORDER)
-
-static void
-validate_integer_pack_format(size_t numwords, size_t wordsize, size_t nails, int flags, int supported_flags)
-{
- int wordorder_bits = flags & INTEGER_PACK_WORDORDER_MASK;
- int byteorder_bits = flags & INTEGER_PACK_BYTEORDER_MASK;
-
- if (flags & ~supported_flags) {
- rb_raise(rb_eArgError, "unsupported flags specified");
- }
- if (wordorder_bits == 0) {
- if (1 < numwords)
- rb_raise(rb_eArgError, "word order not specified");
- }
- else if (wordorder_bits != INTEGER_PACK_MSWORD_FIRST &&
- wordorder_bits != INTEGER_PACK_LSWORD_FIRST)
- rb_raise(rb_eArgError, "unexpected word order");
- if (byteorder_bits == 0) {
- rb_raise(rb_eArgError, "byte order not specified");
- }
- else if (byteorder_bits != INTEGER_PACK_MSBYTE_FIRST &&
- byteorder_bits != INTEGER_PACK_LSBYTE_FIRST &&
- byteorder_bits != INTEGER_PACK_NATIVE_BYTE_ORDER)
- rb_raise(rb_eArgError, "unexpected byte order");
- if (wordsize == 0)
- rb_raise(rb_eArgError, "invalid wordsize: %"PRI_SIZE_PREFIX"u", wordsize);
- if (SSIZE_MAX < wordsize)
- rb_raise(rb_eArgError, "too big wordsize: %"PRI_SIZE_PREFIX"u", wordsize);
- if (wordsize <= nails / CHAR_BIT)
- rb_raise(rb_eArgError, "too big nails: %"PRI_SIZE_PREFIX"u", nails);
- if (SIZE_MAX / wordsize < numwords)
- rb_raise(rb_eArgError, "too big numwords * wordsize: %"PRI_SIZE_PREFIX"u * %"PRI_SIZE_PREFIX"u", numwords, wordsize);
-}
-
-static void
-integer_pack_loop_setup(
- size_t numwords, size_t wordsize, size_t nails, int flags,
- size_t *word_num_fullbytes_ret,
- int *word_num_partialbits_ret,
- size_t *word_start_ret,
- ssize_t *word_step_ret,
- size_t *word_last_ret,
- size_t *byte_start_ret,
- int *byte_step_ret)
-{
- int wordorder_bits = flags & INTEGER_PACK_WORDORDER_MASK;
- int byteorder_bits = flags & INTEGER_PACK_BYTEORDER_MASK;
- size_t word_num_fullbytes;
- int word_num_partialbits;
- size_t word_start;
- ssize_t word_step;
- size_t word_last;
- size_t byte_start;
- int byte_step;
-
- word_num_partialbits = CHAR_BIT - (int)(nails % CHAR_BIT);
- if (word_num_partialbits == CHAR_BIT)
- word_num_partialbits = 0;
- word_num_fullbytes = wordsize - (nails / CHAR_BIT);
- if (word_num_partialbits != 0) {
- word_num_fullbytes--;
- }
-
- if (wordorder_bits == INTEGER_PACK_MSWORD_FIRST) {
- word_start = wordsize*(numwords-1);
- word_step = -(ssize_t)wordsize;
- word_last = 0;
- }
- else {
- word_start = 0;
- word_step = wordsize;
- word_last = wordsize*(numwords-1);
- }
-
- if (byteorder_bits == INTEGER_PACK_NATIVE_BYTE_ORDER) {
-#ifdef WORDS_BIGENDIAN
- byteorder_bits = INTEGER_PACK_MSBYTE_FIRST;
-#else
- byteorder_bits = INTEGER_PACK_LSBYTE_FIRST;
-#endif
- }
- if (byteorder_bits == INTEGER_PACK_MSBYTE_FIRST) {
- byte_start = wordsize-1;
- byte_step = -1;
- }
- else {
- byte_start = 0;
- byte_step = 1;
- }
-
- *word_num_partialbits_ret = word_num_partialbits;
- *word_num_fullbytes_ret = word_num_fullbytes;
- *word_start_ret = word_start;
- *word_step_ret = word_step;
- *word_last_ret = word_last;
- *byte_start_ret = byte_start;
- *byte_step_ret = byte_step;
-}
-
-static inline void
-integer_pack_fill_dd(BDIGIT **dpp, BDIGIT **dep, BDIGIT_DBL *ddp, int *numbits_in_dd_p)
-{
- if (*dpp < *dep && BITSPERDIG <= (int)sizeof(*ddp) * CHAR_BIT - *numbits_in_dd_p) {
- *ddp |= (BDIGIT_DBL)(*(*dpp)++) << *numbits_in_dd_p;
- *numbits_in_dd_p += BITSPERDIG;
- }
- else if (*dpp == *dep) {
- /* higher bits are infinity zeros */
- *numbits_in_dd_p = (int)sizeof(*ddp) * CHAR_BIT;
- }
-}
-
-static inline BDIGIT_DBL
-integer_pack_take_lowbits(int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p)
-{
- BDIGIT_DBL ret;
- ret = (*ddp) & (((BDIGIT_DBL)1 << n) - 1);
- *ddp >>= n;
- *numbits_in_dd_p -= n;
- return ret;
-}
-
-#if !defined(WORDS_BIGENDIAN)
-static int
-bytes_2comp(unsigned char *buf, size_t len)
-{
- size_t i;
- for (i = 0; i < len; i++)
- buf[i] = ~buf[i];
- for (i = 0; i < len; i++) {
- buf[i]++;
- if (buf[i] != 0)
- return 0;
- }
- return 1;
-}
-#endif
-
-static int
-bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
-{
- BDIGIT *dp, *de;
- unsigned char *buf, *bufend;
-
- dp = ds;
- de = ds + num_bdigits;
-
- validate_integer_pack_format(numwords, wordsize, nails, flags,
- INTEGER_PACK_MSWORD_FIRST|
- INTEGER_PACK_LSWORD_FIRST|
- INTEGER_PACK_MSBYTE_FIRST|
- INTEGER_PACK_LSBYTE_FIRST|
- INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP|
- INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION);
-
- while (dp < de && de[-1] == 0)
- de--;
- if (dp == de) {
- sign = 0;
- }
-
- if (!(flags & INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION)) {
- if (sign == 0) {
- MEMZERO(words, unsigned char, numwords * wordsize);
- return 0;
- }
- if (nails == 0 && numwords == 1) {
- int need_swap = wordsize != 1 &&
- (flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_NATIVE_BYTE_ORDER &&
- ((flags & INTEGER_PACK_MSBYTE_FIRST) ? !HOST_BIGENDIAN_P : HOST_BIGENDIAN_P);
- if (0 < sign || !(flags & INTEGER_PACK_2COMP)) {
- BDIGIT d;
- if (wordsize == 1) {
- *((unsigned char *)words) = (unsigned char)(d = dp[0]);
- return ((1 < de - dp || CLEAR_LOWBITS(d, 8) != 0) ? 2 : 1) * sign;
- }
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
- uint16_t u = (uint16_t)(d = dp[0]);
- if (need_swap) u = swap16(u);
- *((uint16_t *)words) = u;
- return ((1 < de - dp || CLEAR_LOWBITS(d, 16) != 0) ? 2 : 1) * sign;
- }
-#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
- uint32_t u = (uint32_t)(d = dp[0]);
- if (need_swap) u = swap32(u);
- *((uint32_t *)words) = u;
- return ((1 < de - dp || CLEAR_LOWBITS(d, 32) != 0) ? 2 : 1) * sign;
- }
-#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
- uint64_t u = (uint64_t)(d = dp[0]);
- if (need_swap) u = swap64(u);
- *((uint64_t *)words) = u;
- return ((1 < de - dp || CLEAR_LOWBITS(d, 64) != 0) ? 2 : 1) * sign;
- }
-#endif
- }
- else { /* sign < 0 && (flags & INTEGER_PACK_2COMP) */
- BDIGIT_DBL_SIGNED d;
- if (wordsize == 1) {
- *((unsigned char *)words) = (unsigned char)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
- return (1 < de - dp || FILL_LOWBITS(d, 8) != -1) ? -2 : -1;
- }
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
- uint16_t u = (uint16_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
- if (need_swap) u = swap16(u);
- *((uint16_t *)words) = u;
- return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
- (1 < de - dp || FILL_LOWBITS(d, 16) != -1) ? -2 : -1;
- }
-#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
- uint32_t u = (uint32_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
- if (need_swap) u = swap32(u);
- *((uint32_t *)words) = u;
- return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
- (1 < de - dp || FILL_LOWBITS(d, 32) != -1) ? -2 : -1;
- }
-#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
- uint64_t u = (uint64_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
- if (need_swap) u = swap64(u);
- *((uint64_t *)words) = u;
- return (wordsize == SIZEOF_BDIGIT && de - dp == 2 && dp[1] == 1 && dp[0] == 0) ? -1 :
- (1 < de - dp || FILL_LOWBITS(d, 64) != -1) ? -2 : -1;
- }
-#endif
- }
- }
-#if !defined(WORDS_BIGENDIAN)
- if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
- (flags & INTEGER_PACK_WORDORDER_MASK) == INTEGER_PACK_LSWORD_FIRST &&
- (flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_MSBYTE_FIRST) {
- size_t src_size = (de - dp) * SIZEOF_BDIGIT;
- size_t dst_size = numwords * wordsize;
- int overflow = 0;
- while (0 < src_size && ((unsigned char *)ds)[src_size-1] == 0)
- src_size--;
- if (src_size <= dst_size) {
- MEMCPY(words, dp, char, src_size);
- MEMZERO((char*)words + src_size, char, dst_size - src_size);
- }
- else {
- MEMCPY(words, dp, char, dst_size);
- overflow = 1;
- }
- if (sign < 0 && (flags & INTEGER_PACK_2COMP)) {
- int zero_p = bytes_2comp(words, dst_size);
- if (zero_p && overflow) {
- unsigned char *p = (unsigned char *)dp;
- if (dst_size == src_size-1 &&
- p[dst_size] == 1) {
- overflow = 0;
- }
- }
- }
- if (overflow)
- sign *= 2;
- return sign;
- }
-#endif
- if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
- wordsize % SIZEOF_BDIGIT == 0 && (uintptr_t)words % ALIGNOF(BDIGIT) == 0) {
- size_t bdigits_per_word = wordsize / SIZEOF_BDIGIT;
- size_t src_num_bdigits = de - dp;
- size_t dst_num_bdigits = numwords * bdigits_per_word;
- int overflow = 0;
- int mswordfirst_p = (flags & INTEGER_PACK_MSWORD_FIRST) != 0;
- int msbytefirst_p = (flags & INTEGER_PACK_NATIVE_BYTE_ORDER) ? HOST_BIGENDIAN_P :
- (flags & INTEGER_PACK_MSBYTE_FIRST) != 0;
- if (src_num_bdigits <= dst_num_bdigits) {
- MEMCPY(words, dp, BDIGIT, src_num_bdigits);
- BDIGITS_ZERO((BDIGIT*)words + src_num_bdigits, dst_num_bdigits - src_num_bdigits);
- }
- else {
- MEMCPY(words, dp, BDIGIT, dst_num_bdigits);
- overflow = 1;
- }
- if (sign < 0 && (flags & INTEGER_PACK_2COMP)) {
- int zero_p = bary_2comp(words, dst_num_bdigits);
- if (zero_p && overflow &&
- dst_num_bdigits == src_num_bdigits-1 &&
- dp[dst_num_bdigits] == 1)
- overflow = 0;
- }
- if (msbytefirst_p != HOST_BIGENDIAN_P) {
- size_t i;
- for (i = 0; i < dst_num_bdigits; i++) {
- BDIGIT d = ((BDIGIT*)words)[i];
- ((BDIGIT*)words)[i] = swap_bdigit(d);
- }
- }
- if (mswordfirst_p ? !msbytefirst_p : msbytefirst_p) {
- size_t i;
- BDIGIT *p = words;
- for (i = 0; i < numwords; i++) {
- bary_swap(p, bdigits_per_word);
- p += bdigits_per_word;
- }
- }
- if (mswordfirst_p) {
- bary_swap(words, dst_num_bdigits);
- }
- if (overflow)
- sign *= 2;
- return sign;
- }
- }
-
- buf = words;
- bufend = buf + numwords * wordsize;
-
- if (buf == bufend) {
- /* overflow if non-zero*/
- if (!(flags & INTEGER_PACK_2COMP) || 0 <= sign)
- sign *= 2;
- else {
- if (de - dp == 1 && dp[0] == 1)
- sign = -1; /* val == -1 == -2**(numwords*(wordsize*CHAR_BIT-nails)) */
- else
- sign = -2; /* val < -1 == -2**(numwords*(wordsize*CHAR_BIT-nails)) */
- }
- }
- else if (dp == de) {
- memset(buf, '\0', bufend - buf);
- }
- else if (dp < de && buf < bufend) {
- int word_num_partialbits;
- size_t word_num_fullbytes;
-
- ssize_t word_step;
- size_t byte_start;
- int byte_step;
-
- size_t word_start, word_last;
- unsigned char *wordp, *last_wordp;
- BDIGIT_DBL dd;
- int numbits_in_dd;
-
- integer_pack_loop_setup(numwords, wordsize, nails, flags,
- &word_num_fullbytes, &word_num_partialbits,
- &word_start, &word_step, &word_last, &byte_start, &byte_step);
-
- wordp = buf + word_start;
- last_wordp = buf + word_last;
-
- dd = 0;
- numbits_in_dd = 0;
-
-#define FILL_DD \
- integer_pack_fill_dd(&dp, &de, &dd, &numbits_in_dd)
-#define TAKE_LOWBITS(n) \
- integer_pack_take_lowbits(n, &dd, &numbits_in_dd)
-
- while (1) {
- size_t index_in_word = 0;
- unsigned char *bytep = wordp + byte_start;
- while (index_in_word < word_num_fullbytes) {
- FILL_DD;
- *bytep = TAKE_LOWBITS(CHAR_BIT);
- bytep += byte_step;
- index_in_word++;
- }
- if (word_num_partialbits) {
- FILL_DD;
- *bytep = TAKE_LOWBITS(word_num_partialbits);
- bytep += byte_step;
- index_in_word++;
- }
- while (index_in_word < wordsize) {
- *bytep = 0;
- bytep += byte_step;
- index_in_word++;
- }
-
- if (wordp == last_wordp)
- break;
-
- wordp += word_step;
- }
- FILL_DD;
- /* overflow tests */
- if (dp != de || 1 < dd) {
- /* 2**(numwords*(wordsize*CHAR_BIT-nails)+1) <= abs(val) */
- sign *= 2;
- }
- else if (dd == 1) {
- /* 2**(numwords*(wordsize*CHAR_BIT-nails)) <= abs(val) < 2**(numwords*(wordsize*CHAR_BIT-nails)+1) */
- if (!(flags & INTEGER_PACK_2COMP) || 0 <= sign)
- sign *= 2;
- else { /* overflow_2comp && sign == -1 */
- /* test lower bits are all zero. */
- dp = ds;
- while (dp < de && *dp == 0)
- dp++;
- if (de - dp == 1 && /* only one non-zero word. */
- POW2_P(*dp)) /* *dp contains only one bit set. */
- sign = -1; /* val == -2**(numwords*(wordsize*CHAR_BIT-nails)) */
- else
- sign = -2; /* val < -2**(numwords*(wordsize*CHAR_BIT-nails)) */
- }
- }
- }
-
- if ((flags & INTEGER_PACK_2COMP) && (sign < 0 && numwords != 0)) {
- unsigned char *buf;
-
- int word_num_partialbits;
- size_t word_num_fullbytes;
-
- ssize_t word_step;
- size_t byte_start;
- int byte_step;
-
- size_t word_start, word_last;
- unsigned char *wordp, *last_wordp;
-
- unsigned int partialbits_mask;
- int carry;
-
- integer_pack_loop_setup(numwords, wordsize, nails, flags,
- &word_num_fullbytes, &word_num_partialbits,
- &word_start, &word_step, &word_last, &byte_start, &byte_step);
-
- partialbits_mask = (1 << word_num_partialbits) - 1;
-
- buf = words;
- wordp = buf + word_start;
- last_wordp = buf + word_last;
-
- carry = 1;
- while (1) {
- size_t index_in_word = 0;
- unsigned char *bytep = wordp + byte_start;
- while (index_in_word < word_num_fullbytes) {
- carry += (unsigned char)~*bytep;
- *bytep = (unsigned char)carry;
- carry >>= CHAR_BIT;
- bytep += byte_step;
- index_in_word++;
- }
- if (word_num_partialbits) {
- carry += (*bytep & partialbits_mask) ^ partialbits_mask;
- *bytep = carry & partialbits_mask;
- carry >>= word_num_partialbits;
- bytep += byte_step;
- index_in_word++;
- }
-
- if (wordp == last_wordp)
- break;
-
- wordp += word_step;
- }
- }
-
- return sign;
-#undef FILL_DD
-#undef TAKE_LOWBITS
-}
-
-static size_t
-integer_unpack_num_bdigits_small(size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret)
-{
- /* nlp_bits stands for number of leading padding bits */
- size_t num_bits = (wordsize * CHAR_BIT - nails) * numwords;
- size_t num_bdigits = (num_bits + BITSPERDIG - 1) / BITSPERDIG;
- *nlp_bits_ret = (int)(num_bdigits * BITSPERDIG - num_bits);
- return num_bdigits;
-}
-
-static size_t
-integer_unpack_num_bdigits_generic(size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret)
-{
- /* BITSPERDIG = SIZEOF_BDIGIT * CHAR_BIT */
- /* num_bits = (wordsize * CHAR_BIT - nails) * numwords */
- /* num_bdigits = (num_bits + BITSPERDIG - 1) / BITSPERDIG */
-
- /* num_bits = CHAR_BIT * (wordsize * numwords) - nails * numwords = CHAR_BIT * num_bytes1 - nails * numwords */
- size_t num_bytes1 = wordsize * numwords;
-
- /* q1 * CHAR_BIT + r1 = numwords */
- size_t q1 = numwords / CHAR_BIT;
- size_t r1 = numwords % CHAR_BIT;
-
- /* num_bits = CHAR_BIT * num_bytes1 - nails * (q1 * CHAR_BIT + r1) = CHAR_BIT * num_bytes2 - nails * r1 */
- size_t num_bytes2 = num_bytes1 - nails * q1;
-
- /* q2 * CHAR_BIT + r2 = nails */
- size_t q2 = nails / CHAR_BIT;
- size_t r2 = nails % CHAR_BIT;
-
- /* num_bits = CHAR_BIT * num_bytes2 - (q2 * CHAR_BIT + r2) * r1 = CHAR_BIT * num_bytes3 - r1 * r2 */
- size_t num_bytes3 = num_bytes2 - q2 * r1;
-
- /* q3 * BITSPERDIG + r3 = num_bytes3 */
- size_t q3 = num_bytes3 / BITSPERDIG;
- size_t r3 = num_bytes3 % BITSPERDIG;
-
- /* num_bits = CHAR_BIT * (q3 * BITSPERDIG + r3) - r1 * r2 = BITSPERDIG * num_digits1 + CHAR_BIT * r3 - r1 * r2 */
- size_t num_digits1 = CHAR_BIT * q3;
-
- /*
- * if CHAR_BIT * r3 >= r1 * r2
- * CHAR_BIT * r3 - r1 * r2 = CHAR_BIT * BITSPERDIG - (CHAR_BIT * BITSPERDIG - (CHAR_BIT * r3 - r1 * r2))
- * q4 * BITSPERDIG + r4 = CHAR_BIT * BITSPERDIG - (CHAR_BIT * r3 - r1 * r2)
- * num_bits = BITSPERDIG * num_digits1 + CHAR_BIT * BITSPERDIG - (q4 * BITSPERDIG + r4) = BITSPERDIG * num_digits2 - r4
- * else
- * q4 * BITSPERDIG + r4 = -(CHAR_BIT * r3 - r1 * r2)
- * num_bits = BITSPERDIG * num_digits1 - (q4 * BITSPERDIG + r4) = BITSPERDIG * num_digits2 - r4
- * end
- */
-
- if (CHAR_BIT * r3 >= r1 * r2) {
- size_t tmp1 = CHAR_BIT * BITSPERDIG - (CHAR_BIT * r3 - r1 * r2);
- size_t q4 = tmp1 / BITSPERDIG;
- int r4 = (int)(tmp1 % BITSPERDIG);
- size_t num_digits2 = num_digits1 + CHAR_BIT - q4;
- *nlp_bits_ret = r4;
- return num_digits2;
- }
- else {
- size_t tmp1 = r1 * r2 - CHAR_BIT * r3;
- size_t q4 = tmp1 / BITSPERDIG;
- int r4 = (int)(tmp1 % BITSPERDIG);
- size_t num_digits2 = num_digits1 - q4;
- *nlp_bits_ret = r4;
- return num_digits2;
- }
-}
-
-static size_t
-integer_unpack_num_bdigits(size_t numwords, size_t wordsize, size_t nails, int *nlp_bits_ret)
-{
- size_t num_bdigits;
-
- if (numwords <= (SIZE_MAX - (BITSPERDIG-1)) / CHAR_BIT / wordsize) {
- num_bdigits = integer_unpack_num_bdigits_small(numwords, wordsize, nails, nlp_bits_ret);
-#ifdef DEBUG_INTEGER_PACK
- {
- int nlp_bits1;
- size_t num_bdigits1 = integer_unpack_num_bdigits_generic(numwords, wordsize, nails, &nlp_bits1);
- assert(num_bdigits == num_bdigits1);
- assert(*nlp_bits_ret == nlp_bits1);
- }
-#endif
- }
- else {
- num_bdigits = integer_unpack_num_bdigits_generic(numwords, wordsize, nails, nlp_bits_ret);
- }
- return num_bdigits;
-}
-
-static inline void
-integer_unpack_push_bits(int data, int numbits, BDIGIT_DBL *ddp, int *numbits_in_dd_p, BDIGIT **dpp)
-{
- (*ddp) |= ((BDIGIT_DBL)data) << (*numbits_in_dd_p);
- *numbits_in_dd_p += numbits;
- while (BITSPERDIG <= *numbits_in_dd_p) {
- *(*dpp)++ = BIGLO(*ddp);
- *ddp = BIGDN(*ddp);
- *numbits_in_dd_p -= BITSPERDIG;
- }
-}
-
-static int
-integer_unpack_single_bdigit(BDIGIT u, size_t size, int flags, BDIGIT *dp)
-{
- int sign;
- if (flags & INTEGER_PACK_2COMP) {
- sign = (flags & INTEGER_PACK_NEGATIVE) ?
- ((size == SIZEOF_BDIGIT && u == 0) ? -2 : -1) :
- ((u >> (size * CHAR_BIT - 1)) ? -1 : 1);
- if (sign < 0) {
- u |= LSHIFTX(BDIGMAX, size * CHAR_BIT);
- u = BIGLO(1 + ~u);
- }
- }
- else
- sign = (flags & INTEGER_PACK_NEGATIVE) ? -1 : 1;
- *dp = u;
- return sign;
-}
-
-static int
-bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags, int nlp_bits)
-{
- int sign;
- const unsigned char *buf = words;
- BDIGIT *dp;
- BDIGIT *de;
-
- dp = bdigits;
- de = dp + num_bdigits;
-
- if (!(flags & INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION)) {
- if (nails == 0 && numwords == 1) {
- int need_swap = wordsize != 1 &&
- (flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_NATIVE_BYTE_ORDER &&
- ((flags & INTEGER_PACK_MSBYTE_FIRST) ? !HOST_BIGENDIAN_P : HOST_BIGENDIAN_P);
- if (wordsize == 1) {
- return integer_unpack_single_bdigit(*(uint8_t *)buf, sizeof(uint8_t), flags, dp);
- }
-#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
- uint16_t u = *(uint16_t *)buf;
- return integer_unpack_single_bdigit(need_swap ? swap16(u) : u, sizeof(uint16_t), flags, dp);
- }
-#endif
-#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
- uint32_t u = *(uint32_t *)buf;
- return integer_unpack_single_bdigit(need_swap ? swap32(u) : u, sizeof(uint32_t), flags, dp);
- }
-#endif
-#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
- uint64_t u = *(uint64_t *)buf;
- return integer_unpack_single_bdigit(need_swap ? swap64(u) : u, sizeof(uint64_t), flags, dp);
- }
-#endif
- }
-#if !defined(WORDS_BIGENDIAN)
- if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
- (flags & INTEGER_PACK_WORDORDER_MASK) == INTEGER_PACK_LSWORD_FIRST &&
- (flags & INTEGER_PACK_BYTEORDER_MASK) != INTEGER_PACK_MSBYTE_FIRST) {
- size_t src_size = numwords * wordsize;
- size_t dst_size = num_bdigits * SIZEOF_BDIGIT;
- MEMCPY(dp, words, char, src_size);
- if (flags & INTEGER_PACK_2COMP) {
- if (flags & INTEGER_PACK_NEGATIVE) {
- int zero_p;
- memset((char*)dp + src_size, 0xff, dst_size - src_size);
- zero_p = bary_2comp(dp, num_bdigits);
- sign = zero_p ? -2 : -1;
- }
- else if (buf[src_size-1] >> (CHAR_BIT-1)) {
- memset((char*)dp + src_size, 0xff, dst_size - src_size);
- bary_2comp(dp, num_bdigits);
- sign = -1;
- }
- else {
- MEMZERO((char*)dp + src_size, char, dst_size - src_size);
- sign = 1;
- }
- }
- else {
- MEMZERO((char*)dp + src_size, char, dst_size - src_size);
- sign = (flags & INTEGER_PACK_NEGATIVE) ? -1 : 1;
- }
- return sign;
- }
-#endif
- if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
- wordsize % SIZEOF_BDIGIT == 0) {
- size_t bdigits_per_word = wordsize / SIZEOF_BDIGIT;
- int mswordfirst_p = (flags & INTEGER_PACK_MSWORD_FIRST) != 0;
- int msbytefirst_p = (flags & INTEGER_PACK_NATIVE_BYTE_ORDER) ? HOST_BIGENDIAN_P :
- (flags & INTEGER_PACK_MSBYTE_FIRST) != 0;
- MEMCPY(dp, words, BDIGIT, numwords*bdigits_per_word);
- if (mswordfirst_p) {
- bary_swap(dp, num_bdigits);
- }
- if (mswordfirst_p ? !msbytefirst_p : msbytefirst_p) {
- size_t i;
- BDIGIT *p = dp;
- for (i = 0; i < numwords; i++) {
- bary_swap(p, bdigits_per_word);
- p += bdigits_per_word;
- }
- }
- if (msbytefirst_p != HOST_BIGENDIAN_P) {
- BDIGIT *p;
- for (p = dp; p < de; p++) {
- BDIGIT d = *p;
- *p = swap_bdigit(d);
- }
- }
- if (flags & INTEGER_PACK_2COMP) {
- if (flags & INTEGER_PACK_NEGATIVE) {
- int zero_p = bary_2comp(dp, num_bdigits);
- sign = zero_p ? -2 : -1;
- }
- else if (BDIGIT_MSB(de[-1])) {
- bary_2comp(dp, num_bdigits);
- sign = -1;
- }
- else {
- sign = 1;
- }
- }
- else {
- sign = (flags & INTEGER_PACK_NEGATIVE) ? -1 : 1;
- }
- return sign;
- }
- }
-
- if (num_bdigits != 0) {
- int word_num_partialbits;
- size_t word_num_fullbytes;
-
- ssize_t word_step;
- size_t byte_start;
- int byte_step;
-
- size_t word_start, word_last;
- const unsigned char *wordp, *last_wordp;
- BDIGIT_DBL dd;
- int numbits_in_dd;
-
- integer_pack_loop_setup(numwords, wordsize, nails, flags,
- &word_num_fullbytes, &word_num_partialbits,
- &word_start, &word_step, &word_last, &byte_start, &byte_step);
-
- wordp = buf + word_start;
- last_wordp = buf + word_last;
-
- dd = 0;
- numbits_in_dd = 0;
-
-#define PUSH_BITS(data, numbits) \
- integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp)
-
- while (1) {
- size_t index_in_word = 0;
- const unsigned char *bytep = wordp + byte_start;
- while (index_in_word < word_num_fullbytes) {
- PUSH_BITS(*bytep, CHAR_BIT);
- bytep += byte_step;
- index_in_word++;
- }
- if (word_num_partialbits) {
- PUSH_BITS(*bytep & ((1 << word_num_partialbits) - 1), word_num_partialbits);
- bytep += byte_step;
- index_in_word++;
- }
-
- if (wordp == last_wordp)
- break;
-
- wordp += word_step;
- }
- if (dd)
- *dp++ = (BDIGIT)dd;
- assert(dp <= de);
- while (dp < de)
- *dp++ = 0;
-#undef PUSH_BITS
- }
-
- if (!(flags & INTEGER_PACK_2COMP)) {
- sign = (flags & INTEGER_PACK_NEGATIVE) ? -1 : 1;
- }
- else {
- if (nlp_bits) {
- if ((flags & INTEGER_PACK_NEGATIVE) ||
- (bdigits[num_bdigits-1] >> (BITSPERDIG - nlp_bits - 1))) {
- bdigits[num_bdigits-1] |= BIGLO(BDIGMAX << (BITSPERDIG - nlp_bits));
- sign = -1;
- }
- else {
- sign = 1;
- }
- }
- else {
- if (flags & INTEGER_PACK_NEGATIVE) {
- sign = bary_zero_p(bdigits, num_bdigits) ? -2 : -1;
- }
- else {
- if (num_bdigits != 0 && BDIGIT_MSB(bdigits[num_bdigits-1]))
- sign = -1;
- else
- sign = 1;
- }
- }
- if (sign == -1 && num_bdigits != 0) {
- bary_2comp(bdigits, num_bdigits);
- }
- }
-
- return sign;
-}
-
-static void
-bary_unpack(BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
-{
- size_t num_bdigits0;
- int nlp_bits;
- int sign;
-
- validate_integer_pack_format(numwords, wordsize, nails, flags,
- INTEGER_PACK_MSWORD_FIRST|
- INTEGER_PACK_LSWORD_FIRST|
- INTEGER_PACK_MSBYTE_FIRST|
- INTEGER_PACK_LSBYTE_FIRST|
- INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP|
- INTEGER_PACK_FORCE_BIGNUM|
- INTEGER_PACK_NEGATIVE|
- INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION);
-
- num_bdigits0 = integer_unpack_num_bdigits(numwords, wordsize, nails, &nlp_bits);
-
- assert(num_bdigits0 <= num_bdigits);
-
- sign = bary_unpack_internal(bdigits, num_bdigits0, words, numwords, wordsize, nails, flags, nlp_bits);
-
- if (num_bdigits0 < num_bdigits) {
- BDIGITS_ZERO(bdigits + num_bdigits0, num_bdigits - num_bdigits0);
- if (sign == -2) {
- bdigits[num_bdigits0] = 1;
- }
- }
-}
-
-static int
-bary_subb(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, int borrow)
-{
- BDIGIT_DBL_SIGNED num;
- size_t i;
- size_t sn;
-
- assert(xn <= zn);
- assert(yn <= zn);
-
- sn = xn < yn ? xn : yn;
-
- num = borrow ? -1 : 0;
- for (i = 0; i < sn; i++) {
- num += (BDIGIT_DBL_SIGNED)xds[i] - yds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- if (yn <= xn) {
- for (; i < xn; i++) {
- if (num == 0) goto num_is_zero;
- num += xds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- }
- else {
- for (; i < yn; i++) {
- num -= yds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- }
- if (num == 0) goto num_is_zero;
- for (; i < zn; i++) {
- zds[i] = BDIGMAX;
- }
- return 1;
-
- num_is_zero:
- if (xds == zds && xn == zn)
- return 0;
- for (; i < xn; i++) {
- zds[i] = xds[i];
- }
- for (; i < zn; i++) {
- zds[i] = 0;
- }
- return 0;
-}
-
-static int
-bary_sub(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- return bary_subb(zds, zn, xds, xn, yds, yn, 0);
-}
-
-static int
-bary_sub_one(BDIGIT *zds, size_t zn)
-{
- return bary_subb(zds, zn, zds, zn, NULL, 0, 1);
-}
-
-static int
-bary_addc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, int carry)
-{
- BDIGIT_DBL num;
- size_t i;
-
- assert(xn <= zn);
- assert(yn <= zn);
-
- if (xn > yn) {
- const BDIGIT *tds;
- tds = xds; xds = yds; yds = tds;
- i = xn; xn = yn; yn = i;
- }
-
- num = carry ? 1 : 0;
- for (i = 0; i < xn; i++) {
- num += (BDIGIT_DBL)xds[i] + yds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- for (; i < yn; i++) {
- if (num == 0) goto num_is_zero;
- num += yds[i];
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- for (; i < zn; i++) {
- if (num == 0) goto num_is_zero;
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
- return num != 0;
-
- num_is_zero:
- if (yds == zds && yn == zn)
- return 0;
- for (; i < yn; i++) {
- zds[i] = yds[i];
- }
- for (; i < zn; i++) {
- zds[i] = 0;
- }
- return 0;
-}
-
-static int
-bary_add(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- return bary_addc(zds, zn, xds, xn, yds, yn, 0);
-}
-
-static int
-bary_add_one(BDIGIT *ds, size_t n)
-{
- size_t i;
- for (i = 0; i < n; i++) {
- ds[i] = BIGLO(ds[i]+1);
- if (ds[i] != 0)
- return 0;
- }
- return 1;
-}
-
-static void
-bary_mul_single(BDIGIT *zds, size_t zn, BDIGIT x, BDIGIT y)
-{
- BDIGIT_DBL n;
-
- assert(2 <= zn);
-
- n = (BDIGIT_DBL)x * y;
- bdigitdbl2bary(zds, 2, n);
- BDIGITS_ZERO(zds + 2, zn - 2);
-}
-
-static int
-bary_muladd_1xN(BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn)
-{
- BDIGIT_DBL n;
- BDIGIT_DBL dd;
- size_t j;
-
- assert(zn > yn);
-
- if (x == 0)
- return 0;
- dd = x;
- n = 0;
- for (j = 0; j < yn; j++) {
- BDIGIT_DBL ee = n + dd * yds[j];
- if (ee) {
- n = zds[j] + ee;
- zds[j] = BIGLO(n);
- n = BIGDN(n);
- }
- else {
- n = 0;
- }
-
- }
- for (; j < zn; j++) {
- if (n == 0)
- break;
- n += zds[j];
- zds[j] = BIGLO(n);
- n = BIGDN(n);
- }
- return n != 0;
-}
-
-static BDIGIT_DBL_SIGNED
-bigdivrem_mulsub(BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn)
-{
- size_t i;
- BDIGIT_DBL t2;
- BDIGIT_DBL_SIGNED num;
-
- assert(zn == yn + 1);
-
- num = 0;
- t2 = 0;
- i = 0;
-
- do {
- BDIGIT_DBL ee;
- t2 += (BDIGIT_DBL)yds[i] * x;
- ee = num - BIGLO(t2);
- num = (BDIGIT_DBL)zds[i] + ee;
- if (ee) zds[i] = BIGLO(num);
- num = BIGDN(num);
- t2 = BIGDN(t2);
- } while (++i < yn);
- num += zds[i] - t2; /* borrow from high digit; don't update */
- return num;
-}
-
-static int
-bary_mulsub_1xN(BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn)
-{
- BDIGIT_DBL_SIGNED num;
-
- assert(zn == yn + 1);
-
- num = bigdivrem_mulsub(zds, zn, x, yds, yn);
- zds[yn] = BIGLO(num);
- if (BIGDN(num))
- return 1;
- return 0;
-}
-
-static void
-bary_mul_normal(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- size_t i;
-
- assert(xn + yn <= zn);
-
- BDIGITS_ZERO(zds, zn);
- for (i = 0; i < xn; i++) {
- bary_muladd_1xN(zds+i, zn-i, xds[i], yds, yn);
- }
-}
-
-VALUE
-rb_big_mul_normal(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- bary_mul_normal(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- return z;
-}
-
-/* efficient squaring (2 times faster than normal multiplication)
- * ref: Handbook of Applied Cryptography, Algorithm 14.16
- * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
- */
-static void
-bary_sq_fast(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn)
-{
- size_t i, j;
- BDIGIT_DBL c, v, w;
- BDIGIT vl;
- int vh;
-
- assert(xn * 2 <= zn);
-
- BDIGITS_ZERO(zds, zn);
-
- if (xn == 0)
- return;
-
- for (i = 0; i < xn-1; i++) {
- v = (BDIGIT_DBL)xds[i];
- if (!v)
- continue;
- c = (BDIGIT_DBL)zds[i + i] + v * v;
- zds[i + i] = BIGLO(c);
- c = BIGDN(c);
- v *= 2;
- vl = BIGLO(v);
- vh = (int)BIGDN(v);
- for (j = i + 1; j < xn; j++) {
- w = (BDIGIT_DBL)xds[j];
- c += (BDIGIT_DBL)zds[i + j] + vl * w;
- zds[i + j] = BIGLO(c);
- c = BIGDN(c);
- if (vh)
- c += w;
- }
- if (c) {
- c += (BDIGIT_DBL)zds[i + xn];
- zds[i + xn] = BIGLO(c);
- c = BIGDN(c);
- if (c)
- zds[i + xn + 1] += (BDIGIT)c;
- }
- }
-
- /* i == xn-1 */
- v = (BDIGIT_DBL)xds[i];
- if (!v)
- return;
- c = (BDIGIT_DBL)zds[i + i] + v * v;
- zds[i + i] = BIGLO(c);
- c = BIGDN(c);
- if (c) {
- zds[i + xn] += BIGLO(c);
- }
-}
-
-VALUE
-rb_big_sq_fast(VALUE x)
-{
- size_t xn = BIGNUM_LEN(x), zn = 2 * xn;
- VALUE z = bignew(zn, 1);
- bary_sq_fast(BDIGITS(z), zn, BDIGITS(x), xn);
- RB_GC_GUARD(x);
- return z;
-}
-
-/* balancing multiplication by slicing larger argument */
-static void
-bary_mul_balance_with_mulfunc(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn, mulfunc_t *mulfunc)
-{
- VALUE work = 0;
- size_t yn0 = yn;
- size_t r, n;
-
- assert(xn + yn <= zn);
- assert(xn <= yn);
- assert(!KARATSUBA_BALANCED(xn, yn) || !TOOM3_BALANCED(xn, yn));
-
- BDIGITS_ZERO(zds, xn);
-
- n = 0;
- while (yn > 0) {
- BDIGIT *tds;
- size_t tn;
- r = xn > yn ? yn : xn;
- tn = xn + r;
- if (2 * (xn + r) <= zn - n) {
- tds = zds + n + xn + r;
- mulfunc(tds, tn, xds, xn, yds + n, r, wds, wn);
- BDIGITS_ZERO(zds + n + xn, r);
- bary_add(zds + n, tn,
- zds + n, tn,
- tds, tn);
- }
- else {
- if (wn < xn) {
- wn = xn;
- wds = ALLOCV_N(BDIGIT, work, wn);
- }
- tds = zds + n;
- MEMCPY(wds, zds + n, BDIGIT, xn);
- mulfunc(tds, tn, xds, xn, yds + n, r, wds+xn, wn-xn);
- bary_add(zds + n, tn,
- zds + n, tn,
- wds, xn);
- }
- yn -= r;
- n += r;
- }
- BDIGITS_ZERO(zds+xn+yn0, zn - (xn+yn0));
-
- if (work)
- ALLOCV_END(work);
-}
-
-VALUE
-rb_big_mul_balance(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- bary_mul_balance_with_mulfunc(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0, bary_mul_toom3_start);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- return z;
-}
-
-/* multiplication by karatsuba method */
-static void
-bary_mul_karatsuba(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- VALUE work = 0;
-
- size_t n;
- int sub_p, borrow, carry1, carry2, carry3;
-
- int odd_y = 0;
- int odd_xy = 0;
- int sq;
-
- const BDIGIT *xds0, *xds1, *yds0, *yds1;
- BDIGIT *zds0, *zds1, *zds2, *zds3;
-
- assert(xn + yn <= zn);
- assert(xn <= yn);
- assert(yn < 2 * xn);
-
- sq = xds == yds && xn == yn;
-
- if (yn & 1) {
- odd_y = 1;
- yn--;
- if (yn < xn) {
- odd_xy = 1;
- xn--;
- }
- }
-
- n = yn / 2;
-
- assert(n < xn);
-
- if (wn < n) {
- /* This function itself needs only n BDIGITs for work area.
- * However this function calls bary_mul_karatsuba and
- * bary_mul_balance recursively.
- * 2n BDIGITs are enough to avoid allocations in
- * the recursively called functions.
- */
- wn = 2*n;
- wds = ALLOCV_N(BDIGIT, work, wn);
- }
-
- /* Karatsuba algorithm:
- *
- * x = x0 + r*x1
- * y = y0 + r*y1
- * z = x*y
- * = (x0 + r*x1) * (y0 + r*y1)
- * = x0*y0 + r*(x1*y0 + x0*y1) + r*r*x1*y1
- * = x0*y0 + r*(x0*y0 + x1*y1 - (x1-x0)*(y1-y0)) + r*r*x1*y1
- * = x0*y0 + r*(x0*y0 + x1*y1 - (x0-x1)*(y0-y1)) + r*r*x1*y1
- */
-
- xds0 = xds;
- xds1 = xds + n;
- yds0 = yds;
- yds1 = yds + n;
- zds0 = zds;
- zds1 = zds + n;
- zds2 = zds + 2*n;
- zds3 = zds + 3*n;
-
- sub_p = 1;
-
- /* zds0:? zds1:? zds2:? zds3:? wds:? */
-
- if (bary_sub(zds0, n, xds, n, xds+n, xn-n)) {
- bary_2comp(zds0, n);
- sub_p = !sub_p;
- }
-
- /* zds0:|x1-x0| zds1:? zds2:? zds3:? wds:? */
-
- if (sq) {
- sub_p = 1;
- bary_mul_karatsuba_start(zds1, 2*n, zds0, n, zds0, n, wds, wn);
- }
- else {
- if (bary_sub(wds, n, yds, n, yds+n, n)) {
- bary_2comp(wds, n);
- sub_p = !sub_p;
- }
-
- /* zds0:|x1-x0| zds1:? zds2:? zds3:? wds:|y1-y0| */
-
- bary_mul_karatsuba_start(zds1, 2*n, zds0, n, wds, n, wds+n, wn-n);
- }
-
- /* zds0:|x1-x0| zds1,zds2:|x1-x0|*|y1-y0| zds3:? wds:|y1-y0| */
-
- borrow = 0;
- if (sub_p) {
- borrow = !bary_2comp(zds1, 2*n);
- }
- /* zds0:|x1-x0| zds1,zds2:-?|x1-x0|*|y1-y0| zds3:? wds:|y1-y0| */
-
- MEMCPY(wds, zds1, BDIGIT, n);
-
- /* zds0:|x1-x0| zds1,zds2:-?|x1-x0|*|y1-y0| zds3:? wds:lo(-?|x1-x0|*|y1-y0|) */
-
- bary_mul_karatsuba_start(zds0, 2*n, xds0, n, yds0, n, wds+n, wn-n);
-
- /* zds0,zds1:x0*y0 zds2:hi(-?|x1-x0|*|y1-y0|) zds3:? wds:lo(-?|x1-x0|*|y1-y0|) */
-
- carry1 = bary_add(wds, n, wds, n, zds0, n);
- carry1 = bary_addc(zds2, n, zds2, n, zds1, n, carry1);
-
- /* zds0,zds1:x0*y0 zds2:hi(x0*y0-?|x1-x0|*|y1-y0|) zds3:? wds:lo(x0*y0-?|x1-x0|*|y1-y0|) */
-
- carry2 = bary_add(zds1, n, zds1, n, wds, n);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|) zds2:hi(x0*y0-?|x1-x0|*|y1-y0|) zds3:? wds:lo(x0*y0-?|x1-x0|*|y1-y0|) */
-
- MEMCPY(wds, zds2, BDIGIT, n);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|) zds2:_ zds3:? wds:hi(x0*y0-?|x1-x0|*|y1-y0|) */
-
- bary_mul_karatsuba_start(zds2, zn-2*n, xds1, xn-n, yds1, n, wds+n, wn-n);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|) zds2,zds3:x1*y1 wds:hi(x0*y0-?|x1-x0|*|y1-y0|) */
-
- carry3 = bary_add(zds1, n, zds1, n, zds2, n);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|)+lo(x1*y1) zds2,zds3:x1*y1 wds:hi(x0*y0-?|x1-x0|*|y1-y0|) */
-
- carry3 = bary_addc(zds2, n, zds2, n, zds3, (4*n < zn ? n : zn-3*n), carry3);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|)+lo(x1*y1) zds2,zds3:x1*y1+hi(x1*y1) wds:hi(x0*y0-?|x1-x0|*|y1-y0|) */
-
- bary_add(zds2, zn-2*n, zds2, zn-2*n, wds, n);
-
- /* zds0:lo(x0*y0) zds1:hi(x0*y0)+lo(x0*y0-?|x1-x0|*|y1-y0|)+lo(x1*y1) zds2,zds3:x1*y1+hi(x1*y1)+hi(x0*y0-?|x1-x0|*|y1-y0|) wds:_ */
-
- if (carry2)
- bary_add_one(zds2, zn-2*n);
-
- if (carry1 + carry3 - borrow < 0)
- bary_sub_one(zds3, zn-3*n);
- else if (carry1 + carry3 - borrow > 0) {
- BDIGIT c = carry1 + carry3 - borrow;
- bary_add(zds3, zn-3*n, zds3, zn-3*n, &c, 1);
- }
-
- /*
- if (SIZEOF_BDIGIT * zn <= 16) {
- uint128_t z, x, y;
- ssize_t i;
- for (x = 0, i = xn-1; 0 <= i; i--) { x <<= SIZEOF_BDIGIT*CHAR_BIT; x |= xds[i]; }
- for (y = 0, i = yn-1; 0 <= i; i--) { y <<= SIZEOF_BDIGIT*CHAR_BIT; y |= yds[i]; }
- for (z = 0, i = zn-1; 0 <= i; i--) { z <<= SIZEOF_BDIGIT*CHAR_BIT; z |= zds[i]; }
- assert(z == x * y);
- }
- */
-
- if (odd_xy) {
- bary_muladd_1xN(zds+yn, zn-yn, yds[yn], xds, xn);
- bary_muladd_1xN(zds+xn, zn-xn, xds[xn], yds, yn+1);
- }
- else if (odd_y) {
- bary_muladd_1xN(zds+yn, zn-yn, yds[yn], xds, xn);
- }
-
- if (work)
- ALLOCV_END(work);
-}
-
-VALUE
-rb_big_mul_karatsuba(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- if (!((xn <= yn && yn < 2) || KARATSUBA_BALANCED(xn, yn)))
- rb_raise(rb_eArgError, "unexpected bignum length for karatsuba");
- bary_mul_karatsuba(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- return z;
-}
-
-static void
-bary_mul_toom3(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- size_t n;
- size_t wnc;
- VALUE work = 0;
-
- /* "p" stands for "positive". Actually it means "non-negative", though. */
- size_t x0n; const BDIGIT *x0ds;
- size_t x1n; const BDIGIT *x1ds;
- size_t x2n; const BDIGIT *x2ds;
- size_t y0n; const BDIGIT *y0ds;
- size_t y1n; const BDIGIT *y1ds;
- size_t y2n; const BDIGIT *y2ds;
-
- size_t u1n; BDIGIT *u1ds; int u1p;
- size_t u2n; BDIGIT *u2ds; int u2p;
- size_t u3n; BDIGIT *u3ds; int u3p;
-
- size_t v1n; BDIGIT *v1ds; int v1p;
- size_t v2n; BDIGIT *v2ds; int v2p;
- size_t v3n; BDIGIT *v3ds; int v3p;
-
- size_t t0n; BDIGIT *t0ds; int t0p;
- size_t t1n; BDIGIT *t1ds; int t1p;
- size_t t2n; BDIGIT *t2ds; int t2p;
- size_t t3n; BDIGIT *t3ds; int t3p;
- size_t t4n; BDIGIT *t4ds; int t4p;
-
- size_t z0n; BDIGIT *z0ds;
- size_t z1n; BDIGIT *z1ds; int z1p;
- size_t z2n; BDIGIT *z2ds; int z2p;
- size_t z3n; BDIGIT *z3ds; int z3p;
- size_t z4n; BDIGIT *z4ds;
-
- size_t zzn; BDIGIT *zzds;
-
- int sq = xds == yds && xn == yn;
-
- assert(xn <= yn); /* assume y >= x */
- assert(xn + yn <= zn);
-
- n = (yn + 2) / 3;
- assert(2*n < xn);
-
- wnc = 0;
-
- wnc += (u1n = n+1); /* BITSPERDIG*n+2 bits */
- wnc += (u2n = n+1); /* BITSPERDIG*n+1 bits */
- wnc += (u3n = n+1); /* BITSPERDIG*n+3 bits */
- wnc += (v1n = n+1); /* BITSPERDIG*n+2 bits */
- wnc += (v2n = n+1); /* BITSPERDIG*n+1 bits */
- wnc += (v3n = n+1); /* BITSPERDIG*n+3 bits */
-
- wnc += (t0n = 2*n); /* BITSPERDIG*2*n bits */
- wnc += (t1n = 2*n+2); /* BITSPERDIG*2*n+4 bits but bary_mul needs u1n+v1n */
- wnc += (t2n = 2*n+2); /* BITSPERDIG*2*n+2 bits but bary_mul needs u2n+v2n */
- wnc += (t3n = 2*n+2); /* BITSPERDIG*2*n+6 bits but bary_mul needs u3n+v3n */
- wnc += (t4n = 2*n); /* BITSPERDIG*2*n bits */
-
- wnc += (z1n = 2*n+1); /* BITSPERDIG*2*n+5 bits */
- wnc += (z2n = 2*n+1); /* BITSPERDIG*2*n+6 bits */
- wnc += (z3n = 2*n+1); /* BITSPERDIG*2*n+8 bits */
-
- if (wn < wnc) {
- wn = wnc * 3 / 2; /* Allocate working memory for whole recursion at once. */
- wds = ALLOCV_N(BDIGIT, work, wn);
- }
-
- u1ds = wds; wds += u1n;
- u2ds = wds; wds += u2n;
- u3ds = wds; wds += u3n;
-
- v1ds = wds; wds += v1n;
- v2ds = wds; wds += v2n;
- v3ds = wds; wds += v3n;
-
- t0ds = wds; wds += t0n;
- t1ds = wds; wds += t1n;
- t2ds = wds; wds += t2n;
- t3ds = wds; wds += t3n;
- t4ds = wds; wds += t4n;
-
- z1ds = wds; wds += z1n;
- z2ds = wds; wds += z2n;
- z3ds = wds; wds += z3n;
-
- wn -= wnc;
-
- zzds = u1ds;
- zzn = 6*n+1;
-
- x0n = n;
- x1n = n;
- x2n = xn - 2*n;
- x0ds = xds;
- x1ds = xds + n;
- x2ds = xds + 2*n;
-
- if (sq) {
- y0n = x0n;
- y1n = x1n;
- y2n = x2n;
- y0ds = x0ds;
- y1ds = x1ds;
- y2ds = x2ds;
- }
- else {
- y0n = n;
- y1n = n;
- y2n = yn - 2*n;
- y0ds = yds;
- y1ds = yds + n;
- y2ds = yds + 2*n;
- }
-
- /*
- * ref. http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication
- *
- * x(b) = x0 * b^0 + x1 * b^1 + x2 * b^2
- * y(b) = y0 * b^0 + y1 * b^1 + y2 * b^2
- *
- * z(b) = x(b) * y(b)
- * z(b) = z0 * b^0 + z1 * b^1 + z2 * b^2 + z3 * b^3 + z4 * b^4
- * where:
- * z0 = x0 * y0
- * z1 = x0 * y1 + x1 * y0
- * z2 = x0 * y2 + x1 * y1 + x2 * y0
- * z3 = x1 * y2 + x2 * y1
- * z4 = x2 * y2
- *
- * Toom3 method (a.k.a. Toom-Cook method):
- * (Step1) calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4),
- * where:
- * b0 = 0, b1 = 1, b2 = -1, b3 = -2, b4 = inf,
- * z(0) = x(0) * y(0) = x0 * y0
- * z(1) = x(1) * y(1) = (x0 + x1 + x2) * (y0 + y1 + y2)
- * z(-1) = x(-1) * y(-1) = (x0 - x1 + x2) * (y0 - y1 + y2)
- * z(-2) = x(-2) * y(-2) = (x0 - 2 * (x1 - 2 * x2)) * (y0 - 2 * (y1 - 2 * y2))
- * z(inf) = x(inf) * y(inf) = x2 * y2
- *
- * (Step2) interpolating z0, z1, z2, z3 and z4.
- *
- * (Step3) Substituting base value into b of the polynomial z(b),
- */
-
- /*
- * [Step1] calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4)
- */
-
- /* u1 <- x0 + x2 */
- bary_add(u1ds, u1n, x0ds, x0n, x2ds, x2n);
- u1p = 1;
-
- /* x(-1) : u2 <- u1 - x1 = x0 - x1 + x2 */
- if (bary_sub(u2ds, u2n, u1ds, u1n, x1ds, x1n)) {
- bary_2comp(u2ds, u2n);
- u2p = 0;
- }
- else {
- u2p = 1;
- }
-
- /* x(1) : u1 <- u1 + x1 = x0 + x1 + x2 */
- bary_add(u1ds, u1n, u1ds, u1n, x1ds, x1n);
-
- /* x(-2) : u3 <- 2 * (u2 + x2) - x0 = x0 - 2 * (x1 - 2 * x2) */
- u3p = 1;
- if (u2p) {
- bary_add(u3ds, u3n, u2ds, u2n, x2ds, x2n);
- }
- else if (bary_sub(u3ds, u3n, x2ds, x2n, u2ds, u2n)) {
- bary_2comp(u3ds, u3n);
- u3p = 0;
- }
- bary_small_lshift(u3ds, u3ds, u3n, 1);
- if (!u3p) {
- bary_add(u3ds, u3n, u3ds, u3n, x0ds, x0n);
- }
- else if (bary_sub(u3ds, u3n, u3ds, u3n, x0ds, x0n)) {
- bary_2comp(u3ds, u3n);
- u3p = 0;
- }
-
- if (sq) {
- v1n = u1n; v1ds = u1ds; v1p = u1p;
- v2n = u2n; v2ds = u2ds; v2p = u2p;
- v3n = u3n; v3ds = u3ds; v3p = u3p;
- }
- else {
- /* v1 <- y0 + y2 */
- bary_add(v1ds, v1n, y0ds, y0n, y2ds, y2n);
- v1p = 1;
-
- /* y(-1) : v2 <- v1 - y1 = y0 - y1 + y2 */
- v2p = 1;
- if (bary_sub(v2ds, v2n, v1ds, v1n, y1ds, y1n)) {
- bary_2comp(v2ds, v2n);
- v2p = 0;
- }
-
- /* y(1) : v1 <- v1 + y1 = y0 + y1 + y2 */
- bary_add(v1ds, v1n, v1ds, v1n, y1ds, y1n);
-
- /* y(-2) : v3 <- 2 * (v2 + y2) - y0 = y0 - 2 * (y1 - 2 * y2) */
- v3p = 1;
- if (v2p) {
- bary_add(v3ds, v3n, v2ds, v2n, y2ds, y2n);
- }
- else if (bary_sub(v3ds, v3n, y2ds, y2n, v2ds, v2n)) {
- bary_2comp(v3ds, v3n);
- v3p = 0;
- }
- bary_small_lshift(v3ds, v3ds, v3n, 1);
- if (!v3p) {
- bary_add(v3ds, v3n, v3ds, v3n, y0ds, y0n);
- }
- else if (bary_sub(v3ds, v3n, v3ds, v3n, y0ds, y0n)) {
- bary_2comp(v3ds, v3n);
- v3p = 0;
- }
- }
-
- /* z(0) : t0 <- x0 * y0 */
- bary_mul_toom3_start(t0ds, t0n, x0ds, x0n, y0ds, y0n, wds, wn);
- t0p = 1;
-
- /* z(1) : t1 <- u1 * v1 */
- bary_mul_toom3_start(t1ds, t1n, u1ds, u1n, v1ds, v1n, wds, wn);
- t1p = u1p == v1p;
- assert(t1ds[t1n-1] == 0);
- t1n--;
-
- /* z(-1) : t2 <- u2 * v2 */
- bary_mul_toom3_start(t2ds, t2n, u2ds, u2n, v2ds, v2n, wds, wn);
- t2p = u2p == v2p;
- assert(t2ds[t2n-1] == 0);
- t2n--;
-
- /* z(-2) : t3 <- u3 * v3 */
- bary_mul_toom3_start(t3ds, t3n, u3ds, u3n, v3ds, v3n, wds, wn);
- t3p = u3p == v3p;
- assert(t3ds[t3n-1] == 0);
- t3n--;
-
- /* z(inf) : t4 <- x2 * y2 */
- bary_mul_toom3_start(t4ds, t4n, x2ds, x2n, y2ds, y2n, wds, wn);
- t4p = 1;
-
- /*
- * [Step2] interpolating z0, z1, z2, z3 and z4.
- */
-
- /* z0 <- z(0) == t0 */
- z0n = t0n; z0ds = t0ds;
-
- /* z4 <- z(inf) == t4 */
- z4n = t4n; z4ds = t4ds;
-
- /* z3 <- (z(-2) - z(1)) / 3 == (t3 - t1) / 3 */
- if (t3p == t1p) {
- z3p = t3p;
- if (bary_sub(z3ds, z3n, t3ds, t3n, t1ds, t1n)) {
- bary_2comp(z3ds, z3n);
- z3p = !z3p;
- }
- }
- else {
- z3p = t3p;
- bary_add(z3ds, z3n, t3ds, t3n, t1ds, t1n);
- }
- bigdivrem_single(z3ds, z3ds, z3n, 3);
-
- /* z1 <- (z(1) - z(-1)) / 2 == (t1 - t2) / 2 */
- if (t1p == t2p) {
- z1p = t1p;
- if (bary_sub(z1ds, z1n, t1ds, t1n, t2ds, t2n)) {
- bary_2comp(z1ds, z1n);
- z1p = !z1p;
- }
- }
- else {
- z1p = t1p;
- bary_add(z1ds, z1n, t1ds, t1n, t2ds, t2n);
- }
- bary_small_rshift(z1ds, z1ds, z1n, 1, 0);
-
- /* z2 <- z(-1) - z(0) == t2 - t0 */
- if (t2p == t0p) {
- z2p = t2p;
- if (bary_sub(z2ds, z2n, t2ds, t2n, t0ds, t0n)) {
- bary_2comp(z2ds, z2n);
- z2p = !z2p;
- }
- }
- else {
- z2p = t2p;
- bary_add(z2ds, z2n, t2ds, t2n, t0ds, t0n);
- }
-
- /* z3 <- (z2 - z3) / 2 + 2 * z(inf) == (z2 - z3) / 2 + 2 * t4 */
- if (z2p == z3p) {
- z3p = z2p;
- if (bary_sub(z3ds, z3n, z2ds, z2n, z3ds, z3n)) {
- bary_2comp(z3ds, z3n);
- z3p = !z3p;
- }
- }
- else {
- z3p = z2p;
- bary_add(z3ds, z3n, z2ds, z2n, z3ds, z3n);
- }
- bary_small_rshift(z3ds, z3ds, z3n, 1, 0);
- if (z3p == t4p) {
- bary_muladd_1xN(z3ds, z3n, 2, t4ds, t4n);
- }
- else {
- if (bary_mulsub_1xN(z3ds, z3n, 2, t4ds, t4n)) {
- bary_2comp(z3ds, z3n);
- z3p = !z3p;
- }
- }
-
- /* z2 <- z2 + z1 - z(inf) == z2 + z1 - t4 */
- if (z2p == z1p) {
- bary_add(z2ds, z2n, z2ds, z2n, z1ds, z1n);
- }
- else {
- if (bary_sub(z2ds, z2n, z2ds, z2n, z1ds, z1n)) {
- bary_2comp(z2ds, z2n);
- z2p = !z2p;
- }
- }
-
- if (z2p == t4p) {
- if (bary_sub(z2ds, z2n, z2ds, z2n, t4ds, t4n)) {
- bary_2comp(z2ds, z2n);
- z2p = !z2p;
- }
- }
- else {
- bary_add(z2ds, z2n, z2ds, z2n, t4ds, t4n);
- }
-
- /* z1 <- z1 - z3 */
- if (z1p == z3p) {
- if (bary_sub(z1ds, z1n, z1ds, z1n, z3ds, z3n)) {
- bary_2comp(z1ds, z1n);
- z1p = !z1p;
- }
- }
- else {
- bary_add(z1ds, z1n, z1ds, z1n, z3ds, z3n);
- }
-
- /*
- * [Step3] Substituting base value into b of the polynomial z(b),
- */
-
- MEMCPY(zzds, z0ds, BDIGIT, z0n);
- BDIGITS_ZERO(zzds + z0n, 4*n - z0n);
- MEMCPY(zzds + 4*n, z4ds, BDIGIT, z4n);
- BDIGITS_ZERO(zzds + 4*n + z4n, zzn - (4*n + z4n));
- if (z1p)
- bary_add(zzds + n, zzn - n, zzds + n, zzn - n, z1ds, z1n);
- else
- bary_sub(zzds + n, zzn - n, zzds + n, zzn - n, z1ds, z1n);
- if (z2p)
- bary_add(zzds + 2*n, zzn - 2*n, zzds + 2*n, zzn - 2*n, z2ds, z2n);
- else
- bary_sub(zzds + 2*n, zzn - 2*n, zzds + 2*n, zzn - 2*n, z2ds, z2n);
- if (z3p)
- bary_add(zzds + 3*n, zzn - 3*n, zzds + 3*n, zzn - 3*n, z3ds, z3n);
- else
- bary_sub(zzds + 3*n, zzn - 3*n, zzds + 3*n, zzn - 3*n, z3ds, z3n);
-
- BARY_TRUNC(zzds, zzn);
- MEMCPY(zds, zzds, BDIGIT, zzn);
- BDIGITS_ZERO(zds + zzn, zn - zzn);
-
- if (work)
- ALLOCV_END(work);
-}
-
-VALUE
-rb_big_mul_toom3(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- if (xn > yn || yn < 3 || !TOOM3_BALANCED(xn,yn))
- rb_raise(rb_eArgError, "unexpected bignum length for toom3");
- bary_mul_toom3(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, NULL, 0);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- return z;
-}
-
-#ifdef USE_GMP
-static void
-bary_mul_gmp(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
- mpz_t x, y, z;
- size_t count;
-
- assert(xn + yn <= zn);
-
- mpz_init(x);
- mpz_init(y);
- mpz_init(z);
- mpz_import(x, xn, -1, sizeof(BDIGIT), 0, nails, xds);
- if (xds == yds && xn == yn) {
- mpz_mul(z, x, x);
- }
- else {
- mpz_import(y, yn, -1, sizeof(BDIGIT), 0, nails, yds);
- mpz_mul(z, x, y);
- }
- mpz_export(zds, &count, -1, sizeof(BDIGIT), 0, nails, z);
- BDIGITS_ZERO(zds+count, zn-count);
- mpz_clear(x);
- mpz_clear(y);
- mpz_clear(z);
-}
-
-VALUE
-rb_big_mul_gmp(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), zn = xn + yn;
- VALUE z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- bary_mul_gmp(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- return z;
-}
-#endif
-
-static void
-bary_short_mul(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- assert(xn + yn <= zn);
-
- if (xn == 1 && yn == 1) {
- bary_mul_single(zds, zn, xds[0], yds[0]);
- }
- else {
- bary_mul_normal(zds, zn, xds, xn, yds, yn);
- rb_thread_check_ints();
- }
-}
-
-/* determine whether a bignum is sparse or not by random sampling */
-static inline int
-bary_sparse_p(const BDIGIT *ds, size_t n)
-{
- long c = 0;
-
- if ( ds[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
- if (c <= 1 && ds[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
- if (c <= 1 && ds[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
-
- return (c <= 1) ? 1 : 0;
-}
-
-static int
-bary_mul_precheck(BDIGIT **zdsp, size_t *znp, const BDIGIT **xdsp, size_t *xnp, const BDIGIT **ydsp, size_t *ynp)
-{
- size_t nlsz; /* number of least significant zero BDIGITs */
-
- BDIGIT *zds = *zdsp;
- size_t zn = *znp;
- const BDIGIT *xds = *xdsp;
- size_t xn = *xnp;
- const BDIGIT *yds = *ydsp;
- size_t yn = *ynp;
-
- assert(xn + yn <= zn);
-
- nlsz = 0;
-
- while (0 < xn) {
- if (xds[xn-1] == 0) {
- xn--;
- }
- else {
- do {
- if (xds[0] != 0)
- break;
- xds++;
- xn--;
- nlsz++;
- } while (0 < xn);
- break;
- }
- }
-
- while (0 < yn) {
- if (yds[yn-1] == 0) {
- yn--;
- }
- else {
- do {
- if (yds[0] != 0)
- break;
- yds++;
- yn--;
- nlsz++;
- } while (0 < yn);
- break;
- }
- }
-
- if (nlsz) {
- BDIGITS_ZERO(zds, nlsz);
- zds += nlsz;
- zn -= nlsz;
- }
-
- /* make sure that y is longer than x */
- if (xn > yn) {
- const BDIGIT *tds;
- size_t tn;
- tds = xds; xds = yds; yds = tds;
- tn = xn; xn = yn; yn = tn;
- }
- assert(xn <= yn);
-
- if (xn <= 1) {
- if (xn == 0) {
- BDIGITS_ZERO(zds, zn);
- return 1;
- }
-
- if (xds[0] == 1) {
- MEMCPY(zds, yds, BDIGIT, yn);
- BDIGITS_ZERO(zds+yn, zn-yn);
- return 1;
- }
- if (POW2_P(xds[0])) {
- zds[yn] = bary_small_lshift(zds, yds, yn, bit_length(xds[0])-1);
- BDIGITS_ZERO(zds+yn+1, zn-yn-1);
- return 1;
- }
- if (yn == 1 && yds[0] == 1) {
- zds[0] = xds[0];
- BDIGITS_ZERO(zds+1, zn-1);
- return 1;
- }
- bary_mul_normal(zds, zn, xds, xn, yds, yn);
- return 1;
- }
-
- *zdsp = zds;
- *znp = zn;
- *xdsp = xds;
- *xnp = xn;
- *ydsp = yds;
- *ynp = yn;
-
- return 0;
-}
-
-static void
-bary_mul_karatsuba_branch(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- /* normal multiplication when x is small */
- if (xn < KARATSUBA_MUL_DIGITS) {
- normal:
- if (xds == yds && xn == yn)
- bary_sq_fast(zds, zn, xds, xn);
- else
- bary_short_mul(zds, zn, xds, xn, yds, yn);
- return;
- }
-
- /* normal multiplication when x or y is a sparse bignum */
- if (bary_sparse_p(xds, xn)) goto normal;
- if (bary_sparse_p(yds, yn)) {
- bary_short_mul(zds, zn, yds, yn, xds, xn);
- return;
- }
-
- /* balance multiplication by slicing y when x is much smaller than y */
- if (!KARATSUBA_BALANCED(xn, yn)) {
- bary_mul_balance_with_mulfunc(zds, zn, xds, xn, yds, yn, wds, wn, bary_mul_karatsuba_start);
- return;
- }
-
- /* multiplication by karatsuba method */
- bary_mul_karatsuba(zds, zn, xds, xn, yds, yn, wds, wn);
-}
-
-static void
-bary_mul_karatsuba_start(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- if (bary_mul_precheck(&zds, &zn, &xds, &xn, &yds, &yn))
- return;
-
- bary_mul_karatsuba_branch(zds, zn, xds, xn, yds, yn, wds, wn);
-}
-
-static void
-bary_mul_toom3_branch(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- if (xn < TOOM3_MUL_DIGITS) {
- bary_mul_karatsuba_branch(zds, zn, xds, xn, yds, yn, wds, wn);
- return;
- }
-
- if (!TOOM3_BALANCED(xn, yn)) {
- bary_mul_balance_with_mulfunc(zds, zn, xds, xn, yds, yn, wds, wn, bary_mul_toom3_start);
- return;
- }
-
- bary_mul_toom3(zds, zn, xds, xn, yds, yn, wds, wn);
-}
-
-static void
-bary_mul_toom3_start(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn)
-{
- if (bary_mul_precheck(&zds, &zn, &xds, &xn, &yds, &yn))
- return;
-
- bary_mul_toom3_branch(zds, zn, xds, xn, yds, yn, wds, wn);
-}
-
-static void
-bary_mul(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
-#ifdef USE_GMP
- const size_t naive_threshold = GMP_MUL_DIGITS;
-#else
- const size_t naive_threshold = KARATSUBA_MUL_DIGITS;
-#endif
- if (xn <= yn) {
- if (xn < naive_threshold) {
- if (xds == yds && xn == yn)
- bary_sq_fast(zds, zn, xds, xn);
- else
- bary_short_mul(zds, zn, xds, xn, yds, yn);
- return;
- }
- }
- else {
- if (yn < naive_threshold) {
- bary_short_mul(zds, zn, yds, yn, xds, xn);
- return;
- }
- }
-
-#ifdef USE_GMP
- bary_mul_gmp(zds, zn, xds, xn, yds, yn);
-#else
- bary_mul_toom3_start(zds, zn, xds, xn, yds, yn, NULL, 0);
-#endif
-}
-
-struct big_div_struct {
- size_t yn, zn;
- BDIGIT *yds, *zds;
- volatile VALUE stop;
-};
-
-static void *
-bigdivrem1(void *ptr)
-{
- struct big_div_struct *bds = (struct big_div_struct*)ptr;
- size_t yn = bds->yn;
- size_t zn = bds->zn;
- BDIGIT *yds = bds->yds, *zds = bds->zds;
- BDIGIT_DBL_SIGNED num;
- BDIGIT q;
-
- do {
- if (bds->stop) {
- bds->zn = zn;
- return 0;
- }
- if (zds[zn-1] == yds[yn-1]) q = BDIGMAX;
- else q = (BDIGIT)((BIGUP(zds[zn-1]) + zds[zn-2])/yds[yn-1]);
- if (q) {
- num = bigdivrem_mulsub(zds+zn-(yn+1), yn+1,
- q,
- yds, yn);
- while (num) { /* "add back" required */
- q--;
- num = bary_add(zds+zn-(yn+1), yn,
- zds+zn-(yn+1), yn,
- yds, yn);
- num--;
- }
- }
- zn--;
- zds[zn] = q;
- } while (zn > yn);
- return 0;
-}
-
-static void
-rb_big_stop(void *ptr)
-{
- struct big_div_struct *bds = ptr;
- bds->stop = Qtrue;
-}
-
-static BDIGIT
-bigdivrem_single1(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT x_higher_bdigit, BDIGIT y)
-{
- assert(0 < xn);
- assert(x_higher_bdigit < y);
- if (POW2_P(y)) {
- BDIGIT r;
- r = xds[0] & (y-1);
- bary_small_rshift(qds, xds, xn, bit_length(y)-1, x_higher_bdigit);
- return r;
- }
- else {
- size_t i;
- BDIGIT_DBL t2;
- t2 = x_higher_bdigit;
- i = xn;
- while (i--) {
- t2 = BIGUP(t2) + xds[i];
- qds[i] = (BDIGIT)(t2 / y);
- t2 %= y;
- }
- return (BDIGIT)t2;
- }
-}
-
-static BDIGIT
-bigdivrem_single(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT y)
-{
- return bigdivrem_single1(qds, xds, xn, 0, y);
-}
-
-static void
-bigdivrem_restoring(BDIGIT *zds, size_t zn, BDIGIT *yds, size_t yn)
-{
- struct big_div_struct bds;
- size_t ynzero;
-
- assert(yn < zn);
- assert(BDIGIT_MSB(yds[yn-1]));
- assert(zds[zn-1] < yds[yn-1]);
-
- for (ynzero = 0; !yds[ynzero]; ynzero++);
-
- if (ynzero+1 == yn) {
- BDIGIT r;
- r = bigdivrem_single1(zds+yn, zds+ynzero, zn-yn, zds[zn-1], yds[ynzero]);
- zds[ynzero] = r;
- return;
- }
-
- bds.yn = yn - ynzero;
- bds.zds = zds + ynzero;
- bds.yds = yds + ynzero;
- bds.stop = Qfalse;
- bds.zn = zn - ynzero;
- if (bds.zn > 10000 || bds.yn > 10000) {
- retry:
- bds.stop = Qfalse;
- rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds);
-
- if (bds.stop == Qtrue) {
- /* execute trap handler, but exception was not raised. */
- goto retry;
- }
- }
- else {
- bigdivrem1(&bds);
- }
-}
-
-static void
-bary_divmod_normal(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- int shift;
- BDIGIT *zds, *yyds;
- size_t zn;
- VALUE tmpyz = 0;
-
- assert(yn < xn || (xn == yn && yds[yn - 1] <= xds[xn - 1]));
- assert(qds ? (xn - yn + 1) <= qn : 1);
- assert(rds ? yn <= rn : 1);
-
- zn = xn + BIGDIVREM_EXTRA_WORDS;
-
- shift = nlz(yds[yn-1]);
- if (shift) {
- int alloc_y = !rds;
- int alloc_z = !qds || qn < zn;
- if (alloc_y && alloc_z) {
- yyds = ALLOCV_N(BDIGIT, tmpyz, yn+zn);
- zds = yyds + yn;
- }
- else {
- yyds = alloc_y ? ALLOCV_N(BDIGIT, tmpyz, yn) : rds;
- zds = alloc_z ? ALLOCV_N(BDIGIT, tmpyz, zn) : qds;
- }
- zds[xn] = bary_small_lshift(zds, xds, xn, shift);
- bary_small_lshift(yyds, yds, yn, shift);
- }
- else {
- if (qds && zn <= qn)
- zds = qds;
- else
- zds = ALLOCV_N(BDIGIT, tmpyz, zn);
- MEMCPY(zds, xds, BDIGIT, xn);
- zds[xn] = 0;
- /* bigdivrem_restoring will not modify y.
- * So use yds directly. */
- yyds = (BDIGIT *)yds;
- }
-
- bigdivrem_restoring(zds, zn, yyds, yn);
-
- if (rds) {
- if (shift)
- bary_small_rshift(rds, zds, yn, shift, 0);
- else
- MEMCPY(rds, zds, BDIGIT, yn);
- BDIGITS_ZERO(rds+yn, rn-yn);
- }
-
- if (qds) {
- size_t j = zn - yn;
- MEMMOVE(qds, zds+yn, BDIGIT, j);
- BDIGITS_ZERO(qds+j, qn-j);
- }
-
- if (tmpyz)
- ALLOCV_END(tmpyz);
-}
-
-VALUE
-rb_big_divrem_normal(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), qn, rn;
- BDIGIT *xds = BDIGITS(x), *yds = BDIGITS(y), *qds, *rds;
- VALUE q, r;
-
- BARY_TRUNC(yds, yn);
- if (yn == 0)
- rb_num_zerodiv();
- BARY_TRUNC(xds, xn);
-
- if (xn < yn || (xn == yn && xds[xn - 1] < yds[yn - 1]))
- return rb_assoc_new(LONG2FIX(0), x);
-
- qn = xn + BIGDIVREM_EXTRA_WORDS;
- q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- qds = BDIGITS(q);
-
- rn = yn;
- r = bignew(rn, BIGNUM_SIGN(x));
- rds = BDIGITS(r);
-
- bary_divmod_normal(qds, qn, rds, rn, xds, xn, yds, yn);
-
- bigtrunc(q);
- bigtrunc(r);
-
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
-
- return rb_assoc_new(q, r);
-}
-
-#ifdef USE_GMP
-static void
-bary_divmod_gmp(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
- mpz_t x, y, q, r;
- size_t count;
-
- assert(yn < xn || (xn == yn && yds[yn - 1] <= xds[xn - 1]));
- assert(qds ? (xn - yn + 1) <= qn : 1);
- assert(rds ? yn <= rn : 1);
- assert(qds || rds);
-
- mpz_init(x);
- mpz_init(y);
- if (qds) mpz_init(q);
- if (rds) mpz_init(r);
-
- mpz_import(x, xn, -1, sizeof(BDIGIT), 0, nails, xds);
- mpz_import(y, yn, -1, sizeof(BDIGIT), 0, nails, yds);
-
- if (!rds) {
- mpz_fdiv_q(q, x, y);
- }
- else if (!qds) {
- mpz_fdiv_r(r, x, y);
- }
- else {
- mpz_fdiv_qr(q, r, x, y);
- }
-
- mpz_clear(x);
- mpz_clear(y);
-
- if (qds) {
- mpz_export(qds, &count, -1, sizeof(BDIGIT), 0, nails, q);
- BDIGITS_ZERO(qds+count, qn-count);
- mpz_clear(q);
- }
-
- if (rds) {
- mpz_export(rds, &count, -1, sizeof(BDIGIT), 0, nails, r);
- BDIGITS_ZERO(rds+count, rn-count);
- mpz_clear(r);
- }
-}
-
-VALUE
-rb_big_divrem_gmp(VALUE x, VALUE y)
-{
- size_t xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y), qn, rn;
- BDIGIT *xds = BDIGITS(x), *yds = BDIGITS(y), *qds, *rds;
- VALUE q, r;
-
- BARY_TRUNC(yds, yn);
- if (yn == 0)
- rb_num_zerodiv();
- BARY_TRUNC(xds, xn);
-
- if (xn < yn || (xn == yn && xds[xn - 1] < yds[yn - 1]))
- return rb_assoc_new(LONG2FIX(0), x);
-
- qn = xn - yn + 1;
- q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- qds = BDIGITS(q);
-
- rn = yn;
- r = bignew(rn, BIGNUM_SIGN(x));
- rds = BDIGITS(r);
-
- bary_divmod_gmp(qds, qn, rds, rn, xds, xn, yds, yn);
-
- bigtrunc(q);
- bigtrunc(r);
-
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
-
- return rb_assoc_new(q, r);
-}
-#endif
-
-static void
-bary_divmod_branch(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
-#ifdef USE_GMP
- if (GMP_DIV_DIGITS < xn) {
- bary_divmod_gmp(qds, qn, rds, rn, xds, xn, yds, yn);
- return;
- }
-#endif
- bary_divmod_normal(qds, qn, rds, rn, xds, xn, yds, yn);
-}
-
-static void
-bary_divmod(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
-{
- assert(xn <= qn);
- assert(yn <= rn);
-
- BARY_TRUNC(yds, yn);
- if (yn == 0)
- rb_num_zerodiv();
-
- BARY_TRUNC(xds, xn);
- if (xn == 0) {
- BDIGITS_ZERO(qds, qn);
- BDIGITS_ZERO(rds, rn);
- return;
- }
-
- if (xn < yn || (xn == yn && xds[xn - 1] < yds[yn - 1])) {
- MEMCPY(rds, xds, BDIGIT, xn);
- BDIGITS_ZERO(rds+xn, rn-xn);
- BDIGITS_ZERO(qds, qn);
- }
- else if (yn == 1) {
- MEMCPY(qds, xds, BDIGIT, xn);
- BDIGITS_ZERO(qds+xn, qn-xn);
- rds[0] = bigdivrem_single(qds, xds, xn, yds[0]);
- BDIGITS_ZERO(rds+1, rn-1);
- }
- else if (xn == 2 && yn == 2) {
- BDIGIT_DBL x = bary2bdigitdbl(xds, 2);
- BDIGIT_DBL y = bary2bdigitdbl(yds, 2);
- BDIGIT_DBL q = x / y;
- BDIGIT_DBL r = x % y;
- qds[0] = BIGLO(q);
- qds[1] = BIGLO(BIGDN(q));
- BDIGITS_ZERO(qds+2, qn-2);
- rds[0] = BIGLO(r);
- rds[1] = BIGLO(BIGDN(r));
- BDIGITS_ZERO(rds+2, rn-2);
- }
- else {
- bary_divmod_branch(qds, qn, rds, rn, xds, xn, yds, yn);
- }
-}
-
+ (RBIGNUM_LEN(x) == 1 || bigzero_p(x))))
#define BIGNUM_DEBUG 0
#if BIGNUM_DEBUG
@@ -2873,11 +57,11 @@ static void
dump_bignum(VALUE x)
{
long i;
- printf("%c0x0", BIGNUM_SIGN(x) ? '+' : '-');
- for (i = BIGNUM_LEN(x); i--; ) {
- printf("_%0*"PRIxBDIGIT, SIZEOF_BDIGIT*2, BDIGITS(x)[i]);
+ printf("%c0x0", RBIGNUM_SIGN(x) ? '+' : '-');
+ for (i = RBIGNUM_LEN(x); i--; ) {
+ printf("_%08"PRIxBDIGIT, BDIGITS(x)[i]);
}
- printf(", len=%"PRIuSIZE, BIGNUM_LEN(x));
+ printf(", len=%lu", RBIGNUM_LEN(x));
puts("");
}
@@ -2894,7 +78,13 @@ rb_big_dump(VALUE x)
static int
bigzero_p(VALUE x)
{
- return bary_zero_p(BDIGITS(x), BIGNUM_LEN(x));
+ long i;
+ BDIGIT *ds = BDIGITS(x);
+
+ for (i = RBIGNUM_LEN(x) - 1; 0 <= i; i--) {
+ if (ds[i]) return 0;
+ }
+ return 1;
}
int
@@ -2915,9 +105,9 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
if (l < 0) return -1;
return 0;
}
- if (RB_BIGNUM_TYPE_P(val)) {
+ if (RB_TYPE_P(val, T_BIGNUM)) {
if (BIGZEROP(val)) return 0;
- if (BIGNUM_SIGN(val)) return 1;
+ if (RBIGNUM_SIGN(val)) return 1;
return -1;
}
if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
@@ -2925,39 +115,38 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
return 0;
}
-#define BIGNUM_SET_LEN(b,l) \
- ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
+#define RBIGNUM_SET_LEN(b,l) \
+ ((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
(void)(RBASIC(b)->flags = \
- (RBASIC(b)->flags & ~BIGNUM_EMBED_LEN_MASK) | \
- ((l) << BIGNUM_EMBED_LEN_SHIFT)) : \
+ (RBASIC(b)->flags & ~RBIGNUM_EMBED_LEN_MASK) | \
+ ((l) << RBIGNUM_EMBED_LEN_SHIFT)) : \
(void)(RBIGNUM(b)->as.heap.len = (l)))
static void
-rb_big_realloc(VALUE big, size_t len)
+rb_big_realloc(VALUE big, long len)
{
BDIGIT *ds;
- if (RBASIC(big)->flags & BIGNUM_EMBED_FLAG) {
- if (BIGNUM_EMBED_LEN_MAX < len) {
+ if (RBASIC(big)->flags & RBIGNUM_EMBED_FLAG) {
+ if (RBIGNUM_EMBED_LEN_MAX < len) {
ds = ALLOC_N(BDIGIT, len);
- MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, BIGNUM_EMBED_LEN_MAX);
- RBIGNUM(big)->as.heap.len = BIGNUM_LEN(big);
+ MEMCPY(ds, RBIGNUM(big)->as.ary, BDIGIT, RBIGNUM_EMBED_LEN_MAX);
+ RBIGNUM(big)->as.heap.len = RBIGNUM_LEN(big);
RBIGNUM(big)->as.heap.digits = ds;
- RBASIC(big)->flags &= ~BIGNUM_EMBED_FLAG;
+ RBASIC(big)->flags &= ~RBIGNUM_EMBED_FLAG;
}
}
else {
- if (len <= BIGNUM_EMBED_LEN_MAX) {
+ if (len <= RBIGNUM_EMBED_LEN_MAX) {
ds = RBIGNUM(big)->as.heap.digits;
- RBASIC(big)->flags |= BIGNUM_EMBED_FLAG;
- BIGNUM_SET_LEN(big, len);
- (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)RBIGNUM(big)->as.ary, sizeof(RBIGNUM(big)->as.ary));
+ RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
+ RBIGNUM_SET_LEN(big, len);
if (ds) {
MEMCPY(RBIGNUM(big)->as.ary, ds, BDIGIT, len);
xfree(ds);
}
}
else {
- if (BIGNUM_LEN(big) == 0) {
+ if (RBIGNUM_LEN(big) == 0) {
RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
}
else {
@@ -2968,21 +157,20 @@ rb_big_realloc(VALUE big, size_t len)
}
void
-rb_big_resize(VALUE big, size_t len)
+rb_big_resize(VALUE big, long len)
{
rb_big_realloc(big, len);
- BIGNUM_SET_LEN(big, len);
+ RBIGNUM_SET_LEN(big, len);
}
static VALUE
-bignew_1(VALUE klass, size_t len, int sign)
+bignew_1(VALUE klass, long len, int sign)
{
- NEWOBJ_OF(big, struct RBignum, klass, T_BIGNUM | (RGENGC_WB_PROTECTED_BIGNUM ? FL_WB_PROTECTED : 0));
- BIGNUM_SET_SIGN(big, sign?1:0);
- if (len <= BIGNUM_EMBED_LEN_MAX) {
- RBASIC(big)->flags |= BIGNUM_EMBED_FLAG;
- BIGNUM_SET_LEN(big, len);
- (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)RBIGNUM(big)->as.ary, sizeof(RBIGNUM(big)->as.ary));
+ NEWOBJ_OF(big, struct RBignum, klass, T_BIGNUM);
+ RBIGNUM_SET_SIGN(big, sign?1:0);
+ if (len <= RBIGNUM_EMBED_LEN_MAX) {
+ RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
+ RBIGNUM_SET_LEN(big, len);
}
else {
RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
@@ -2992,8 +180,10 @@ bignew_1(VALUE klass, size_t len, int sign)
return (VALUE)big;
}
+#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
+
VALUE
-rb_big_new(size_t len, int sign)
+rb_big_new(long len, int sign)
{
return bignew(len, sign != 0);
}
@@ -3001,29 +191,33 @@ rb_big_new(size_t len, int sign)
VALUE
rb_big_clone(VALUE x)
{
- size_t len = BIGNUM_LEN(x);
- VALUE z = bignew_1(CLASS_OF(x), len, BIGNUM_SIGN(x));
+ long len = RBIGNUM_LEN(x);
+ VALUE z = bignew_1(CLASS_OF(x), len, RBIGNUM_SIGN(x));
MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, len);
return z;
}
-static void
-big_extend_carry(VALUE x)
-{
- rb_big_resize(x, BIGNUM_LEN(x)+1);
- BDIGITS(x)[BIGNUM_LEN(x)-1] = 1;
-}
-
/* modify a bignum by 2's complement */
static void
get2comp(VALUE x)
{
- long i = BIGNUM_LEN(x);
+ long i = RBIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
+ BDIGIT_DBL num;
- if (bary_2comp(ds, i)) {
- big_extend_carry(x);
+ if (!i) return;
+ while (i--) ds[i] = ~ds[i];
+ i = 0; num = 1;
+ do {
+ num += ds[i];
+ ds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ } while (i < RBIGNUM_LEN(x));
+ if (num != 0) {
+ rb_big_resize(x, RBIGNUM_LEN(x)+1);
+ ds = BDIGITS(x);
+ ds[RBIGNUM_LEN(x)-1] = 1;
}
}
@@ -3033,45 +227,15 @@ rb_big_2comp(VALUE x) /* get 2's complement */
get2comp(x);
}
-static BDIGIT
-abs2twocomp(VALUE *xp, long *n_ret)
-{
- VALUE x = *xp;
- long n = BIGNUM_LEN(x);
- BDIGIT *ds = BDIGITS(x);
- BDIGIT hibits = 0;
-
- BARY_TRUNC(ds, n);
-
- if (n != 0 && BIGNUM_NEGATIVE_P(x)) {
- VALUE z = bignew_1(CLASS_OF(x), n, 0);
- MEMCPY(BDIGITS(z), ds, BDIGIT, n);
- bary_2comp(BDIGITS(z), n);
- hibits = BDIGMAX;
- *xp = z;
- }
- *n_ret = n;
- return hibits;
-}
-
-static void
-twocomp2abs_bang(VALUE x, int hibits)
-{
- BIGNUM_SET_SIGN(x, !hibits);
- if (hibits) {
- get2comp(x);
- }
-}
-
static inline VALUE
bigtrunc(VALUE x)
{
- size_t len = BIGNUM_LEN(x);
+ long len = RBIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
if (len == 0) return x;
while (--len && !ds[len]);
- if (BIGNUM_LEN(x) > len+1) {
+ if (RBIGNUM_LEN(x) > len+1) {
rb_big_resize(x, len+1);
}
return x;
@@ -3080,52 +244,36 @@ bigtrunc(VALUE x)
static inline VALUE
bigfixize(VALUE x)
{
- size_t n = BIGNUM_LEN(x);
+ long len = RBIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- unsigned long u;
-#else
- BDIGIT u;
-#endif
-
- BARY_TRUNC(ds, n);
- if (n == 0) return INT2FIX(0);
-
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (sizeof(long)/SIZEOF_BDIGIT < n)
- goto return_big;
- else {
- int i = (int)n;
- u = 0;
- while (i--) {
- u = (unsigned long)(BIGUP(u) + ds[i]);
- }
- }
-#else /* SIZEOF_BDIGIT >= SIZEOF_LONG */
- if (1 < n)
- goto return_big;
- else
- u = ds[0];
+ if (len == 0) return INT2FIX(0);
+ if ((size_t)(len*SIZEOF_BDIGITS) <= sizeof(long)) {
+ long num = 0;
+#if 2*SIZEOF_BDIGITS > SIZEOF_LONG
+ num = (long)ds[0];
+#else
+ while (len--) {
+ num = (long)(BIGUP(num) + ds[len]);
+ }
#endif
-
- if (BIGNUM_POSITIVE_P(x)) {
- if (POSFIXABLE(u)) return LONG2FIX((long)u);
- }
- else {
- if (u <= -FIXNUM_MIN) return LONG2FIX(-(long)u);
+ if (num >= 0) {
+ if (RBIGNUM_SIGN(x)) {
+ if (POSFIXABLE(num)) return LONG2FIX(num);
+ }
+ else {
+ if (NEGFIXABLE(-num)) return LONG2FIX(-num);
+ }
+ }
}
-
- return_big:
- rb_big_resize(x, n);
return x;
}
static VALUE
bignorm(VALUE x)
{
- if (RB_BIGNUM_TYPE_P(x)) {
- x = bigfixize(x);
+ if (RB_TYPE_P(x, T_BIGNUM)) {
+ x = bigfixize(bigtrunc(x));
}
return x;
}
@@ -3139,22 +287,21 @@ rb_big_norm(VALUE x)
VALUE
rb_uint2big(VALUE n)
{
- long i;
- VALUE big = bignew(bdigit_roomof(SIZEOF_VALUE), 1);
- BDIGIT *digits = BDIGITS(big);
+ BDIGIT_DBL num = n;
+ long i = 0;
+ BDIGIT *digits;
+ VALUE big;
-#if SIZEOF_BDIGIT >= SIZEOF_VALUE
- digits[0] = n;
-#else
- for (i = 0; i < bdigit_roomof(SIZEOF_VALUE); i++) {
- digits[i] = BIGLO(n);
- n = BIGDN(n);
+ big = bignew(DIGSPERLONG, 1);
+ digits = BDIGITS(big);
+ while (i < DIGSPERLONG) {
+ digits[i++] = BIGLO(num);
+ num = BIGDN(num);
}
-#endif
- i = bdigit_roomof(SIZEOF_VALUE);
+ i = DIGSPERLONG;
while (--i && !digits[i]) ;
- BIGNUM_SET_LEN(big, i+1);
+ RBIGNUM_SET_LEN(big, i+1);
return big;
}
@@ -3162,19 +309,15 @@ VALUE
rb_int2big(SIGNED_VALUE n)
{
long neg = 0;
- VALUE u;
VALUE big;
if (n < 0) {
- u = 1 + (VALUE)(-(n + 1)); /* u = -n avoiding overflow */
+ n = -n;
neg = 1;
}
- else {
- u = n;
- }
- big = rb_uint2big(u);
+ big = rb_uint2big(n);
if (neg) {
- BIGNUM_SET_SIGN(big, 0);
+ RBIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -3193,788 +336,265 @@ rb_int2inum(SIGNED_VALUE n)
return rb_int2big(n);
}
-void
-rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
-{
- rb_integer_pack(val, buf, num_longs, sizeof(long), 0,
- INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP);
-}
-
-VALUE
-rb_big_unpack(unsigned long *buf, long num_longs)
-{
- return rb_integer_unpack(buf, num_longs, sizeof(long), 0,
- INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP);
-}
+#if SIZEOF_LONG % SIZEOF_BDIGITS != 0
+# error unexpected SIZEOF_LONG : SIZEOF_BDIGITS ratio
+#endif
/*
- * Calculate the number of bytes to be required to represent
- * the absolute value of the integer given as _val_.
- *
- * [val] an integer.
- * [nlz_bits_ret] number of leading zero bits in the most significant byte is returned if not NULL.
- *
- * This function returns ((val_numbits * CHAR_BIT + CHAR_BIT - 1) / CHAR_BIT)
- * where val_numbits is the number of bits of abs(val).
- * This function should not overflow.
- *
- * If nlz_bits_ret is not NULL,
- * (return_value * CHAR_BIT - val_numbits) is stored in *nlz_bits_ret.
- * In this case, 0 <= *nlz_bits_ret < CHAR_BIT.
- *
+ * buf is an array of long integers.
+ * buf is ordered from least significant word to most significant word.
+ * buf[0] is the least significant word and
+ * buf[num_longs-1] is the most significant word.
+ * This means words in buf is little endian.
+ * However each word in buf is native endian.
+ * (buf[i]&1) is the least significant bit and
+ * (buf[i]&(1<<(SIZEOF_LONG*CHAR_BIT-1))) is the most significant bit
+ * for each 0 <= i < num_longs.
+ * So buf is little endian at whole on a little endian machine.
+ * But buf is mixed endian on a big endian machine.
+ *
+ * The buf represents negative integers as two's complement.
+ * So, the most significant bit of the most significant word,
+ * (buf[num_longs-1]>>(SIZEOF_LONG*CHAR_BIT-1)),
+ * is the sign bit: 1 means negative and 0 means zero or positive.
+ *
+ * If given size of buf (num_longs) is not enough to represent val,
+ * higier words (including a sign bit) are ignored.
*/
-size_t
-rb_absint_size(VALUE val, int *nlz_bits_ret)
+void
+rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
{
- BDIGIT *dp;
- BDIGIT *de;
- BDIGIT fixbuf[bdigit_roomof(sizeof(long))];
-
- int num_leading_zeros;
-
val = rb_to_int(val);
-
+ if (num_longs == 0)
+ return;
if (FIXNUM_P(val)) {
- long v = FIX2LONG(val);
- if (v < 0) {
- v = -v;
+ long i;
+ long tmp = FIX2LONG(val);
+ buf[0] = (unsigned long)tmp;
+ tmp = tmp < 0 ? ~0L : 0;
+ for (i = 1; i < num_longs; i++)
+ buf[i] = (unsigned long)tmp;
+ return;
+ }
+ else {
+ long len = RBIGNUM_LEN(val);
+ BDIGIT *ds = BDIGITS(val), *dend = ds + len;
+ long i, j;
+ for (i = 0; i < num_longs && ds < dend; i++) {
+ unsigned long l = 0;
+ for (j = 0; j < DIGSPERLONG && ds < dend; j++, ds++) {
+ l |= ((unsigned long)*ds << (j * BITSPERDIG));
+ }
+ buf[i] = l;
}
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
- fixbuf[0] = v;
-#else
- {
- int i;
- for (i = 0; i < numberof(fixbuf); i++) {
- fixbuf[i] = BIGLO(v);
- v = BIGDN(v);
+ for (; i < num_longs; i++)
+ buf[i] = 0;
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ for (i = 0; i < num_longs; i++) {
+ buf[i] = ~buf[i];
+ }
+ for (i = 0; i < num_longs; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return;
}
}
-#endif
- dp = fixbuf;
- de = fixbuf + numberof(fixbuf);
}
- else {
- dp = BDIGITS(val);
- de = dp + BIGNUM_LEN(val);
- }
- while (dp < de && de[-1] == 0)
- de--;
- if (dp == de) {
- if (nlz_bits_ret)
- *nlz_bits_ret = 0;
- return 0;
- }
- num_leading_zeros = nlz(de[-1]);
- if (nlz_bits_ret)
- *nlz_bits_ret = num_leading_zeros % CHAR_BIT;
- return (de - dp) * SIZEOF_BDIGIT - num_leading_zeros / CHAR_BIT;
-}
-
-static size_t
-absint_numwords_small(size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret)
-{
- size_t val_numbits = numbytes * CHAR_BIT - nlz_bits_in_msbyte;
- size_t div = val_numbits / word_numbits;
- size_t mod = val_numbits % word_numbits;
- size_t numwords;
- size_t nlz_bits;
- numwords = mod == 0 ? div : div + 1;
- nlz_bits = mod == 0 ? 0 : word_numbits - mod;
- *nlz_bits_ret = nlz_bits;
- return numwords;
}
-static size_t
-absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret)
+/* See rb_big_pack comment for endianness and sign of buf. */
+VALUE
+rb_big_unpack(unsigned long *buf, long num_longs)
{
- static const BDIGIT char_bit[1] = { CHAR_BIT };
- BDIGIT numbytes_bary[bdigit_roomof(sizeof(numbytes))];
- BDIGIT val_numbits_bary[bdigit_roomof(sizeof(numbytes) + 1)];
- BDIGIT nlz_bits_in_msbyte_bary[1];
- BDIGIT word_numbits_bary[bdigit_roomof(sizeof(word_numbits))];
- BDIGIT div_bary[numberof(val_numbits_bary) + BIGDIVREM_EXTRA_WORDS];
- BDIGIT mod_bary[numberof(word_numbits_bary)];
- BDIGIT one[1] = { 1 };
- size_t nlz_bits;
- size_t mod;
- int sign;
- size_t numwords;
-
- nlz_bits_in_msbyte_bary[0] = nlz_bits_in_msbyte;
-
- /*
- * val_numbits = numbytes * CHAR_BIT - nlz_bits_in_msbyte
- * div, mod = val_numbits.divmod(word_numbits)
- * numwords = mod == 0 ? div : div + 1
- * nlz_bits = mod == 0 ? 0 : word_numbits - mod
- */
-
- bary_unpack(BARY_ARGS(numbytes_bary), &numbytes, 1, sizeof(numbytes), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER);
- BARY_SHORT_MUL(val_numbits_bary, numbytes_bary, char_bit);
- if (nlz_bits_in_msbyte)
- BARY_SUB(val_numbits_bary, val_numbits_bary, nlz_bits_in_msbyte_bary);
- bary_unpack(BARY_ARGS(word_numbits_bary), &word_numbits, 1, sizeof(word_numbits), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER);
- BARY_DIVMOD(div_bary, mod_bary, val_numbits_bary, word_numbits_bary);
- if (BARY_ZERO_P(mod_bary)) {
- nlz_bits = 0;
- }
- else {
- BARY_ADD(div_bary, div_bary, one);
- bary_pack(+1, BARY_ARGS(mod_bary), &mod, 1, sizeof(mod), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER);
- nlz_bits = word_numbits - mod;
- }
- sign = bary_pack(+1, BARY_ARGS(div_bary), &numwords, 1, sizeof(numwords), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER);
-
- if (sign == 2) {
-#if defined __GNUC__ && (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
- *nlz_bits_ret = 0;
-#endif
- return (size_t)-1;
- }
- *nlz_bits_ret = nlz_bits;
- return numwords;
-}
-
-/*
- * Calculate the number of words to be required to represent
- * the absolute value of the integer given as _val_.
- *
- * [val] an integer.
- * [word_numbits] number of bits in a word.
- * [nlz_bits_ret] number of leading zero bits in the most significant word is returned if not NULL.
- *
- * This function returns ((val_numbits * CHAR_BIT + word_numbits - 1) / word_numbits)
- * where val_numbits is the number of bits of abs(val).
- *
- * This function can overflow.
- * When overflow occur, (size_t)-1 is returned.
- *
- * If nlz_bits_ret is not NULL and overflow is not occur,
- * (return_value * word_numbits - val_numbits) is stored in *nlz_bits_ret.
- * In this case, 0 <= *nlz_bits_ret < word_numbits.
- *
- */
-size_t
-rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret)
-{
- size_t numbytes;
- int nlz_bits_in_msbyte;
- size_t numwords;
- size_t nlz_bits;
-
- if (word_numbits == 0)
- return (size_t)-1;
-
- numbytes = rb_absint_size(val, &nlz_bits_in_msbyte);
-
- if (numbytes <= SIZE_MAX / CHAR_BIT) {
- numwords = absint_numwords_small(numbytes, nlz_bits_in_msbyte, word_numbits, &nlz_bits);
-#ifdef DEBUG_INTEGER_PACK
- {
- size_t numwords0, nlz_bits0;
- numwords0 = absint_numwords_generic(numbytes, nlz_bits_in_msbyte, word_numbits, &nlz_bits0);
- assert(numwords0 == numwords);
- assert(nlz_bits0 == nlz_bits);
- }
-#endif
- }
- else {
- numwords = absint_numwords_generic(numbytes, nlz_bits_in_msbyte, word_numbits, &nlz_bits);
+ while (2 <= num_longs) {
+ if (buf[num_longs-1] == 0 && (long)buf[num_longs-2] >= 0)
+ num_longs--;
+ else if (buf[num_longs-1] == ~0UL && (long)buf[num_longs-2] < 0)
+ num_longs--;
+ else
+ break;
}
- if (numwords == (size_t)-1)
- return numwords;
-
- if (nlz_bits_ret)
- *nlz_bits_ret = nlz_bits;
-
- return numwords;
-}
-
-/* Test abs(val) consists only a bit or not.
- *
- * Returns 1 if abs(val) == 1 << n for some n >= 0.
- * Returns 0 otherwise.
- *
- * rb_absint_singlebit_p can be used to determine required buffer size
- * for rb_integer_pack used with INTEGER_PACK_2COMP (two's complement).
- *
- * Following example calculates number of bits required to
- * represent val in two's complement number, without sign bit.
- *
- * size_t size;
- * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
- * size = rb_absint_numwords(val, 1, NULL)
- * if (size == (size_t)-1) ...overflow...
- * if (neg && rb_absint_singlebit_p(val))
- * size--;
- *
- * Following example calculates number of bytes required to
- * represent val in two's complement number, with sign bit.
- *
- * size_t size;
- * int neg = FIXNUM_P(val) ? FIX2LONG(val) < 0 : BIGNUM_NEGATIVE_P(val);
- * int nlz_bits;
- * size = rb_absint_size(val, &nlz_bits);
- * if (nlz_bits == 0 && !(neg && rb_absint_singlebit_p(val)))
- * size++;
- */
-int
-rb_absint_singlebit_p(VALUE val)
-{
- BDIGIT *dp;
- BDIGIT *de;
- BDIGIT fixbuf[bdigit_roomof(sizeof(long))];
- BDIGIT d;
-
- val = rb_to_int(val);
-
- if (FIXNUM_P(val)) {
- long v = FIX2LONG(val);
- if (v < 0) {
- v = -v;
- }
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
- fixbuf[0] = v;
+ if (num_longs == 0)
+ return INT2FIX(0);
+ else if (num_longs == 1)
+ return LONG2NUM((long)buf[0]);
+ else {
+ VALUE big;
+ BDIGIT *ds;
+ long len = num_longs * DIGSPERLONG;
+ long i;
+ big = bignew(len, 1);
+ ds = BDIGITS(big);
+ for (i = 0; i < num_longs; i++) {
+ unsigned long d = buf[i];
+#if SIZEOF_LONG == SIZEOF_BDIGITS
+ *ds++ = d;
#else
- {
- int i;
- for (i = 0; i < numberof(fixbuf); i++) {
- fixbuf[i] = BIGLO(v);
- v = BIGDN(v);
+ int j;
+ for (j = 0; j < DIGSPERLONG; j++) {
+ *ds++ = BIGLO(d);
+ d = BIGDN(d);
}
- }
#endif
- dp = fixbuf;
- de = fixbuf + numberof(fixbuf);
+ }
+ if ((long)buf[num_longs-1] < 0) {
+ get2comp(big);
+ RBIGNUM_SET_SIGN(big, 0);
+ }
+ return bignorm(big);
}
- else {
- dp = BDIGITS(val);
- de = dp + BIGNUM_LEN(val);
- }
- while (dp < de && de[-1] == 0)
- de--;
- while (dp < de && dp[0] == 0)
- dp++;
- if (dp == de) /* no bit set. */
- return 0;
- if (dp != de-1) /* two non-zero words. two bits set, at least. */
- return 0;
- d = *dp;
- return POW2_P(d);
}
+#define QUAD_SIZE 8
-/*
- * Export an integer into a buffer.
- *
- * This function fills the buffer specified by _words_ and _numwords_ as
- * val in the format specified by _wordsize_, _nails_ and _flags_.
- *
- * [val] Fixnum, Bignum or another integer like object which has to_int method.
- * [words] buffer to export abs(val).
- * [numwords] the size of given buffer as number of words.
- * [wordsize] the size of word as number of bytes.
- * [nails] number of padding bits in a word.
- * Most significant nails bits of each word are filled by zero.
- * [flags] bitwise or of constants which name starts "INTEGER_PACK_".
- *
- * flags:
- * [INTEGER_PACK_MSWORD_FIRST] Store the most significant word as the first word.
- * [INTEGER_PACK_LSWORD_FIRST] Store the least significant word as the first word.
- * [INTEGER_PACK_MSBYTE_FIRST] Store the most significant byte in a word as the first byte in the word.
- * [INTEGER_PACK_LSBYTE_FIRST] Store the least significant byte in a word as the first byte in the word.
- * [INTEGER_PACK_NATIVE_BYTE_ORDER] INTEGER_PACK_MSBYTE_FIRST or INTEGER_PACK_LSBYTE_FIRST corresponding to the host's endian.
- * [INTEGER_PACK_2COMP] Use 2's complement representation.
- * [INTEGER_PACK_LITTLE_ENDIAN] Same as INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_LSBYTE_FIRST
- * [INTEGER_PACK_BIG_ENDIAN] Same as INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_MSBYTE_FIRST
- * [INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION] Use generic implementation (for test and debug).
- *
- * This function fills the buffer specified by _words_
- * as abs(val) if INTEGER_PACK_2COMP is not specified in _flags_.
- * If INTEGER_PACK_2COMP is specified, 2's complement representation of val is
- * filled in the buffer.
- *
- * This function returns the signedness and overflow condition.
- * The overflow condition depends on INTEGER_PACK_2COMP.
- *
- * INTEGER_PACK_2COMP is not specified:
- * -2 : negative overflow. val <= -2**(numwords*(wordsize*CHAR_BIT-nails))
- * -1 : negative without overflow. -2**(numwords*(wordsize*CHAR_BIT-nails)) < val < 0
- * 0 : zero. val == 0
- * 1 : positive without overflow. 0 < val < 2**(numwords*(wordsize*CHAR_BIT-nails))
- * 2 : positive overflow. 2**(numwords*(wordsize*CHAR_BIT-nails)) <= val
- *
- * INTEGER_PACK_2COMP is specified:
- * -2 : negative overflow. val < -2**(numwords*(wordsize*CHAR_BIT-nails))
- * -1 : negative without overflow. -2**(numwords*(wordsize*CHAR_BIT-nails)) <= val < 0
- * 0 : zero. val == 0
- * 1 : positive without overflow. 0 < val < 2**(numwords*(wordsize*CHAR_BIT-nails))
- * 2 : positive overflow. 2**(numwords*(wordsize*CHAR_BIT-nails)) <= val
- *
- * The value, -2**(numwords*(wordsize*CHAR_BIT-nails)), is representable
- * in 2's complement representation but not representable in absolute value.
- * So -1 is returned for the value if INTEGER_PACK_2COMP is specified
- * but returns -2 if INTEGER_PACK_2COMP is not specified.
- *
- * The least significant words are filled in the buffer when overflow occur.
- */
+#if SIZEOF_LONG_LONG == QUAD_SIZE && SIZEOF_BDIGITS*2 == SIZEOF_LONG_LONG
-int
-rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
+void
+rb_quad_pack(char *buf, VALUE val)
{
- int sign;
- BDIGIT *ds;
- size_t num_bdigits;
- BDIGIT fixbuf[bdigit_roomof(sizeof(long))];
-
- RB_GC_GUARD(val) = rb_to_int(val);
+ LONG_LONG q;
+ val = rb_to_int(val);
if (FIXNUM_P(val)) {
- long v = FIX2LONG(val);
- if (v < 0) {
- sign = -1;
- v = -v;
- }
- else {
- sign = 1;
- }
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
- fixbuf[0] = v;
-#else
- {
- int i;
- for (i = 0; i < numberof(fixbuf); i++) {
- fixbuf[i] = BIGLO(v);
- v = BIGDN(v);
- }
- }
-#endif
- ds = fixbuf;
- num_bdigits = numberof(fixbuf);
+ q = FIX2LONG(val);
}
else {
- sign = BIGNUM_POSITIVE_P(val) ? 1 : -1;
- ds = BDIGITS(val);
- num_bdigits = BIGNUM_LEN(val);
- }
+ long len = RBIGNUM_LEN(val);
+ BDIGIT *ds;
- return bary_pack(sign, ds, num_bdigits, words, numwords, wordsize, nails, flags);
+ if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS) {
+ len = SIZEOF_LONG_LONG/SIZEOF_BDIGITS;
+ }
+ ds = BDIGITS(val);
+ q = 0;
+ while (len--) {
+ q = BIGUP(q);
+ q += ds[len];
+ }
+ if (!RBIGNUM_SIGN(val)) q = -q;
+ }
+ memcpy(buf, (char*)&q, SIZEOF_LONG_LONG);
}
-/*
- * Import an integer into a buffer.
- *
- * [words] buffer to import.
- * [numwords] the size of given buffer as number of words.
- * [wordsize] the size of word as number of bytes.
- * [nails] number of padding bits in a word.
- * Most significant nails bits of each word are ignored.
- * [flags] bitwise or of constants which name starts "INTEGER_PACK_".
- *
- * flags:
- * [INTEGER_PACK_MSWORD_FIRST] Interpret the first word as the most significant word.
- * [INTEGER_PACK_LSWORD_FIRST] Interpret the first word as the least significant word.
- * [INTEGER_PACK_MSBYTE_FIRST] Interpret the first byte in a word as the most significant byte in the word.
- * [INTEGER_PACK_LSBYTE_FIRST] Interpret the first byte in a word as the least significant byte in the word.
- * [INTEGER_PACK_NATIVE_BYTE_ORDER] INTEGER_PACK_MSBYTE_FIRST or INTEGER_PACK_LSBYTE_FIRST corresponding to the host's endian.
- * [INTEGER_PACK_2COMP] Use 2's complement representation.
- * [INTEGER_PACK_LITTLE_ENDIAN] Same as INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_LSBYTE_FIRST
- * [INTEGER_PACK_BIG_ENDIAN] Same as INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_MSBYTE_FIRST
- * [INTEGER_PACK_FORCE_BIGNUM] the result will be a Bignum
- * even if it is representable as a Fixnum.
- * [INTEGER_PACK_NEGATIVE] Returns non-positive value.
- * (Returns non-negative value if not specified.)
- * [INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION] Use generic implementation (for test and debug).
- *
- * This function returns the imported integer as Fixnum or Bignum.
- *
- * The range of the result value depends on INTEGER_PACK_2COMP and INTEGER_PACK_NEGATIVE.
- *
- * INTEGER_PACK_2COMP is not set:
- * 0 <= val < 2**(numwords*(wordsize*CHAR_BIT-nails)) if !INTEGER_PACK_NEGATIVE
- * -2**(numwords*(wordsize*CHAR_BIT-nails)) < val <= 0 if INTEGER_PACK_NEGATIVE
- *
- * INTEGER_PACK_2COMP is set:
- * -2**(numwords*(wordsize*CHAR_BIT-nails)-1) <= val <= 2**(numwords*(wordsize*CHAR_BIT-nails)-1)-1 if !INTEGER_PACK_NEGATIVE
- * -2**(numwords*(wordsize*CHAR_BIT-nails)) <= val <= -1 if INTEGER_PACK_NEGATIVE
- *
- * INTEGER_PACK_2COMP without INTEGER_PACK_NEGATIVE means sign extension.
- * INTEGER_PACK_2COMP with INTEGER_PACK_NEGATIVE mean assuming the higher bits are 1.
- *
- * Note that this function returns 0 when numwords is zero and
- * INTEGER_PACK_2COMP is set but INTEGER_PACK_NEGATIVE is not set.
- */
-
VALUE
-rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
+rb_quad_unpack(const char *buf, int sign)
{
- VALUE val;
- size_t num_bdigits;
- int sign;
- int nlp_bits;
- BDIGIT *ds;
- BDIGIT fixbuf[2] = { 0, 0 };
-
- validate_integer_pack_format(numwords, wordsize, nails, flags,
- INTEGER_PACK_MSWORD_FIRST|
- INTEGER_PACK_LSWORD_FIRST|
- INTEGER_PACK_MSBYTE_FIRST|
- INTEGER_PACK_LSBYTE_FIRST|
- INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP|
- INTEGER_PACK_FORCE_BIGNUM|
- INTEGER_PACK_NEGATIVE|
- INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION);
-
- num_bdigits = integer_unpack_num_bdigits(numwords, wordsize, nails, &nlp_bits);
-
- if (LONG_MAX-1 < num_bdigits)
- rb_raise(rb_eArgError, "too big to unpack as an integer");
- if (num_bdigits <= numberof(fixbuf) && !(flags & INTEGER_PACK_FORCE_BIGNUM)) {
- val = Qfalse;
- ds = fixbuf;
+ unsigned LONG_LONG q;
+ long neg = 0;
+ long i;
+ BDIGIT *digits;
+ VALUE big;
+
+ memcpy(&q, buf, SIZEOF_LONG_LONG);
+ if (sign) {
+ if (FIXABLE((LONG_LONG)q)) return LONG2FIX((LONG_LONG)q);
+ if ((LONG_LONG)q < 0) {
+ q = -(LONG_LONG)q;
+ neg = 1;
+ }
}
else {
- val = bignew((long)num_bdigits, 0);
- ds = BDIGITS(val);
+ if (POSFIXABLE(q)) return LONG2FIX(q);
}
- sign = bary_unpack_internal(ds, num_bdigits, words, numwords, wordsize, nails, flags, nlp_bits);
- if (sign == -2) {
- if (val) {
- big_extend_carry(val);
- }
- else if (num_bdigits == numberof(fixbuf)) {
- val = bignew((long)num_bdigits+1, 0);
- MEMCPY(BDIGITS(val), fixbuf, BDIGIT, num_bdigits);
- BDIGITS(val)[num_bdigits++] = 1;
- }
- else {
- ds[num_bdigits++] = 1;
- }
- }
-
- if (!val) {
- BDIGIT_DBL u = fixbuf[0] + BIGUP(fixbuf[1]);
- if (u == 0)
- return LONG2FIX(0);
- if (0 < sign && POSFIXABLE(u))
- return LONG2FIX(u);
- if (sign < 0 && BDIGIT_MSB(fixbuf[1]) == 0 &&
- NEGFIXABLE(-(BDIGIT_DBL_SIGNED)u))
- return LONG2FIX(-(BDIGIT_DBL_SIGNED)u);
- val = bignew((long)num_bdigits, 0 <= sign);
- MEMCPY(BDIGITS(val), fixbuf, BDIGIT, num_bdigits);
+ i = 0;
+ big = bignew(DIGSPERLL, 1);
+ digits = BDIGITS(big);
+ while (i < DIGSPERLL) {
+ digits[i++] = BIGLO(q);
+ q = BIGDN(q);
}
- if ((flags & INTEGER_PACK_FORCE_BIGNUM) && sign != 0 &&
- bary_zero_p(BDIGITS(val), BIGNUM_LEN(val)))
- sign = 0;
- BIGNUM_SET_SIGN(val, 0 <= sign);
+ i = DIGSPERLL;
+ while (i-- && !digits[i]) ;
+ RBIGNUM_SET_LEN(big, i+1);
- if (flags & INTEGER_PACK_FORCE_BIGNUM)
- return bigtrunc(val);
- return bignorm(val);
+ if (neg) {
+ RBIGNUM_SET_SIGN(big, 0);
+ }
+ return bignorm(big);
}
-#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])
+#else
-static void
-str2big_scan_digits(const char *s, const char *str, int base, int badcheck, size_t *num_digits_p, size_t *len_p)
+static int
+quad_buf_complement(char *buf, size_t len)
{
- char nondigit = 0;
- size_t num_digits = 0;
- const char *digits_start = str;
- const char *digits_end = str;
-
- int c;
-
- if (badcheck && *str == '_') goto bad;
-
- while ((c = *str++) != 0) {
- if (c == '_') {
- if (nondigit) {
- if (badcheck) goto bad;
- break;
- }
- nondigit = (char) c;
- continue;
- }
- else if ((c = conv_digit(c)) < 0) {
- break;
- }
- if (c >= base) break;
- nondigit = 0;
- num_digits++;
- digits_end = str;
- }
- if (badcheck) {
- str--;
- if (s+1 < str && str[-1] == '_') goto bad;
- while (*str && ISSPACE(*str)) str++;
- if (*str) {
- bad:
- rb_invalid_str(s, "Integer()");
- }
+ size_t i;
+ for (i = 0; i < len; i++)
+ buf[i] = ~buf[i];
+ for (i = 0; i < len; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return 0;
}
- *num_digits_p = num_digits;
- *len_p = digits_end - digits_start;
+ return 1;
}
-static VALUE
-str2big_poweroftwo(
- int sign,
- const char *digits_start,
- const char *digits_end,
- size_t num_digits,
- int bits_per_digit)
-{
- BDIGIT *dp;
- BDIGIT_DBL dd;
- int numbits;
-
- size_t num_bdigits;
- const char *p;
- int c;
- VALUE z;
+void
+rb_quad_pack(char *buf, VALUE val)
+{
+ long len;
- num_bdigits = (num_digits / BITSPERDIG) * bits_per_digit + roomof((num_digits % BITSPERDIG) * bits_per_digit, BITSPERDIG);
- z = bignew(num_bdigits, sign);
- dp = BDIGITS(z);
- dd = 0;
- numbits = 0;
- for (p = digits_end; digits_start < p; p--) {
- if ((c = conv_digit(p[-1])) < 0)
- continue;
- dd |= (BDIGIT_DBL)c << numbits;
- numbits += bits_per_digit;
- if (BITSPERDIG <= numbits) {
- *dp++ = BIGLO(dd);
- dd = BIGDN(dd);
- numbits -= BITSPERDIG;
- }
+ memset(buf, 0, QUAD_SIZE);
+ val = rb_to_int(val);
+ if (FIXNUM_P(val)) {
+ val = rb_int2big(FIX2LONG(val));
}
- if (numbits) {
- *dp++ = BIGLO(dd);
+ len = RBIGNUM_LEN(val) * SIZEOF_BDIGITS;
+ if (len > QUAD_SIZE) {
+ len = QUAD_SIZE;
}
- assert((size_t)(dp - BDIGITS(z)) == num_bdigits);
-
- return z;
-}
-
-static VALUE
-str2big_normal(
- int sign,
- const char *digits_start,
- const char *digits_end,
- size_t num_bdigits,
- int base)
-{
- size_t blen = 1;
- BDIGIT *zds;
- BDIGIT_DBL num;
-
- size_t i;
- const char *p;
- int c;
- VALUE z;
-
- z = bignew(num_bdigits, sign);
- zds = BDIGITS(z);
- BDIGITS_ZERO(zds, num_bdigits);
-
- for (p = digits_start; p < digits_end; p++) {
- if ((c = conv_digit(*p)) < 0)
- continue;
- num = c;
- i = 0;
- for (;;) {
- while (i<blen) {
- num += (BDIGIT_DBL)zds[i]*base;
- zds[i++] = BIGLO(num);
- num = BIGDN(num);
- }
- if (num) {
- blen++;
- continue;
- }
- break;
- }
- assert(blen <= num_bdigits);
+ memcpy(buf, (char*)BDIGITS(val), len);
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ quad_buf_complement(buf, QUAD_SIZE);
}
-
- return z;
}
-static VALUE
-str2big_karatsuba(
- int sign,
- const char *digits_start,
- const char *digits_end,
- size_t num_digits,
- size_t num_bdigits,
- int digits_per_bdigits_dbl,
- int base)
-{
- VALUE powerv;
- size_t unit;
- VALUE tmpuv = 0;
- BDIGIT *uds, *vds, *tds;
- BDIGIT_DBL dd;
- BDIGIT_DBL current_base;
- int m;
- int power_level = 0;
+#define BNEG(b) (RSHIFT(((BDIGIT*)(b))[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
- size_t i;
- const char *p;
- int c;
- VALUE z;
-
- uds = ALLOCV_N(BDIGIT, tmpuv, 2*num_bdigits);
- vds = uds + num_bdigits;
+VALUE
+rb_quad_unpack(const char *buf, int sign)
+{
+ VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1);
- powerv = power_cache_get_power(base, power_level, NULL);
+ memcpy((char*)BDIGITS(big), buf, QUAD_SIZE);
+ if (sign && BNEG(buf)) {
+ char *tmp = (char*)BDIGITS(big);
- i = 0;
- dd = 0;
- current_base = 1;
- m = digits_per_bdigits_dbl;
- if (num_digits < (size_t)m)
- m = (int)num_digits;
- for (p = digits_end; digits_start < p; p--) {
- if ((c = conv_digit(p[-1])) < 0)
- continue;
- dd = dd + c * current_base;
- current_base *= base;
- num_digits--;
- m--;
- if (m == 0) {
- uds[i++] = BIGLO(dd);
- uds[i++] = (BDIGIT)BIGDN(dd);
- dd = 0;
- m = digits_per_bdigits_dbl;
- if (num_digits < (size_t)m)
- m = (int)num_digits;
- current_base = 1;
- }
+ RBIGNUM_SET_SIGN(big, 0);
+ quad_buf_complement(tmp, QUAD_SIZE);
}
- assert(i == num_bdigits);
- for (unit = 2; unit < num_bdigits; unit *= 2) {
- for (i = 0; i < num_bdigits; i += unit*2) {
- if (2*unit <= num_bdigits - i) {
- bary_mul(vds+i, unit*2, BDIGITS(powerv), BIGNUM_LEN(powerv), uds+i+unit, unit);
- bary_add(vds+i, unit*2, vds+i, unit*2, uds+i, unit);
- }
- else if (unit <= num_bdigits - i) {
- bary_mul(vds+i, num_bdigits-i, BDIGITS(powerv), BIGNUM_LEN(powerv), uds+i+unit, num_bdigits-(i+unit));
- bary_add(vds+i, num_bdigits-i, vds+i, num_bdigits-i, uds+i, unit);
- }
- else {
- MEMCPY(vds+i, uds+i, BDIGIT, num_bdigits-i);
- }
- }
- power_level++;
- powerv = power_cache_get_power(base, power_level, NULL);
- tds = vds;
- vds = uds;
- uds = tds;
- }
- BARY_TRUNC(uds, num_bdigits);
- z = bignew(num_bdigits, sign);
- MEMCPY(BDIGITS(z), uds, BDIGIT, num_bdigits);
- if (tmpuv)
- ALLOCV_END(tmpuv);
-
- return z;
+ return bignorm(big);
}
-#ifdef USE_GMP
-static VALUE
-str2big_gmp(
- int sign,
- const char *digits_start,
- const char *digits_end,
- size_t num_digits,
- size_t num_bdigits,
- int base)
-{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
- char *buf, *p;
- const char *q;
- VALUE tmps;
- mpz_t mz;
- VALUE z;
- BDIGIT *zds;
- size_t zn, count;
-
- buf = ALLOCV_N(char, tmps, num_digits+1);
- p = buf;
- for (q = digits_start; q < digits_end; q++) {
- if (conv_digit(*q) < 0)
- continue;
- *p++ = *q;
- }
- *p = '\0';
-
- mpz_init(mz);
- mpz_set_str(mz, buf, base);
- zn = num_bdigits;
- z = bignew(zn, sign);
- zds = BDIGITS(z);
- mpz_export(BDIGITS(z), &count, -1, sizeof(BDIGIT), 0, nails, mz);
- BDIGITS_ZERO(zds+count, zn-count);
- mpz_clear(mz);
-
- if (tmps)
- ALLOCV_END(tmps);
-
- return z;
-}
#endif
-/*
- * Parse +str+ as Ruby Integer, i.e., underscores, 0d and 0b prefixes.
- *
- * str: pointer to the string to be parsed.
- * should be NUL-terminated.
- * base: base of conversion, must be 2..36, or -36..0.
- * if +base+ > 0, the conversion is done according to the +base+
- * and unmatched prefix is parsed as a part of the result if
- * present.
- * if +base+ <= 0, the conversion is done according to the
- * prefix if present, in base <code>-base</code> if +base+ < -1,
- * or in base 10.
- * badcheck: if non-zero, +ArgumentError+ is raised when +str+ is not
- * valid as an Integer. if zero, Fixnum 0 is returned in
- * that case.
- */
VALUE
rb_cstr_to_inum(const char *str, int base, int badcheck)
{
const char *s = str;
- char sign = 1;
+ char *end;
+ char sign = 1, nondigit = 0;
int c;
+ BDIGIT_DBL num;
+ long len, blen = 1;
+ long i;
VALUE z;
+ BDIGIT *zds;
- int bits_per_digit;
-
- const char *digits_start, *digits_end;
- size_t num_digits;
- size_t num_bdigits;
- size_t len;
+#undef ISDIGIT
+#define ISDIGIT(c) ('0' <= (c) && (c) <= '9')
+#define conv_digit(c) \
+ (!ISASCII(c) ? -1 : \
+ ISDIGIT(c) ? ((c) - '0') : \
+ ISLOWER(c) ? ((c) - 'a' + 10) : \
+ ISUPPER(c) ? ((c) - 'A' + 10) : \
+ -1)
if (!str) {
- if (badcheck) {
- bad:
- rb_invalid_str(s, "Integer()");
- }
+ if (badcheck) goto bad;
return INT2FIX(0);
}
while (ISSPACE(*str)) str++;
@@ -3995,19 +615,15 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
switch (str[1]) {
case 'x': case 'X':
base = 16;
- str += 2;
break;
case 'b': case 'B':
base = 2;
- str += 2;
break;
case 'o': case 'O':
base = 8;
- str += 2;
break;
case 'd': case 'D':
base = 10;
- str += 2;
break;
default:
base = 8;
@@ -4020,28 +636,47 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
base = 10;
}
}
- else if (base == 2) {
+ switch (base) {
+ case 2:
+ len = 1;
if (str[0] == '0' && (str[1] == 'b'||str[1] == 'B')) {
str += 2;
}
- }
- else if (base == 8) {
+ break;
+ case 3:
+ len = 2;
+ break;
+ case 8:
if (str[0] == '0' && (str[1] == 'o'||str[1] == 'O')) {
str += 2;
}
- }
- else if (base == 10) {
+ case 4: case 5: case 6: case 7:
+ len = 3;
+ break;
+ case 10:
if (str[0] == '0' && (str[1] == 'd'||str[1] == 'D')) {
str += 2;
}
- }
- else if (base == 16) {
+ case 9: case 11: case 12: case 13: case 14: case 15:
+ len = 4;
+ break;
+ case 16:
+ len = 4;
if (str[0] == '0' && (str[1] == 'x'||str[1] == 'X')) {
str += 2;
}
- }
- if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
+ break;
+ default:
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
+ }
+ if (base <= 32) {
+ len = 5;
+ }
+ else {
+ len = 6;
+ }
+ break;
}
if (*str == '0') { /* squeeze preceding 0s */
int us = 0;
@@ -4049,10 +684,8 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
if (c == '_') {
if (++us >= 2)
break;
- }
- else {
+ } else
us = 0;
- }
}
if (!(c = *str) || ISSPACE(c)) --str;
}
@@ -4062,10 +695,9 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
if (badcheck) goto bad;
return INT2FIX(0);
}
+ len *= strlen(str)*sizeof(char);
- bits_per_digit = bit_length(base-1);
- if (bits_per_digit * strlen(str) <= sizeof(long) * CHAR_BIT) {
- char *end;
+ if ((size_t)len <= (sizeof(long)*CHAR_BIT)) {
unsigned long val = STRTOUL(str, &end, base);
if (str < end && *end == '_') goto bigparse;
@@ -4084,40 +716,54 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
}
else {
VALUE big = rb_uint2big(val);
- BIGNUM_SET_SIGN(big, sign);
+ RBIGNUM_SET_SIGN(big, sign);
return bignorm(big);
}
}
-
bigparse:
- digits_start = str;
- str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
- digits_end = digits_start + len;
+ len = (len/BITSPERDIG)+1;
+ if (badcheck && *str == '_') goto bad;
- if (POW2_P(base)) {
- z = str2big_poweroftwo(sign, digits_start, digits_end, num_digits,
- bits_per_digit);
+ z = bignew(len, sign);
+ zds = BDIGITS(z);
+ for (i=len;i--;) zds[i]=0;
+ while ((c = *str++) != 0) {
+ if (c == '_') {
+ if (nondigit) {
+ if (badcheck) goto bad;
+ break;
+ }
+ nondigit = (char) c;
+ continue;
+ }
+ else if ((c = conv_digit(c)) < 0) {
+ break;
+ }
+ if (c >= base) break;
+ nondigit = 0;
+ i = 0;
+ num = c;
+ for (;;) {
+ while (i<blen) {
+ num += (BDIGIT_DBL)zds[i]*base;
+ zds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ if (num) {
+ blen++;
+ continue;
+ }
+ break;
+ }
}
- else {
- int digits_per_bdigits_dbl;
- maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
- num_bdigits = roomof(num_digits, digits_per_bdigits_dbl)*2;
-
-#ifdef USE_GMP
- if (GMP_STR2BIG_DIGITS < num_bdigits) {
- z = str2big_gmp(sign, digits_start, digits_end, num_digits,
- num_bdigits, base);
- }
- else
-#endif
- if (num_bdigits < KARATSUBA_MUL_DIGITS) {
- z = str2big_normal(sign, digits_start, digits_end,
- num_bdigits, base);
- }
- else {
- z = str2big_karatsuba(sign, digits_start, digits_end, num_digits,
- num_bdigits, digits_per_bdigits_dbl, base);
- }
+ if (badcheck) {
+ str--;
+ if (s+1 < str && str[-1] == '_') goto bad;
+ while (*str && ISSPACE(*str)) str++;
+ if (*str) {
+ bad:
+ rb_invalid_str(s, "Integer()");
+ }
}
return bignorm(z);
@@ -4155,178 +801,26 @@ rb_str_to_inum(VALUE str, int base, int badcheck)
return ret;
}
-VALUE
-rb_str2big_poweroftwo(VALUE arg, int base, int badcheck)
-{
- int positive_p = 1;
- const char *s, *str;
- const char *digits_start, *digits_end;
- size_t num_digits;
- size_t len;
- VALUE z;
-
- if (base < 2 || 36 < base || !POW2_P(base)) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
- }
-
- rb_must_asciicompat(arg);
- s = str = StringValueCStr(arg);
- if (*str == '-') {
- str++;
- positive_p = 0;
- }
-
- digits_start = str;
- str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
- digits_end = digits_start + len;
-
- z = str2big_poweroftwo(positive_p, digits_start, digits_end, num_digits,
- bit_length(base-1));
-
- RB_GC_GUARD(arg);
-
- return bignorm(z);
-}
-
-VALUE
-rb_str2big_normal(VALUE arg, int base, int badcheck)
-{
- int positive_p = 1;
- const char *s, *str;
- const char *digits_start, *digits_end;
- size_t num_digits;
- size_t len;
- VALUE z;
-
- int digits_per_bdigits_dbl;
- size_t num_bdigits;
-
- if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
- }
-
- rb_must_asciicompat(arg);
- s = str = StringValueCStr(arg);
- if (*str == '-') {
- str++;
- positive_p = 0;
- }
-
- digits_start = str;
- str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
- digits_end = digits_start + len;
-
- maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
- num_bdigits = roomof(num_digits, digits_per_bdigits_dbl)*2;
-
- z = str2big_normal(positive_p, digits_start, digits_end,
- num_bdigits, base);
-
- RB_GC_GUARD(arg);
-
- return bignorm(z);
-}
-
-VALUE
-rb_str2big_karatsuba(VALUE arg, int base, int badcheck)
-{
- int positive_p = 1;
- const char *s, *str;
- const char *digits_start, *digits_end;
- size_t num_digits;
- size_t len;
- VALUE z;
-
- int digits_per_bdigits_dbl;
- size_t num_bdigits;
-
- if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
- }
-
- rb_must_asciicompat(arg);
- s = str = StringValueCStr(arg);
- if (*str == '-') {
- str++;
- positive_p = 0;
- }
-
- digits_start = str;
- str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
- digits_end = digits_start + len;
-
- maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
- num_bdigits = roomof(num_digits, digits_per_bdigits_dbl)*2;
-
- z = str2big_karatsuba(positive_p, digits_start, digits_end, num_digits,
- num_bdigits, digits_per_bdigits_dbl, base);
-
- RB_GC_GUARD(arg);
-
- return bignorm(z);
-}
-
-#ifdef USE_GMP
-VALUE
-rb_str2big_gmp(VALUE arg, int base, int badcheck)
-{
- int positive_p = 1;
- const char *s, *str;
- const char *digits_start, *digits_end;
- size_t num_digits;
- size_t len;
- VALUE z;
-
- int digits_per_bdigits_dbl;
- size_t num_bdigits;
-
- if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "invalid radix %d", base);
- }
-
- rb_must_asciicompat(arg);
- s = str = StringValueCStr(arg);
- if (*str == '-') {
- str++;
- positive_p = 0;
- }
-
- digits_start = str;
- str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
- digits_end = digits_start + len;
-
- maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
- num_bdigits = roomof(num_digits, digits_per_bdigits_dbl)*2;
-
- z = str2big_gmp(positive_p, digits_start, digits_end, num_digits, num_bdigits, base);
-
- RB_GC_GUARD(arg);
-
- return bignorm(z);
-}
-#endif
-
#if HAVE_LONG_LONG
static VALUE
rb_ull2big(unsigned LONG_LONG n)
{
- long i;
- VALUE big = bignew(bdigit_roomof(SIZEOF_LONG_LONG), 1);
- BDIGIT *digits = BDIGITS(big);
+ BDIGIT_DBL num = n;
+ long i = 0;
+ BDIGIT *digits;
+ VALUE big;
-#if SIZEOF_BDIGIT >= SIZEOF_LONG_LONG
- digits[0] = n;
-#else
- for (i = 0; i < bdigit_roomof(SIZEOF_LONG_LONG); i++) {
- digits[i] = BIGLO(n);
- n = BIGDN(n);
+ big = bignew(DIGSPERLL, 1);
+ digits = BDIGITS(big);
+ while (i < DIGSPERLL) {
+ digits[i++] = BIGLO(num);
+ num = BIGDN(num);
}
-#endif
- i = bdigit_roomof(SIZEOF_LONG_LONG);
+ i = DIGSPERLL;
while (i-- && !digits[i]) ;
- BIGNUM_SET_LEN(big, i+1);
+ RBIGNUM_SET_LEN(big, i+1);
return big;
}
@@ -4334,19 +828,15 @@ static VALUE
rb_ll2big(LONG_LONG n)
{
long neg = 0;
- unsigned LONG_LONG u;
VALUE big;
if (n < 0) {
- u = 1 + (unsigned LONG_LONG)(-(n + 1)); /* u = -n avoiding overflow */
+ n = -n;
neg = 1;
}
- else {
- u = n;
- }
- big = rb_ull2big(u);
+ big = rb_ull2big(n);
if (neg) {
- BIGNUM_SET_SIGN(big, 0);
+ RBIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -4379,549 +869,292 @@ rb_str2inum(VALUE str, int base)
return rb_str_to_inum(str, base, base==0);
}
-static VALUE
-big_shift3(VALUE x, int lshift_p, size_t shift_numdigits, int shift_numbits)
-{
- BDIGIT *xds, *zds;
- long s1;
- int s2;
- VALUE z;
- long xn;
+const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
- if (lshift_p) {
- if (LONG_MAX < shift_numdigits) {
- rb_raise(rb_eArgError, "too big number");
- }
- s1 = shift_numdigits;
- s2 = shift_numbits;
- xn = BIGNUM_LEN(x);
- z = bignew(xn+s1+1, BIGNUM_SIGN(x));
- zds = BDIGITS(z);
- BDIGITS_ZERO(zds, s1);
- xds = BDIGITS(x);
- zds[xn+s1] = bary_small_lshift(zds+s1, xds, xn, s2);
- }
- else {
- long zn;
- BDIGIT hibitsx;
- if (LONG_MAX < shift_numdigits || (size_t)BIGNUM_LEN(x) <= shift_numdigits) {
- if (BIGNUM_POSITIVE_P(x) ||
- bary_zero_p(BDIGITS(x), BIGNUM_LEN(x)))
- return INT2FIX(0);
- else
- return INT2FIX(-1);
- }
- s1 = shift_numdigits;
- s2 = shift_numbits;
- hibitsx = abs2twocomp(&x, &xn);
- xds = BDIGITS(x);
- if (xn <= s1) {
- return hibitsx ? INT2FIX(-1) : INT2FIX(0);
- }
- zn = xn - s1;
- z = bignew(zn, 0);
- zds = BDIGITS(z);
- bary_small_rshift(zds, xds+s1, zn, s2, hibitsx != 0 ? BDIGMAX : 0);
- twocomp2abs_bang(z, hibitsx != 0);
- }
- RB_GC_GUARD(x);
- return z;
-}
+static VALUE bigsqr(VALUE x);
+static void bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp);
-static VALUE
-big_shift2(VALUE x, int lshift_p, VALUE y)
-{
- int sign;
- size_t lens[2];
- size_t shift_numdigits;
- int shift_numbits;
+#define POW2_P(x) (((x)&((x)-1))==0)
- assert(POW2_P(CHAR_BIT));
- assert(POW2_P(BITSPERDIG));
+static inline int
+ones(register unsigned long x)
+{
+#if SIZEOF_LONG == 8
+# define MASK_55 0x5555555555555555UL
+# define MASK_33 0x3333333333333333UL
+# define MASK_0f 0x0f0f0f0f0f0f0f0fUL
+#else
+# define MASK_55 0x55555555UL
+# define MASK_33 0x33333333UL
+# define MASK_0f 0x0f0f0f0fUL
+#endif
+ x -= (x >> 1) & MASK_55;
+ x = ((x >> 2) & MASK_33) + (x & MASK_33);
+ x = ((x >> 4) + x) & MASK_0f;
+ x += (x >> 8);
+ x += (x >> 16);
+#if SIZEOF_LONG == 8
+ x += (x >> 32);
+#endif
+ return (int)(x & 0x7f);
+#undef MASK_0f
+#undef MASK_33
+#undef MASK_55
+}
- if (BIGZEROP(x))
- return INT2FIX(0);
- sign = rb_integer_pack(y, lens, numberof(lens), sizeof(size_t), 0,
- INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
- if (sign < 0) {
- lshift_p = !lshift_p;
- sign = -sign;
- }
- if (lshift_p) {
- if (1 < sign || CHAR_BIT <= lens[1])
- rb_raise(rb_eRangeError, "shift width too big");
- }
- else {
- if (1 < sign || CHAR_BIT <= lens[1])
- return BIGNUM_POSITIVE_P(x) ? INT2FIX(0) : INT2FIX(-1);
- }
- shift_numbits = (int)(lens[0] & (BITSPERDIG-1));
- shift_numdigits = (lens[0] >> bit_length(BITSPERDIG-1)) |
- (lens[1] << (CHAR_BIT*SIZEOF_SIZE_T - bit_length(BITSPERDIG-1)));
- return big_shift3(x, lshift_p, shift_numdigits, shift_numbits);
+static inline unsigned long
+next_pow2(register unsigned long x)
+{
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+#if SIZEOF_LONG == 8
+ x |= x >> 32;
+#endif
+ return x + 1;
}
-static VALUE
-big_lshift(VALUE x, unsigned long shift)
+static inline int
+floor_log2(register unsigned long x)
{
- long s1 = shift/BITSPERDIG;
- int s2 = (int)(shift%BITSPERDIG);
- return big_shift3(x, 1, s1, s2);
+ x |= x >> 1;
+ x |= x >> 2;
+ x |= x >> 4;
+ x |= x >> 8;
+ x |= x >> 16;
+#if SIZEOF_LONG == 8
+ x |= x >> 32;
+#endif
+ return (int)ones(x) - 1;
}
-static VALUE
-big_rshift(VALUE x, unsigned long shift)
+static inline int
+ceil_log2(register unsigned long x)
{
- long s1 = shift/BITSPERDIG;
- int s2 = (int)(shift%BITSPERDIG);
- return big_shift3(x, 0, s1, s2);
+ return floor_log2(x) + !POW2_P(x);
}
-#define MAX_BASE36_POWER_TABLE_ENTRIES (SIZEOF_SIZE_T * CHAR_BIT + 1)
+#define LOG2_KARATSUBA_DIGITS 7
+#define KARATSUBA_DIGITS (1L<<LOG2_KARATSUBA_DIGITS)
+#define MAX_BIG2STR_TABLE_ENTRIES 64
-static VALUE base36_power_cache[35][MAX_BASE36_POWER_TABLE_ENTRIES];
-static size_t base36_numdigits_cache[35][MAX_BASE36_POWER_TABLE_ENTRIES];
+static VALUE big2str_power_cache[35][MAX_BIG2STR_TABLE_ENTRIES];
static void
power_cache_init(void)
{
int i, j;
for (i = 0; i < 35; ++i) {
- for (j = 0; j < MAX_BASE36_POWER_TABLE_ENTRIES; ++j) {
- base36_power_cache[i][j] = Qnil;
+ for (j = 0; j < MAX_BIG2STR_TABLE_ENTRIES; ++j) {
+ big2str_power_cache[i][j] = Qnil;
}
}
}
static inline VALUE
-power_cache_get_power(int base, int power_level, size_t *numdigits_ret)
+power_cache_get_power0(int base, int i)
{
- /*
- * MAX_BASE36_POWER_TABLE_ENTRIES is big enough to that
- * base36_power_cache[base][MAX_BASE36_POWER_TABLE_ENTRIES-1] fills whole memory.
- * So MAX_BASE36_POWER_TABLE_ENTRIES <= power_level is not possible to calculate.
- *
- * number-of-bytes =
- * log256(base36_power_cache[base][MAX_BASE36_POWER_TABLE_ENTRIES-1]) =
- * log256(maxpow_in_bdigit_dbl(base)**(2**(MAX_BASE36_POWER_TABLE_ENTRIES-1))) =
- * log256(maxpow_in_bdigit_dbl(base)**(2**(SIZEOF_SIZE_T*CHAR_BIT))) =
- * (2**(SIZEOF_SIZE_T*CHAR_BIT))*log256(maxpow_in_bdigit_dbl(base)) =
- * (256**SIZEOF_SIZE_T)*log256(maxpow_in_bdigit_dbl(base)) >
- * (256**SIZEOF_SIZE_T)*(sizeof(BDIGIT_DBL)-1) >
- * 256**SIZEOF_SIZE_T
- */
- if (MAX_BASE36_POWER_TABLE_ENTRIES <= power_level)
- rb_bug("too big power number requested: maxpow_in_bdigit_dbl(%d)**(2**%d)", base, power_level);
-
- if (NIL_P(base36_power_cache[base - 2][power_level])) {
- VALUE power;
- size_t numdigits;
- if (power_level == 0) {
- int numdigits0;
- BDIGIT_DBL dd = maxpow_in_bdigit_dbl(base, &numdigits0);
- power = bignew(2, 1);
- bdigitdbl2bary(BDIGITS(power), 2, dd);
- numdigits = numdigits0;
- }
- else {
- power = bigtrunc(bigsq(power_cache_get_power(base, power_level - 1, &numdigits)));
- numdigits *= 2;
- }
- rb_obj_hide(power);
- base36_power_cache[base - 2][power_level] = power;
- base36_numdigits_cache[base - 2][power_level] = numdigits;
- rb_gc_register_mark_object(power);
+ if (NIL_P(big2str_power_cache[base - 2][i])) {
+ big2str_power_cache[base - 2][i] =
+ i == 0 ? rb_big_pow(rb_int2big(base), INT2FIX(KARATSUBA_DIGITS))
+ : bigsqr(power_cache_get_power0(base, i - 1));
+ rb_gc_register_mark_object(big2str_power_cache[base - 2][i]);
}
- if (numdigits_ret)
- *numdigits_ret = base36_numdigits_cache[base - 2][power_level];
- return base36_power_cache[base - 2][power_level];
+ return big2str_power_cache[base - 2][i];
}
-struct big2str_struct {
- int negative;
- int base;
- BDIGIT_DBL hbase2;
- int hbase2_numdigits;
- VALUE result;
- char *ptr;
-};
-
-static void
-big2str_alloc(struct big2str_struct *b2s, size_t len)
-{
- if (LONG_MAX-1 < len)
- rb_raise(rb_eArgError, "too big number");
- b2s->result = rb_usascii_str_new(0, (long)(len + 1)); /* plus one for sign */
- b2s->ptr = RSTRING_PTR(b2s->result);
- if (b2s->negative)
- *b2s->ptr++ = '-';
-}
-
-static void
-big2str_2bdigits(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t taillen)
-{
- size_t j;
- BDIGIT_DBL num;
- char buf[SIZEOF_BDIGIT_DBL*CHAR_BIT], *p;
- int beginning = !b2s->ptr;
- size_t len = 0;
-
- assert(xn <= 2);
- num = bary2bdigitdbl(xds, xn);
-
- if (beginning) {
- if (num == 0)
- return;
- p = buf;
- j = sizeof(buf);
- do {
- p[--j] = ruby_digitmap[num % b2s->base];
- num /= b2s->base;
- } while (num);
- len = sizeof(buf) - j;
- big2str_alloc(b2s, len + taillen);
- MEMCPY(b2s->ptr, buf + j, char, len);
- }
- else {
- p = b2s->ptr;
- j = b2s->hbase2_numdigits;
- do {
- p[--j] = ruby_digitmap[num % b2s->base];
- num /= b2s->base;
- } while (j);
- len = b2s->hbase2_numdigits;
- }
- b2s->ptr += len;
-}
-
-static void
-big2str_karatsuba(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t wn,
- int power_level, size_t taillen)
+static VALUE
+power_cache_get_power(int base, long n1, long* m1)
{
- VALUE b;
- size_t half_numdigits, lower_numdigits;
- int lower_power_level;
- size_t bn;
- const BDIGIT *bds;
- size_t len;
+ int i, m;
+ long j;
+ VALUE t;
- /*
- * Precondition:
- * abs(x) < maxpow**(2**power_level)
- * where
- * maxpow = maxpow_in_bdigit_dbl(base, &numdigits)
- *
- * This function generates sequence of zeros, and then stringized abs(x) into b2s->ptr.
- *
- * b2s->ptr can be NULL.
- * It is allocated when the first character is generated via big2str_alloc.
- *
- * The prefix zeros should be generated if and only if b2s->ptr is not NULL.
- * When the zeros are generated, the zeros and abs(x) consists
- * numdigits*(2**power_level) characters at total.
- *
- * Note:
- * power_cache_get_power(base, power_level, &len) may not be cached yet. It should not be called.
- * power_cache_get_power(base, power_level-1, &len) should be cached already if 0 <= power_level-1.
- */
+ if (n1 <= KARATSUBA_DIGITS)
+ rb_bug("n1 > KARATSUBA_DIGITS");
- if (xn == 0 || bary_zero_p(xds, xn)) {
- if (b2s->ptr) {
- /* When x is zero, power_cache_get_power(base, power_level) should be cached already. */
- power_cache_get_power(b2s->base, power_level, &len);
- memset(b2s->ptr, '0', len);
- b2s->ptr += len;
- }
- return;
- }
+ m = ceil_log2(n1);
+ if (m1) *m1 = 1 << m;
+ i = m - LOG2_KARATSUBA_DIGITS;
+ if (i >= MAX_BIG2STR_TABLE_ENTRIES)
+ i = MAX_BIG2STR_TABLE_ENTRIES - 1;
+ t = power_cache_get_power0(base, i);
- if (power_level == 0) {
- big2str_2bdigits(b2s, xds, xn, taillen);
- return;
+ j = KARATSUBA_DIGITS*(1 << i);
+ while (n1 > j) {
+ t = bigsqr(t);
+ j *= 2;
}
+ return t;
+}
- lower_power_level = power_level-1;
- b = power_cache_get_power(b2s->base, lower_power_level, &lower_numdigits);
- bn = BIGNUM_LEN(b);
- bds = BDIGITS(b);
-
- half_numdigits = lower_numdigits;
+/* big2str_muraken_find_n1
+ *
+ * Let a natural number x is given by:
+ * x = 2^0 * x_0 + 2^1 * x_1 + ... + 2^(B*n_0 - 1) * x_{B*n_0 - 1},
+ * where B is BITSPERDIG (i.e. BDIGITS*CHAR_BIT) and n_0 is
+ * RBIGNUM_LEN(x).
+ *
+ * Now, we assume n_1 = min_n \{ n | 2^(B*n_0/2) <= b_1^(n_1) \}, so
+ * it is realized that 2^(B*n_0) <= {b_1}^{2*n_1}, where b_1 is a
+ * given radix number. And then, we have n_1 <= (B*n_0) /
+ * (2*log_2(b_1)), therefore n_1 is given by ceil((B*n_0) /
+ * (2*log_2(b_1))).
+ */
+static long
+big2str_find_n1(VALUE x, int base)
+{
+ static const double log_2[] = {
+ 1.0, 1.58496250072116, 2.0,
+ 2.32192809488736, 2.58496250072116, 2.8073549220576,
+ 3.0, 3.16992500144231, 3.32192809488736,
+ 3.4594316186373, 3.58496250072116, 3.70043971814109,
+ 3.8073549220576, 3.90689059560852, 4.0,
+ 4.08746284125034, 4.16992500144231, 4.24792751344359,
+ 4.32192809488736, 4.39231742277876, 4.4594316186373,
+ 4.52356195605701, 4.58496250072116, 4.64385618977472,
+ 4.70043971814109, 4.75488750216347, 4.8073549220576,
+ 4.85798099512757, 4.90689059560852, 4.95419631038688,
+ 5.0, 5.04439411935845, 5.08746284125034,
+ 5.12928301694497, 5.16992500144231
+ };
+ long bits;
- while (0 < lower_power_level &&
- (xn < bn ||
- (xn == bn && bary_cmp(xds, xn, bds, bn) < 0))) {
- lower_power_level--;
- b = power_cache_get_power(b2s->base, lower_power_level, &lower_numdigits);
- bn = BIGNUM_LEN(b);
- bds = BDIGITS(b);
- }
+ if (base < 2 || 36 < base)
+ rb_bug("invalid radix %d", base);
- if (lower_power_level == 0 &&
- (xn < bn ||
- (xn == bn && bary_cmp(xds, xn, bds, bn) < 0))) {
- if (b2s->ptr) {
- len = half_numdigits * 2 - lower_numdigits;
- memset(b2s->ptr, '0', len);
- b2s->ptr += len;
- }
- big2str_2bdigits(b2s, xds, xn, taillen);
+ if (FIXNUM_P(x)) {
+ bits = (SIZEOF_LONG*CHAR_BIT - 1)/2 + 1;
}
- else {
- BDIGIT *qds, *rds;
- size_t qn, rn;
- BDIGIT *tds;
- int shift;
-
- if (lower_power_level != power_level-1 && b2s->ptr) {
- len = (half_numdigits - lower_numdigits) * 2;
- memset(b2s->ptr, '0', len);
- b2s->ptr += len;
- }
-
- shift = nlz(bds[bn-1]);
-
- qn = xn + BIGDIVREM_EXTRA_WORDS;
-
- if (shift == 0) {
- /* bigdivrem_restoring will not modify y.
- * So use bds directly. */
- tds = (BDIGIT *)bds;
- xds[xn] = 0;
- }
- else {
- /* bigdivrem_restoring will modify y.
- * So use temporary buffer. */
- tds = xds + qn;
- assert(qn + bn <= xn + wn);
- bary_small_lshift(tds, bds, bn, shift);
- xds[xn] = bary_small_lshift(xds, xds, xn, shift);
- }
-
- bigdivrem_restoring(xds, qn, tds, bn);
-
- rds = xds;
- rn = bn;
-
- qds = xds + bn;
- qn = qn - bn;
-
- if (shift) {
- bary_small_rshift(rds, rds, rn, shift, 0);
- }
-
- BARY_TRUNC(qds, qn);
- assert(qn <= bn);
- big2str_karatsuba(b2s, qds, qn, xn+wn - (rn+qn), lower_power_level, lower_numdigits+taillen);
- BARY_TRUNC(rds, rn);
- big2str_karatsuba(b2s, rds, rn, xn+wn - rn, lower_power_level, taillen);
+ else if (BIGZEROP(x)) {
+ return 0;
}
-}
-
-static VALUE
-big2str_base_poweroftwo(VALUE x, int base)
-{
- int word_numbits = ffs(base) - 1;
- size_t numwords;
- VALUE result;
- char *ptr;
- numwords = rb_absint_numwords(x, word_numbits, NULL);
- if (BIGNUM_NEGATIVE_P(x)) {
- if (LONG_MAX-1 < numwords)
- rb_raise(rb_eArgError, "too big number");
- result = rb_usascii_str_new(0, 1+numwords);
- ptr = RSTRING_PTR(result);
- *ptr++ = BIGNUM_POSITIVE_P(x) ? '+' : '-';
+ else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
}
else {
- if (LONG_MAX < numwords)
- rb_raise(rb_eArgError, "too big number");
- result = rb_usascii_str_new(0, numwords);
- ptr = RSTRING_PTR(result);
+ bits = BITSPERDIG*RBIGNUM_LEN(x);
}
- rb_integer_pack(x, ptr, numwords, 1, CHAR_BIT-word_numbits,
- INTEGER_PACK_BIG_ENDIAN);
- while (0 < numwords) {
- *ptr = ruby_digitmap[*(unsigned char *)ptr];
- ptr++;
- numwords--;
- }
- return result;
-}
-VALUE
-rb_big2str_poweroftwo(VALUE x, int base)
-{
- return big2str_base_poweroftwo(x, base);
+ /* @shyouhei note: vvvvvvvvvvvvv this cast is suspicious. But I believe it is OK, because if that cast loses data, this x value is too big, and should have raised RangeError. */
+ return (long)ceil(((double)bits)/log_2[base - 2]);
}
-static VALUE
-big2str_generic(VALUE x, int base)
+static long
+big2str_orig(VALUE x, int base, char* ptr, long len, long hbase, int trim)
{
- BDIGIT *xds;
- size_t xn;
- struct big2str_struct b2s_data;
- int power_level;
- VALUE power;
-
- xds = BDIGITS(x);
- xn = BIGNUM_LEN(x);
- BARY_TRUNC(xds, xn);
-
- if (xn == 0) {
- return rb_usascii_str_new2("0");
- }
-
- if (base < 2 || 36 < base)
- rb_raise(rb_eArgError, "invalid radix %d", base);
-
- if (xn >= LONG_MAX/BITSPERDIG) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
- }
-
- power_level = 0;
- power = power_cache_get_power(base, power_level, NULL);
- while (power_level < MAX_BASE36_POWER_TABLE_ENTRIES &&
- (size_t)BIGNUM_LEN(power) <= (xn+1)/2) {
- power_level++;
- power = power_cache_get_power(base, power_level, NULL);
- }
- assert(power_level != MAX_BASE36_POWER_TABLE_ENTRIES);
-
- if ((size_t)BIGNUM_LEN(power) <= xn) {
- /*
- * This increment guarantees x < power_cache_get_power(base, power_level)
- * without invoking it actually.
- * (power_cache_get_power(base, power_level) can be slow and not used
- * in big2str_karatsuba.)
- *
- * Although it is possible that x < power_cache_get_power(base, power_level-1),
- * it is no problem because big2str_karatsuba checks it and
- * doesn't affect the result when b2s_data.ptr is NULL.
- */
- power_level++;
- }
+ long i = RBIGNUM_LEN(x), j = len;
+ BDIGIT* ds = BDIGITS(x);
- b2s_data.negative = BIGNUM_NEGATIVE_P(x);
- b2s_data.base = base;
- b2s_data.hbase2 = maxpow_in_bdigit_dbl(base, &b2s_data.hbase2_numdigits);
+ while (i && j > 0) {
+ long k = i;
+ BDIGIT_DBL num = 0;
- b2s_data.result = Qnil;
- b2s_data.ptr = NULL;
-
- if (power_level == 0) {
- big2str_2bdigits(&b2s_data, xds, xn, 0);
+ while (k--) { /* x / hbase */
+ num = BIGUP(num) + ds[k];
+ ds[k] = (BDIGIT)(num / hbase);
+ num %= hbase;
+ }
+ if (trim && ds[i-1] == 0) i--;
+ k = SIZEOF_BDIGITS;
+ while (k--) {
+ ptr[--j] = ruby_digitmap[num % base];
+ num /= base;
+ if (j <= 0) break;
+ if (trim && i == 0 && num == 0) break;
+ }
}
- else {
- VALUE tmpw = 0;
- BDIGIT *wds;
- size_t wn;
- wn = power_level * BIGDIVREM_EXTRA_WORDS + BIGNUM_LEN(power);
- wds = ALLOCV_N(BDIGIT, tmpw, xn + wn);
- MEMCPY(wds, xds, BDIGIT, xn);
- big2str_karatsuba(&b2s_data, wds, xn, wn, power_level, 0);
- if (tmpw)
- ALLOCV_END(tmpw);
+ if (trim) {
+ while (j < len && ptr[j] == '0') j++;
+ MEMMOVE(ptr, ptr + j, char, len - j);
+ len -= j;
}
- RB_GC_GUARD(x);
-
- *b2s_data.ptr = '\0';
- rb_str_resize(b2s_data.result, (long)(b2s_data.ptr - RSTRING_PTR(b2s_data.result)));
-
- RB_GC_GUARD(x);
- return b2s_data.result;
+ return len;
}
-VALUE
-rb_big2str_generic(VALUE x, int base)
+static long
+big2str_karatsuba(VALUE x, int base, char* ptr,
+ long n1, long len, long hbase, int trim)
{
- return big2str_generic(x, base);
-}
-
-#ifdef USE_GMP
-static VALUE
-big2str_gmp(VALUE x, int base)
-{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
- mpz_t mx;
- size_t size;
- VALUE str;
- BDIGIT *xds = BDIGITS(x);
- size_t xn = BIGNUM_LEN(x);
+ long lh, ll, m1;
+ VALUE b, q, r;
- mpz_init(mx);
- mpz_import(mx, xn, -1, sizeof(BDIGIT), 0, nails, xds);
-
- size = mpz_sizeinbase(mx, base);
-
- if (BIGNUM_NEGATIVE_P(x)) {
- mpz_neg(mx, mx);
- str = rb_usascii_str_new(0, size+1);
- }
- else {
- str = rb_usascii_str_new(0, size);
+ if (BIGZEROP(x)) {
+ if (trim) return 0;
+ else {
+ memset(ptr, '0', len);
+ return len;
+ }
}
- mpz_get_str(RSTRING_PTR(str), base, mx);
- mpz_clear(mx);
- if (RSTRING_PTR(str)[RSTRING_LEN(str)-1] == '\0') {
- rb_str_set_len(str, RSTRING_LEN(str)-1);
+ if (n1 <= KARATSUBA_DIGITS) {
+ return big2str_orig(x, base, ptr, len, hbase, trim);
}
- RB_GC_GUARD(x);
- return str;
-}
+ b = power_cache_get_power(base, n1, &m1);
+ bigdivmod(x, b, &q, &r);
+ lh = big2str_karatsuba(q, base, ptr, (len - m1)/2,
+ len - m1, hbase, trim);
+ rb_big_resize(q, 0);
+ ll = big2str_karatsuba(r, base, ptr + lh, m1/2,
+ m1, hbase, !lh && trim);
+ rb_big_resize(r, 0);
-VALUE
-rb_big2str_gmp(VALUE x, int base)
-{
- return big2str_gmp(x, base);
+ return lh + ll;
}
-#endif
-static VALUE
-rb_big2str1(VALUE x, int base)
+VALUE
+rb_big2str0(VALUE x, int base, int trim)
{
- BDIGIT *xds;
- size_t xn;
+ int off;
+ VALUE ss, xx;
+ long n1, n2, len, hbase;
+ char* ptr;
if (FIXNUM_P(x)) {
return rb_fix2str(x, base);
}
-
- bigtrunc(x);
- xds = BDIGITS(x);
- xn = BIGNUM_LEN(x);
- BARY_TRUNC(xds, xn);
-
- if (xn == 0) {
+ if (BIGZEROP(x)) {
return rb_usascii_str_new2("0");
}
if (base < 2 || 36 < base)
rb_raise(rb_eArgError, "invalid radix %d", base);
- if (xn >= LONG_MAX/BITSPERDIG) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
- }
+ n2 = big2str_find_n1(x, base);
+ n1 = (n2 + 1) / 2;
+ ss = rb_usascii_str_new(0, n2 + 1); /* plus one for sign */
+ ptr = RSTRING_PTR(ss);
+ ptr[0] = RBIGNUM_SIGN(x) ? '+' : '-';
- if (POW2_P(base)) {
- /* base == 2 || base == 4 || base == 8 || base == 16 || base == 32 */
- return big2str_base_poweroftwo(x, base);
+ hbase = base*base;
+#if SIZEOF_BDIGITS > 2
+ hbase *= hbase;
+#endif
+ off = !(trim && RBIGNUM_SIGN(x)); /* erase plus sign if trim */
+ xx = rb_big_clone(x);
+ RBIGNUM_SET_SIGN(xx, 1);
+ if (n1 <= KARATSUBA_DIGITS) {
+ len = off + big2str_orig(xx, base, ptr + off, n2, hbase, trim);
}
-
-#ifdef USE_GMP
- if (GMP_BIG2STR_DIGITS < xn) {
- return big2str_gmp(x, base);
+ else {
+ len = off + big2str_karatsuba(xx, base, ptr + off, n1,
+ n2, hbase, trim);
}
-#endif
+ rb_big_resize(xx, 0);
- return big2str_generic(x, base);
+ ptr[len] = '\0';
+ rb_str_resize(ss, len);
+
+ return ss;
}
VALUE
rb_big2str(VALUE x, int base)
{
- return rb_big2str1(x, base);
+ return rb_big2str0(x, base, 1);
}
/*
@@ -4953,64 +1186,63 @@ rb_big_to_s(int argc, VALUE *argv, VALUE x)
return rb_big2str(x, base);
}
-static unsigned long
-big2ulong(VALUE x, const char *type)
+static VALUE
+big2ulong(VALUE x, const char *type, int check)
{
- size_t len = BIGNUM_LEN(x);
- unsigned long num;
+ long len = RBIGNUM_LEN(x);
+ BDIGIT_DBL num;
BDIGIT *ds;
- if (len == 0)
- return 0;
- if (BIGSIZE(x) > sizeof(long)) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ if (len > DIGSPERLONG) {
+ if (check)
+ rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ len = DIGSPERLONG;
}
ds = BDIGITS(x);
-#if SIZEOF_LONG <= SIZEOF_BDIGIT
- num = (unsigned long)ds[0];
-#else
num = 0;
while (len--) {
- num <<= BITSPERDIG;
- num += (unsigned long)ds[len]; /* overflow is already checked */
+ num = BIGUP(num);
+ num += ds[len];
+ }
+ return (VALUE)num;
+}
+
+VALUE
+rb_big2ulong_pack(VALUE x)
+{
+ VALUE num = big2ulong(x, "unsigned long", FALSE);
+ if (!RBIGNUM_SIGN(x)) {
+ return (VALUE)(-(SIGNED_VALUE)num);
}
-#endif
return num;
}
-unsigned long
+VALUE
rb_big2ulong(VALUE x)
{
- unsigned long num = big2ulong(x, "unsigned long");
+ VALUE num = big2ulong(x, "unsigned long", TRUE);
- if (BIGNUM_POSITIVE_P(x)) {
- return num;
- }
- else {
- if (num <= LONG_MAX)
- return -(long)num;
- if (num == 1+(unsigned long)(-(LONG_MIN+1)))
- return LONG_MIN;
+ if (!RBIGNUM_SIGN(x)) {
+ unsigned long v = (unsigned long)(-(long)num);
+
+ if (v <= LONG_MAX)
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
+ return (VALUE)v;
}
- rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
+ return num;
}
-long
+SIGNED_VALUE
rb_big2long(VALUE x)
{
- unsigned long num = big2ulong(x, "long");
+ VALUE num = big2ulong(x, "long", TRUE);
- if (BIGNUM_POSITIVE_P(x)) {
- if (num <= LONG_MAX)
- return num;
+ if ((long)num < 0 &&
+ (RBIGNUM_SIGN(x) || (long)num != LONG_MIN)) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
}
- else {
- if (num <= LONG_MAX)
- return -(long)num;
- if (num == 1+(unsigned long)(-(LONG_MIN+1)))
- return LONG_MIN;
- }
- rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
+ if (!RBIGNUM_SIGN(x)) return -(SIGNED_VALUE)num;
+ return num;
}
#if HAVE_LONG_LONG
@@ -5018,23 +1250,18 @@ rb_big2long(VALUE x)
static unsigned LONG_LONG
big2ull(VALUE x, const char *type)
{
- size_t len = BIGNUM_LEN(x);
- unsigned LONG_LONG num;
- BDIGIT *ds = BDIGITS(x);
+ long len = RBIGNUM_LEN(x);
+ BDIGIT_DBL num;
+ BDIGIT *ds;
- if (len == 0)
- return 0;
- if (BIGSIZE(x) > SIZEOF_LONG_LONG)
+ if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
-#if SIZEOF_LONG_LONG <= SIZEOF_BDIGIT
- num = (unsigned LONG_LONG)ds[0];
-#else
+ ds = BDIGITS(x);
num = 0;
while (len--) {
num = BIGUP(num);
num += ds[len];
}
-#endif
return num;
}
@@ -5043,16 +1270,15 @@ rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (BIGNUM_POSITIVE_P(x)) {
- return num;
- }
- else {
- if (num <= LLONG_MAX)
- return -(LONG_LONG)num;
- if (num == 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
- return LLONG_MIN;
+ if (!RBIGNUM_SIGN(x)) {
+ LONG_LONG v = -(LONG_LONG)num;
+
+ /* FIXNUM_MIN-1 .. LLONG_MIN mapped into 0xbfffffffffffffff .. LONG_MAX+1 */
+ if ((unsigned LONG_LONG)v <= LLONG_MAX)
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
+ return v;
}
- rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
+ return num;
}
LONG_LONG
@@ -5060,17 +1286,12 @@ rb_big2ll(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "long long");
- if (BIGNUM_POSITIVE_P(x)) {
- if (num <= LLONG_MAX)
- return num;
- }
- else {
- if (num <= LLONG_MAX)
- return -(LONG_LONG)num;
- if (num == 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
- return LLONG_MIN;
+ if ((LONG_LONG)num < 0 && (RBIGNUM_SIGN(x)
+ || (LONG_LONG)num != LLONG_MIN)) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
- rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
+ if (!RBIGNUM_SIGN(x)) return -(LONG_LONG)num;
+ return num;
}
#endif /* HAVE_LONG_LONG */
@@ -5091,7 +1312,7 @@ dbl2big(double d)
rb_raise(rb_eFloatDomainError, "NaN");
}
- while (1.0 <= u) {
+ while (!POSFIXABLE(u) || 0 != (long)u) {
u /= (double)(BIGRAD);
i++;
}
@@ -5113,11 +1334,32 @@ rb_dbl2big(double d)
return bignorm(dbl2big(d));
}
+static int
+nlz(BDIGIT x)
+{
+ BDIGIT y;
+ int n = BITSPERDIG;
+#if BITSPERDIG > 64
+ y = x >> 64; if (y) {n -= 64; x = y;}
+#endif
+#if BITSPERDIG > 32
+ y = x >> 32; if (y) {n -= 32; x = y;}
+#endif
+#if BITSPERDIG > 16
+ y = x >> 16; if (y) {n -= 16; x = y;}
+#endif
+ y = x >> 8; if (y) {n -= 8; x = y;}
+ y = x >> 4; if (y) {n -= 4; x = y;}
+ y = x >> 2; if (y) {n -= 2; x = y;}
+ y = x >> 1; if (y) {return n - 2;}
+ return n - x;
+}
+
static double
big2dbl(VALUE x)
{
double d = 0.0;
- long i = (bigtrunc(x), BIGNUM_LEN(x)), lo = 0, bits;
+ long i = (bigtrunc(x), RBIGNUM_LEN(x)), lo = 0, bits;
BDIGIT *ds = BDIGITS(x), dl;
if (i) {
@@ -5134,17 +1376,16 @@ big2dbl(VALUE x)
d = ds[i] + BIGRAD*d;
}
dl = ds[i];
- if (bits && (dl & ((BDIGIT)1 << (bits %= BITSPERDIG)))) {
- int carry = (dl & ~(BDIGMAX << bits)) != 0;
+ if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) {
+ int carry = dl & ~(~(BDIGIT)0 << bits);
if (!carry) {
while (i-- > 0) {
- carry = ds[i] != 0;
- if (carry) break;
+ if ((carry = ds[i]) != 0) break;
}
}
if (carry) {
- dl &= BDIGMAX << bits;
- dl = BIGLO(dl + ((BDIGIT)1 << bits));
+ dl &= (BDIGIT)~0 << bits;
+ dl += (BDIGIT)1 << bits;
if (!dl) d += 1;
}
}
@@ -5159,7 +1400,7 @@ big2dbl(VALUE x)
}
}
}
- if (!BIGNUM_SIGN(x)) d = -d;
+ if (!RBIGNUM_SIGN(x)) d = -d;
return d;
}
@@ -5216,16 +1457,16 @@ rb_integer_float_cmp(VALUE x, VALUE y)
return INT2FIX(1);
return INT2FIX(0);
#else
- long xn, yn;
+ long xl, yl;
if (yi < FIXNUM_MIN)
return INT2FIX(1);
if (FIXNUM_MAX+1 <= yi)
return INT2FIX(-1);
- xn = FIX2LONG(x);
- yn = (long)yi;
- if (xn < yn)
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl < yl)
return INT2FIX(-1);
- if (xn > yn)
+ if (xl > yl)
return INT2FIX(1);
if (yf < 0.0)
return INT2FIX(1);
@@ -5261,12 +1502,12 @@ rb_integer_float_eq(VALUE x, VALUE y)
return Qfalse;
return Qtrue;
#else
- long xn, yn;
+ long xl, yl;
if (yi < LONG_MIN || LONG_MAX < yi)
return Qfalse;
- xn = FIX2LONG(x);
- yn = (long)yi;
- if (xn != yn)
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl != yl)
return Qfalse;
return Qtrue;
#endif
@@ -5279,48 +1520,48 @@ rb_integer_float_eq(VALUE x, VALUE y)
* call-seq:
* big <=> numeric -> -1, 0, +1 or nil
*
- * Comparison---Returns -1, 0, or +1 depending on whether +big+ is
- * less than, equal to, or greater than +numeric+. This is the
- * basis for the tests in Comparable.
- *
- * +nil+ is returned if the two values are incomparable.
+ * Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is
+ * less than, equal to, or greater than <i>numeric</i>. This is the
+ * basis for the tests in <code>Comparable</code>.
*
*/
VALUE
rb_big_cmp(VALUE x, VALUE y)
{
- int cmp;
+ long xlen = RBIGNUM_LEN(x);
+ BDIGIT *xds, *yds;
- if (FIXNUM_P(y)) {
- x = bignorm(x);
- if (FIXNUM_P(x)) {
- if (FIX2LONG(x) > FIX2LONG(y)) return INT2FIX(1);
- if (FIX2LONG(x) < FIX2LONG(y)) return INT2FIX(-1);
- return INT2FIX(0);
- }
- else {
- if (BIGNUM_NEGATIVE_P(x)) return INT2FIX(-1);
- return INT2FIX(1);
- }
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ y = rb_int2big(FIX2LONG(y));
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ case T_FLOAT:
return rb_integer_float_cmp(x, y);
- }
- else {
+
+ default:
return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
}
- if (BIGNUM_SIGN(x) > BIGNUM_SIGN(y)) return INT2FIX(1);
- if (BIGNUM_SIGN(x) < BIGNUM_SIGN(y)) return INT2FIX(-1);
+ if (RBIGNUM_SIGN(x) > RBIGNUM_SIGN(y)) return INT2FIX(1);
+ if (RBIGNUM_SIGN(x) < RBIGNUM_SIGN(y)) return INT2FIX(-1);
+ if (xlen < RBIGNUM_LEN(y))
+ return (RBIGNUM_SIGN(x)) ? INT2FIX(-1) : INT2FIX(1);
+ if (xlen > RBIGNUM_LEN(y))
+ return (RBIGNUM_SIGN(x)) ? INT2FIX(1) : INT2FIX(-1);
- cmp = bary_cmp(BDIGITS(x), BIGNUM_LEN(x), BDIGITS(y), BIGNUM_LEN(y));
- if (BIGNUM_SIGN(x))
- return INT2FIX(cmp);
- else
- return INT2FIX(-cmp);
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+
+ while (xlen-- && (xds[xlen]==yds[xlen]));
+ if (-1 == xlen) return INT2FIX(0);
+ return (xds[xlen] > yds[xlen]) ?
+ (RBIGNUM_SIGN(x) ? INT2FIX(1) : INT2FIX(-1)) :
+ (RBIGNUM_SIGN(x) ? INT2FIX(-1) : INT2FIX(1));
}
enum big_op_t {
@@ -5336,21 +1577,27 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
VALUE rel;
int n;
- if (FIXNUM_P(y) || RB_BIGNUM_TYPE_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
rel = rb_big_cmp(x, y);
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+ break;
+
+ case T_FLOAT:
rel = rb_integer_float_cmp(x, y);
- }
- else {
- ID id = 0;
- switch (op) {
- case big_op_gt: id = '>'; break;
- case big_op_ge: id = rb_intern(">="); break;
- case big_op_lt: id = '<'; break;
- case big_op_le: id = rb_intern("<="); break;
+ break;
+
+ default:
+ {
+ ID id = 0;
+ switch (op) {
+ case big_op_gt: id = '>'; break;
+ case big_op_ge: id = rb_intern(">="); break;
+ case big_op_lt: id = '<'; break;
+ case big_op_le: id = rb_intern("<="); break;
+ }
+ return rb_num_coerce_relop(x, y, id);
}
- return rb_num_coerce_relop(x, y, id);
}
if (NIL_P(rel)) return Qfalse;
@@ -5435,21 +1682,20 @@ big_le(VALUE x, VALUE y)
VALUE
rb_big_eq(VALUE x, VALUE y)
{
- if (FIXNUM_P(y)) {
- if (bignorm(x) == y) return Qtrue;
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+ break;
+ case T_BIGNUM:
+ break;
+ case T_FLOAT:
return rb_integer_float_eq(x, y);
- }
- else {
+ default:
return rb_equal(y, x);
}
- if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
- if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
+ if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
@@ -5467,10 +1713,10 @@ rb_big_eq(VALUE x, VALUE y)
VALUE
rb_big_eql(VALUE x, VALUE y)
{
- if (!RB_BIGNUM_TYPE_P(y)) return Qfalse;
- if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y)) return Qfalse;
- if (BIGNUM_LEN(x) != BIGNUM_LEN(y)) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,BIGNUM_LEN(y)) != 0) return Qfalse;
+ if (!RB_TYPE_P(y, T_BIGNUM)) return Qfalse;
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
+ if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
+ if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
return Qtrue;
}
@@ -5486,7 +1732,7 @@ rb_big_uminus(VALUE x)
{
VALUE z = rb_big_clone(x);
- BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
return bignorm(z);
}
@@ -5507,49 +1753,78 @@ static VALUE
rb_big_neg(VALUE x)
{
VALUE z = rb_big_clone(x);
- BDIGIT *ds = BDIGITS(z);
- long n = BIGNUM_LEN(z);
-
- if (!n) return INT2FIX(-1);
+ BDIGIT *ds;
+ long i;
- if (BIGNUM_POSITIVE_P(z)) {
- if (bary_add_one(ds, n)) {
- big_extend_carry(z);
- }
- BIGNUM_SET_NEGATIVE_SIGN(z);
- }
- else {
- bary_neg(ds, n);
- if (bary_add_one(ds, n))
- return INT2FIX(-1);
- bary_neg(ds, n);
- BIGNUM_SET_POSITIVE_SIGN(z);
+ if (!RBIGNUM_SIGN(x)) get2comp(z);
+ ds = BDIGITS(z);
+ i = RBIGNUM_LEN(x);
+ if (!i) return INT2FIX(~(SIGNED_VALUE)0);
+ while (i--) {
+ ds[i] = ~ds[i];
}
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(z));
+ if (RBIGNUM_SIGN(x)) get2comp(z);
return bignorm(z);
}
-static VALUE
-bigsub(VALUE x, VALUE y)
+static void
+bigsub_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
{
- VALUE z;
- BDIGIT *xds, *yds, *zds;
- long xn, yn, zn;
-
- xn = BIGNUM_LEN(x);
- yn = BIGNUM_LEN(y);
- zn = xn < yn ? yn : xn;
+ BDIGIT_DBL_SIGNED num;
+ long i;
- z = bignew(zn, 1);
+ for (i = 0, num = 0; i < yn; i++) {
+ num += (BDIGIT_DBL_SIGNED)xds[i] - yds[i];
+ zds[i] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (num && i < xn) {
+ num += xds[i];
+ zds[i++] = BIGLO(num);
+ num = BIGDN(num);
+ }
+ while (i < xn) {
+ zds[i] = xds[i];
+ i++;
+ }
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
+ }
+}
- xds = BDIGITS(x);
- yds = BDIGITS(y);
- zds = BDIGITS(z);
+static VALUE
+bigsub(VALUE x, VALUE y)
+{
+ VALUE z = 0;
+ long i = RBIGNUM_LEN(x);
+ BDIGIT *xds, *yds;
- if (bary_sub(zds, zn, xds, xn, yds, yn)) {
- bary_2comp(zds, zn);
- BIGNUM_SET_NEGATIVE_SIGN(z);
+ /* if x is smaller than y, swap */
+ if (RBIGNUM_LEN(x) < RBIGNUM_LEN(y)) {
+ z = x; x = y; y = z; /* swap x y */
}
+ else if (RBIGNUM_LEN(x) == RBIGNUM_LEN(y)) {
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+ while (i > 0) {
+ i--;
+ if (xds[i] > yds[i]) {
+ break;
+ }
+ if (xds[i] < yds[i]) {
+ z = x; x = y; y = z; /* swap x y */
+ break;
+ }
+ }
+ }
+
+ z = bignew(RBIGNUM_LEN(x), z==0);
+ bigsub_core(BDIGITS(x), RBIGNUM_LEN(x),
+ BDIGITS(y), RBIGNUM_LEN(y),
+ BDIGITS(z), RBIGNUM_LEN(z));
return z;
}
@@ -5561,30 +1836,21 @@ bigsub_int(VALUE x, long y0)
{
VALUE z;
BDIGIT *xds, *zds;
- long xn, zn;
+ long xn;
BDIGIT_DBL_SIGNED num;
long i, y;
y = y0;
xds = BDIGITS(x);
- xn = BIGNUM_LEN(x);
+ xn = RBIGNUM_LEN(x);
- if (xn == 0)
- return LONG2NUM(-y0);
-
- zn = xn;
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (zn < bdigit_roomof(SIZEOF_LONG))
- zn = bdigit_roomof(SIZEOF_LONG);
-#endif
- z = bignew(zn, BIGNUM_SIGN(x));
+ z = bignew(xn, RBIGNUM_SIGN(x));
zds = BDIGITS(z);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
- assert(xn == zn);
+#if SIZEOF_BDIGITS == SIZEOF_LONG
num = (BDIGIT_DBL_SIGNED)xds[0] - y;
if (xn == 1 && num < 0) {
- BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
+ RBIGNUM_SET_SIGN(z, !RBIGNUM_SIGN(x));
zds[0] = (BDIGIT)-num;
RB_GC_GUARD(x);
return bignorm(z);
@@ -5592,62 +1858,26 @@ bigsub_int(VALUE x, long y0)
zds[0] = BIGLO(num);
num = BIGDN(num);
i = 1;
- if (i < xn)
- goto y_is_zero_x;
- goto finish;
#else
num = 0;
- for (i=0; i < xn; i++) {
- if (y == 0) goto y_is_zero_x;
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
num += (BDIGIT_DBL_SIGNED)xds[i] - BIGLO(y);
zds[i] = BIGLO(num);
num = BIGDN(num);
y = BIGDN(y);
}
- for (; i < zn; i++) {
- if (y == 0) goto y_is_zero_z;
- num -= BIGLO(y);
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- y = BIGDN(y);
- }
- goto finish;
#endif
-
- for (; i < xn; i++) {
- y_is_zero_x:
- if (num == 0) goto num_is_zero_x;
+ while (num && i < xn) {
num += xds[i];
- zds[i] = BIGLO(num);
+ zds[i++] = BIGLO(num);
num = BIGDN(num);
}
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- for (; i < zn; i++) {
- y_is_zero_z:
- if (num == 0) goto num_is_zero_z;
- zds[i] = BIGLO(num);
- num = BIGDN(num);
- }
-#endif
- goto finish;
-
- for (; i < xn; i++) {
- num_is_zero_x:
+ while (i < xn) {
zds[i] = xds[i];
+ i++;
}
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- for (; i < zn; i++) {
- num_is_zero_z:
- zds[i] = 0;
- }
-#endif
- goto finish;
-
- finish:
- assert(num == 0 || num == -1);
if (num < 0) {
- get2comp(z);
- BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
+ z = bigsub(x, rb_int2big(y0));
}
RB_GC_GUARD(x);
return bignorm(z);
@@ -5663,102 +1893,106 @@ bigadd_int(VALUE x, long y)
long i;
xds = BDIGITS(x);
- xn = BIGNUM_LEN(x);
-
- if (xn == 0)
- return LONG2NUM(y);
+ xn = RBIGNUM_LEN(x);
- zn = xn;
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (zn < bdigit_roomof(SIZEOF_LONG))
- zn = bdigit_roomof(SIZEOF_LONG);
-#endif
- zn++;
-
- z = bignew(zn, BIGNUM_SIGN(x));
+ if (xn < 2) {
+ zn = 3;
+ }
+ else {
+ zn = xn + 1;
+ }
+ z = bignew(zn, RBIGNUM_SIGN(x));
zds = BDIGITS(z);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
+#if SIZEOF_BDIGITS == SIZEOF_LONG
num = (BDIGIT_DBL)xds[0] + y;
zds[0] = BIGLO(num);
num = BIGDN(num);
i = 1;
- if (i < xn)
- goto y_is_zero_x;
- goto y_is_zero_z;
#else
num = 0;
- for (i=0; i < xn; i++) {
- if (y == 0) goto y_is_zero_x;
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
num += (BDIGIT_DBL)xds[i] + BIGLO(y);
zds[i] = BIGLO(num);
num = BIGDN(num);
y = BIGDN(y);
}
- for (; i < zn; i++) {
- if (y == 0) goto y_is_zero_z;
- num += BIGLO(y);
- zds[i] = BIGLO(num);
+#endif
+ while (num && i < xn) {
+ num += xds[i];
+ zds[i++] = BIGLO(num);
num = BIGDN(num);
- y = BIGDN(y);
}
- goto finish;
+ if (num) zds[i++] = (BDIGIT)num;
+ else while (i < xn) {
+ zds[i] = xds[i];
+ i++;
+ }
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
+ }
+ RB_GC_GUARD(x);
+ return bignorm(z);
+}
-#endif
+static void
+bigadd_core(BDIGIT *xds, long xn, BDIGIT *yds, long yn, BDIGIT *zds, long zn)
+{
+ BDIGIT_DBL num = 0;
+ long i;
- for (;i < xn; i++) {
- y_is_zero_x:
- if (num == 0) goto num_is_zero_x;
- num += (BDIGIT_DBL)xds[i];
- zds[i] = BIGLO(num);
+ if (xn > yn) {
+ BDIGIT *tds;
+ tds = xds; xds = yds; yds = tds;
+ i = xn; xn = yn; yn = i;
+ }
+
+ i = 0;
+ while (i < xn) {
+ num += (BDIGIT_DBL)xds[i] + yds[i];
+ zds[i++] = BIGLO(num);
num = BIGDN(num);
}
- for (; i < zn; i++) {
- y_is_zero_z:
- if (num == 0) goto num_is_zero_z;
- zds[i] = BIGLO(num);
+ while (num && i < yn) {
+ num += yds[i];
+ zds[i++] = BIGLO(num);
num = BIGDN(num);
}
- goto finish;
-
- for (;i < xn; i++) {
- num_is_zero_x:
- zds[i] = xds[i];
+ while (i < yn) {
+ zds[i] = yds[i];
+ i++;
}
- for (; i < zn; i++) {
- num_is_zero_z:
- zds[i] = 0;
+ if (num) zds[i++] = (BDIGIT)num;
+ assert(i <= zn);
+ while (i < zn) {
+ zds[i++] = 0;
}
- goto finish;
-
- finish:
- RB_GC_GUARD(x);
- return bignorm(z);
}
static VALUE
bigadd(VALUE x, VALUE y, int sign)
{
VALUE z;
- size_t len;
+ long len;
- sign = (sign == BIGNUM_SIGN(y));
- if (BIGNUM_SIGN(x) != sign) {
+ sign = (sign == RBIGNUM_SIGN(y));
+ if (RBIGNUM_SIGN(x) != sign) {
if (sign) return bigsub(y, x);
return bigsub(x, y);
}
- if (BIGNUM_LEN(x) > BIGNUM_LEN(y)) {
- len = BIGNUM_LEN(x) + 1;
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ len = RBIGNUM_LEN(x) + 1;
}
else {
- len = BIGNUM_LEN(y) + 1;
+ len = RBIGNUM_LEN(y) + 1;
}
z = bignew(len, sign);
- bary_add(BDIGITS(z), BIGNUM_LEN(z),
- BDIGITS(x), BIGNUM_LEN(x),
- BDIGITS(y), BIGNUM_LEN(y));
+ bigadd_core(BDIGITS(x), RBIGNUM_LEN(x),
+ BDIGITS(y), RBIGNUM_LEN(y),
+ BDIGITS(z), RBIGNUM_LEN(z));
return z;
}
@@ -5775,9 +2009,10 @@ rb_big_plus(VALUE x, VALUE y)
{
long n;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
n = FIX2LONG(y);
- if ((n > 0) != BIGNUM_SIGN(x)) {
+ if ((n > 0) != RBIGNUM_SIGN(x)) {
if (n < 0) {
n = -n;
}
@@ -5787,14 +2022,14 @@ rb_big_plus(VALUE x, VALUE y)
n = -n;
}
return bigadd_int(x, n);
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
+
+ case T_BIGNUM:
return bignorm(bigadd(x, y, 1));
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+
+ case T_FLOAT:
return DBL2NUM(rb_big2dbl(x) + RFLOAT_VALUE(y));
- }
- else {
+
+ default:
return rb_num_coerce_bin(x, y, '+');
}
}
@@ -5811,9 +2046,10 @@ rb_big_minus(VALUE x, VALUE y)
{
long n;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
n = FIX2LONG(y);
- if ((n > 0) != BIGNUM_SIGN(x)) {
+ if ((n > 0) != RBIGNUM_SIGN(x)) {
if (n < 0) {
n = -n;
}
@@ -5823,76 +2059,573 @@ rb_big_minus(VALUE x, VALUE y)
n = -n;
}
return bigsub_int(x, n);
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
+
+ case T_BIGNUM:
return bignorm(bigadd(x, y, 0));
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+
+ case T_FLOAT:
return DBL2NUM(rb_big2dbl(x) - RFLOAT_VALUE(y));
- }
- else {
+
+ default:
return rb_num_coerce_bin(x, y, '-');
}
}
-static VALUE
-bigsq(VALUE x)
+static long
+big_real_len(VALUE x)
{
- long xn, zn;
- VALUE z;
- BDIGIT *xds, *zds;
-
- xn = BIGNUM_LEN(x);
- zn = 2 * xn;
+ long i = RBIGNUM_LEN(x);
+ BDIGIT *xds = BDIGITS(x);
+ while (--i && !xds[i]);
+ return i + 1;
+}
- z = bignew(zn, 1);
+static VALUE
+bigmul1_single(VALUE x, VALUE y)
+{
+ BDIGIT_DBL n;
+ VALUE z = bignew(2, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ BDIGIT *xds, *yds, *zds;
xds = BDIGITS(x);
+ yds = BDIGITS(y);
zds = BDIGITS(z);
-#ifdef USE_GMP
- if (xn < GMP_MUL_DIGITS)
- bary_sq_fast(zds, zn, xds, xn);
- else
- bary_mul(zds, zn, xds, xn, xds, xn);
-#else
- if (xn < KARATSUBA_MUL_DIGITS)
- bary_sq_fast(zds, zn, xds, xn);
- else
- bary_mul(zds, zn, xds, xn, xds, xn);
-#endif
+ n = (BDIGIT_DBL)xds[0] * yds[0];
+ zds[0] = BIGLO(n);
+ zds[1] = (BDIGIT)BIGDN(n);
- RB_GC_GUARD(x);
return z;
}
static VALUE
-bigmul0(VALUE x, VALUE y)
+bigmul1_normal(VALUE x, VALUE y)
{
- long xn, yn, zn;
- VALUE z;
+ long xl = RBIGNUM_LEN(x), yl = RBIGNUM_LEN(y), i, j = xl + yl + 1;
+ BDIGIT_DBL n = 0;
+ VALUE z = bignew(j, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
BDIGIT *xds, *yds, *zds;
- if (x == y)
- return bigsq(x);
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+ zds = BDIGITS(z);
+ while (j--) zds[j] = 0;
+ for (i = 0; i < xl; i++) {
+ BDIGIT_DBL dd;
+ dd = xds[i];
+ if (dd == 0) continue;
+ n = 0;
+ for (j = 0; j < yl; j++) {
+ BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * yds[j];
+ n = zds[i + j] + ee;
+ if (ee) zds[i + j] = BIGLO(n);
+ n = BIGDN(n);
+ }
+ if (n) {
+ zds[i + j] = (BDIGIT)n;
+ }
+ }
+ rb_thread_check_ints();
+ return z;
+}
+
+static VALUE bigmul0(VALUE x, VALUE y);
- xn = BIGNUM_LEN(x);
- yn = BIGNUM_LEN(y);
- zn = xn + yn;
+/* balancing multiplication by slicing larger argument */
+static VALUE
+bigmul1_balance(VALUE x, VALUE y)
+{
+ VALUE z, t1, t2;
+ long i, xn, yn, r, n;
+ BDIGIT *yds, *zds, *t1ds;
- z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ assert(2 * xn <= yn || 3 * xn <= 2*(yn+2));
+
+ z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ t1 = bignew(xn, 1);
- xds = BDIGITS(x);
yds = BDIGITS(y);
zds = BDIGITS(z);
+ t1ds = BDIGITS(t1);
- bary_mul(zds, zn, xds, xn, yds, yn);
+ for (i = 0; i < xn + yn; i++) zds[i] = 0;
+
+ n = 0;
+ while (yn > 0) {
+ r = xn > yn ? yn : xn;
+ MEMCPY(t1ds, yds + n, BDIGIT, r);
+ RBIGNUM_SET_LEN(t1, r);
+ t2 = bigmul0(x, t1);
+ bigadd_core(zds + n, RBIGNUM_LEN(z) - n,
+ BDIGITS(t2), big_real_len(t2),
+ zds + n, RBIGNUM_LEN(z) - n);
+ yn -= r;
+ n += r;
+ }
+
+ return z;
+}
+
+/* split a bignum into high and low bignums */
+static void
+big_split(VALUE v, long n, volatile VALUE *ph, volatile VALUE *pl)
+{
+ long hn = 0, ln = RBIGNUM_LEN(v);
+ VALUE h, l;
+ BDIGIT *vds = BDIGITS(v);
+
+ if (ln > n) {
+ hn = ln - n;
+ ln = n;
+ }
+
+ if (!hn) {
+ h = rb_uint2big(0);
+ }
+ else {
+ while (--hn && !vds[hn + ln]);
+ h = bignew(hn += 2, 1);
+ MEMCPY(BDIGITS(h), vds + ln, BDIGIT, hn - 1);
+ BDIGITS(h)[hn - 1] = 0; /* margin for carry */
+ }
+
+ while (--ln && !vds[ln]);
+ l = bignew(ln += 2, 1);
+ MEMCPY(BDIGITS(l), vds, BDIGIT, ln - 1);
+ BDIGITS(l)[ln - 1] = 0; /* margin for carry */
+
+ *pl = l;
+ *ph = h;
+}
+
+/* multiplication by karatsuba method */
+static VALUE
+bigmul1_karatsuba(VALUE x, VALUE y)
+{
+ long i, n, xn, yn, t1n, t2n;
+ VALUE xh, xl, yh, yl, z, t1, t2, t3;
+ BDIGIT *zds;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ n = yn / 2;
+ big_split(x, n, &xh, &xl);
+ if (x == y) {
+ yh = xh; yl = xl;
+ }
+ else big_split(y, n, &yh, &yl);
+
+ /* x = xh * b + xl
+ * y = yh * b + yl
+ *
+ * Karatsuba method:
+ * x * y = z2 * b^2 + z1 * b + z0
+ * where
+ * z2 = xh * yh
+ * z0 = xl * yl
+ * z1 = (xh + xl) * (yh + yl) - z2 - z0
+ *
+ * ref: http://en.wikipedia.org/wiki/Karatsuba_algorithm
+ */
+
+ /* allocate a result bignum */
+ z = bignew(xn + yn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ zds = BDIGITS(z);
+
+ /* t1 <- xh * yh */
+ t1 = bigmul0(xh, yh);
+ t1n = big_real_len(t1);
+
+ /* copy t1 into high bytes of the result (z2) */
+ MEMCPY(zds + 2 * n, BDIGITS(t1), BDIGIT, t1n);
+ for (i = 2 * n + t1n; i < xn + yn; i++) zds[i] = 0;
+
+ if (!BIGZEROP(xl) && !BIGZEROP(yl)) {
+ /* t2 <- xl * yl */
+ t2 = bigmul0(xl, yl);
+ t2n = big_real_len(t2);
+
+ /* copy t2 into low bytes of the result (z0) */
+ MEMCPY(zds, BDIGITS(t2), BDIGIT, t2n);
+ for (i = t2n; i < 2 * n; i++) zds[i] = 0;
+ }
+ else {
+ t2 = Qundef;
+ t2n = 0;
+
+ /* copy 0 into low bytes of the result (z0) */
+ for (i = 0; i < 2 * n; i++) zds[i] = 0;
+ }
+
+ /* xh <- xh + xl */
+ if (RBIGNUM_LEN(xl) > RBIGNUM_LEN(xh)) {
+ t3 = xl; xl = xh; xh = t3;
+ }
+ /* xh has a margin for carry */
+ bigadd_core(BDIGITS(xh), RBIGNUM_LEN(xh),
+ BDIGITS(xl), RBIGNUM_LEN(xl),
+ BDIGITS(xh), RBIGNUM_LEN(xh));
+
+ /* yh <- yh + yl */
+ if (x != y) {
+ if (RBIGNUM_LEN(yl) > RBIGNUM_LEN(yh)) {
+ t3 = yl; yl = yh; yh = t3;
+ }
+ /* yh has a margin for carry */
+ bigadd_core(BDIGITS(yh), RBIGNUM_LEN(yh),
+ BDIGITS(yl), RBIGNUM_LEN(yl),
+ BDIGITS(yh), RBIGNUM_LEN(yh));
+ }
+ else yh = xh;
+
+ /* t3 <- xh * yh */
+ t3 = bigmul0(xh, yh);
+
+ i = xn + yn - n;
+ /* subtract t1 from t3 */
+ bigsub_core(BDIGITS(t3), big_real_len(t3), BDIGITS(t1), t1n, BDIGITS(t3), big_real_len(t3));
+
+ /* subtract t2 from t3; t3 is now the middle term of the product */
+ if (t2 != Qundef) bigsub_core(BDIGITS(t3), big_real_len(t3), BDIGITS(t2), t2n, BDIGITS(t3), big_real_len(t3));
+
+ /* add t3 to middle bytes of the result (z1) */
+ bigadd_core(zds + n, i, BDIGITS(t3), big_real_len(t3), zds + n, i);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
return z;
}
+static void
+biglsh_bang(BDIGIT *xds, long xn, unsigned long shift)
+{
+ long const s1 = shift/BITSPERDIG;
+ int const s2 = (int)(shift%BITSPERDIG);
+ int const s3 = BITSPERDIG-s2;
+ BDIGIT* zds;
+ BDIGIT num;
+ long i;
+ if (s1 >= xn) {
+ MEMZERO(xds, BDIGIT, xn);
+ return;
+ }
+ zds = xds + xn - 1;
+ xn -= s1 + 1;
+ num = xds[xn]<<s2;
+ do {
+ *zds-- = num | xds[--xn]>>s3;
+ num = xds[xn]<<s2;
+ }
+ while (xn > 0);
+ *zds = num;
+ for (i = s1; i > 0; --i)
+ *zds-- = 0;
+}
+
+static void
+bigrsh_bang(BDIGIT* xds, long xn, unsigned long shift)
+{
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ int s3 = BITSPERDIG - s2;
+ int i;
+ BDIGIT num;
+ BDIGIT* zds;
+ if (s1 >= xn) {
+ MEMZERO(xds, BDIGIT, xn);
+ return;
+ }
+
+ i = 0;
+ zds = xds + s1;
+ num = *zds++>>s2;
+ do {
+ xds[i++] = (BDIGIT)(*zds<<s3) | num;
+ num = *zds++>>s2;
+ }
+ while (i < xn - s1 - 1);
+ xds[i] = num;
+ MEMZERO(xds + xn - s1, BDIGIT, s1);
+}
+
+static void
+big_split3(VALUE v, long n, volatile VALUE* p0, volatile VALUE* p1, volatile VALUE* p2)
+{
+ VALUE v0, v12, v1, v2;
+
+ big_split(v, n, &v12, &v0);
+ big_split(v12, n, &v2, &v1);
+
+ *p0 = bigtrunc(v0);
+ *p1 = bigtrunc(v1);
+ *p2 = bigtrunc(v2);
+}
+
+static VALUE big_lshift(VALUE, unsigned long);
+static VALUE big_rshift(VALUE, unsigned long);
+static VALUE bigdivrem(VALUE, VALUE, volatile VALUE*, volatile VALUE*);
+
+static VALUE
+bigmul1_toom3(VALUE x, VALUE y)
+{
+ long n, xn, yn, zn;
+ VALUE x0, x1, x2, y0, y1, y2;
+ VALUE u0, u1, u2, u3, u4, v1, v2, v3;
+ VALUE z0, z1, z2, z3, z4, z, t;
+ BDIGIT* zds;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+ assert(xn <= yn); /* assume y >= x */
+
+ n = (yn + 2) / 3;
+ big_split3(x, n, &x0, &x1, &x2);
+ if (x == y) {
+ y0 = x0; y1 = x1; y2 = x2;
+ }
+ else big_split3(y, n, &y0, &y1, &y2);
+
+ /*
+ * ref. http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication
+ *
+ * x(b) = x0 * b^0 + x1 * b^1 + x2 * b^2
+ * y(b) = y0 * b^0 + y1 * b^1 + y2 * b^2
+ *
+ * z(b) = x(b) * y(b)
+ * z(b) = z0 * b^0 + z1 * b^1 + z2 * b^2 + z3 * b^3 + z4 * b^4
+ * where:
+ * z0 = x0 * y0
+ * z1 = x0 * y1 + x1 * y0
+ * z2 = x0 * y2 + x1 * y1 + x2 * y0
+ * z3 = x1 * y2 + x2 * y1
+ * z4 = x2 * y2
+ *
+ * Toom3 method (a.k.a. Toom-Cook method):
+ * (Step1) calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4),
+ * where:
+ * b0 = 0, b1 = 1, b2 = -1, b3 = -2, b4 = inf,
+ * z(0) = x(0) * y(0) = x0 * y0
+ * z(1) = x(1) * y(1) = (x0 + x1 + x2) * (y0 + y1 + y2)
+ * z(-1) = x(-1) * y(-1) = (x0 - x1 + x2) * (y0 - y1 + y2)
+ * z(-2) = x(-2) * y(-2) = (x0 - 2 * (x1 - 2 * x2)) * (y0 - 2 * (y1 - 2 * y2))
+ * z(inf) = x(inf) * y(inf) = x2 * y2
+ *
+ * (Step2) interpolating z0, z1, z2, z3, z4, and z5.
+ *
+ * (Step3) Substituting base value into b of the polynomial z(b),
+ */
+
+ /*
+ * [Step1] calculating 5 points z(b0), z(b1), z(b2), z(b3), z(b4)
+ */
+
+ /* u1 <- x0 + x2 */
+ u1 = bigtrunc(bigadd(x0, x2, 1));
+
+ /* x(-1) : u2 <- u1 - x1 = x0 - x1 + x2 */
+ u2 = bigtrunc(bigsub(u1, x1));
+
+ /* x(1) : u1 <- u1 + x1 = x0 + x1 + x2 */
+ u1 = bigtrunc(bigadd(u1, x1, 1));
+
+ /* x(-2) : u3 <- 2 * (u2 + x2) - x0 = x0 - 2 * (x1 - 2 * x2) */
+ u3 = bigadd(u2, x2, 1);
+ if (BDIGITS(u3)[RBIGNUM_LEN(u3)-1] & BIGRAD_HALF) {
+ rb_big_resize(u3, RBIGNUM_LEN(u3) + 1);
+ BDIGITS(u3)[RBIGNUM_LEN(u3)-1] = 0;
+ }
+ biglsh_bang(BDIGITS(u3), RBIGNUM_LEN(u3), 1);
+ u3 = bigtrunc(bigadd(bigtrunc(u3), x0, 0));
+
+ if (x == y) {
+ v1 = u1; v2 = u2; v3 = u3;
+ }
+ else {
+ /* v1 <- y0 + y2 */
+ v1 = bigtrunc(bigadd(y0, y2, 1));
+
+ /* y(-1) : v2 <- v1 - y1 = y0 - y1 + y2 */
+ v2 = bigtrunc(bigsub(v1, y1));
+
+ /* y(1) : v1 <- v1 + y1 = y0 + y1 + y2 */
+ v1 = bigtrunc(bigadd(v1, y1, 1));
+
+ /* y(-2) : v3 <- 2 * (v2 + y2) - y0 = y0 - 2 * (y1 - 2 * y2) */
+ v3 = bigadd(v2, y2, 1);
+ if (BDIGITS(v3)[RBIGNUM_LEN(v3)-1] & BIGRAD_HALF) {
+ rb_big_resize(v3, RBIGNUM_LEN(v3) + 1);
+ BDIGITS(v3)[RBIGNUM_LEN(v3)-1] = 0;
+ }
+ biglsh_bang(BDIGITS(v3), RBIGNUM_LEN(v3), 1);
+ v3 = bigtrunc(bigadd(bigtrunc(v3), y0, 0));
+ }
+
+ /* z(0) : u0 <- x0 * y0 */
+ u0 = bigtrunc(bigmul0(x0, y0));
+
+ /* z(1) : u1 <- u1 * v1 */
+ u1 = bigtrunc(bigmul0(u1, v1));
+
+ /* z(-1) : u2 <- u2 * v2 */
+ u2 = bigtrunc(bigmul0(u2, v2));
+
+ /* z(-2) : u3 <- u3 * v3 */
+ u3 = bigtrunc(bigmul0(u3, v3));
+
+ /* z(inf) : u4 <- x2 * y2 */
+ u4 = bigtrunc(bigmul0(x2, y2));
+
+ /* for GC */
+ v1 = v2 = v3 = Qnil;
+
+ /*
+ * [Step2] interpolating z0, z1, z2, z3, z4, and z5.
+ */
+
+ /* z0 <- z(0) == u0 */
+ z0 = u0;
+
+ /* z4 <- z(inf) == u4 */
+ z4 = u4;
+
+ /* z3 <- (z(-2) - z(1)) / 3 == (u3 - u1) / 3 */
+ z3 = bigadd(u3, u1, 0);
+ bigdivrem(z3, big_three, &z3, NULL); /* TODO: optimize */
+ bigtrunc(z3);
+
+ /* z1 <- (z(1) - z(-1)) / 2 == (u1 - u2) / 2 */
+ z1 = bigtrunc(bigadd(u1, u2, 0));
+ bigrsh_bang(BDIGITS(z1), RBIGNUM_LEN(z1), 1);
+
+ /* z2 <- z(-1) - z(0) == u2 - u0 */
+ z2 = bigtrunc(bigadd(u2, u0, 0));
+
+ /* z3 <- (z2 - z3) / 2 + 2 * z(inf) == (z2 - z3) / 2 + 2 * u4 */
+ z3 = bigtrunc(bigadd(z2, z3, 0));
+ bigrsh_bang(BDIGITS(z3), RBIGNUM_LEN(z3), 1);
+ t = big_lshift(u4, 1); /* TODO: combining with next addition */
+ z3 = bigtrunc(bigadd(z3, t, 1));
+
+ /* z2 <- z2 + z1 - z(inf) == z2 + z1 - u4 */
+ z2 = bigtrunc(bigadd(z2, z1, 1));
+ z2 = bigtrunc(bigadd(z2, u4, 0));
+
+ /* z1 <- z1 - z3 */
+ z1 = bigtrunc(bigadd(z1, z3, 0));
+
+ /*
+ * [Step3] Substituting base value into b of the polynomial z(b),
+ */
+
+ zn = 6*n + 1;
+ z = bignew(zn, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ zds = BDIGITS(z);
+ MEMCPY(zds, BDIGITS(z0), BDIGIT, RBIGNUM_LEN(z0));
+ MEMZERO(zds + RBIGNUM_LEN(z0), BDIGIT, zn - RBIGNUM_LEN(z0));
+ bigadd_core(zds + n, zn - n, BDIGITS(z1), big_real_len(z1), zds + n, zn - n);
+ bigadd_core(zds + 2*n, zn - 2*n, BDIGITS(z2), big_real_len(z2), zds + 2*n, zn - 2*n);
+ bigadd_core(zds + 3*n, zn - 3*n, BDIGITS(z3), big_real_len(z3), zds + 3*n, zn - 3*n);
+ bigadd_core(zds + 4*n, zn - 4*n, BDIGITS(z4), big_real_len(z4), zds + 4*n, zn - 4*n);
+ z = bignorm(z);
+
+ return bignorm(z);
+}
+
+/* efficient squaring (2 times faster than normal multiplication)
+ * ref: Handbook of Applied Cryptography, Algorithm 14.16
+ * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
+ */
+static VALUE
+bigsqr_fast(VALUE x)
+{
+ long len = RBIGNUM_LEN(x), i, j;
+ VALUE z = bignew(2 * len + 1, 1);
+ BDIGIT *xds = BDIGITS(x), *zds = BDIGITS(z);
+ BDIGIT_DBL c, v, w;
+
+ for (i = 2 * len + 1; i--; ) zds[i] = 0;
+ for (i = 0; i < len; i++) {
+ v = (BDIGIT_DBL)xds[i];
+ if (!v) continue;
+ c = (BDIGIT_DBL)zds[i + i] + v * v;
+ zds[i + i] = BIGLO(c);
+ c = BIGDN(c);
+ v *= 2;
+ for (j = i + 1; j < len; j++) {
+ w = (BDIGIT_DBL)xds[j];
+ c += (BDIGIT_DBL)zds[i + j] + BIGLO(v) * w;
+ zds[i + j] = BIGLO(c);
+ c = BIGDN(c);
+ if (BIGDN(v)) c += w;
+ }
+ if (c) {
+ c += (BDIGIT_DBL)zds[i + len];
+ zds[i + len] = BIGLO(c);
+ c = BIGDN(c);
+ }
+ if (c) zds[i + len + 1] += (BDIGIT)c;
+ }
+ return z;
+}
+
+#define KARATSUBA_MUL_DIGITS 70
+#define TOOM3_MUL_DIGITS 150
+
+
+/* determine whether a bignum is sparse or not by random sampling */
+static inline VALUE
+big_sparse_p(VALUE x)
+{
+ long c = 0, n = RBIGNUM_LEN(x);
+
+ if ( BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+ if (c <= 1 && BDIGITS(x)[rb_genrand_ulong_limited(n / 2) + n / 4]) c++;
+
+ return (c <= 1) ? Qtrue : Qfalse;
+}
+
+static VALUE
+bigmul0(VALUE x, VALUE y)
+{
+ long xn, yn;
+
+ xn = RBIGNUM_LEN(x);
+ yn = RBIGNUM_LEN(y);
+
+ /* make sure that y is longer than x */
+ if (xn > yn) {
+ VALUE t;
+ long tn;
+ t = x; x = y; y = t;
+ tn = xn; xn = yn; yn = tn;
+ }
+ assert(xn <= yn);
+
+ /* normal multiplication when x is small */
+ if (xn < KARATSUBA_MUL_DIGITS) {
+ normal:
+ if (x == y) return bigsqr_fast(x);
+ if (xn == 1 && yn == 1) return bigmul1_single(x, y);
+ return bigmul1_normal(x, y);
+ }
+
+ /* normal multiplication when x or y is a sparse bignum */
+ if (big_sparse_p(x)) goto normal;
+ if (big_sparse_p(y)) return bigmul1_normal(y, x);
+
+ /* balance multiplication by slicing y when x is much smaller than y */
+ if (2 * xn <= yn) return bigmul1_balance(x, y);
+
+ if (xn < TOOM3_MUL_DIGITS) {
+ /* multiplication by karatsuba method */
+ return bigmul1_karatsuba(x, y);
+ }
+ else if (3*xn <= 2*(yn + 2))
+ return bigmul1_balance(x, y);
+ return bigmul1_toom3(x, y);
+}
+
/*
* call-seq:
* big * other -> Numeric
@@ -5903,112 +2636,207 @@ bigmul0(VALUE x, VALUE y)
VALUE
rb_big_mul(VALUE x, VALUE y)
{
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ case T_FLOAT:
return DBL2NUM(rb_big2dbl(x) * RFLOAT_VALUE(y));
- }
- else {
+
+ default:
return rb_num_coerce_bin(x, y, '*');
}
return bignorm(bigmul0(x, y));
}
-static VALUE
-bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
+struct big_div_struct {
+ long nx, ny, j, nyzero;
+ BDIGIT *yds, *zds;
+ volatile VALUE stop;
+};
+
+static void *
+bigdivrem1(void *ptr)
{
- long xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y);
- VALUE z;
- BDIGIT *xds, *yds, *zds;
- BDIGIT dd;
+ struct big_div_struct *bds = (struct big_div_struct*)ptr;
+ long ny = bds->ny;
+ long i, j;
+ BDIGIT *yds = bds->yds, *zds = bds->zds;
+ BDIGIT_DBL t2;
+ BDIGIT_DBL_SIGNED num;
+ BDIGIT q;
+
+ j = bds->j;
+ do {
+ if (bds->stop) {
+ bds->j = j;
+ return 0;
+ }
+ if (zds[j] == yds[ny-1]) q = (BDIGIT)BIGRAD-1;
+ else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
+ if (q) {
+ i = bds->nyzero; num = 0; t2 = 0;
+ do { /* multiply and subtract */
+ BDIGIT_DBL ee;
+ t2 += (BDIGIT_DBL)yds[i] * q;
+ ee = num - BIGLO(t2);
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ t2 = BIGDN(t2);
+ } while (++i < ny);
+ num += zds[j - ny + i] - t2;/* borrow from high digit; don't update */
+ while (num) { /* "add back" required */
+ i = 0; num = 0; q--;
+ do {
+ BDIGIT_DBL ee = num + yds[i];
+ num = (BDIGIT_DBL)zds[j - ny + i] + ee;
+ if (ee) zds[j - ny + i] = BIGLO(num);
+ num = BIGDN(num);
+ } while (++i < ny);
+ num--;
+ }
+ }
+ zds[j] = q;
+ } while (--j >= ny);
+ return 0;
+}
- VALUE q = Qnil, r = Qnil;
- BDIGIT *qds, *rds;
- long qn, rn;
+static void
+rb_big_stop(void *ptr)
+{
+ struct big_div_struct *bds = ptr;
+ bds->stop = Qtrue;
+}
- yds = BDIGITS(y);
- BARY_TRUNC(yds, yn);
- if (yn == 0)
- rb_num_zerodiv();
+static VALUE
+bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
+{
+ struct big_div_struct bds;
+ long nx = RBIGNUM_LEN(x), ny = RBIGNUM_LEN(y);
+ long i, j;
+ VALUE z, yy, zz;
+ BDIGIT *xds, *yds, *zds, *tds;
+ BDIGIT_DBL t2;
+ BDIGIT dd, q;
+ if (BIGZEROP(y)) rb_num_zerodiv();
xds = BDIGITS(x);
- BARY_TRUNC(xds, xn);
-
- if (xn < yn || (xn == yn && xds[xn - 1] < yds[yn - 1])) {
+ yds = BDIGITS(y);
+ if (nx < ny || (nx == ny && xds[nx - 1] < yds[ny - 1])) {
if (divp) *divp = rb_int2big(0);
if (modp) *modp = x;
return Qnil;
}
- if (yn == 1) {
+ if (ny == 1) {
dd = yds[0];
- z = bignew(xn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
+ z = rb_big_clone(x);
zds = BDIGITS(z);
- dd = bigdivrem_single(zds, xds, xn, dd);
+ t2 = 0; i = nx;
+ while (i--) {
+ t2 = BIGUP(t2) + zds[i];
+ zds[i] = (BDIGIT)(t2 / dd);
+ t2 %= dd;
+ }
+ RBIGNUM_SET_SIGN(z, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
if (modp) {
- *modp = rb_uint2big((VALUE)dd);
- BIGNUM_SET_SIGN(*modp, BIGNUM_SIGN(x));
+ *modp = rb_uint2big((VALUE)t2);
+ RBIGNUM_SET_SIGN(*modp, RBIGNUM_SIGN(x));
}
if (divp) *divp = z;
return Qnil;
}
- if (xn == 2 && yn == 2) {
- BDIGIT_DBL x0 = bary2bdigitdbl(xds, 2);
- BDIGIT_DBL y0 = bary2bdigitdbl(yds, 2);
- BDIGIT_DBL q0 = x0 / y0;
- BDIGIT_DBL r0 = x0 % y0;
- if (divp) {
- z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- zds = BDIGITS(z);
- zds[0] = BIGLO(q0);
- zds[1] = BIGLO(BIGDN(q0));
- *divp = z;
- }
- if (modp) {
- z = bignew(bdigit_roomof(sizeof(BDIGIT_DBL)), BIGNUM_SIGN(x));
- zds = BDIGITS(z);
- zds[0] = BIGLO(r0);
- zds[1] = BIGLO(BIGDN(r0));
- *modp = z;
- }
- return Qnil;
- }
- if (divp) {
- qn = xn + BIGDIVREM_EXTRA_WORDS;
- q = bignew(qn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
- qds = BDIGITS(q);
- }
- else {
- qn = 0;
- qds = NULL;
- }
+ z = bignew(nx==ny?nx+2:nx+1, RBIGNUM_SIGN(x)==RBIGNUM_SIGN(y));
+ zds = BDIGITS(z);
+ if (nx==ny) zds[nx+1] = 0;
+ while (!yds[ny-1]) ny--;
- if (modp) {
- rn = yn;
- r = bignew(rn, BIGNUM_SIGN(x));
- rds = BDIGITS(r);
+ dd = 0;
+ q = yds[ny-1];
+ while ((q & (BDIGIT)(1UL<<(BITSPERDIG-1))) == 0) {
+ q <<= 1UL;
+ dd++;
+ }
+ if (dd) {
+ yy = rb_big_clone(y);
+ tds = BDIGITS(yy);
+ j = 0;
+ t2 = 0;
+ while (j<ny) {
+ t2 += (BDIGIT_DBL)yds[j]<<dd;
+ tds[j++] = BIGLO(t2);
+ t2 = BIGDN(t2);
+ }
+ yds = tds;
+ RB_GC_GUARD(y) = yy;
+ j = 0;
+ t2 = 0;
+ while (j<nx) {
+ t2 += (BDIGIT_DBL)xds[j]<<dd;
+ zds[j++] = BIGLO(t2);
+ t2 = BIGDN(t2);
+ }
+ zds[j] = (BDIGIT)t2;
}
else {
- rn = 0;
- rds = NULL;
+ zds[nx] = 0;
+ j = nx;
+ while (j--) zds[j] = xds[j];
}
- bary_divmod_branch(qds, qn, rds, rn, xds, xn, yds, yn);
+ bds.nx = nx;
+ bds.ny = ny;
+ bds.zds = zds;
+ bds.yds = yds;
+ bds.stop = Qfalse;
+ bds.j = nx==ny?nx+1:nx;
+ for (bds.nyzero = 0; !yds[bds.nyzero]; bds.nyzero++);
+ if (nx > 10000 || ny > 10000) {
+ retry:
+ bds.stop = Qfalse;
+ rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds);
- if (divp) {
- bigtrunc(q);
- *divp = q;
+ if (bds.stop == Qtrue) {
+ /* execute trap handler, but exception was not raised. */
+ goto retry;
+ }
}
- if (modp) {
- bigtrunc(r);
- *modp = r;
+ else {
+ bigdivrem1(&bds);
}
- return Qnil;
+ if (divp) { /* move quotient down in z */
+ *divp = zz = rb_big_clone(z);
+ zds = BDIGITS(zz);
+ j = (nx==ny ? nx+2 : nx+1) - ny;
+ for (i = 0;i < j;i++) zds[i] = zds[i+ny];
+ if (!zds[i-1]) i--;
+ RBIGNUM_SET_LEN(zz, i);
+ }
+ if (modp) { /* normalize remainder */
+ *modp = zz = rb_big_clone(z);
+ zds = BDIGITS(zz);
+ while (ny > 1 && !zds[ny-1]) --ny;
+ if (dd) {
+ t2 = 0; i = ny;
+ while (i--) {
+ t2 = (t2 | zds[i]) >> dd;
+ q = zds[i];
+ zds[i] = BIGLO(t2);
+ t2 = BIGUP(q);
+ }
+ }
+ if (!zds[ny-1]) ny--;
+ RBIGNUM_SET_LEN(zz, ny);
+ RBIGNUM_SET_SIGN(zz, RBIGNUM_SIGN(x));
+ }
+ return z;
}
static void
@@ -6017,7 +2845,7 @@ bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y) && !BIGZEROP(mod)) {
+ if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y) && !BIGZEROP(mod)) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
@@ -6032,22 +2860,27 @@ rb_big_divide(VALUE x, VALUE y, ID op)
{
VALUE z;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
- }
- else if (RB_FLOAT_TYPE_P(y)) {
- if (op == '/') {
- return DBL2NUM(rb_big2dbl(x) / RFLOAT_VALUE(y));
- }
- else {
- double dy = RFLOAT_VALUE(y);
- if (dy == 0.0) rb_num_zerodiv();
- return rb_dbl2big(rb_big2dbl(x) / dy);
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ case T_FLOAT:
+ {
+ if (op == '/') {
+ return DBL2NUM(rb_big2dbl(x) / RFLOAT_VALUE(y));
+ }
+ else {
+ double dy = RFLOAT_VALUE(y);
+ if (dy == 0.0) rb_num_zerodiv();
+ return rb_dbl2big(rb_big2dbl(x) / dy);
+ }
}
- }
- else {
+
+ default:
return rb_num_coerce_bin(x, y, op);
}
bigdivmod(x, y, &z, 0);
@@ -6097,10 +2930,15 @@ rb_big_modulo(VALUE x, VALUE y)
{
VALUE z;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (!RB_BIGNUM_TYPE_P(y)) {
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ default:
return rb_num_coerce_bin(x, y, '%');
}
bigdivmod(x, y, 0, &z);
@@ -6122,10 +2960,15 @@ rb_big_remainder(VALUE x, VALUE y)
{
VALUE z;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (!RB_BIGNUM_TYPE_P(y)) {
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ default:
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
}
bigdivrem(x, y, 0, &z);
@@ -6145,10 +2988,15 @@ rb_big_divmod(VALUE x, VALUE y)
{
VALUE div, mod;
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- }
- else if (!RB_BIGNUM_TYPE_P(y)) {
+ break;
+
+ case T_BIGNUM:
+ break;
+
+ default:
return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
bigdivmod(x, y, &div, &mod);
@@ -6156,29 +3004,73 @@ rb_big_divmod(VALUE x, VALUE y)
return rb_assoc_new(bignorm(div), bignorm(mod));
}
+static int
+bdigbitsize(BDIGIT x)
+{
+ int size = 1;
+ int nb = BITSPERDIG / 2;
+ BDIGIT bits = (~0 << nb);
+
+ if (!x) return 0;
+ while (x > 1) {
+ if (x & bits) {
+ size += nb;
+ x >>= nb;
+ }
+ x &= ~bits;
+ nb /= 2;
+ bits >>= nb;
+ }
+
+ return size;
+}
+
+static VALUE big_lshift(VALUE, unsigned long);
+static VALUE big_rshift(VALUE, unsigned long);
+
static VALUE
big_shift(VALUE x, long n)
{
if (n < 0)
- return big_lshift(x, 1+(unsigned long)(-(n+1)));
+ return big_lshift(x, (unsigned long)-n);
else if (n > 0)
return big_rshift(x, (unsigned long)n);
return x;
}
static VALUE
-big_fdiv(VALUE x, VALUE y, long ey)
+big_fdiv(VALUE x, VALUE y)
{
#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
VALUE z;
- long l, ex;
+ long l, ex, ey;
+ int i;
bigtrunc(x);
- l = BIGNUM_LEN(x);
- ex = l * BITSPERDIG - nlz(BDIGITS(x)[l-1]);
+ l = RBIGNUM_LEN(x) - 1;
+ ex = l * BITSPERDIG;
+ ex += bdigbitsize(BDIGITS(x)[l]);
ex -= 2 * DBL_BIGDIG * BITSPERDIG;
if (ex) x = big_shift(x, ex);
+ switch (TYPE(y)) {
+ case T_FIXNUM:
+ y = rb_int2big(FIX2LONG(y));
+ case T_BIGNUM:
+ bigtrunc(y);
+ l = RBIGNUM_LEN(y) - 1;
+ ey = l * BITSPERDIG;
+ ey += bdigbitsize(BDIGITS(y)[l]);
+ ey -= DBL_BIGDIG * BITSPERDIG;
+ if (ey) y = big_shift(y, ey);
+ break;
+ case T_FLOAT:
+ y = dbl2big(ldexp(frexp(RFLOAT_VALUE(y), &i), DBL_MANT_DIG));
+ ey = i - DBL_MANT_DIG;
+ break;
+ default:
+ rb_bug("big_fdiv");
+ }
bigdivrem(x, y, &z, 0);
l = ex - ey;
#if SIZEOF_LONG > SIZEOF_INT
@@ -6191,26 +3083,6 @@ big_fdiv(VALUE x, VALUE y, long ey)
return DBL2NUM(ldexp(big2dbl(z), (int)l));
}
-static VALUE
-big_fdiv_int(VALUE x, VALUE y)
-{
- long l, ey;
- bigtrunc(y);
- l = BIGNUM_LEN(y);
- ey = l * BITSPERDIG - nlz(BDIGITS(y)[l-1]);
- ey -= DBL_BIGDIG * BITSPERDIG;
- if (ey) y = big_shift(y, ey);
- return big_fdiv(x, y, ey);
-}
-
-static VALUE
-big_fdiv_float(VALUE x, VALUE y)
-{
- int i;
- y = dbl2big(ldexp(frexp(RFLOAT_VALUE(y), &i), DBL_MANT_DIG));
- return big_fdiv(x, y, i - DBL_MANT_DIG);
-}
-
/*
* call-seq:
* big.fdiv(numeric) -> float
@@ -6230,29 +3102,39 @@ rb_big_fdiv(VALUE x, VALUE y)
double dx, dy;
dx = big2dbl(x);
- if (FIXNUM_P(y)) {
+ switch (TYPE(y)) {
+ case T_FIXNUM:
dy = (double)FIX2LONG(y);
if (isinf(dx))
- return big_fdiv_int(x, rb_int2big(FIX2LONG(y)));
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
+ return big_fdiv(x, y);
+ break;
+
+ case T_BIGNUM:
dy = rb_big2dbl(y);
if (isinf(dx) || isinf(dy))
- return big_fdiv_int(x, y);
- }
- else if (RB_FLOAT_TYPE_P(y)) {
+ return big_fdiv(x, y);
+ break;
+
+ case T_FLOAT:
dy = RFLOAT_VALUE(y);
if (isnan(dy))
return y;
if (isinf(dx))
- return big_fdiv_float(x, y);
- }
- else {
+ return big_fdiv(x, y);
+ break;
+
+ default:
return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
return DBL2NUM(dx / dy);
}
+static VALUE
+bigsqr(VALUE x)
+{
+ return bigtrunc(bigmul0(x, x));
+}
+
/*
* call-seq:
* big ** exponent -> numeric
@@ -6263,7 +3145,7 @@ rb_big_fdiv(VALUE x, VALUE y)
*
* 123456789 ** 2 #=> 15241578750190521
* 123456789 ** 1.2 #=> 5126464716.09932
- * 123456789 ** -2 #=> (1/15241578750190521)
+ * 123456789 ** -2 #=> 6.5610001194102e-17
*/
VALUE
@@ -6272,21 +3154,20 @@ rb_big_pow(VALUE x, VALUE y)
double d;
SIGNED_VALUE yy;
- again:
if (y == INT2FIX(0)) return INT2FIX(1);
- if (RB_FLOAT_TYPE_P(y)) {
+ switch (TYPE(y)) {
+ case T_FLOAT:
d = RFLOAT_VALUE(y);
- if ((!BIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
+ if ((!RBIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
- }
- else if (RB_BIGNUM_TYPE_P(y)) {
- y = bignorm(y);
- if (FIXNUM_P(y))
- goto again;
+ break;
+
+ case T_BIGNUM:
rb_warn("in a**b, b may be too big");
d = rb_big2dbl(y);
- }
- else if (FIXNUM_P(y)) {
+ break;
+
+ case T_FIXNUM:
yy = FIX2LONG(y);
if (yy < 0)
@@ -6294,84 +3175,73 @@ rb_big_pow(VALUE x, VALUE y)
else {
VALUE z = 0;
SIGNED_VALUE mask;
- const size_t xbits = rb_absint_numwords(x, 1, NULL);
- const size_t BIGLEN_LIMIT = 32*1024*1024;
+ const long xlen = RBIGNUM_LEN(x) - 1;
+ const long xbits = ffs(RBIGNUM_DIGITS(x)[xlen]) + SIZEOF_BDIGITS*BITSPERDIG*xlen;
+ const long BIGLEN_LIMIT = BITSPERDIG*1024*1024;
- if (xbits == (size_t)-1 ||
- (xbits > BIGLEN_LIMIT) ||
- (xbits * yy > BIGLEN_LIMIT)) {
+ if ((xbits > BIGLEN_LIMIT) || (xbits * yy > BIGLEN_LIMIT)) {
rb_warn("in a**b, b may be too big");
d = (double)yy;
+ break;
}
- else {
- for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
- if (z) z = bigsq(z);
- if (yy & mask) {
- z = z ? bigtrunc(bigmul0(z, x)) : x;
- }
+ for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
+ if (z) z = bigsqr(z);
+ if (yy & mask) {
+ z = z ? bigtrunc(bigmul0(z, x)) : x;
}
- return bignorm(z);
}
+ return bignorm(z);
}
- }
- else {
+ /* NOTREACHED */
+ break;
+
+ default:
return rb_num_coerce_bin(x, y, rb_intern("**"));
}
return DBL2NUM(pow(rb_big2dbl(x), d));
}
static VALUE
-bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+bigand_int(VALUE x, long y)
{
VALUE z;
BDIGIT *xds, *zds;
- long zn;
+ long xn, zn;
long i;
- BDIGIT hibitsy;
+ char sign;
if (y == 0) return INT2FIX(0);
- if (xn == 0) return hibitsx ? LONG2NUM(y) : 0;
- hibitsy = 0 <= y ? 0 : BDIGMAX;
+ sign = (y > 0);
xds = BDIGITS(x);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
- if (!hibitsy) {
+ zn = xn = RBIGNUM_LEN(x);
+#if SIZEOF_BDIGITS == SIZEOF_LONG
+ if (sign) {
y &= xds[0];
return LONG2NUM(y);
}
#endif
- zn = xn;
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (hibitsx && zn < bdigit_roomof(SIZEOF_LONG))
- zn = bdigit_roomof(SIZEOF_LONG);
-#endif
-
- z = bignew(zn, 0);
+ z = bignew(zn, RBIGNUM_SIGN(x) || sign);
zds = BDIGITS(z);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
+#if SIZEOF_BDIGITS == SIZEOF_LONG
i = 1;
- zds[0] = xds[0] & BIGLO(y);
+ zds[0] = xds[0] & y;
#else
- for (i=0; i < xn; i++) {
- if (y == 0 || y == -1) break;
- zds[i] = xds[i] & BIGLO(y);
- y = BIGDN(y);
- }
- for (; i < zn; i++) {
- if (y == 0 || y == -1) break;
- zds[i] = hibitsx & BIGLO(y);
- y = BIGDN(y);
+ {
+ BDIGIT_DBL num = y;
+
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] & BIGLO(num);
+ num = BIGDN(num);
+ }
}
#endif
- for (;i < xn; i++) {
- zds[i] = xds[i] & hibitsy;
- }
- for (;i < zn; i++) {
- zds[i] = hibitsx & hibitsy;
+ while (i < xn) {
+ zds[i] = sign?0:xds[i];
+ i++;
}
- twocomp2abs_bang(z, hibitsx && hibitsy);
- RB_GC_GUARD(x);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
@@ -6383,121 +3253,91 @@ bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
*/
VALUE
-rb_big_and(VALUE x, VALUE y)
+rb_big_and(VALUE xx, VALUE yy)
{
- VALUE z;
+ volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
- long i, xn, yn, n1, n2;
- BDIGIT hibitsx, hibitsy;
- BDIGIT hibits1, hibits2;
- VALUE tmpv;
- BDIGIT tmph;
- long tmpn;
+ long i, l1, l2;
+ char sign;
- if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
- return rb_num_coerce_bit(x, y, '&');
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '&');
}
- hibitsx = abs2twocomp(&x, &xn);
+ x = xx;
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- return bigand_int(x, xn, hibitsx, FIX2LONG(y));
+ return bigand_int(x, FIX2LONG(y));
}
- hibitsy = abs2twocomp(&y, &yn);
- if (xn > yn) {
- tmpv = x; x = y; y = tmpv;
- tmpn = xn; xn = yn; yn = tmpn;
- tmph = hibitsx; hibitsx = hibitsy; hibitsy = tmph;
+ if (!RBIGNUM_SIGN(y)) {
+ y = rb_big_clone(y);
+ get2comp(y);
}
- n1 = xn;
- n2 = yn;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- hibits1 = hibitsx;
- hibits2 = hibitsy;
-
- if (!hibits1)
- n2 = n1;
-
- z = bignew(n2, 0);
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
+ ds1 = BDIGITS(y);
+ ds2 = BDIGITS(x);
+ sign = RBIGNUM_SIGN(y);
+ }
+ else {
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
+ ds1 = BDIGITS(x);
+ ds2 = BDIGITS(y);
+ sign = RBIGNUM_SIGN(x);
+ }
+ z = bignew(l2, RBIGNUM_SIGN(x) || RBIGNUM_SIGN(y));
zds = BDIGITS(z);
- for (i=0; i<n1; i++) {
+ for (i=0; i<l1; i++) {
zds[i] = ds1[i] & ds2[i];
}
- for (; i<n2; i++) {
- zds[i] = hibits1 & ds2[i];
+ for (; i<l2; i++) {
+ zds[i] = sign?0:ds2[i];
}
- twocomp2abs_bang(z, hibits1 && hibits2);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
static VALUE
-bigor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+bigor_int(VALUE x, long y)
{
VALUE z;
BDIGIT *xds, *zds;
- long zn;
+ long xn, zn;
long i;
- BDIGIT hibitsy;
+ char sign;
- if (y == -1) return INT2FIX(-1);
- if (xn == 0) return hibitsx ? INT2FIX(-1) : LONG2FIX(y);
- hibitsy = 0 <= y ? 0 : BDIGMAX;
+ sign = (y >= 0);
xds = BDIGITS(x);
-
- zn = BIGNUM_LEN(x);
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (zn < bdigit_roomof(SIZEOF_LONG))
- zn = bdigit_roomof(SIZEOF_LONG);
-#endif
- z = bignew(zn, 0);
+ zn = xn = RBIGNUM_LEN(x);
+ z = bignew(zn, RBIGNUM_SIGN(x) && sign);
zds = BDIGITS(z);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
+#if SIZEOF_BDIGITS == SIZEOF_LONG
i = 1;
- zds[0] = xds[0] | BIGLO(y);
- if (i < zn)
- goto y_is_fixed_point;
- goto finish;
+ zds[0] = xds[0] | y;
#else
- for (i=0; i < xn; i++) {
- if (y == 0 || y == -1) goto y_is_fixed_point;
- zds[i] = xds[i] | BIGLO(y);
- y = BIGDN(y);
- }
- if (hibitsx)
- goto fill_hibits;
- for (; i < zn; i++) {
- if (y == 0 || y == -1) goto y_is_fixed_point;
- zds[i] = BIGLO(y);
- y = BIGDN(y);
- }
- goto finish;
-#endif
+ {
+ BDIGIT_DBL num = y;
- y_is_fixed_point:
- if (hibitsy)
- goto fill_hibits;
- for (; i < xn; i++) {
- zds[i] = xds[i];
- }
- if (hibitsx)
- goto fill_hibits;
- for (; i < zn; i++) {
- zds[i] = 0;
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] | BIGLO(num);
+ num = BIGDN(num);
+ }
}
- goto finish;
-
- fill_hibits:
- for (; i < zn; i++) {
- zds[i] = BDIGMAX;
+#endif
+ while (i < xn) {
+ zds[i] = sign?xds[i]:(BDIGIT)(BIGRAD-1);
+ i++;
}
-
- finish:
- twocomp2abs_bang(z, hibitsx || hibitsy);
- RB_GC_GUARD(x);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
@@ -6509,96 +3349,91 @@ bigor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
*/
VALUE
-rb_big_or(VALUE x, VALUE y)
+rb_big_or(VALUE xx, VALUE yy)
{
- VALUE z;
+ volatile VALUE x, y, z;
BDIGIT *ds1, *ds2, *zds;
- long i, xn, yn, n1, n2;
- BDIGIT hibitsx, hibitsy;
- BDIGIT hibits1, hibits2;
- VALUE tmpv;
- BDIGIT tmph;
- long tmpn;
+ long i, l1, l2;
+ char sign;
- if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
- return rb_num_coerce_bit(x, y, '|');
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '|');
}
- hibitsx = abs2twocomp(&x, &xn);
+ x = xx;
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- return bigor_int(x, xn, hibitsx, FIX2LONG(y));
+ return bigor_int(x, FIX2LONG(y));
}
- hibitsy = abs2twocomp(&y, &yn);
- if (xn > yn) {
- tmpv = x; x = y; y = tmpv;
- tmpn = xn; xn = yn; yn = tmpn;
- tmph = hibitsx; hibitsx = hibitsy; hibitsy = tmph;
+ if (!RBIGNUM_SIGN(y)) {
+ y = rb_big_clone(y);
+ get2comp(y);
}
- n1 = xn;
- n2 = yn;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- hibits1 = hibitsx;
- hibits2 = hibitsy;
-
- if (hibits1)
- n2 = n1;
-
- z = bignew(n2, 0);
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
+ ds1 = BDIGITS(y);
+ ds2 = BDIGITS(x);
+ sign = RBIGNUM_SIGN(y);
+ }
+ else {
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
+ ds1 = BDIGITS(x);
+ ds2 = BDIGITS(y);
+ sign = RBIGNUM_SIGN(x);
+ }
+ z = bignew(l2, RBIGNUM_SIGN(x) && RBIGNUM_SIGN(y));
zds = BDIGITS(z);
- for (i=0; i<n1; i++) {
+ for (i=0; i<l1; i++) {
zds[i] = ds1[i] | ds2[i];
}
- for (; i<n2; i++) {
- zds[i] = hibits1 | ds2[i];
+ for (; i<l2; i++) {
+ zds[i] = sign?ds2[i]:(BDIGIT)(BIGRAD-1);
}
- twocomp2abs_bang(z, hibits1 || hibits2);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
static VALUE
-bigxor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+bigxor_int(VALUE x, long y)
{
VALUE z;
BDIGIT *xds, *zds;
- long zn;
+ long xn, zn;
long i;
- BDIGIT hibitsy;
+ char sign;
- hibitsy = 0 <= y ? 0 : BDIGMAX;
+ sign = (y >= 0) ? 1 : 0;
xds = BDIGITS(x);
- zn = BIGNUM_LEN(x);
-#if SIZEOF_BDIGIT < SIZEOF_LONG
- if (zn < bdigit_roomof(SIZEOF_LONG))
- zn = bdigit_roomof(SIZEOF_LONG);
-#endif
- z = bignew(zn, 0);
+ zn = xn = RBIGNUM_LEN(x);
+ z = bignew(zn, !(RBIGNUM_SIGN(x) ^ sign));
zds = BDIGITS(z);
-#if SIZEOF_BDIGIT >= SIZEOF_LONG
+#if SIZEOF_BDIGITS == SIZEOF_LONG
i = 1;
- zds[0] = xds[0] ^ BIGLO(y);
+ zds[0] = xds[0] ^ y;
#else
- for (i = 0; i < xn; i++) {
- zds[i] = xds[i] ^ BIGLO(y);
- y = BIGDN(y);
- }
- for (; i < zn; i++) {
- zds[i] = hibitsx ^ BIGLO(y);
- y = BIGDN(y);
+ {
+ BDIGIT_DBL num = y;
+
+ for (i=0; i<(int)(sizeof(y)/sizeof(BDIGIT)); i++) {
+ zds[i] = xds[i] ^ BIGLO(num);
+ num = BIGDN(num);
+ }
}
#endif
- for (; i < xn; i++) {
- zds[i] = xds[i] ^ hibitsy;
- }
- for (; i < zn; i++) {
- zds[i] = hibitsx ^ hibitsy;
+ while (i < xn) {
+ zds[i] = sign?xds[i]:~xds[i];
+ i++;
}
- twocomp2abs_bang(z, (hibitsx ^ hibitsy) != 0);
- RB_GC_GUARD(x);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
return bignorm(z);
}
/*
@@ -6609,53 +3444,72 @@ bigxor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
*/
VALUE
-rb_big_xor(VALUE x, VALUE y)
+rb_big_xor(VALUE xx, VALUE yy)
{
+ volatile VALUE x, y;
VALUE z;
BDIGIT *ds1, *ds2, *zds;
- long i, xn, yn, n1, n2;
- BDIGIT hibitsx, hibitsy;
- BDIGIT hibits1, hibits2;
- VALUE tmpv;
- BDIGIT tmph;
- long tmpn;
+ long i, l1, l2;
+ char sign;
- if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
- return rb_num_coerce_bit(x, y, '^');
+ if (!FIXNUM_P(yy) && !RB_TYPE_P(yy, T_BIGNUM)) {
+ return rb_num_coerce_bit(xx, yy, '^');
}
- hibitsx = abs2twocomp(&x, &xn);
+ x = xx;
+ y = yy;
+
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
if (FIXNUM_P(y)) {
- return bigxor_int(x, xn, hibitsx, FIX2LONG(y));
+ return bigxor_int(x, FIX2LONG(y));
}
- hibitsy = abs2twocomp(&y, &yn);
- if (xn > yn) {
- tmpv = x; x = y; y = tmpv;
- tmpn = xn; xn = yn; yn = tmpn;
- tmph = hibitsx; hibitsx = hibitsy; hibitsy = tmph;
- }
- n1 = xn;
- n2 = yn;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- hibits1 = hibitsx;
- hibits2 = hibitsy;
-
- z = bignew(n2, 0);
+ if (!RBIGNUM_SIGN(y)) {
+ y = rb_big_clone(y);
+ get2comp(y);
+ }
+ if (RBIGNUM_LEN(x) > RBIGNUM_LEN(y)) {
+ l1 = RBIGNUM_LEN(y);
+ l2 = RBIGNUM_LEN(x);
+ ds1 = BDIGITS(y);
+ ds2 = BDIGITS(x);
+ sign = RBIGNUM_SIGN(y);
+ }
+ else {
+ l1 = RBIGNUM_LEN(x);
+ l2 = RBIGNUM_LEN(y);
+ ds1 = BDIGITS(x);
+ ds2 = BDIGITS(y);
+ sign = RBIGNUM_SIGN(x);
+ }
+ RBIGNUM_SET_SIGN(x, RBIGNUM_SIGN(x)?1:0);
+ RBIGNUM_SET_SIGN(y, RBIGNUM_SIGN(y)?1:0);
+ z = bignew(l2, !(RBIGNUM_SIGN(x) ^ RBIGNUM_SIGN(y)));
zds = BDIGITS(z);
- for (i=0; i<n1; i++) {
+ for (i=0; i<l1; i++) {
zds[i] = ds1[i] ^ ds2[i];
}
- for (; i<n2; i++) {
- zds[i] = hibitsx ^ ds2[i];
+ for (; i<l2; i++) {
+ zds[i] = sign?ds2[i]:~ds2[i];
}
- twocomp2abs_bang(z, (hibits1 ^ hibits2) != 0);
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
+ if (!RBIGNUM_SIGN(z)) get2comp(z);
+
return bignorm(z);
}
+static VALUE
+check_shiftdown(VALUE y, VALUE x)
+{
+ if (!RBIGNUM_LEN(x)) return INT2FIX(0);
+ if (RBIGNUM_LEN(y) > SIZEOF_LONG / SIZEOF_BDIGITS) {
+ return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(-1);
+ }
+ return Qnil;
+}
+
/*
* call-seq:
* big << numeric -> integer
@@ -6666,33 +3520,59 @@ rb_big_xor(VALUE x, VALUE y)
VALUE
rb_big_lshift(VALUE x, VALUE y)
{
- int lshift_p;
- size_t shift_numdigits;
- int shift_numbits;
+ long shift;
+ int neg = 0;
for (;;) {
if (FIXNUM_P(y)) {
- long l = FIX2LONG(y);
- unsigned long shift;
- if (0 <= l) {
- lshift_p = 1;
- shift = l;
- }
- else {
- lshift_p = 0;
- shift = 1+(unsigned long)(-(l+1));
+ shift = FIX2LONG(y);
+ if (shift < 0) {
+ neg = 1;
+ shift = -shift;
}
- shift_numbits = (int)(shift & (BITSPERDIG-1));
- shift_numdigits = shift >> bit_length(BITSPERDIG-1);
- return bignorm(big_shift3(x, lshift_p, shift_numdigits, shift_numbits));
+ break;
}
- else if (RB_BIGNUM_TYPE_P(y)) {
- return bignorm(big_shift2(x, 1, y));
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (!RBIGNUM_SIGN(y)) {
+ VALUE t = check_shiftdown(y, x);
+ if (!NIL_P(t)) return t;
+ neg = 1;
+ }
+ shift = big2ulong(y, "long", TRUE);
+ break;
}
y = rb_to_int(y);
}
+
+ x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
+ return bignorm(x);
}
+static VALUE
+big_lshift(VALUE x, unsigned long shift)
+{
+ BDIGIT *xds, *zds;
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ VALUE z;
+ BDIGIT_DBL num = 0;
+ long len, i;
+
+ len = RBIGNUM_LEN(x);
+ z = bignew(len+s1+1, RBIGNUM_SIGN(x));
+ zds = BDIGITS(z);
+ for (i=0; i<s1; i++) {
+ *zds++ = 0;
+ }
+ xds = BDIGITS(x);
+ for (i=0; i<len; i++) {
+ num = num | (BDIGIT_DBL)*xds++<<s2;
+ *zds++ = BIGLO(num);
+ num = BIGDN(num);
+ }
+ *zds = BIGLO(num);
+ return z;
+}
/*
* call-seq:
@@ -6704,31 +3584,79 @@ rb_big_lshift(VALUE x, VALUE y)
VALUE
rb_big_rshift(VALUE x, VALUE y)
{
- int lshift_p;
- size_t shift_numdigits;
- int shift_numbits;
+ long shift;
+ int neg = 0;
for (;;) {
if (FIXNUM_P(y)) {
- long l = FIX2LONG(y);
- unsigned long shift;
- if (0 <= l) {
- lshift_p = 0;
- shift = l;
- }
- else {
- lshift_p = 1;
- shift = 1+(unsigned long)(-(l+1));
+ shift = FIX2LONG(y);
+ if (shift < 0) {
+ neg = 1;
+ shift = -shift;
}
- shift_numbits = (int)(shift & (BITSPERDIG-1));
- shift_numdigits = shift >> bit_length(BITSPERDIG-1);
- return bignorm(big_shift3(x, lshift_p, shift_numdigits, shift_numbits));
+ break;
}
- else if (RB_BIGNUM_TYPE_P(y)) {
- return bignorm(big_shift2(x, 0, y));
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (RBIGNUM_SIGN(y)) {
+ VALUE t = check_shiftdown(y, x);
+ if (!NIL_P(t)) return t;
+ }
+ else {
+ neg = 1;
+ }
+ shift = big2ulong(y, "long", TRUE);
+ break;
}
y = rb_to_int(y);
}
+
+ x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
+ return bignorm(x);
+}
+
+static VALUE
+big_rshift(VALUE x, unsigned long shift)
+{
+ BDIGIT *xds, *zds;
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ VALUE z;
+ BDIGIT_DBL num = 0;
+ long i, j;
+ volatile VALUE save_x;
+
+ if (s1 > RBIGNUM_LEN(x)) {
+ if (RBIGNUM_SIGN(x))
+ return INT2FIX(0);
+ else
+ return INT2FIX(-1);
+ }
+ if (!RBIGNUM_SIGN(x)) {
+ x = rb_big_clone(x);
+ get2comp(x);
+ }
+ save_x = x;
+ xds = BDIGITS(x);
+ i = RBIGNUM_LEN(x); j = i - s1;
+ if (j == 0) {
+ if (RBIGNUM_SIGN(x)) return INT2FIX(0);
+ else return INT2FIX(-1);
+ }
+ z = bignew(j, RBIGNUM_SIGN(x));
+ if (!RBIGNUM_SIGN(x)) {
+ num = ((BDIGIT_DBL)~0) << BITSPERDIG;
+ }
+ zds = BDIGITS(z);
+ while (i--, j--) {
+ num = (num | xds[i]) >> s2;
+ zds[j] = BIGLO(num);
+ num = BIGUP(xds[i]);
+ }
+ if (!RBIGNUM_SIGN(x)) {
+ get2comp(z);
+ }
+ RB_GC_GUARD(save_x);
+ return z;
}
/*
@@ -6754,45 +3682,42 @@ static VALUE
rb_big_aref(VALUE x, VALUE y)
{
BDIGIT *xds;
- size_t shift;
- size_t i, s1, s2;
- long l;
- BDIGIT bit;
+ BDIGIT_DBL num;
+ VALUE shift;
+ long i, s1, s2;
- if (RB_BIGNUM_TYPE_P(y)) {
- if (!BIGNUM_SIGN(y))
+ if (RB_TYPE_P(y, T_BIGNUM)) {
+ if (!RBIGNUM_SIGN(y))
return INT2FIX(0);
bigtrunc(y);
- if (BIGSIZE(y) > sizeof(size_t)) {
+ if (RBIGNUM_LEN(y) > DIGSPERLONG) {
out_of_range:
- return BIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
+ return RBIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
}
-#if SIZEOF_SIZE_T <= SIZEOF_LONG
- shift = big2ulong(y, "long");
-#else
- shift = big2ull(y, "long long");
-#endif
+ shift = big2ulong(y, "long", FALSE);
}
else {
- l = NUM2LONG(y);
- if (l < 0) return INT2FIX(0);
- shift = (size_t)l;
+ i = NUM2LONG(y);
+ if (i < 0) return INT2FIX(0);
+ shift = (VALUE)i;
}
s1 = shift/BITSPERDIG;
s2 = shift%BITSPERDIG;
- bit = (BDIGIT)1 << s2;
- if (s1 >= BIGNUM_LEN(x)) goto out_of_range;
-
- xds = BDIGITS(x);
- if (BIGNUM_POSITIVE_P(x))
- return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
- if (xds[s1] & (bit-1))
- return (xds[s1] & bit) ? INT2FIX(0) : INT2FIX(1);
- for (i = 0; i < s1; i++)
- if (xds[i])
- return (xds[s1] & bit) ? INT2FIX(0) : INT2FIX(1);
- return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
+ if (s1 >= RBIGNUM_LEN(x)) goto out_of_range;
+ if (!RBIGNUM_SIGN(x)) {
+ xds = BDIGITS(x);
+ i = 0; num = 1;
+ while (num += ~xds[i], ++i <= s1) {
+ num = BIGDN(num);
+ }
+ }
+ else {
+ num = BDIGITS(x)[s1];
+ }
+ if (num & ((BDIGIT_DBL)1<<s2))
+ return INT2FIX(1);
+ return INT2FIX(0);
}
/*
@@ -6800,31 +3725,19 @@ rb_big_aref(VALUE x, VALUE y)
* big.hash -> fixnum
*
* Compute a hash based on the value of _big_.
- *
- * See also Object#hash.
*/
-VALUE
+static VALUE
rb_big_hash(VALUE x)
{
st_index_t hash;
- hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*BIGNUM_LEN(x)) ^ BIGNUM_SIGN(x);
+ hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*RBIGNUM_LEN(x)) ^ RBIGNUM_SIGN(x);
return INT2FIX(hash);
}
/*
- * call-seq:
- * big.coerce(numeric) -> array
- *
- * Returns an array with both a +numeric+ and a +big+ represented as Bignum
- * objects.
- *
- * This is achieved by converting +numeric+ to a Bignum.
- *
- * A TypeError is raised if the +numeric+ is not a Fixnum or Bignum type.
- *
- * (0x3FFFFFFFFFFFFFFF+1).coerce(42) #=> [42, 4611686018427387904]
+ * MISSING: documentation
*/
static VALUE
@@ -6833,9 +3746,9 @@ rb_big_coerce(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
}
- else if (!RB_BIGNUM_TYPE_P(y)) {
- rb_raise(rb_eTypeError, "can't coerce %"PRIsVALUE" to Bignum",
- rb_obj_class(y));
+ else if (!RB_TYPE_P(y, T_BIGNUM)) {
+ rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
+ rb_obj_classname(y));
}
return rb_assoc_new(y, x);
}
@@ -6843,7 +3756,6 @@ rb_big_coerce(VALUE x, VALUE y)
/*
* call-seq:
* big.abs -> aBignum
- * big.magnitude -> aBignum
*
* Returns the absolute value of <i>big</i>.
*
@@ -6853,9 +3765,9 @@ rb_big_coerce(VALUE x, VALUE y)
static VALUE
rb_big_abs(VALUE x)
{
- if (!BIGNUM_SIGN(x)) {
+ if (!RBIGNUM_SIGN(x)) {
x = rb_big_clone(x);
- BIGNUM_SET_SIGN(x, 1);
+ RBIGNUM_SET_SIGN(x, 1);
}
return x;
}
@@ -6875,86 +3787,7 @@ rb_big_abs(VALUE x)
static VALUE
rb_big_size(VALUE big)
{
- return SIZET2NUM(BIGSIZE(big));
-}
-
-/*
- * call-seq:
- * int.bit_length -> integer
- *
- * Returns the number of bits of the value of <i>int</i>.
- *
- * "the number of bits" means that
- * the bit position of the highest bit which is different to the sign bit.
- * (The bit position of the bit 2**n is n+1.)
- * If there is no such bit (zero or minus one), zero is returned.
- *
- * I.e. This method returns ceil(log2(int < 0 ? -int : int+1)).
- *
- * (-2**10000-1).bit_length #=> 10001
- * (-2**10000).bit_length #=> 10000
- * (-2**10000+1).bit_length #=> 10000
- *
- * (-2**1000-1).bit_length #=> 1001
- * (-2**1000).bit_length #=> 1000
- * (-2**1000+1).bit_length #=> 1000
- *
- * (2**1000-1).bit_length #=> 1000
- * (2**1000).bit_length #=> 1001
- * (2**1000+1).bit_length #=> 1001
- *
- * (2**10000-1).bit_length #=> 10000
- * (2**10000).bit_length #=> 10001
- * (2**10000+1).bit_length #=> 10001
- *
- * This method can be used to detect overflow in Array#pack as follows.
- *
- * if n.bit_length < 32
- * [n].pack("l") # no overflow
- * else
- * raise "overflow"
- * end
- */
-
-static VALUE
-rb_big_bit_length(VALUE big)
-{
- int nlz_bits;
- size_t numbytes;
-
- static const BDIGIT char_bit[1] = { CHAR_BIT };
- BDIGIT numbytes_bary[bdigit_roomof(sizeof(size_t))];
- BDIGIT nlz_bary[1];
- BDIGIT result_bary[bdigit_roomof(sizeof(size_t)+1)];
-
- numbytes = rb_absint_size(big, &nlz_bits);
-
- if (numbytes == 0)
- return LONG2FIX(0);
-
- if (BIGNUM_NEGATIVE_P(big) && rb_absint_singlebit_p(big)) {
- if (nlz_bits != CHAR_BIT-1) {
- nlz_bits++;
- }
- else {
- nlz_bits = 0;
- numbytes--;
- }
- }
-
- if (numbytes <= SIZE_MAX / CHAR_BIT) {
- return SIZET2NUM(numbytes * CHAR_BIT - nlz_bits);
- }
-
- nlz_bary[0] = nlz_bits;
-
- bary_unpack(BARY_ARGS(numbytes_bary), &numbytes, 1, sizeof(numbytes), 0,
- INTEGER_PACK_NATIVE_BYTE_ORDER);
- BARY_SHORT_MUL(result_bary, numbytes_bary, char_bit);
- BARY_SUB(result_bary, result_bary, nlz_bary);
-
- return rb_integer_unpack(result_bary, numberof(result_bary), sizeof(BDIGIT), 0,
- INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
+ return LONG2FIX(RBIGNUM_LEN(big)*SIZEOF_BDIGITS);
}
/*
@@ -6967,7 +3800,7 @@ rb_big_bit_length(VALUE big)
static VALUE
rb_big_odd_p(VALUE num)
{
- if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ if (BDIGITS(num)[0] & 1) {
return Qtrue;
}
return Qfalse;
@@ -6983,7 +3816,7 @@ rb_big_odd_p(VALUE num)
static VALUE
rb_big_even_p(VALUE num)
{
- if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ if (BDIGITS(num)[0] & 1) {
return Qfalse;
}
return Qtrue;
@@ -7048,14 +3881,11 @@ Init_Bignum(void)
rb_define_method(rb_cBignum, "abs", rb_big_abs, 0);
rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0);
rb_define_method(rb_cBignum, "size", rb_big_size, 0);
- rb_define_method(rb_cBignum, "bit_length", rb_big_bit_length, 0);
rb_define_method(rb_cBignum, "odd?", rb_big_odd_p, 0);
rb_define_method(rb_cBignum, "even?", rb_big_even_p, 0);
-#ifdef USE_GMP
- /* The version of loaded GMP. */
- rb_define_const(rb_cBignum, "GMP_VERSION", rb_sprintf("GMP %s", gmp_version));
-#endif
-
power_cache_init();
+
+ big_three = rb_uint2big(3);
+ rb_gc_register_mark_object(big_three);
}
diff --git a/bin/erb b/bin/erb
index 6a88c3b26a..6b92ac2284 100755
--- a/bin/erb
+++ b/bin/erb
@@ -11,8 +11,7 @@ class ERB
return nil if self.empty?
arg = self.shift
return nil if arg == '--'
- case arg
- when /\A-(.)(.*)/
+ if arg =~ /^-(.)(.*)/
if $1 == '-'
arg, @maybe_arg = arg.split(/=/, 2)
return arg
@@ -25,8 +24,6 @@ class ERB
@maybe_arg = nil
end
"-#{$1}"
- when /\A(\w+)=/
- arg
else
self.unshift arg
nil
@@ -57,7 +54,6 @@ class ERB
def run(factory=ERB)
trim_mode = 0
disable_percent = false
- variables = {}
begin
while switch = ARGV.switch
case switch
@@ -76,7 +72,7 @@ class ERB
require ARGV.req_arg
when '-S' # security level
arg = ARGV.req_arg
- raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-1]\z/
+ raise "invalid safe_level #{arg.dump}" unless arg =~ /^[0-4]$/
safe_level = arg.to_i
when '-T' # trim mode
arg = ARGV.req_arg
@@ -84,7 +80,7 @@ class ERB
trim_mode = arg
next
end
- raise "invalid trim mode #{arg.dump}" unless arg =~ /\A[0-2]\z/
+ raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
trim_mode = arg.to_i
when '-E', '--encoding'
arg = ARGV.req_arg
@@ -95,29 +91,25 @@ class ERB
disable_percent = true
when '--help'
raise "print this help"
- when /\A-/
- raise "unknown switch #{switch.dump}"
else
- var, val = *switch.split('=', 2)
- (variables ||= {})[var] = val
+ raise "unknown switch #{switch.dump}"
end
end
rescue # usage
STDERR.puts $!.to_s
STDERR.puts File.basename($0) +
- " [switches] [var=value...] [inputfile]"
+ " [switches] [inputfile]"
STDERR.puts <<EOU
-x print ruby script
-n print ruby script with line number
-v enable verbose mode
-d set $DEBUG to true
-r library load a library
- -S safe_level set $SAFE (0..1)
+ -S safe_level set $SAFE (0..4)
-E ex[:in] set default external/internal encodings
-U set default encoding to UTF-8.
-T trim_mode specify trim_mode (0..2, -)
-P ignore lines which start with "%"
- var=value set variable
EOU
exit 1
end
@@ -138,23 +130,15 @@ EOU
puts erb.src
end
else
- bind = TOPLEVEL_BINDING.taint
- if variables
- enc = erb.encoding
- for var, val in variables do
- val = val.encode(enc) if val
- bind.local_variable_set(var, val)
- end
- end
- erb.run(bind)
+ erb.run(TOPLEVEL_BINDING.taint)
end
end
module_function :run
def set_encoding(extern, intern = nil)
verbose, $VERBOSE = $VERBOSE, nil
- Encoding.default_external = extern unless extern.nil? || extern == ""
- Encoding.default_internal = intern unless intern.nil? || intern == ""
+ Encoding.default_external = extern unless extern.nil? || extern.empty?
+ Encoding.default_internal = intern unless intern.nil? || intern.empty?
[$stdin, $stdout, $stderr].each do |io|
io.set_encoding(extern, intern)
end
diff --git a/bin/irb b/bin/irb
index c64ee85fbd..6c8465c802 100755
--- a/bin/irb
+++ b/bin/irb
@@ -8,4 +8,13 @@
require "irb"
-IRB.start(__FILE__)
+if __FILE__ == $0
+ IRB.start(__FILE__)
+else
+ # check -e option
+ if /^-e$/ =~ $0
+ IRB.start(__FILE__)
+ else
+ IRB.setup(__FILE__)
+ end
+end
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000000..6aad2f0df3
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,37 @@
+#!/usr/bin/env ruby
+
+#--
+# Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#++
+
+begin
+ require 'rubygems'
+ gem 'rake'
+rescue LoadError
+end
+
+module Rake
+ REDUCE_COMPAT = true if ARGV.include?("--reduce-compat")
+end
+
+require 'rake'
+
+Rake.application.run
diff --git a/bin/testrb b/bin/testrb
new file mode 100755
index 0000000000..23a00b439f
--- /dev/null
+++ b/bin/testrb
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require 'test/unit'
+exit Test::Unit::AutoRunner.run(true)
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 5eb468a338..08c335ae42 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -62,7 +62,6 @@ def main
@verbose = false
$stress = false
@color = nil
- @tty = nil
@quiet = false
dir = nil
quiet = false
@@ -88,10 +87,6 @@ def main
warn "unknown --color argument: #$3" if $3
@color = $1 ? nil : !$2
true
- when /\A--tty(=(?:yes|(no)|(.*)))?\z/
- warn "unknown --tty argument: #$3" if $3
- @tty = !$1 || !$2
- true
when /\A(-q|--q(uiet))\z/
quiet = true
@quiet = true
@@ -128,7 +123,7 @@ End
@progress = %w[- \\ | /]
@progress_bs = "\b" * @progress[0].size
- @tty = $stderr.tty? if @tty.nil?
+ @tty = $stderr.tty?
case @color
when nil
@color = @tty && /dumb/ !~ ENV["TERM"]
@@ -136,18 +131,13 @@ End
@tty &&= !@verbose
if @color
# dircolors-like style
- colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
- begin
- File.read(File.join(__dir__, "../test/colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
- colors[n] ||= c
- end
- rescue
- end
- @passed = "\e[;#{colors["pass"] || "32"}m"
- @failed = "\e[;#{colors["fail"] || "31"}m"
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
@reset = "\e[m"
+ @erase = "\r\e[2K\r"
else
- @passed = @failed = @reset = ""
+ @passed = @failed = @reset = @erase = ""
end
unless quiet
puts Time.now
@@ -168,56 +158,40 @@ End
}
end
-def erase(e = true)
- if e and @columns > 0 and !@verbose
- "\r#{" "*@columns}\r"
- else
- ""
- end
-end
-
def exec_test(pathes)
@count = 0
@error = 0
@errbuf = []
@location = nil
- @columns = 0
- @width = pathes.map {|path| File.basename(path).size}.max + 2
pathes.each do |path|
@basename = File.basename(path)
- $stderr.printf("%s%-*s ", erase(@quiet), @width, @basename)
- $stderr.flush
- @columns = @width + 1
+ $stderr.print @basename, " "
$stderr.puts if @verbose
count = @count
error = @error
load File.expand_path(path)
if @tty
if @error == error
- msg = "PASS #{@count-count}"
- @columns += msg.size - 1
- $stderr.print "#{@progress_bs}#{@passed}#{msg}#{@reset}"
+ $stderr.print "#{@progress_bs}#{@passed}PASS #{@count-count}#{@reset}"
+ $stderr.print @erase if @quiet
else
- msg = "FAIL #{@error-error}/#{@count-count}"
- $stderr.print "#{@progress_bs}#{@failed}#{msg}#{@reset}"
- @columns = 0
+ $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
end
end
- $stderr.puts unless @quiet and @tty and @error == error
+ $stderr.puts unless @quiet
end
- $stderr.print(erase) if @quiet
if @error == 0
if @count == 0
$stderr.puts "No tests, no problem"
else
- $stderr.puts "#{@passed}PASS#{@reset} all #{@count} tests"
+ $stderr.puts "PASS all #{@count} tests"
end
exit true
else
@errbuf.each do |msg|
$stderr.puts msg
end
- $stderr.puts "#{@failed}FAIL#{@reset} #{@error}/#{@count} tests failed"
+ $stderr.puts "FAIL #{@error}/#{@count} tests failed"
exit false
end
end
@@ -228,28 +202,23 @@ def show_progress(message = '')
elsif @tty
$stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
end
- t = Time.now if @verbose
faildesc, errout = with_stderr {yield}
- t = Time.now - t if @verbose
if !faildesc
if @tty
$stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
- elsif @verbose
- $stderr.printf(". %.3f\n", t)
else
$stderr.print '.'
end
+ $stderr.puts if @verbose
else
- $stderr.print "#{@failed}F"
- $stderr.printf(" %.3f", t) if @verbose
- $stderr.print "#{@reset}"
+ $stderr.print "#{@failed}F#{@reset}"
$stderr.puts if @verbose
error faildesc, message
unless errout.empty?
$stderr.print "#{@failed}stderr output is not empty#{@reset}\n", adjust_indent(errout)
end
if @tty and !@verbose
- $stderr.printf("%-*s%s", @width, @basename, @progress[@count % @progress.size])
+ $stderr.print @basename, " ", @progress[@count % @progress.size]
end
end
rescue Interrupt
@@ -347,7 +316,7 @@ def assert_normal_exit(testsrc, *rest)
$stderr.reopen(old_stderr)
old_stderr.close
end
- if status&.signaled?
+ if status.signaled?
signo = status.termsig
signame = Signal.list.invert[signo]
unless ignore_signals and ignore_signals.include?(signame)
@@ -411,7 +380,7 @@ end
INDENT = 27
def adjust_indent(src)
- untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ').sub(/\s*\z/, "\n")
+ untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ')
end
def untabify(str)
@@ -433,7 +402,7 @@ def get_result_string(src, opt = '')
begin
`#{@ruby} -W0 #{opt} #{filename}`
ensure
- raise Interrupt if $? and $?.signaled? && $?.termsig == Signal.list["INT"]
+ raise Interrupt if $?.signaled? && $?.termsig == Signal.list["INT"]
raise CoreDumpError, "core dumped" if $? and $?.coredump?
end
else
@@ -471,7 +440,7 @@ end
def error(msg, additional_message)
msg = "#{@failed}\##{@count} #{@location}#{@reset}: #{msg} #{additional_message}"
if @tty
- $stderr.puts "#{erase}#{msg}"
+ $stderr.puts "#{@erase}#{msg}"
else
@errbuf.push msg
end
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb
index a9f8e6dacd..e8df6684b6 100644
--- a/bootstraptest/test_autoload.rb
+++ b/bootstraptest/test_autoload.rb
@@ -43,6 +43,46 @@ assert_equal 'ok', %q{
ZZZ.ok
}
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ require "./zzz.rb"
+ proc{$SAFE=4; ZZZ.ok}.call
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{M.instance_eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{$SAFE=4; M.instance_eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ Thread.new{$SAFE=4; eval('ZZZ.new.hoge')}.value
+}
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"}
+ autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb')
+ module M; end
+ Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value
+}
+
assert_equal 'okok', %q{
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
autoload :ZZZ, "./zzz.rb"
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index cdc5960a59..6a2ccfc6da 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -597,17 +597,3 @@ assert_equal 'true', %q{
C1.new.foo{}
}
-assert_equal 'ok', %q{
- 1.times do
- begin
- raise
- rescue
- begin
- raise
- rescue
- break
- end
- end
- end
- 'ok'
-}
diff --git a/bootstraptest/test_class.rb b/bootstraptest/test_class.rb
index b7fe0a1acd..664dd2f166 100644
--- a/bootstraptest/test_class.rb
+++ b/bootstraptest/test_class.rb
@@ -11,16 +11,6 @@ assert_equal 'C', %q( class C; end
C.new.class.name )
assert_equal 'Class', %q( class C; end
C.new.class.class )
-assert_equal 'true', %q( Object.__send__(:remove_const, :TrueClass)
- GC.start
- true.inspect)
-assert_equal 'false', %q( Object.__send__(:remove_const, :FalseClass)
- GC.start
- false.inspect)
-assert_equal 'nil', %q( Object.__send__(:remove_const, :NilClass)
- GC.start
- nil.inspect)
-
# inherited class
assert_equal 'true', %q( class A; end
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
index 1cd9f7ac6c..384294727f 100644
--- a/bootstraptest/test_fork.rb
+++ b/bootstraptest/test_fork.rb
@@ -22,32 +22,26 @@ assert_finish 10, %q{
}, '[ruby-core:22158]'
assert_normal_exit(<<'End', '[ruby-dev:37934]')
- main = Thread.current
- Thread.new { sleep 0.01 until main.stop?; Thread.kill main }
- Process.setrlimit(:NPROC, 1) if defined?(Process::RLIMIT_NPROC)
+ Thread.new { sleep 1; Thread.kill Thread.main }
+ Process.setrlimit(:NPROC, 1)
fork {}
End
assert_equal 'ok', %q{
begin
- r, w = IO.pipe
if pid1 = fork
- w.close
- r.read(1)
+ sleep 1
Process.kill("USR1", pid1)
_, s = Process.wait2(pid1)
s.success? ? :ok : :ng
else
- r.close
if pid2 = fork
- trap("USR1") { Time.now.to_s; Process.kill("USR2", pid2) }
- w.close
+ trap("USR1") { Time.now.to_s }
Process.wait2(pid2)
else
- w.close
- sleep 0.2
+ sleep 2
end
- exit true
+ exit 0
end
rescue NotImplementedError
:ok
@@ -56,17 +50,17 @@ assert_equal 'ok', %q{
assert_equal '[1, 2]', %q{
a = []
- main = Thread.current
- trap(:INT) { a.push(1).size == 2 and main.wakeup }
- trap(:TERM) { a.push(2).size == 2 and main.wakeup }
+ trap(:INT) { a.push(1) }
+ trap(:TERM) { a.push(2) }
pid = $$
begin
- pid = fork do
+ fork do
+ sleep 0.5
Process.kill(:INT, pid)
Process.kill(:TERM, pid)
end
- Process.wait(pid)
- 100.times {break if a.size > 1; sleep 0.001}
+
+ sleep 1
a.sort
rescue NotImplementedError
[1, 2]
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index 1d2b19368a..f7360f34b3 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -2,8 +2,9 @@ assert_finish 5, %q{
r, w = IO.pipe
t1 = Thread.new { r.sysread(1) }
t2 = Thread.new { r.sysread(1) }
- sleep 0.01 until t1.stop? and t2.stop?
+ sleep 0.1
w.write "a"
+ sleep 0.1
w.write "a"
}, '[ruby-dev:31866]'
@@ -26,16 +27,16 @@ assert_finish 10, %q{
t1.join
t2.join
end
- rescue LoadError, Timeout::Error, NotImplementedError
+ rescue LoadError, TimeoutError, NotImplementedError
end
}, '[ruby-dev:32566]'
assert_finish 1, %q{
r, w = IO.pipe
Thread.new {
- w << "ab"
- sleep 0.01
- w << "ab"
+ w << "ab"
+ sleep 0.1
+ w << "ab"
}
r.gets("abab")
}
@@ -90,8 +91,7 @@ assert_normal_exit %q{
megacontent = "abc" * 12345678
#File.open("megasrc", "w") {|f| f << megacontent }
- t0 = Thread.main
- Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) }
+ Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }
r1, w1 = IO.pipe
r2, w2 = IO.pipe
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index aa65bddae1..5a9497c642 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -84,7 +84,7 @@ assert_equal '0', 're = /test/; re =~ "test"'
assert_equal '0', 'str = "test"; /test/ =~ str'
assert_equal '0', 're = /test/; str = "test"; re =~ str'
-# dynamic regexp
+# dynacmi regexp
assert_equal 'regexp', %q(/re#{'ge'}xp/.source)
assert_equal 'Regexp', %q(/re#{'ge'}xp/.class)
@@ -224,8 +224,3 @@ assert_equal 'ok', %q{ # long hash literal (optimized)
eval "a = {#{(1..10_000).map{|n| "#{n} => #{n}"}.join(', ')}}"
:ok
}
-
-assert_equal 'ok', %q{
- [print(:ok), exit] # void literal with side-effect
- :dummy
-}
diff --git a/bootstraptest/test_literal_suffix.rb b/bootstraptest/test_literal_suffix.rb
deleted file mode 100644
index 4316c9e040..0000000000
--- a/bootstraptest/test_literal_suffix.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# numbers with suffix
-assert_equal '0/1', '0r'
-assert_equal 'Rational', '0r.class'
-assert_equal '1/1', '1r'
-assert_equal 'Rational', '1r.class'
-assert_equal '-1/1', '-1r'
-assert_equal 'Rational', '(-1r).class'
-assert_equal '1/1', '0x1r'
-assert_equal 'Rational', '0x1r.class'
-assert_equal '1/1', '0b1r'
-assert_equal 'Rational', '0b1r.class'
-assert_equal '1/1', '0d1r'
-assert_equal 'Rational', '0d1r.class'
-assert_equal '1/1', '0o1r'
-assert_equal 'Rational', '0o1r.class'
-assert_equal '1/1', '01r'
-assert_equal 'Rational', '01r.class'
-assert_equal '6/5', '1.2r'
-assert_equal 'Rational', '1.2r.class'
-assert_equal '-6/5', '-1.2r'
-assert_equal 'Rational', '(-1.2r).class'
-assert_equal '0+0i', '0i'
-assert_equal 'Complex', '0i.class'
-assert_equal '0+1i', '1i'
-assert_equal 'Complex', '1i.class'
-assert_equal '0+1i', '0x1i'
-assert_equal 'Complex', '0x1i.class'
-assert_equal '0+1i', '0b1i'
-assert_equal 'Complex', '0b1i.class'
-assert_equal '0+1i', '0d1i'
-assert_equal 'Complex', '0d1i.class'
-assert_equal '0+1i', '0o1i'
-assert_equal 'Complex', '0o1i.class'
-assert_equal '0+1i', '01i'
-assert_equal 'Complex', '01i.class'
-assert_equal '0+1.2i', '1.2i'
-assert_equal 'Complex', '1.2i.class'
-assert_equal '0+1/1i', '1ri'
-assert_equal 'Complex', '1ri.class'
-assert_equal '0+6/5i', '1.2ri'
-assert_equal 'Complex', '1.2ri.class'
-assert_equal '0+10.0i', '1e1i'
-assert_equal 'Complex', '1e1i.class'
-assert_equal '1', '1if true'
-assert_equal '1', '1rescue nil'
-assert_equal '10000000000000000001/10000000000000000000',
- '1.0000000000000000001r'
-
-assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
- %q{begin eval('1ir', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
-assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
- %q{begin eval('1.2ir', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
-assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
- %q{begin eval('1e1r', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 3462aa9434..ed22608aea 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -3,7 +3,7 @@ assert_equal '1', 'def m() 1 end; m()'
assert_equal '1', 'def m(a) a end; m(1)'
assert_equal '[1, 2]', 'def m(a,b) [a, b] end; m(1,2)'
assert_equal '[1, 2, 3]', 'def m(a,b,c) [a, b, c] end; m(1,2,3)'
-assert_match /\Awrong number of arguments \(.*\b1\b.* 0\)\z/, %q{
+assert_equal 'wrong number of arguments (1 for 0)', %q{
def m; end
begin
m(1)
@@ -12,7 +12,7 @@ assert_match /\Awrong number of arguments \(.*\b1\b.* 0\)\z/, %q{
end
}
-assert_match /\Awrong number of arguments \(.*\b0\b.* 1\)\z/, %q{
+assert_equal 'wrong number of arguments (0 for 1)', %q{
def m a; end
begin
m
@@ -886,6 +886,50 @@ class C0; def m *args; [:C0_m, args]; end; end
class C1 < C0; def m a, o=:o; super; end; end
; C1.new.m 1, 2}
+assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
+ $ans = []
+ class Foo
+ def m
+ end
+ end
+
+ c1 = c2 = nil
+
+ lambda{
+ $SAFE = 4
+ c1 = Class.new{
+ def m
+ end
+ }
+ c2 = Class.new(Foo){
+ alias mm m
+ }
+ }.call
+
+ def test
+ begin
+ yield
+ rescue SecurityError
+ $ans << :ok
+ else
+ $ans << :ng
+ end
+ end
+
+ o1 = c1.new
+ o2 = c2.new
+
+ test{o1.m}
+ test{o2.mm}
+ test{o1.send :m}
+ test{o2.send :mm}
+ test{o1.public_send :m}
+ test{o2.public_send :mm}
+ test{o1.method(:m).call}
+ test{o2.method(:mm).call}
+ $ans
+}
+
assert_equal 'ok', %q{
class C
def x=(n)
@@ -910,6 +954,34 @@ assert_equal 'ok', %q{
}, '[ruby-core:11998]'
assert_equal 'ok', %q{
+ proc{
+ $SAFE = 2
+ class C
+ def m
+ :ok
+ end
+ end
+ }.call
+ C.new.m
+}, '[ruby-core:11998]'
+
+assert_equal 'ok', %q{
+ proc{
+ $SAFE = 3
+ class C
+ def m
+ :ng
+ end
+ end
+ }.call
+ begin
+ C.new.m
+ rescue SecurityError
+ :ok
+ end
+}, '[ruby-core:11998]'
+
+assert_equal 'ok', %q{
class B
def m() :fail end
end
@@ -929,8 +1001,8 @@ assert_equal 'ok', %q{
assert_normal_exit %q{
begin
- Process.setrlimit(Process::RLIMIT_STACK, 4_206_592)
- # FreeBSD SEGVs this less than 4M + 12K bytes.
+ Process.setrlimit(Process::RLIMIT_STACK, 4_202_496)
+ # FreeBSD fails this less than 4M + 8K bytes.
rescue Exception
exit
end
diff --git a/bootstraptest/test_string.rb b/bootstraptest/test_string.rb
deleted file mode 100644
index 849dcd45b0..0000000000
--- a/bootstraptest/test_string.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-assert_normal_exit %q{
- inspect.clear
-}, '[ruby-core:68110]'
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index a111990a1f..80eaa6416d 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -376,8 +376,6 @@ assert_equal %q{1}, %q{1 or 2 or 3 or 4}
assert_equal %q{1}, %q{1 or false or 3 or 4}
assert_equal %q{2}, %q{nil or 2 or 3 or 4}
assert_equal %q{2}, %q{false or 2 or 3 or 4}
-assert_equal %q{1}, %q{if true && ""; then 1; end}
-assert_equal %q{1}, %q{if nil || true; then 1; end}
assert_equal %q{false}, %q{nil or false or nil or false}
assert_equal %q{elseng}, %q{
case
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index d64f44be49..121def8b42 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -10,8 +10,7 @@ assert_equal %q{ok}, %q{
:ok
}.value
}
-assert_equal %q{ok}, %q{
-begin
+assert_equal %q{20100}, %q{
v = 0
(1..200).map{|i|
Thread.new{
@@ -20,10 +19,7 @@ begin
}.each{|t|
v += t.value
}
- v == 20100 ? :ok : v
-rescue ThreadError => e
- :ok if /can't create Thread/ =~ e.message
-end
+ v
}
assert_equal %q{5000}, %q{
5000.times{|e|
@@ -45,17 +41,13 @@ assert_equal %q{5000}, %q{
}
}
}
-assert_equal %q{ok}, %q{
-begin
- :ok if 5000 == 5000.times{
+assert_equal %q{5000}, %q{
+ 5000.times{
t = Thread.new{}
while t.alive?
Thread.pass
end
}
-rescue NoMemoryError
- :ok
-end
}
assert_equal %q{100}, %q{
100.times{
@@ -85,7 +77,7 @@ assert_equal %q{ok}, %q{
ans = :ok
end
}
- Thread.pass until t.stop?
+ Thread.pass
t.kill
t.join
ans
@@ -241,16 +233,16 @@ assert_equal 'ok', %{
}
assert_finish 3, %{
- th = Thread.new {sleep 0.2}
- th.join(0.1)
+ th = Thread.new {sleep 2}
+ th.join(1)
th.join
}
assert_finish 3, %{
require 'timeout'
- th = Thread.new {sleep 0.2}
+ th = Thread.new {sleep 2}
begin
- Timeout.timeout(0.1) {th.join}
+ Timeout.timeout(1) {th.join}
rescue Timeout::Error
end
th.join
@@ -276,7 +268,7 @@ assert_normal_exit %q{
assert_equal 'ok', %q{
def m
t = Thread.new { while true; // =~ "" end }
- sleep 0.01
+ sleep 0.1
10.times {
if /((ab)*(ab)*)*(b)/ =~ "ab"*7
return :ng if !$4
@@ -340,9 +332,8 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
begin
m1, m2 = Mutex.new, Mutex.new
- f1 = f2 = false
- Thread.new { m1.lock; f2 = true; sleep 0.001 until f1; m2.lock }
- m2.lock; f1 = true; sleep 0.001 until f2; m1.lock
+ Thread.new { m1.lock; sleep 1; m2.lock }
+ m2.lock; sleep 1; m1.lock
:ng
rescue Exception
:ok
@@ -351,7 +342,7 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock }; sleep 0.1; m.lock
+ Thread.new { m.lock }; sleep 1; m.lock
:ok
}
@@ -369,15 +360,15 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock; sleep 0.2 }
- sleep 0.1; m.lock
+ Thread.new { m.lock; sleep 2 }
+ sleep 1; m.lock
:ok
}
assert_equal 'ok', %q{
m = Mutex.new
- Thread.new { m.lock; sleep 0.2; m.unlock }
- sleep 0.1; m.lock
+ Thread.new { m.lock; sleep 2; m.unlock }
+ sleep 1; m.lock
:ok
}
@@ -399,20 +390,19 @@ assert_equal 'ok', %q{
assert_equal 'ok', %{
open("zzz.rb", "w") do |f|
- f.puts <<-'end;' # do
+ f.puts <<-END
begin
m = Mutex.new
+ Thread.new { m.lock; sleep 1 }
+ sleep 0.3
parent = Thread.current
- th1 = Thread.new { m.lock; sleep }
- sleep 0.01 until th1.stop?
Thread.new do
- sleep 0.01 until parent.stop?
+ sleep 0.3
begin
fork { GC.start }
rescue Exception
parent.raise $!
end
- th1.run
end
m.lock
pid, status = Process.wait2
@@ -420,7 +410,7 @@ assert_equal 'ok', %{
rescue NotImplementedError
$result = :ok
end
- end;
+ END
end
require "./zzz.rb"
$result
@@ -450,27 +440,17 @@ assert_finish 3, %q{
assert_equal 'ok', %q{
begin
- Process.waitpid2(fork {})[1].success? ? 'ok' : 'ng'
+ Process.waitpid2(fork {sleep 1})[1].success? ? 'ok' : 'ng'
rescue NotImplementedError
'ok'
end
}
assert_equal 'foo', %q{
- i = 0
- Thread.start {sleep 1; exit!}
- f = proc {|s, c| /#{c.call; s}/o }
- th2 = Thread.new {
- sleep 0.01 until i == 1
- i = 2
- f.call("bar", proc {sleep 2});
- nil
- }
- th1 = Thread.new {
- f.call("foo", proc {i = 1; sleep 0.01 until i == 2; sleep 0.01})
- nil
- }
- [th1, th2].each {|t| t.join }
+ f = proc {|s| /#{ sleep 1; s }/o }
+ [ Thread.new { f.call("foo"); nil },
+ Thread.new { sleep 0.5; f.call("bar"); nil },
+ ].each {|t| t.join }
GC.start
f.call.source
}
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
deleted file mode 100644
index a04d1d4709..0000000000
--- a/ccan/build_assert/build_assert.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
-#ifndef CCAN_BUILD_ASSERT_H
-#define CCAN_BUILD_ASSERT_H
-
-/**
- * BUILD_ASSERT - assert a build-time dependency.
- * @cond: the compile-time condition which must be true.
- *
- * Your compile will fail if the condition isn't true, or can't be evaluated
- * by the compiler. This can only be used within a function.
- *
- * Example:
- * #include <stddef.h>
- * ...
- * static char *foo_to_char(struct foo *foo)
- * {
- * // This code needs string to be at start of foo.
- * BUILD_ASSERT(offsetof(struct foo, string) == 0);
- * return (char *)foo;
- * }
- */
-#define BUILD_ASSERT(cond) \
- do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
-
-/**
- * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
- * @cond: the compile-time condition which must be true.
- *
- * Your compile will fail if the condition isn't true, or can't be evaluated
- * by the compiler. This can be used in an expression: its value is "0".
- *
- * Example:
- * #define foo_to_char(foo) \
- * ((char *)(foo) \
- * + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
- */
-#define BUILD_ASSERT_OR_ZERO(cond) \
- (sizeof(char [1 - 2*!(cond)]) - 1)
-
-#endif /* CCAN_BUILD_ASSERT_H */
diff --git a/ccan/check_type/check_type.h b/ccan/check_type/check_type.h
deleted file mode 100644
index 1f77a535e4..0000000000
--- a/ccan/check_type/check_type.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
-#ifndef CCAN_CHECK_TYPE_H
-#define CCAN_CHECK_TYPE_H
-
-/**
- * check_type - issue a warning or build failure if type is not correct.
- * @expr: the expression whose type we should check (not evaluated).
- * @type: the exact type we expect the expression to be.
- *
- * This macro is usually used within other macros to try to ensure that a macro
- * argument is of the expected type. No type promotion of the expression is
- * done: an unsigned int is not the same as an int!
- *
- * check_type() always evaluates to 0.
- *
- * If your compiler does not support typeof, then the best we can do is fail
- * to compile if the sizes of the types are unequal (a less complete check).
- *
- * Example:
- * // They should always pass a 64-bit value to _set_some_value!
- * #define set_some_value(expr) \
- * _set_some_value((check_type((expr), uint64_t), (expr)))
- */
-
-/**
- * check_types_match - issue a warning or build failure if types are not same.
- * @expr1: the first expression (not evaluated).
- * @expr2: the second expression (not evaluated).
- *
- * This macro is usually used within other macros to try to ensure that
- * arguments are of identical types. No type promotion of the expressions is
- * done: an unsigned int is not the same as an int!
- *
- * check_types_match() always evaluates to 0.
- *
- * If your compiler does not support typeof, then the best we can do is fail
- * to compile if the sizes of the types are unequal (a less complete check).
- *
- * Example:
- * // Do subtraction to get to enclosing type, but make sure that
- * // pointer is of correct type for that member.
- * #define container_of(mbr_ptr, encl_type, mbr) \
- * (check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
- * ((encl_type *) \
- * ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
- */
-#if HAVE_TYPEOF
-#define check_type(expr, type) \
- ((typeof(expr) *)0 != (type *)0)
-
-#define check_types_match(expr1, expr2) \
- ((typeof(expr1) *)0 != (typeof(expr2) *)0)
-#else
-#include "ccan/build_assert/build_assert.h"
-/* Without typeof, we can only test the sizes. */
-#define check_type(expr, type) \
- BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
-
-#define check_types_match(expr1, expr2) \
- BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
-#endif /* HAVE_TYPEOF */
-
-#endif /* CCAN_CHECK_TYPE_H */
diff --git a/ccan/container_of/container_of.h b/ccan/container_of/container_of.h
deleted file mode 100644
index ae3e1fc81f..0000000000
--- a/ccan/container_of/container_of.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
-#ifndef CCAN_CONTAINER_OF_H
-#define CCAN_CONTAINER_OF_H
-#include "ccan/check_type/check_type.h"
-
-/**
- * container_of - get pointer to enclosing structure
- * @member_ptr: pointer to the structure member
- * @containing_type: the type this member is within
- * @member: the name of this member within the structure.
- *
- * Given a pointer to a member of a structure, this macro does pointer
- * subtraction to return the pointer to the enclosing type.
- *
- * Example:
- * struct foo {
- * int fielda, fieldb;
- * // ...
- * };
- * struct info {
- * int some_other_field;
- * struct foo my_foo;
- * };
- *
- * static struct info *foo_to_info(struct foo *foo)
- * {
- * return container_of(foo, struct info, my_foo);
- * }
- */
-#define container_of(member_ptr, containing_type, member) \
- ((containing_type *) \
- ((char *)(member_ptr) \
- - container_off(containing_type, member)) \
- + check_types_match(*(member_ptr), ((containing_type *)0)->member))
-
-
-/**
- * container_of_or_null - get pointer to enclosing structure, or NULL
- * @member_ptr: pointer to the structure member
- * @containing_type: the type this member is within
- * @member: the name of this member within the structure.
- *
- * Given a pointer to a member of a structure, this macro does pointer
- * subtraction to return the pointer to the enclosing type, unless it
- * is given NULL, in which case it also returns NULL.
- *
- * Example:
- * struct foo {
- * int fielda, fieldb;
- * // ...
- * };
- * struct info {
- * int some_other_field;
- * struct foo my_foo;
- * };
- *
- * static struct info *foo_to_info_allowing_null(struct foo *foo)
- * {
- * return container_of_or_null(foo, struct info, my_foo);
- * }
- */
-static inline char *container_of_or_null_(void *member_ptr, size_t offset)
-{
- return member_ptr ? (char *)member_ptr - offset : NULL;
-}
-#define container_of_or_null(member_ptr, containing_type, member) \
- ((containing_type *) \
- container_of_or_null_(member_ptr, \
- container_off(containing_type, member)) \
- + check_types_match(*(member_ptr), ((containing_type *)0)->member))
-
-/**
- * container_off - get offset to enclosing structure
- * @containing_type: the type this member is within
- * @member: the name of this member within the structure.
- *
- * Given a pointer to a member of a structure, this macro does
- * typechecking and figures out the offset to the enclosing type.
- *
- * Example:
- * struct foo {
- * int fielda, fieldb;
- * // ...
- * };
- * struct info {
- * int some_other_field;
- * struct foo my_foo;
- * };
- *
- * static struct info *foo_to_info(struct foo *foo)
- * {
- * size_t off = container_off(struct info, my_foo);
- * return (void *)((char *)foo - off);
- * }
- */
-#define container_off(containing_type, member) \
- offsetof(containing_type, member)
-
-/**
- * container_of_var - get pointer to enclosing structure using a variable
- * @member_ptr: pointer to the structure member
- * @container_var: a pointer of same type as this member's container
- * @member: the name of this member within the structure.
- *
- * Given a pointer to a member of a structure, this macro does pointer
- * subtraction to return the pointer to the enclosing type.
- *
- * Example:
- * static struct info *foo_to_i(struct foo *foo)
- * {
- * struct info *i = container_of_var(foo, i, my_foo);
- * return i;
- * }
- */
-#if HAVE_TYPEOF
-#define container_of_var(member_ptr, container_var, member) \
- container_of(member_ptr, typeof(*container_var), member)
-#else
-#define container_of_var(member_ptr, container_var, member) \
- ((void *)((char *)(member_ptr) - \
- container_off_var(container_var, member)))
-#endif
-
-/**
- * container_off_var - get offset of a field in enclosing structure
- * @container_var: a pointer to a container structure
- * @member: the name of a member within the structure.
- *
- * Given (any) pointer to a structure and a its member name, this
- * macro does pointer subtraction to return offset of member in a
- * structure memory layout.
- *
- */
-#if HAVE_TYPEOF
-#define container_off_var(var, member) \
- container_off(typeof(*var), member)
-#else
-#define container_off_var(var, member) \
- ((const char *)&(var)->member - (const char *)(var))
-#endif
-
-#endif /* CCAN_CONTAINER_OF_H */
diff --git a/ccan/licenses/BSD-MIT b/ccan/licenses/BSD-MIT
deleted file mode 100644
index 89de354795..0000000000
--- a/ccan/licenses/BSD-MIT
+++ /dev/null
@@ -1,17 +0,0 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/ccan/licenses/CC0 b/ccan/licenses/CC0
deleted file mode 100644
index feb9b118e6..0000000000
--- a/ccan/licenses/CC0
+++ /dev/null
@@ -1,28 +0,0 @@
-Statement of Purpose
-
-The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
-
-Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
-
-For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
-
-1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
-
- the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
- moral rights retained by the original author(s) and/or performer(s);
- publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
- rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
- rights protecting the extraction, dissemination, use and reuse of data in a Work;
- database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
- other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
-
-2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
-
-3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
-
-4. Limitations and Disclaimers.
-
- No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
- Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
- Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
- Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/ccan/list/list.h b/ccan/list/list.h
deleted file mode 100644
index ca9f9f1f7f..0000000000
--- a/ccan/list/list.h
+++ /dev/null
@@ -1,773 +0,0 @@
-/* Licensed under BSD-MIT - see ccan/licenses/BSD-MIT file for details */
-#ifndef CCAN_LIST_H
-#define CCAN_LIST_H
-#include <assert.h>
-#include "ccan/str/str.h"
-#include "ccan/container_of/container_of.h"
-#include "ccan/check_type/check_type.h"
-
-/**
- * struct list_node - an entry in a doubly-linked list
- * @next: next entry (self if empty)
- * @prev: previous entry (self if empty)
- *
- * This is used as an entry in a linked list.
- * Example:
- * struct child {
- * const char *name;
- * // Linked list of all us children.
- * struct list_node list;
- * };
- */
-struct list_node
-{
- struct list_node *next, *prev;
-};
-
-/**
- * struct list_head - the head of a doubly-linked list
- * @h: the list_head (containing next and prev pointers)
- *
- * This is used as the head of a linked list.
- * Example:
- * struct parent {
- * const char *name;
- * struct list_head children;
- * unsigned int num_children;
- * };
- */
-struct list_head
-{
- struct list_node n;
-};
-
-#define LIST_LOC __FILE__ ":" stringify(__LINE__)
-#define list_debug(h, loc) ((void)loc, h)
-#define list_debug_node(n, loc) ((void)loc, n)
-
-/**
- * LIST_HEAD_INIT - initializer for an empty list_head
- * @name: the name of the list.
- *
- * Explicit initializer for an empty list.
- *
- * See also:
- * LIST_HEAD, list_head_init()
- *
- * Example:
- * static struct list_head my_list = LIST_HEAD_INIT(my_list);
- */
-#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
-
-/**
- * LIST_HEAD - define and initialize an empty list_head
- * @name: the name of the list.
- *
- * The LIST_HEAD macro defines a list_head and initializes it to an empty
- * list. It can be prepended by "static" to define a static list_head.
- *
- * See also:
- * LIST_HEAD_INIT, list_head_init()
- *
- * Example:
- * static LIST_HEAD(my_global_list);
- */
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-/**
- * list_head_init - initialize a list_head
- * @h: the list_head to set to the empty list
- *
- * Example:
- * ...
- * struct parent *parent = malloc(sizeof(*parent));
- *
- * list_head_init(&parent->children);
- * parent->num_children = 0;
- */
-static inline void list_head_init(struct list_head *h)
-{
- h->n.next = h->n.prev = &h->n;
-}
-
-/**
- * list_node_init - initialize a list_node
- * @n: the list_node to link to itself.
- *
- * You don't need to use this normally! But it lets you list_del(@n)
- * safely.
- */
-static inline void list_node_init(struct list_node *n)
-{
- n->next = n->prev = n;
-}
-
-/**
- * list_add_after - add an entry after an existing node in a linked list
- * @h: the list_head to add the node to (for debugging)
- * @p: the existing list_node to add the node after
- * @n: the new list_node to add to the list.
- *
- * The existing list_node must already be a member of the list.
- * The new list_node does not need to be initialized; it will be overwritten.
- *
- * Example:
- * struct child c1, c2, c3;
- * LIST_HEAD(h);
- *
- * list_add_tail(&h, &c1.list);
- * list_add_tail(&h, &c3.list);
- * list_add_after(&h, &c1.list, &c2.list);
- */
-#define list_add_after(h, p, n) list_add_after_(h, p, n, LIST_LOC)
-static inline void list_add_after_(struct list_head *h,
- struct list_node *p,
- struct list_node *n,
- const char *abortstr)
-{
- n->next = p->next;
- n->prev = p;
- p->next->prev = n;
- p->next = n;
- (void)list_debug(h, abortstr);
-}
-
-/**
- * list_add - add an entry at the start of a linked list.
- * @h: the list_head to add the node to
- * @n: the list_node to add to the list.
- *
- * The list_node does not need to be initialized; it will be overwritten.
- * Example:
- * struct child *child = malloc(sizeof(*child));
- *
- * child->name = "marvin";
- * list_add(&parent->children, &child->list);
- * parent->num_children++;
- */
-#define list_add(h, n) list_add_(h, n, LIST_LOC)
-static inline void list_add_(struct list_head *h,
- struct list_node *n,
- const char *abortstr)
-{
- list_add_after_(h, &h->n, n, abortstr);
-}
-
-/**
- * list_add_before - add an entry before an existing node in a linked list
- * @h: the list_head to add the node to (for debugging)
- * @p: the existing list_node to add the node before
- * @n: the new list_node to add to the list.
- *
- * The existing list_node must already be a member of the list.
- * The new list_node does not need to be initialized; it will be overwritten.
- *
- * Example:
- * list_head_init(&h);
- * list_add_tail(&h, &c1.list);
- * list_add_tail(&h, &c3.list);
- * list_add_before(&h, &c3.list, &c2.list);
- */
-#define list_add_before(h, p, n) list_add_before_(h, p, n, LIST_LOC)
-static inline void list_add_before_(struct list_head *h,
- struct list_node *p,
- struct list_node *n,
- const char *abortstr)
-{
- n->next = p;
- n->prev = p->prev;
- p->prev->next = n;
- p->prev = n;
- (void)list_debug(h, abortstr);
-}
-
-/**
- * list_add_tail - add an entry at the end of a linked list.
- * @h: the list_head to add the node to
- * @n: the list_node to add to the list.
- *
- * The list_node does not need to be initialized; it will be overwritten.
- * Example:
- * list_add_tail(&parent->children, &child->list);
- * parent->num_children++;
- */
-#define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
-static inline void list_add_tail_(struct list_head *h,
- struct list_node *n,
- const char *abortstr)
-{
- list_add_before_(h, &h->n, n, abortstr);
-}
-
-/**
- * list_empty - is a list empty?
- * @h: the list_head
- *
- * If the list is empty, returns true.
- *
- * Example:
- * assert(list_empty(&parent->children) == (parent->num_children == 0));
- */
-#define list_empty(h) list_empty_(h, LIST_LOC)
-static inline int list_empty_(const struct list_head *h, const char* abortstr)
-{
- (void)list_debug(h, abortstr);
- return h->n.next == &h->n;
-}
-
-/**
- * list_empty_nodebug - is a list empty (and don't perform debug checks)?
- * @h: the list_head
- *
- * If the list is empty, returns true.
- * This differs from list_empty() in that if CCAN_LIST_DEBUG is set it
- * will NOT perform debug checks. Only use this function if you REALLY
- * know what you're doing.
- *
- * Example:
- * assert(list_empty_nodebug(&parent->children) == (parent->num_children == 0));
- */
-#ifndef CCAN_LIST_DEBUG
-#define list_empty_nodebug(h) list_empty(h)
-#else
-static inline int list_empty_nodebug(const struct list_head *h)
-{
- return h->n.next == &h->n;
-}
-#endif
-
-/**
- * list_del - delete an entry from an (unknown) linked list.
- * @n: the list_node to delete from the list.
- *
- * Note that this leaves @n in an undefined state; it can be added to
- * another list, but not deleted again.
- *
- * See also:
- * list_del_from(), list_del_init()
- *
- * Example:
- * list_del(&child->list);
- * parent->num_children--;
- */
-#define list_del(n) list_del_(n, LIST_LOC)
-static inline void list_del_(struct list_node *n, const char* abortstr)
-{
- (void)list_debug_node(n, abortstr);
- n->next->prev = n->prev;
- n->prev->next = n->next;
-#ifdef CCAN_LIST_DEBUG
- /* Catch use-after-del. */
- n->next = n->prev = NULL;
-#endif
-}
-
-/**
- * list_del_init - delete a node, and reset it so it can be deleted again.
- * @n: the list_node to be deleted.
- *
- * list_del(@n) or list_del_init() again after this will be safe,
- * which can be useful in some cases.
- *
- * See also:
- * list_del_from(), list_del()
- *
- * Example:
- * list_del_init(&child->list);
- * parent->num_children--;
- */
-#define list_del_init(n) list_del_init_(n, LIST_LOC)
-static inline void list_del_init_(struct list_node *n, const char *abortstr)
-{
- list_del_(n, abortstr);
- list_node_init(n);
-}
-
-/**
- * list_del_from - delete an entry from a known linked list.
- * @h: the list_head the node is in.
- * @n: the list_node to delete from the list.
- *
- * This explicitly indicates which list a node is expected to be in,
- * which is better documentation and can catch more bugs.
- *
- * See also: list_del()
- *
- * Example:
- * list_del_from(&parent->children, &child->list);
- * parent->num_children--;
- */
-static inline void list_del_from(struct list_head *h, struct list_node *n)
-{
-#ifdef CCAN_LIST_DEBUG
- {
- /* Thorough check: make sure it was in list! */
- struct list_node *i;
- for (i = h->n.next; i != n; i = i->next)
- assert(i != &h->n);
- }
-#endif /* CCAN_LIST_DEBUG */
-
- /* Quick test that catches a surprising number of bugs. */
- assert(!list_empty(h));
- list_del(n);
-}
-
-/**
- * list_swap - swap out an entry from an (unknown) linked list for a new one.
- * @o: the list_node to replace from the list.
- * @n: the list_node to insert in place of the old one.
- *
- * Note that this leaves @o in an undefined state; it can be added to
- * another list, but not deleted/swapped again.
- *
- * See also:
- * list_del()
- *
- * Example:
- * struct child x1, x2;
- * LIST_HEAD(xh);
- *
- * list_add(&xh, &x1.list);
- * list_swap(&x1.list, &x2.list);
- */
-#define list_swap(o, n) list_swap_(o, n, LIST_LOC)
-static inline void list_swap_(struct list_node *o,
- struct list_node *n,
- const char* abortstr)
-{
- (void)list_debug_node(o, abortstr);
- *n = *o;
- n->next->prev = n;
- n->prev->next = n;
-#ifdef CCAN_LIST_DEBUG
- /* Catch use-after-del. */
- o->next = o->prev = NULL;
-#endif
-}
-
-/**
- * list_entry - convert a list_node back into the structure containing it.
- * @n: the list_node
- * @type: the type of the entry
- * @member: the list_node member of the type
- *
- * Example:
- * // First list entry is children.next; convert back to child.
- * child = list_entry(parent->children.n.next, struct child, list);
- *
- * See Also:
- * list_top(), list_for_each()
- */
-#define list_entry(n, type, member) container_of(n, type, member)
-
-/**
- * list_top - get the first entry in a list
- * @h: the list_head
- * @type: the type of the entry
- * @member: the list_node member of the type
- *
- * If the list is empty, returns NULL.
- *
- * Example:
- * struct child *first;
- * first = list_top(&parent->children, struct child, list);
- * if (!first)
- * printf("Empty list!\n");
- */
-#define list_top(h, type, member) \
- ((type *)list_top_((h), list_off_(type, member)))
-
-static inline const void *list_top_(const struct list_head *h, size_t off)
-{
- if (list_empty(h))
- return NULL;
- return (const char *)h->n.next - off;
-}
-
-/**
- * list_pop - remove the first entry in a list
- * @h: the list_head
- * @type: the type of the entry
- * @member: the list_node member of the type
- *
- * If the list is empty, returns NULL.
- *
- * Example:
- * struct child *one;
- * one = list_pop(&parent->children, struct child, list);
- * if (!one)
- * printf("Empty list!\n");
- */
-#define list_pop(h, type, member) \
- ((type *)list_pop_((h), list_off_(type, member)))
-
-static inline const void *list_pop_(const struct list_head *h, size_t off)
-{
- struct list_node *n;
-
- if (list_empty(h))
- return NULL;
- n = h->n.next;
- list_del(n);
- return (const char *)n - off;
-}
-
-/**
- * list_tail - get the last entry in a list
- * @h: the list_head
- * @type: the type of the entry
- * @member: the list_node member of the type
- *
- * If the list is empty, returns NULL.
- *
- * Example:
- * struct child *last;
- * last = list_tail(&parent->children, struct child, list);
- * if (!last)
- * printf("Empty list!\n");
- */
-#define list_tail(h, type, member) \
- ((type *)list_tail_((h), list_off_(type, member)))
-
-static inline const void *list_tail_(const struct list_head *h, size_t off)
-{
- if (list_empty(h))
- return NULL;
- return (const char *)h->n.prev - off;
-}
-
-/**
- * list_for_each - iterate through a list.
- * @h: the list_head (warning: evaluated multiple times!)
- * @i: the structure containing the list_node
- * @member: the list_node member of the structure
- *
- * This is a convenient wrapper to iterate @i over the entire list. It's
- * a for loop, so you can break and continue as normal.
- *
- * Example:
- * list_for_each(&parent->children, child, list)
- * printf("Name: %s\n", child->name);
- */
-#define list_for_each(h, i, member) \
- list_for_each_off(h, i, list_off_var_(i, member))
-
-/**
- * list_for_each_rev - iterate through a list backwards.
- * @h: the list_head
- * @i: the structure containing the list_node
- * @member: the list_node member of the structure
- *
- * This is a convenient wrapper to iterate @i over the entire list. It's
- * a for loop, so you can break and continue as normal.
- *
- * Example:
- * list_for_each_rev(&parent->children, child, list)
- * printf("Name: %s\n", child->name);
- */
-#define list_for_each_rev(h, i, member) \
- list_for_each_rev_off(h, i, list_off_var_(i, member))
-
-/**
- * list_for_each_rev_safe - iterate through a list backwards,
- * maybe during deletion
- * @h: the list_head
- * @i: the structure containing the list_node
- * @nxt: the structure containing the list_node
- * @member: the list_node member of the structure
- *
- * This is a convenient wrapper to iterate @i over the entire list backwards.
- * It's a for loop, so you can break and continue as normal. The extra
- * variable * @nxt is used to hold the next element, so you can delete @i
- * from the list.
- *
- * Example:
- * struct child *next;
- * list_for_each_rev_safe(&parent->children, child, next, list) {
- * printf("Name: %s\n", child->name);
- * }
- */
-#define list_for_each_rev_safe(h, i, nxt, member) \
- list_for_each_rev_safe_off(h, i, nxt, list_off_var_(i, member))
-
-/**
- * list_for_each_safe - iterate through a list, maybe during deletion
- * @h: the list_head
- * @i: the structure containing the list_node
- * @nxt: the structure containing the list_node
- * @member: the list_node member of the structure
- *
- * This is a convenient wrapper to iterate @i over the entire list. It's
- * a for loop, so you can break and continue as normal. The extra variable
- * @nxt is used to hold the next element, so you can delete @i from the list.
- *
- * Example:
- * list_for_each_safe(&parent->children, child, next, list) {
- * list_del(&child->list);
- * parent->num_children--;
- * }
- */
-#define list_for_each_safe(h, i, nxt, member) \
- list_for_each_safe_off(h, i, nxt, list_off_var_(i, member))
-
-/**
- * list_next - get the next entry in a list
- * @h: the list_head
- * @i: a pointer to an entry in the list.
- * @member: the list_node member of the structure
- *
- * If @i was the last entry in the list, returns NULL.
- *
- * Example:
- * struct child *second;
- * second = list_next(&parent->children, first, list);
- * if (!second)
- * printf("No second child!\n");
- */
-#define list_next(h, i, member) \
- ((list_typeof(i))list_entry_or_null(list_debug(h, \
- __FILE__ ":" stringify(__LINE__)), \
- (i)->member.next, \
- list_off_var_((i), member)))
-
-/**
- * list_prev - get the previous entry in a list
- * @h: the list_head
- * @i: a pointer to an entry in the list.
- * @member: the list_node member of the structure
- *
- * If @i was the first entry in the list, returns NULL.
- *
- * Example:
- * first = list_prev(&parent->children, second, list);
- * if (!first)
- * printf("Can't go back to first child?!\n");
- */
-#define list_prev(h, i, member) \
- ((list_typeof(i))list_entry_or_null(list_debug(h, \
- __FILE__ ":" stringify(__LINE__)), \
- (i)->member.prev, \
- list_off_var_((i), member)))
-
-/**
- * list_append_list - empty one list onto the end of another.
- * @to: the list to append into
- * @from: the list to empty.
- *
- * This takes the entire contents of @from and moves it to the end of
- * @to. After this @from will be empty.
- *
- * Example:
- * struct list_head adopter;
- *
- * list_append_list(&adopter, &parent->children);
- * assert(list_empty(&parent->children));
- * parent->num_children = 0;
- */
-#define list_append_list(t, f) list_append_list_(t, f, \
- __FILE__ ":" stringify(__LINE__))
-static inline void list_append_list_(struct list_head *to,
- struct list_head *from,
- const char *abortstr)
-{
- struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
- struct list_node *to_tail = list_debug(to, abortstr)->n.prev;
-
- /* Sew in head and entire list. */
- to->n.prev = from_tail;
- from_tail->next = &to->n;
- to_tail->next = &from->n;
- from->n.prev = to_tail;
-
- /* Now remove head. */
- list_del(&from->n);
- list_head_init(from);
-}
-
-/**
- * list_prepend_list - empty one list into the start of another.
- * @to: the list to prepend into
- * @from: the list to empty.
- *
- * This takes the entire contents of @from and moves it to the start
- * of @to. After this @from will be empty.
- *
- * Example:
- * list_prepend_list(&adopter, &parent->children);
- * assert(list_empty(&parent->children));
- * parent->num_children = 0;
- */
-#define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)
-static inline void list_prepend_list_(struct list_head *to,
- struct list_head *from,
- const char *abortstr)
-{
- struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
- struct list_node *to_head = list_debug(to, abortstr)->n.next;
-
- /* Sew in head and entire list. */
- to->n.next = &from->n;
- from->n.prev = &to->n;
- to_head->prev = from_tail;
- from_tail->next = to_head;
-
- /* Now remove head. */
- list_del(&from->n);
- list_head_init(from);
-}
-
-/* internal macros, do not use directly */
-#define list_for_each_off_dir_(h, i, off, dir) \
- for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
- (off)); \
- list_node_from_off_((void *)i, (off)) != &(h)->n; \
- i = list_node_to_off_(list_node_from_off_((void *)i, (off))->dir, \
- (off)))
-
-#define list_for_each_safe_off_dir_(h, i, nxt, off, dir) \
- for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.dir, \
- (off)), \
- nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
- (off)); \
- list_node_from_off_(i, (off)) != &(h)->n; \
- i = nxt, \
- nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
- (off)))
-
-/**
- * list_for_each_off - iterate through a list of memory regions.
- * @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
- * @off: offset(relative to @i) at which list node data resides.
- *
- * This is a low-level wrapper to iterate @i over the entire list, used to
- * implement all oher, more high-level, for-each constructs. It's a for loop,
- * so you can break and continue as normal.
- *
- * WARNING! Being the low-level macro that it is, this wrapper doesn't know
- * nor care about the type of @i. The only assumtion made is that @i points
- * to a chunk of memory that at some @offset, relative to @i, contains a
- * properly filled `struct node_list' which in turn contains pointers to
- * memory chunks and it's turtles all the way down. Whith all that in mind
- * remember that given the wrong pointer/offset couple this macro will
- * happilly churn all you memory untill SEGFAULT stops it, in other words
- * caveat emptor.
- *
- * It is worth mentioning that one of legitimate use-cases for that wrapper
- * is operation on opaque types with known offset for `struct list_node'
- * member(preferably 0), because it allows you not to disclose the type of
- * @i.
- *
- * Example:
- * list_for_each_off(&parent->children, child,
- * offsetof(struct child, list))
- * printf("Name: %s\n", child->name);
- */
-#define list_for_each_off(h, i, off) \
- list_for_each_off_dir_((h),(i),(off),next)
-
-/**
- * list_for_each_rev_off - iterate through a list of memory regions backwards
- * @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
- * @off: offset(relative to @i) at which list node data resides.
- *
- * See list_for_each_off for details
- */
-#define list_for_each_rev_off(h, i, off) \
- list_for_each_off_dir_((h),(i),(off),prev)
-
-/**
- * list_for_each_safe_off - iterate through a list of memory regions, maybe
- * during deletion
- * @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
- * @nxt: the structure containing the list_node
- * @off: offset(relative to @i) at which list node data resides.
- *
- * For details see `list_for_each_off' and `list_for_each_safe'
- * descriptions.
- *
- * Example:
- * list_for_each_safe_off(&parent->children, child,
- * next, offsetof(struct child, list))
- * printf("Name: %s\n", child->name);
- */
-#define list_for_each_safe_off(h, i, nxt, off) \
- list_for_each_safe_off_dir_((h),(i),(nxt),(off),next)
-
-/**
- * list_for_each_rev_safe_off - iterate backwards through a list of
- * memory regions, maybe during deletion
- * @h: the list_head
- * @i: the pointer to a memory region wich contains list node data.
- * @nxt: the structure containing the list_node
- * @off: offset(relative to @i) at which list node data resides.
- *
- * For details see `list_for_each_rev_off' and `list_for_each_rev_safe'
- * descriptions.
- *
- * Example:
- * list_for_each_rev_safe_off(&parent->children, child,
- * next, offsetof(struct child, list))
- * printf("Name: %s\n", child->name);
- */
-#define list_for_each_rev_safe_off(h, i, nxt, off) \
- list_for_each_safe_off_dir_((h),(i),(nxt),(off),prev)
-
-/* Other -off variants. */
-#define list_entry_off(n, type, off) \
- ((type *)list_node_from_off_((n), (off)))
-
-#define list_head_off(h, type, off) \
- ((type *)list_head_off((h), (off)))
-
-#define list_tail_off(h, type, off) \
- ((type *)list_tail_((h), (off)))
-
-#define list_add_off(h, n, off) \
- list_add((h), list_node_from_off_((n), (off)))
-
-#define list_del_off(n, off) \
- list_del(list_node_from_off_((n), (off)))
-
-#define list_del_from_off(h, n, off) \
- list_del_from(h, list_node_from_off_((n), (off)))
-
-/* Offset helper functions so we only single-evaluate. */
-static inline void *list_node_to_off_(struct list_node *node, size_t off)
-{
- return (void *)((char *)node - off);
-}
-static inline struct list_node *list_node_from_off_(void *ptr, size_t off)
-{
- return (struct list_node *)((char *)ptr + off);
-}
-
-/* Get the offset of the member, but make sure it's a list_node. */
-#define list_off_(type, member) \
- (container_off(type, member) + \
- check_type(((type *)0)->member, struct list_node))
-
-#define list_off_var_(var, member) \
- (container_off_var(var, member) + \
- check_type(var->member, struct list_node))
-
-#if HAVE_TYPEOF
-#define list_typeof(var) typeof(var)
-#else
-#define list_typeof(var) void *
-#endif
-
-/* Returns member, or NULL if at end of list. */
-static inline void *list_entry_or_null(const struct list_head *h,
- const struct list_node *n,
- size_t off)
-{
- if (n == &h->n)
- return NULL;
- return (char *)n - off;
-}
-#endif /* CCAN_LIST_H */
diff --git a/ccan/str/str.h b/ccan/str/str.h
deleted file mode 100644
index 9a9da9cd3f..0000000000
--- a/ccan/str/str.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
-#ifndef CCAN_STR_H
-#define CCAN_STR_H
-/**
- * stringify - Turn expression into a string literal
- * @expr: any C expression
- *
- * Example:
- * #define PRINT_COND_IF_FALSE(cond) \
- * ((cond) || printf("%s is false!", stringify(cond)))
- */
-#define stringify(expr) stringify_1(expr)
-/* Double-indirection required to stringify expansions */
-#define stringify_1(expr) #expr
-
-#endif /* CCAN_STR_H */
diff --git a/class.c b/class.c
index a72f4dcebd..36e7b76caf 100644
--- a/class.c
+++ b/class.c
@@ -23,129 +23,16 @@
* \{
*/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/st.h"
+#include "method.h"
#include "constant.h"
#include "vm_core.h"
-#include "id_table.h"
+#include "internal.h"
#include <ctype.h>
-#define id_attached id__attached__
-
-void
-rb_class_subclass_add(VALUE super, VALUE klass)
-{
- rb_subclass_entry_t *entry, *head;
-
- if (super && super != Qundef) {
- entry = ALLOC(rb_subclass_entry_t);
- entry->klass = klass;
- entry->next = NULL;
-
- head = RCLASS_EXT(super)->subclasses;
- if (head) {
- entry->next = head;
- RCLASS_EXT(head->klass)->parent_subclasses = &entry->next;
- }
-
- RCLASS_EXT(super)->subclasses = entry;
- RCLASS_EXT(klass)->parent_subclasses = &RCLASS_EXT(super)->subclasses;
- }
-}
-
-static void
-rb_module_add_to_subclasses_list(VALUE module, VALUE iclass)
-{
- rb_subclass_entry_t *entry, *head;
-
- entry = ALLOC(rb_subclass_entry_t);
- entry->klass = iclass;
- entry->next = NULL;
-
- head = RCLASS_EXT(module)->subclasses;
- if (head) {
- entry->next = head;
- RCLASS_EXT(head->klass)->module_subclasses = &entry->next;
- }
-
- RCLASS_EXT(module)->subclasses = entry;
- RCLASS_EXT(iclass)->module_subclasses = &RCLASS_EXT(module)->subclasses;
-}
-
-void
-rb_class_remove_from_super_subclasses(VALUE klass)
-{
- rb_subclass_entry_t *entry;
-
- if (RCLASS_EXT(klass)->parent_subclasses) {
- entry = *RCLASS_EXT(klass)->parent_subclasses;
-
- *RCLASS_EXT(klass)->parent_subclasses = entry->next;
- if (entry->next) {
- RCLASS_EXT(entry->next->klass)->parent_subclasses = RCLASS_EXT(klass)->parent_subclasses;
- }
- xfree(entry);
- }
-
- RCLASS_EXT(klass)->parent_subclasses = NULL;
-}
-
-void
-rb_class_remove_from_module_subclasses(VALUE klass)
-{
- rb_subclass_entry_t *entry;
-
- if (RCLASS_EXT(klass)->module_subclasses) {
- entry = *RCLASS_EXT(klass)->module_subclasses;
- *RCLASS_EXT(klass)->module_subclasses = entry->next;
-
- if (entry->next) {
- RCLASS_EXT(entry->next->klass)->module_subclasses = RCLASS_EXT(klass)->module_subclasses;
- }
-
- xfree(entry);
- }
-
- RCLASS_EXT(klass)->module_subclasses = NULL;
-}
-
-void
-rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE arg)
-{
- rb_subclass_entry_t *cur = RCLASS_EXT(klass)->subclasses;
-
- /* do not be tempted to simplify this loop into a for loop, the order of
- operations is important here if `f` modifies the linked list */
- while (cur) {
- VALUE curklass = cur->klass;
- cur = cur->next;
- f(curklass, arg);
- }
-}
-
-static void
-class_detach_subclasses(VALUE klass, VALUE arg)
-{
- rb_class_remove_from_super_subclasses(klass);
-}
-
-void
-rb_class_detach_subclasses(VALUE klass)
-{
- rb_class_foreach_subclass(klass, class_detach_subclasses, Qnil);
-}
-
-static void
-class_detach_module_subclasses(VALUE klass, VALUE arg)
-{
- rb_class_remove_from_module_subclasses(klass);
-}
-
-void
-rb_class_detach_module_subclasses(VALUE klass)
-{
- rb_class_foreach_subclass(klass, class_detach_module_subclasses, Qnil);
-}
+extern st_table *rb_class_tbl;
+static ID id_attached;
/**
* Allocates a struct RClass for a new class.
@@ -162,31 +49,19 @@ rb_class_detach_module_subclasses(VALUE klass)
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
- NEWOBJ_OF(obj, struct RClass, klass, (flags & T_MASK) | FL_PROMOTED1 /* start from age == 2 */ | (RGENGC_WB_PROTECTED_CLASS ? FL_WB_PROTECTED : 0));
- obj->ptr = ZALLOC(rb_classext_t);
- /* ZALLOC
- RCLASS_IV_TBL(obj) = 0;
- RCLASS_CONST_TBL(obj) = 0;
- RCLASS_M_TBL(obj) = 0;
- RCLASS_IV_INDEX_TBL(obj) = 0;
- RCLASS_SET_SUPER((VALUE)obj, 0);
- RCLASS_EXT(obj)->subclasses = NULL;
- RCLASS_EXT(obj)->parent_subclasses = NULL;
- RCLASS_EXT(obj)->module_subclasses = NULL;
- */
- RCLASS_SET_ORIGIN((VALUE)obj, (VALUE)obj);
- RCLASS_SERIAL(obj) = rb_next_class_serial();
+ NEWOBJ_OF(obj, struct RClass, klass, flags);
+ obj->ptr = ALLOC(rb_classext_t);
+ RCLASS_IV_TBL(obj) = 0;
+ RCLASS_CONST_TBL(obj) = 0;
+ RCLASS_M_TBL(obj) = 0;
+ RCLASS_SUPER(obj) = 0;
+ RCLASS_ORIGIN(obj) = (VALUE)obj;
+ RCLASS_IV_INDEX_TBL(obj) = 0;
RCLASS_REFINED_CLASS(obj) = Qnil;
RCLASS_EXT(obj)->allocator = 0;
-
return (VALUE)obj;
}
-static void
-RCLASS_M_TBL_INIT(VALUE c)
-{
- RCLASS_M_TBL(c) = rb_id_table_create(0);
-}
/*!
* A utility function that wraps class_alloc.
@@ -202,8 +77,8 @@ rb_class_boot(VALUE super)
{
VALUE klass = class_alloc(T_CLASS, rb_cClass);
- RCLASS_SET_SUPER(klass, super);
- RCLASS_M_TBL_INIT(klass);
+ RCLASS_SUPER(klass) = super;
+ RCLASS_M_TBL(klass) = st_init_numtable();
OBJ_INFECT(klass, super);
return (VALUE)klass;
@@ -220,8 +95,8 @@ void
rb_check_inheritable(VALUE super)
{
if (!RB_TYPE_P(super, T_CLASS)) {
- rb_raise(rb_eTypeError, "superclass must be a Class (%"PRIsVALUE" given)",
- rb_obj_class(super));
+ rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
+ rb_obj_classname(super));
}
if (RBASIC(super)->flags & FL_SINGLETON) {
rb_raise(rb_eTypeError, "can't make subclass of singleton class");
@@ -246,53 +121,60 @@ rb_class_new(VALUE super)
return rb_class_boot(super);
}
+static NODE*
+rewrite_cref_stack(NODE *node, VALUE old_klass, VALUE new_klass)
+{
+ NODE *new_node;
+ if (!node) {
+ return NULL;
+ }
+ if (node->nd_clss == old_klass) {
+ new_node = NEW_CREF(new_klass);
+ new_node->nd_next = node->nd_next;
+ } else {
+ new_node = NEW_CREF(node->nd_clss);
+ new_node->nd_next = rewrite_cref_stack(node->nd_next, old_klass, new_klass);
+ }
+ return new_node;
+}
+
static void
-clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *me)
+clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
{
- if (me->def->type == VM_METHOD_TYPE_ISEQ) {
- rb_cref_t *new_cref;
- rb_vm_rewrite_cref(me->def->body.iseq.cref, old_klass, new_klass, &new_cref);
- rb_add_method_iseq(new_klass, mid, me->def->body.iseq.iseqptr, new_cref, METHOD_ENTRY_VISI(me));
+ VALUE newiseqval;
+ if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) {
+ rb_iseq_t *iseq;
+ newiseqval = rb_iseq_clone(me->def->body.iseq->self, klass);
+ GetISeqPtr(newiseqval, iseq);
+ iseq->cref_stack = rewrite_cref_stack(me->def->body.iseq->cref_stack, me->klass, klass);
+ rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
+ RB_GC_GUARD(newiseqval);
}
else {
- rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me));
+ rb_method_entry_set(klass, mid, me, me->flag);
}
}
-struct clone_method_arg {
- VALUE new_klass;
- VALUE old_klass;
-};
-
-static enum rb_id_table_iterator_result
-clone_method_i(ID key, VALUE value, void *data)
+static int
+clone_method_i(st_data_t key, st_data_t value, st_data_t data)
{
- const struct clone_method_arg *arg = (struct clone_method_arg *)data;
- clone_method(arg->old_klass, arg->new_klass, key, (const rb_method_entry_t *)value);
- return ID_TABLE_CONTINUE;
+ clone_method((VALUE)data, (ID)key, (const rb_method_entry_t *)value);
+ return ST_CONTINUE;
}
-struct clone_const_arg {
- VALUE klass;
- st_table *tbl;
-};
-
static int
-clone_const(ID key, const rb_const_entry_t *ce, struct clone_const_arg *arg)
+clone_const(ID key, const rb_const_entry_t *ce, st_table *tbl)
{
rb_const_entry_t *nce = ALLOC(rb_const_entry_t);
- MEMCPY(nce, ce, rb_const_entry_t, 1);
- RB_OBJ_WRITTEN(arg->klass, Qundef, ce->value);
- RB_OBJ_WRITTEN(arg->klass, Qundef, ce->file);
-
- st_insert(arg->tbl, key, (st_data_t)nce);
+ *nce = *ce;
+ st_insert(tbl, key, (st_data_t)nce);
return ST_CONTINUE;
}
static int
clone_const_i(st_data_t key, st_data_t value, st_data_t data)
{
- return clone_const((ID)key, (const rb_const_entry_t *)value, (struct clone_const_arg *)data);
+ return clone_const((ID)key, (const rb_const_entry_t *)value, (st_table *)data);
}
static void
@@ -316,26 +198,20 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}
- if (!OBJ_INIT_COPY(clone, orig)) return clone;
+ rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
- RBASIC_SET_CLASS(clone, rb_singleton_class_clone(orig));
+ RBASIC(clone)->klass = rb_singleton_class_clone(orig);
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
- RCLASS_SET_SUPER(clone, RCLASS_SUPER(orig));
+ RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
RCLASS_EXT(clone)->allocator = RCLASS_EXT(orig)->allocator;
- if (RCLASS_IV_TBL(clone)) {
- st_free_table(RCLASS_IV_TBL(clone));
- RCLASS_IV_TBL(clone) = 0;
- }
- if (RCLASS_CONST_TBL(clone)) {
- rb_free_const_table(RCLASS_CONST_TBL(clone));
- RCLASS_CONST_TBL(clone) = 0;
- }
- RCLASS_M_TBL(clone) = 0;
if (RCLASS_IV_TBL(orig)) {
st_data_t id;
- RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(orig));
+ if (RCLASS_IV_TBL(clone)) {
+ st_free_table(RCLASS_IV_TBL(clone));
+ }
+ RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig));
CONST_ID(id, "__tmp_classpath__");
st_delete(RCLASS_IV_TBL(clone), &id, 0);
CONST_ID(id, "__classpath__");
@@ -344,19 +220,18 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
st_delete(RCLASS_IV_TBL(clone), &id, 0);
}
if (RCLASS_CONST_TBL(orig)) {
- struct clone_const_arg arg;
-
+ if (RCLASS_CONST_TBL(clone)) {
+ rb_free_const_table(RCLASS_CONST_TBL(clone));
+ }
RCLASS_CONST_TBL(clone) = st_init_numtable();
- arg.klass = clone;
- arg.tbl = RCLASS_CONST_TBL(clone);
- st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)&arg);
+ st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
}
if (RCLASS_M_TBL(orig)) {
- struct clone_method_arg arg;
- arg.old_klass = orig;
- arg.new_klass = clone;
- RCLASS_M_TBL_INIT(clone);
- rb_id_table_foreach(RCLASS_M_TBL(orig), clone_method_i, &arg);
+ if (RCLASS_M_TBL(clone)) {
+ rb_free_m_table(RCLASS_M_TBL(clone));
+ }
+ RCLASS_M_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
}
return clone;
@@ -371,7 +246,7 @@ rb_singleton_class_clone(VALUE obj)
VALUE
rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
{
- const VALUE klass = RBASIC(obj)->klass;
+ VALUE klass = RBASIC(obj)->klass;
if (!FL_TEST(klass, FL_SINGLETON))
return klass;
@@ -380,37 +255,28 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
if (BUILTIN_TYPE(obj) == T_CLASS) {
- RBASIC_SET_CLASS(clone, clone);
+ RBASIC(clone)->klass = clone;
}
else {
- RBASIC_SET_CLASS(clone, rb_singleton_class_clone(klass));
+ RBASIC(clone)->klass = rb_singleton_class_clone(klass);
}
- RCLASS_SET_SUPER(clone, RCLASS_SUPER(klass));
+ RCLASS_SUPER(clone) = RCLASS_SUPER(klass);
RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator;
if (RCLASS_IV_TBL(klass)) {
- RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(klass));
+ RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(klass));
}
if (RCLASS_CONST_TBL(klass)) {
- struct clone_const_arg arg;
RCLASS_CONST_TBL(clone) = st_init_numtable();
- arg.klass = clone;
- arg.tbl = RCLASS_CONST_TBL(clone);
- st_foreach(RCLASS_CONST_TBL(klass), clone_const_i, (st_data_t)&arg);
+ st_foreach(RCLASS_CONST_TBL(klass), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
}
if (attach != Qundef) {
rb_singleton_class_attached(clone, attach);
}
- RCLASS_M_TBL_INIT(clone);
- {
- struct clone_method_arg arg;
- arg.old_klass = klass;
- arg.new_klass = clone;
- rb_id_table_foreach(RCLASS_M_TBL(klass), clone_method_i, &arg);
- }
+ RCLASS_M_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(klass), clone_method_i, (st_data_t)clone);
rb_singleton_class_attached(RBASIC(clone)->klass, clone);
FL_SET(clone, FL_SINGLETON);
-
return clone;
}
}
@@ -426,14 +292,13 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
if (!RCLASS_IV_TBL(klass)) {
RCLASS_IV_TBL(klass) = st_init_numtable();
}
- rb_class_ivar_set(klass, id_attached, obj);
+ st_insert(RCLASS_IV_TBL(klass), id_attached, obj);
}
}
#define METACLASS_OF(k) RBASIC(k)->klass
-#define SET_METACLASS_OF(k, cls) RBASIC_SET_CLASS(k, cls)
/*!
* whether k is a meta^(n)-class of Class class
@@ -442,27 +307,6 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
*/
#define META_CLASS_OF_CLASS_CLASS_P(k) (METACLASS_OF(k) == (k))
-static int
-rb_singleton_class_has_metaclass_p(VALUE sklass)
-{
- return rb_attr_get(METACLASS_OF(sklass), id_attached) == sklass;
-}
-
-int
-rb_singleton_class_internal_p(VALUE sklass)
-{
- return (RB_TYPE_P(rb_attr_get(sklass, id_attached), T_CLASS) &&
- !rb_singleton_class_has_metaclass_p(sklass));
-}
-
-/*!
- * whether k has a metaclass
- * @retval 1 if \a k has a metaclass
- * @retval 0 otherwise
- */
-#define HAVE_METACLASS_P(k) \
- (FL_TEST(METACLASS_OF(k), FL_SINGLETON) && \
- rb_singleton_class_has_metaclass_p(k))
/*!
* ensures \a klass belongs to its own eigenclass.
@@ -472,7 +316,7 @@ rb_singleton_class_internal_p(VALUE sklass)
* @note this macro creates a new eigenclass if necessary.
*/
#define ENSURE_EIGENCLASS(klass) \
- (HAVE_METACLASS_P(klass) ? METACLASS_OF(klass) : make_metaclass(klass))
+ (rb_ivar_get(METACLASS_OF(klass), id_attached) == (klass) ? METACLASS_OF(klass) : make_metaclass(klass))
/*!
@@ -494,18 +338,17 @@ make_metaclass(VALUE klass)
rb_singleton_class_attached(metaclass, klass);
if (META_CLASS_OF_CLASS_CLASS_P(klass)) {
- SET_METACLASS_OF(klass, metaclass);
- SET_METACLASS_OF(metaclass, metaclass);
+ METACLASS_OF(klass) = METACLASS_OF(metaclass) = metaclass;
}
else {
VALUE tmp = METACLASS_OF(klass); /* for a meta^(n)-class klass, tmp is meta^(n)-class of Class class */
- SET_METACLASS_OF(klass, metaclass);
- SET_METACLASS_OF(metaclass, ENSURE_EIGENCLASS(tmp));
+ METACLASS_OF(klass) = metaclass;
+ METACLASS_OF(metaclass) = ENSURE_EIGENCLASS(tmp);
}
super = RCLASS_SUPER(klass);
while (RB_TYPE_P(super, T_ICLASS)) super = RCLASS_SUPER(super);
- RCLASS_SET_SUPER(metaclass, super ? ENSURE_EIGENCLASS(super) : rb_cClass);
+ RCLASS_SUPER(metaclass) = super ? ENSURE_EIGENCLASS(super) : rb_cClass;
OBJ_INFECT(metaclass, RCLASS_SUPER(metaclass));
@@ -525,10 +368,10 @@ make_singleton_class(VALUE obj)
VALUE klass = rb_class_boot(orig_class);
FL_SET(klass, FL_SINGLETON);
- RBASIC_SET_CLASS(obj, klass);
+ RBASIC(obj)->klass = klass;
rb_singleton_class_attached(klass, obj);
- SET_METACLASS_OF(klass, METACLASS_OF(rb_class_real(orig_class)));
+ METACLASS_OF(klass) = METACLASS_OF(rb_class_real(orig_class));
return klass;
}
@@ -536,10 +379,12 @@ make_singleton_class(VALUE obj)
static VALUE
boot_defclass(const char *name, VALUE super)
{
+ extern st_table *rb_class_tbl;
VALUE obj = rb_class_boot(super);
ID id = rb_intern(name);
rb_name_class(obj, id);
+ st_add_direct(rb_class_tbl, id, obj);
rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
return obj;
}
@@ -547,16 +392,19 @@ boot_defclass(const char *name, VALUE super)
void
Init_class_hierarchy(void)
{
+ id_attached = rb_intern("__attached__");
+
rb_cBasicObject = boot_defclass("BasicObject", 0);
rb_cObject = boot_defclass("Object", rb_cBasicObject);
rb_cModule = boot_defclass("Module", rb_cObject);
rb_cClass = boot_defclass("Class", rb_cModule);
- rb_const_set(rb_cObject, rb_intern_const("BasicObject"), rb_cBasicObject);
- RBASIC_SET_CLASS(rb_cClass, rb_cClass);
- RBASIC_SET_CLASS(rb_cModule, rb_cClass);
- RBASIC_SET_CLASS(rb_cObject, rb_cClass);
- RBASIC_SET_CLASS(rb_cBasicObject, rb_cClass);
+ rb_const_set(rb_cObject, rb_intern("BasicObject"), rb_cBasicObject);
+ RBASIC(rb_cClass)->klass
+ = RBASIC(rb_cModule)->klass
+ = RBASIC(rb_cObject)->klass
+ = RBASIC(rb_cBasicObject)->klass
+ = rb_cClass;
}
@@ -649,8 +497,7 @@ rb_define_class(const char *name, VALUE super)
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
if (!RB_TYPE_P(klass, T_CLASS)) {
- rb_raise(rb_eTypeError, "%s is not a class (%"PRIsVALUE")",
- name, rb_obj_class(klass));
+ rb_raise(rb_eTypeError, "%s is not a class", name);
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
rb_raise(rb_eTypeError, "superclass mismatch for class %s", name);
@@ -661,7 +508,7 @@ rb_define_class(const char *name, VALUE super)
rb_warn("no super class for `%s', Object assumed", name);
}
klass = rb_define_class_id(id, super);
- rb_vm_add_root_module(id, klass);
+ st_add_direct(rb_class_tbl, id, klass);
rb_name_class(klass, id);
rb_const_set(rb_cObject, id, klass);
rb_class_inherited(super, klass);
@@ -679,7 +526,7 @@ rb_define_class(const char *name, VALUE super)
* \return the created class
* \throw TypeError if the constant name \a name is already taken but
* the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
+ * \throw NameError if the class is already defined but the class can not
* be reopened because its superclass is not \a super.
* \post top-level constant named \a name refers the returned class.
*
@@ -702,7 +549,7 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super)
* \return the created class
* \throw TypeError if the constant name \a name is already taken but
* the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
+ * \throw NameError if the class is already defined but the class can not
* be reopened because its superclass is not \a super.
* \post top-level constant named \a name refers the returned class.
*
@@ -717,21 +564,16 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get_at(outer, id);
if (!RB_TYPE_P(klass, T_CLASS)) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a class"
- " (%"PRIsVALUE")",
- outer, rb_id2str(id), rb_obj_class(klass));
+ rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
- rb_raise(rb_eTypeError, "superclass mismatch for class "
- "%"PRIsVALUE"::%"PRIsVALUE""
- " (%"PRIsVALUE" is given but was %"PRIsVALUE")",
- outer, rb_id2str(id), RCLASS_SUPER(klass), super);
+ rb_name_error(id, "%s is already defined", rb_id2name(id));
}
return klass;
}
if (!super) {
- rb_warn("no super class for `%"PRIsVALUE"::%"PRIsVALUE"', Object assumed",
- rb_class_path(outer), rb_id2str(id));
+ rb_warn("no super class for `%s::%s', Object assumed",
+ rb_class2name(outer), rb_id2name(id));
}
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, outer, rb_id2str(id));
@@ -746,7 +588,9 @@ VALUE
rb_module_new(void)
{
VALUE mdl = class_alloc(T_MODULE, rb_cModule);
- RCLASS_M_TBL_INIT(mdl);
+
+ RCLASS_M_TBL(mdl) = st_init_numtable();
+
return (VALUE)mdl;
}
@@ -770,14 +614,12 @@ rb_define_module(const char *name)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
module = rb_const_get(rb_cObject, id);
- if (!RB_TYPE_P(module, T_MODULE)) {
- rb_raise(rb_eTypeError, "%s is not a module (%"PRIsVALUE")",
- name, rb_obj_class(module));
- }
- return module;
+ if (RB_TYPE_P(module, T_MODULE))
+ return module;
+ rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
}
module = rb_define_module_id(id);
- rb_vm_add_root_module(id, module);
+ st_add_direct(rb_class_tbl, id, module);
rb_const_set(rb_cObject, id, module);
return module;
@@ -796,12 +638,10 @@ rb_define_module_id_under(VALUE outer, ID id)
if (rb_const_defined_at(outer, id)) {
module = rb_const_get_at(outer, id);
- if (!RB_TYPE_P(module, T_MODULE)) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a module"
- " (%"PRIsVALUE")",
- outer, rb_id2str(id), rb_obj_class(module));
- }
- return module;
+ if (RB_TYPE_P(module, T_MODULE))
+ return module;
+ rb_raise(rb_eTypeError, "%s::%s is not a module",
+ rb_class2name(outer), rb_obj_classname(module));
}
module = rb_define_module_id(id);
rb_const_set(outer, id, module);
@@ -827,16 +667,13 @@ rb_include_class_new(VALUE module, VALUE super)
}
RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
-
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module))); /* TODO: unprotected? */
-
- RCLASS_SET_SUPER(klass, super);
+ RCLASS_M_TBL(klass) = RCLASS_M_TBL(RCLASS_ORIGIN(module));
+ RCLASS_SUPER(klass) = super;
if (RB_TYPE_P(module, T_ICLASS)) {
- RBASIC_SET_CLASS(klass, RBASIC(module)->klass);
+ RBASIC(klass)->klass = RBASIC(module)->klass;
}
else {
- RBASIC_SET_CLASS(klass, module);
+ RBASIC(klass)->klass = module;
}
OBJ_INFECT(klass, module);
OBJ_INFECT(klass, super);
@@ -844,7 +681,7 @@ rb_include_class_new(VALUE module, VALUE super)
return (VALUE)klass;
}
-static int include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super);
+static int include_modules_at(VALUE klass, VALUE c, VALUE module);
void
rb_include_module(VALUE klass, VALUE module)
@@ -852,6 +689,9 @@ rb_include_module(VALUE klass, VALUE module)
int changed = 0;
rb_frozen_class_p(klass);
+ if (!OBJ_UNTRUSTED(klass)) {
+ rb_secure(4);
+ }
if (!RB_TYPE_P(module, T_MODULE)) {
Check_Type(module, T_MODULE);
@@ -859,100 +699,90 @@ rb_include_module(VALUE klass, VALUE module)
OBJ_INFECT(klass, module);
- changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module, TRUE);
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic include detected");
+ if (changed) rb_clear_cache();
}
-static enum rb_id_table_iterator_result
-add_refined_method_entry_i(ID key, VALUE value, void *data)
+static int
+add_refined_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
- rb_add_refined_method_entry((VALUE)data, key);
- return ID_TABLE_CONTINUE;
+ rb_add_refined_method_entry((VALUE) data, (ID) key);
+ return ST_CONTINUE;
}
static int
-include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
+include_modules_at(VALUE klass, VALUE c, VALUE module)
{
- VALUE p, iclass;
- int method_changed = 0, constant_changed = 0;
- struct rb_id_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
+ VALUE p;
+ int changed = 0;
while (module) {
int superclass_seen = FALSE;
if (RCLASS_ORIGIN(module) != module)
goto skip;
- if (klass_m_tbl && klass_m_tbl == RCLASS_M_TBL(module))
+ if (RCLASS_M_TBL(klass) && RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
return -1;
/* ignore if the module included already in superclasses */
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
- int type = BUILTIN_TYPE(p);
- if (type == T_ICLASS) {
+ switch (BUILTIN_TYPE(p)) {
+ case T_ICLASS:
if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
if (!superclass_seen) {
c = p; /* move insertion point */
}
goto skip;
}
- }
- else if (type == T_CLASS) {
- if (!search_super) break;
+ break;
+ case T_CLASS:
superclass_seen = TRUE;
+ break;
}
}
- iclass = rb_include_class_new(module, RCLASS_SUPER(c));
- c = RCLASS_SET_SUPER(c, iclass);
-
- {
- VALUE m = module;
- if (BUILTIN_TYPE(m) == T_ICLASS) m = RBASIC(m)->klass;
- rb_module_add_to_subclasses_list(m, iclass);
- }
-
+ c = RCLASS_SUPER(c) = rb_include_class_new(module, RCLASS_SUPER(c));
if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
VALUE refined_class =
rb_refinement_module_get_refined_class(klass);
- rb_id_table_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i, (void *)refined_class);
+ st_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i,
+ (st_data_t) refined_class);
FL_SET(c, RMODULE_INCLUDED_INTO_REFINEMENT);
}
- if (RMODULE_M_TBL(module) && rb_id_table_size(RMODULE_M_TBL(module))) method_changed = 1;
- if (RMODULE_CONST_TBL(module) && RMODULE_CONST_TBL(module)->num_entries) constant_changed = 1;
+ if (RMODULE_M_TBL(module) && RMODULE_M_TBL(module)->num_entries)
+ changed = 1;
skip:
module = RCLASS_SUPER(module);
}
- if (method_changed) rb_clear_method_cache_by_class(klass);
- if (constant_changed) rb_clear_constant_cache();
-
- return method_changed;
+ return changed;
}
-static enum rb_id_table_iterator_result
-move_refined_method(ID key, VALUE value, void *data)
+static int
+move_refined_method(st_data_t key, st_data_t value, st_data_t data)
{
rb_method_entry_t *me = (rb_method_entry_t *) value;
- VALUE klass = (VALUE)data;
- struct rb_id_table *tbl = RCLASS_M_TBL(klass);
+ st_table *tbl = (st_table *) data;
if (me->def->type == VM_METHOD_TYPE_REFINED) {
- if (me->def->body.refined.orig_me) {
- const rb_method_entry_t *orig_me = me->def->body.refined.orig_me, *new_me;
- RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL);
- new_me = rb_method_entry_clone(me);
- rb_id_table_insert(tbl, key, (VALUE)new_me);
- RB_OBJ_WRITTEN(klass, Qundef, new_me);
- rb_method_entry_copy(me, orig_me);
- return ID_TABLE_CONTINUE;
+ if (me->def->body.orig_me) {
+ rb_method_entry_t *orig_me = me->def->body.orig_me, *new_me;
+ me->def->body.orig_me = NULL;
+ new_me = ALLOC(rb_method_entry_t);
+ *new_me = *me;
+ st_add_direct(tbl, key, (st_data_t) new_me);
+ *me = *orig_me;
+ xfree(orig_me);
+ return ST_CONTINUE;
}
else {
- rb_id_table_insert(tbl, key, (VALUE)me);
- return ID_TABLE_DELETE;
+ st_add_direct(tbl, key, (st_data_t) me);
+ return ST_DELETE;
}
}
else {
- return ID_TABLE_CONTINUE;
+ return ST_CONTINUE;
}
}
@@ -963,6 +793,9 @@ rb_prepend_module(VALUE klass, VALUE module)
int changed = 0;
rb_frozen_class_p(klass);
+ if (!OBJ_UNTRUSTED(klass)) {
+ rb_secure(4);
+ }
Check_Type(module, T_MODULE);
@@ -971,20 +804,18 @@ rb_prepend_module(VALUE klass, VALUE module)
origin = RCLASS_ORIGIN(klass);
if (origin == klass) {
origin = class_alloc(T_ICLASS, klass);
- OBJ_WB_UNPROTECT(origin); /* TODO: conservative shading. Need more survey. */
- RCLASS_SET_SUPER(origin, RCLASS_SUPER(klass));
- RCLASS_SET_SUPER(klass, origin);
- RCLASS_SET_ORIGIN(klass, origin);
+ RCLASS_SUPER(origin) = RCLASS_SUPER(klass);
+ RCLASS_SUPER(klass) = origin;
+ RCLASS_ORIGIN(klass) = origin;
RCLASS_M_TBL(origin) = RCLASS_M_TBL(klass);
- RCLASS_M_TBL_INIT(klass);
- rb_id_table_foreach(RCLASS_M_TBL(origin), move_refined_method, (void *)klass);
+ RCLASS_M_TBL(klass) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(origin), move_refined_method,
+ (st_data_t) RCLASS_M_TBL(klass));
}
- changed = include_modules_at(klass, klass, module, FALSE);
+ changed = include_modules_at(klass, klass, module);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic prepend detected");
- if (changed) {
- rb_vm_check_redefinition_by_prepend(klass);
- }
+ if (changed) rb_clear_cache();
}
/*
@@ -1009,13 +840,10 @@ rb_mod_included_modules(VALUE mod)
{
VALUE ary = rb_ary_new();
VALUE p;
- VALUE origin = RCLASS_ORIGIN(mod);
for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
- if (p != origin && BUILTIN_TYPE(p) == T_ICLASS) {
- VALUE m = RBASIC(p)->klass;
- if (RB_TYPE_P(m, T_MODULE))
- rb_ary_push(ary, m);
+ if (BUILTIN_TYPE(p) == T_ICLASS) {
+ rb_ary_push(ary, RBASIC(p)->klass);
}
}
return ary;
@@ -1058,18 +886,16 @@ rb_mod_include_p(VALUE mod, VALUE mod2)
* call-seq:
* mod.ancestors -> array
*
- * Returns a list of modules included/prepended in <i>mod</i>
- * (including <i>mod</i> itself).
+ * Returns a list of modules included in <i>mod</i> (including
+ * <i>mod</i> itself).
*
* module Mod
* include Math
* include Comparable
- * prepend Enumerable
* end
*
- * Mod.ancestors #=> [Enumerable, Mod, Comparable, Math]
- * Math.ancestors #=> [Math]
- * Enumerable.ancestors #=> [Enumerable]
+ * Mod.ancestors #=> [Mod, Comparable, Math]
+ * Math.ancestors #=> [Math]
*/
VALUE
@@ -1078,6 +904,8 @@ rb_mod_ancestors(VALUE mod)
VALUE p, ary = rb_ary_new();
for (p = mod; p; p = RCLASS_SUPER(p)) {
+ if (FL_TEST(p, FL_SINGLETON))
+ continue;
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
@@ -1088,84 +916,79 @@ rb_mod_ancestors(VALUE mod)
return ary;
}
+#define VISI(x) ((x)&NOEX_MASK)
+#define VISI_CHECK(x,f) (VISI(x) == (f))
+
static int
-ins_methods_push(ID name, rb_method_visibility_t visi, VALUE ary, rb_method_visibility_t expected_visi)
+ins_methods_push(ID name, long type, VALUE ary, long visi)
{
- if (visi == METHOD_VISI_UNDEF) return ST_CONTINUE;
+ if (type == -1) return ST_CONTINUE;
- switch (expected_visi) {
- case METHOD_VISI_UNDEF:
- if (visi != METHOD_VISI_PRIVATE) rb_ary_push(ary, ID2SYM(name));
+ switch (visi) {
+ case NOEX_PRIVATE:
+ case NOEX_PROTECTED:
+ case NOEX_PUBLIC:
+ visi = (type == visi);
break;
- case METHOD_VISI_PRIVATE:
- case METHOD_VISI_PROTECTED:
- case METHOD_VISI_PUBLIC:
- if (visi == expected_visi) rb_ary_push(ary, ID2SYM(name));
+ default:
+ visi = (type != NOEX_PRIVATE);
break;
}
+ if (visi) {
+ rb_ary_push(ary, ID2SYM(name));
+ }
return ST_CONTINUE;
}
static int
ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_UNDEF); /* everything but private */
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, -1); /* everything but private */
}
static int
ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PROTECTED);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PROTECTED);
}
static int
ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PRIVATE);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PRIVATE);
}
static int
ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push((ID)name, (rb_method_visibility_t)type, (VALUE)ary, METHOD_VISI_PUBLIC);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PUBLIC);
}
-struct method_entry_arg {
- st_table *list;
- int recur;
-};
-
-static enum rb_id_table_iterator_result
-method_entry_i(ID key, VALUE value, void *data)
+static int
+method_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
const rb_method_entry_t *me = (const rb_method_entry_t *)value;
- struct method_entry_arg *arg = (struct method_entry_arg *)data;
- rb_method_visibility_t type;
+ st_table *list = (st_table *)data;
+ long type;
- if (me->def->type == VM_METHOD_TYPE_REFINED) {
- VALUE owner = me->owner;
- me = rb_resolve_refined_method(Qnil, me);
- if (!me) return ID_TABLE_CONTINUE;
- if (!arg->recur && me->owner != owner) return ID_TABLE_CONTINUE;
- }
- if (!st_lookup(arg->list, key, 0)) {
+ if (!st_lookup(list, key, 0)) {
if (UNDEFINED_METHOD_ENTRY_P(me)) {
- type = METHOD_VISI_UNDEF; /* none */
+ type = -1; /* none */
}
else {
- type = METHOD_ENTRY_VISI(me);
+ type = VISI(me->flag);
}
- st_add_direct(arg->list, key, (st_data_t)type);
+ st_add_direct(list, key, type);
}
- return ID_TABLE_CONTINUE;
+ return ST_CONTINUE;
}
static VALUE
-class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
+class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
{
VALUE ary;
int recur, prepended = 0;
- struct method_entry_arg me_arg;
+ st_table *list;
if (argc == 0) {
recur = TRUE;
@@ -1181,17 +1004,16 @@ class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int
prepended = 1;
}
- me_arg.list = st_init_numtable();
- me_arg.recur = recur;
+ list = st_init_numtable();
for (; mod; mod = RCLASS_SUPER(mod)) {
- if (RCLASS_M_TBL(mod)) rb_id_table_foreach(RCLASS_M_TBL(mod), method_entry_i, &me_arg);
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
ary = rb_ary_new();
- st_foreach(me_arg.list, func, ary);
- st_free_table(me_arg.list);
+ st_foreach(list, func, ary);
+ st_free_table(list);
return ary;
}
@@ -1202,29 +1024,29 @@ class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int
*
* Returns an array containing the names of the public and protected instance
* methods in the receiver. For a module, these are the public and protected methods;
- * for a class, they are the instance (not singleton) methods. If the optional
- * parameter is <code>false</code>, the methods of any ancestors are not included.
+ * for a class, they are the instance (not singleton) methods. With no
+ * argument, or with an argument that is <code>false</code>, the
+ * instance methods in <i>mod</i> are returned, otherwise the methods
+ * in <i>mod</i> and <i>mod</i>'s superclasses are returned.
*
* module A
* def method1() end
* end
* class B
- * include A
* def method2() end
* end
* class C < B
* def method3() end
* end
*
- * A.instance_methods(false) #=> [:method1]
- * B.instance_methods(false) #=> [:method2]
- * B.instance_methods(true).include?(:method1) #=> true
- * C.instance_methods(false) #=> [:method3]
- * C.instance_methods.include?(:method2) #=> true
+ * A.instance_methods #=> [:method1]
+ * B.instance_methods(false) #=> [:method2]
+ * C.instance_methods(false) #=> [:method3]
+ * C.instance_methods(true).length #=> 43
*/
VALUE
-rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
+rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_i);
}
@@ -1234,12 +1056,12 @@ rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
* mod.protected_instance_methods(include_super=true) -> array
*
* Returns a list of the protected instance methods defined in
- * <i>mod</i>. If the optional parameter is <code>false</code>, the
- * methods of any ancestors are not included.
+ * <i>mod</i>. If the optional parameter is not <code>false</code>, the
+ * methods of any ancestors are included.
*/
VALUE
-rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
+rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_prot_i);
}
@@ -1249,8 +1071,8 @@ rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
* mod.private_instance_methods(include_super=true) -> array
*
* Returns a list of the private instance methods defined in
- * <i>mod</i>. If the optional parameter is <code>false</code>, the
- * methods of any ancestors are not included.
+ * <i>mod</i>. If the optional parameter is not <code>false</code>, the
+ * methods of any ancestors are included.
*
* module Mod
* def method1() end
@@ -1262,7 +1084,7 @@ rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
*/
VALUE
-rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
+rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_priv_i);
}
@@ -1272,26 +1094,25 @@ rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
* mod.public_instance_methods(include_super=true) -> array
*
* Returns a list of the public instance methods defined in <i>mod</i>.
- * If the optional parameter is <code>false</code>, the methods of
- * any ancestors are not included.
+ * If the optional parameter is not <code>false</code>, the methods of
+ * any ancestors are included.
*/
VALUE
-rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
+rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
{
return class_instance_method_list(argc, argv, mod, 0, ins_methods_pub_i);
}
/*
* call-seq:
- * obj.methods(regular=true) -> array
+ * obj.methods(all=true) -> array
*
* Returns a list of the names of public and protected methods of
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
- * If the optional parameter is <code>false</code>, it
- * returns an array of <i>obj<i>'s public and protected singleton methods,
- * the array will not include methods in modules included in <i>obj</i>.
+ * If the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
*
* class Klass
* def klass_method()
@@ -1301,25 +1122,26 @@ rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
* k.methods[0..9] #=> [:klass_method, :nil?, :===,
* # :==~, :!, :eql?
* # :hash, :<=>, :class, :singleton_class]
- * k.methods.length #=> 56
- *
- * k.methods(false) #=> []
- * def k.singleton_method; end
- * k.methods(false) #=> [:singleton_method]
- *
- * module M123; def m123; end end
- * k.extend M123
- * k.methods(false) #=> [:singleton_method]
+ * k.methods.length #=> 57
*/
VALUE
-rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
+rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
- rb_check_arity(argc, 0, 1);
- if (argc > 0 && !RTEST(argv[0])) {
+ retry:
+ if (argc == 0) {
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
+ }
+ else {
+ VALUE recur;
+
+ rb_scan_args(argc, argv, "1", &recur);
+ if (RTEST(recur)) {
+ argc = 0;
+ goto retry;
+ }
return rb_obj_singleton_methods(argc, argv, obj);
}
- return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
}
/*
@@ -1332,7 +1154,7 @@ rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
+rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_prot_i);
}
@@ -1347,7 +1169,7 @@ rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
+rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_priv_i);
}
@@ -1362,7 +1184,7 @@ rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
+rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
{
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i);
}
@@ -1401,11 +1223,10 @@ rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
*/
VALUE
-rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
+rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
{
- VALUE recur, ary, klass, origin;
- struct method_entry_arg me_arg;
- struct rb_id_table *mtbl;
+ VALUE recur, ary, klass;
+ st_table *list;
if (argc == 0) {
recur = Qtrue;
@@ -1414,22 +1235,22 @@ rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
rb_scan_args(argc, argv, "01", &recur);
}
klass = CLASS_OF(obj);
- origin = RCLASS_ORIGIN(klass);
- me_arg.list = st_init_numtable();
- me_arg.recur = RTEST(recur);
+ list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- if ((mtbl = RCLASS_M_TBL(origin)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
klass = RCLASS_SUPER(klass);
}
if (RTEST(recur)) {
while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) {
- if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
klass = RCLASS_SUPER(klass);
}
}
ary = rb_ary_new();
- st_foreach(me_arg.list, ins_methods_i, ary);
- st_free_table(me_arg.list);
+ st_foreach(list, ins_methods_i, ary);
+ st_free_table(list);
return ary;
}
@@ -1494,31 +1315,31 @@ rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
void
rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, mid, func, argc, METHOD_VISI_PUBLIC);
+ rb_add_method_cfunc(klass, mid, func, argc, NOEX_PUBLIC);
}
void
rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PUBLIC);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PUBLIC);
}
void
rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PROTECTED);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PROTECTED);
}
void
rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PRIVATE);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
}
void
rb_undef_method(VALUE klass, const char *name)
{
- rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, METHOD_VISI_UNDEF);
+ rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
}
/*!
@@ -1564,8 +1385,7 @@ singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || FLONUM_P(obj) || STATIC_SYM_P(obj)) {
- no_singleton:
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
}
if (SPECIAL_CONST_P(obj)) {
@@ -1575,16 +1395,18 @@ singleton_class_of(VALUE obj)
return klass;
}
else {
- switch (BUILTIN_TYPE(obj)) {
- case T_FLOAT: case T_BIGNUM: case T_SYMBOL:
- goto no_singleton;
+ enum ruby_value_type type = BUILTIN_TYPE(obj);
+ if (type == T_FLOAT || type == T_BIGNUM) {
+ rb_raise(rb_eTypeError, "can't define singleton");
}
}
- klass = RBASIC(obj)->klass;
- if (!(FL_TEST(klass, FL_SINGLETON) &&
- rb_ivar_get(klass, id_attached) == obj)) {
- klass = rb_make_metaclass(obj, klass);
+ if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
+ rb_ivar_get(RBASIC(obj)->klass, id_attached) == obj) {
+ klass = RBASIC(obj)->klass;
+ }
+ else {
+ klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
}
if (OBJ_TAINTED(obj)) {
@@ -1593,45 +1415,18 @@ singleton_class_of(VALUE obj)
else {
FL_UNSET(klass, FL_TAINT);
}
- if (OBJ_FROZEN(obj)) OBJ_FREEZE_RAW(klass);
-
- return klass;
-}
-
-void
-rb_freeze_singleton_class(VALUE x)
-{
- /* should not propagate to meta-meta-class, and so on */
- if (!(RBASIC(x)->flags & FL_SINGLETON)) {
- VALUE klass = RBASIC_CLASS(x);
- if (klass && (klass = RCLASS_ORIGIN(klass)) != 0 &&
- FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
- OBJ_FREEZE_RAW(klass);
- }
+ if (OBJ_UNTRUSTED(obj)) {
+ OBJ_UNTRUST(klass);
}
-}
-
-/*!
- * Returns the singleton class of \a obj, or nil if obj is not a
- * singleton object.
- *
- * \param obj an arbitrary object.
- * \return the singleton class or nil.
- */
-VALUE
-rb_singleton_class_get(VALUE obj)
-{
- VALUE klass;
-
- if (SPECIAL_CONST_P(obj)) {
- return rb_special_singleton_class(obj);
+ else {
+ FL_UNSET(klass, FL_UNTRUSTED);
}
- klass = RBASIC(obj)->klass;
- if (!FL_TEST(klass, FL_SINGLETON)) return Qnil;
- if (rb_ivar_get(klass, id_attached) != obj) return Qnil;
+ if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass);
+
return klass;
}
+
/*!
* Returns the singleton class of \a obj. Creates it if necessary.
*
@@ -1740,7 +1535,7 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
int
rb_obj_basic_to_s_p(VALUE obj)
{
- const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"));
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"), 0);
if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
me->def->body.cfunc.func == rb_any_to_s)
return 1;
@@ -1814,11 +1609,8 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
}
else {
hash = rb_check_hash_type(last);
- if (!NIL_P(hash)) {
- VALUE opts = rb_extract_keywords(&hash);
- if (!hash) argc--;
- hash = opts ? opts : Qnil;
- }
+ if (!NIL_P(hash))
+ argc--;
}
}
/* capture leading mandatory arguments */
@@ -1882,140 +1674,6 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
return argc;
}
-VALUE
-rb_keyword_error_new(const char *error, VALUE keys)
-{
- const char *msg = "";
- VALUE error_message;
-
- if (RARRAY_LEN(keys) == 1) {
- keys = RARRAY_AREF(keys, 0);
- }
- else {
- keys = rb_ary_join(keys, rb_usascii_str_new2(", "));
- msg = "s";
- }
-
- error_message = rb_sprintf("%s keyword%s: %"PRIsVALUE, error, msg, keys);
-
- return rb_exc_new_str(rb_eArgError, error_message);
-}
-
-NORETURN(static void rb_keyword_error(const char *error, VALUE keys));
-static void
-rb_keyword_error(const char *error, VALUE keys)
-{
- rb_exc_raise(rb_keyword_error_new(error, keys));
-}
-
-NORETURN(static void unknown_keyword_error(VALUE hash, const ID *table, int keywords));
-static void
-unknown_keyword_error(VALUE hash, const ID *table, int keywords)
-{
- st_table *tbl = rb_hash_tbl_raw(hash);
- VALUE keys;
- int i;
- for (i = 0; i < keywords; i++) {
- st_data_t key = ID2SYM(table[i]);
- st_delete(tbl, &key, NULL);
- }
- keys = rb_funcallv(hash, rb_intern("keys"), 0, 0);
- if (!RB_TYPE_P(keys, T_ARRAY)) rb_raise(rb_eArgError, "unknown keyword");
- rb_keyword_error("unknown", keys);
-}
-
-static int
-separate_symbol(st_data_t key, st_data_t value, st_data_t arg)
-{
- VALUE *kwdhash = (VALUE *)arg;
-
- if (!SYMBOL_P(key)) kwdhash++;
- if (!*kwdhash) *kwdhash = rb_hash_new();
- rb_hash_aset(*kwdhash, (VALUE)key, (VALUE)value);
- return ST_CONTINUE;
-}
-
-VALUE
-rb_extract_keywords(VALUE *orighash)
-{
- VALUE parthash[2] = {0, 0};
- VALUE hash = *orighash;
-
- if (RHASH_EMPTY_P(hash)) {
- *orighash = 0;
- return hash;
- }
- st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash);
- *orighash = parthash[1];
- return parthash[0];
-}
-
-int
-rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
-{
- int i = 0, j;
- int rest = 0;
- VALUE missing = Qnil;
- st_data_t key;
-
-#define extract_kwarg(keyword, val) \
- (key = (st_data_t)(keyword), values ? \
- st_delete(rb_hash_tbl_raw(keyword_hash), &key, (val)) : \
- st_lookup(rb_hash_tbl_raw(keyword_hash), key, (val)))
-
- if (NIL_P(keyword_hash)) keyword_hash = 0;
-
- if (optional < 0) {
- rest = 1;
- optional = -1-optional;
- }
- if (values) {
- for (j = 0; j < required + optional; j++) {
- values[j] = Qundef;
- }
- }
- if (required) {
- for (; i < required; i++) {
- VALUE keyword = ID2SYM(table[i]);
- if (keyword_hash) {
- st_data_t val;
- if (extract_kwarg(keyword, &val)) {
- if (values) values[i] = (VALUE)val;
- continue;
- }
- }
- if (NIL_P(missing)) missing = rb_ary_tmp_new(1);
- rb_ary_push(missing, keyword);
- }
- if (!NIL_P(missing)) {
- rb_keyword_error("missing", missing);
- }
- }
- j = i;
- if (optional && keyword_hash) {
- for (i = 0; i < optional; i++) {
- st_data_t val;
- if (extract_kwarg(ID2SYM(table[required+i]), &val)) {
- if (values) values[required+i] = (VALUE)val;
- j++;
- }
- }
- }
- if (!rest && keyword_hash) {
- if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
- unknown_keyword_error(keyword_hash, table, required+optional);
- }
- }
- return j;
-#undef extract_kwarg
-}
-
-int
-rb_class_has_methods(VALUE c)
-{
- return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
-}
-
/*!
* \}
*/
diff --git a/common.mk b/common.mk
index da4608bc61..2e90d074bd 100644
--- a/common.mk
+++ b/common.mk
@@ -8,47 +8,32 @@ dll: $(LIBRUBY_SO)
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-ECHO0 = $(ECHO1:0=echo)
-ECHO = @$(ECHO0)
-
-UNICODE_VERSION = 8.0.0
+ECHO = $(ECHO1:0=@echo)
RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
RUN_OPTS = --disable-gems
-GEM_HOME =
-GEM_PATH =
-GEM_VENDOR =
-
-SPEC_GIT_BASE = git://github.com/ruby
+SPEC_GIT_BASE = git://github.com/rubyspec
MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git
RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git
-SIMPLECOV_GIT_URL = git://github.com/colszowka/simplecov.git
-SIMPLECOV_GIT_REF = v0.10.0
-SIMPLECOV_HTML_GIT_URL = git://github.com/colszowka/simplecov-html.git
-SIMPLECOV_HTML_GIT_REF = v0.10.0
-DOCLIE_GIT_URL = git://github.com/ms-ati/docile.git
-DOCLIE_GIT_REF = v1.1.5
-
STATIC_RUBY = static-ruby
EXTCONF = extconf.rb
LIBRUBY_EXTS = ./.libruby-with-ext.time
REVISION_H = ./.revision.time
PLATFORM_D = ./$(PLATFORM_DIR)/.time
-ENC_TRANS_D = ./enc/trans/.time
RDOCOUT = $(EXTOUT)/rdoc
-HTMLOUT = $(EXTOUT)/html
CAPIOUT = doc/capi
-INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
+DMYEXT = dmyext.$(OBJEXT)
NORMALMAINOBJ = main.$(OBJEXT)
MAINOBJ = $(NORMALMAINOBJ)
-DLDOBJS = $(INITOBJS)
+EXTOBJS =
+DLDOBJS = $(DMYEXT)
EXTSOLIBS =
-MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
+MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) dmyversion.$(OBJEXT) miniprelude.$(OBJEXT)
ENC_MK = enc.mk
COMMONOBJS = array.$(OBJEXT) \
@@ -58,7 +43,6 @@ COMMONOBJS = array.$(OBJEXT) \
complex.$(OBJEXT) \
dir.$(OBJEXT) \
dln_find.$(OBJEXT) \
- encoding.$(OBJEXT) \
enum.$(OBJEXT) \
enumerator.$(OBJEXT) \
error.$(OBJEXT) \
@@ -96,12 +80,10 @@ COMMONOBJS = array.$(OBJEXT) \
strftime.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
- symbol.$(OBJEXT) \
time.$(OBJEXT) \
transcode.$(OBJEXT) \
util.$(OBJEXT) \
variable.$(OBJEXT) \
- version.$(OBJEXT) \
compile.$(OBJEXT) \
debug.$(OBJEXT) \
iseq.$(OBJEXT) \
@@ -111,36 +93,34 @@ COMMONOBJS = array.$(OBJEXT) \
vm_trace.$(OBJEXT) \
thread.$(OBJEXT) \
cont.$(OBJEXT) \
- $(DTRACE_OBJ) \
$(BUILTIN_ENCOBJS) \
$(BUILTIN_TRANSOBJS) \
$(MISSING)
EXPORTOBJS = $(DLNOBJ) \
- localeinit.$(OBJEXT) \
- loadpath.$(OBJEXT) \
+ encoding.$(OBJEXT) \
+ version.$(OBJEXT) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
-ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
-DEFAULT_PRELUDES = $(GEM_PRELUDE)
PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
-GEM_PRELUDE = $(srcdir)/gem_prelude.rb
-PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
-GOLFPRELUDES = {$(srcdir)}golf_prelude.c
+GEM_PRELUDE = $(srcdir)/gem_prelude.rb
+YES_GEM_PRELUDE = $(GEM_PRELUDE)
+NO_GEM_PRELUDE =
+PRELUDES = prelude.c miniprelude.c
+GOLFPRELUDES = golf_prelude.c
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
- --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" \
- --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
- --
-INSTRUBY = $(SUDO) $(RUNRUBY) -r./$(arch)-fake $(srcdir)/tool/rbinstall.rb
+ --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --
+INSTRUBY = $(SUDO) $(MINIRUBY) $(srcdir)/tool/rbinstall.rb
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
--prog-mode=$(INSTALL_PROG_MODE) \
@@ -153,24 +133,21 @@ PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil'
$(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
TESTSDIR = $(srcdir)/test
-TEST_EXCLUDES = --excludes-dir=$(TESTSDIR)/excludes --name=!/memory_leak/
-EXCLUDE_TESTFRAMEWORK = --exclude=/testunit/ --exclude=/minitest/
TESTWORKDIR = testwork
-TESTOPTS = $(RUBY_TESTOPTS)
TESTRUN_SCRIPT = $(srcdir)/test.rb
-COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
+BOOTSTRAPRUBY = $(BASERUBY)
-SHOWFLAGS = showflags
+COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
-all: $(SHOWFLAGS) main docs
+all: showflags main docs
-main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs
+main: showflags $(EXTSTATIC:static=lib)encs exts
@$(NULLCMD)
.PHONY: showflags
-exts enc trans: $(SHOWFLAGS)
+exts enc trans: showflags
showflags:
$(MESSAGE_BEGIN) \
" CC = $(CC)" \
@@ -182,13 +159,12 @@ showflags:
" DLDFLAGS = $(DLDFLAGS)" \
" SOLIBS = $(SOLIBS)" \
$(MESSAGE_END)
- -@$(CC_VERSION)
.PHONY: showconfig
showconfig:
- @$(ECHO_BEGIN) \
- $(configure_args) \
- $(ECHO_END)
+ @$(MESSAGE_BEGIN) \
+ "$(configure_args)" \
+ $(MESSAGE_END)
exts: build-ext
@@ -200,14 +176,19 @@ $(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
configure-ext: $(EXTS_MK)
build-ext: $(EXTS_MK)
- $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) \
- EXTENCS="$(ENCOBJS)" UPDATE_LIBRARIES=no $(EXTSTATIC)
+ $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
+
+$(MKMAIN_CMD): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
prog: program wprogram
+loadpath: $(PREP) PHONY
+ $(MINIRUBY) -e 'p $$:'
+
$(PREP): $(MKFILES)
-miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE) $(DTRACE_OBJ)
objs: $(ALLOBJS)
@@ -219,7 +200,7 @@ capi: $(CAPIOUT)/.timestamp PHONY
$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
$(Q) $(MAKEDIRS) "$(@D)"
$(ECHO) generating capi
- -$(Q) $(DOXYGEN) -b
+ $(Q) $(DOXYGEN) -b
$(Q) $(MINIRUBY) -e 'File.open(ARGV[0], "w"){|f| f.puts(Time.now)}' "$@"
Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
@@ -227,13 +208,12 @@ Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb
$(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ $(srcdir)/template/Doxyfile.tmpl \
--srcdir="$(srcdir)" --miniruby="$(MINIRUBY)"
-program: $(SHOWFLAGS) $(PROGRAM)
-wprogram: $(SHOWFLAGS) $(WPROGRAM)
-mini: PHONY miniruby$(EXEEXT)
+program: showflags $(PROGRAM)
+wprogram: showflags $(WPROGRAM)
$(PROGRAM) $(WPROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
-$(LIBRUBY_A): $(LIBRUBY_A_OBJS) $(MAINOBJ) $(INITOBJS) $(ARCHFILE)
+$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DTRACE_OBJ) $(DTRACE_GLOMMED_OBJ) $(DMYEXT) $(ARCHFILE)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
@@ -244,9 +224,9 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
$(Q)$(RM) $@
$(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
-ruby.imp: $(COMMONOBJS)
- $(Q)$(NM) -Pgp $(COMMONOBJS) | \
- awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|ruby_static_id_|.*_threadptr_|\.)/{print $$1}' | \
+ruby.imp: $(EXPORTOBJS)
+ $(Q)$(NM) -Pgp $(EXPORTOBJS) | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
sort -u -o $@
install: install-$(INSTALLDOC)
@@ -255,80 +235,80 @@ pkgconfig-data: $(ruby_pc)
$(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
install-all: docs pre-install-all do-install-all post-install-all
-pre-install-all:: all pre-install-local pre-install-ext pre-install-doc
-do-install-all: pre-install-all
+pre-install-all:: pre-install-local pre-install-ext pre-install-doc
+do-install-all: all
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
post-install-all:: post-install-local post-install-ext post-install-doc
@$(NULLCMD)
install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
pre-install-nodoc:: pre-install-local pre-install-ext
-do-install-nodoc: main pre-install-nodoc
+do-install-nodoc: main
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS)
post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local
pre-install-local:: pre-install-bin pre-install-lib pre-install-man
-do-install-local: $(PROGRAM) pre-install-local
+do-install-local: $(PROGRAM)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
post-install-local:: post-install-bin post-install-lib post-install-man
install-ext: pre-install-ext do-install-ext post-install-ext
pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
-do-install-ext: exts pre-install-ext
+do-install-ext: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
post-install-ext:: post-install-ext-arch post-install-ext-comm
install-arch: pre-install-arch do-install-arch post-install-arch
pre-install-arch:: pre-install-bin pre-install-ext-arch
-do-install-arch: main do-install-arch
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=arch
+do-install-arch: main
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-install-arch:: post-install-bin post-install-ext-arch
install-comm: pre-install-comm do-install-comm post-install-comm
pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
-do-install-comm: $(PREP) pre-install-comm
+do-install-comm: $(PREP)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
post-install-comm:: post-install-lib post-install-ext-comm post-install-man
install-bin: pre-install-bin do-install-bin post-install-bin
pre-install-bin:: install-prereq
-do-install-bin: $(PROGRAM) pre-install-bin
+do-install-bin: $(PROGRAM)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-install-bin::
@$(NULLCMD)
install-lib: pre-install-lib do-install-lib post-install-lib
pre-install-lib:: install-prereq
-do-install-lib: $(PREP) pre-install-lib
+do-install-lib: $(PREP)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
post-install-lib::
@$(NULLCMD)
install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
pre-install-ext-comm:: install-prereq
-do-install-ext-comm: exts pre-install-ext-comm
+do-install-ext-comm: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
post-install-ext-comm::
@$(NULLCMD)
install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
pre-install-ext-arch:: install-prereq
-do-install-ext-arch: exts pre-install-ext-arch
+do-install-ext-arch: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-install-ext-arch::
@$(NULLCMD)
install-man: pre-install-man do-install-man post-install-man
pre-install-man:: install-prereq
-do-install-man: $(PREP) pre-install-man
+do-install-man: $(PREP)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
post-install-man::
@$(NULLCMD)
install-capi: capi pre-install-capi do-install-capi post-install-capi
pre-install-capi:: install-prereq
-do-install-capi: $(PREP) pre-install-capi
+do-install-capi: $(PREP)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=capi
post-install-capi::
@$(NULLCMD)
@@ -343,11 +323,6 @@ dont-install-all: $(PROGRAM)
post-no-install-all:: post-no-install-local post-no-install-ext post-no-install-doc
@$(NULLCMD)
-uninstall: $(INSTALLED_LIST) sudo-precheck
- $(Q)$(SUDO) $(MINIRUBY) $(srcdir)/tool/rbuninstall.rb --destdir=$(DESTDIR) $(INSTALLED_LIST)
-
-reinstall: all uninstall install
-
what-where-nodoc: no-install-nodoc
no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
@@ -425,40 +400,19 @@ post-no-install-man::
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
-do-install-doc: $(PROGRAM) pre-install-doc
+do-install-doc: $(PROGRAM)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
-install-gem: pre-install-gem do-install-gem post-install-gem
-pre-install-gem:: pre-install-bin pre-install-lib pre-install-man
-do-install-gem: $(PROGRAM) pre-install-gem
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=gem
-post-install-gem::
- @$(NULLCMD)
-
rdoc: PHONY main
@echo Generating RDoc documentation
$(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
-html: PHONY main
- @echo Generating RDoc HTML files
- $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --op "$(HTMLOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
-
rdoc-coverage: PHONY main
@echo Generating RDoc coverage report
$(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
-RDOCBENCHOUT=/tmp/rdocbench
-
-GCBENCH_ITEM=null
-
-gcbench: PHONY
- $(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" $(GCBENCH_ITEM)
-
-gcbench-rdoc: PHONY
- $(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" rdoc
-
nodoc: PHONY
what-where-doc: no-install-doc
@@ -471,166 +425,107 @@ post-no-install-doc::
CLEAR_INSTALLED_LIST = clear-installed-list
-install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake sudo-precheck PHONY
+install-prereq: $(CLEAR_INSTALLED_LIST) PHONY
clear-installed-list: PHONY
@> $(INSTALLED_LIST) set MAKE="$(MAKE)"
-clean: clean-ext clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-local clean-platform
-clean-local:: clean-runnable
+clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-platform
+clean-local:: PHONY
$(Q)$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
- $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) dmyenc.$(OBJEXT) $(ARCHFILE) .*.time
- $(Q)$(RM) y.tab.c y.output encdb.h transdb.h config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT)
- $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D)
- -$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0
-clean-runnable:: PHONY
- $(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || exit 0
- $(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || exit 0
- $(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || exit 0
+ $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
+ $(Q)$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT)
clean-ext:: PHONY
clean-golf: PHONY
$(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
clean-rdoc: PHONY
-clean-html: PHONY
clean-capi: PHONY
clean-platform: PHONY
clean-extout: PHONY
- -$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || exit 0
-clean-docs: clean-rdoc clean-html clean-capi
+clean-docs: clean-rdoc clean-capi
-distclean: distclean-ext distclean-enc distclean-golf distclean-extout distclean-local distclean-platform
+distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
distclean-local:: clean-local
- $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(PRELUDES)
- $(Q)$(RM) config.cache config.status config.status.lineno
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc
+ $(Q)$(RM) config.cache config.status config.status.lineno $(PRELUDES)
$(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
- -$(Q)$(RMALL) $(srcdir)/autom4te.cache
distclean-ext:: PHONY
distclean-golf: clean-golf
+ $(Q)$(RM) $(GOLFPRELUDES)
distclean-rdoc: PHONY
-distclean-html: PHONY
distclean-capi: PHONY
distclean-extout: clean-extout
distclean-platform: clean-platform
realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
realclean-local:: distclean-local
- $(Q)$(RM) parse.c parse.h lex.c enc/trans/newline.c revision.h
- $(Q)$(RM) id.c id.h probes.dmyh
- $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h
- $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) id.c id.h probes.dmyh
- $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure tool/config.guess tool/config.sub gems/*.gem
-realclean-ext:: PHONY
+ $(Q)$(RM) parse.c parse.h lex.c newline.c revision.h
+realclean-ext::
realclean-golf: distclean-golf
- $(Q)$(RM) $(GOLFPRELUDES)
realclean-capi: PHONY
realclean-extout: distclean-extout
clean-ext distclean-ext realclean-ext::
$(Q)$(RM) $(EXTS_MK)
- $(Q)$(RM) $(EXTOUT)/.timestamp/.*.time
- $(Q)$(RMDIR) $(EXTOUT)/.timestamp 2> $(NULL) || exit 0
clean-enc distclean-enc realclean-enc: PHONY
-clean-enc: clean-enc.d
-
-clean-enc.d: PHONY
- $(Q)$(RM) $(ENC_TRANS_D)
- -$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0
-
-clean-rdoc distclean-rdoc realclean-rdoc:
- @echo $(@:-rdoc=ing) rdoc
- $(Q)$(RMALL) $(RDOCOUT)
-
-clean-html distclean-html realclean-html:
- @echo $(@:-html=ing) HTML
- $(Q)$(RMALL) $(HTMLOUT)
-
-clean-capi distclean-capi realclean-capi:
- @echo $(@:-capi=ing) capi
- $(Q)$(RMALL) $(CAPIOUT)
-
-clean-platform:
- $(Q) $(RM) $(PLATFORM_D)
- -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || exit 0
-
-check: main test test-testframework test-almost
+check: main test test-all
$(ECHO) check succeeded
check-ruby: test test-ruby
fake: $(CROSS_COMPILING)-fake
yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY
-no-fake -fake: PHONY
-
-# really doesn't depend on .o, just ensure newer than headers which
-# version.o depends on.
-$(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(srcdir)/tool/generic_erb.rb version.$(OBJEXT) miniruby$(EXEEXT)
- $(ECHO) generating $@
- $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) "$(srcdir)/version.c" | \
- $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ "$(srcdir)/template/fake.rb.in" \
- i=- srcdir="$(srcdir)" BASERUBY="$(BASERUBY)"
+no-fake: PHONY
btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
yes-btest: fake miniruby$(EXEEXT) PHONY
- $(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS)
+ $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY)" $(OPTS) $(TESTOPTS)
btest-ruby: $(TEST_RUNNABLE)-btest-ruby
no-btest-ruby: PHONY
yes-btest-ruby: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
+ $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS) $(TESTOPTS)
test-sample: $(TEST_RUNNABLE)-test-sample
no-test-sample: PHONY
yes-test-sample: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/tool/rubytest.rb" --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
+ $(Q)$(RUNRUBY) $(srcdir)/tool/rubytest.rb $(OPTS) $(TESTOPTS)
test-knownbugs: test-knownbug
test-knownbug: $(TEST_RUNNABLE)-test-knownbug
no-test-knownbug: PHONY
yes-test-knownbug: prog PHONY
- -$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
-
-test-testframework: $(TEST_RUNNABLE)-test-testframework
-yes-test-testframework: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
-no-test-testframework: PHONY
+ -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
test: test-sample btest-ruby test-knownbug
-# $ make test-all TESTOPTS="--help" displays more detail
-# for example, make test-all TESTOPTS="-j2 -v -n test-name -- test-file-name"
test-all: $(TEST_RUNNABLE)-test-all
yes-test-all: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) $(TESTS)
TESTS_BUILD = mkmf
no-test-all: PHONY
$(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
-test-almost: $(TEST_RUNNABLE)-test-almost
-yes-test-almost: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(EXCLUDE_TESTFRAMEWORK) $(TESTS)
-no-test-almost: PHONY
-
test-ruby: $(TEST_RUNNABLE)-test-ruby
no-test-ruby: PHONY
yes-test-ruby: prog encs PHONY
- $(RUNRUBY) "$(srcdir)/test/runner.rb" $(TEST_EXCLUDES) $(TESTOPTS) -- ruby -ext-
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
extconf: $(PREP)
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
- $(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
- -arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
+$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
+ $(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
test-rubyspec-precheck:
-test-rubyspec: test-rubyspec-precheck $(arch)-fake.rb
- $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
+test-rubyspec: test-rubyspec-precheck
+ $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
@@ -639,7 +534,7 @@ yes-runnable: PHONY
encs: enc trans
libencs: libenc libtrans
-encs enc trans libencs libenc libtrans: $(SHOWFLAGS) $(ENC_MK) $(LIBRUBY) $(PREP) PHONY
+encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP)
$(ECHO) making $@
$(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
@@ -650,16 +545,16 @@ libenc enc: {$(VPATH)}encdb.h
libtrans trans: {$(VPATH)}transdb.h
$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG) fake
+ $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(ECHO) generating $@
- $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $(ENCS) $@
+ $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(EXTSTATIC) $@ $(ENCS)
.PRECIOUS: $(MKFILES)
.PHONY: PHONY all fake prereq incs srcs preludes help
.PHONY: test install install-nodoc install-doc dist
.PHONY: loadpath golf capi rdoc install-prereq clear-installed-list
-.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-html clean-extout
+.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-extout
.PHONY: distclean distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
.PHONY: realclean realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
.PHONY: check test test-all btest btest-ruby test-sample test-knownbug
@@ -673,7 +568,7 @@ PHONY:
{$(srcdir)}.y.c:
$(ECHO) generating $@
- $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
+ $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=$(PATH_SEPARATOR) --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
$(Q)$(YACC) -d $(YFLAGS) -o y.tab.c parse.tmp.y
$(Q)$(RM) parse.tmp.y
$(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
@@ -681,37 +576,17 @@ PHONY:
$(Q)sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse.*\.y/d" y.tab.h > $(@:.c=.h)
$(Q)$(RM) y.tab.c y.tab.h
-$(PLATFORM_D):
- $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
- @exit > $@
-
-$(BUILTIN_ENCOBJS) $(BUILTIN_TRANSOBJS): $(ENC_TRANS_D)
-
-$(ENC_TRANS_D):
- $(Q) $(MAKEDIRS) enc/trans
- @exit > $@
-
-###
-CCAN_DIR = {$(VPATH)}ccan
-
-RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
- {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
- {$(VPATH)}subst.h
-
-###
-
acosh.$(OBJEXT): {$(VPATH)}acosh.c
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
crypt.$(OBJEXT): {$(VPATH)}crypt.c
dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
-explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
finite.$(OBJEXT): {$(VPATH)}finite.c
flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
-setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c {$(VPATH)}util.h $(RUBY_H_INCLUDES)
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
@@ -721,35 +596,233 @@ strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
nt.$(OBJEXT): {$(VPATH)}nt.c
+os2.$(OBJEXT): {$(VPATH)}os2.c
+dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
-###
-
-# dependencies for generated C sources.
-parse.$(OBJEXT): {$(VPATH)}parse.c
-miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
-prelude.$(OBJEXT): {$(VPATH)}prelude.c
+$(PLATFORM_D):
+ $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
+ @exit > $@
-# dependencies for optional sources.
-compile.$(OBJEXT): {$(VPATH)}opt_sc.inc {$(VPATH)}optunifs.inc
+###
-win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c {$(VPATH)}win32/file.h \
- {$(VPATH)}dln.h {$(VPATH)}dln_find.c {$(VPATH)}encindex.h \
- {$(VPATH)}internal.h {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(PLATFORM_D)
-win32/file.$(OBJEXT): {$(VPATH)}win32/file.c {$(VPATH)}win32/file.h \
- $(RUBY_H_INCLUDES) $(PLATFORM_D)
+RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
+ {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
+ {$(VPATH)}subst.h
+ENCODING_H_INCLUDES= {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h
+PROBES_H_INCLUDES = {$(VPATH)}probes.h
+VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
+ {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
+ {$(VPATH)}vm_debug.h {$(VPATH)}id.h
+
+addr2line.$(OBJEXT): {$(VPATH)}addr2line.c {$(VPATH)}addr2line.h {$(VPATH)}config.h
+array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES) {$(VPATH)}id.h
+bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}thread.h {$(VPATH)}internal.h
+class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}constant.h
+compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
+complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+dir.$(OBJEXT): {$(VPATH)}dir.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h
+dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
+dln_find.$(OBJEXT): {$(VPATH)}dln_find.c {$(VPATH)}dln.h $(RUBY_H_INCLUDES)
+dmydln.$(OBJEXT): {$(VPATH)}dmydln.c $(RUBY_H_INCLUDES)
+dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
+dmyencoding.$(OBJEXT): {$(VPATH)}dmyencoding.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}regenc.h {$(VPATH)}util.h $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}encoding.c {$(VPATH)}internal.h
+encoding.$(OBJEXT): {$(VPATH)}encoding.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}regenc.h {$(VPATH)}util.h \
+ {$(VPATH)}internal.h
+enum.$(OBJEXT): {$(VPATH)}enum.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
+ {$(VPATH)}util.h {$(VPATH)}id.h
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}known_errors.inc \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h
+eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h {$(VPATH)}vm.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_error.c \
+ {$(VPATH)}eval_jump.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
+ {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}dln.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}dln.h \
+ {$(VPATH)}internal.h
+gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
+ {$(VPATH)}internal.h {$(VPATH)}constant.h \
+ {$(VPATH)}thread.h $(PROBES_H_INCLUDES)
+hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
+ {$(VPATH)}internal.h {$(VPATH)}thread.h {$(VPATH)}id.h
+main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h {$(VPATH)}vm_debug.h
+marshal.$(OBJEXT): {$(VPATH)}marshal.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}internal.h
+math.$(OBJEXT): {$(VPATH)}math.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
+node.$(OBJEXT): {$(VPATH)}node.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES)
+numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
+object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES) $(PROBES_H_INCLUDES)
+pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
+ {$(VPATH)}oniguruma.h
+parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}id.h {$(VPATH)}regenc.h \
+ {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c \
+ {$(VPATH)}defs/keywords {$(VPATH)}id.c {$(VPATH)}parse.y \
+ {$(VPATH)}parse.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
+ $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h
+process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}util.h {$(VPATH)}io.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h \
+ {$(VPATH)}thread.h
+random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}siphash.c {$(VPATH)}siphash.h
+range.$(OBJEXT): {$(VPATH)}range.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}id.h
+rational.$(OBJEXT): {$(VPATH)}rational.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
+re.$(OBJEXT): {$(VPATH)}re.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}internal.h
+regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}regparse.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
+ $(RUBY_H_INCLUDES)
+regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}regparse.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h \
+ $(RUBY_H_INCLUDES)
+regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}regint.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
+ruby.$(OBJEXT): {$(VPATH)}ruby.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}eval_intern.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}dln.h {$(VPATH)}internal.h
+safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES)
+signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES)
+sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES)
+st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES)
+strftime.$(OBJEXT): {$(VPATH)}strftime.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}timev.h $(ENCODING_H_INCLUDES)
+string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
+struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
+thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
+ $(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
+ {$(VPATH)}thread_$(THREAD_MODEL).c $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}io.h {$(VPATH)}thread.h
+transcode.$(OBJEXT): {$(VPATH)}transcode.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}transcode_data.h {$(VPATH)}internal.h
+cont.$(OBJEXT): {$(VPATH)}cont.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}gc.h {$(VPATH)}eval_intern.h \
+ {$(VPATH)}internal.h
+time.$(OBJEXT): {$(VPATH)}time.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}timev.h {$(VPATH)}internal.h
+util.$(OBJEXT): {$(VPATH)}util.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
+ {$(VPATH)}internal.h
+variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h \
+ verconf.h
+dmyversion.$(OBJEXT): {$(VPATH)}dmyversion.c version.$(OBJEXT)
+
+compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}iseq.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
+ {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc \
+ {$(VPATH)}optunifs.inc {$(VPATH)}opt_sc.inc {$(VPATH)}insns.inc \
+ {$(VPATH)}internal.h
+iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
+ {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}internal.h
+vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ {$(VPATH)}eval_intern.h $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
+ {$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
+ {$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
+ {$(VPATH)}vm.inc {$(VPATH)}insns.inc \
+ {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h \
+ $(PROBES_H_INCLUDES) {$(VPATH)}probes_helper.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}addr2line.h \
+ {$(VPATH)}internal.h
+debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
+ $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_intern.h \
+ {$(VPATH)}util.h
+id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) {$(VPATH)}id.h {$(VPATH)}vm_opts.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h {$(VPATH)}debug.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c $(ENCODING_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
+ {$(VPATH)}internal.h
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+prelude.$(OBJEXT): {$(VPATH)}prelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c $(RUBY_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
+goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}vm_debug.h {$(VPATH)}node.h
+
+ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c {$(VPATH)}regenc.h \
+ {$(VPATH)}config.h {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
+ {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}st.h {$(VPATH)}ruby.h \
+ {$(VPATH)}missing.h {$(VPATH)}intern.h \
+ {$(VPATH)}enc/unicode/name2ctype.h {$(VPATH)}enc/unicode/casefold.h \
+ {$(VPATH)}subst.h $(RUBY_H_INCLUDES)
+
+utf_8.$(OBJEXT): {$(VPATH)}utf_8.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+
+win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
+win32/file.$(OBJEXT): {$(VPATH)}win32/file.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
- $(Q) $(MAKEDIRS) $(@D)
$(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
-enc/trans/newline.$(OBJEXT): $(NEWLINE_C)
+newline.$(OBJEXT): $(NEWLINE_C) {$(VPATH)}defines.h \
+ {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
+ {$(VPATH)}transcode_data.h {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}subst.h
-verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb
- $(ECHO) creating $@
- $(Q) $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ vm.$(OBJEXT)
-ruby-glommed.$(OBJEXT): $(OBJS)
+probes.$(OBJEXT): $(DTRACE_DEPENDENT_OBJS)
+ruby-glommed.$(OBJEXT): $(OBJS) $(DTRACE_OBJ)
$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
@@ -771,43 +844,32 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
-common-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}enc/trans/newline.c {$(VPATH)}id.c \
- srcs-lib srcs-ext
-
-srcs: common-srcs srcs-enc
+srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c srcs-ext srcs-enc
-EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \
- $(srcdir)/ext/rbconfig/sizeof/sizes.c
+EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/json/parser/parser.c \
+ $(srcdir)/ext/dl/callback/callback.c
srcs-ext: $(EXT_SRCS)
-srcs-extra: $(srcdir)/ext/json/parser/parser.c
-
-LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb
-
-srcs-lib: $(LIB_SRCS)
-
srcs-enc: $(ENC_MK)
$(ECHO) making srcs under enc
$(Q) $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
-all-incs: incs {$(VPATH)}encdb.h {$(VPATH)}transdb.h
-incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}known_errors.inc \
- {$(VPATH)}vm_call_iseq_optimized.inc $(srcdir)/revision.h \
- $(REVISION_H) enc/unicode/name2ctype.h enc/jis/props.h \
- {$(VPATH)}id.h {$(VPATH)}probes.dmyh
+all-incs: incs
+incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
+ $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h {$(VPATH)}id.h {$(VPATH)}probes.dmyh
insns: $(INSNS)
id.h: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.h.tmpl $(srcdir)/defs/id.def
$(ECHO) generating $@
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
- $(srcdir)/template/id.h.tmpl
+ $(srcdir)/template/$@.tmpl
id.c: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.c.tmpl $(srcdir)/defs/id.def
$(ECHO) generating $@
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
- $(srcdir)/template/id.c.tmpl
+ $(srcdir)/template/$@.tmpl
node_name.inc: {$(VPATH)}node.h
$(ECHO) generating $@
@@ -827,27 +889,20 @@ known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_
$(ECHO) generating $@
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
-vm_call_iseq_optimized.inc: $(srcdir)/tool/mk_call_iseq_optimized.rb
- $(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/mk_call_iseq_optimized.rb > $@
-
-$(MINIPRELUDE_C): $(COMPILE_PRELUDE)
+$(MINIPRELUDE_C): $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
- $(srcdir)/template/prelude.c.tmpl
+ $(Q) $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
-$(PRELUDE_C): $(COMPILE_PRELUDE) \
- {$(srcdir)}lib/rubygems/defaults.rb \
- {$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \
- $(PRELUDE_SCRIPTS) $(LIB_SRCS)
+prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
+ $(srcdir)/lib/rubygems/defaults.rb \
+ $(srcdir)/lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(PREP)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
- $(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
+ $(Q) $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
-{$(VPATH)}golf_prelude.c: $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb
+golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
- $(srcdir)/template/prelude.c.tmpl golf_prelude.rb
+ $(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
$(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
@@ -856,7 +911,6 @@ probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
prereq: incs srcs preludes PHONY
-preludes: {$(VPATH)}prelude.c
preludes: {$(VPATH)}miniprelude.c
preludes: {$(srcdir)}golf_prelude.c
@@ -867,26 +921,20 @@ $(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastr
-$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > revision.tmp
$(Q)$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" revision.tmp
-$(srcdir)/ext/ripper/ripper.c: parse.y id.h
+$(srcdir)/ext/ripper/ripper.c: parse.y
$(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && \
- sed /AUTOGENERATED/q depend | \
- $(exec) $(MAKE) -f - $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \
- RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
$(ECHO) generating $@
$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)"
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=.
-$(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
- $(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
+$(srcdir)/ext/dl/callback/callback.c: $(srcdir)/ext/dl/callback/mkcallback.rb $(srcdir)/ext/dl/dl.h
$(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && \
- sed /AUTOGENERATED/q depend | \
- $(exec) $(MAKE) -f - $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)"
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
##
@@ -899,21 +947,10 @@ runruby: $(PROGRAM) PHONY
parse: fake miniruby$(EXEEXT) PHONY
$(BTESTRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT)
-bisect: PHONY
- $(srcdir)/tool/bisect.sh miniruby $(srcdir)
-
-bisect-ruby: PHONY
- $(srcdir)/tool/bisect.sh ruby $(srcdir)
-
COMPARE_RUBY = $(BASERUBY)
ITEM =
OPTS =
-# You can pass several options through OPTS environment variable.
-# $ make benchmark OPTS="--help" displays more detail.
-# for example,
-# $ make benchmark COMPARE_RUBY="ruby-trunk" OPTS="-e ruby-2.2.2"
-# This command compares trunk and built-ruby and 2.2.2
benchmark: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
--executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
@@ -930,8 +967,7 @@ tbench: $(PROGRAM) PHONY
--pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
run.gdb:
- echo set breakpoint pending on > run.gdb
- echo b ruby_debug_breakpoint >> run.gdb
+ echo b ruby_debug_breakpoint > run.gdb
echo '# handle SIGINT nostop' >> run.gdb
echo '# handle SIGPIPE nostop' >> run.gdb
echo '# b rb_longjmp' >> run.gdb
@@ -951,123 +987,30 @@ gdb-ruby: $(PROGRAM) run.gdb PHONY
$(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
dist:
- $(BASERUBY) $(srcdir)/tool/make-snapshot -srcdir=$(srcdir) tmp $(RELNAME)
+ $(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
up::
- -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
-
-up::
- -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) after-update
-
-after-update:: update-unicode update-gems extract-extlibs
-
-update-config_files: PHONY
- $(Q) $(BASERUBY) -C "$(srcdir)/tool" \
- ../tool/downloader.rb -e gnu \
- config.guess config.sub
-
-update-gems: PHONY
- $(ECHO) Downloading bundled gem files...
- $(Q) $(BASERUBY) -C "$(srcdir)/gems" \
- -I../tool -rdownloader -answ \
- -e 'gem, ver = *$$F' \
- -e 'old = Dir.glob("#{gem}-*.gem")' \
- -e 'gem = "#{gem}-#{ver}.gem"' \
- -e 'Downloader::RubyGems.download(gem, nil, nil) and' \
- -e 'File.unlink(*(old-[gem]))' \
- bundled_gems
-
-extract-gems: PHONY
- $(ECHO) Extracting bundled gem files...
- $(Q) $(RUNRUBY) -C "$(srcdir)/gems" \
- -I../tool -rgem-unpack -answ \
- -e 'gem, ver = *$$F' \
- -e 'Gem.unpack("#{gem}-#{ver}.gem")' \
- bundled_gems
-
-UPDATE_LIBRARIES = no
-
-### set the following environment variable or uncomment the line if
-### the Unicode data files are updated every minute.
-# ALWAYS_UPDATE_UNICODE = yes
-
-UNICODE_FILES = $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/UnicodeData.txt \
- $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/CompositionExclusions.txt \
- $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/NormalizationTest.txt
-
-update-unicode: $(UNICODE_FILES) PHONY
-
-UNICODE_FILES_DEPS0 = $(UPDATE_LIBRARIES:yes=download-unicode-data)
-UNICODE_FILES_DEPS = $(UNICODE_FILES_DEPS0:no=)
-$(UNICODE_FILES): $(UNICODE_FILES_DEPS)
-
-download-unicode-data: ./.unicode-$(UNICODE_VERSION).time
-./.unicode-$(UNICODE_VERSION).time: PHONY
- $(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
- $(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)"
- $(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb \
- -d enc/unicode/data/$(UNICODE_VERSION) \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
- $(UNICODE_VERSION)/ucd/UnicodeData.txt \
- $(UNICODE_VERSION)/ucd/CompositionExclusions.txt \
- $(UNICODE_VERSION)/ucd/NormalizationTest.txt
- @exit > $@
-
-$(srcdir)/$(HAVE_BASERUBY:yes=lib/unicode_normalize/tables.rb): \
- $(UNICODE_FILES_DEPS:download-unicode-data=./.unicode-tables.time)
-
-./.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
- $(UNICODE_FILES) $(UNICODE_FILES_DEPS) \
- $(srcdir)/template/unicode_norm_gen.tmpl
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
- -c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
- -I $(srcdir) \
- $(srcdir)/template/unicode_norm_gen.tmpl \
- enc/unicode/data/$(UNICODE_VERSION) lib/unicode_normalize
-
-download-extlibs:
- $(Q) $(BASERUBY) -C $(srcdir) -w tool/extlibs.rb --download ext
-
-extract-extlibs:
- $(Q) $(BASERUBY) -C $(srcdir) -w tool/extlibs.rb --all ext
-
-clean-extlibs:
- $(Q) $(RMALL) $(srcdir)/.downloaded-cache
-
-clean-gems:
- $(Q) $(RM) gems/*.gem
-
-CLEAN_CACHE = clean-extlibs
+ -$(Q)$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
info: info-program info-libruby_a info-libruby_so info-arch
-info-program: PHONY
+info-program:
@echo PROGRAM=$(PROGRAM)
-info-libruby_a: PHONY
+info-libruby_a:
@echo LIBRUBY_A=$(LIBRUBY_A)
-info-libruby_so: PHONY
+info-libruby_so:
@echo LIBRUBY_SO=$(LIBRUBY_SO)
-info-arch: PHONY
+info-arch:
@echo arch=$(arch)
change: PHONY
$(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
-exam: check test-rubyspec
-
-love: sudo-precheck up all test install check
+love: sudo-precheck up all test install test-all
@echo love is all you need
-yes-test-all: sudo-precheck
-
-sudo-precheck: PHONY
+sudo-precheck:
@$(SUDO) echo > $(NULL)
-update-man-date: PHONY
- -$(Q) $(BASERUBY) -I"$(srcdir)/tool" -rvcs -i -p \
- -e 'BEGIN{@vcs=VCS.detect(ARGV.shift)}' \
- -e '$$_.sub!(/^(\.Dd ).*/){$$1+@vcs.modified(ARGF.path).strftime("%B %d, %Y")}' \
- "$(srcdir)" "$(srcdir)"/man/*.1
-
help: PHONY
$(MESSAGE_BEGIN) \
" Makefile of Ruby" \
@@ -1084,14 +1027,11 @@ help: PHONY
" gdb: runs test.rb by miniruby under gdb" \
" gdb-ruby: runs test.rb by ruby under gdb" \
" check: equals make test test-all" \
- " exam: equals make check test-rubyspec" \
" test: ruby core tests" \
- " test-all: all ruby tests [TESTOPTS=-j4 TESTS=\"<test files>\"]" \
+ " test-all: all ruby tests" \
" test-rubyspec: run RubySpec test suite" \
" update-rubyspec: update local copy of RubySpec" \
- " benchmark: benchmark this ruby and COMPARE_RUBY." \
- " gcbench: gc benchmark [GCBENCH_ITEM=<item_name>]" \
- " gcbench-rdoc: gc benchmark with GCBENCH_ITEM=rdoc" \
+ " benchmark: benchmark this ruby and COMPARE_RUBY" \
" install: install all ruby distributions" \
" install-nodoc: install without rdoc" \
" install-cross: install cross compiling staff" \
@@ -1101,1411 +1041,5 @@ help: PHONY
" golf: for golfers" \
"" \
"see DeveloperHowto for more detail: " \
- " https://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto" \
+ " http://bugs.ruby-lang.org/wiki/ruby/DeveloperHowto" \
$(MESSAGE_END)
-
-# AUTOGENERATED DEPENDENCIES START
-addr2line.$(OBJEXT): {$(VPATH)}addr2line.c
-addr2line.$(OBJEXT): {$(VPATH)}addr2line.h
-addr2line.$(OBJEXT): {$(VPATH)}config.h
-addr2line.$(OBJEXT): {$(VPATH)}missing.h
-array.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-array.$(OBJEXT): $(top_srcdir)/include/ruby.h
-array.$(OBJEXT): {$(VPATH)}array.c
-array.$(OBJEXT): {$(VPATH)}config.h
-array.$(OBJEXT): {$(VPATH)}defines.h
-array.$(OBJEXT): {$(VPATH)}encoding.h
-array.$(OBJEXT): {$(VPATH)}id.h
-array.$(OBJEXT): {$(VPATH)}intern.h
-array.$(OBJEXT): {$(VPATH)}internal.h
-array.$(OBJEXT): {$(VPATH)}io.h
-array.$(OBJEXT): {$(VPATH)}missing.h
-array.$(OBJEXT): {$(VPATH)}oniguruma.h
-array.$(OBJEXT): {$(VPATH)}probes.h
-array.$(OBJEXT): {$(VPATH)}st.h
-array.$(OBJEXT): {$(VPATH)}subst.h
-array.$(OBJEXT): {$(VPATH)}util.h
-array.$(OBJEXT): {$(VPATH)}vm_opts.h
-bignum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-bignum.$(OBJEXT): $(top_srcdir)/include/ruby.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c
-bignum.$(OBJEXT): {$(VPATH)}config.h
-bignum.$(OBJEXT): {$(VPATH)}defines.h
-bignum.$(OBJEXT): {$(VPATH)}encoding.h
-bignum.$(OBJEXT): {$(VPATH)}intern.h
-bignum.$(OBJEXT): {$(VPATH)}internal.h
-bignum.$(OBJEXT): {$(VPATH)}io.h
-bignum.$(OBJEXT): {$(VPATH)}missing.h
-bignum.$(OBJEXT): {$(VPATH)}oniguruma.h
-bignum.$(OBJEXT): {$(VPATH)}st.h
-bignum.$(OBJEXT): {$(VPATH)}subst.h
-bignum.$(OBJEXT): {$(VPATH)}thread.h
-bignum.$(OBJEXT): {$(VPATH)}util.h
-class.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-class.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-class.$(OBJEXT): $(CCAN_DIR)/list/list.h
-class.$(OBJEXT): $(CCAN_DIR)/str/str.h
-class.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-class.$(OBJEXT): $(top_srcdir)/include/ruby.h
-class.$(OBJEXT): {$(VPATH)}class.c
-class.$(OBJEXT): {$(VPATH)}config.h
-class.$(OBJEXT): {$(VPATH)}constant.h
-class.$(OBJEXT): {$(VPATH)}defines.h
-class.$(OBJEXT): {$(VPATH)}encoding.h
-class.$(OBJEXT): {$(VPATH)}id.h
-class.$(OBJEXT): {$(VPATH)}id_table.h
-class.$(OBJEXT): {$(VPATH)}intern.h
-class.$(OBJEXT): {$(VPATH)}internal.h
-class.$(OBJEXT): {$(VPATH)}io.h
-class.$(OBJEXT): {$(VPATH)}method.h
-class.$(OBJEXT): {$(VPATH)}missing.h
-class.$(OBJEXT): {$(VPATH)}node.h
-class.$(OBJEXT): {$(VPATH)}oniguruma.h
-class.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-class.$(OBJEXT): {$(VPATH)}st.h
-class.$(OBJEXT): {$(VPATH)}subst.h
-class.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-class.$(OBJEXT): {$(VPATH)}thread_native.h
-class.$(OBJEXT): {$(VPATH)}vm_core.h
-class.$(OBJEXT): {$(VPATH)}vm_debug.h
-class.$(OBJEXT): {$(VPATH)}vm_opts.h
-compar.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-compar.$(OBJEXT): {$(VPATH)}compar.c
-compar.$(OBJEXT): {$(VPATH)}config.h
-compar.$(OBJEXT): {$(VPATH)}defines.h
-compar.$(OBJEXT): {$(VPATH)}intern.h
-compar.$(OBJEXT): {$(VPATH)}missing.h
-compar.$(OBJEXT): {$(VPATH)}st.h
-compar.$(OBJEXT): {$(VPATH)}subst.h
-compile.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-compile.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-compile.$(OBJEXT): $(CCAN_DIR)/list/list.h
-compile.$(OBJEXT): $(CCAN_DIR)/str/str.h
-compile.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-compile.$(OBJEXT): $(top_srcdir)/include/ruby.h
-compile.$(OBJEXT): {$(VPATH)}compile.c
-compile.$(OBJEXT): {$(VPATH)}config.h
-compile.$(OBJEXT): {$(VPATH)}defines.h
-compile.$(OBJEXT): {$(VPATH)}encindex.h
-compile.$(OBJEXT): {$(VPATH)}encoding.h
-compile.$(OBJEXT): {$(VPATH)}gc.h
-compile.$(OBJEXT): {$(VPATH)}id.h
-compile.$(OBJEXT): {$(VPATH)}insns.inc
-compile.$(OBJEXT): {$(VPATH)}insns_info.inc
-compile.$(OBJEXT): {$(VPATH)}intern.h
-compile.$(OBJEXT): {$(VPATH)}internal.h
-compile.$(OBJEXT): {$(VPATH)}io.h
-compile.$(OBJEXT): {$(VPATH)}iseq.h
-compile.$(OBJEXT): {$(VPATH)}method.h
-compile.$(OBJEXT): {$(VPATH)}missing.h
-compile.$(OBJEXT): {$(VPATH)}node.h
-compile.$(OBJEXT): {$(VPATH)}oniguruma.h
-compile.$(OBJEXT): {$(VPATH)}optinsn.inc
-compile.$(OBJEXT): {$(VPATH)}re.h
-compile.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-compile.$(OBJEXT): {$(VPATH)}st.h
-compile.$(OBJEXT): {$(VPATH)}subst.h
-compile.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-compile.$(OBJEXT): {$(VPATH)}thread_native.h
-compile.$(OBJEXT): {$(VPATH)}vm_core.h
-compile.$(OBJEXT): {$(VPATH)}vm_debug.h
-compile.$(OBJEXT): {$(VPATH)}vm_opts.h
-complex.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-complex.$(OBJEXT): $(top_srcdir)/include/ruby.h
-complex.$(OBJEXT): {$(VPATH)}complex.c
-complex.$(OBJEXT): {$(VPATH)}config.h
-complex.$(OBJEXT): {$(VPATH)}defines.h
-complex.$(OBJEXT): {$(VPATH)}encoding.h
-complex.$(OBJEXT): {$(VPATH)}intern.h
-complex.$(OBJEXT): {$(VPATH)}internal.h
-complex.$(OBJEXT): {$(VPATH)}io.h
-complex.$(OBJEXT): {$(VPATH)}missing.h
-complex.$(OBJEXT): {$(VPATH)}oniguruma.h
-complex.$(OBJEXT): {$(VPATH)}st.h
-complex.$(OBJEXT): {$(VPATH)}subst.h
-cont.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-cont.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-cont.$(OBJEXT): $(CCAN_DIR)/list/list.h
-cont.$(OBJEXT): $(CCAN_DIR)/str/str.h
-cont.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-cont.$(OBJEXT): $(top_srcdir)/include/ruby.h
-cont.$(OBJEXT): {$(VPATH)}config.h
-cont.$(OBJEXT): {$(VPATH)}cont.c
-cont.$(OBJEXT): {$(VPATH)}defines.h
-cont.$(OBJEXT): {$(VPATH)}encoding.h
-cont.$(OBJEXT): {$(VPATH)}eval_intern.h
-cont.$(OBJEXT): {$(VPATH)}gc.h
-cont.$(OBJEXT): {$(VPATH)}id.h
-cont.$(OBJEXT): {$(VPATH)}intern.h
-cont.$(OBJEXT): {$(VPATH)}internal.h
-cont.$(OBJEXT): {$(VPATH)}io.h
-cont.$(OBJEXT): {$(VPATH)}method.h
-cont.$(OBJEXT): {$(VPATH)}missing.h
-cont.$(OBJEXT): {$(VPATH)}node.h
-cont.$(OBJEXT): {$(VPATH)}oniguruma.h
-cont.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-cont.$(OBJEXT): {$(VPATH)}st.h
-cont.$(OBJEXT): {$(VPATH)}subst.h
-cont.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-cont.$(OBJEXT): {$(VPATH)}thread_native.h
-cont.$(OBJEXT): {$(VPATH)}vm_core.h
-cont.$(OBJEXT): {$(VPATH)}vm_debug.h
-cont.$(OBJEXT): {$(VPATH)}vm_opts.h
-debug.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-debug.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-debug.$(OBJEXT): $(CCAN_DIR)/list/list.h
-debug.$(OBJEXT): $(CCAN_DIR)/str/str.h
-debug.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-debug.$(OBJEXT): $(top_srcdir)/include/ruby.h
-debug.$(OBJEXT): {$(VPATH)}config.h
-debug.$(OBJEXT): {$(VPATH)}debug.c
-debug.$(OBJEXT): {$(VPATH)}defines.h
-debug.$(OBJEXT): {$(VPATH)}encoding.h
-debug.$(OBJEXT): {$(VPATH)}eval_intern.h
-debug.$(OBJEXT): {$(VPATH)}id.h
-debug.$(OBJEXT): {$(VPATH)}intern.h
-debug.$(OBJEXT): {$(VPATH)}internal.h
-debug.$(OBJEXT): {$(VPATH)}io.h
-debug.$(OBJEXT): {$(VPATH)}method.h
-debug.$(OBJEXT): {$(VPATH)}missing.h
-debug.$(OBJEXT): {$(VPATH)}node.h
-debug.$(OBJEXT): {$(VPATH)}oniguruma.h
-debug.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-debug.$(OBJEXT): {$(VPATH)}st.h
-debug.$(OBJEXT): {$(VPATH)}subst.h
-debug.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-debug.$(OBJEXT): {$(VPATH)}thread_native.h
-debug.$(OBJEXT): {$(VPATH)}util.h
-debug.$(OBJEXT): {$(VPATH)}vm_core.h
-debug.$(OBJEXT): {$(VPATH)}vm_debug.h
-debug.$(OBJEXT): {$(VPATH)}vm_opts.h
-dir.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dir.$(OBJEXT): $(top_srcdir)/include/ruby.h
-dir.$(OBJEXT): {$(VPATH)}config.h
-dir.$(OBJEXT): {$(VPATH)}defines.h
-dir.$(OBJEXT): {$(VPATH)}dir.c
-dir.$(OBJEXT): {$(VPATH)}encindex.h
-dir.$(OBJEXT): {$(VPATH)}encoding.h
-dir.$(OBJEXT): {$(VPATH)}intern.h
-dir.$(OBJEXT): {$(VPATH)}internal.h
-dir.$(OBJEXT): {$(VPATH)}io.h
-dir.$(OBJEXT): {$(VPATH)}missing.h
-dir.$(OBJEXT): {$(VPATH)}oniguruma.h
-dir.$(OBJEXT): {$(VPATH)}st.h
-dir.$(OBJEXT): {$(VPATH)}subst.h
-dir.$(OBJEXT): {$(VPATH)}util.h
-dln.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dln.$(OBJEXT): {$(VPATH)}config.h
-dln.$(OBJEXT): {$(VPATH)}defines.h
-dln.$(OBJEXT): {$(VPATH)}dln.c
-dln.$(OBJEXT): {$(VPATH)}dln.h
-dln.$(OBJEXT): {$(VPATH)}intern.h
-dln.$(OBJEXT): {$(VPATH)}missing.h
-dln.$(OBJEXT): {$(VPATH)}st.h
-dln.$(OBJEXT): {$(VPATH)}subst.h
-dln_find.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dln_find.$(OBJEXT): {$(VPATH)}config.h
-dln_find.$(OBJEXT): {$(VPATH)}defines.h
-dln_find.$(OBJEXT): {$(VPATH)}dln.h
-dln_find.$(OBJEXT): {$(VPATH)}dln_find.c
-dln_find.$(OBJEXT): {$(VPATH)}intern.h
-dln_find.$(OBJEXT): {$(VPATH)}missing.h
-dln_find.$(OBJEXT): {$(VPATH)}st.h
-dln_find.$(OBJEXT): {$(VPATH)}subst.h
-dmydln.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dmydln.$(OBJEXT): {$(VPATH)}config.h
-dmydln.$(OBJEXT): {$(VPATH)}defines.h
-dmydln.$(OBJEXT): {$(VPATH)}dmydln.c
-dmydln.$(OBJEXT): {$(VPATH)}intern.h
-dmydln.$(OBJEXT): {$(VPATH)}missing.h
-dmydln.$(OBJEXT): {$(VPATH)}st.h
-dmydln.$(OBJEXT): {$(VPATH)}subst.h
-dmyenc.$(OBJEXT): {$(VPATH)}dmyenc.c
-dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-enc/ascii.$(OBJEXT): {$(VPATH)}config.h
-enc/ascii.$(OBJEXT): {$(VPATH)}defines.h
-enc/ascii.$(OBJEXT): {$(VPATH)}enc/ascii.c
-enc/ascii.$(OBJEXT): {$(VPATH)}encindex.h
-enc/ascii.$(OBJEXT): {$(VPATH)}missing.h
-enc/ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
-enc/ascii.$(OBJEXT): {$(VPATH)}regenc.h
-enc/trans/newline.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}config.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}defines.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}enc/trans/newline.c
-enc/trans/newline.$(OBJEXT): {$(VPATH)}intern.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}missing.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}st.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}subst.h
-enc/trans/newline.$(OBJEXT): {$(VPATH)}transcode_data.h
-enc/unicode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/unicode.$(OBJEXT): {$(VPATH)}config.h
-enc/unicode.$(OBJEXT): {$(VPATH)}defines.h
-enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode.c
-enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode/casefold.h
-enc/unicode.$(OBJEXT): {$(VPATH)}enc/unicode/name2ctype.h
-enc/unicode.$(OBJEXT): {$(VPATH)}intern.h
-enc/unicode.$(OBJEXT): {$(VPATH)}missing.h
-enc/unicode.$(OBJEXT): {$(VPATH)}oniguruma.h
-enc/unicode.$(OBJEXT): {$(VPATH)}regenc.h
-enc/unicode.$(OBJEXT): {$(VPATH)}regint.h
-enc/unicode.$(OBJEXT): {$(VPATH)}st.h
-enc/unicode.$(OBJEXT): {$(VPATH)}subst.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}config.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}defines.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}enc/us_ascii.c
-enc/us_ascii.$(OBJEXT): {$(VPATH)}encindex.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}missing.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
-enc/us_ascii.$(OBJEXT): {$(VPATH)}regenc.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}config.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}defines.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}enc/utf_8.c
-enc/utf_8.$(OBJEXT): {$(VPATH)}encindex.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}missing.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}oniguruma.h
-enc/utf_8.$(OBJEXT): {$(VPATH)}regenc.h
-encoding.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-encoding.$(OBJEXT): $(top_srcdir)/include/ruby.h
-encoding.$(OBJEXT): {$(VPATH)}config.h
-encoding.$(OBJEXT): {$(VPATH)}defines.h
-encoding.$(OBJEXT): {$(VPATH)}encindex.h
-encoding.$(OBJEXT): {$(VPATH)}encoding.c
-encoding.$(OBJEXT): {$(VPATH)}encoding.h
-encoding.$(OBJEXT): {$(VPATH)}intern.h
-encoding.$(OBJEXT): {$(VPATH)}internal.h
-encoding.$(OBJEXT): {$(VPATH)}io.h
-encoding.$(OBJEXT): {$(VPATH)}missing.h
-encoding.$(OBJEXT): {$(VPATH)}oniguruma.h
-encoding.$(OBJEXT): {$(VPATH)}regenc.h
-encoding.$(OBJEXT): {$(VPATH)}st.h
-encoding.$(OBJEXT): {$(VPATH)}subst.h
-encoding.$(OBJEXT): {$(VPATH)}util.h
-enum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enum.$(OBJEXT): $(top_srcdir)/include/ruby.h
-enum.$(OBJEXT): {$(VPATH)}config.h
-enum.$(OBJEXT): {$(VPATH)}defines.h
-enum.$(OBJEXT): {$(VPATH)}encoding.h
-enum.$(OBJEXT): {$(VPATH)}enum.c
-enum.$(OBJEXT): {$(VPATH)}id.h
-enum.$(OBJEXT): {$(VPATH)}intern.h
-enum.$(OBJEXT): {$(VPATH)}internal.h
-enum.$(OBJEXT): {$(VPATH)}io.h
-enum.$(OBJEXT): {$(VPATH)}missing.h
-enum.$(OBJEXT): {$(VPATH)}oniguruma.h
-enum.$(OBJEXT): {$(VPATH)}st.h
-enum.$(OBJEXT): {$(VPATH)}subst.h
-enum.$(OBJEXT): {$(VPATH)}util.h
-enumerator.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enumerator.$(OBJEXT): $(top_srcdir)/include/ruby.h
-enumerator.$(OBJEXT): {$(VPATH)}config.h
-enumerator.$(OBJEXT): {$(VPATH)}defines.h
-enumerator.$(OBJEXT): {$(VPATH)}encoding.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c
-enumerator.$(OBJEXT): {$(VPATH)}intern.h
-enumerator.$(OBJEXT): {$(VPATH)}internal.h
-enumerator.$(OBJEXT): {$(VPATH)}io.h
-enumerator.$(OBJEXT): {$(VPATH)}missing.h
-enumerator.$(OBJEXT): {$(VPATH)}oniguruma.h
-enumerator.$(OBJEXT): {$(VPATH)}st.h
-enumerator.$(OBJEXT): {$(VPATH)}subst.h
-error.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-error.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-error.$(OBJEXT): $(CCAN_DIR)/list/list.h
-error.$(OBJEXT): $(CCAN_DIR)/str/str.h
-error.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-error.$(OBJEXT): $(top_srcdir)/include/ruby.h
-error.$(OBJEXT): {$(VPATH)}config.h
-error.$(OBJEXT): {$(VPATH)}defines.h
-error.$(OBJEXT): {$(VPATH)}encoding.h
-error.$(OBJEXT): {$(VPATH)}error.c
-error.$(OBJEXT): {$(VPATH)}id.h
-error.$(OBJEXT): {$(VPATH)}intern.h
-error.$(OBJEXT): {$(VPATH)}internal.h
-error.$(OBJEXT): {$(VPATH)}io.h
-error.$(OBJEXT): {$(VPATH)}known_errors.inc
-error.$(OBJEXT): {$(VPATH)}method.h
-error.$(OBJEXT): {$(VPATH)}missing.h
-error.$(OBJEXT): {$(VPATH)}node.h
-error.$(OBJEXT): {$(VPATH)}oniguruma.h
-error.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-error.$(OBJEXT): {$(VPATH)}st.h
-error.$(OBJEXT): {$(VPATH)}subst.h
-error.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-error.$(OBJEXT): {$(VPATH)}thread_native.h
-error.$(OBJEXT): {$(VPATH)}vm_core.h
-error.$(OBJEXT): {$(VPATH)}vm_debug.h
-error.$(OBJEXT): {$(VPATH)}vm_opts.h
-eval.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-eval.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-eval.$(OBJEXT): $(CCAN_DIR)/list/list.h
-eval.$(OBJEXT): $(CCAN_DIR)/str/str.h
-eval.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-eval.$(OBJEXT): $(top_srcdir)/include/ruby.h
-eval.$(OBJEXT): {$(VPATH)}config.h
-eval.$(OBJEXT): {$(VPATH)}defines.h
-eval.$(OBJEXT): {$(VPATH)}encoding.h
-eval.$(OBJEXT): {$(VPATH)}eval.c
-eval.$(OBJEXT): {$(VPATH)}eval_error.c
-eval.$(OBJEXT): {$(VPATH)}eval_intern.h
-eval.$(OBJEXT): {$(VPATH)}eval_jump.c
-eval.$(OBJEXT): {$(VPATH)}gc.h
-eval.$(OBJEXT): {$(VPATH)}id.h
-eval.$(OBJEXT): {$(VPATH)}intern.h
-eval.$(OBJEXT): {$(VPATH)}internal.h
-eval.$(OBJEXT): {$(VPATH)}io.h
-eval.$(OBJEXT): {$(VPATH)}iseq.h
-eval.$(OBJEXT): {$(VPATH)}method.h
-eval.$(OBJEXT): {$(VPATH)}missing.h
-eval.$(OBJEXT): {$(VPATH)}node.h
-eval.$(OBJEXT): {$(VPATH)}oniguruma.h
-eval.$(OBJEXT): {$(VPATH)}probes.h
-eval.$(OBJEXT): {$(VPATH)}probes_helper.h
-eval.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-eval.$(OBJEXT): {$(VPATH)}st.h
-eval.$(OBJEXT): {$(VPATH)}subst.h
-eval.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-eval.$(OBJEXT): {$(VPATH)}thread_native.h
-eval.$(OBJEXT): {$(VPATH)}vm.h
-eval.$(OBJEXT): {$(VPATH)}vm_core.h
-eval.$(OBJEXT): {$(VPATH)}vm_debug.h
-eval.$(OBJEXT): {$(VPATH)}vm_opts.h
-file.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-file.$(OBJEXT): $(top_srcdir)/include/ruby.h
-file.$(OBJEXT): {$(VPATH)}config.h
-file.$(OBJEXT): {$(VPATH)}defines.h
-file.$(OBJEXT): {$(VPATH)}dln.h
-file.$(OBJEXT): {$(VPATH)}encindex.h
-file.$(OBJEXT): {$(VPATH)}encoding.h
-file.$(OBJEXT): {$(VPATH)}file.c
-file.$(OBJEXT): {$(VPATH)}intern.h
-file.$(OBJEXT): {$(VPATH)}internal.h
-file.$(OBJEXT): {$(VPATH)}io.h
-file.$(OBJEXT): {$(VPATH)}missing.h
-file.$(OBJEXT): {$(VPATH)}oniguruma.h
-file.$(OBJEXT): {$(VPATH)}st.h
-file.$(OBJEXT): {$(VPATH)}subst.h
-file.$(OBJEXT): {$(VPATH)}util.h
-gc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-gc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-gc.$(OBJEXT): $(CCAN_DIR)/list/list.h
-gc.$(OBJEXT): $(CCAN_DIR)/str/str.h
-gc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-gc.$(OBJEXT): $(top_srcdir)/include/ruby.h
-gc.$(OBJEXT): {$(VPATH)}config.h
-gc.$(OBJEXT): {$(VPATH)}constant.h
-gc.$(OBJEXT): {$(VPATH)}debug.h
-gc.$(OBJEXT): {$(VPATH)}defines.h
-gc.$(OBJEXT): {$(VPATH)}encoding.h
-gc.$(OBJEXT): {$(VPATH)}eval_intern.h
-gc.$(OBJEXT): {$(VPATH)}gc.c
-gc.$(OBJEXT): {$(VPATH)}gc.h
-gc.$(OBJEXT): {$(VPATH)}id.h
-gc.$(OBJEXT): {$(VPATH)}id_table.h
-gc.$(OBJEXT): {$(VPATH)}intern.h
-gc.$(OBJEXT): {$(VPATH)}internal.h
-gc.$(OBJEXT): {$(VPATH)}io.h
-gc.$(OBJEXT): {$(VPATH)}method.h
-gc.$(OBJEXT): {$(VPATH)}missing.h
-gc.$(OBJEXT): {$(VPATH)}node.h
-gc.$(OBJEXT): {$(VPATH)}oniguruma.h
-gc.$(OBJEXT): {$(VPATH)}probes.h
-gc.$(OBJEXT): {$(VPATH)}re.h
-gc.$(OBJEXT): {$(VPATH)}regenc.h
-gc.$(OBJEXT): {$(VPATH)}regex.h
-gc.$(OBJEXT): {$(VPATH)}regint.h
-gc.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-gc.$(OBJEXT): {$(VPATH)}st.h
-gc.$(OBJEXT): {$(VPATH)}subst.h
-gc.$(OBJEXT): {$(VPATH)}thread.h
-gc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-gc.$(OBJEXT): {$(VPATH)}thread_native.h
-gc.$(OBJEXT): {$(VPATH)}util.h
-gc.$(OBJEXT): {$(VPATH)}vm_core.h
-gc.$(OBJEXT): {$(VPATH)}vm_debug.h
-gc.$(OBJEXT): {$(VPATH)}vm_opts.h
-golf_prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-golf_prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-golf_prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
-golf_prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
-golf_prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-golf_prelude.$(OBJEXT): $(top_srcdir)/include/ruby.h
-golf_prelude.$(OBJEXT): {$(VPATH)}config.h
-golf_prelude.$(OBJEXT): {$(VPATH)}defines.h
-golf_prelude.$(OBJEXT): {$(VPATH)}encoding.h
-golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c
-golf_prelude.$(OBJEXT): {$(VPATH)}id.h
-golf_prelude.$(OBJEXT): {$(VPATH)}intern.h
-golf_prelude.$(OBJEXT): {$(VPATH)}internal.h
-golf_prelude.$(OBJEXT): {$(VPATH)}io.h
-golf_prelude.$(OBJEXT): {$(VPATH)}method.h
-golf_prelude.$(OBJEXT): {$(VPATH)}missing.h
-golf_prelude.$(OBJEXT): {$(VPATH)}node.h
-golf_prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
-golf_prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-golf_prelude.$(OBJEXT): {$(VPATH)}st.h
-golf_prelude.$(OBJEXT): {$(VPATH)}subst.h
-golf_prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-golf_prelude.$(OBJEXT): {$(VPATH)}thread_native.h
-golf_prelude.$(OBJEXT): {$(VPATH)}vm_core.h
-golf_prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
-golf_prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
-goruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-goruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
-goruby.$(OBJEXT): {$(VPATH)}config.h
-goruby.$(OBJEXT): {$(VPATH)}defines.h
-goruby.$(OBJEXT): {$(VPATH)}goruby.c
-goruby.$(OBJEXT): {$(VPATH)}intern.h
-goruby.$(OBJEXT): {$(VPATH)}main.c
-goruby.$(OBJEXT): {$(VPATH)}missing.h
-goruby.$(OBJEXT): {$(VPATH)}node.h
-goruby.$(OBJEXT): {$(VPATH)}st.h
-goruby.$(OBJEXT): {$(VPATH)}subst.h
-goruby.$(OBJEXT): {$(VPATH)}vm_debug.h
-hash.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-hash.$(OBJEXT): $(top_srcdir)/include/ruby.h
-hash.$(OBJEXT): {$(VPATH)}config.h
-hash.$(OBJEXT): {$(VPATH)}defines.h
-hash.$(OBJEXT): {$(VPATH)}encoding.h
-hash.$(OBJEXT): {$(VPATH)}hash.c
-hash.$(OBJEXT): {$(VPATH)}id.h
-hash.$(OBJEXT): {$(VPATH)}intern.h
-hash.$(OBJEXT): {$(VPATH)}internal.h
-hash.$(OBJEXT): {$(VPATH)}io.h
-hash.$(OBJEXT): {$(VPATH)}missing.h
-hash.$(OBJEXT): {$(VPATH)}oniguruma.h
-hash.$(OBJEXT): {$(VPATH)}probes.h
-hash.$(OBJEXT): {$(VPATH)}st.h
-hash.$(OBJEXT): {$(VPATH)}subst.h
-hash.$(OBJEXT): {$(VPATH)}symbol.h
-hash.$(OBJEXT): {$(VPATH)}util.h
-hash.$(OBJEXT): {$(VPATH)}vm_opts.h
-inits.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-inits.$(OBJEXT): $(top_srcdir)/include/ruby.h
-inits.$(OBJEXT): {$(VPATH)}config.h
-inits.$(OBJEXT): {$(VPATH)}defines.h
-inits.$(OBJEXT): {$(VPATH)}encoding.h
-inits.$(OBJEXT): {$(VPATH)}inits.c
-inits.$(OBJEXT): {$(VPATH)}intern.h
-inits.$(OBJEXT): {$(VPATH)}internal.h
-inits.$(OBJEXT): {$(VPATH)}io.h
-inits.$(OBJEXT): {$(VPATH)}missing.h
-inits.$(OBJEXT): {$(VPATH)}oniguruma.h
-inits.$(OBJEXT): {$(VPATH)}st.h
-inits.$(OBJEXT): {$(VPATH)}subst.h
-io.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-io.$(OBJEXT): $(top_srcdir)/include/ruby.h
-io.$(OBJEXT): {$(VPATH)}config.h
-io.$(OBJEXT): {$(VPATH)}defines.h
-io.$(OBJEXT): {$(VPATH)}dln.h
-io.$(OBJEXT): {$(VPATH)}encindex.h
-io.$(OBJEXT): {$(VPATH)}encoding.h
-io.$(OBJEXT): {$(VPATH)}id.h
-io.$(OBJEXT): {$(VPATH)}intern.h
-io.$(OBJEXT): {$(VPATH)}internal.h
-io.$(OBJEXT): {$(VPATH)}io.c
-io.$(OBJEXT): {$(VPATH)}io.h
-io.$(OBJEXT): {$(VPATH)}missing.h
-io.$(OBJEXT): {$(VPATH)}oniguruma.h
-io.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-io.$(OBJEXT): {$(VPATH)}st.h
-io.$(OBJEXT): {$(VPATH)}subst.h
-io.$(OBJEXT): {$(VPATH)}thread.h
-io.$(OBJEXT): {$(VPATH)}util.h
-iseq.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-iseq.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-iseq.$(OBJEXT): $(CCAN_DIR)/list/list.h
-iseq.$(OBJEXT): $(CCAN_DIR)/str/str.h
-iseq.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-iseq.$(OBJEXT): $(top_srcdir)/include/ruby.h
-iseq.$(OBJEXT): {$(VPATH)}config.h
-iseq.$(OBJEXT): {$(VPATH)}defines.h
-iseq.$(OBJEXT): {$(VPATH)}encoding.h
-iseq.$(OBJEXT): {$(VPATH)}eval_intern.h
-iseq.$(OBJEXT): {$(VPATH)}gc.h
-iseq.$(OBJEXT): {$(VPATH)}id.h
-iseq.$(OBJEXT): {$(VPATH)}insns.inc
-iseq.$(OBJEXT): {$(VPATH)}insns_info.inc
-iseq.$(OBJEXT): {$(VPATH)}intern.h
-iseq.$(OBJEXT): {$(VPATH)}internal.h
-iseq.$(OBJEXT): {$(VPATH)}io.h
-iseq.$(OBJEXT): {$(VPATH)}iseq.c
-iseq.$(OBJEXT): {$(VPATH)}iseq.h
-iseq.$(OBJEXT): {$(VPATH)}method.h
-iseq.$(OBJEXT): {$(VPATH)}missing.h
-iseq.$(OBJEXT): {$(VPATH)}node.h
-iseq.$(OBJEXT): {$(VPATH)}node_name.inc
-iseq.$(OBJEXT): {$(VPATH)}oniguruma.h
-iseq.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-iseq.$(OBJEXT): {$(VPATH)}st.h
-iseq.$(OBJEXT): {$(VPATH)}subst.h
-iseq.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-iseq.$(OBJEXT): {$(VPATH)}thread_native.h
-iseq.$(OBJEXT): {$(VPATH)}util.h
-iseq.$(OBJEXT): {$(VPATH)}vm_core.h
-iseq.$(OBJEXT): {$(VPATH)}vm_debug.h
-iseq.$(OBJEXT): {$(VPATH)}vm_opts.h
-load.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-load.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-load.$(OBJEXT): $(CCAN_DIR)/list/list.h
-load.$(OBJEXT): $(CCAN_DIR)/str/str.h
-load.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-load.$(OBJEXT): $(top_srcdir)/include/ruby.h
-load.$(OBJEXT): {$(VPATH)}config.h
-load.$(OBJEXT): {$(VPATH)}defines.h
-load.$(OBJEXT): {$(VPATH)}dln.h
-load.$(OBJEXT): {$(VPATH)}encoding.h
-load.$(OBJEXT): {$(VPATH)}eval_intern.h
-load.$(OBJEXT): {$(VPATH)}id.h
-load.$(OBJEXT): {$(VPATH)}intern.h
-load.$(OBJEXT): {$(VPATH)}internal.h
-load.$(OBJEXT): {$(VPATH)}io.h
-load.$(OBJEXT): {$(VPATH)}load.c
-load.$(OBJEXT): {$(VPATH)}method.h
-load.$(OBJEXT): {$(VPATH)}missing.h
-load.$(OBJEXT): {$(VPATH)}node.h
-load.$(OBJEXT): {$(VPATH)}oniguruma.h
-load.$(OBJEXT): {$(VPATH)}probes.h
-load.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-load.$(OBJEXT): {$(VPATH)}st.h
-load.$(OBJEXT): {$(VPATH)}subst.h
-load.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-load.$(OBJEXT): {$(VPATH)}thread_native.h
-load.$(OBJEXT): {$(VPATH)}util.h
-load.$(OBJEXT): {$(VPATH)}vm_core.h
-load.$(OBJEXT): {$(VPATH)}vm_debug.h
-load.$(OBJEXT): {$(VPATH)}vm_opts.h
-loadpath.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-loadpath.$(OBJEXT): $(hdrdir)/ruby/version.h
-loadpath.$(OBJEXT): $(top_srcdir)/version.h
-loadpath.$(OBJEXT): {$(VPATH)}config.h
-loadpath.$(OBJEXT): {$(VPATH)}defines.h
-loadpath.$(OBJEXT): {$(VPATH)}intern.h
-loadpath.$(OBJEXT): {$(VPATH)}loadpath.c
-loadpath.$(OBJEXT): {$(VPATH)}missing.h
-loadpath.$(OBJEXT): {$(VPATH)}st.h
-loadpath.$(OBJEXT): {$(VPATH)}subst.h
-loadpath.$(OBJEXT): {$(VPATH)}verconf.h
-localeinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-localeinit.$(OBJEXT): $(top_srcdir)/include/ruby.h
-localeinit.$(OBJEXT): {$(VPATH)}config.h
-localeinit.$(OBJEXT): {$(VPATH)}defines.h
-localeinit.$(OBJEXT): {$(VPATH)}encindex.h
-localeinit.$(OBJEXT): {$(VPATH)}encoding.h
-localeinit.$(OBJEXT): {$(VPATH)}intern.h
-localeinit.$(OBJEXT): {$(VPATH)}internal.h
-localeinit.$(OBJEXT): {$(VPATH)}io.h
-localeinit.$(OBJEXT): {$(VPATH)}localeinit.c
-localeinit.$(OBJEXT): {$(VPATH)}missing.h
-localeinit.$(OBJEXT): {$(VPATH)}oniguruma.h
-localeinit.$(OBJEXT): {$(VPATH)}st.h
-localeinit.$(OBJEXT): {$(VPATH)}subst.h
-main.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-main.$(OBJEXT): $(top_srcdir)/include/ruby.h
-main.$(OBJEXT): {$(VPATH)}config.h
-main.$(OBJEXT): {$(VPATH)}defines.h
-main.$(OBJEXT): {$(VPATH)}intern.h
-main.$(OBJEXT): {$(VPATH)}main.c
-main.$(OBJEXT): {$(VPATH)}missing.h
-main.$(OBJEXT): {$(VPATH)}node.h
-main.$(OBJEXT): {$(VPATH)}st.h
-main.$(OBJEXT): {$(VPATH)}subst.h
-main.$(OBJEXT): {$(VPATH)}vm_debug.h
-marshal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-marshal.$(OBJEXT): $(top_srcdir)/include/ruby.h
-marshal.$(OBJEXT): {$(VPATH)}config.h
-marshal.$(OBJEXT): {$(VPATH)}defines.h
-marshal.$(OBJEXT): {$(VPATH)}encindex.h
-marshal.$(OBJEXT): {$(VPATH)}encoding.h
-marshal.$(OBJEXT): {$(VPATH)}id_table.h
-marshal.$(OBJEXT): {$(VPATH)}intern.h
-marshal.$(OBJEXT): {$(VPATH)}internal.h
-marshal.$(OBJEXT): {$(VPATH)}io.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c
-marshal.$(OBJEXT): {$(VPATH)}missing.h
-marshal.$(OBJEXT): {$(VPATH)}oniguruma.h
-marshal.$(OBJEXT): {$(VPATH)}st.h
-marshal.$(OBJEXT): {$(VPATH)}subst.h
-marshal.$(OBJEXT): {$(VPATH)}util.h
-math.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-math.$(OBJEXT): $(top_srcdir)/include/ruby.h
-math.$(OBJEXT): {$(VPATH)}config.h
-math.$(OBJEXT): {$(VPATH)}defines.h
-math.$(OBJEXT): {$(VPATH)}encoding.h
-math.$(OBJEXT): {$(VPATH)}intern.h
-math.$(OBJEXT): {$(VPATH)}internal.h
-math.$(OBJEXT): {$(VPATH)}io.h
-math.$(OBJEXT): {$(VPATH)}math.c
-math.$(OBJEXT): {$(VPATH)}missing.h
-math.$(OBJEXT): {$(VPATH)}oniguruma.h
-math.$(OBJEXT): {$(VPATH)}st.h
-math.$(OBJEXT): {$(VPATH)}subst.h
-miniinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-miniinit.$(OBJEXT): {$(VPATH)}config.h
-miniinit.$(OBJEXT): {$(VPATH)}defines.h
-miniinit.$(OBJEXT): {$(VPATH)}encoding.h
-miniinit.$(OBJEXT): {$(VPATH)}intern.h
-miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
-miniinit.$(OBJEXT): {$(VPATH)}missing.h
-miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
-miniinit.$(OBJEXT): {$(VPATH)}st.h
-miniinit.$(OBJEXT): {$(VPATH)}subst.h
-miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
-node.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-node.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-node.$(OBJEXT): $(CCAN_DIR)/list/list.h
-node.$(OBJEXT): $(CCAN_DIR)/str/str.h
-node.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-node.$(OBJEXT): $(top_srcdir)/include/ruby.h
-node.$(OBJEXT): {$(VPATH)}config.h
-node.$(OBJEXT): {$(VPATH)}defines.h
-node.$(OBJEXT): {$(VPATH)}encoding.h
-node.$(OBJEXT): {$(VPATH)}id.h
-node.$(OBJEXT): {$(VPATH)}intern.h
-node.$(OBJEXT): {$(VPATH)}internal.h
-node.$(OBJEXT): {$(VPATH)}io.h
-node.$(OBJEXT): {$(VPATH)}method.h
-node.$(OBJEXT): {$(VPATH)}missing.h
-node.$(OBJEXT): {$(VPATH)}node.c
-node.$(OBJEXT): {$(VPATH)}node.h
-node.$(OBJEXT): {$(VPATH)}oniguruma.h
-node.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-node.$(OBJEXT): {$(VPATH)}st.h
-node.$(OBJEXT): {$(VPATH)}subst.h
-node.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-node.$(OBJEXT): {$(VPATH)}thread_native.h
-node.$(OBJEXT): {$(VPATH)}vm_core.h
-node.$(OBJEXT): {$(VPATH)}vm_debug.h
-node.$(OBJEXT): {$(VPATH)}vm_opts.h
-numeric.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-numeric.$(OBJEXT): $(top_srcdir)/include/ruby.h
-numeric.$(OBJEXT): {$(VPATH)}config.h
-numeric.$(OBJEXT): {$(VPATH)}defines.h
-numeric.$(OBJEXT): {$(VPATH)}encoding.h
-numeric.$(OBJEXT): {$(VPATH)}id.h
-numeric.$(OBJEXT): {$(VPATH)}intern.h
-numeric.$(OBJEXT): {$(VPATH)}internal.h
-numeric.$(OBJEXT): {$(VPATH)}io.h
-numeric.$(OBJEXT): {$(VPATH)}missing.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c
-numeric.$(OBJEXT): {$(VPATH)}oniguruma.h
-numeric.$(OBJEXT): {$(VPATH)}st.h
-numeric.$(OBJEXT): {$(VPATH)}subst.h
-numeric.$(OBJEXT): {$(VPATH)}util.h
-object.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-object.$(OBJEXT): $(top_srcdir)/include/ruby.h
-object.$(OBJEXT): {$(VPATH)}config.h
-object.$(OBJEXT): {$(VPATH)}constant.h
-object.$(OBJEXT): {$(VPATH)}defines.h
-object.$(OBJEXT): {$(VPATH)}encoding.h
-object.$(OBJEXT): {$(VPATH)}id.h
-object.$(OBJEXT): {$(VPATH)}intern.h
-object.$(OBJEXT): {$(VPATH)}internal.h
-object.$(OBJEXT): {$(VPATH)}io.h
-object.$(OBJEXT): {$(VPATH)}missing.h
-object.$(OBJEXT): {$(VPATH)}object.c
-object.$(OBJEXT): {$(VPATH)}oniguruma.h
-object.$(OBJEXT): {$(VPATH)}probes.h
-object.$(OBJEXT): {$(VPATH)}st.h
-object.$(OBJEXT): {$(VPATH)}subst.h
-object.$(OBJEXT): {$(VPATH)}util.h
-object.$(OBJEXT): {$(VPATH)}vm_opts.h
-pack.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-pack.$(OBJEXT): $(top_srcdir)/include/ruby.h
-pack.$(OBJEXT): {$(VPATH)}config.h
-pack.$(OBJEXT): {$(VPATH)}defines.h
-pack.$(OBJEXT): {$(VPATH)}encoding.h
-pack.$(OBJEXT): {$(VPATH)}intern.h
-pack.$(OBJEXT): {$(VPATH)}internal.h
-pack.$(OBJEXT): {$(VPATH)}io.h
-pack.$(OBJEXT): {$(VPATH)}missing.h
-pack.$(OBJEXT): {$(VPATH)}oniguruma.h
-pack.$(OBJEXT): {$(VPATH)}pack.c
-pack.$(OBJEXT): {$(VPATH)}st.h
-pack.$(OBJEXT): {$(VPATH)}subst.h
-parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-parse.$(OBJEXT): $(top_srcdir)/include/ruby.h
-parse.$(OBJEXT): {$(VPATH)}config.h
-parse.$(OBJEXT): {$(VPATH)}defines.h
-parse.$(OBJEXT): {$(VPATH)}defs/keywords
-parse.$(OBJEXT): {$(VPATH)}encoding.h
-parse.$(OBJEXT): {$(VPATH)}id.h
-parse.$(OBJEXT): {$(VPATH)}intern.h
-parse.$(OBJEXT): {$(VPATH)}internal.h
-parse.$(OBJEXT): {$(VPATH)}io.h
-parse.$(OBJEXT): {$(VPATH)}lex.c
-parse.$(OBJEXT): {$(VPATH)}missing.h
-parse.$(OBJEXT): {$(VPATH)}node.h
-parse.$(OBJEXT): {$(VPATH)}oniguruma.h
-parse.$(OBJEXT): {$(VPATH)}parse.c
-parse.$(OBJEXT): {$(VPATH)}parse.h
-parse.$(OBJEXT): {$(VPATH)}parse.y
-parse.$(OBJEXT): {$(VPATH)}probes.h
-parse.$(OBJEXT): {$(VPATH)}regenc.h
-parse.$(OBJEXT): {$(VPATH)}regex.h
-parse.$(OBJEXT): {$(VPATH)}st.h
-parse.$(OBJEXT): {$(VPATH)}subst.h
-parse.$(OBJEXT): {$(VPATH)}symbol.h
-parse.$(OBJEXT): {$(VPATH)}util.h
-parse.$(OBJEXT): {$(VPATH)}vm_opts.h
-prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
-prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
-prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-prelude.$(OBJEXT): $(top_srcdir)/include/ruby.h
-prelude.$(OBJEXT): {$(VPATH)}config.h
-prelude.$(OBJEXT): {$(VPATH)}defines.h
-prelude.$(OBJEXT): {$(VPATH)}encoding.h
-prelude.$(OBJEXT): {$(VPATH)}id.h
-prelude.$(OBJEXT): {$(VPATH)}intern.h
-prelude.$(OBJEXT): {$(VPATH)}internal.h
-prelude.$(OBJEXT): {$(VPATH)}io.h
-prelude.$(OBJEXT): {$(VPATH)}method.h
-prelude.$(OBJEXT): {$(VPATH)}missing.h
-prelude.$(OBJEXT): {$(VPATH)}node.h
-prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
-prelude.$(OBJEXT): {$(VPATH)}prelude.c
-prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-prelude.$(OBJEXT): {$(VPATH)}st.h
-prelude.$(OBJEXT): {$(VPATH)}subst.h
-prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-prelude.$(OBJEXT): {$(VPATH)}thread_native.h
-prelude.$(OBJEXT): {$(VPATH)}vm_core.h
-prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
-prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
-proc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-proc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-proc.$(OBJEXT): $(CCAN_DIR)/list/list.h
-proc.$(OBJEXT): $(CCAN_DIR)/str/str.h
-proc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-proc.$(OBJEXT): $(top_srcdir)/include/ruby.h
-proc.$(OBJEXT): {$(VPATH)}config.h
-proc.$(OBJEXT): {$(VPATH)}defines.h
-proc.$(OBJEXT): {$(VPATH)}encoding.h
-proc.$(OBJEXT): {$(VPATH)}eval_intern.h
-proc.$(OBJEXT): {$(VPATH)}gc.h
-proc.$(OBJEXT): {$(VPATH)}id.h
-proc.$(OBJEXT): {$(VPATH)}intern.h
-proc.$(OBJEXT): {$(VPATH)}internal.h
-proc.$(OBJEXT): {$(VPATH)}io.h
-proc.$(OBJEXT): {$(VPATH)}iseq.h
-proc.$(OBJEXT): {$(VPATH)}method.h
-proc.$(OBJEXT): {$(VPATH)}missing.h
-proc.$(OBJEXT): {$(VPATH)}node.h
-proc.$(OBJEXT): {$(VPATH)}oniguruma.h
-proc.$(OBJEXT): {$(VPATH)}proc.c
-proc.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-proc.$(OBJEXT): {$(VPATH)}st.h
-proc.$(OBJEXT): {$(VPATH)}subst.h
-proc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-proc.$(OBJEXT): {$(VPATH)}thread_native.h
-proc.$(OBJEXT): {$(VPATH)}vm_core.h
-proc.$(OBJEXT): {$(VPATH)}vm_debug.h
-proc.$(OBJEXT): {$(VPATH)}vm_opts.h
-process.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-process.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-process.$(OBJEXT): $(CCAN_DIR)/list/list.h
-process.$(OBJEXT): $(CCAN_DIR)/str/str.h
-process.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-process.$(OBJEXT): $(top_srcdir)/include/ruby.h
-process.$(OBJEXT): {$(VPATH)}config.h
-process.$(OBJEXT): {$(VPATH)}defines.h
-process.$(OBJEXT): {$(VPATH)}dln.h
-process.$(OBJEXT): {$(VPATH)}encoding.h
-process.$(OBJEXT): {$(VPATH)}id.h
-process.$(OBJEXT): {$(VPATH)}intern.h
-process.$(OBJEXT): {$(VPATH)}internal.h
-process.$(OBJEXT): {$(VPATH)}io.h
-process.$(OBJEXT): {$(VPATH)}method.h
-process.$(OBJEXT): {$(VPATH)}missing.h
-process.$(OBJEXT): {$(VPATH)}node.h
-process.$(OBJEXT): {$(VPATH)}oniguruma.h
-process.$(OBJEXT): {$(VPATH)}process.c
-process.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-process.$(OBJEXT): {$(VPATH)}st.h
-process.$(OBJEXT): {$(VPATH)}subst.h
-process.$(OBJEXT): {$(VPATH)}thread.h
-process.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-process.$(OBJEXT): {$(VPATH)}thread_native.h
-process.$(OBJEXT): {$(VPATH)}util.h
-process.$(OBJEXT): {$(VPATH)}vm_core.h
-process.$(OBJEXT): {$(VPATH)}vm_debug.h
-process.$(OBJEXT): {$(VPATH)}vm_opts.h
-random.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-random.$(OBJEXT): $(top_srcdir)/include/ruby.h
-random.$(OBJEXT): {$(VPATH)}config.h
-random.$(OBJEXT): {$(VPATH)}defines.h
-random.$(OBJEXT): {$(VPATH)}encoding.h
-random.$(OBJEXT): {$(VPATH)}intern.h
-random.$(OBJEXT): {$(VPATH)}internal.h
-random.$(OBJEXT): {$(VPATH)}io.h
-random.$(OBJEXT): {$(VPATH)}missing.h
-random.$(OBJEXT): {$(VPATH)}oniguruma.h
-random.$(OBJEXT): {$(VPATH)}random.c
-random.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-random.$(OBJEXT): {$(VPATH)}siphash.c
-random.$(OBJEXT): {$(VPATH)}siphash.h
-random.$(OBJEXT): {$(VPATH)}st.h
-random.$(OBJEXT): {$(VPATH)}subst.h
-range.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-range.$(OBJEXT): $(top_srcdir)/include/ruby.h
-range.$(OBJEXT): {$(VPATH)}config.h
-range.$(OBJEXT): {$(VPATH)}defines.h
-range.$(OBJEXT): {$(VPATH)}encoding.h
-range.$(OBJEXT): {$(VPATH)}id.h
-range.$(OBJEXT): {$(VPATH)}intern.h
-range.$(OBJEXT): {$(VPATH)}internal.h
-range.$(OBJEXT): {$(VPATH)}io.h
-range.$(OBJEXT): {$(VPATH)}missing.h
-range.$(OBJEXT): {$(VPATH)}oniguruma.h
-range.$(OBJEXT): {$(VPATH)}range.c
-range.$(OBJEXT): {$(VPATH)}st.h
-range.$(OBJEXT): {$(VPATH)}subst.h
-rational.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-rational.$(OBJEXT): $(top_srcdir)/include/ruby.h
-rational.$(OBJEXT): {$(VPATH)}config.h
-rational.$(OBJEXT): {$(VPATH)}defines.h
-rational.$(OBJEXT): {$(VPATH)}encoding.h
-rational.$(OBJEXT): {$(VPATH)}intern.h
-rational.$(OBJEXT): {$(VPATH)}internal.h
-rational.$(OBJEXT): {$(VPATH)}io.h
-rational.$(OBJEXT): {$(VPATH)}missing.h
-rational.$(OBJEXT): {$(VPATH)}oniguruma.h
-rational.$(OBJEXT): {$(VPATH)}rational.c
-rational.$(OBJEXT): {$(VPATH)}st.h
-rational.$(OBJEXT): {$(VPATH)}subst.h
-re.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-re.$(OBJEXT): $(top_srcdir)/include/ruby.h
-re.$(OBJEXT): {$(VPATH)}config.h
-re.$(OBJEXT): {$(VPATH)}defines.h
-re.$(OBJEXT): {$(VPATH)}encindex.h
-re.$(OBJEXT): {$(VPATH)}encoding.h
-re.$(OBJEXT): {$(VPATH)}intern.h
-re.$(OBJEXT): {$(VPATH)}internal.h
-re.$(OBJEXT): {$(VPATH)}io.h
-re.$(OBJEXT): {$(VPATH)}missing.h
-re.$(OBJEXT): {$(VPATH)}oniguruma.h
-re.$(OBJEXT): {$(VPATH)}re.c
-re.$(OBJEXT): {$(VPATH)}re.h
-re.$(OBJEXT): {$(VPATH)}regenc.h
-re.$(OBJEXT): {$(VPATH)}regex.h
-re.$(OBJEXT): {$(VPATH)}regint.h
-re.$(OBJEXT): {$(VPATH)}st.h
-re.$(OBJEXT): {$(VPATH)}subst.h
-re.$(OBJEXT): {$(VPATH)}util.h
-regcomp.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regcomp.$(OBJEXT): {$(VPATH)}config.h
-regcomp.$(OBJEXT): {$(VPATH)}defines.h
-regcomp.$(OBJEXT): {$(VPATH)}intern.h
-regcomp.$(OBJEXT): {$(VPATH)}missing.h
-regcomp.$(OBJEXT): {$(VPATH)}oniguruma.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c
-regcomp.$(OBJEXT): {$(VPATH)}regenc.h
-regcomp.$(OBJEXT): {$(VPATH)}regint.h
-regcomp.$(OBJEXT): {$(VPATH)}regparse.h
-regcomp.$(OBJEXT): {$(VPATH)}st.h
-regcomp.$(OBJEXT): {$(VPATH)}subst.h
-regenc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regenc.$(OBJEXT): {$(VPATH)}config.h
-regenc.$(OBJEXT): {$(VPATH)}defines.h
-regenc.$(OBJEXT): {$(VPATH)}intern.h
-regenc.$(OBJEXT): {$(VPATH)}missing.h
-regenc.$(OBJEXT): {$(VPATH)}oniguruma.h
-regenc.$(OBJEXT): {$(VPATH)}regenc.c
-regenc.$(OBJEXT): {$(VPATH)}regenc.h
-regenc.$(OBJEXT): {$(VPATH)}regint.h
-regenc.$(OBJEXT): {$(VPATH)}st.h
-regenc.$(OBJEXT): {$(VPATH)}subst.h
-regerror.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regerror.$(OBJEXT): {$(VPATH)}config.h
-regerror.$(OBJEXT): {$(VPATH)}defines.h
-regerror.$(OBJEXT): {$(VPATH)}intern.h
-regerror.$(OBJEXT): {$(VPATH)}missing.h
-regerror.$(OBJEXT): {$(VPATH)}oniguruma.h
-regerror.$(OBJEXT): {$(VPATH)}regenc.h
-regerror.$(OBJEXT): {$(VPATH)}regerror.c
-regerror.$(OBJEXT): {$(VPATH)}regint.h
-regerror.$(OBJEXT): {$(VPATH)}st.h
-regerror.$(OBJEXT): {$(VPATH)}subst.h
-regexec.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regexec.$(OBJEXT): {$(VPATH)}config.h
-regexec.$(OBJEXT): {$(VPATH)}defines.h
-regexec.$(OBJEXT): {$(VPATH)}intern.h
-regexec.$(OBJEXT): {$(VPATH)}missing.h
-regexec.$(OBJEXT): {$(VPATH)}oniguruma.h
-regexec.$(OBJEXT): {$(VPATH)}regenc.h
-regexec.$(OBJEXT): {$(VPATH)}regexec.c
-regexec.$(OBJEXT): {$(VPATH)}regint.h
-regexec.$(OBJEXT): {$(VPATH)}st.h
-regexec.$(OBJEXT): {$(VPATH)}subst.h
-regparse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regparse.$(OBJEXT): {$(VPATH)}config.h
-regparse.$(OBJEXT): {$(VPATH)}defines.h
-regparse.$(OBJEXT): {$(VPATH)}intern.h
-regparse.$(OBJEXT): {$(VPATH)}missing.h
-regparse.$(OBJEXT): {$(VPATH)}oniguruma.h
-regparse.$(OBJEXT): {$(VPATH)}regenc.h
-regparse.$(OBJEXT): {$(VPATH)}regint.h
-regparse.$(OBJEXT): {$(VPATH)}regparse.c
-regparse.$(OBJEXT): {$(VPATH)}regparse.h
-regparse.$(OBJEXT): {$(VPATH)}st.h
-regparse.$(OBJEXT): {$(VPATH)}subst.h
-regsyntax.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regsyntax.$(OBJEXT): {$(VPATH)}config.h
-regsyntax.$(OBJEXT): {$(VPATH)}defines.h
-regsyntax.$(OBJEXT): {$(VPATH)}intern.h
-regsyntax.$(OBJEXT): {$(VPATH)}missing.h
-regsyntax.$(OBJEXT): {$(VPATH)}oniguruma.h
-regsyntax.$(OBJEXT): {$(VPATH)}regenc.h
-regsyntax.$(OBJEXT): {$(VPATH)}regint.h
-regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c
-regsyntax.$(OBJEXT): {$(VPATH)}st.h
-regsyntax.$(OBJEXT): {$(VPATH)}subst.h
-ruby.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-ruby.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-ruby.$(OBJEXT): $(CCAN_DIR)/list/list.h
-ruby.$(OBJEXT): $(CCAN_DIR)/str/str.h
-ruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-ruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
-ruby.$(OBJEXT): {$(VPATH)}config.h
-ruby.$(OBJEXT): {$(VPATH)}defines.h
-ruby.$(OBJEXT): {$(VPATH)}dln.h
-ruby.$(OBJEXT): {$(VPATH)}encoding.h
-ruby.$(OBJEXT): {$(VPATH)}eval_intern.h
-ruby.$(OBJEXT): {$(VPATH)}id.h
-ruby.$(OBJEXT): {$(VPATH)}intern.h
-ruby.$(OBJEXT): {$(VPATH)}internal.h
-ruby.$(OBJEXT): {$(VPATH)}io.h
-ruby.$(OBJEXT): {$(VPATH)}method.h
-ruby.$(OBJEXT): {$(VPATH)}missing.h
-ruby.$(OBJEXT): {$(VPATH)}node.h
-ruby.$(OBJEXT): {$(VPATH)}oniguruma.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c
-ruby.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-ruby.$(OBJEXT): {$(VPATH)}st.h
-ruby.$(OBJEXT): {$(VPATH)}subst.h
-ruby.$(OBJEXT): {$(VPATH)}thread.h
-ruby.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-ruby.$(OBJEXT): {$(VPATH)}thread_native.h
-ruby.$(OBJEXT): {$(VPATH)}util.h
-ruby.$(OBJEXT): {$(VPATH)}vm_core.h
-ruby.$(OBJEXT): {$(VPATH)}vm_debug.h
-ruby.$(OBJEXT): {$(VPATH)}vm_opts.h
-safe.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-safe.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-safe.$(OBJEXT): $(CCAN_DIR)/list/list.h
-safe.$(OBJEXT): $(CCAN_DIR)/str/str.h
-safe.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-safe.$(OBJEXT): $(top_srcdir)/include/ruby.h
-safe.$(OBJEXT): {$(VPATH)}config.h
-safe.$(OBJEXT): {$(VPATH)}defines.h
-safe.$(OBJEXT): {$(VPATH)}encoding.h
-safe.$(OBJEXT): {$(VPATH)}id.h
-safe.$(OBJEXT): {$(VPATH)}intern.h
-safe.$(OBJEXT): {$(VPATH)}internal.h
-safe.$(OBJEXT): {$(VPATH)}io.h
-safe.$(OBJEXT): {$(VPATH)}method.h
-safe.$(OBJEXT): {$(VPATH)}missing.h
-safe.$(OBJEXT): {$(VPATH)}node.h
-safe.$(OBJEXT): {$(VPATH)}oniguruma.h
-safe.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-safe.$(OBJEXT): {$(VPATH)}safe.c
-safe.$(OBJEXT): {$(VPATH)}st.h
-safe.$(OBJEXT): {$(VPATH)}subst.h
-safe.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-safe.$(OBJEXT): {$(VPATH)}thread_native.h
-safe.$(OBJEXT): {$(VPATH)}vm_core.h
-safe.$(OBJEXT): {$(VPATH)}vm_debug.h
-safe.$(OBJEXT): {$(VPATH)}vm_opts.h
-setproctitle.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-setproctitle.$(OBJEXT): $(top_srcdir)/include/ruby.h
-setproctitle.$(OBJEXT): {$(VPATH)}config.h
-setproctitle.$(OBJEXT): {$(VPATH)}defines.h
-setproctitle.$(OBJEXT): {$(VPATH)}intern.h
-setproctitle.$(OBJEXT): {$(VPATH)}missing.h
-setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
-setproctitle.$(OBJEXT): {$(VPATH)}st.h
-setproctitle.$(OBJEXT): {$(VPATH)}subst.h
-setproctitle.$(OBJEXT): {$(VPATH)}util.h
-signal.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-signal.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-signal.$(OBJEXT): $(CCAN_DIR)/list/list.h
-signal.$(OBJEXT): $(CCAN_DIR)/str/str.h
-signal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-signal.$(OBJEXT): $(top_srcdir)/include/ruby.h
-signal.$(OBJEXT): {$(VPATH)}config.h
-signal.$(OBJEXT): {$(VPATH)}defines.h
-signal.$(OBJEXT): {$(VPATH)}encoding.h
-signal.$(OBJEXT): {$(VPATH)}eval_intern.h
-signal.$(OBJEXT): {$(VPATH)}id.h
-signal.$(OBJEXT): {$(VPATH)}intern.h
-signal.$(OBJEXT): {$(VPATH)}internal.h
-signal.$(OBJEXT): {$(VPATH)}io.h
-signal.$(OBJEXT): {$(VPATH)}method.h
-signal.$(OBJEXT): {$(VPATH)}missing.h
-signal.$(OBJEXT): {$(VPATH)}node.h
-signal.$(OBJEXT): {$(VPATH)}oniguruma.h
-signal.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-signal.$(OBJEXT): {$(VPATH)}signal.c
-signal.$(OBJEXT): {$(VPATH)}st.h
-signal.$(OBJEXT): {$(VPATH)}subst.h
-signal.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-signal.$(OBJEXT): {$(VPATH)}thread_native.h
-signal.$(OBJEXT): {$(VPATH)}vm_core.h
-signal.$(OBJEXT): {$(VPATH)}vm_debug.h
-signal.$(OBJEXT): {$(VPATH)}vm_opts.h
-sprintf.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-sprintf.$(OBJEXT): $(top_srcdir)/include/ruby.h
-sprintf.$(OBJEXT): {$(VPATH)}config.h
-sprintf.$(OBJEXT): {$(VPATH)}defines.h
-sprintf.$(OBJEXT): {$(VPATH)}encoding.h
-sprintf.$(OBJEXT): {$(VPATH)}id.h
-sprintf.$(OBJEXT): {$(VPATH)}intern.h
-sprintf.$(OBJEXT): {$(VPATH)}internal.h
-sprintf.$(OBJEXT): {$(VPATH)}io.h
-sprintf.$(OBJEXT): {$(VPATH)}missing.h
-sprintf.$(OBJEXT): {$(VPATH)}oniguruma.h
-sprintf.$(OBJEXT): {$(VPATH)}re.h
-sprintf.$(OBJEXT): {$(VPATH)}regex.h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c
-sprintf.$(OBJEXT): {$(VPATH)}st.h
-sprintf.$(OBJEXT): {$(VPATH)}subst.h
-sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
-st.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-st.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-st.$(OBJEXT): $(CCAN_DIR)/list/list.h
-st.$(OBJEXT): $(CCAN_DIR)/str/str.h
-st.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-st.$(OBJEXT): $(top_srcdir)/include/ruby.h
-st.$(OBJEXT): {$(VPATH)}config.h
-st.$(OBJEXT): {$(VPATH)}defines.h
-st.$(OBJEXT): {$(VPATH)}encoding.h
-st.$(OBJEXT): {$(VPATH)}intern.h
-st.$(OBJEXT): {$(VPATH)}internal.h
-st.$(OBJEXT): {$(VPATH)}io.h
-st.$(OBJEXT): {$(VPATH)}missing.h
-st.$(OBJEXT): {$(VPATH)}oniguruma.h
-st.$(OBJEXT): {$(VPATH)}st.c
-st.$(OBJEXT): {$(VPATH)}st.h
-st.$(OBJEXT): {$(VPATH)}subst.h
-strftime.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-strftime.$(OBJEXT): {$(VPATH)}config.h
-strftime.$(OBJEXT): {$(VPATH)}defines.h
-strftime.$(OBJEXT): {$(VPATH)}encoding.h
-strftime.$(OBJEXT): {$(VPATH)}intern.h
-strftime.$(OBJEXT): {$(VPATH)}missing.h
-strftime.$(OBJEXT): {$(VPATH)}oniguruma.h
-strftime.$(OBJEXT): {$(VPATH)}st.h
-strftime.$(OBJEXT): {$(VPATH)}strftime.c
-strftime.$(OBJEXT): {$(VPATH)}subst.h
-strftime.$(OBJEXT): {$(VPATH)}timev.h
-string.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-string.$(OBJEXT): $(top_srcdir)/include/ruby.h
-string.$(OBJEXT): {$(VPATH)}config.h
-string.$(OBJEXT): {$(VPATH)}defines.h
-string.$(OBJEXT): {$(VPATH)}encindex.h
-string.$(OBJEXT): {$(VPATH)}encoding.h
-string.$(OBJEXT): {$(VPATH)}gc.h
-string.$(OBJEXT): {$(VPATH)}id.h
-string.$(OBJEXT): {$(VPATH)}intern.h
-string.$(OBJEXT): {$(VPATH)}internal.h
-string.$(OBJEXT): {$(VPATH)}io.h
-string.$(OBJEXT): {$(VPATH)}missing.h
-string.$(OBJEXT): {$(VPATH)}oniguruma.h
-string.$(OBJEXT): {$(VPATH)}probes.h
-string.$(OBJEXT): {$(VPATH)}re.h
-string.$(OBJEXT): {$(VPATH)}regex.h
-string.$(OBJEXT): {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c
-string.$(OBJEXT): {$(VPATH)}subst.h
-string.$(OBJEXT): {$(VPATH)}vm_opts.h
-strlcat.$(OBJEXT): {$(VPATH)}config.h
-strlcat.$(OBJEXT): {$(VPATH)}missing.h
-strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
-strlcpy.$(OBJEXT): {$(VPATH)}config.h
-strlcpy.$(OBJEXT): {$(VPATH)}missing.h
-strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
-struct.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-struct.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-struct.$(OBJEXT): $(CCAN_DIR)/list/list.h
-struct.$(OBJEXT): $(CCAN_DIR)/str/str.h
-struct.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-struct.$(OBJEXT): $(top_srcdir)/include/ruby.h
-struct.$(OBJEXT): {$(VPATH)}config.h
-struct.$(OBJEXT): {$(VPATH)}defines.h
-struct.$(OBJEXT): {$(VPATH)}encoding.h
-struct.$(OBJEXT): {$(VPATH)}id.h
-struct.$(OBJEXT): {$(VPATH)}intern.h
-struct.$(OBJEXT): {$(VPATH)}internal.h
-struct.$(OBJEXT): {$(VPATH)}io.h
-struct.$(OBJEXT): {$(VPATH)}method.h
-struct.$(OBJEXT): {$(VPATH)}missing.h
-struct.$(OBJEXT): {$(VPATH)}node.h
-struct.$(OBJEXT): {$(VPATH)}oniguruma.h
-struct.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-struct.$(OBJEXT): {$(VPATH)}st.h
-struct.$(OBJEXT): {$(VPATH)}struct.c
-struct.$(OBJEXT): {$(VPATH)}subst.h
-struct.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-struct.$(OBJEXT): {$(VPATH)}thread_native.h
-struct.$(OBJEXT): {$(VPATH)}vm_core.h
-struct.$(OBJEXT): {$(VPATH)}vm_debug.h
-struct.$(OBJEXT): {$(VPATH)}vm_opts.h
-symbol.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-symbol.$(OBJEXT): $(top_srcdir)/include/ruby.h
-symbol.$(OBJEXT): {$(VPATH)}config.h
-symbol.$(OBJEXT): {$(VPATH)}defines.h
-symbol.$(OBJEXT): {$(VPATH)}encoding.h
-symbol.$(OBJEXT): {$(VPATH)}gc.h
-symbol.$(OBJEXT): {$(VPATH)}id.c
-symbol.$(OBJEXT): {$(VPATH)}id.h
-symbol.$(OBJEXT): {$(VPATH)}intern.h
-symbol.$(OBJEXT): {$(VPATH)}internal.h
-symbol.$(OBJEXT): {$(VPATH)}io.h
-symbol.$(OBJEXT): {$(VPATH)}missing.h
-symbol.$(OBJEXT): {$(VPATH)}oniguruma.h
-symbol.$(OBJEXT): {$(VPATH)}probes.h
-symbol.$(OBJEXT): {$(VPATH)}st.h
-symbol.$(OBJEXT): {$(VPATH)}subst.h
-symbol.$(OBJEXT): {$(VPATH)}symbol.c
-symbol.$(OBJEXT): {$(VPATH)}id_table.c
-symbol.$(OBJEXT): {$(VPATH)}id_table.h
-symbol.$(OBJEXT): {$(VPATH)}symbol.h
-symbol.$(OBJEXT): {$(VPATH)}vm_opts.h
-thread.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-thread.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-thread.$(OBJEXT): $(CCAN_DIR)/list/list.h
-thread.$(OBJEXT): $(CCAN_DIR)/str/str.h
-thread.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-thread.$(OBJEXT): $(top_srcdir)/include/ruby.h
-thread.$(OBJEXT): {$(VPATH)}config.h
-thread.$(OBJEXT): {$(VPATH)}defines.h
-thread.$(OBJEXT): {$(VPATH)}encoding.h
-thread.$(OBJEXT): {$(VPATH)}eval_intern.h
-thread.$(OBJEXT): {$(VPATH)}gc.h
-thread.$(OBJEXT): {$(VPATH)}id.h
-thread.$(OBJEXT): {$(VPATH)}intern.h
-thread.$(OBJEXT): {$(VPATH)}internal.h
-thread.$(OBJEXT): {$(VPATH)}io.h
-thread.$(OBJEXT): {$(VPATH)}method.h
-thread.$(OBJEXT): {$(VPATH)}missing.h
-thread.$(OBJEXT): {$(VPATH)}node.h
-thread.$(OBJEXT): {$(VPATH)}oniguruma.h
-thread.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-thread.$(OBJEXT): {$(VPATH)}st.h
-thread.$(OBJEXT): {$(VPATH)}subst.h
-thread.$(OBJEXT): {$(VPATH)}thread.c
-thread.$(OBJEXT): {$(VPATH)}thread.h
-thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).c
-thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-thread.$(OBJEXT): {$(VPATH)}thread_native.h
-thread.$(OBJEXT): {$(VPATH)}thread_sync.c
-thread.$(OBJEXT): {$(VPATH)}timev.h
-thread.$(OBJEXT): {$(VPATH)}vm_core.h
-thread.$(OBJEXT): {$(VPATH)}vm_debug.h
-thread.$(OBJEXT): {$(VPATH)}vm_opts.h
-time.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-time.$(OBJEXT): $(top_srcdir)/include/ruby.h
-time.$(OBJEXT): {$(VPATH)}config.h
-time.$(OBJEXT): {$(VPATH)}defines.h
-time.$(OBJEXT): {$(VPATH)}encoding.h
-time.$(OBJEXT): {$(VPATH)}intern.h
-time.$(OBJEXT): {$(VPATH)}internal.h
-time.$(OBJEXT): {$(VPATH)}io.h
-time.$(OBJEXT): {$(VPATH)}missing.h
-time.$(OBJEXT): {$(VPATH)}oniguruma.h
-time.$(OBJEXT): {$(VPATH)}st.h
-time.$(OBJEXT): {$(VPATH)}subst.h
-time.$(OBJEXT): {$(VPATH)}time.c
-time.$(OBJEXT): {$(VPATH)}timev.h
-transcode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-transcode.$(OBJEXT): $(top_srcdir)/include/ruby.h
-transcode.$(OBJEXT): {$(VPATH)}config.h
-transcode.$(OBJEXT): {$(VPATH)}defines.h
-transcode.$(OBJEXT): {$(VPATH)}encoding.h
-transcode.$(OBJEXT): {$(VPATH)}intern.h
-transcode.$(OBJEXT): {$(VPATH)}internal.h
-transcode.$(OBJEXT): {$(VPATH)}io.h
-transcode.$(OBJEXT): {$(VPATH)}missing.h
-transcode.$(OBJEXT): {$(VPATH)}oniguruma.h
-transcode.$(OBJEXT): {$(VPATH)}st.h
-transcode.$(OBJEXT): {$(VPATH)}subst.h
-transcode.$(OBJEXT): {$(VPATH)}transcode.c
-transcode.$(OBJEXT): {$(VPATH)}transcode_data.h
-util.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-util.$(OBJEXT): $(top_srcdir)/include/ruby.h
-util.$(OBJEXT): {$(VPATH)}config.h
-util.$(OBJEXT): {$(VPATH)}defines.h
-util.$(OBJEXT): {$(VPATH)}encoding.h
-util.$(OBJEXT): {$(VPATH)}intern.h
-util.$(OBJEXT): {$(VPATH)}internal.h
-util.$(OBJEXT): {$(VPATH)}io.h
-util.$(OBJEXT): {$(VPATH)}missing.h
-util.$(OBJEXT): {$(VPATH)}oniguruma.h
-util.$(OBJEXT): {$(VPATH)}st.h
-util.$(OBJEXT): {$(VPATH)}subst.h
-util.$(OBJEXT): {$(VPATH)}util.c
-util.$(OBJEXT): {$(VPATH)}util.h
-variable.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-variable.$(OBJEXT): $(top_srcdir)/include/ruby.h
-variable.$(OBJEXT): {$(VPATH)}config.h
-variable.$(OBJEXT): {$(VPATH)}constant.h
-variable.$(OBJEXT): {$(VPATH)}defines.h
-variable.$(OBJEXT): {$(VPATH)}encoding.h
-variable.$(OBJEXT): {$(VPATH)}id.h
-variable.$(OBJEXT): {$(VPATH)}intern.h
-variable.$(OBJEXT): {$(VPATH)}internal.h
-variable.$(OBJEXT): {$(VPATH)}io.h
-variable.$(OBJEXT): {$(VPATH)}missing.h
-variable.$(OBJEXT): {$(VPATH)}oniguruma.h
-variable.$(OBJEXT): {$(VPATH)}st.h
-variable.$(OBJEXT): {$(VPATH)}subst.h
-variable.$(OBJEXT): {$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c
-version.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-version.$(OBJEXT): $(hdrdir)/ruby/version.h
-version.$(OBJEXT): $(top_srcdir)/revision.h
-version.$(OBJEXT): $(top_srcdir)/version.h
-version.$(OBJEXT): {$(VPATH)}config.h
-version.$(OBJEXT): {$(VPATH)}defines.h
-version.$(OBJEXT): {$(VPATH)}intern.h
-version.$(OBJEXT): {$(VPATH)}missing.h
-version.$(OBJEXT): {$(VPATH)}st.h
-version.$(OBJEXT): {$(VPATH)}subst.h
-version.$(OBJEXT): {$(VPATH)}version.c
-vm.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-vm.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-vm.$(OBJEXT): $(CCAN_DIR)/list/list.h
-vm.$(OBJEXT): $(CCAN_DIR)/str/str.h
-vm.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm.$(OBJEXT): {$(VPATH)}config.h
-vm.$(OBJEXT): {$(VPATH)}constant.h
-vm.$(OBJEXT): {$(VPATH)}defines.h
-vm.$(OBJEXT): {$(VPATH)}encoding.h
-vm.$(OBJEXT): {$(VPATH)}eval_intern.h
-vm.$(OBJEXT): {$(VPATH)}gc.h
-vm.$(OBJEXT): {$(VPATH)}id.h
-vm.$(OBJEXT): {$(VPATH)}id_table.h
-vm.$(OBJEXT): {$(VPATH)}insns.def
-vm.$(OBJEXT): {$(VPATH)}insns.inc
-vm.$(OBJEXT): {$(VPATH)}intern.h
-vm.$(OBJEXT): {$(VPATH)}internal.h
-vm.$(OBJEXT): {$(VPATH)}io.h
-vm.$(OBJEXT): {$(VPATH)}iseq.h
-vm.$(OBJEXT): {$(VPATH)}method.h
-vm.$(OBJEXT): {$(VPATH)}missing.h
-vm.$(OBJEXT): {$(VPATH)}node.h
-vm.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm.$(OBJEXT): {$(VPATH)}probes.h
-vm.$(OBJEXT): {$(VPATH)}probes_helper.h
-vm.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-vm.$(OBJEXT): {$(VPATH)}st.h
-vm.$(OBJEXT): {$(VPATH)}subst.h
-vm.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-vm.$(OBJEXT): {$(VPATH)}thread_native.h
-vm.$(OBJEXT): {$(VPATH)}vm.c
-vm.$(OBJEXT): {$(VPATH)}vm.h
-vm.$(OBJEXT): {$(VPATH)}vm.inc
-vm.$(OBJEXT): {$(VPATH)}vm_call_iseq_optimized.inc
-vm.$(OBJEXT): {$(VPATH)}vm_args.c
-vm.$(OBJEXT): {$(VPATH)}vm_core.h
-vm.$(OBJEXT): {$(VPATH)}vm_debug.h
-vm.$(OBJEXT): {$(VPATH)}vm_eval.c
-vm.$(OBJEXT): {$(VPATH)}vm_exec.c
-vm.$(OBJEXT): {$(VPATH)}vm_exec.h
-vm.$(OBJEXT): {$(VPATH)}vm_insnhelper.c
-vm.$(OBJEXT): {$(VPATH)}vm_insnhelper.h
-vm.$(OBJEXT): {$(VPATH)}vm_method.c
-vm.$(OBJEXT): {$(VPATH)}vm_opts.h
-vm.$(OBJEXT): {$(VPATH)}vmtc.inc
-vm_backtrace.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-vm_backtrace.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-vm_backtrace.$(OBJEXT): $(CCAN_DIR)/list/list.h
-vm_backtrace.$(OBJEXT): $(CCAN_DIR)/str/str.h
-vm_backtrace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm_backtrace.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}config.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}debug.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}defines.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}encoding.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}eval_intern.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}id.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}intern.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}internal.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}io.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}iseq.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}method.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}missing.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}node.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}st.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}subst.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-vm_backtrace.$(OBJEXT): {$(VPATH)}thread_native.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c
-vm_backtrace.$(OBJEXT): {$(VPATH)}vm_core.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}vm_debug.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}vm_opts.h
-vm_call.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm_call.$(OBJEXT): {$(VPATH)}vm_core.h
-vm_call.$(OBJEXT): {$(VPATH)}vm_call_iseq_optimized.inc
-vm_dump.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-vm_dump.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-vm_dump.$(OBJEXT): $(CCAN_DIR)/list/list.h
-vm_dump.$(OBJEXT): $(CCAN_DIR)/str/str.h
-vm_dump.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm_dump.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm_dump.$(OBJEXT): {$(VPATH)}addr2line.h
-vm_dump.$(OBJEXT): {$(VPATH)}config.h
-vm_dump.$(OBJEXT): {$(VPATH)}defines.h
-vm_dump.$(OBJEXT): {$(VPATH)}encoding.h
-vm_dump.$(OBJEXT): {$(VPATH)}id.h
-vm_dump.$(OBJEXT): {$(VPATH)}intern.h
-vm_dump.$(OBJEXT): {$(VPATH)}internal.h
-vm_dump.$(OBJEXT): {$(VPATH)}io.h
-vm_dump.$(OBJEXT): {$(VPATH)}iseq.h
-vm_dump.$(OBJEXT): {$(VPATH)}method.h
-vm_dump.$(OBJEXT): {$(VPATH)}missing.h
-vm_dump.$(OBJEXT): {$(VPATH)}node.h
-vm_dump.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_dump.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-vm_dump.$(OBJEXT): {$(VPATH)}st.h
-vm_dump.$(OBJEXT): {$(VPATH)}subst.h
-vm_dump.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-vm_dump.$(OBJEXT): {$(VPATH)}thread_native.h
-vm_dump.$(OBJEXT): {$(VPATH)}vm_core.h
-vm_dump.$(OBJEXT): {$(VPATH)}vm_debug.h
-vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c
-vm_dump.$(OBJEXT): {$(VPATH)}vm_opts.h
-vm_trace.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-vm_trace.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-vm_trace.$(OBJEXT): $(CCAN_DIR)/list/list.h
-vm_trace.$(OBJEXT): $(CCAN_DIR)/str/str.h
-vm_trace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm_trace.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm_trace.$(OBJEXT): {$(VPATH)}config.h
-vm_trace.$(OBJEXT): {$(VPATH)}debug.h
-vm_trace.$(OBJEXT): {$(VPATH)}defines.h
-vm_trace.$(OBJEXT): {$(VPATH)}encoding.h
-vm_trace.$(OBJEXT): {$(VPATH)}eval_intern.h
-vm_trace.$(OBJEXT): {$(VPATH)}id.h
-vm_trace.$(OBJEXT): {$(VPATH)}intern.h
-vm_trace.$(OBJEXT): {$(VPATH)}internal.h
-vm_trace.$(OBJEXT): {$(VPATH)}io.h
-vm_trace.$(OBJEXT): {$(VPATH)}method.h
-vm_trace.$(OBJEXT): {$(VPATH)}missing.h
-vm_trace.$(OBJEXT): {$(VPATH)}node.h
-vm_trace.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_trace.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-vm_trace.$(OBJEXT): {$(VPATH)}st.h
-vm_trace.$(OBJEXT): {$(VPATH)}subst.h
-vm_trace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-vm_trace.$(OBJEXT): {$(VPATH)}thread_native.h
-vm_trace.$(OBJEXT): {$(VPATH)}vm_core.h
-vm_trace.$(OBJEXT): {$(VPATH)}vm_debug.h
-vm_trace.$(OBJEXT): {$(VPATH)}vm_opts.h
-vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/compar.c b/compar.c
index b040641651..65def78484 100644
--- a/compar.c
+++ b/compar.c
@@ -18,43 +18,33 @@ static ID cmp;
void
rb_cmperr(VALUE x, VALUE y)
{
- VALUE classname;
+ const char *classname;
- if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
- classname = rb_inspect(y);
+ if (SPECIAL_CONST_P(y)) {
+ y = rb_inspect(y);
+ classname = StringValuePtr(y);
}
else {
- classname = rb_obj_class(y);
+ classname = rb_obj_classname(y);
}
- rb_raise(rb_eArgError, "comparison of %"PRIsVALUE" with %"PRIsVALUE" failed",
- rb_obj_class(x), classname);
+ rb_raise(rb_eArgError, "comparison of %s with %s failed",
+ rb_obj_classname(x), classname);
}
static VALUE
-invcmp_recursive(VALUE x, VALUE y, int recursive)
+cmp_eq(VALUE *a)
{
- if (recursive) return Qnil;
- return rb_check_funcall(y, cmp, 1, &x);
-}
+ VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
-VALUE
-rb_invcmp(VALUE x, VALUE y)
-{
- VALUE invcmp = rb_exec_recursive(invcmp_recursive, x, y);
- if (invcmp == Qundef || NIL_P(invcmp)) {
- return Qnil;
- }
- else {
- int result = -rb_cmpint(invcmp, x, y);
- return INT2FIX(result);
- }
+ if (NIL_P(c)) return Qfalse;
+ if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;
+ return Qfalse;
}
static VALUE
-cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
+cmp_failed(void)
{
- if (recursive) return Qnil;
- return rb_funcallv(arg1, cmp, 1, &arg2);
+ return Qfalse;
}
/*
@@ -69,14 +59,12 @@ cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
static VALUE
cmp_equal(VALUE x, VALUE y)
{
- VALUE c;
- if (x == y) return Qtrue;
+ VALUE a[2];
- c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y);
+ if (x == y) return Qtrue;
- if (NIL_P(c)) return Qfalse;
- if (rb_cmpint(c, x, y) == 0) return Qtrue;
- return Qfalse;
+ a[0] = x; a[1] = y;
+ return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
}
/*
@@ -185,8 +173,8 @@ cmp_between(VALUE x, VALUE min, VALUE max)
* class SizeMatters
* include Comparable
* attr :str
- * def <=>(other)
- * str.size <=> other.str.size
+ * def <=>(anOther)
+ * str.size <=> anOther.str.size
* end
* def initialize(str)
* @str = str
diff --git a/compile.c b/compile.c
index f767dc4b05..7dffe08141 100644
--- a/compile.c
+++ b/compile.c
@@ -9,9 +9,8 @@
**********************************************************************/
+#include "ruby/ruby.h"
#include "internal.h"
-#include "ruby/re.h"
-#include "encindex.h"
#include <math.h>
#define USE_INSN_STACK_INCREASE 1
@@ -19,15 +18,8 @@
#include "iseq.h"
#include "insns.inc"
#include "insns_info.inc"
-#include "gc.h"
-
-#ifdef HAVE_DLADDR
-# include <dlfcn.h>
-#endif
-
-#undef RUBY_UNTYPED_DATA_WARNING
-#define RUBY_UNTYPED_DATA_WARNING 0
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
#define FIXNUM_OR(n, i) ((n)|INT2FIX(i))
@@ -47,13 +39,6 @@ typedef struct iseq_link_anchor {
LINK_ELEMENT *last;
} LINK_ANCHOR;
-typedef enum {
- LABEL_RESCUE_NONE,
- LABEL_RESCUE_BEG,
- LABEL_RESCUE_END,
- LABEL_RESCUE_TYPE_MAX
-} LABEL_RESCUE_TYPE;
-
typedef struct iseq_label_data {
LINK_ELEMENT link;
int label_no;
@@ -61,8 +46,6 @@ typedef struct iseq_label_data {
int sc_state;
int set;
int sp;
- int refcnt;
- unsigned int rescued: 2;
} LABEL;
typedef struct iseq_insn_data {
@@ -112,7 +95,7 @@ struct iseq_compile_data_ensure_node_stack {
#if CPDEBUG >= 0
#define compile_debug CPDEBUG
#else
-#define compile_debug ISEQ_COMPILE_DATA(iseq)->option->debug_level
+#define compile_debug iseq->compile_data->option->debug_level
#endif
#if CPDEBUG
@@ -171,7 +154,6 @@ r_value(VALUE value)
#endif
#if CPDEBUG > 1 || CPDEBUG < 0
-#define printf ruby_debug_printf
#define debugs if (compile_debug_print_indent(1)) ruby_debug_printf
#define debug_compile(msg, v) ((void)(compile_debug_print_indent(1) && fputs((msg), stderr)), (v))
#else
@@ -183,14 +165,17 @@ r_value(VALUE value)
/* create new label */
#define NEW_LABEL(l) new_label_body(iseq, (l))
-#define iseq_path(iseq) ((iseq)->body->location.path)
-#define iseq_absolute_path(iseq) ((iseq)->body->location.absolute_path)
+#define iseq_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.path)
+
+#define iseq_absolute_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.absolute_path)
-#define NEW_ISEQ(node, name, type, line_no) \
- new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))
+#define NEW_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), (name), 0, (type), (line_no))
-#define NEW_CHILD_ISEQ(node, name, type, line_no) \
- new_child_iseq(iseq, (node), rb_fstring(name), iseq, (type), (line_no))
+#define NEW_CHILD_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), (name), iseq->self, (type), (line_no))
/* add instructions */
#define ADD_SEQ(seq1, seq2) \
@@ -200,24 +185,13 @@ r_value(VALUE value)
#define ADD_INSN(seq, line, insn) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
-/* insert an instruction before prev */
-#define INSERT_BEFORE_INSN(prev, line, insn) \
- INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
-
/* add an instruction with some operands (1, 2, 3, 5) */
#define ADD_INSN1(seq, line, insn, op1) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
-/* insert an instruction with some operands (1, 2, 3, 5) before prev */
-#define INSERT_BEFORE_INSN1(prev, line, insn, op1) \
- INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) \
- new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
-
-#define LABEL_REF(label) ((label)->refcnt++)
-
/* add an instruction with label operand (alias of ADD_INSN1) */
-#define ADD_INSNL(seq, line, insn, label) (ADD_INSN1(seq, line, insn, label), LABEL_REF(label))
+#define ADD_INSNL(seq, line, insn, label) ADD_INSN1(seq, line, insn, label)
#define ADD_INSN2(seq, line, insn, op1, op2) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
@@ -229,36 +203,31 @@ r_value(VALUE value)
/* Specific Insn factory */
#define ADD_SEND(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(0), NULL)
-
-#define ADD_SEND_WITH_FLAG(seq, line, id, argc, flag) \
- ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)(flag), NULL)
-
-#define ADD_SEND_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(0), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0))
#define ADD_CALL_RECEIVER(seq, line) \
ADD_INSN((seq), (line), putself)
#define ADD_CALL(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL))
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL))
-#define ADD_SEND_R(seq, line, id, argc, block, flag, keywords) \
- ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (block), (VALUE)(flag), (keywords)))
+#define ADD_SEND_R(seq, line, id, argc, block, flag) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_send(iseq, (line), \
+ (VALUE)(id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag)))
#define ADD_TRACE(seq, line, event) \
do { \
- if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
- (line) > 0 && \
- (line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
- RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
- ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \
+ if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
+ (line) != iseq->compile_data->last_coverable_line) { \
+ RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+ iseq->compile_data->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
- if (ISEQ_COMPILE_DATA(iseq)->option->trace_instruction) { \
+ if (iseq->compile_data->option->trace_instruction) { \
ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
} \
} while (0)
@@ -276,15 +245,11 @@ r_value(VALUE value)
#define ADD_ADJUST_RESTORE(seq, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))
-#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) do { \
- VALUE _e = rb_ary_new3(5, (type), \
- (VALUE)(ls) | 1, (VALUE)(le) | 1, \
- (VALUE)(iseqv), (VALUE)(lc) | 1); \
- if (ls) LABEL_REF(ls); \
- if (le) LABEL_REF(le); \
- if (lc) LABEL_REF(lc); \
- rb_ary_push(ISEQ_COMPILE_DATA(iseq)->catch_table_ary, freeze_hide_obj(_e)); \
-} while (0)
+#define ADD_CATCH_ENTRY(type, ls, le, iseqv, lc) \
+ (rb_ary_push(iseq->compile_data->catch_table_ary, \
+ rb_ary_new3(5, (type), \
+ (VALUE)(ls) | 1, (VALUE)(le) | 1, \
+ (VALUE)(iseqv), (VALUE)(lc) | 1)))
/* compile node */
#define COMPILE(anchor, desc, node) \
@@ -301,11 +266,6 @@ r_value(VALUE value)
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), (poped))))
-#define COMPILE_RECV(anchor, desc, node) \
- (private_recv_p(node) ? \
- (ADD_INSN(anchor, nd_line(node), putself), VM_CALL_FCALL) : \
- (COMPILE(anchor, desc, node->nd_recv), 0))
-
#define OPERAND_AT(insn, idx) \
(((INSN*)(insn))->operands[(idx)])
@@ -313,69 +273,20 @@ r_value(VALUE value)
(((INSN*)(insn))->insn_id)
/* error */
-typedef void (*compile_error_func)(VALUE, int, const char *, ...);
-
-static void
-append_compile_error(VALUE file, int line, const char *fmt, ...)
-{
- VALUE err_info = rb_errinfo();
- VALUE str = rb_attr_get(err_info, idMesg);
- va_list args;
-
- if (RSTRING_LEN(str)) rb_str_cat2(str, "\n");
- if (file) {
- rb_str_concat(str, file);
- if (line) rb_str_catf(str, ":%d", line);
- rb_str_cat2(str, ": ");
- }
- va_start(args, fmt);
- rb_str_vcatf(str, fmt, args);
- va_end(args);
+#define COMPILE_ERROR(strs) \
+{ \
+ VALUE tmp = GET_THREAD()->errinfo; \
+ if (compile_debug) rb_compile_bug strs; \
+ GET_THREAD()->errinfo = iseq->compile_data->err_info; \
+ rb_compile_error strs; \
+ iseq->compile_data->err_info = GET_THREAD()->errinfo; \
+ GET_THREAD()->errinfo = tmp; \
+ ret = 0; \
+ break; \
}
-NOINLINE(static compile_error_func prepare_compile_error(rb_iseq_t *iseq));
+#define ERROR_ARGS ruby_sourcefile, nd_line(node),
-static compile_error_func
-prepare_compile_error(rb_iseq_t *iseq)
-{
- VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info;
- if (compile_debug) return rb_compile_bug_str;
- if (NIL_P(err_info)) {
- err_info = rb_exc_new_cstr(rb_eSyntaxError, "");
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err_info);
- }
- rb_set_errinfo(err_info);
- return append_compile_error;
-}
-
-#define COMPILE_ERROR prepare_compile_error(iseq)
-
-#define ERROR_ARGS_AT(n) ruby_sourcefile_string, nd_line(n),
-#define ERROR_ARGS ERROR_ARGS_AT(node)
-
-#define EXPECT_NODE(prefix, node, ndtype) \
-do { \
- NODE *error_node = (node); \
- enum node_type error_type = nd_type(error_node); \
- if (error_type != (ndtype)) { \
- rb_compile_bug_str(ERROR_ARGS_AT(error_node) \
- prefix ": " #ndtype " is expected, but %s", \
- ruby_node_name(error_type)); \
- } \
-} while (0)
-
-#define EXPECT_NODE_NONULL(prefix, parent, ndtype) \
-do { \
- rb_compile_bug_str(ERROR_ARGS_AT(parent) \
- prefix ": must be " #ndtype ", but 0"); \
-} while (0)
-
-#define UNKNOWN_NODE(prefix, node) \
-do { \
- NODE *error_node = (node); \
- rb_compile_bug_str(ERROR_ARGS_AT(error_node) prefix ": unknown node (%s)", \
- ruby_node_name(nd_type(error_node))); \
-} while (0)
#define COMPILE_OK 1
#define COMPILE_NG 0
@@ -388,13 +299,7 @@ do { \
#define INIT_ANCHOR(name) \
(name##_body__.last = &name##_body__.anchor, name = &name##_body__)
-static inline VALUE
-freeze_hide_obj(VALUE obj)
-{
- OBJ_FREEZE(obj);
- RBASIC_CLEAR_CLASS(obj);
- return obj;
-}
+#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC(obj)->klass = 0;} while (0)
#include "optinsn.inc"
#if OPT_INSTRUCTIONS_UNIFICATION
@@ -411,15 +316,19 @@ freeze_hide_obj(VALUE obj)
#endif
#if CPDEBUG
-#define gl_node_level ISEQ_COMPILE_DATA(iseq)->node_level
+#define gl_node_level iseq->compile_data->node_level
+#if 0
+static void debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor);
+#endif
#endif
static void dump_disasm_list(LINK_ELEMENT *elem);
static int insn_data_length(INSN *iobj);
+static int insn_data_line_no(INSN *iobj);
static int calc_sp_depth(int depth, INSN *iobj);
-static INSN *new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc, ...);
+static INSN *new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...);
static LABEL *new_label_body(rb_iseq_t *iseq, long line);
static ADJUST *new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line);
@@ -428,7 +337,7 @@ static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
-static int iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl);
+static int iseq_set_local_table(rb_iseq_t *iseq, ID *tbl);
static int iseq_set_exception_local_table(rb_iseq_t *iseq);
static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
@@ -500,26 +409,25 @@ APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELE
}
#if CPDEBUG < 0
#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, (anchor), (elem))
-#define APPEND_ELEM(anchor, before, elem) APPEND_ELEM(iseq, (anchor), (before), (elem))
+#define APPEND_ELEM(anchor, before, elem) ADD_ELEM(iseq, (anchor), (before), (elem))
#endif
static int
-iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
- rb_iseq_add_mark_object(iseq, v);
+ rb_ary_push(iseq->mark_ary, v);
}
return COMPILE_OK;
}
-#define ruby_sourcefile_string (iseq->body->location.path)
-#define ruby_sourcefile RSTRING_PTR(iseq->body->location.path)
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
static int
-iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
- rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, v);
+ rb_ary_push(iseq->compile_data->mark_ary, v);
}
return COMPILE_OK;
}
@@ -531,9 +439,10 @@ validate_label(st_data_t name, st_data_t label, st_data_t arg)
LABEL *lobj = (LABEL *)label;
if (!lobj->link.next) {
do {
- COMPILE_ERROR(ruby_sourcefile_string, lobj->position,
- "%"PRIsVALUE": undefined label",
- rb_id2str((ID)name));
+ int ret;
+ COMPILE_ERROR((ruby_sourcefile, lobj->position,
+ "%s: undefined label", rb_id2name((ID)name)));
+ if (ret) break;
} while (0);
}
return ST_CONTINUE;
@@ -543,17 +452,18 @@ static void
validate_labels(rb_iseq_t *iseq, st_table *labels_table)
{
st_foreach(labels_table, validate_label, (st_data_t)iseq);
- st_free_table(labels_table);
- if (!NIL_P(ISEQ_COMPILE_DATA(iseq)->err_info)) {
- rb_exc_raise(ISEQ_COMPILE_DATA(iseq)->err_info);
+ if (!NIL_P(iseq->compile_data->err_info)) {
+ rb_exc_raise(iseq->compile_data->err_info);
}
}
VALUE
-rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
+rb_iseq_compile_node(VALUE self, NODE *node)
{
DECL_ANCHOR(ret);
+ rb_iseq_t *iseq;
INIT_ANCHOR(ret);
+ GetISeqPtr(self, iseq);
if (node == 0) {
COMPILE(ret, "nil", node);
@@ -564,20 +474,17 @@ rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
iseq_set_local_table(iseq, node->nd_tbl);
iseq_set_arguments(iseq, ret, node->nd_args);
- switch (iseq->body->type) {
+ switch (iseq->type) {
case ISEQ_TYPE_BLOCK:
{
- LABEL *start = ISEQ_COMPILE_DATA(iseq)->start_label = NEW_LABEL(0);
- LABEL *end = ISEQ_COMPILE_DATA(iseq)->end_label = NEW_LABEL(0);
+ LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
+ LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
- start->rescued = LABEL_RESCUE_BEG;
- end->rescued = LABEL_RESCUE_END;
-
- ADD_TRACE(ret, FIX2INT(iseq->body->location.first_lineno), RUBY_EVENT_B_CALL);
ADD_LABEL(ret, start);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
COMPILE(ret, "block body", node->nd_body);
- ADD_LABEL(ret, end);
ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
+ ADD_LABEL(ret, end);
/* wide range catch handler must put at last */
ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
@@ -586,14 +493,14 @@ rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
}
case ISEQ_TYPE_CLASS:
{
- ADD_TRACE(ret, FIX2INT(iseq->body->location.first_lineno), RUBY_EVENT_CLASS);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CLASS);
COMPILE(ret, "scoped node", node->nd_body);
ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
break;
}
case ISEQ_TYPE_METHOD:
{
- ADD_TRACE(ret, FIX2INT(iseq->body->location.first_lineno), RUBY_EVENT_CALL);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CALL);
COMPILE(ret, "scoped node", node->nd_body);
ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
break;
@@ -604,22 +511,17 @@ rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
}
}
}
- else if (RB_TYPE_P((VALUE)node, T_IMEMO)) {
- const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
- /* user callback */
- (*ifunc->func)(iseq, ret, ifunc->data);
- }
else {
- switch (iseq->body->type) {
+ switch (iseq->type) {
case ISEQ_TYPE_METHOD:
case ISEQ_TYPE_CLASS:
case ISEQ_TYPE_BLOCK:
case ISEQ_TYPE_EVAL:
case ISEQ_TYPE_MAIN:
case ISEQ_TYPE_TOP:
- COMPILE_ERROR(ERROR_ARGS "compile/should not be reached: %s:%d",
- __FILE__, __LINE__);
- return COMPILE_NG;
+ rb_compile_error(ERROR_ARGS "compile/should not be reached: %s:%d",
+ __FILE__, __LINE__);
+ break;
case ISEQ_TYPE_RESCUE:
iseq_set_exception_local_table(iseq);
COMPILE(ret, "rescue", node);
@@ -629,27 +531,25 @@ rb_iseq_compile_node(rb_iseq_t *iseq, NODE *node)
COMPILE_POPED(ret, "ensure", node);
break;
case ISEQ_TYPE_DEFINED_GUARD:
- iseq_set_exception_local_table(iseq);
+ iseq_set_local_table(iseq, 0);
COMPILE(ret, "defined guard", node);
break;
default:
- rb_compile_bug_str(ERROR_ARGS "unknown scope");
+ rb_bug("unknown scope");
}
}
- if (iseq->body->type == ISEQ_TYPE_RESCUE || iseq->body->type == ISEQ_TYPE_ENSURE) {
+ if (iseq->type == ISEQ_TYPE_RESCUE || iseq->type == ISEQ_TYPE_ENSURE) {
ADD_INSN2(ret, 0, getlocal, INT2FIX(2), INT2FIX(0));
ADD_INSN1(ret, 0, throw, INT2FIX(0) /* continue throw */ );
}
else {
- ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, leave);
+ ADD_INSN(ret, iseq->compile_data->last_line, leave);
}
#if SUPPORT_JOKE
- if (ISEQ_COMPILE_DATA(iseq)->labels_table) {
- st_table *labels_table = ISEQ_COMPILE_DATA(iseq)->labels_table;
- ISEQ_COMPILE_DATA(iseq)->labels_table = 0;
- validate_labels(iseq, labels_table);
+ if (iseq->compile_data->labels_table) {
+ validate_labels(iseq, iseq->compile_data->labels_table);
}
#endif
return iseq_setup(iseq, ret);
@@ -660,150 +560,54 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
{
#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
const void * const *table = rb_vm_get_insns_address_table();
- unsigned int i;
- VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
+ unsigned long i;
+
+ iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
+ MEMCPY(iseq->iseq_encoded, iseq->iseq, VALUE, iseq->iseq_size);
- for (i = 0; i < iseq->body->iseq_size; /* */ ) {
- int insn = (int)iseq->body->iseq_encoded[i];
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ int insn = (int)iseq->iseq_encoded[i];
int len = insn_len(insn);
- encoded[i] = (VALUE)table[insn];
+ iseq->iseq_encoded[i] = (VALUE)table[insn];
i += len;
}
+#else
+ iseq->iseq_encoded = iseq->iseq;
#endif
return COMPILE_OK;
}
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
-static int
-rb_vm_insn_addr2insn(const void *addr) /* cold path */
-{
- int insn;
- const void * const *table = rb_vm_get_insns_address_table();
-
- for (insn = 0; insn < VM_INSTRUCTION_SIZE; insn++) {
- if (table[insn] == addr) {
- return insn;
- }
- }
- rb_bug("rb_vm_insn_addr2insn: invalid insn address: %p", addr);
-}
-#endif
-
-VALUE *
-rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
-{
- VALUE *original_code;
-
- if (ISEQ_ORIGINAL_ISEQ(iseq)) return ISEQ_ORIGINAL_ISEQ(iseq);
- original_code = ISEQ_ORIGINAL_ISEQ_ALLOC(iseq, iseq->body->iseq_size);
- MEMCPY(original_code, iseq->body->iseq_encoded, VALUE, iseq->body->iseq_size);
-
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- {
- unsigned int i;
-
- for (i = 0; i < iseq->body->iseq_size; /* */ ) {
- const void *addr = (const void *)original_code[i];
- const int insn = rb_vm_insn_addr2insn(addr);
-
- original_code[i] = insn;
- i += insn_len(insn);
- }
- }
-#endif
- return original_code;
-}
-
/*********************************************/
/* definition of data structure for compiler */
/*********************************************/
-/*
- * On 32-bit SPARC, GCC by default generates SPARC V7 code that may require
- * 8-byte word alignment. On the other hand, Oracle Solaris Studio seems to
- * generate SPARCV8PLUS code with unaligned memory access instructions.
- * That is why the STRICT_ALIGNMENT is defined only with GCC.
- */
-#if defined(__sparc) && SIZEOF_VOIDP == 4 && defined(__GNUC__)
- #define STRICT_ALIGNMENT
-#endif
-
-#ifdef STRICT_ALIGNMENT
- #if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE
- #define ALIGNMENT_SIZE SIZEOF_LONG_LONG
- #else
- #define ALIGNMENT_SIZE SIZEOF_VALUE
- #endif
- #define PADDING_SIZE_MAX ((size_t)((ALIGNMENT_SIZE) - 1))
- #define ALIGNMENT_SIZE_MASK PADDING_SIZE_MAX
- /* Note: ALIGNMENT_SIZE == (2 ** N) is expected. */
-#else
- #define PADDING_SIZE_MAX 0
-#endif /* STRICT_ALIGNMENT */
-
-#ifdef STRICT_ALIGNMENT
-/* calculate padding size for aligned memory access */
-static size_t
-calc_padding(void *ptr, size_t size)
-{
- size_t mis;
- size_t padding = 0;
-
- mis = (size_t)ptr & ALIGNMENT_SIZE_MASK;
- if (mis > 0) {
- padding = ALIGNMENT_SIZE - mis;
- }
-/*
- * On 32-bit sparc or equivalents, when a single VALUE is requested
- * and padding == sizeof(VALUE), it is clear that no padding is needed.
- */
-#if ALIGNMENT_SIZE > SIZEOF_VALUE
- if (size == sizeof(VALUE) && padding == sizeof(VALUE)) {
- padding = 0;
- }
-#endif
-
- return padding;
-}
-#endif /* STRICT_ALIGNMENT */
-
static void *
compile_data_alloc(rb_iseq_t *iseq, size_t size)
{
void *ptr = 0;
struct iseq_compile_data_storage *storage =
- ISEQ_COMPILE_DATA(iseq)->storage_current;
-#ifdef STRICT_ALIGNMENT
- size_t padding = calc_padding((void *)&storage->buff[storage->pos], size);
-#else
- const size_t padding = 0; /* expected to be optimized by compiler */
-#endif /* STRICT_ALIGNMENT */
+ iseq->compile_data->storage_current;
- if (size >= INT_MAX - padding) rb_memerror();
- if (storage->pos + size + padding > storage->size) {
- unsigned int alloc_size = storage->size;
+ if (storage->pos + size > storage->size) {
+ unsigned long alloc_size = storage->size * 2;
- while (alloc_size < size + PADDING_SIZE_MAX) {
- if (alloc_size >= INT_MAX / 2) rb_memerror();
+ retry:
+ if (alloc_size < size) {
alloc_size *= 2;
+ goto retry;
}
storage->next = (void *)ALLOC_N(char, alloc_size +
- SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
- storage = ISEQ_COMPILE_DATA(iseq)->storage_current = storage->next;
+ sizeof(struct
+ iseq_compile_data_storage));
+ storage = iseq->compile_data->storage_current = storage->next;
storage->next = 0;
storage->pos = 0;
storage->size = alloc_size;
-#ifdef STRICT_ALIGNMENT
- padding = calc_padding((void *)&storage->buff[storage->pos], size);
-#endif /* STRICT_ALIGNMENT */
+ storage->buff = (char *)(&storage->buff + 1);
}
-#ifdef STRICT_ALIGNMENT
- storage->pos += (int)padding;
-#endif /* STRICT_ALIGNMENT */
-
ptr = (void *)&storage->buff[storage->pos];
- storage->pos += (int)size;
+ storage->pos += size;
return ptr;
}
@@ -839,8 +643,9 @@ INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
}
}
+#if 0 /* unused */
/*
- * elem1, elemX => elemX, elem2, elem1
+ * elemX, elem1 => elemX, elem2, elem1
*/
static void
INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
@@ -852,8 +657,8 @@ INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
elem2->prev->next = elem2;
}
}
+#endif
-#if 0
/*
* elemX, elem1, elemY => elemX, elem2, elemY
*/
@@ -869,7 +674,6 @@ REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
elem1->next->prev = elem2;
}
}
-#endif
static void
REMOVE_ELEM(LINK_ELEMENT *elem)
@@ -886,11 +690,13 @@ FIRST_ELEMENT(LINK_ANCHOR *anchor)
return anchor->anchor.next;
}
+#if 0 /* unused */
static LINK_ELEMENT *
LAST_ELEMENT(LINK_ANCHOR *anchor)
{
- return anchor->last;
+ return anchor->last;
}
+#endif
static LINK_ELEMENT *
POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
@@ -905,6 +711,32 @@ POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
#endif
+#if 0 /* unused */
+static LINK_ELEMENT *
+SHIFT_ELEMENT(LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ if (elem) {
+ anchor->anchor.next = elem->next;
+ }
+ return elem;
+}
+#endif
+
+#if 0 /* unused */
+static int
+LIST_SIZE(LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ int size = 0;
+ while (elem) {
+ size += 1;
+ elem = elem->next;
+ }
+ return size;
+}
+#endif
+
static int
LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
{
@@ -966,6 +798,65 @@ INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
#define INSERT_LIST(anc1, anc2) INSERT_LIST(iseq, (anc1), (anc2))
#endif
+#if 0 /* unused */
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e4, e5
+ * anc2: e1, e2, e3
+ */
+static void
+SWAP_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ LINK_ANCHOR tmp = *anc2;
+
+ /* it has bug */
+ *anc2 = *anc1;
+ *anc1 = tmp;
+
+ verify_list("swap1", anc1);
+ verify_list("swap2", anc2);
+}
+#if CPDEBUG < 0
+#define SWAP_LIST(anc1, anc2) SWAP_LIST(iseq, (anc1), (anc2))
+#endif
+
+static LINK_ANCHOR *
+REVERSE_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc)
+{
+ LINK_ELEMENT *first, *last, *elem, *e;
+ first = &anc->anchor;
+ elem = first->next;
+ last = anc->last;
+
+ if (elem != 0) {
+ anc->anchor.next = last;
+ anc->last = elem;
+ }
+ else {
+ /* null list */
+ return anc;
+ }
+ while (elem) {
+ e = elem->next;
+ elem->next = elem->prev;
+ elem->prev = e;
+ elem = e;
+ }
+
+ first->next = last;
+ last->prev = first;
+ anc->last->next = 0;
+
+ verify_list("reverse", anc);
+ return anc;
+}
+#if CPDEBUG < 0
+#define REVERSE_LIST(anc) REVERSE_LIST(iseq, (anc))
+#endif
+#endif
+
#if CPDEBUG && 0
static void
debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
@@ -997,12 +888,9 @@ new_label_body(rb_iseq_t *iseq, long line)
labelobj->link.type = ISEQ_ELEMENT_LABEL;
labelobj->link.next = 0;
- labelobj->label_no = ISEQ_COMPILE_DATA(iseq)->label_no++;
+ labelobj->label_no = iseq->compile_data->label_no++;
labelobj->sc_state = 0;
labelobj->sp = -1;
- labelobj->refcnt = 0;
- labelobj->set = 0;
- labelobj->rescued = LABEL_RESCUE_NONE;
return labelobj;
}
@@ -1035,7 +923,7 @@ new_insn_core(rb_iseq_t *iseq, int line_no,
}
static INSN *
-new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc, ...)
+new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
{
VALUE *operands = 0;
va_list argv;
@@ -1052,57 +940,55 @@ new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int a
return new_insn_core(iseq, line_no, insn_id, argc, operands);
}
-static struct rb_call_info *
-new_callinfo(rb_iseq_t *iseq, ID mid, int argc, unsigned int flag, struct rb_call_info_kw_arg *kw_arg, int has_blockiseq)
+static rb_call_info_t *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned long flag)
{
- size_t size = kw_arg != NULL ? sizeof(struct rb_call_info_with_kwarg) : sizeof(struct rb_call_info);
- struct rb_call_info *ci = (struct rb_call_info *)compile_data_alloc(iseq, size);
- struct rb_call_info_with_kwarg *ci_kw = (struct rb_call_info_with_kwarg *)ci;
-
+ rb_call_info_t *ci = (rb_call_info_t *)compile_data_alloc(iseq, sizeof(rb_call_info_t));
ci->mid = mid;
ci->flag = flag;
ci->orig_argc = argc;
+ ci->argc = argc;
- if (kw_arg) {
- ci->flag |= VM_CALL_KWARG;
- ci_kw->kw_arg = kw_arg;
- ci->orig_argc += kw_arg->keyword_len;
- iseq->body->ci_kw_size++;
+ if (block) {
+ GetISeqPtr(block, ci->blockiseq);
}
else {
- iseq->body->ci_size++;
+ ci->blockiseq = 0;
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG))) {
+ ci->flag |= VM_CALL_ARGS_SKIP_SETUP;
+ }
}
+ ci->vmstat = 0;
+ ci->blockptr = 0;
+ ci->recv = Qundef;
+ ci->call = 0; /* TODO: should set default function? */
+
+ ci->aux.index = iseq->callinfo_size++;
- if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG)) &&
- kw_arg == NULL && !has_blockiseq) {
- ci->flag |= VM_CALL_ARGS_SIMPLE;
- }
return ci;
}
static INSN *
-new_insn_send(rb_iseq_t *iseq, int line_no, ID id, VALUE argc, const rb_iseq_t *blockiseq, VALUE flag, struct rb_call_info_kw_arg *keywords)
+new_insn_send(rb_iseq_t *iseq, int line_no, VALUE id, VALUE argc, VALUE block, VALUE flag)
{
- VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 3);
- operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), FIX2INT(flag), keywords, blockiseq != NULL);
- operands[1] = Qfalse; /* cache */
- operands[2] = (VALUE)blockiseq;
- return new_insn_core(iseq, line_no, BIN(send), 3, operands);
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, SYM2ID(id), FIX2INT(argc), block, FIX2INT(flag));
+ return new_insn_core(iseq, line_no, BIN(send), 1, operands);
}
-static rb_iseq_t *
+static VALUE
new_child_iseq(rb_iseq_t *iseq, NODE *node,
- VALUE name, const rb_iseq_t *parent, enum iseq_type type, int line_no)
+ VALUE name, VALUE parent, enum iseq_type type, int line_no)
{
- rb_iseq_t *ret_iseq;
+ VALUE ret;
debugs("[new_child_iseq]> ---------------------------------------\n");
- ret_iseq = rb_iseq_new_with_opt(node, name,
- iseq_path(iseq), iseq_absolute_path(iseq),
- INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
+ ret = rb_iseq_new_with_opt(node, name,
+ iseq_path(iseq->self), iseq_absolute_path(iseq->self),
+ INT2FIX(line_no), parent, type, iseq->compile_data->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
- iseq_add_mark_object(iseq, (VALUE)ret_iseq);
- return ret_iseq;
+ iseq_add_mark_object(iseq, ret);
+ return ret;
}
static int
@@ -1119,14 +1005,14 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
- if (ISEQ_COMPILE_DATA(iseq)->option->instructions_unification) {
+ if (iseq->compile_data->option->instructions_unification) {
debugs("[compile step 3.2 (iseq_insns_unification)]\n");
iseq_insns_unification(iseq, anchor);
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
}
- if (ISEQ_COMPILE_DATA(iseq)->option->stack_caching) {
+ if (iseq->compile_data->option->stack_caching) {
debugs("[compile step 3.3 (iseq_set_sequence_stackcaching)]\n");
iseq_set_sequence_stackcaching(iseq, anchor);
if (compile_debug > 5)
@@ -1134,73 +1020,70 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
}
debugs("[compile step 4.1 (iseq_set_sequence)]\n");
- if (!iseq_set_sequence(iseq, anchor)) return COMPILE_NG;
+ iseq_set_sequence(iseq, anchor);
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
debugs("[compile step 4.2 (iseq_set_exception_table)]\n");
- if (!iseq_set_exception_table(iseq)) return COMPILE_NG;
+ iseq_set_exception_table(iseq);
debugs("[compile step 4.3 (set_optargs_table)] \n");
- if (!iseq_set_optargs_table(iseq)) return COMPILE_NG;
+ iseq_set_optargs_table(iseq);
debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
- if (!rb_iseq_translate_threaded_code(iseq)) return COMPILE_NG;
+ rb_iseq_translate_threaded_code(iseq);
if (compile_debug > 1) {
- VALUE str = rb_iseq_disasm(iseq);
+ VALUE str = rb_iseq_disasm(iseq->self);
printf("%s\n", StringValueCStr(str));
+ fflush(stdout);
}
debugs("[compile step: finish]\n");
- return COMPILE_OK;
+ return 0;
}
static int
iseq_set_exception_local_table(rb_iseq_t *iseq)
{
- /* TODO: every id table is same -> share it.
- * Current problem is iseq_free().
- */
ID id_dollar_bang;
- ID *ids = (ID *)ALLOC_N(ID, 1);
CONST_ID(id_dollar_bang, "#$!");
- iseq->body->local_table_size = 1;
- iseq->body->local_size = iseq->body->local_table_size + 1;
- ids[0] = id_dollar_bang;
- iseq->body->local_table = ids;
+ iseq->local_table = (ID *)ALLOC_N(ID, 1);
+ iseq->local_table_size = 1;
+ iseq->local_size = iseq->local_table_size + 1;
+ iseq->local_table[0] = id_dollar_bang;
return COMPILE_OK;
}
static int
-get_lvar_level(const rb_iseq_t *iseq)
+get_lvar_level(rb_iseq_t *iseq)
{
int lev = 0;
- while (iseq != iseq->body->local_iseq) {
+ while (iseq != iseq->local_iseq) {
lev++;
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
}
return lev;
}
static int
-get_dyna_var_idx_at_raw(const rb_iseq_t *iseq, ID id)
+get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
{
- unsigned int i;
+ int i;
- for (i = 0; i < iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
- return (int)i;
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return i;
}
}
return -1;
}
static int
-get_local_var_idx(const rb_iseq_t *iseq, ID id)
+get_local_var_idx(rb_iseq_t *iseq, ID id)
{
- int idx = get_dyna_var_idx_at_raw(iseq->body->local_iseq, id);
+ int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
if (idx < 0) {
rb_bug("get_local_var_idx: %d", idx);
@@ -1210,7 +1093,7 @@ get_local_var_idx(const rb_iseq_t *iseq, ID id)
}
static int
-get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
+get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
{
int lv = 0, idx = -1;
@@ -1219,7 +1102,7 @@ get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
if (idx >= 0) {
break;
}
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
lv++;
}
@@ -1228,117 +1111,10 @@ get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
}
*level = lv;
- *ls = iseq->body->local_size;
+ *ls = iseq->local_size;
return idx;
}
-static void
-iseq_calc_param_size(rb_iseq_t *iseq)
-{
- if (iseq->body->param.flags.has_opt ||
- iseq->body->param.flags.has_post ||
- iseq->body->param.flags.has_rest ||
- iseq->body->param.flags.has_block ||
- iseq->body->param.flags.has_kw ||
- iseq->body->param.flags.has_kwrest) {
-
- if (iseq->body->param.flags.has_block) {
- iseq->body->param.size = iseq->body->param.block_start + 1;
- }
- else if (iseq->body->param.flags.has_kwrest) {
- iseq->body->param.size = iseq->body->param.keyword->rest_start + 1;
- }
- else if (iseq->body->param.flags.has_kw) {
- iseq->body->param.size = iseq->body->param.keyword->bits_start + 1;
- }
- else if (iseq->body->param.flags.has_post) {
- iseq->body->param.size = iseq->body->param.post_start + iseq->body->param.post_num;
- }
- else if (iseq->body->param.flags.has_rest) {
- iseq->body->param.size = iseq->body->param.rest_start + 1;
- }
- else if (iseq->body->param.flags.has_opt) {
- iseq->body->param.size = iseq->body->param.lead_num + iseq->body->param.opt_num;
- }
- else {
- rb_bug("unreachable");
- }
- }
- else {
- iseq->body->param.size = iseq->body->param.lead_num;
- }
-}
-
-static void
-iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *optargs, const struct rb_args_info *args)
-{
- NODE *node = args->kw_args;
- struct rb_iseq_param_keyword *keyword;
- const VALUE default_values = rb_ary_tmp_new(1);
- const VALUE complex_mark = rb_str_tmp_new(0);
- int kw = 0, rkw = 0, di = 0, i;
-
- iseq->body->param.flags.has_kw = TRUE;
- iseq->body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
- keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
-
- while (node) {
- NODE *val_node = node->nd_body->nd_value;
- VALUE dv;
-
- if (val_node == (NODE *)-1) {
- ++rkw;
- }
- else {
- switch (nd_type(val_node)) {
- case NODE_LIT:
- dv = val_node->nd_lit;
- iseq_add_mark_object(iseq, dv);
- break;
- case NODE_NIL:
- dv = Qnil;
- break;
- case NODE_TRUE:
- dv = Qtrue;
- break;
- case NODE_FALSE:
- dv = Qfalse;
- break;
- default:
- COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
- dv = complex_mark;
- }
-
- keyword->num = ++di;
- rb_ary_push(default_values, dv);
- }
-
- kw++;
- node = node->nd_next;
- }
-
- keyword->num = kw;
-
- if (args->kw_rest_arg->nd_cflag != 0) {
- keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
- iseq->body->param.flags.has_kwrest = TRUE;
- }
- keyword->required_num = rkw;
- keyword->table = &iseq->body->local_table[keyword->bits_start - keyword->num];
-
- {
- VALUE *dvs = ALLOC_N(VALUE, RARRAY_LEN(default_values));
-
- for (i = 0; i < RARRAY_LEN(default_values); i++) {
- VALUE dv = RARRAY_AREF(default_values, i);
- if (dv == complex_mark) dv = Qundef;
- dvs[i] = dv;
- }
-
- keyword->default_values = dvs;
- }
-}
-
static int
iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
{
@@ -1350,11 +1126,14 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
int last_comma = 0;
ID block_id = 0;
- EXPECT_NODE("iseq_set_arguments", node_args, NODE_ARGS);
+ if (nd_type(node_args) != NODE_ARGS) {
+ rb_bug("iseq_set_arguments: NODE_ARGS is expected, but %s",
+ ruby_node_name(nd_type(node_args)));
+ }
- iseq->body->param.lead_num = (int)args->pre_args_num;
- if (iseq->body->param.lead_num > 0) iseq->body->param.flags.has_lead = TRUE;
- debugs(" - argc: %d\n", iseq->body->param.lead_num);
+
+ iseq->argc = (int)args->pre_args_num;
+ debugs(" - argc: %d\n", iseq->argc);
rest_id = args->rest_arg;
if (rest_id == 1) {
@@ -1364,16 +1143,14 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
block_id = args->block_arg;
if (args->first_post_arg) {
- iseq->body->param.post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
- iseq->body->param.post_num = args->post_args_num;
- iseq->body->param.flags.has_post = TRUE;
+ iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->arg_post_len = args->post_args_num;
}
if (args->opt_args) {
NODE *node = args->opt_args;
LABEL *label;
VALUE labels = rb_ary_tmp_new(1);
- VALUE *opt_table;
int i = 0, j;
while (node) {
@@ -1389,28 +1166,49 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
label = NEW_LABEL(nd_line(node_args));
rb_ary_push(labels, (VALUE)label | 1);
ADD_LABEL(optargs, label);
+ i += 1;
- opt_table = ALLOC_N(VALUE, i+1);
-
- MEMCPY(opt_table, RARRAY_CONST_PTR(labels), VALUE, i+1);
- for (j = 0; j < i+1; j++) {
- opt_table[j] &= ~1;
+ iseq->arg_opts = i;
+ iseq->arg_opt_table = ALLOC_N(VALUE, i);
+ MEMCPY(iseq->arg_opt_table, RARRAY_PTR(labels), VALUE, i);
+ for (j = 0; j < i; j++) {
+ iseq->arg_opt_table[j] &= ~1;
}
rb_ary_clear(labels);
-
- iseq->body->param.flags.has_opt = TRUE;
- iseq->body->param.opt_num = i;
- iseq->body->param.opt_table = opt_table;
+ }
+ else {
+ iseq->arg_opts = 0;
}
if (args->kw_args) {
- iseq_set_arguments_keywords(iseq, optargs, args);
+ NODE *node = args->kw_args;
+ VALUE keywords = rb_ary_tmp_new(1);
+ int i = 0, j;
+
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ while (node) {
+ rb_ary_push(keywords, INT2FIX(node->nd_body->nd_vid));
+ COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
+ node = node->nd_next;
+ i += 1;
+ }
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ iseq->arg_keywords = i;
+ iseq->arg_keyword_table = ALLOC_N(ID, i);
+ for (j = 0; j < i; j++) {
+ iseq->arg_keyword_table[j] = FIX2INT(RARRAY_PTR(keywords)[j]);
+ }
+ ADD_INSN(optargs, nd_line(args->kw_args), pop);
}
else if (args->kw_rest_arg) {
- struct rb_iseq_param_keyword *keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
- keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
- iseq->body->param.keyword = keyword;
- iseq->body->param.flags.has_kwrest = TRUE;
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ ADD_INSN(optargs, nd_line(args->kw_rest_arg), pop);
+ }
+ else {
+ iseq->arg_keyword = -1;
}
if (args->pre_init) { /* m_init */
@@ -1421,42 +1219,69 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
}
if (rest_id) {
- iseq->body->param.rest_start = get_dyna_var_idx_at_raw(iseq, rest_id);
- iseq->body->param.flags.has_rest = TRUE;
- assert(iseq->body->param.rest_start != -1);
+ iseq->arg_rest = get_dyna_var_idx_at_raw(iseq, rest_id);
+
+ if (iseq->arg_rest == -1) {
+ rb_bug("arg_rest: -1");
+ }
- if (iseq->body->param.post_start == 0) { /* TODO: why that? */
- iseq->body->param.post_start = iseq->body->param.rest_start + 1;
+ if (iseq->arg_post_start == 0) {
+ iseq->arg_post_start = iseq->arg_rest + 1;
}
}
if (block_id) {
- iseq->body->param.block_start = get_dyna_var_idx_at_raw(iseq, block_id);
- iseq->body->param.flags.has_block = TRUE;
+ iseq->arg_block = get_dyna_var_idx_at_raw(iseq, block_id);
}
- iseq_calc_param_size(iseq);
+ if (iseq->arg_opts != 0 || iseq->arg_post_len != 0 ||
+ iseq->arg_rest != -1 || iseq->arg_block != -1 ||
+ iseq->arg_keyword != -1) {
+ iseq->arg_simple = 0;
- if (iseq->body->type == ISEQ_TYPE_BLOCK) {
- if (iseq->body->param.flags.has_opt == FALSE &&
- iseq->body->param.flags.has_post == FALSE &&
- iseq->body->param.flags.has_rest == FALSE &&
- iseq->body->param.flags.has_kw == FALSE &&
- iseq->body->param.flags.has_kwrest == FALSE) {
+ /* set arg_size: size of arguments */
+ if (iseq->arg_keyword != -1) {
+ iseq->arg_size = iseq->arg_keyword + 1;
+ }
+ else if (iseq->arg_block != -1) {
+ iseq->arg_size = iseq->arg_block + 1;
+ }
+ else if (iseq->arg_post_len) {
+ iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
+ }
+ else if (iseq->arg_rest != -1) {
+ iseq->arg_size = iseq->arg_rest + 1;
+ }
+ else if (iseq->arg_opts) {
+ iseq->arg_size = iseq->argc + iseq->arg_opts - 1;
+ }
+ else {
+ iseq->arg_size = iseq->argc;
+ }
+ }
+ else {
+ iseq->arg_simple = 1;
+ iseq->arg_size = iseq->argc;
+ }
- if (iseq->body->param.lead_num == 1 && last_comma == 0) {
+ if (iseq->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->arg_opts == 0 && iseq->arg_post_len == 0 && iseq->arg_rest == -1) {
+ if (iseq->argc == 1 && last_comma == 0) {
/* {|a|} */
- iseq->body->param.flags.ambiguous_param0 = TRUE;
+ iseq->arg_simple |= 0x02;
}
}
}
}
+ else {
+ iseq->arg_simple = 1;
+ }
return COMPILE_OK;
}
static int
-iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
+iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
{
int size;
@@ -1469,13 +1294,12 @@ iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
}
if (size > 0) {
- ID *ids = (ID *)ALLOC_N(ID, size);
- MEMCPY(ids, tbl, ID, size);
- iseq->body->local_table = ids;
+ iseq->local_table = (ID *)ALLOC_N(ID, size);
+ MEMCPY(iseq->local_table, tbl, ID, size);
}
- iseq->body->local_size = iseq->body->local_table_size = size;
- iseq->body->local_size += 1;
+ iseq->local_size = iseq->local_table_size = size;
+ iseq->local_size += 1;
/*
if (lfp == dfp ) { // top, class, method
dfp[-1]: svar
@@ -1484,7 +1308,7 @@ iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
}
*/
- debugs("iseq_set_local_table: %d, %d\n", iseq->body->local_size, iseq->body->local_table_size);
+ debugs("iseq_set_local_table: %d, %d\n", iseq->local_size, iseq->local_table_size);
return COMPILE_OK;
}
@@ -1541,30 +1365,32 @@ cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
static int
iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
+ LABEL *lobj;
+ INSN *iobj;
struct iseq_line_info_entry *line_info_table;
unsigned int last_line = 0;
LINK_ELEMENT *list;
VALUE *generated_iseq;
- int insn_num, code_index, line_info_index, sp, stack_max = 0, line = 0;
+ int k, pos, sp, stack_max = 0, line = 0;
- /* fix label position */
+ /* set label position */
list = FIRST_ELEMENT(anchor);
- insn_num = code_index = 0;
+ k = pos = 0;
while (list) {
switch (list->type) {
case ISEQ_ELEMENT_INSN:
{
- INSN *iobj = (INSN *)list;
+ iobj = (INSN *)list;
line = iobj->line_no;
- code_index += insn_data_length(iobj);
- insn_num++;
+ pos += insn_data_length(iobj);
+ k++;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- LABEL *lobj = (LABEL *)list;
- lobj->position = code_index;
+ lobj = (LABEL *)list;
+ lobj->position = pos;
lobj->set = TRUE;
break;
}
@@ -1577,32 +1403,31 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
ADJUST *adjust = (ADJUST *)list;
if (adjust->line_no != -1) {
- code_index += 2 /* insn + 1 operand */;
- insn_num++;
+ pos += 2 /* insn + 1 operand */;
+ k++;
}
break;
}
default:
dump_disasm_list(FIRST_ELEMENT(anchor));
dump_disasm_list(list);
- COMPILE_ERROR(ruby_sourcefile_string, line, "error: set_sequence");
- return COMPILE_NG;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line,
+ "error: set_sequence");
+ break;
}
list = list->next;
}
/* make instruction sequence */
- generated_iseq = ALLOC_N(VALUE, code_index);
- line_info_table = ALLOC_N(struct iseq_line_info_entry, insn_num);
- iseq->body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, iseq->body->is_size);
- iseq->body->ci_entries = (struct rb_call_info *)ruby_xmalloc(sizeof(struct rb_call_info) * iseq->body->ci_size +
- sizeof(struct rb_call_info_with_kwarg) * iseq->body->ci_kw_size);
- iseq->body->cc_entries = ZALLOC_N(struct rb_call_cache, iseq->body->ci_size + iseq->body->ci_kw_size);
-
- ISEQ_COMPILE_DATA(iseq)->ci_index = ISEQ_COMPILE_DATA(iseq)->ci_kw_index = 0;
+ generated_iseq = ALLOC_N(VALUE, pos);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
+ iseq->ic_entries = ALLOC_N(struct iseq_inline_cache_entry, iseq->ic_size);
+ MEMZERO(iseq->ic_entries, struct iseq_inline_cache_entry, iseq->ic_size);
+ iseq->callinfo_entries = ALLOC_N(rb_call_info_t, iseq->callinfo_size);
+ /* MEMZERO(iseq->callinfo_entries, rb_call_info_t, iseq->callinfo_size); */
list = FIRST_ELEMENT(anchor);
- line_info_index = code_index = sp = 0;
+ k = pos = sp = 0;
while (list) {
switch (list->type) {
@@ -1611,7 +1436,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
int j, len, insn;
const char *types;
VALUE *operands;
- INSN *iobj = (INSN *)list;
+
+ iobj = (INSN *)list;
/* update sp */
sp = calc_sp_depth(sp, iobj);
@@ -1622,7 +1448,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
/* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
operands = iobj->operands;
insn = iobj->insn_id;
- generated_iseq[code_index] = insn;
+ generated_iseq[pos] = insn;
types = insn_op_types(insn);
len = insn_len(insn);
@@ -1630,12 +1456,12 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (iobj->operand_size != len - 1) {
/* printf("operand size miss! (%d, %d)\n", iobj->operand_size, len); */
dump_disasm_list(list);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "operand size miss! (%d for %d)",
+ iobj->operand_size, len - 1);
xfree(generated_iseq);
xfree(line_info_table);
- COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
- "operand size miss! (%d for %d)",
- iobj->operand_size, len - 1);
- return COMPILE_NG;
+ return 0;
}
for (j = 0; types[j]; j++) {
@@ -1645,16 +1471,15 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case TS_OFFSET:
{
/* label(destination position) */
- LABEL *lobj = (LABEL *)operands[j];
+ lobj = (LABEL *)operands[j];
if (!lobj->set) {
- COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
- "unknown label");
- return COMPILE_NG;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown label");
}
if (lobj->sp == -1) {
lobj->sp = sp;
}
- generated_iseq[code_index + 1 + j] = lobj->position - (code_index + len);
+ generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
break;
}
case TS_CDHASH:
@@ -1662,102 +1487,87 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
VALUE map = operands[j];
struct cdhash_set_label_struct data;
data.hash = map;
- data.pos = code_index;
+ data.pos = pos;
data.len = len;
rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
- rb_hash_rehash(map);
- freeze_hide_obj(map);
- generated_iseq[code_index + 1 + j] = map;
+ hide_obj(map);
+ generated_iseq[pos + 1 + j] = map;
break;
}
case TS_LINDEX:
case TS_NUM: /* ulong */
- generated_iseq[code_index + 1 + j] = FIX2INT(operands[j]);
+ generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
break;
case TS_ISEQ: /* iseq */
{
VALUE v = operands[j];
- generated_iseq[code_index + 1 + j] = v;
+ rb_iseq_t *block = 0;
+ if (v) {
+ GetISeqPtr(v, block);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)block;
break;
}
case TS_VALUE: /* VALUE */
{
VALUE v = operands[j];
- generated_iseq[code_index + 1 + j] = v;
+ generated_iseq[pos + 1 + j] = v;
/* to mark ruby object */
iseq_add_mark_object(iseq, v);
break;
}
case TS_IC: /* inline cache */
{
- unsigned int ic_index = FIX2UINT(operands[j]);
- IC ic = (IC)&iseq->body->is_entries[ic_index];
- if (UNLIKELY(ic_index >= iseq->body->is_size)) {
- rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->body->is_size);
+ int ic_index = FIX2INT(operands[j]);
+ IC ic = &iseq->ic_entries[ic_index];
+ if (UNLIKELY(ic_index >= iseq->ic_size)) {
+ rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->ic_size);
}
- generated_iseq[code_index + 1 + j] = (VALUE)ic;
+ generated_iseq[pos + 1 + j] = (VALUE)ic;
break;
}
case TS_CALLINFO: /* call info */
{
- struct rb_call_info *base_ci = (struct rb_call_info *)operands[j];
- struct rb_call_info *ci;
-
- if (base_ci->flag & VM_CALL_KWARG) {
- struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&iseq->body->ci_entries[iseq->body->ci_size];
- struct rb_call_info_with_kwarg *ci_kw = &ci_kw_entries[ISEQ_COMPILE_DATA(iseq)->ci_kw_index++];
- *ci_kw = *((struct rb_call_info_with_kwarg *)base_ci);
- ci = (struct rb_call_info *)ci_kw;
- assert(ISEQ_COMPILE_DATA(iseq)->ci_kw_index <= iseq->body->ci_kw_size);
- }
- else {
- ci = &iseq->body->ci_entries[ISEQ_COMPILE_DATA(iseq)->ci_index++];
- *ci = *base_ci;
- assert(ISEQ_COMPILE_DATA(iseq)->ci_index <= iseq->body->ci_size);
- }
+ rb_call_info_t *base_ci = (rb_call_info_t *)operands[j];
+ rb_call_info_t *ci = &iseq->callinfo_entries[base_ci->aux.index];
+ *ci = *base_ci;
- generated_iseq[code_index + 1 + j] = (VALUE)ci;
- break;
- }
- case TS_CALLCACHE:
- {
- struct rb_call_cache *cc = &iseq->body->cc_entries[ISEQ_COMPILE_DATA(iseq)->ci_index + ISEQ_COMPILE_DATA(iseq)->ci_kw_index - 1];
- generated_iseq[code_index + 1 + j] = (VALUE)cc;
+ if (UNLIKELY(base_ci->aux.index >= iseq->callinfo_size)) {
+ rb_bug("iseq_set_sequence: ci_index overflow: index: %d, size: %d", base_ci->argc, iseq->callinfo_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ci;
break;
}
case TS_ID: /* ID */
- generated_iseq[code_index + 1 + j] = SYM2ID(operands[j]);
+ generated_iseq[pos + 1 + j] = SYM2ID(operands[j]);
break;
case TS_GENTRY:
{
struct rb_global_entry *entry =
(struct rb_global_entry *)(operands[j] & (~1));
- generated_iseq[code_index + 1 + j] = (VALUE)entry;
+ generated_iseq[pos + 1 + j] = (VALUE)entry;
}
break;
- case TS_FUNCPTR:
- generated_iseq[code_index + 1 + j] = operands[j];
- break;
default:
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown operand type: %c", type);
xfree(generated_iseq);
xfree(line_info_table);
- COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
- "unknown operand type: %c", type);
- return COMPILE_NG;
+ return 0;
}
}
if (last_line != iobj->line_no) {
- line_info_table[line_info_index].line_no = last_line = iobj->line_no;
- line_info_table[line_info_index].position = code_index;
- line_info_index++;
+ line_info_table[k].line_no = last_line = iobj->line_no;
+ line_info_table[k].position = pos;
+ k++;
}
- code_index += len;
+ pos += len;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- LABEL *lobj = (LABEL *)list;
+ lobj = (LABEL *)list;
if (lobj->sp == -1) {
lobj->sp = sp;
}
@@ -1781,26 +1591,25 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (adjust->line_no != -1) {
if (orig_sp - sp > 0) {
if (last_line != (unsigned int)adjust->line_no) {
- line_info_table[line_info_index].line_no = last_line = adjust->line_no;
- line_info_table[line_info_index].position = code_index;
- line_info_index++;
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
}
- generated_iseq[code_index++] = BIN(adjuststack);
- generated_iseq[code_index++] = orig_sp - sp;
+ generated_iseq[pos++] = BIN(adjuststack);
+ generated_iseq[pos++] = orig_sp - sp;
}
else if (orig_sp - sp == 0) {
/* jump to next insn */
if (last_line != (unsigned int)adjust->line_no) {
- line_info_table[line_info_index].line_no = last_line = adjust->line_no;
- line_info_table[line_info_index].position = code_index;
- line_info_index++;
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
}
- generated_iseq[code_index++] = BIN(nop);
- generated_iseq[code_index++] = BIN(nop);
+ generated_iseq[pos++] = BIN(jump);
+ generated_iseq[pos++] = 0;
}
else {
- rb_compile_bug_str(ruby_sourcefile_string, adjust->line_no,
- "iseq_set_sequence: adjust bug %d < %d", orig_sp, sp);
+ rb_bug("iseq_set_sequence: adjust bug");
}
}
break;
@@ -1812,13 +1621,20 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
list = list->next;
}
- iseq->body->iseq_encoded = (void *)generated_iseq;
- iseq->body->iseq_size = code_index;
- iseq->body->stack_max = stack_max;
+#if 0 /* XXX */
+ /* this check need dead code elimination */
+ if (sp != 1) {
+ rb_bug("SP is not 0 on %s (%d)\n", RSTRING_PTR(iseq->name), sp);
+ }
+#endif
+
+ iseq->iseq = (void *)generated_iseq;
+ iseq->iseq_size = pos;
+ iseq->stack_max = stack_max;
- REALLOC_N(line_info_table, struct iseq_line_info_entry, line_info_index);
- iseq->body->line_info_table = line_info_table;
- iseq->body->line_info_size = line_info_index;
+ line_info_table = ruby_xrealloc(line_info_table, k * sizeof(struct iseq_line_info_entry));
+ iseq->line_info_table = line_info_table;
+ iseq->line_info_size = k;
return COMPILE_OK;
}
@@ -1838,54 +1654,48 @@ label_get_sp(LABEL *lobj)
static int
iseq_set_exception_table(rb_iseq_t *iseq)
{
- const VALUE *tptr, *ptr;
- unsigned int tlen, i;
+ VALUE *tptr, *ptr;
+ int tlen, i;
struct iseq_catch_table_entry *entry;
- tlen = (int)RARRAY_LEN(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
- tptr = RARRAY_CONST_PTR(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
+ tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
+ tptr = RARRAY_PTR(iseq->compile_data->catch_table_ary);
- if (tlen > 0) {
- struct iseq_catch_table *table = xmalloc(iseq_catch_table_bytes(tlen));
- table->size = tlen;
+ iseq->catch_table = tlen ? ALLOC_N(struct iseq_catch_table_entry, tlen) : 0;
+ iseq->catch_table_size = tlen;
- for (i = 0; i < table->size; i++) {
- ptr = RARRAY_CONST_PTR(tptr[i]);
- entry = &table->entries[i];
- entry->type = (enum catch_type)(ptr[0] & 0xffff);
- entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
- entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
- entry->iseq = (rb_iseq_t *)ptr[3];
+ for (i = 0; i < tlen; i++) {
+ ptr = RARRAY_PTR(tptr[i]);
+ entry = &iseq->catch_table[i];
+ entry->type = (enum catch_type)(ptr[0] & 0xffff);
+ entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
+ entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
+ entry->iseq = ptr[3];
- /* register iseq as mark object */
- if (entry->iseq != 0) {
- iseq_add_mark_object(iseq, (VALUE)entry->iseq);
- }
+ /* register iseq as mark object */
+ if (entry->iseq != 0) {
+ iseq_add_mark_object(iseq, entry->iseq);
+ }
- /* stack depth */
- if (ptr[4]) {
- LABEL *lobj = (LABEL *)(ptr[4] & ~1);
- entry->cont = label_get_position(lobj);
- entry->sp = label_get_sp(lobj);
-
- /* TODO: Dirty Hack! Fix me */
- if (entry->type == CATCH_TYPE_RESCUE ||
- entry->type == CATCH_TYPE_BREAK ||
- entry->type == CATCH_TYPE_NEXT) {
- entry->sp--;
- }
- }
- else {
- entry->cont = 0;
+ /* stack depth */
+ if (ptr[4]) {
+ LABEL *lobj = (LABEL *)(ptr[4] & ~1);
+ entry->cont = label_get_position(lobj);
+ entry->sp = label_get_sp(lobj);
+
+ /* TODO: Dirty Hack! Fix me */
+ if (entry->type == CATCH_TYPE_RESCUE ||
+ entry->type == CATCH_TYPE_BREAK ||
+ entry->type == CATCH_TYPE_NEXT) {
+ entry->sp--;
}
}
- iseq->body->catch_table = table;
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, 0); /* free */
- }
- else {
- iseq->body->catch_table = NULL;
+ else {
+ entry->cont = 0;
+ }
}
+ iseq->compile_data->catch_table_ary = 0; /* free */
return COMPILE_OK;
}
@@ -1902,11 +1712,11 @@ static int
iseq_set_optargs_table(rb_iseq_t *iseq)
{
int i;
- VALUE *opt_table = (VALUE *)iseq->body->param.opt_table;
- if (iseq->body->param.flags.has_opt) {
- for (i = 0; i < iseq->body->param.opt_num + 1; i++) {
- opt_table[i] = label_get_position((LABEL *)opt_table[i]);
+ if (iseq->arg_opts != 0) {
+ for (i = 0; i < iseq->arg_opts; i++) {
+ iseq->arg_opt_table[i] =
+ label_get_position((LABEL *)iseq->arg_opt_table[i]);
}
}
return COMPILE_OK;
@@ -1956,50 +1766,6 @@ get_prev_insn(INSN *iobj)
return 0;
}
-static void
-unref_destination(INSN *iobj)
-{
- LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
- --lobj->refcnt;
- if (!lobj->refcnt) REMOVE_ELEM(&lobj->link);
-}
-
-static void
-replace_destination(INSN *dobj, INSN *nobj)
-{
- VALUE n = OPERAND_AT(nobj, 0);
- LABEL *dl = (LABEL *)OPERAND_AT(dobj, 0);
- LABEL *nl = (LABEL *)n;
- --dl->refcnt;
- ++nl->refcnt;
- OPERAND_AT(dobj, 0) = n;
- if (!dl->refcnt) REMOVE_ELEM(&dl->link);
-}
-
-static int
-remove_unreachable_chunk(LINK_ELEMENT *i)
-{
- int removed = 0;
- while (i) {
- if (i->type == ISEQ_ELEMENT_INSN) {
- switch (INSN_OF(i)) {
- case BIN(jump):
- case BIN(branchif):
- case BIN(branchunless):
- case BIN(branchnil):
- unref_destination((INSN *)i);
- default:
- break;
- }
- }
- else break;
- REMOVE_ELEM(i);
- removed = 1;
- i = i->next;
- }
- return removed;
-}
-
static int
iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
{
@@ -2027,14 +1793,13 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* =>
* LABEL:
*/
- unref_destination(iobj);
REMOVE_ELEM(&iobj->link);
}
- else if (iobj != diobj && diobj->insn_id == BIN(jump) &&
- OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
- replace_destination(iobj, diobj);
- remove_unreachable_chunk(iobj->link.next);
- goto again;
+ else if (iobj != diobj && diobj->insn_id == BIN(jump)) {
+ if (OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(diobj, 0);
+ goto again;
+ }
}
else if (diobj->insn_id == BIN(leave)) {
/*
@@ -2048,14 +1813,14 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* LABEL:
* leave
*/
+ INSN *eiobj = new_insn_core(iseq, iobj->line_no, BIN(leave),
+ diobj->operand_size, diobj->operands);
INSN *popiobj = new_insn_core(iseq, iobj->line_no,
BIN(pop), 0, 0);
/* replace */
- unref_destination(iobj);
- iobj->insn_id = BIN(leave);
- iobj->operand_size = 0;
- INSERT_ELEM_NEXT(&iobj->link, &popiobj->link);
- goto again;
+ REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
+ INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
+ iobj = popiobj;
}
/*
* useless jump elimination (if/unless destination):
@@ -2077,21 +1842,13 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
if (niobj == (INSN *)get_destination_insn(piobj)) {
piobj->insn_id = (piobj->insn_id == BIN(branchif))
? BIN(branchunless) : BIN(branchif);
- replace_destination(piobj, iobj);
+ OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
REMOVE_ELEM(&iobj->link);
}
}
- else if (remove_unreachable_chunk(iobj->link.next)) {
- goto again;
- }
- }
-
- if (iobj->insn_id == BIN(leave)) {
- remove_unreachable_chunk(iobj->link.next);
}
if (iobj->insn_id == BIN(branchif) ||
- iobj->insn_id == BIN(branchnil) ||
iobj->insn_id == BIN(branchunless)) {
/*
* if L1
@@ -2102,124 +1859,12 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* if L2
*/
INSN *nobj = (INSN *)get_destination_insn(iobj);
- INSN *pobj = (INSN *)iobj->link.prev;
- int prev_dup = 0;
- if (pobj) {
- if (pobj->link.type != ISEQ_ELEMENT_INSN)
- pobj = 0;
- else if (pobj->insn_id == BIN(dup))
- prev_dup = 1;
- }
-
- for (;;) {
- if (nobj->insn_id == BIN(jump)) {
- replace_destination(iobj, nobj);
- }
- else if (prev_dup && nobj->insn_id == BIN(dup) &&
- !!(nobj = (INSN *)nobj->link.next) &&
- /* basic blocks, with no labels in the middle */
- nobj->insn_id == iobj->insn_id) {
- /*
- * dup
- * if L1
- * ...
- * L1:
- * dup
- * if L2
- * =>
- * dup
- * if L2
- * ...
- * L1:
- * dup
- * if L2
- */
- replace_destination(iobj, nobj);
- }
- else if (pobj) {
- /*
- * putnil
- * if L1
- * =>
- * # nothing
- *
- * putobject true
- * if L1
- * =>
- * jump L1
- *
- * putstring ".."
- * if L1
- * =>
- * jump L1
- *
- * putstring ".."
- * dup
- * if L1
- * =>
- * putstring ".."
- * jump L1
- *
- */
- int cond;
- if (prev_dup && pobj->link.prev->type == ISEQ_ELEMENT_INSN) {
- pobj = (INSN *)pobj->link.prev;
- }
- if (pobj->insn_id == BIN(putobject)) {
- cond = (iobj->insn_id == BIN(branchif) ?
- OPERAND_AT(pobj, 0) != Qfalse :
- iobj->insn_id == BIN(branchunless) ?
- OPERAND_AT(pobj, 0) == Qfalse :
- FALSE);
- }
- else if (pobj->insn_id == BIN(putstring)) {
- cond = iobj->insn_id == BIN(branchif);
- }
- else if (pobj->insn_id == BIN(putnil)) {
- cond = iobj->insn_id != BIN(branchif);
- }
- else break;
- REMOVE_ELEM(iobj->link.prev);
- if (cond) {
- iobj->insn_id = BIN(jump);
- goto again;
- }
- else {
- unref_destination(iobj);
- REMOVE_ELEM(&iobj->link);
- }
- break;
- }
- else break;
- nobj = (INSN *)get_destination_insn(nobj);
+ if (nobj->insn_id == BIN(jump)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
}
}
- if (iobj->insn_id == BIN(pop)) {
- /*
- * putself / putnil / putobject obj / putstring "..."
- * pop
- * =>
- * # do nothing
- */
- LINK_ELEMENT *prev = iobj->link.prev;
- if (prev->type == ISEQ_ELEMENT_INSN) {
- enum ruby_vminsn_type previ = ((INSN *)prev)->insn_id;
- if (previ == BIN(putobject) || previ == BIN(putnil) ||
- previ == BIN(putself) || previ == BIN(putstring)) {
- /* just push operand or static value and pop soon, no
- * side effects */
- REMOVE_ELEM(prev);
- REMOVE_ELEM(&iobj->link);
- }
- }
- }
-
- if (do_tailcallopt &&
- (iobj->insn_id == BIN(send) ||
- iobj->insn_id == BIN(opt_aref_with) ||
- iobj->insn_id == BIN(opt_aset_with) ||
- iobj->insn_id == BIN(invokesuper))) {
+ if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
/*
* send ...
* leave
@@ -2227,43 +1872,11 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* send ..., ... | VM_CALL_TAILCALL, ...
* leave # unreachable
*/
- INSN *piobj = NULL;
- if (iobj->link.next) {
- LINK_ELEMENT *next = iobj->link.next;
- do {
- if (next->type != ISEQ_ELEMENT_INSN) {
- next = next->next;
- continue;
- }
- switch (INSN_OF(next)) {
- case BIN(nop):
- /*case BIN(trace):*/
- next = next->next;
- break;
- case BIN(jump):
- /* if cond
- * return tailcall
- * end
- */
- next = get_destination_insn((INSN *)next);
- break;
- case BIN(leave):
- piobj = iobj;
- default:
- next = NULL;
- break;
- }
- } while (next);
- }
+ INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
- if (piobj) {
- struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
- if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(invokesuper)) {
- if (piobj->operands[2] == 0) { /* no blockiseq */
- ci->flag |= VM_CALL_TAILCALL;
- }
- }
- else {
+ if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(opt_send_simple)) {
+ rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
+ if (ci->blockiseq == 0) {
ci->flag |= VM_CALL_TAILCALL;
}
}
@@ -2274,17 +1887,18 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
static int
insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
{
+ int old_opsize = iobj->operand_size;
iobj->insn_id = insn_id;
iobj->operand_size = insn_len(insn_id) - 1;
- if (insn_id == BIN(opt_neq)) {
+ if (iobj->operand_size > old_opsize) {
VALUE *old_operands = iobj->operands;
- iobj->operand_size = 4;
+ if (insn_id != BIN(opt_neq)) {
+ rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
+ }
iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size * sizeof(VALUE));
iobj->operands[0] = old_operands[0];
- iobj->operands[1] = Qfalse; /* CALL_CACHE */
- iobj->operands[2] = (VALUE)new_callinfo(iseq, idEq, 1, 0, NULL, FALSE);
- iobj->operands[3] = Qfalse; /* CALL_CACHE */
+ iobj->operands[1] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0);
}
return COMPILE_OK;
@@ -2294,11 +1908,10 @@ static int
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
{
if (iobj->insn_id == BIN(send)) {
- struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(iobj, 0);
- const rb_iseq_t *blockiseq = (rb_iseq_t *)OPERAND_AT(iobj, 2);
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, 0);
#define SP_INSN(opt) insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))
- if (ci->flag & VM_CALL_ARGS_SIMPLE) {
+ if (ci->blockiseq == 0 && (ci->flag & ~VM_CALL_ARGS_SKIP_SETUP) == 0) {
switch (ci->orig_argc) {
case 0:
switch (ci->mid) {
@@ -2326,17 +1939,10 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
case idAREF: SP_INSN(aref); return COMPILE_OK;
}
break;
- case 2:
- switch (ci->mid) {
- case idASET: SP_INSN(aset); return COMPILE_OK;
- }
- break;
}
}
-
- if ((ci->flag & VM_CALL_ARGS_BLOCKARG) == 0 && blockiseq == NULL) {
- iobj->insn_id = BIN(opt_send_without_block);
- iobj->operand_size = insn_len(iobj->insn_id) - 1;
+ if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {
+ iobj->insn_id = BIN(opt_send_simple);
}
}
#undef SP_INSN
@@ -2344,37 +1950,20 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
return COMPILE_OK;
}
-static inline int
-tailcallable_p(rb_iseq_t *iseq)
-{
- switch (iseq->body->type) {
- case ISEQ_TYPE_RESCUE:
- case ISEQ_TYPE_ENSURE:
- /* rescue block can't tail call because of errinfo */
- return FALSE;
- default:
- return TRUE;
- }
-}
-
static int
iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
LINK_ELEMENT *list;
- const int do_peepholeopt = ISEQ_COMPILE_DATA(iseq)->option->peephole_optimization;
- const int do_tailcallopt = tailcallable_p(iseq) &&
- ISEQ_COMPILE_DATA(iseq)->option->tailcall_optimization;
- const int do_si = ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction;
- const int do_ou = ISEQ_COMPILE_DATA(iseq)->option->operands_unification;
- int rescue_level = 0;
- int tailcallopt = do_tailcallopt;
-
+ const int do_peepholeopt = iseq->compile_data->option->peephole_optimization;
+ const int do_tailcallopt = iseq->compile_data->option->tailcall_optimization;
+ const int do_si = iseq->compile_data->option->specialized_instruction;
+ const int do_ou = iseq->compile_data->option->operands_unification;
list = FIRST_ELEMENT(anchor);
while (list) {
if (list->type == ISEQ_ELEMENT_INSN) {
if (do_peepholeopt) {
- iseq_peephole_optimize(iseq, list, tailcallopt);
+ iseq_peephole_optimize(iseq, list, do_tailcallopt);
}
if (do_si) {
iseq_specialized_instruction(iseq, (INSN *)list);
@@ -2383,17 +1972,6 @@ iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
insn_operands_unification((INSN *)list);
}
}
- if (list->type == ISEQ_ELEMENT_LABEL) {
- switch (((LABEL *)list)->rescued) {
- case LABEL_RESCUE_BEG:
- rescue_level++;
- tailcallopt = FALSE;
- break;
- case LABEL_RESCUE_END:
- if (!--rescue_level) tailcallopt = do_tailcallopt;
- break;
- }
- }
list = list->next;
}
return COMPILE_OK;
@@ -2517,9 +2095,9 @@ insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
dump_disasm_list((LINK_ELEMENT *)iobj);
dump_disasm_list((LINK_ELEMENT *)lobj);
printf("\n-- %d, %d\n", lobj->sc_state, nstate);
- COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
- "insn_set_sc_state error\n");
- return COMPILE_NG;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "insn_set_sc_state error\n");
+ return 0;
}
}
else {
@@ -2619,9 +2197,8 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case SCS_XX:
goto normal_insn;
default:
- COMPILE_ERROR(ruby_sourcefile_string, iobj->line_no,
- "unreachable");
- return COMPILE_NG;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unreachable");
}
/* remove useless pop */
REMOVE_ELEM(list);
@@ -2656,27 +2233,20 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
{
NODE *list = node->nd_next;
VALUE lit = node->nd_lit;
- LINK_ELEMENT *first_lit = 0;
int cnt = 0;
debugp_param("nd_lit", lit);
if (!NIL_P(lit)) {
+ hide_obj(lit);
cnt++;
- if (!RB_TYPE_P(lit, T_STRING)) {
- rb_compile_bug_str(ERROR_ARGS "dstr: must be string: %s",
- rb_builtin_type_name(TYPE(lit)));
- }
- lit = node->nd_lit = rb_fstring(lit);
ADD_INSN1(ret, nd_line(node), putobject, lit);
- if (RSTRING_LEN(lit) == 0) first_lit = LAST_ELEMENT(ret);
}
while (list) {
node = list->nd_head;
if (nd_type(node) == NODE_STR) {
- node->nd_lit = rb_fstring(node->nd_lit);
+ hide_obj(node->nd_lit);
ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
- lit = Qnil;
}
else {
COMPILE(ret, "each string", node);
@@ -2684,10 +2254,6 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
cnt++;
list = list->nd_next;
}
- if (NIL_P(lit) && first_lit) {
- REMOVE_ELEM(first_lit);
- --cnt;
- }
*cntp = cnt;
return COMPILE_OK;
@@ -2756,52 +2322,6 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
return COMPILE_OK;
}
-static int
-compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE * const root_node, struct rb_call_info_kw_arg ** const kw_arg_ptr)
-{
- if (kw_arg_ptr == NULL) return FALSE;
-
- if (nd_type(root_node) == NODE_HASH && root_node->nd_head && nd_type(root_node->nd_head) == NODE_ARRAY) {
- NODE *node = root_node->nd_head;
-
- while (node) {
- NODE *key_node = node->nd_head;
-
- assert(nd_type(node) == NODE_ARRAY);
- if (key_node && nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
- /* can be keywords */
- }
- else {
- return FALSE;
- }
- node = node->nd_next; /* skip value node */
- node = node->nd_next;
- }
-
- /* may be keywords */
- node = root_node->nd_head;
- {
- int len = (int)node->nd_alen / 2;
- struct rb_call_info_kw_arg *kw_arg = (struct rb_call_info_kw_arg *)ruby_xmalloc(sizeof(struct rb_call_info_kw_arg) + sizeof(VALUE) * (len - 1));
- VALUE *keywords = kw_arg->keywords;
- int i = 0;
- kw_arg->keyword_len = len;
-
- *kw_arg_ptr = kw_arg;
-
- for (i=0; node != NULL; i++, node = node->nd_next->nd_next) {
- NODE *key_node = node->nd_head;
- NODE *val_node = node->nd_next->nd_head;
- keywords[i] = key_node->nd_lit;
- COMPILE(ret, "keyword values", val_node);
- }
- assert(i == len);
- return TRUE;
- }
- }
- return FALSE;
-}
-
enum compile_array_type_t {
COMPILE_ARRAY_TYPE_ARRAY,
COMPILE_ARRAY_TYPE_HASH,
@@ -2810,7 +2330,7 @@ enum compile_array_type_t {
static int
compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
- enum compile_array_type_t type, struct rb_call_info_kw_arg **keywords_ptr, int poped)
+ enum compile_array_type_t type, int poped)
{
NODE *node = node_root;
int line = (int)nd_line(node);
@@ -2837,30 +2357,22 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
INIT_ANCHOR(anchor);
for (i=0; i<max && node; i++, len++, node = node->nd_next) {
- if (CPDEBUG > 0) {
- EXPECT_NODE("compile_array", node, NODE_ARRAY);
+ if (CPDEBUG > 0 && nd_type(node) != NODE_ARRAY) {
+ rb_bug("compile_array: This node is not NODE_ARRAY, but %s", ruby_node_name(nd_type(node)));
}
- if (type != COMPILE_ARRAY_TYPE_ARRAY && !node->nd_head) {
+ if (type == COMPILE_ARRAY_TYPE_HASH && !node->nd_head) {
+ opt_p = 0;
kw = node->nd_next;
- node = 0;
- if (kw) {
- opt_p = 0;
- node = kw->nd_next;
- kw = kw->nd_head;
- }
+ node = kw->nd_next;
+ kw = kw->nd_head;
break;
}
if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
opt_p = 0;
}
- if (type == COMPILE_ARRAY_TYPE_ARGS && node->nd_next == NULL /* last node */ && compile_array_keyword_arg(iseq, anchor, node->nd_head, keywords_ptr)) {
- len--;
- }
- else {
- COMPILE_(anchor, "array element", node->nd_head, poped);
- }
+ COMPILE_(anchor, "array element", node->nd_head, poped);
}
if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
@@ -2895,7 +2407,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
else { /* COMPILE_ARRAY_TYPE_HASH */
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putobject, ary);
- ADD_SEND(ret, line, id_core_hash_from_ary, INT2FIX(1));
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_from_ary), INT2FIX(1));
}
}
else {
@@ -2906,7 +2418,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
else {
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putobject, ary);
- ADD_SEND(ret, line, id_core_hash_merge_ary, INT2FIX(1));
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ary), INT2FIX(1));
}
}
}
@@ -2923,41 +2435,32 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
else {
ADD_INSN(anchor, line, concatarray);
}
-
APPEND_LIST(ret, anchor);
break;
case COMPILE_ARRAY_TYPE_HASH:
- if (i > 0) {
- if (first) {
- ADD_INSN1(anchor, line, newhash, INT2FIX(i));
- APPEND_LIST(ret, anchor);
- }
- else {
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN(ret, line, swap);
- APPEND_LIST(ret, anchor);
- ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
- }
+ if (first) {
+ first = 0;
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ APPEND_LIST(ret, anchor);
+ }
+ else if (i > 0) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ APPEND_LIST(ret, anchor);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ptr), INT2FIX(i + 1));
}
if (kw) {
- VALUE nhash = (i > 0 || !first) ? INT2FIX(2) : INT2FIX(1);
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (i > 0 || !first) ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, line, swap);
COMPILE(ret, "keyword splat", kw);
- ADD_SEND(ret, line, id_core_hash_merge_kwd, nhash);
- if (nhash == INT2FIX(1)) ADD_SEND(ret, line, rb_intern("dup"), INT2FIX(0));
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_kwd), INT2FIX(2));
}
- first = 0;
break;
case COMPILE_ARRAY_TYPE_ARGS:
APPEND_LIST(ret, anchor);
break;
}
}
- else {
- /* poped */
- APPEND_LIST(ret, anchor);
- }
}
}
}
@@ -2967,7 +2470,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
static VALUE
compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, enum compile_array_type_t type)
{
- return compile_array_(iseq, ret, node_root, type, NULL, 0);
+ return compile_array_(iseq, ret, node_root, type, 0);
}
static VALUE
@@ -2986,14 +2489,8 @@ case_when_optimizable_literal(NODE * node)
}
break;
}
- case NODE_NIL:
- return Qnil;
- case NODE_TRUE:
- return Qtrue;
- case NODE_FALSE:
- return Qfalse;
case NODE_STR:
- return node->nd_lit = rb_fstring(node->nd_lit);
+ return node->nd_lit;
}
return Qundef;
}
@@ -3010,8 +2507,7 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int onl
}
else {
if (rb_hash_lookup(literals, lit) != Qnil) {
- rb_compile_warning(ruby_sourcefile, nd_line(val),
- "duplicated when clause is ignored");
+ rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
}
else {
rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
@@ -3021,8 +2517,8 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int onl
ADD_INSN(cond_seq, nd_line(val), dup); /* dup target */
if (nd_type(val) == NODE_STR) {
- val->nd_lit = rb_fstring(val->nd_lit);
debugp_param("nd_lit", val->nd_lit);
+ OBJ_FREEZE(val->nd_lit);
ADD_INSN1(cond_seq, nd_line(val), putobject, val->nd_lit);
}
else {
@@ -3042,24 +2538,21 @@ compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
switch (nd_type(node)) {
case NODE_ATTRASGN: {
INSN *iobj;
- struct rb_call_info *ci;
+ rb_call_info_t *ci;
VALUE dupidx;
- int line = nd_line(node);
COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
- iobj = (INSN *)get_prev_insn((INSN *)LAST_ELEMENT(ret)); /* send insn */
- ci = (struct rb_call_info *)iobj->operands[0];
- ci->orig_argc += 1;
+ POP_ELEMENT(ret); /* pop pop insn */
+ iobj = (INSN *)POP_ELEMENT(ret); /* pop send insn */
+ ci = (rb_call_info_t *)iobj->operands[0];
+ ci->orig_argc += 1; ci->argc = ci->orig_argc;
dupidx = INT2FIX(ci->orig_argc);
- INSERT_BEFORE_INSN1(iobj, line, topn, dupidx);
- if (ci->flag & VM_CALL_ARGS_SPLAT) {
- --ci->orig_argc;
- INSERT_BEFORE_INSN1(iobj, line, newarray, INT2FIX(1));
- INSERT_BEFORE_INSN(iobj, line, concatarray);
- }
- ADD_INSN(ret, line, pop); /* result */
+ ADD_INSN1(ret, nd_line(node), topn, dupidx);
+ ADD_ELEM(ret, (LINK_ELEMENT *)iobj);
+ ADD_INSN(ret, nd_line(node), pop); /* result */
+ ADD_INSN(ret, nd_line(node), pop); /* rhs */
break;
}
case NODE_MASGN: {
@@ -3156,17 +2649,6 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
return 1;
}
-static void
-adjust_stack(rb_iseq_t *iseq, LINK_ANCHOR *ret, int line, int rlen, int llen)
-{
- if (rlen < llen) {
- do {ADD_INSN(ret, line, putnil);} while (++rlen < llen);
- }
- else if (rlen > llen) {
- do {ADD_INSN(ret, line, pop);} while (--rlen > llen);
- }
-}
-
static int
compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
{
@@ -3177,7 +2659,6 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
if (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
int llen = 0;
- int expand = 1;
DECL_ANCHOR(lhsseq);
INIT_ANCHOR(lhsseq);
@@ -3193,35 +2674,9 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
if (!poped) {
ADD_INSN(ret, nd_line(node), dup);
}
- else if (!lhs_splat) {
- INSN *last = (INSN*)ret->last;
- if (last->link.type == ISEQ_ELEMENT_INSN &&
- last->insn_id == BIN(newarray) &&
- last->operand_size == 1) {
- int rlen = FIX2INT(OPERAND_AT(last, 0));
- /* special case: assign to aset or attrset */
- if (llen == 2) {
- POP_ELEMENT(ret);
- adjust_stack(iseq, ret, nd_line(node), rlen, llen);
- ADD_INSN(ret, nd_line(node), swap);
- expand = 0;
- }
- else if (llen > 2 && llen != rlen) {
- POP_ELEMENT(ret);
- adjust_stack(iseq, ret, nd_line(node), rlen, llen);
- ADD_INSN1(ret, nd_line(node), reverse, INT2FIX(llen));
- expand = 0;
- }
- else if (llen > 2) {
- last->insn_id = BIN(reverse);
- expand = 0;
- }
- }
- }
- if (expand) {
- ADD_INSN2(ret, nd_line(node), expandarray,
- INT2FIX(llen), INT2FIX(lhs_splat));
- }
+
+ ADD_INSN2(ret, nd_line(node), expandarray,
+ INT2FIX(llen), INT2FIX(lhs_splat));
ADD_SEQ(ret, lhsseq);
if (lhs_splat) {
@@ -3300,8 +2755,6 @@ compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
}
}
-#define private_recv_p(node) (nd_type((node)->nd_recv) == NODE_SELF)
-
#define defined_expr defined_expr0
static int
defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
@@ -3405,10 +2858,17 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
case NODE_VCALL:
case NODE_FCALL:
case NODE_ATTRASGN:{
- const int explicit_receiver =
- (type == NODE_CALL ||
- (type == NODE_ATTRASGN && !private_recv_p(node)));
+ int self = TRUE;
+ switch (type) {
+ case NODE_ATTRASGN:
+ if (node->nd_recv == (NODE *)1) break;
+ case NODE_CALL:
+ self = FALSE;
+ break;
+ default:
+ /* through */;
+ }
if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
}
@@ -3416,7 +2876,7 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
}
- if (explicit_receiver) {
+ if (!self) {
defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
COMPILE(ret, "defined/recv", node->nd_recv);
@@ -3493,13 +2953,11 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
int line = nd_line(node);
LABEL *lstart = NEW_LABEL(line);
LABEL *lend = NEW_LABEL(line);
- const rb_iseq_t *rescue = NEW_CHILD_ISEQ(NEW_NIL(),
- rb_str_concat(rb_str_new2
- ("defined guard in "),
- iseq->body->location.label),
- ISEQ_TYPE_DEFINED_GUARD, 0);
- lstart->rescued = LABEL_RESCUE_BEG;
- lend->rescued = LABEL_RESCUE_END;
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
APPEND_LABEL(ret, lcur, lstart);
ADD_LABEL(ret, lend);
ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
@@ -3507,26 +2965,28 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
return done;
}
+#define BUFSIZE 0x100
+
static VALUE
-make_name_for_block(const rb_iseq_t *orig_iseq)
+make_name_for_block(rb_iseq_t *iseq)
{
int level = 1;
- const rb_iseq_t *iseq = orig_iseq;
+ rb_iseq_t *ip = iseq;
- if (orig_iseq->body->parent_iseq != 0) {
- while (orig_iseq->body->local_iseq != iseq) {
- if (iseq->body->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->parent_iseq != 0) {
+ while (ip->local_iseq != ip) {
+ if (ip->type == ISEQ_TYPE_BLOCK) {
level++;
}
- iseq = iseq->body->parent_iseq;
+ ip = ip->parent_iseq;
}
}
if (level == 1) {
- return rb_sprintf("block in %"PRIsVALUE, iseq->body->location.label);
+ return rb_sprintf("block in %s", RSTRING_PTR(ip->location.label));
}
else {
- return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, iseq->body->location.label);
+ return rb_sprintf("block (%d levels) in %s", level, RSTRING_PTR(ip->location.label));
}
}
@@ -3536,9 +2996,9 @@ push_ensure_entry(rb_iseq_t *iseq,
struct ensure_range *er, NODE *node)
{
enl->ensure_node = node;
- enl->prev = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack; /* prev */
+ enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
enl->erange = er;
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl;
+ iseq->compile_data->ensure_node_stack = enl;
}
static void
@@ -3563,7 +3023,7 @@ static void
add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
{
struct iseq_compile_data_ensure_node_stack *enlp =
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack;
+ iseq->compile_data->ensure_node_stack;
struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
DECL_ANCHOR(ensure);
@@ -3577,7 +3037,7 @@ add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
add_ensure_range(iseq, enlp->erange, lstart, lend);
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enlp->prev;
+ iseq->compile_data->ensure_node_stack = enlp->prev;
ADD_LABEL(ensure_part, lstart);
COMPILE_POPED(ensure_part, "ensure part", enlp->ensure_node);
ADD_LABEL(ensure_part, lend);
@@ -3590,12 +3050,12 @@ add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
}
enlp = enlp->prev;
}
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = prev_enlp;
+ iseq->compile_data->ensure_node_stack = prev_enlp;
ADD_SEQ(ret, ensure);
}
static VALUE
-setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, struct rb_call_info_kw_arg **keywords)
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
{
VALUE argc = INT2FIX(0);
int nsplat = 0;
@@ -3615,7 +3075,6 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
switch (nd_type(argn)) {
case NODE_SPLAT: {
COMPILE(args, "args (splat)", argn->nd_head);
- ADD_INSN1(args, nd_line(argn), splatarray, Qfalse);
argc = INT2FIX(1);
nsplat++;
*flag |= VM_CALL_ARGS_SPLAT;
@@ -3628,11 +3087,16 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
INIT_ANCHOR(tmp);
COMPILE(tmp, "args (cat: splat)", argn->nd_body);
- if (nd_type(argn) == NODE_ARGSCAT) {
- ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
+ if (next_is_array && nsplat == 0) {
+ /* none */
}
else {
- ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ if (nd_type(argn) == NODE_ARGSCAT) {
+ ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
+ }
+ else {
+ ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ }
}
INSERT_LIST(args_splat, tmp);
nsplat++;
@@ -3647,13 +3111,12 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
}
break;
}
- case NODE_ARRAY:
- {
- argc = INT2FIX(compile_array_(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS, keywords, FALSE));
- break;
- }
+ case NODE_ARRAY: {
+ argc = INT2FIX(compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS));
+ break;
+ }
default: {
- UNKNOWN_NODE("setup_arg", argn);
+ rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
}
}
}
@@ -3675,18 +3138,6 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, s
return argc;
}
-static VALUE
-build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *body)
-{
- int line = nd_line(body);
- VALUE argc = INT2FIX(0);
- const rb_iseq_t *block = NEW_CHILD_ISEQ(body, make_name_for_block(iseq->body->parent_iseq), ISEQ_TYPE_BLOCK, line);
-
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_CALL_WITH_BLOCK(ret, line, id_core_set_postexe, argc, block);
- iseq_set_local_table(iseq, 0);
- return Qnil;
-}
/**
compile each node
@@ -3699,34 +3150,24 @@ static int
iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
{
enum node_type type;
- LINK_ELEMENT *saved_last_element = 0;
- int line;
if (node == 0) {
if (!poped) {
debugs("node: NODE_NIL(implicit)\n");
- ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, putnil);
+ ADD_INSN(ret, iseq->compile_data->last_line, putnil);
}
return COMPILE_OK;
}
- line = (int)nd_line(node);
-
- if (ISEQ_COMPILE_DATA(iseq)->last_line == line) {
- /* ignore */
- }
- else {
- if (node->flags & NODE_FL_NEWLINE) {
- ISEQ_COMPILE_DATA(iseq)->last_line = line;
- ADD_TRACE(ret, line, RUBY_EVENT_LINE);
- saved_last_element = ret->last;
- }
- }
-
+ iseq->compile_data->last_line = (int)nd_line(node);
debug_node_start(node);
type = nd_type(node);
+ if (node->flags & NODE_FL_NEWLINE) {
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_LINE);
+ }
+
switch (type) {
case NODE_BLOCK:{
while (node && nd_type(node) == NODE_BLOCK) {
@@ -3748,9 +3189,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(cond_seq);
INIT_ANCHOR(then_seq);
INIT_ANCHOR(else_seq);
- then_label = NEW_LABEL(line);
- else_label = NEW_LABEL(line);
- end_label = NEW_LABEL(line);
+ then_label = NEW_LABEL(nd_line(node));
+ else_label = NEW_LABEL(nd_line(node));
+ end_label = NEW_LABEL(nd_line(node));
compile_branch_condition(iseq, cond_seq, node->nd_cond,
then_label, else_label);
@@ -3761,7 +3202,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_LABEL(ret, then_label);
ADD_SEQ(ret, then_seq);
- ADD_INSNL(ret, line, jump, end_label);
+ ADD_INSNL(ret, nd_line(node), jump, end_label);
ADD_LABEL(ret, else_label);
ADD_SEQ(ret, else_seq);
@@ -3784,7 +3225,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(body_seq);
INIT_ANCHOR(cond_seq);
- rb_hash_tbl_raw(literals)->type = &cdhash_type;
+ RHASH_TBL(literals)->type = &cdhash_type;
if (node->nd_head == 0) {
COMPILE_(ret, "when", node->nd_body, poped);
@@ -3794,27 +3235,24 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
node = node->nd_body;
type = nd_type(node);
- line = nd_line(node);
if (type != NODE_WHEN) {
- COMPILE_ERROR(ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type));
- debug_node_end();
- return COMPILE_NG;
+ COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
}
- endlabel = NEW_LABEL(line);
- elselabel = NEW_LABEL(line);
+ endlabel = NEW_LABEL(nd_line(node));
+ elselabel = NEW_LABEL(nd_line(node));
ADD_SEQ(ret, head); /* case VAL */
while (type == NODE_WHEN) {
LABEL *l1;
- l1 = NEW_LABEL(line);
+ l1 = NEW_LABEL(nd_line(node));
ADD_LABEL(body_seq, l1);
- ADD_INSN(body_seq, line, pop);
+ ADD_INSN(body_seq, nd_line(node), pop);
COMPILE_(body_seq, "when body", node->nd_body, poped);
- ADD_INSNL(body_seq, line, jump, endlabel);
+ ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
vals = node->nd_head;
if (vals) {
@@ -3832,11 +3270,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
break;
default:
- UNKNOWN_NODE("NODE_CASE", vals);
+ rb_bug("NODE_CASE: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
}
}
else {
- EXPECT_NODE_NONULL("NODE_CASE", node, NODE_ARRAY);
+ rb_bug("NODE_CASE: must be NODE_ARRAY, but 0");
}
node = node->nd_next;
@@ -3844,14 +3283,13 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
type = nd_type(node);
- line = nd_line(node);
}
/* else */
if (node) {
ADD_LABEL(cond_seq, elselabel);
- ADD_INSN(cond_seq, line, pop);
+ ADD_INSN(cond_seq, nd_line(node), pop);
COMPILE_(cond_seq, "else", node, poped);
- ADD_INSNL(cond_seq, line, jump, endlabel);
+ ADD_INSNL(cond_seq, nd_line(node), jump, endlabel);
}
else {
debugs("== else (implicit)\n");
@@ -3868,7 +3306,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, nd_line(tempnode), dup);
ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
- LABEL_REF(elselabel);
}
ADD_SEQ(ret, cond_seq);
@@ -3884,17 +3321,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
DECL_ANCHOR(body_seq);
INIT_ANCHOR(body_seq);
- endlabel = NEW_LABEL(line);
+ endlabel = NEW_LABEL(nd_line(node));
while (node && nd_type(node) == NODE_WHEN) {
- LABEL *l1 = NEW_LABEL(line = nd_line(node));
+ LABEL *l1 = NEW_LABEL(nd_line(node));
ADD_LABEL(body_seq, l1);
COMPILE_(body_seq, "when", node->nd_body, poped);
- ADD_INSNL(body_seq, line, jump, endlabel);
+ ADD_INSNL(body_seq, nd_line(node), jump, endlabel);
vals = node->nd_head;
if (!vals) {
- rb_compile_bug_str(ERROR_ARGS "NODE_WHEN: must be NODE_ARRAY, but 0");
+ rb_bug("NODE_WHEN: must be NODE_ARRAY, but 0");
}
switch (nd_type(vals)) {
case NODE_ARRAY:
@@ -3914,7 +3351,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(ret, nd_line(vals), branchif, l1);
break;
default:
- UNKNOWN_NODE("NODE_WHEN", vals);
+ rb_bug("NODE_WHEN: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
}
node = node->nd_next;
}
@@ -3930,37 +3368,35 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_OPT_N:
case NODE_WHILE:
case NODE_UNTIL:{
- LABEL *prev_start_label = ISEQ_COMPILE_DATA(iseq)->start_label;
- LABEL *prev_end_label = ISEQ_COMPILE_DATA(iseq)->end_label;
- LABEL *prev_redo_label = ISEQ_COMPILE_DATA(iseq)->redo_label;
- int prev_loopval_popped = ISEQ_COMPILE_DATA(iseq)->loopval_popped;
+ LABEL *prev_start_label = iseq->compile_data->start_label;
+ LABEL *prev_end_label = iseq->compile_data->end_label;
+ LABEL *prev_redo_label = iseq->compile_data->redo_label;
+ int prev_loopval_popped = iseq->compile_data->loopval_popped;
struct iseq_compile_data_ensure_node_stack enl;
- LABEL *next_label = ISEQ_COMPILE_DATA(iseq)->start_label = NEW_LABEL(line); /* next */
- LABEL *redo_label = ISEQ_COMPILE_DATA(iseq)->redo_label = NEW_LABEL(line); /* redo */
- LABEL *break_label = ISEQ_COMPILE_DATA(iseq)->end_label = NEW_LABEL(line); /* break */
- LABEL *end_label = NEW_LABEL(line);
- LABEL *adjust_label = NEW_LABEL(line);
+ LABEL *next_label = iseq->compile_data->start_label = NEW_LABEL(nd_line(node)); /* next */
+ LABEL *redo_label = iseq->compile_data->redo_label = NEW_LABEL(nd_line(node)); /* redo */
+ LABEL *break_label = iseq->compile_data->end_label = NEW_LABEL(nd_line(node)); /* break */
+ LABEL *end_label = NEW_LABEL(nd_line(node));
- LABEL *next_catch_label = NEW_LABEL(line);
+ LABEL *next_catch_label = NEW_LABEL(nd_line(node));
LABEL *tmp_label = NULL;
- ISEQ_COMPILE_DATA(iseq)->loopval_popped = 0;
+ iseq->compile_data->loopval_popped = 0;
push_ensure_entry(iseq, &enl, 0, 0);
if (type == NODE_OPT_N || node->nd_state == 1) {
- ADD_INSNL(ret, line, jump, next_label);
+ ADD_INSNL(ret, nd_line(node), jump, next_label);
}
else {
- tmp_label = NEW_LABEL(line);
- ADD_INSNL(ret, line, jump, tmp_label);
+ tmp_label = NEW_LABEL(nd_line(node));
+ ADD_INSNL(ret, nd_line(node), jump, tmp_label);
}
- ADD_LABEL(ret, adjust_label);
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
ADD_LABEL(ret, next_catch_label);
- ADD_INSN(ret, line, pop);
- ADD_INSNL(ret, line, jump, next_label);
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSNL(ret, nd_line(node), jump, next_label);
if (tmp_label) ADD_LABEL(ret, tmp_label);
ADD_LABEL(ret, redo_label);
@@ -3972,32 +3408,31 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
redo_label, end_label);
}
else if (type == NODE_UNTIL) {
- /* until */
+ /* untile */
compile_branch_condition(iseq, ret, node->nd_cond,
end_label, redo_label);
}
else {
- ADD_CALL_RECEIVER(ret, line);
- ADD_CALL(ret, line, idGets, INT2FIX(0));
- ADD_INSNL(ret, line, branchif, redo_label);
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ ADD_CALL(ret, nd_line(node), ID2SYM(idGets), INT2FIX(0));
+ ADD_INSNL(ret, nd_line(node), branchif, redo_label);
/* opt_n */
}
ADD_LABEL(ret, end_label);
- ADD_ADJUST_RESTORE(ret, adjust_label);
if (node->nd_state == Qundef) {
- /* ADD_INSN(ret, line, putundef); */
- rb_compile_bug_str(ERROR_ARGS "unsupported: putundef");
+ /* ADD_INSN(ret, nd_line(node), putundef); */
+ rb_bug("unsupported: putundef");
}
else {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
ADD_LABEL(ret, break_label); /* break */
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label,
@@ -4005,67 +3440,45 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, redo_label, break_label, 0,
next_catch_label);
ADD_CATCH_ENTRY(CATCH_TYPE_REDO, redo_label, break_label, 0,
- ISEQ_COMPILE_DATA(iseq)->redo_label);
+ iseq->compile_data->redo_label);
- ISEQ_COMPILE_DATA(iseq)->start_label = prev_start_label;
- ISEQ_COMPILE_DATA(iseq)->end_label = prev_end_label;
- ISEQ_COMPILE_DATA(iseq)->redo_label = prev_redo_label;
- ISEQ_COMPILE_DATA(iseq)->loopval_popped = prev_loopval_popped;
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack->prev;
+ iseq->compile_data->start_label = prev_start_label;
+ iseq->compile_data->end_label = prev_end_label;
+ iseq->compile_data->redo_label = prev_redo_label;
+ iseq->compile_data->loopval_popped = prev_loopval_popped;
+ iseq->compile_data->ensure_node_stack = iseq->compile_data->ensure_node_stack->prev;
break;
}
- case NODE_FOR:
- if (node->nd_var) {
- /* massign to var in "for"
- * args.length == 1 && Array === (tmp = args[0]) ? tmp : args
- */
- NODE *var = node->nd_var;
- LABEL *not_single = NEW_LABEL(nd_line(var));
- LABEL *not_ary = NEW_LABEL(nd_line(var));
- COMPILE(ret, "for var", var);
- ADD_INSN(ret, line, dup);
- ADD_CALL(ret, line, idLength, INT2FIX(0));
- ADD_INSN1(ret, line, putobject, INT2FIX(1));
- ADD_CALL(ret, line, idEq, INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, not_single);
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, INT2FIX(0));
- ADD_CALL(ret, line, idAREF, INT2FIX(1));
- ADD_INSN1(ret, line, putobject, rb_cArray);
- ADD_INSN1(ret, line, topn, INT2FIX(1));
- ADD_CALL(ret, line, idEqq, INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, not_ary);
- ADD_INSN(ret, line, swap);
- ADD_LABEL(ret, not_ary);
- ADD_INSN(ret, line, pop);
- ADD_LABEL(ret, not_single);
- break;
- }
- case NODE_ITER:{
- const rb_iseq_t *prevblock = ISEQ_COMPILE_DATA(iseq)->current_block;
- LABEL *retry_label = NEW_LABEL(line);
- LABEL *retry_end_l = NEW_LABEL(line);
+ case NODE_ITER:
+ case NODE_FOR:{
+ VALUE prevblock = iseq->compile_data->current_block;
+ LABEL *retry_label = NEW_LABEL(nd_line(node));
+ LABEL *retry_end_l = NEW_LABEL(nd_line(node));
ADD_LABEL(ret, retry_label);
if (nd_type(node) == NODE_FOR) {
COMPILE(ret, "iter caller (for)", node->nd_iter);
- ISEQ_COMPILE_DATA(iseq)->current_block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
- ADD_SEND_WITH_BLOCK(ret, line, idEach, INT2FIX(0), ISEQ_COMPILE_DATA(iseq)->current_block);
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, nd_line(node));
+
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),
+ iseq->compile_data->current_block, INT2FIX(0));
}
else {
- ISEQ_COMPILE_DATA(iseq)->current_block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, nd_line(node));
COMPILE(ret, "iter caller", node->nd_iter);
}
ADD_LABEL(ret, retry_end_l);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
- ISEQ_COMPILE_DATA(iseq)->current_block = prevblock;
+ iseq->compile_data->current_block = prevblock;
ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
@@ -4074,214 +3487,214 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_BREAK:{
unsigned long level = 0;
- if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
+ if (iseq->compile_data->redo_label != 0) {
/* while/until */
LABEL *splabel = NEW_LABEL(0);
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
- COMPILE_(ret, "break val (while/until)", node->nd_stts, ISEQ_COMPILE_DATA(iseq)->loopval_popped);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
+ COMPILE_(ret, "break val (while/until)", node->nd_stts, iseq->compile_data->loopval_popped);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->end_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
- else if (iseq->body->type == ISEQ_TYPE_BLOCK) {
+ else if (iseq->type == ISEQ_TYPE_BLOCK) {
break_by_insn:
/* escape from block */
COMPILE(ret, "break val (block)", node->nd_stts);
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_BREAK));
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x02) /* TAG_BREAK */ );
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
break_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with break");
- debug_node_end();
- return COMPILE_NG;
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
}
else {
- const rb_iseq_t *ip = iseq->body->parent_iseq;
-
+ rb_iseq_t *ip = iseq->parent_iseq;
while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
+ if (!ip->compile_data) {
ip = 0;
break;
}
level++;
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- level = VM_THROW_NO_ESCAPE_FLAG;
+ if (ip->compile_data->redo_label != 0) {
+ level = 0x8000;
+ if (ip->compile_data->loopval_popped == 0) {
+ /* need value */
+ level |= 0x4000;
+ }
goto break_by_insn;
}
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- level <<= VM_THROW_LEVEL_SHIFT;
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ level <<= 16;
goto break_by_insn;
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
+ else if (ip->type == ISEQ_TYPE_EVAL) {
goto break_in_eval;
}
- ip = ip->body->parent_iseq;
+ ip = ip->parent_iseq;
}
- COMPILE_ERROR(ERROR_ARGS "Invalid break");
- debug_node_end();
- return COMPILE_NG;
+ COMPILE_ERROR((ERROR_ARGS "Invalid break"));
}
break;
}
case NODE_NEXT:{
unsigned long level = 0;
- if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
+ if (iseq->compile_data->redo_label != 0) {
LABEL *splabel = NEW_LABEL(0);
debugs("next in while loop\n");
ADD_LABEL(ret, splabel);
COMPILE(ret, "next val/valid syntax?", node->nd_stts);
add_ensure_iseq(ret, iseq, 0);
- ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->start_label);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
- else if (ISEQ_COMPILE_DATA(iseq)->end_label) {
+ else if (iseq->compile_data->end_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("next in block\n");
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->start_label);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
COMPILE(ret, "next val", node->nd_stts);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->end_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
next_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with next");
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
}
else {
- const rb_iseq_t *ip = iseq;
-
+ rb_iseq_t *ip;
+ ip = iseq;
while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
+ if (!ip->compile_data) {
ip = 0;
break;
}
- level = VM_THROW_NO_ESCAPE_FLAG;
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
+ level = 0x8000 | 0x4000;
+ if (ip->compile_data->redo_label != 0) {
/* while loop */
break;
}
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
break;
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
+ else if (ip->type == ISEQ_TYPE_EVAL) {
goto next_in_eval;
}
- ip = ip->body->parent_iseq;
+ ip = ip->parent_iseq;
}
if (ip != 0) {
COMPILE(ret, "next val", node->nd_stts);
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_NEXT));
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "Invalid next");
+ COMPILE_ERROR((ERROR_ARGS "Invalid next"));
}
}
break;
}
case NODE_REDO:{
- if (ISEQ_COMPILE_DATA(iseq)->redo_label) {
+ if (iseq->compile_data->redo_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("redo in while");
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->redo_label);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label);
add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->redo_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->redo_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
redo_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with redo");
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
}
- else if (ISEQ_COMPILE_DATA(iseq)->start_label) {
+ else if (iseq->compile_data->start_label) {
LABEL *splabel = NEW_LABEL(0);
debugs("redo in block");
ADD_LABEL(ret, splabel);
add_ensure_iseq(ret, iseq, 0);
- ADD_ADJUST(ret, line, ISEQ_COMPILE_DATA(iseq)->start_label);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->start_label);
+ ADD_ADJUST(ret, nd_line(node), iseq->compile_data->start_label);
+ ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
else {
- const rb_iseq_t *ip = iseq;
- const unsigned long level = VM_THROW_NO_ESCAPE_FLAG;
-
+ rb_iseq_t *ip;
+ unsigned long level;
+ level = 0x8000 | 0x4000;
+ ip = iseq;
while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
+ if (!ip->compile_data) {
ip = 0;
break;
}
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
+ if (ip->compile_data->redo_label != 0) {
break;
}
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
break;
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
+ else if (ip->type == ISEQ_TYPE_EVAL) {
goto redo_in_eval;
}
- ip = ip->body->parent_iseq;
+ ip = ip->parent_iseq;
}
if (ip != 0) {
- ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_REDO));
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "Invalid redo");
+ COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
}
}
break;
}
case NODE_RETRY:{
- if (iseq->body->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETRY));
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x04) /* TAG_RETRY */ );
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "Invalid retry");
+ COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
}
break;
}
@@ -4290,27 +3703,26 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_RESCUE:{
- LABEL *lstart = NEW_LABEL(line);
- LABEL *lend = NEW_LABEL(line);
- LABEL *lcont = NEW_LABEL(line);
- const rb_iseq_t *rescue = NEW_CHILD_ISEQ(node->nd_resq,
- rb_str_concat(rb_str_new2("rescue in "), iseq->body->location.label),
- ISEQ_TYPE_RESCUE, line);
+ LABEL *lstart = NEW_LABEL(nd_line(node));
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lcont = NEW_LABEL(nd_line(node));
+ VALUE rescue = NEW_CHILD_ISEQVAL(
+ node->nd_resq,
+ rb_str_concat(rb_str_new2("rescue in "), iseq->location.label),
+ ISEQ_TYPE_RESCUE, nd_line(node));
- lstart->rescued = LABEL_RESCUE_BEG;
- lend->rescued = LABEL_RESCUE_END;
ADD_LABEL(ret, lstart);
COMPILE(ret, "rescue head", node->nd_head);
ADD_LABEL(ret, lend);
if (node->nd_else) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
COMPILE(ret, "rescue else", node->nd_else);
}
- ADD_INSN(ret, line, nop);
+ ADD_INSN(ret, nd_line(node), nop);
ADD_LABEL(ret, lcont);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
/* register catch entry */
@@ -4324,46 +3736,47 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *label_miss, *label_hit;
while (resq) {
- label_miss = NEW_LABEL(line);
- label_hit = NEW_LABEL(line);
+ label_miss = NEW_LABEL(nd_line(node));
+ label_hit = NEW_LABEL(nd_line(node));
narg = resq->nd_args;
if (narg) {
switch (nd_type(narg)) {
case NODE_ARRAY:
while (narg) {
- ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
COMPILE(ret, "rescue arg", narg->nd_head);
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
- ADD_INSNL(ret, line, branchif, label_hit);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
narg = narg->nd_next;
}
break;
case NODE_SPLAT:
case NODE_ARGSCAT:
case NODE_ARGSPUSH:
- ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
COMPILE(ret, "rescue/cond splat", narg);
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
- ADD_INSNL(ret, line, branchif, label_hit);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
break;
default:
- UNKNOWN_NODE("NODE_RESBODY", narg);
+ rb_bug("NODE_RESBODY: unknown node (%s)",
+ ruby_node_name(nd_type(narg)));
}
}
else {
- ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
- ADD_INSN1(ret, line, putobject, rb_eStandardError);
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
- ADD_INSNL(ret, line, branchif, label_hit);
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN1(ret, nd_line(node), putobject, rb_eStandardError);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ ADD_INSNL(ret, nd_line(node), branchif, label_hit);
}
- ADD_INSNL(ret, line, jump, label_miss);
+ ADD_INSNL(ret, nd_line(node), jump, label_miss);
ADD_LABEL(ret, label_hit);
COMPILE(ret, "resbody body", resq->nd_body);
- if (ISEQ_COMPILE_DATA(iseq)->option->tailcall_optimization) {
- ADD_INSN(ret, line, nop);
+ if (iseq->compile_data->option->tailcall_optimization) {
+ ADD_INSN(ret, nd_line(node), nop);
}
- ADD_INSN(ret, line, leave);
+ ADD_INSN(ret, nd_line(node), leave);
ADD_LABEL(ret, label_miss);
resq = resq->nd_head;
}
@@ -4371,12 +3784,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_ENSURE:{
DECL_ANCHOR(ensr);
- const rb_iseq_t *ensure = NEW_CHILD_ISEQ(node->nd_ensr,
- rb_str_concat(rb_str_new2 ("ensure in "), iseq->body->location.label),
- ISEQ_TYPE_ENSURE, line);
- LABEL *lstart = NEW_LABEL(line);
- LABEL *lend = NEW_LABEL(line);
- LABEL *lcont = NEW_LABEL(line);
+ VALUE ensure = NEW_CHILD_ISEQVAL(node->nd_ensr,
+ rb_str_concat(rb_str_new2
+ ("ensure in "),
+ iseq->location.label),
+ ISEQ_TYPE_ENSURE, nd_line(node));
+ LABEL *lstart = NEW_LABEL(nd_line(node));
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lcont = NEW_LABEL(nd_line(node));
struct ensure_range er;
struct iseq_compile_data_ensure_node_stack enl;
struct ensure_range *erange;
@@ -4393,39 +3808,39 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE_(ret, "ensure head", node->nd_head, poped);
ADD_LABEL(ret, lend);
if (ensr->anchor.next == 0) {
- ADD_INSN(ret, line, nop);
+ ADD_INSN(ret, nd_line(node), nop);
}
else {
ADD_SEQ(ret, ensr);
}
ADD_LABEL(ret, lcont);
- erange = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack->erange;
+ erange = iseq->compile_data->ensure_node_stack->erange;
while (erange) {
ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, erange->begin, erange->end,
ensure, lcont);
erange = erange->next;
}
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl.prev;
+ iseq->compile_data->ensure_node_stack = enl.prev;
break;
}
case NODE_AND:
case NODE_OR:{
- LABEL *end_label = NEW_LABEL(line);
+ LABEL *end_label = NEW_LABEL(nd_line(node));
COMPILE(ret, "nd_1st", node->nd_1st);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
if (type == NODE_AND) {
- ADD_INSNL(ret, line, branchunless, end_label);
+ ADD_INSNL(ret, nd_line(node), branchunless, end_label);
}
else {
- ADD_INSNL(ret, line, branchif, end_label);
+ ADD_INSNL(ret, nd_line(node), branchif, end_label);
}
if (!poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
COMPILE_(ret, "nd_2nd", node->nd_2nd, poped);
ADD_LABEL(ret, end_label);
@@ -4439,15 +3854,15 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_LASGN:{
ID id = node->nd_vid;
- int idx = iseq->body->local_iseq->body->local_size - get_local_var_idx(iseq, id);
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
- debugs("lvar: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
+ debugs("lvar: %s idx: %d\n", rb_id2name(id), idx);
COMPILE(ret, "rvalue", node->nd_value);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN2(ret, line, setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
break;
}
@@ -4455,28 +3870,28 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_DASGN_CURR:{
int idx, lv, ls;
COMPILE(ret, "dvalue", node->nd_value);
- debugi("dassn id", rb_id2str(node->nd_vid) ? node->nd_vid : '*');
+ debugp_param("dassn id", rb_str_new2(rb_id2name(node->nd_vid) ? rb_id2name(node->nd_vid) : "*"));
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- rb_compile_bug_str(ERROR_ARGS "NODE_DASGN(_CURR): unknown id (%"PRIsVALUE")", rb_id2str(node->nd_vid));
+ rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
}
- ADD_INSN2(ret, line, setlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
break;
}
case NODE_GASGN:{
COMPILE(ret, "lvalue", node->nd_value);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN1(ret, line, setglobal,
+ ADD_INSN1(ret, nd_line(node), setglobal,
((VALUE)node->nd_entry | 1));
break;
}
@@ -4484,44 +3899,43 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_IASGN2:{
COMPILE(ret, "lvalue", node->nd_value);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN2(ret, line, setinstancevariable,
- ID2SYM(node->nd_vid), INT2FIX(iseq->body->is_size++));
+ ADD_INSN2(ret, nd_line(node), setinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->ic_size++));
break;
}
case NODE_CDECL:{
COMPILE(ret, "lvalue", node->nd_value);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
if (node->nd_vid) {
- ADD_INSN1(ret, line, putspecialobject,
+ ADD_INSN1(ret, nd_line(node), putspecialobject,
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
- ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_vid));
}
else {
compile_cpath(ret, iseq, node->nd_else);
- ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_else->nd_mid));
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(node->nd_else->nd_mid));
}
break;
}
case NODE_CVASGN:{
COMPILE(ret, "cvasgn val", node->nd_value);
if (!poped) {
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN1(ret, line, setclassvariable,
+ ADD_INSN1(ret, nd_line(node), setclassvariable,
ID2SYM(node->nd_vid));
break;
}
case NODE_OP_ASGN1: {
DECL_ANCHOR(args);
VALUE argc;
- unsigned int flag = 0;
- unsigned int asgnflag = 0;
+ VALUE flag = 0;
ID id = node->nd_mid;
int boff = 0;
@@ -4549,9 +3963,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
- asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
+ COMPILE(ret, "NODE_OP_ASGN1 recv", node->nd_recv);
switch (nd_type(node->nd_args->nd_head)) {
case NODE_ZARRAY:
argc = INT2FIX(0);
@@ -4560,12 +3974,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
boff = 1;
default:
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag);
ADD_SEQ(ret, args);
}
- ADD_INSN1(ret, line, dupn, FIXNUM_INC(argc, 1 + boff));
- ADD_SEND_WITH_FLAG(ret, line, idAREF, argc, INT2FIX(flag));
- flag |= asgnflag;
+ ADD_INSN1(ret, nd_line(node), dupn, FIXNUM_INC(argc, 1 + boff));
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idAREF), argc, Qfalse, LONG2FIX(flag));
if (id == 0 || id == 1) {
/* 0: or, 1: and
@@ -4577,91 +3990,92 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
nil
end
*/
- LABEL *label = NEW_LABEL(line);
- LABEL *lfin = NEW_LABEL(line);
+ LABEL *label = NEW_LABEL(nd_line(node));
+ LABEL *lfin = NEW_LABEL(nd_line(node));
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
if (id == 0) {
/* or */
- ADD_INSNL(ret, line, branchif, label);
+ ADD_INSNL(ret, nd_line(node), branchif, label);
}
else {
/* and */
- ADD_INSNL(ret, line, branchunless, label);
+ ADD_INSNL(ret, nd_line(node), branchunless, label);
}
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
if (!poped) {
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
}
if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line, newarray, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
if (boff > 0) {
- ADD_INSN1(ret, line, dupn, INT2FIX(3));
- ADD_INSN(ret, line, swap);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
}
- ADD_INSN(ret, line, concatarray);
+ ADD_INSN(ret, nd_line(node), concatarray);
if (boff > 0) {
- ADD_INSN1(ret, line, setn, INT2FIX(3));
- ADD_INSN(ret, line, pop);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
- ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ argc, Qfalse, LONG2FIX(flag));
}
else {
if (boff > 0)
- ADD_INSN(ret, line, swap);
- ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
}
- ADD_INSN(ret, line, pop);
- ADD_INSNL(ret, line, jump, lfin);
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
ADD_LABEL(ret, label);
if (!poped) {
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
}
- ADD_INSN1(ret, line, adjuststack, FIXNUM_INC(argc, 2+boff));
+ ADD_INSN1(ret, nd_line(node), adjuststack, FIXNUM_INC(argc, 2+boff));
ADD_LABEL(ret, lfin);
}
else {
COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
- ADD_SEND(ret, line, id, INT2FIX(1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(id), INT2FIX(1));
if (!poped) {
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
}
if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line, newarray, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
if (boff > 0) {
- ADD_INSN1(ret, line, dupn, INT2FIX(3));
- ADD_INSN(ret, line, swap);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
}
- ADD_INSN(ret, line, concatarray);
+ ADD_INSN(ret, nd_line(node), concatarray);
if (boff > 0) {
- ADD_INSN1(ret, line, setn, INT2FIX(3));
- ADD_INSN(ret, line, pop);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(3));
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
- ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ argc, Qfalse, LONG2FIX(flag));
}
else {
if (boff > 0)
- ADD_INSN(ret, line, swap);
- ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(idASET),
+ FIXNUM_INC(argc, 1), Qfalse, LONG2FIX(flag));
}
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_OP_ASGN2:{
ID atype = node->nd_next->nd_mid;
- ID vid = node->nd_next->nd_vid, aid = rb_id_attrset(vid);
- VALUE asgnflag;
- LABEL *lfin = NEW_LABEL(line);
- LABEL *lcfin = NEW_LABEL(line);
- LABEL *lskip = 0;
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+ LABEL *lcfin = NEW_LABEL(nd_line(node));
/*
class C; attr_accessor :c; end
r = C.new
@@ -4704,55 +4118,48 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
- asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
- if (node->nd_next->nd_aid) {
- lskip = NEW_LABEL(line);
- ADD_INSN(ret, line, dup);
- ADD_INSNL(ret, line, branchnil, lskip);
- }
- ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, vid, INT2FIX(0));
+ COMPILE(ret, "NODE_OP_ASGN2#recv", node->nd_recv);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_vid),
+ INT2FIX(0));
if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
if (atype == 0) {
- ADD_INSNL(ret, line, branchif, lcfin);
+ ADD_INSNL(ret, nd_line(node), branchif, lcfin);
}
else {
- ADD_INSNL(ret, line, branchunless, lcfin);
+ ADD_INSNL(ret, nd_line(node), branchunless, lcfin);
}
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
- ADD_INSN(ret, line, swap);
- ADD_INSN1(ret, line, topn, INT2FIX(1));
- ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
- ADD_INSNL(ret, line, jump, lfin);
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
+ INT2FIX(1));
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
ADD_LABEL(ret, lcfin);
- ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, nd_line(node), swap);
ADD_LABEL(ret, lfin);
- ADD_INSN(ret, line, pop);
- if (lskip) {
- ADD_LABEL(ret, lskip);
- }
+ ADD_INSN(ret, nd_line(node), pop);
if (poped) {
/* we can apply more optimize */
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
else {
COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
- ADD_SEND(ret, line, atype, INT2FIX(1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_mid),
+ INT2FIX(1));
if (!poped) {
- ADD_INSN(ret, line, swap);
- ADD_INSN1(ret, line, topn, INT2FIX(1));
- }
- ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
- ADD_INSN(ret, line, pop);
- if (lskip) {
- ADD_LABEL(ret, lskip);
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
}
+ ADD_SEND(ret, nd_line(node), ID2SYM(node->nd_next->nd_aid),
+ INT2FIX(1));
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
@@ -4763,69 +4170,70 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
switch (nd_type(node->nd_head)) {
case NODE_COLON3:
- ADD_INSN1(ret, line, putobject, rb_cObject);
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
break;
case NODE_COLON2:
COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
break;
default:
- COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
- ruby_node_name(nd_type(node->nd_head)));
- debug_node_end();
+ do {
+ COMPILE_ERROR((ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+ ruby_node_name(nd_type(node->nd_head))));
+ } while (0);
return COMPILE_NG;
}
mid = node->nd_head->nd_mid;
/* cref */
if (node->nd_aid == 0) {
- lassign = NEW_LABEL(line);
- ADD_INSN(ret, line, dup); /* cref cref */
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_CONST),
+ lassign = NEW_LABEL(nd_line(node));
+ ADD_INSN(ret, nd_line(node), dup); /* cref cref */
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
ID2SYM(mid), Qfalse); /* cref bool */
- ADD_INSNL(ret, line, branchunless, lassign); /* cref */
+ ADD_INSNL(ret, nd_line(node), branchunless, lassign); /* cref */
}
- ADD_INSN(ret, line, dup); /* cref cref */
- ADD_INSN1(ret, line, getconstant, ID2SYM(mid)); /* cref obj */
+ ADD_INSN(ret, nd_line(node), dup); /* cref cref */
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(mid)); /* cref obj */
if (node->nd_aid == 0 || node->nd_aid == 1) {
- lfin = NEW_LABEL(line);
- if (!poped) ADD_INSN(ret, line, dup); /* cref [obj] obj */
+ lfin = NEW_LABEL(nd_line(node));
+ if (!poped) ADD_INSN(ret, nd_line(node), dup); /* cref [obj] obj */
if (node->nd_aid == 0)
- ADD_INSNL(ret, line, branchif, lfin);
+ ADD_INSNL(ret, nd_line(node), branchif, lfin);
else
- ADD_INSNL(ret, line, branchunless, lfin);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
/* cref [obj] */
- if (!poped) ADD_INSN(ret, line, pop); /* cref */
+ if (!poped) ADD_INSN(ret, nd_line(node), pop); /* cref */
if (lassign) ADD_LABEL(ret, lassign);
COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
/* cref value */
if (poped)
- ADD_INSN1(ret, line, topn, INT2FIX(1)); /* cref value cref */
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1)); /* cref value cref */
else {
- ADD_INSN1(ret, line, dupn, INT2FIX(2)); /* cref value cref value */
- ADD_INSN(ret, line, swap); /* cref value value cref */
+ ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(2)); /* cref value cref value */
+ ADD_INSN(ret, nd_line(node), swap); /* cref value value cref */
}
- ADD_INSN1(ret, line, setconstant, ID2SYM(mid)); /* cref [value] */
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(mid)); /* cref [value] */
ADD_LABEL(ret, lfin); /* cref [value] */
- if (!poped) ADD_INSN(ret, line, swap); /* [value] cref */
- ADD_INSN(ret, line, pop); /* [value] */
+ if (!poped) ADD_INSN(ret, nd_line(node), swap); /* [value] cref */
+ ADD_INSN(ret, nd_line(node), pop); /* [value] */
}
else {
COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
/* cref obj value */
- ADD_CALL(ret, line, node->nd_aid, INT2FIX(1));
+ ADD_CALL(ret, nd_line(node), ID2SYM(node->nd_aid), INT2FIX(1));
/* cref value */
- ADD_INSN(ret, line, swap); /* value cref */
+ ADD_INSN(ret, nd_line(node), swap); /* value cref */
if (!poped) {
- ADD_INSN1(ret, line, topn, INT2FIX(1)); /* value cref value */
- ADD_INSN(ret, line, swap); /* value value cref */
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1)); /* value cref value */
+ ADD_INSN(ret, nd_line(node), swap); /* value value cref */
}
- ADD_INSN1(ret, line, setconstant, ID2SYM(mid));
+ ADD_INSN1(ret, nd_line(node), setconstant, ID2SYM(mid));
}
break;
}
case NODE_OP_ASGN_AND:
case NODE_OP_ASGN_OR:{
- LABEL *lfin = NEW_LABEL(line);
+ LABEL *lfin = NEW_LABEL(nd_line(node));
LABEL *lassign;
if (nd_type(node) == NODE_OP_ASGN_OR) {
@@ -4835,71 +4243,36 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
lassign = lfinish[1];
if (!lassign) {
- lassign = NEW_LABEL(line);
+ lassign = NEW_LABEL(nd_line(node));
}
- ADD_INSNL(ret, line, branchunless, lassign);
+ ADD_INSNL(ret, nd_line(node), branchunless, lassign);
}
else {
- lassign = NEW_LABEL(line);
+ lassign = NEW_LABEL(nd_line(node));
}
COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head);
- ADD_INSN(ret, line, dup);
+ ADD_INSN(ret, nd_line(node), dup);
if (nd_type(node) == NODE_OP_ASGN_AND) {
- ADD_INSNL(ret, line, branchunless, lfin);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
}
else {
- ADD_INSNL(ret, line, branchif, lfin);
+ ADD_INSNL(ret, nd_line(node), branchif, lfin);
}
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
ADD_LABEL(ret, lassign);
COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value);
ADD_LABEL(ret, lfin);
if (poped) {
/* we can apply more optimize */
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_CALL:
- /* optimization shortcut
- * "literal".freeze -> opt_str_freeze("literal")
- */
- if (node->nd_recv && nd_type(node->nd_recv) == NODE_STR &&
- node->nd_mid == idFreeze && node->nd_args == NULL &&
- ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = rb_fstring(node->nd_recv->nd_lit);
- iseq_add_mark_object(iseq, str);
- ADD_INSN1(ret, line, opt_str_freeze, str);
- if (poped) {
- ADD_INSN(ret, line, pop);
- }
- break;
- }
- /* optimization shortcut
- * obj["literal"] -> opt_aref_with(obj, "literal")
- */
- if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
- nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 1 &&
- nd_type(node->nd_args->nd_head) == NODE_STR &&
- ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
- node->nd_args->nd_head->nd_lit = str;
- COMPILE(ret, "recv", node->nd_recv);
- ADD_INSN3(ret, line, opt_aref_with,
- new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
- NULL/* CALL_CACHE */, str);
- if (poped) {
- ADD_INSN(ret, line, pop);
- }
- break;
- }
- case NODE_QCALL:
case NODE_FCALL:
case NODE_VCALL:{ /* VCALL: variable or call */
/*
@@ -4909,13 +4282,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
*/
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
- LABEL *lskip = 0;
ID mid = node->nd_mid;
VALUE argc;
- unsigned int flag = 0;
- struct rb_call_info_kw_arg *keywords = NULL;
- const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
+ VALUE flag = 0;
+ VALUE parent_block = iseq->compile_data->current_block;
+ iseq->compile_data->current_block = Qfalse;
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
@@ -4928,11 +4299,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
CONST_ID(id_answer, "the_answer_to_life_the_universe_and_everything");
if (mid == id_bitblt) {
- ADD_INSN(ret, line, bitblt);
+ ADD_INSN(ret, nd_line(node), bitblt);
break;
}
else if (mid == id_answer) {
- ADD_INSN(ret, line, answer);
+ ADD_INSN(ret, nd_line(node), answer);
break;
}
}
@@ -4948,20 +4319,20 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
(mid == goto_id || mid == label_id)) {
LABEL *label;
st_data_t data;
- st_table *labels_table = ISEQ_COMPILE_DATA(iseq)->labels_table;
+ st_table *labels_table = iseq->compile_data->labels_table;
ID label_name;
if (!labels_table) {
labels_table = st_init_numtable();
- ISEQ_COMPILE_DATA(iseq)->labels_table = labels_table;
+ iseq->compile_data->labels_table = labels_table;
}
if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
label_name = SYM2ID(node->nd_args->nd_head->nd_lit);
if (!st_lookup(labels_table, (st_data_t)label_name, &data)) {
- label = NEW_LABEL(line);
- label->position = line;
+ label = NEW_LABEL(nd_line(node));
+ label->position = nd_line(node);
st_insert(labels_table, (st_data_t)label_name, (st_data_t)label);
}
else {
@@ -4969,12 +4340,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "invalid goto/label format");
+ COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
}
if (mid == goto_id) {
- ADD_INSNL(ret, line, jump, label);
+ ADD_INSNL(ret, nd_line(node), jump, label);
}
else {
ADD_LABEL(ret, label);
@@ -4984,21 +4355,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
#endif
/* receiver */
- if (type == NODE_CALL || type == NODE_QCALL) {
+ if (type == NODE_CALL) {
COMPILE(recv, "recv", node->nd_recv);
- if (type == NODE_QCALL) {
- lskip = NEW_LABEL(line);
- ADD_INSN(recv, line, dup);
- ADD_INSNL(recv, line, branchnil, lskip);
- }
}
else if (type == NODE_FCALL || type == NODE_VCALL) {
- ADD_CALL_RECEIVER(recv, line);
+ ADD_CALL_RECEIVER(recv, nd_line(node));
}
/* args */
if (nd_type(node) != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
}
else {
argc = INT2FIX(0);
@@ -5018,145 +4384,105 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
flag |= VM_CALL_FCALL;
}
- ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(mid),
+ argc, parent_block, LONG2FIX(flag));
- if (lskip) {
- ADD_LABEL(ret, lskip);
- }
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_SUPER:
case NODE_ZSUPER:{
DECL_ANCHOR(args);
- int argc;
- unsigned int flag = 0;
- struct rb_call_info_kw_arg *keywords = NULL;
- const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
+ VALUE argc;
+ VALUE flag = 0;
+ VALUE parent_block = iseq->compile_data->current_block;
INIT_ANCHOR(args);
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
+ iseq->compile_data->current_block = Qfalse;
if (nd_type(node) == NODE_SUPER) {
- VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- argc = FIX2INT(vargc);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
}
else {
/* NODE_ZSUPER */
int i;
- const rb_iseq_t *liseq = iseq->body->local_iseq;
+ rb_iseq_t *liseq = iseq->local_iseq;
int lvar_level = get_lvar_level(iseq);
- argc = liseq->body->param.lead_num;
+ argc = INT2FIX(liseq->argc);
/* normal arguments */
- for (i = 0; i < liseq->body->param.lead_num; i++) {
- int idx = liseq->body->local_size - i;
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
-
- if (liseq->body->param.flags.has_opt) {
- /* optional arguments */
- int j;
- for (j = 0; j < liseq->body->param.opt_num; j++) {
- int idx = liseq->body->local_size - (i + j);
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- i += j;
- argc = i;
- }
- if (liseq->body->param.flags.has_rest) {
- /* rest argument */
- int idx = liseq->body->local_size - liseq->body->param.rest_start;
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- argc = liseq->body->param.rest_start + 1;
- flag |= VM_CALL_ARGS_SPLAT;
+ for (i = 0; i < liseq->argc; i++) {
+ int idx = liseq->local_size - i;
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- if (liseq->body->param.flags.has_post) {
- /* post arguments */
- int post_len = liseq->body->param.post_num;
- int post_start = liseq->body->param.post_start;
- if (liseq->body->param.flags.has_rest) {
+ if (!liseq->arg_simple) {
+ if (liseq->arg_opts) {
+ /* optional arguments */
int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->body->local_size - (post_start + j);
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ for (j = 0; j < liseq->arg_opts - 1; j++) {
+ int idx = liseq->local_size - (i + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- ADD_INSN1(args, line, newarray, INT2FIX(j));
- ADD_INSN (args, line, concatarray);
- /* argc is settled at above */
+ i += j;
+ argc = INT2FIX(i);
}
- else {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->body->local_size - (post_start + j);
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- argc = post_len + post_start;
- }
- }
- if (liseq->body->param.flags.has_kw) { /* TODO: support keywords */
- int local_size = liseq->body->local_size;
- argc++;
+ if (liseq->arg_rest != -1) {
+ /* rest argument */
+ int idx = liseq->local_size - liseq->arg_rest;
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ argc = INT2FIX(liseq->arg_rest + 1);
+ flag |= VM_CALL_ARGS_SPLAT;
+ }
- ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ if (liseq->arg_post_len) {
+ /* post arguments */
+ int post_len = liseq->arg_post_len;
+ int post_start = liseq->arg_post_start;
- if (liseq->body->param.flags.has_kwrest) {
- ADD_INSN2(args, line, getlocal, INT2FIX(liseq->body->local_size - liseq->body->param.keyword->rest_start), INT2FIX(lvar_level));
- ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
- }
- else {
- ADD_INSN1(args, line, newhash, INT2FIX(0));
- }
- for (i = 0; i < liseq->body->param.keyword->num; ++i) {
- ID id = liseq->body->param.keyword->table[i];
- int idx = local_size - get_local_var_idx(liseq, id);
- ADD_INSN1(args, line, putobject, ID2SYM(id));
- ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
- }
- ADD_SEND(args, line, id_core_hash_merge_ptr, INT2FIX(i * 2 + 1));
- if (liseq->body->param.flags.has_rest) {
- ADD_INSN1(args, line, newarray, INT2FIX(1));
- ADD_INSN (args, line, concatarray);
- --argc;
- }
- }
- else if (liseq->body->param.flags.has_kwrest) {
- ADD_INSN2(args, line, getlocal, INT2FIX(liseq->body->local_size - liseq->body->param.keyword->rest_start), INT2FIX(lvar_level));
- ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
- if (liseq->body->param.flags.has_rest) {
- ADD_INSN1(args, line, newarray, INT2FIX(1));
- ADD_INSN (args, line, concatarray);
- }
- else {
- argc++;
+ if (liseq->arg_rest != -1) {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ ADD_INSN1(args, nd_line(node), newarray, INT2FIX(j));
+ ADD_INSN (args, nd_line(node), concatarray);
+ /* argc is setteled at above */
+ }
+ else {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ argc = INT2FIX(post_len + post_start);
+ }
}
}
}
/* dummy receiver */
- ADD_INSN1(ret, line, putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
+ ADD_INSN1(ret, nd_line(node), putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
ADD_SEQ(ret, args);
- ADD_INSN3(ret, line, invokesuper,
- new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | VM_CALL_FCALL, keywords, parent_block != NULL),
- Qnil, /* CALL_CACHE */
- parent_block);
+ ADD_INSN1(ret, nd_line(node), invokesuper, new_callinfo(iseq, 0, FIX2INT(argc), parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_ARRAY:{
- compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, NULL, poped);
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, poped);
break;
}
case NODE_ZARRAY:{
if (!poped) {
- ADD_INSN1(ret, line, newarray, INT2FIX(0));
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(0));
}
break;
}
@@ -5166,9 +4492,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "values item", n->nd_head);
n = n->nd_next;
}
- ADD_INSN1(ret, line, newarray, INT2FIX(node->nd_alen));
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(node->nd_alen));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
@@ -5184,16 +4510,15 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
case NODE_ZARRAY:
- ADD_INSN1(ret, line, newhash, INT2FIX(0));
+ ADD_INSN1(ret, nd_line(node), newhash, INT2FIX(0));
break;
default:
- rb_compile_bug_str(ERROR_ARGS_AT(node->nd_head) "can't make hash with this node: %s",
- ruby_node_name(type));
+ rb_bug("can't make hash with this node: %s", ruby_node_name(type));
}
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
@@ -5201,34 +4526,34 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
rb_iseq_t *is = iseq;
if (is) {
- if (is->body->type == ISEQ_TYPE_TOP) {
- COMPILE_ERROR(ERROR_ARGS "Invalid return");
+ if (is->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid return"));
}
else {
LABEL *splabel = 0;
- if (is->body->type == ISEQ_TYPE_METHOD) {
+ if (is->type == ISEQ_TYPE_METHOD) {
splabel = NEW_LABEL(0);
ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, 0);
+ ADD_ADJUST(ret, nd_line(node), 0);
}
COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
- if (is->body->type == ISEQ_TYPE_METHOD) {
+ if (is->type == ISEQ_TYPE_METHOD) {
add_ensure_iseq(ret, iseq, 1);
- ADD_TRACE(ret, line, RUBY_EVENT_RETURN);
- ADD_INSN(ret, line, leave);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
+ ADD_INSN(ret, nd_line(node), leave);
ADD_ADJUST_RESTORE(ret, splabel);
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
else {
- ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETURN));
+ ADD_INSN1(ret, nd_line(node), throw, INT2FIX(0x01) /* TAG_RETURN */ );
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
}
}
@@ -5238,38 +4563,35 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_YIELD:{
DECL_ANCHOR(args);
VALUE argc;
- unsigned int flag = 0;
- struct rb_call_info_kw_arg *keywords = NULL;
+ VALUE flag = 0;
INIT_ANCHOR(args);
- if (iseq->body->type == ISEQ_TYPE_TOP) {
- COMPILE_ERROR(ERROR_ARGS "Invalid yield");
- debug_node_end();
- return COMPILE_NG;
+ if (iseq->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
}
if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag, &keywords);
+ argc = setup_args(iseq, args, node->nd_head, &flag);
}
else {
argc = INT2FIX(0);
}
ADD_SEQ(ret, args);
- ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), flag, keywords, FALSE));
+ ADD_INSN1(ret, nd_line(node), invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_LVAR:{
if (!poped) {
ID id = node->nd_vid;
- int idx = iseq->body->local_iseq->body->local_size - get_local_var_idx(iseq, id);
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
- debugs("id: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
- ADD_INSN2(ret, line, getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ debugs("id: %s idx: %d\n", rb_id2name(id), idx);
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
}
break;
}
@@ -5279,71 +4601,67 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- rb_compile_bug_str(ERROR_ARGS "unknown dvar (%"PRIsVALUE")", rb_id2str(node->nd_vid));
+ rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
}
- ADD_INSN2(ret, line, getlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(ls - idx), INT2FIX(lv));
}
break;
}
case NODE_GVAR:{
- ADD_INSN1(ret, line, getglobal,
+ ADD_INSN1(ret, nd_line(node), getglobal,
((VALUE)node->nd_entry | 1));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_IVAR:{
debugi("nd_vid", node->nd_vid);
if (!poped) {
- ADD_INSN2(ret, line, getinstancevariable,
- ID2SYM(node->nd_vid), INT2FIX(iseq->body->is_size++));
+ ADD_INSN2(ret, nd_line(node), getinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->ic_size++));
}
break;
}
case NODE_CONST:{
debugi("nd_vid", node->nd_vid);
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ if (iseq->compile_data->option->inline_const_cache) {
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
- ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
- ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
else {
- ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_vid));
}
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_CVAR:{
if (!poped) {
- ADD_INSN1(ret, line, getclassvariable,
+ ADD_INSN1(ret, nd_line(node), getclassvariable,
ID2SYM(node->nd_vid));
}
break;
}
case NODE_NTH_REF:{
if (!poped) {
- if (!node->nd_nth) {
- ADD_INSN(ret, line, putnil);
- break;
- }
- ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
+ ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
INT2FIX(node->nd_nth << 1));
}
break;
}
case NODE_BACK_REF:{
if (!poped) {
- ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
+ ADD_INSN2(ret, nd_line(node), getspecial, INT2FIX(1) /* '~' */,
INT2FIX(0x01 | (node->nd_nth << 1)));
}
break;
@@ -5358,8 +4676,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(val);
switch (nd_type(node)) {
case NODE_MATCH:
- ADD_INSN1(recv, line, putobject, node->nd_lit);
- ADD_INSN2(val, line, getspecial, INT2FIX(0),
+ ADD_INSN1(recv, nd_line(node), putobject, node->nd_lit);
+ ADD_INSN2(val, nd_line(node), getspecial, INT2FIX(0),
INT2FIX(0));
break;
case NODE_MATCH2:
@@ -5372,58 +4690,44 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
- if (ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
+ if (iseq->compile_data->option->specialized_instruction) {
/* TODO: detect by node */
if (recv->last == recv->anchor.next &&
INSN_OF(recv->last) == BIN(putobject) &&
nd_type(node) == NODE_MATCH2) {
ADD_SEQ(ret, val);
- ADD_INSN1(ret, line, opt_regexpmatch1,
+ ADD_INSN1(ret, nd_line(node), opt_regexpmatch1,
OPERAND_AT(recv->last, 0));
}
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, val);
- ADD_INSN2(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, NULL, FALSE), Qnil);
+ ADD_INSN(ret, nd_line(node), opt_regexpmatch2);
}
}
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, val);
- ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idEqTilde), INT2FIX(1));
}
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_LIT:{
debugp_param("lit", node->nd_lit);
if (!poped) {
- ADD_INSN1(ret, line, putobject, node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
}
break;
}
case NODE_STR:{
debugp_param("nd_lit", node->nd_lit);
if (!poped) {
- node->nd_lit = rb_fstring(node->nd_lit);
- if (!ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
- ADD_INSN1(ret, line, putstring, node->nd_lit);
- }
- else {
- if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
- VALUE debug_info = rb_ary_new_from_args(2, iseq->body->location.path, INT2FIX(line));
- VALUE str = rb_str_dup(node->nd_lit);
- rb_ivar_set(str, id_debug_created_info, rb_obj_freeze(debug_info));
- ADD_INSN1(ret, line, putobject, rb_obj_freeze(str));
- iseq_add_mark_object_compile_time(iseq, str);
- }
- else {
- ADD_INSN1(ret, line, putobject, node->nd_lit);
- }
- }
+ OBJ_FREEZE(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putstring, node->nd_lit);
}
break;
}
@@ -5431,38 +4735,28 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
compile_dstr(iseq, ret, node);
if (poped) {
- ADD_INSN(ret, line, pop);
- }
- else {
- if (ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
- VALUE debug_info = Qnil;
- if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
- debug_info = rb_ary_new_from_args(2, iseq->body->location.path, INT2FIX(line));
- iseq_add_mark_object_compile_time(iseq, rb_obj_freeze(debug_info));
- }
- ADD_INSN1(ret, line, freezestring, debug_info);
- }
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_XSTR:{
- node->nd_lit = rb_fstring(node->nd_lit);
- ADD_CALL_RECEIVER(ret, line);
- ADD_INSN1(ret, line, putobject, node->nd_lit);
- ADD_CALL(ret, line, idBackquote, INT2FIX(1));
+ OBJ_FREEZE(node->nd_lit);
+ ADD_CALL_RECEIVER(ret, nd_line(node));
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_DXSTR:{
- ADD_CALL_RECEIVER(ret, line);
+ ADD_CALL_RECEIVER(ret, nd_line(node));
compile_dstr(iseq, ret, node);
- ADD_CALL(ret, line, idBackquote, INT2FIX(1));
+ ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
@@ -5470,10 +4764,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "nd_body", node->nd_body);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
else {
- ADD_INSN(ret, line, tostring);
+ ADD_INSN(ret, nd_line(node), tostring);
}
break;
}
@@ -5481,188 +4775,199 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
compile_dregx(iseq, ret, node);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_DREGX_ONCE:{
- int ic_index = iseq->body->is_size++;
- NODE *dregx_node = NEW_NODE(NODE_DREGX, node->u1.value, node->u2.value, node->u3.value);
- NODE *block_node = NEW_NODE(NODE_SCOPE, 0, dregx_node, 0);
- const rb_iseq_t * block_iseq = NEW_CHILD_ISEQ(block_node, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ /* TODO: once? */
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
- ADD_INSN2(ret, line, once, block_iseq, INT2FIX(ic_index));
+ ADD_INSN2(ret, nd_line(node), onceinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
+
+ compile_dregx(iseq, ret, node);
+
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_ARGSCAT:{
if (poped) {
COMPILE(ret, "argscat head", node->nd_head);
- ADD_INSN1(ret, line, splatarray, Qfalse);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
COMPILE(ret, "argscat body", node->nd_body);
- ADD_INSN1(ret, line, splatarray, Qfalse);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
}
else {
COMPILE(ret, "argscat head", node->nd_head);
COMPILE(ret, "argscat body", node->nd_body);
- ADD_INSN(ret, line, concatarray);
+ ADD_INSN(ret, nd_line(node), concatarray);
}
break;
}
case NODE_ARGSPUSH:{
if (poped) {
COMPILE(ret, "arsgpush head", node->nd_head);
- ADD_INSN1(ret, line, splatarray, Qfalse);
- ADD_INSN(ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN(ret, nd_line(node), pop);
COMPILE_(ret, "argspush body", node->nd_body, poped);
}
else {
COMPILE(ret, "arsgpush head", node->nd_head);
COMPILE_(ret, "argspush body", node->nd_body, poped);
- ADD_INSN1(ret, line, newarray, INT2FIX(1));
- ADD_INSN(ret, line, concatarray);
+ ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
+ ADD_INSN(ret, nd_line(node), concatarray);
}
break;
}
case NODE_SPLAT:{
COMPILE(ret, "splat", node->nd_head);
- ADD_INSN1(ret, line, splatarray, Qtrue);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qtrue);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_DEFN:{
- const rb_iseq_t *method_iseq = NEW_ISEQ(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_str_dup(rb_id2str(node->nd_mid)),
+ ISEQ_TYPE_METHOD, nd_line(node));
- debugp_param("defn/iseq", rb_iseqw_new(method_iseq));
+ debugp_param("defn/iseq", iseqval);
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, line, putiseq, method_iseq);
- ADD_SEND (ret, line, id_core_define_method, INT2FIX(2));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_method), INT2FIX(3));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
+ debugp_param("defn", iseqval);
break;
}
case NODE_DEFS:{
- const rb_iseq_t * singleton_method = NEW_ISEQ(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_str_dup(rb_id2str(node->nd_mid)),
+ ISEQ_TYPE_METHOD, nd_line(node));
- debugp_param("defs/iseq", rb_iseqw_new(singleton_method));
+ debugp_param("defs/iseq", iseqval);
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
COMPILE(ret, "defs: recv", node->nd_recv);
- ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, line, putiseq, singleton_method);
- ADD_SEND (ret, line, id_core_define_singleton_method, INT2FIX(3));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, nd_line(node), putiseq, iseqval);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_define_singleton_method), INT2FIX(3));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_ALIAS:{
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
COMPILE(ret, "alias arg1", node->u1.node);
COMPILE(ret, "alias arg2", node->u2.node);
- ADD_SEND(ret, line, id_core_set_method_alias, INT2FIX(3));
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_method_alias), INT2FIX(3));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_VALIAS:{
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putobject, ID2SYM(node->u1.id));
- ADD_INSN1(ret, line, putobject, ID2SYM(node->u2.id));
- ADD_SEND(ret, line, id_core_set_variable_alias, INT2FIX(2));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u1.id));
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u2.id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_set_variable_alias), INT2FIX(2));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_UNDEF:{
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
COMPILE(ret, "undef arg", node->u2.node);
- ADD_SEND(ret, line, id_core_undef_method, INT2FIX(2));
+ ADD_SEND(ret, nd_line(node), ID2SYM(id_core_undef_method), INT2FIX(2));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_CLASS:{
- const rb_iseq_t *class_iseq = NEW_CHILD_ISEQ(node->nd_body,
- rb_sprintf("<class:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS, line);
+ VALUE iseqval =
+ NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<class:%s>", rb_id2name(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, nd_line(node));
VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
int flags = VM_DEFINECLASS_TYPE_CLASS;
-
if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
if (node->nd_super) flags |= VM_DEFINECLASS_FLAG_HAS_SUPERCLASS;
COMPILE(ret, "super", node->nd_super);
- ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), class_iseq, INT2FIX(flags));
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_MODULE:{
- const rb_iseq_t *module_iseq = NEW_CHILD_ISEQ(node->nd_body,
- rb_sprintf("<module:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
- ISEQ_TYPE_CLASS, line);
+ VALUE iseqval = NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, nd_line(node));
+
VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
int flags = VM_DEFINECLASS_TYPE_MODULE;
-
if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
- ADD_INSN (ret, line, putnil); /* dummy */
- ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), module_iseq, INT2FIX(flags));
-
+ ADD_INSN (ret, nd_line(node), putnil); /* dummy */
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_SCLASS:{
ID singletonclass;
- const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_str_new2("singleton class"),
- ISEQ_TYPE_CLASS, line);
+ VALUE iseqval =
+ NEW_ISEQVAL(node->nd_body, rb_str_new2("singleton class"),
+ ISEQ_TYPE_CLASS, nd_line(node));
COMPILE(ret, "sclass#recv", node->nd_recv);
- ADD_INSN (ret, line, putnil);
+ ADD_INSN (ret, nd_line(node), putnil);
CONST_ID(singletonclass, "singletonclass");
- ADD_INSN3(ret, line, defineclass,
- ID2SYM(singletonclass), singleton_class,
+ ADD_INSN3(ret, nd_line(node), defineclass,
+ ID2SYM(singletonclass), iseqval,
INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_COLON2:{
if (rb_is_const_id(node->nd_mid)) {
/* constant */
- LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
DECL_ANCHOR(pref);
DECL_ANCHOR(body);
@@ -5671,17 +4976,17 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
INIT_ANCHOR(body);
compile_colon2(iseq, node, pref, body);
if (LIST_SIZE_ZERO(pref)) {
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
}
else {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
ADD_SEQ(ret, body);
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
}
@@ -5692,37 +4997,38 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
else {
/* function call */
- ADD_CALL_RECEIVER(ret, line);
+ ADD_CALL_RECEIVER(ret, nd_line(node));
COMPILE(ret, "colon2#nd_head", node->nd_head);
- ADD_CALL(ret, line, node->nd_mid, INT2FIX(1));
+ ADD_CALL(ret, nd_line(node), ID2SYM(node->nd_mid),
+ INT2FIX(1));
}
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_COLON3:{
- LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ int ic_index = iseq->ic_size++;
- debugi("colon3#nd_mid", node->nd_mid);
+ debugi("colon3#nd_mid", node->nd_mid);
/* add cache insn */
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
- ADD_INSN(ret, line, pop);
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, nd_line(node), getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
}
- ADD_INSN1(ret, line, putobject, rb_cObject);
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ ADD_INSN1(ret, nd_line(node), getconstant, ID2SYM(node->nd_mid));
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
@@ -5732,118 +5038,114 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
COMPILE(ret, "min", (NODE *) node->nd_beg);
COMPILE(ret, "max", (NODE *) node->nd_end);
if (poped) {
- ADD_INSN(ret, line, pop);
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
else {
- ADD_INSN1(ret, line, newrange, flag);
+ ADD_INSN1(ret, nd_line(node), newrange, flag);
}
break;
}
case NODE_FLIP2:
case NODE_FLIP3:{
- LABEL *lend = NEW_LABEL(line);
- LABEL *lfin = NEW_LABEL(line);
- LABEL *ltrue = NEW_LABEL(line);
- rb_iseq_t *local_iseq = iseq->body->local_iseq;
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ LABEL *lfin = NEW_LABEL(nd_line(node));
+ LABEL *ltrue = NEW_LABEL(nd_line(node));
+ struct iseq_compile_data *data = iseq->local_iseq->compile_data;
rb_num_t cnt;
VALUE key;
- cnt = ISEQ_FLIP_CNT_INCREMENT(local_iseq) + VM_SVAR_FLIPFLOP_START;
+ if (!data) data = iseq->compile_data;
+ cnt = data->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
key = INT2FIX(cnt);
- ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));
- ADD_INSNL(ret, line, branchif, lend);
+ ADD_INSN2(ret, nd_line(node), getspecial, key, INT2FIX(0));
+ ADD_INSNL(ret, nd_line(node), branchif, lend);
/* *flip == 0 */
COMPILE(ret, "flip2 beg", node->nd_beg);
- ADD_INSN(ret, line, dup);
- ADD_INSNL(ret, line, branchunless, lfin);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfin);
if (nd_type(node) == NODE_FLIP3) {
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, setspecial, key);
- ADD_INSNL(ret, line, jump, lfin);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
+ ADD_INSNL(ret, nd_line(node), jump, lfin);
}
else {
- ADD_INSN1(ret, line, setspecial, key);
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
}
/* *flip == 1 */
ADD_LABEL(ret, lend);
COMPILE(ret, "flip2 end", node->nd_end);
- ADD_INSNL(ret, line, branchunless, ltrue);
- ADD_INSN1(ret, line, putobject, Qfalse);
- ADD_INSN1(ret, line, setspecial, key);
+ ADD_INSNL(ret, nd_line(node), branchunless, ltrue);
+ ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
+ ADD_INSN1(ret, nd_line(node), setspecial, key);
ADD_LABEL(ret, ltrue);
- ADD_INSN1(ret, line, putobject, Qtrue);
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
ADD_LABEL(ret, lfin);
break;
}
case NODE_SELF:{
if (!poped) {
- ADD_INSN(ret, line, putself);
+ ADD_INSN(ret, nd_line(node), putself);
}
break;
}
case NODE_NIL:{
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
break;
}
case NODE_TRUE:{
if (!poped) {
- ADD_INSN1(ret, line, putobject, Qtrue);
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
}
break;
}
case NODE_FALSE:{
if (!poped) {
- ADD_INSN1(ret, line, putobject, Qfalse);
+ ADD_INSN1(ret, nd_line(node), putobject, Qfalse);
}
break;
}
case NODE_ERRINFO:{
if (!poped) {
- if (iseq->body->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
}
else {
- const rb_iseq_t *ip = iseq;
+ rb_iseq_t *ip = iseq;
int level = 0;
while (ip) {
- if (ip->body->type == ISEQ_TYPE_RESCUE) {
+ if (ip->type == ISEQ_TYPE_RESCUE) {
break;
}
- ip = ip->body->parent_iseq;
+ ip = ip->parent_iseq;
level++;
}
if (ip) {
- ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(level));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(level));
}
else {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
}
}
}
break;
}
case NODE_DEFINED:{
- if (poped) break;
- if (!node->nd_head) {
- VALUE str = rb_iseq_defined_string(DEFINED_NIL);
- ADD_INSN1(ret, nd_line(node), putobject, str);
- }
- else {
+ if (!poped) {
LABEL *lfinish[2];
- lfinish[0] = NEW_LABEL(line);
+ lfinish[0] = NEW_LABEL(nd_line(node));
lfinish[1] = 0;
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
- ADD_INSN(ret, line, swap);
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), swap);
+ ADD_INSN(ret, nd_line(node), pop);
if (lfinish[1]) {
ADD_LABEL(ret, lfinish[1]);
}
@@ -5852,182 +5154,144 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_POSTEXE:{
- /* compiled to:
- * ONCE{ rb_mRubyVMFrozenCore::core#set_postexe{ ... } }
- */
- int is_index = iseq->body->is_size++;
- const rb_iseq_t *once_iseq = NEW_CHILD_ISEQ((NODE *)IFUNC_NEW(build_postexe_iseq, node->nd_body, 0),
- make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ LABEL *lend = NEW_LABEL(nd_line(node));
+ VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(node));
+ int ic_index = iseq->ic_size++;
- ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index));
+ ADD_INSN2(ret, nd_line(node), onceinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, nd_line(node), pop);
+
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, nd_line(node), putiseq, block);
+ ADD_SEND (ret, nd_line(node), ID2SYM(id_core_set_postexe), INT2FIX(1));
+
+ ADD_INSN1(ret, nd_line(node), setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
- case NODE_KW_ARG:
- {
- LABEL *end_label = NEW_LABEL(nd_line(node));
- NODE *default_value = node->nd_body->nd_value;
-
- if (default_value == (NODE *)-1) {
- /* required argument. do nothing */
- rb_compile_bug_str(ERROR_ARGS "unreachable");
- }
- else if (nd_type(default_value) == NODE_LIT ||
- nd_type(default_value) == NODE_NIL ||
- nd_type(default_value) == NODE_TRUE ||
- nd_type(default_value) == NODE_FALSE) {
- rb_compile_bug_str(ERROR_ARGS "unreachable");
- }
- else {
- /* if keywordcheck(_kw_bits, nth_keyword)
- * kw = default_value
- * end
- */
- int kw_bits_idx = iseq->body->local_size - iseq->body->param.keyword->bits_start;
- int keyword_idx = iseq->body->param.keyword->num;
-
- ADD_INSN2(ret, line, checkkeyword, INT2FIX(kw_bits_idx), INT2FIX(keyword_idx));
- ADD_INSNL(ret, line, branchif, end_label);
- COMPILE_POPED(ret, "keyword default argument", node->nd_body);
- ADD_LABEL(ret, end_label);
- }
-
+ case NODE_KW_ARG:{
+ LABEL *default_label = NEW_LABEL(nd_line(node));
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ int idx, lv, ls;
+ ID id = node->nd_body->nd_vid;
+
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("key?")), INT2FIX(1));
+ ADD_INSNL(ret, nd_line(node), branchunless, default_label);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("delete")), INT2FIX(1));
+ switch (nd_type(node->nd_body)) {
+ case NODE_LASGN:
+ idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ break;
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ idx = get_dyna_var_idx(iseq, id, &lv, &ls);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
break;
+ default:
+ rb_bug("iseq_compile_each (NODE_KW_ARG): unknown node: %s", ruby_node_name(nd_type(node->nd_body)));
}
+ ADD_INSNL(ret, nd_line(node), jump, end_label);
+ ADD_LABEL(ret, default_label);
+ COMPILE_POPED(ret, "keyword default argument", node->nd_body);
+ ADD_LABEL(ret, end_label);
+ break;
+ }
case NODE_DSYM:{
compile_dstr(iseq, ret, node);
if (!poped) {
- ADD_SEND(ret, line, idIntern, INT2FIX(0));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idIntern), INT2FIX(0));
}
else {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
case NODE_ATTRASGN:{
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
- unsigned int flag = 0;
- ID mid = node->nd_mid;
- LABEL *lskip = 0;
+ VALUE flag = 0;
VALUE argc;
- /* optimization shortcut
- * obj["literal"] = value -> opt_aset_with(obj, "literal", value)
- */
- if (mid == idASET && !private_recv_p(node) && node->nd_args &&
- nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 2 &&
- nd_type(node->nd_args->nd_head) == NODE_STR &&
- ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
- {
- VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
- node->nd_args->nd_head->nd_lit = str;
- iseq_add_mark_object(iseq, str);
- COMPILE(ret, "recv", node->nd_recv);
- COMPILE(ret, "value", node->nd_args->nd_next->nd_head);
- if (!poped) {
- ADD_INSN(ret, line, swap);
- ADD_INSN1(ret, line, topn, INT2FIX(1));
- }
- ADD_INSN3(ret, line, opt_aset_with,
- new_callinfo(iseq, idASET, 2, 0, NULL, FALSE),
- NULL/* CALL_CACHE */, str);
- ADD_INSN(ret, line, pop);
- break;
- }
-
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
+ argc = setup_args(iseq, args, node->nd_args, &flag);
- flag |= COMPILE_RECV(recv, "recv", node);
+ if (node->nd_recv == (NODE *) 1) {
+ flag |= VM_CALL_FCALL;
+ ADD_INSN(recv, nd_line(node), putself);
+ }
+ else {
+ COMPILE(recv, "recv", node->nd_recv);
+ }
debugp_param("argc", argc);
- debugp_param("nd_mid", ID2SYM(mid));
+ debugp_param("nd_mid", ID2SYM(node->nd_mid));
- if (!rb_is_attrset_id(mid)) {
- /* safe nav attr */
- mid = rb_id_attrset(mid);
- ADD_INSN(recv, line, dup);
- lskip = NEW_LABEL(line);
- ADD_INSNL(recv, line, branchnil, lskip);
- }
if (!poped) {
- ADD_INSN(ret, line, putnil);
+ ADD_INSN(ret, nd_line(node), putnil);
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
if (flag & VM_CALL_ARGS_BLOCKARG) {
- ADD_INSN1(ret, line, topn, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
}
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 3));
- ADD_INSN (ret, line, pop);
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 3));
+ ADD_INSN (ret, nd_line(node), pop);
}
else if (flag & VM_CALL_ARGS_SPLAT) {
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2));
- ADD_INSN (ret, line, pop);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
+ ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2));
+ ADD_INSN (ret, nd_line(node), pop);
}
else {
- ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 1));
+ ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 1));
}
}
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
}
- ADD_SEND_WITH_FLAG(ret, line, mid, argc, INT2FIX(flag));
- if (lskip) ADD_LABEL(ret, lskip);
- ADD_INSN(ret, line, pop);
+ ADD_SEND_R(ret, nd_line(node), ID2SYM(node->nd_mid), argc, 0, LONG2FIX(flag));
+ ADD_INSN(ret, nd_line(node), pop);
break;
}
case NODE_PRELUDE:{
- const rb_compile_option_t *orig_opt = ISEQ_COMPILE_DATA(iseq)->option;
- if (node->nd_orig) {
- rb_compile_option_t new_opt = *orig_opt;
- rb_iseq_make_compile_option(&new_opt, node->nd_orig);
- ISEQ_COMPILE_DATA(iseq)->option = &new_opt;
- }
COMPILE_POPED(ret, "prelude", node->nd_head);
COMPILE_(ret, "body", node->nd_body, poped);
- ISEQ_COMPILE_DATA(iseq)->option = orig_opt;
break;
}
case NODE_LAMBDA:{
/* compile same as lambda{...} */
- const rb_iseq_t *block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(node));
VALUE argc = INT2FIX(0);
-
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_CALL_WITH_BLOCK(ret, line, idLambda, argc, block);
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_CALL_WITH_BLOCK(ret, nd_line(node), ID2SYM(idLambda), argc, block);
if (poped) {
- ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, nd_line(node), pop);
}
break;
}
default:
- UNKNOWN_NODE("iseq_compile_each", node);
+ rb_bug("iseq_compile_each: unknown node: %s", ruby_node_name(type));
return COMPILE_NG;
}
- /* check & remove redundant trace(line) */
- if (saved_last_element && ret /* ret can be 0 when error */ &&
- ret->last == saved_last_element &&
- ((INSN *)saved_last_element)->insn_id == BIN(trace)) {
- POP_ELEMENT(ret);
- }
-
debug_node_end();
return COMPILE_OK;
}
@@ -6048,29 +5312,16 @@ calc_sp_depth(int depth, INSN *insn)
return insn_stack_increase(depth, insn->insn_id, insn->operands);
}
-static VALUE
-opobj_inspect(VALUE obj)
+static int
+insn_data_line_no(INSN *iobj)
{
- struct RBasic *r = (struct RBasic *) obj;
- if (!SPECIAL_CONST_P(r) && r->klass == 0) {
- switch (BUILTIN_TYPE(r)) {
- case T_STRING:
- obj = rb_str_new_cstr(RSTRING_PTR(obj));
- break;
- case T_ARRAY:
- obj = rb_ary_dup(obj);
- break;
- }
- }
- return rb_inspect(obj);
+ return insn_len(iobj->line_no);
}
-
-
static VALUE
insn_data_to_s_detail(INSN *iobj)
{
- VALUE str = rb_sprintf("%-20s ", insn_name(iobj->insn_id));
+ VALUE str = rb_sprintf("%-16s", insn_name(iobj->insn_id));
if (iobj->operands) {
const char *types = insn_op_types(iobj->insn_id);
@@ -6078,6 +5329,7 @@ insn_data_to_s_detail(INSN *iobj)
for (j = 0; types[j]; j++) {
char type = types[j];
+ printf("str: %"PRIxVALUE", type: %c\n", str, type);
switch (type) {
case TS_OFFSET: /* label(destination position) */
@@ -6092,9 +5344,9 @@ insn_data_to_s_detail(INSN *iobj)
rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
VALUE val = Qnil;
if (0 && iseq) { /* TODO: invalidate now */
- val = (VALUE)iseq;
+ val = iseq->self;
}
- rb_str_concat(str, opobj_inspect(val));
+ rb_str_concat(str, rb_inspect(val));
}
break;
case TS_LINDEX:
@@ -6102,17 +5354,17 @@ insn_data_to_s_detail(INSN *iobj)
case TS_VALUE: /* VALUE */
{
VALUE v = OPERAND_AT(iobj, j);
- rb_str_concat(str, opobj_inspect(v));
+ rb_str_concat(str, rb_inspect(v));
break;
}
case TS_ID: /* ID */
- rb_str_concat(str, opobj_inspect(OPERAND_AT(iobj, j)));
+ rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
break;
case TS_GENTRY:
{
struct rb_global_entry *entry = (struct rb_global_entry *)
(OPERAND_AT(iobj, j) & (~1));
- rb_str_append(str, rb_id2str(entry->id));
+ rb_str_cat2(str, rb_id2name(entry->id));
break;
}
case TS_IC: /* inline cache */
@@ -6120,33 +5372,13 @@ insn_data_to_s_detail(INSN *iobj)
break;
case TS_CALLINFO: /* call info */
{
- struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(iobj, j);
- rb_str_cat2(str, "<callinfo:");
- if (ci->mid) rb_str_catf(str, "%"PRIsVALUE, rb_id2str(ci->mid));
- rb_str_catf(str, ", %d>", ci->orig_argc);
- break;
- }
- case TS_CALLCACHE: /* call cache */
- {
- rb_str_catf(str, "<call cache>");
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<callinfo:%s, %d>", ci->mid ? rb_id2name(ci->mid) : "", ci->orig_argc);
break;
}
case TS_CDHASH: /* case/when condition cache */
rb_str_cat2(str, "<ch>");
break;
- case TS_FUNCPTR:
- {
- rb_insn_func_t func = (rb_insn_func_t)OPERAND_AT(iobj, j);
-#ifdef HAVE_DLADDR
- Dl_info info;
- if (dladdr(func, &info) && info.dli_sname) {
- rb_str_cat2(str, info.dli_sname);
- break;
- }
-#endif
- rb_str_catf(str, "<%p>", func);
- }
- break;
default:{
rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
}
@@ -6175,7 +5407,7 @@ dump_disasm_list(struct iseq_link_element *link)
{
iobj = (INSN *)link;
str = insn_data_to_s_detail(iobj);
- printf("%04d %-65s(%4u)\n", pos, StringValueCStr(str), iobj->line_no);
+ printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), insn_data_line_no(iobj));
pos += insn_data_length(iobj);
break;
}
@@ -6193,7 +5425,7 @@ dump_disasm_list(struct iseq_link_element *link)
case ISEQ_ELEMENT_ADJUST:
{
ADJUST *adjust = (ADJUST *)link;
- printf("adjust: [label: %d]\n", adjust->label ? adjust->label->label_no : -1);
+ printf("adjust: [label: %d]\n", adjust->label->label_no);
break;
}
default:
@@ -6203,7 +5435,6 @@ dump_disasm_list(struct iseq_link_element *link)
link = link->next;
}
printf("---------------------\n");
- fflush(stdout);
}
const char *
@@ -6218,7 +5449,7 @@ rb_insns_name_array(void)
VALUE ary = rb_ary_new();
int i;
for (i = 0; i < numberof(insn_name_info); i++) {
- rb_ary_push(ary, rb_fstring(rb_str_new2(insn_name_info[i])));
+ rb_ary_push(ary, rb_obj_freeze(rb_str_new2(insn_name_info[i])));
}
return rb_obj_freeze(ary);
}
@@ -6237,7 +5468,6 @@ register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
else {
label = (LABEL *)tmp;
}
- LABEL_REF(label);
return label;
}
@@ -6246,6 +5476,7 @@ get_exception_sym2type(VALUE sym)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ VALUE sym_inspect;
static VALUE symRescue, symEnsure, symRetry;
static VALUE symBreak, symRedo, symNext;
@@ -6264,7 +5495,9 @@ get_exception_sym2type(VALUE sym)
if (sym == symBreak) return CATCH_TYPE_BREAK;
if (sym == symRedo) return CATCH_TYPE_REDO;
if (sym == symNext) return CATCH_TYPE_NEXT;
- rb_raise(rb_eSyntaxError, "invalid exception symbol: %+"PRIsVALUE, sym);
+ sym_inspect = rb_inspect(sym);
+ rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
+ StringValuePtr(sym_inspect));
return 0;
}
@@ -6275,36 +5508,32 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
int i;
for (i=0; i<RARRAY_LEN(exception); i++) {
- const rb_iseq_t *eiseq;
- VALUE v, type;
- const VALUE *ptr;
+ VALUE v, type, *ptr, eiseqval;
LABEL *lstart, *lend, *lcont;
- unsigned int sp;
+ int sp;
- v = rb_convert_type(RARRAY_AREF(exception, i), T_ARRAY,
+ RB_GC_GUARD(v) = rb_convert_type(RARRAY_PTR(exception)[i], T_ARRAY,
"Array", "to_ary");
if (RARRAY_LEN(v) != 6) {
rb_raise(rb_eSyntaxError, "wrong exception entry");
}
- ptr = RARRAY_CONST_PTR(v);
+ ptr = RARRAY_PTR(v);
type = get_exception_sym2type(ptr[0]);
if (ptr[1] == Qnil) {
- eiseq = NULL;
+ eiseqval = 0;
}
else {
- eiseq = rb_iseqw_to_iseq(rb_iseq_load(ptr[1], (VALUE)iseq, Qnil));
+ eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
}
lstart = register_label(iseq, labels_table, ptr[2]);
lend = register_label(iseq, labels_table, ptr[3]);
lcont = register_label(iseq, labels_table, ptr[4]);
- sp = NUM2UINT(ptr[5]);
+ sp = NUM2INT(ptr[5]);
(void)sp;
- ADD_CATCH_ENTRY(type, lstart, lend, eiseq, lcont);
-
- RB_GC_GUARD(v);
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
}
return COMPILE_OK;
}
@@ -6323,74 +5552,32 @@ insn_make_insn_table(void)
return table;
}
-static const rb_iseq_t *
-iseq_build_load_iseq(const rb_iseq_t *iseq, VALUE op)
+static VALUE
+iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
{
- VALUE iseqw;
- const rb_iseq_t *loaded_iseq;
-
+ VALUE iseqval;
if (RB_TYPE_P(op, T_ARRAY)) {
- iseqw = rb_iseq_load(op, (VALUE)iseq, Qnil);
+ iseqval = rb_iseq_load(op, iseq->self, Qnil);
}
else if (CLASS_OF(op) == rb_cISeq) {
- iseqw = op;
+ iseqval = op;
}
else {
rb_raise(rb_eSyntaxError, "ISEQ is required");
}
-
- loaded_iseq = rb_iseqw_to_iseq(iseqw);
- iseq_add_mark_object(iseq, (VALUE)loaded_iseq);
- return loaded_iseq;
-}
-
-static VALUE
-iseq_build_callinfo_from_hash(rb_iseq_t *iseq, VALUE op)
-{
- ID mid = 0;
- int orig_argc = 0;
- unsigned int flag = 0;
- struct rb_call_info_kw_arg *kw_arg = 0;
-
- if (!NIL_P(op)) {
- VALUE vmid = rb_hash_aref(op, ID2SYM(rb_intern("mid")));
- VALUE vflag = rb_hash_aref(op, ID2SYM(rb_intern("flag")));
- VALUE vorig_argc = rb_hash_aref(op, ID2SYM(rb_intern("orig_argc")));
- VALUE vkw_arg = rb_hash_aref(op, ID2SYM(rb_intern("kw_arg")));
-
- if (!NIL_P(vmid)) mid = SYM2ID(vmid);
- if (!NIL_P(vflag)) flag = NUM2UINT(vflag);
- if (!NIL_P(vorig_argc)) orig_argc = FIX2INT(vorig_argc);
-
- if (!NIL_P(vkw_arg)) {
- int i;
- int len = RARRAY_LENINT(vkw_arg);
- size_t n = rb_call_info_kw_arg_bytes(len);
-
- kw_arg = xmalloc(n);
- kw_arg->keyword_len = len;
- for (i = 0; i < len; i++) {
- VALUE kw = RARRAY_AREF(vkw_arg, i);
- SYM2ID(kw); /* make immortal */
- kw_arg->keywords[i] = kw;
- }
- }
- }
-
- return (VALUE)new_callinfo(iseq, mid, orig_argc, flag, kw_arg, (flag & VM_CALL_ARGS_SIMPLE) == 0);
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
}
static int
iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
- VALUE body, VALUE labels_wrapper)
+ VALUE body, struct st_table *labels_table)
{
/* TODO: body should be frozen */
- const VALUE *ptr = RARRAY_CONST_PTR(body);
+ VALUE *ptr = RARRAY_PTR(body);
long i, len = RARRAY_LEN(body);
- struct st_table *labels_table = DATA_PTR(labels_wrapper);
int j;
int line_no = 0;
- int ret = COMPILE_OK;
/*
* index -> LABEL *label
@@ -6417,20 +5604,17 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
st_data_t insn_id;
VALUE insn;
- insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
+ insn = (argc < 0) ? Qnil : RARRAY_PTR(obj)[0];
if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
/* TODO: exception */
- COMPILE_ERROR(ruby_sourcefile_string, line_no,
- "unknown instruction: %+"PRIsVALUE, insn);
- ret = COMPILE_NG;
- break;
+ RB_GC_GUARD(insn) = rb_inspect(insn);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "unknown instruction: %s", RSTRING_PTR(insn));
}
if (argc != insn_len((VALUE)insn_id)-1) {
- COMPILE_ERROR(ruby_sourcefile_string, line_no,
- "operand size mismatch");
- ret = COMPILE_NG;
- break;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "operand size mismatch");
}
if (argc > 0) {
@@ -6455,7 +5639,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
case TS_ISEQ:
{
if (op != Qnil) {
- argv[j] = (VALUE)iseq_build_load_iseq(iseq, op);
+ argv[j] = iseq_build_load_iseq(iseq, op);
}
else {
argv[j] = 0;
@@ -6468,15 +5652,30 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
break;
case TS_IC:
argv[j] = op;
- if (NUM2UINT(op) >= iseq->body->is_size) {
- iseq->body->is_size = NUM2INT(op) + 1;
+ if (NUM2INT(op) >= iseq->ic_size) {
+ iseq->ic_size = NUM2INT(op) + 1;
}
break;
case TS_CALLINFO:
- argv[j] = iseq_build_callinfo_from_hash(iseq, op);
- break;
- case TS_CALLCACHE:
- argv[j] = Qfalse;
+ {
+ ID mid = 0;
+ int orig_argc = 0;
+ VALUE block = 0;
+ unsigned long flag = 0;
+
+ if (!NIL_P(op)) {
+ VALUE vmid = rb_hash_aref(op, ID2SYM(rb_intern("mid")));
+ VALUE vflag = rb_hash_aref(op, ID2SYM(rb_intern("flag")));
+ VALUE vorig_argc = rb_hash_aref(op, ID2SYM(rb_intern("orig_argc")));
+ VALUE vblock = rb_hash_aref(op, ID2SYM(rb_intern("block")));
+
+ if (!NIL_P(vmid)) mid = SYM2ID(vmid);
+ if (!NIL_P(vflag)) flag = NUM2ULONG(vflag);
+ if (!NIL_P(vorig_argc)) orig_argc = FIX2INT(vorig_argc);
+ if (!NIL_P(vblock)) block = iseq_build_load_iseq(iseq, vblock);
+ }
+ argv[j] = (VALUE)new_callinfo(iseq, mid, orig_argc, block, flag);
+ }
break;
case TS_ID:
argv[j] = rb_convert_type(op, T_SYMBOL,
@@ -6485,30 +5684,16 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
case TS_CDHASH:
{
int i;
- VALUE map = rb_hash_new();
-
- rb_hash_tbl_raw(map)->type = &cdhash_type;
op = rb_convert_type(op, T_ARRAY, "Array", "to_ary");
+ op = rb_ary_dup(op);
for (i=0; i<RARRAY_LEN(op); i+=2) {
- VALUE key = RARRAY_AREF(op, i);
- VALUE sym = RARRAY_AREF(op, i+1);
+ VALUE sym = rb_ary_entry(op, i+1);
LABEL *label =
register_label(iseq, labels_table, sym);
- rb_hash_aset(map, key, (VALUE)label | 1);
+ rb_ary_store(op, i+1, (VALUE)label | 1);
}
- RB_GC_GUARD(op);
- argv[j] = map;
- rb_iseq_add_mark_object(iseq, map);
- }
- break;
- case TS_FUNCPTR:
- {
-#if SIZEOF_VALUE <= SIZEOF_LONG
- long funcptr = NUM2LONG(op);
-#else
- LONG_LONG funcptr = NUM2LL(op);
-#endif
- argv[j] = (VALUE)funcptr;
+ argv[j] = op;
+ iseq_add_mark_object_compile_time(iseq, op);
}
break;
default:
@@ -6524,197 +5709,87 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
rb_raise(rb_eTypeError, "unexpected object for instruction");
}
}
- DATA_PTR(labels_wrapper) = 0;
validate_labels(iseq, labels_table);
- if (!ret) return ret;
- return iseq_setup(iseq, anchor);
+ st_free_table(labels_table);
+ iseq_setup(iseq, anchor);
+ return COMPILE_OK;
}
#define CHECK_ARRAY(v) rb_convert_type((v), T_ARRAY, "Array", "to_ary")
+#define CHECK_STRING(v) rb_convert_type((v), T_STRING, "String", "to_str")
#define CHECK_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
+static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
-static int
-int_param(int *dst, VALUE param, VALUE sym)
-{
- VALUE val = rb_hash_aref(param, sym);
- switch (TYPE(val)) {
- case T_NIL:
- return FALSE;
- case T_FIXNUM:
- *dst = FIX2INT(val);
- return TRUE;
- default:
- rb_raise(rb_eTypeError, "invalid %+"PRIsVALUE" Fixnum: %+"PRIsVALUE,
- sym, val);
- }
- return FALSE;
-}
-
-static const struct rb_iseq_param_keyword *
-iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords)
-{
- int i, j;
- int len = RARRAY_LENINT(keywords);
- int default_len;
- VALUE key, sym, default_val;
- VALUE *dvs;
- ID *ids;
- struct rb_iseq_param_keyword *keyword = ZALLOC(struct rb_iseq_param_keyword);
-
- iseq->body->param.flags.has_kw = TRUE;
-
- keyword->num = len;
-#define SYM(s) ID2SYM(rb_intern(#s))
- (void)int_param(&keyword->bits_start, params, SYM(kwbits));
- i = keyword->bits_start - keyword->num;
- ids = (VALUE *)&iseq->body->local_table[i];
-#undef SYM
-
- /* required args */
- for (i = 0; i < len; i++) {
- VALUE val = RARRAY_AREF(keywords, i);
-
- if (!SYMBOL_P(val)) {
- goto default_values;
- }
- ids[i] = SYM2ID(val);
- keyword->required_num++;
- }
-
- default_values: /* note: we intentionally preserve `i' from previous loop */
- default_len = len - i;
- if (default_len == 0) {
- return keyword;
- }
-
- dvs = ALLOC_N(VALUE, default_len);
-
- for (j = 0; i < len; i++, j++) {
- key = RARRAY_AREF(keywords, i);
- CHECK_ARRAY(key);
-
- switch (RARRAY_LEN(key)) {
- case 1:
- sym = RARRAY_AREF(key, 0);
- default_val = Qundef;
- break;
- case 2:
- sym = RARRAY_AREF(key, 0);
- default_val = RARRAY_AREF(key, 1);
- break;
- default:
- rb_raise(rb_eTypeError, "keyword default has unsupported len %+"PRIsVALUE, key);
- }
- ids[i] = SYM2ID(sym);
- dvs[j] = default_val;
- }
-
- keyword->table = ids;
- keyword->default_values = dvs;
-
- return keyword;
-}
-
-void
-rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
+VALUE
+rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
VALUE exception, VALUE body)
{
-#define SYM(s) ID2SYM(rb_intern(#s))
- int i, len;
+ int i;
ID *tbl;
struct st_table *labels_table = st_init_numtable();
- VALUE labels_wrapper = Data_Wrap_Struct(0, 0, st_free_table, labels_table);
- VALUE arg_opt_labels = rb_hash_aref(params, SYM(opt));
- VALUE keywords = rb_hash_aref(params, SYM(keyword));
- VALUE sym_arg_rest = ID2SYM(rb_intern("#arg_rest"));
DECL_ANCHOR(anchor);
INIT_ANCHOR(anchor);
- len = RARRAY_LENINT(locals);
- iseq->body->local_table_size = len;
- iseq->body->local_table = tbl = len > 0 ? (ID *)ALLOC_N(ID, iseq->body->local_table_size) : NULL;
- iseq->body->local_size = iseq->body->local_table_size + 1;
+ iseq->local_table_size = RARRAY_LENINT(locals);
+ iseq->local_table = tbl = (ID *)ALLOC_N(ID, iseq->local_table_size);
+ iseq->local_size = iseq->local_table_size + 1;
- for (i = 0; i < len; i++) {
- VALUE lv = RARRAY_AREF(locals, i);
+ for (i=0; i<RARRAY_LEN(locals); i++) {
+ VALUE lv = RARRAY_PTR(locals)[i];
+ tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ }
- if (sym_arg_rest == lv) {
- tbl[i] = 0;
+ /* args */
+ if (FIXNUM_P(args)) {
+ iseq->arg_size = iseq->argc = FIX2INT(args);
+ iseq->arg_simple = 1;
+ }
+ else {
+ int i = 0;
+ VALUE argc = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_opt_labels = CHECK_ARRAY(rb_ary_entry(args, i++));
+ VALUE arg_post_len = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_post_start = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_rest = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_block = CHECK_INTEGER(rb_ary_entry(args, i++));
+ VALUE arg_simple = CHECK_INTEGER(rb_ary_entry(args, i++));
+
+ iseq->argc = FIX2INT(argc);
+ iseq->arg_rest = FIX2INT(arg_rest);
+ iseq->arg_post_len = FIX2INT(arg_post_len);
+ iseq->arg_post_start = FIX2INT(arg_post_start);
+ iseq->arg_block = FIX2INT(arg_block);
+ iseq->arg_opts = RARRAY_LENINT(arg_opt_labels);
+ iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts);
+
+ if (iseq->arg_block != -1) {
+ iseq->arg_size = iseq->arg_block + 1;
+ }
+ else if (iseq->arg_post_len) {
+ iseq->arg_size = iseq->arg_post_start + iseq->arg_post_len;
+ }
+ else if (iseq->arg_rest != -1) {
+ iseq->arg_size = iseq->arg_rest + 1;
}
else {
- tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
}
- }
- /*
- * we currently ignore misc params,
- * local_size, stack_size and param.size are all calculated
- */
-
-#define INT_PARAM(F) int_param(&iseq->body->param.F, params, SYM(F))
- if (INT_PARAM(lead_num)) {
- iseq->body->param.flags.has_lead = TRUE;
- }
- if (INT_PARAM(post_num)) iseq->body->param.flags.has_post = TRUE;
- if (INT_PARAM(post_start)) iseq->body->param.flags.has_post = TRUE;
- if (INT_PARAM(rest_start)) iseq->body->param.flags.has_rest = TRUE;
- if (INT_PARAM(block_start)) iseq->body->param.flags.has_block = TRUE;
-#undef INT_PARAM
-
- switch (TYPE(arg_opt_labels)) {
- case T_ARRAY:
- len = RARRAY_LENINT(arg_opt_labels);
- iseq->body->param.flags.has_opt = !!(len - 1 >= 0);
-
- if (iseq->body->param.flags.has_opt) {
- VALUE *opt_table = ALLOC_N(VALUE, len);
-
- for (i = 0; i < len; i++) {
- VALUE ent = RARRAY_AREF(arg_opt_labels, i);
- LABEL *label = register_label(iseq, labels_table, ent);
- opt_table[i] = (VALUE)label;
- }
-
- iseq->body->param.opt_num = len - 1;
- iseq->body->param.opt_table = opt_table;
+ for (i=0; i<RARRAY_LEN(arg_opt_labels); i++) {
+ iseq->arg_opt_table[i] =
+ (VALUE)register_label(iseq, labels_table,
+ rb_ary_entry(arg_opt_labels, i));
}
- case T_NIL:
- break;
- default:
- rb_raise(rb_eTypeError, ":opt param is not an array: %+"PRIsVALUE,
- arg_opt_labels);
- }
- switch (TYPE(keywords)) {
- case T_ARRAY:
- iseq->body->param.keyword = iseq_build_kw(iseq, params, keywords);
- case T_NIL:
- break;
- default:
- rb_raise(rb_eTypeError, ":keywords param is not an array: %+"PRIsVALUE,
- keywords);
- }
-
- if (Qtrue == rb_hash_aref(params, SYM(ambiguous_param0))) {
- iseq->body->param.flags.ambiguous_param0 = TRUE;
+ iseq->arg_simple = NUM2INT(arg_simple);
}
- if (int_param(&i, params, SYM(kwrest))) {
- struct rb_iseq_param_keyword *keyword = (struct rb_iseq_param_keyword *)iseq->body->param.keyword;
- if (keyword == NULL) {
- iseq->body->param.keyword = keyword = ZALLOC(struct rb_iseq_param_keyword);
- }
- keyword->rest_start = i;
- iseq->body->param.flags.has_kwrest = TRUE;
- }
-#undef SYM
- iseq_calc_param_size(iseq);
-
/* exception */
iseq_build_from_ary_exception(iseq, labels_table, exception);
/* body */
- iseq_build_from_ary_body(iseq, anchor, body, labels_wrapper);
+ iseq_build_from_ary_body(iseq, anchor, body, labels_table);
+ return iseq->self;
}
/* for parser */
@@ -6723,23 +5798,22 @@ int
rb_dvar_defined(ID id)
{
rb_thread_t *th = GET_THREAD();
- const rb_iseq_t *iseq;
-
+ rb_iseq_t *iseq;
if (th->base_block && (iseq = th->base_block->iseq)) {
- while (iseq->body->type == ISEQ_TYPE_BLOCK ||
- iseq->body->type == ISEQ_TYPE_RESCUE ||
- iseq->body->type == ISEQ_TYPE_ENSURE ||
- iseq->body->type == ISEQ_TYPE_EVAL ||
- iseq->body->type == ISEQ_TYPE_MAIN
+ while (iseq->type == ISEQ_TYPE_BLOCK ||
+ iseq->type == ISEQ_TYPE_RESCUE ||
+ iseq->type == ISEQ_TYPE_ENSURE ||
+ iseq->type == ISEQ_TYPE_EVAL ||
+ iseq->type == ISEQ_TYPE_MAIN
) {
- unsigned int i;
+ int i;
- for (i = 0; i < iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
return 1;
}
}
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
}
}
return 0;
@@ -6749,14 +5823,14 @@ int
rb_local_defined(ID id)
{
rb_thread_t *th = GET_THREAD();
- const rb_iseq_t *iseq;
+ rb_iseq_t *iseq;
if (th->base_block && th->base_block->iseq) {
- unsigned int i;
- iseq = th->base_block->iseq->body->local_iseq;
+ int i;
+ iseq = th->base_block->iseq->local_iseq;
- for (i=0; i<iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
return 1;
}
}
@@ -6775,1595 +5849,3 @@ rb_parse_in_main(void)
{
return GET_THREAD()->parse_in_eval < 0;
}
-
-static int
-caller_location(VALUE *path, VALUE *absolute_path)
-{
- const rb_thread_t *const th = GET_THREAD();
- const rb_control_frame_t *const cfp =
- rb_vm_get_ruby_level_next_cfp(th, th->cfp);
-
- if (cfp) {
- int line = rb_vm_get_sourceline(cfp);
- *path = cfp->iseq->body->location.path;
- *absolute_path = cfp->iseq->body->location.absolute_path;
- return line;
- }
- else {
- *path = rb_str_new2("<compiled>");
- *absolute_path = *path;
- return 1;
- }
-}
-
-typedef struct {
- VALUE arg;
- rb_insn_func_t func;
- int line;
-} accessor_args;
-
-static const rb_iseq_t *
-method_for_self(VALUE name, VALUE arg, rb_insn_func_t func,
- VALUE (*build)(rb_iseq_t *, LINK_ANCHOR *, VALUE))
-{
- VALUE path, absolute_path;
- accessor_args acc;
-
- acc.arg = arg;
- acc.func = func;
- acc.line = caller_location(&path, &absolute_path);
- return rb_iseq_new_with_opt((NODE *)IFUNC_NEW(build, (VALUE)&acc, 0),
- rb_sym2str(name), path, absolute_path,
- INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
-}
-
-static VALUE
-for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
-{
- const accessor_args *const args = (void *)a;
- const int line = args->line;
-
- iseq_set_local_table(iseq, 0);
- iseq->body->param.lead_num = 0;
- iseq->body->param.size = 0;
-
- ADD_INSN1(ret, line, putobject, args->arg);
- ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
- return Qnil;
-}
-
-static VALUE
-for_self_aset(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
-{
- const accessor_args *const args = (void *)a;
- const int line = args->line;
- static const ID vars[] = {1, idUScore};
-
- iseq_set_local_table(iseq, vars);
- iseq->body->param.lead_num = 1;
- iseq->body->param.size = 1;
-
- ADD_INSN2(ret, line, getlocal, INT2FIX(numberof(vars)-0), INT2FIX(0));
- ADD_INSN1(ret, line, putobject, args->arg);
- ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
- ADD_INSN(ret, line, pop);
- return Qnil;
-}
-
-/*
- * func (index) -> (value)
- */
-const rb_iseq_t *
-rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func)
-{
- return method_for_self(name, arg, func, for_self_aref);
-}
-
-/*
- * func (index, value) -> (index, value)
- */
-const rb_iseq_t *
-rb_method_for_self_aset(VALUE name, VALUE arg, rb_insn_func_t func)
-{
- return method_for_self(name, arg, func, for_self_aset);
-}
-
-/* ISeq binary format */
-
-typedef unsigned int ibf_offset_t;
-#define IBF_OFFSET(ptr) ((ibf_offset_t)(VALUE)(ptr))
-
-struct ibf_header {
- char magic[4]; /* YARB */
- unsigned int major_version;
- unsigned int minor_version;
- unsigned int size;
- unsigned int extra_size;
-
- unsigned int iseq_list_size;
- unsigned int id_list_size;
- unsigned int object_list_size;
-
- ibf_offset_t iseq_list_offset;
- ibf_offset_t id_list_offset;
- ibf_offset_t object_list_offset;
-};
-
-struct ibf_id_entry {
- enum {
- ibf_id_enc_ascii,
- ibf_id_enc_utf8,
- ibf_id_enc_other
- } enc : 2;
- char body[1];
-};
-
-struct ibf_dump {
- VALUE str;
- VALUE iseq_list; /* [iseq0 offset, ...] */
- VALUE obj_list; /* [objs] */
- st_table *iseq_table; /* iseq -> iseq number */
- st_table *id_table; /* id -> id number */
-};
-
-rb_iseq_t * iseq_alloc(void);
-
-struct ibf_load {
- const char *buff;
- const struct ibf_header *header;
- ID *id_list; /* [id0, ...] */
- VALUE iseq_list; /* [iseq0, ...] */
- VALUE obj_list; /* [obj0, ...] */
- VALUE loader_obj;
- VALUE str;
- rb_iseq_t *iseq;
-};
-
-static ibf_offset_t
-ibf_dump_pos(struct ibf_dump *dump)
-{
- return (unsigned int)rb_str_strlen(dump->str);
-}
-
-static ibf_offset_t
-ibf_dump_write(struct ibf_dump *dump, const void *buff, unsigned long size)
-{
- ibf_offset_t pos = ibf_dump_pos(dump);
- rb_str_cat(dump->str, (const char *)buff, size);
- /* TODO: overflow check */
- return pos;
-}
-
-static void
-ibf_dump_overwrite(struct ibf_dump *dump, void *buff, unsigned int size, long offset)
-{
- VALUE str = dump->str;
- char *ptr = RSTRING_PTR(str);
- if ((unsigned long)(size + offset) > (unsigned long)RSTRING_LEN(str))
- rb_bug("ibf_dump_overwrite: overflow");
- memcpy(ptr + offset, buff, size);
-}
-
-static void *
-ibf_load_alloc(const struct ibf_load *load, ibf_offset_t offset, int size)
-{
- void *buff = ruby_xmalloc(size);
- memcpy(buff, load->buff + offset, size);
- return buff;
-}
-
-#define IBF_W(b, type, n) (type *)(VALUE)ibf_dump_write(dump, (b), sizeof(type) * (n))
-#define IBF_WV(variable) ibf_dump_write(dump, &(variable), sizeof(variable))
-#define IBF_WP(b, type, n) ibf_dump_write(dump, (b), sizeof(type) * (n))
-#define IBF_R(val, type, n) (type *)ibf_load_alloc(load, IBF_OFFSET(val), sizeof(type) * (n))
-
-static int
-ibf_table_lookup(struct st_table *table, st_data_t key)
-{
- st_data_t val;
-
- if (st_lookup(table, key, &val)) {
- return (int)val;
- }
- else {
- return -1;
- }
-}
-
-static int
-ibf_table_index(struct st_table *table, st_data_t key)
-{
- int index = ibf_table_lookup(table, key);
-
- if (index < 0) { /* not found */
- index = (int)table->num_entries;
- st_insert(table, key, (st_data_t)index);
- }
-
- return index;
-}
-
-/* dump/load generic */
-
-static VALUE ibf_load_object(const struct ibf_load *load, VALUE object_index);
-static rb_iseq_t *ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq);
-
-static VALUE
-ibf_dump_object(struct ibf_dump *dump, VALUE obj)
-{
- long index = RARRAY_LEN(dump->obj_list);
- long i;
- for (i=0; i<index; i++) {
- if (RARRAY_AREF(dump->obj_list, i) == obj) return (VALUE)i; /* dedup */
- }
- rb_ary_push(dump->obj_list, obj);
- return (VALUE)index;
-}
-
-static VALUE
-ibf_dump_id(struct ibf_dump *dump, ID id)
-{
- return (VALUE)ibf_table_index(dump->id_table, (st_data_t)id);
-}
-
-static ID
-ibf_load_id(const struct ibf_load *load, const ID id_index)
-{
- ID id;
-
- if (id_index == 0) {
- id = 0;
- }
- else {
- id = load->id_list[(long)id_index];
-
- if (id == 0) {
- long *indices = (long *)(load->buff + load->header->id_list_offset);
- VALUE str = ibf_load_object(load, indices[id_index]);
- id = NIL_P(str) ? 0 : rb_intern_str(str); /* str == nil -> internal junk id */
- load->id_list[(long)id_index] = id;
- }
- }
-
- return id;
-}
-
-/* dump/load: code */
-
-static VALUE
-ibf_dump_callinfo(struct ibf_dump *dump, const struct rb_call_info *ci)
-{
- return (ci->flag & VM_CALL_KWARG) ? Qtrue : Qfalse;
-}
-
-static ibf_offset_t ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq);
-
-static rb_iseq_t *
-ibf_dump_iseq(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- if (iseq == NULL) {
- return (rb_iseq_t *)-1;
- }
- else {
- int iseq_index = ibf_table_lookup(dump->iseq_table, (st_data_t)iseq);
- if (iseq_index < 0) {
- iseq_index = ibf_table_index(dump->iseq_table, (st_data_t)iseq);
- rb_ary_store(dump->iseq_list, iseq_index, LONG2NUM(ibf_dump_iseq_each(dump, rb_iseq_check(iseq))));
- }
- return (rb_iseq_t *)(VALUE)iseq_index;
- }
-}
-
-static VALUE
-ibf_dump_gentry(struct ibf_dump *dump, const struct rb_global_entry *entry)
-{
- return (VALUE)ibf_dump_id(dump, entry->id);
-}
-
-static VALUE
-ibf_load_gentry(const struct ibf_load *load, const struct rb_global_entry *entry)
-{
- ID gid = ibf_load_id(load, (ID)(VALUE)entry);
- return (VALUE)rb_global_entry(gid);
-}
-
-static VALUE *
-ibf_dump_code(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const int iseq_size = iseq->body->iseq_size;
- int code_index;
- VALUE *code;
- const VALUE *orig_code = rb_iseq_original_iseq(iseq);
-
- code = ALLOCA_N(VALUE, iseq_size);
-
- for (code_index=0; code_index<iseq_size;) {
- const VALUE insn = orig_code[code_index];
- const char *types = insn_op_types(insn);
- int op_index;
-
- code[code_index++] = (VALUE)insn;
-
- for (op_index=0; types[op_index]; op_index++, code_index++) {
- VALUE op = orig_code[code_index];
- switch (types[op_index]) {
- case TS_CDHASH:
- case TS_VALUE:
- code[code_index] = ibf_dump_object(dump, op);
- break;
- case TS_ISEQ:
- code[code_index] = (VALUE)ibf_dump_iseq(dump, (const rb_iseq_t *)op);
- break;
- case TS_IC:
- {
- unsigned int i;
- for (i=0; i<iseq->body->is_size; i++) {
- if (op == (VALUE)&iseq->body->is_entries[i]) {
- break;
- }
- }
- code[code_index] = i;
- }
- break;
- case TS_CALLINFO:
- code[code_index] = ibf_dump_callinfo(dump, (const struct rb_call_info *)op);
- break;
- case TS_CALLCACHE:
- code[code_index] = 0;
- break;
- case TS_ID:
- code[code_index] = ibf_dump_id(dump, (ID)op);
- break;
- case TS_GENTRY:
- code[code_index] = ibf_dump_gentry(dump, (const struct rb_global_entry *)op);
- break;
- case TS_FUNCPTR:
- rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
- break;
- default:
- code[code_index] = op;
- break;
- }
- }
- assert(insn_len(insn) == op_index+1);
- }
-
- return IBF_W(code, VALUE, iseq_size);
-}
-
-static VALUE *
-ibf_load_code(const struct ibf_load *load, const rb_iseq_t *iseq, const struct rb_iseq_constant_body *body)
-{
- const int iseq_size = body->iseq_size;
- int code_index;
- VALUE *code = IBF_R(body->iseq_encoded, VALUE, iseq_size);
-
- struct rb_call_info *ci_entries = iseq->body->ci_entries;
- struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&iseq->body->ci_entries[iseq->body->ci_size];
- struct rb_call_cache *cc_entries = iseq->body->cc_entries;
- union iseq_inline_storage_entry *is_entries = iseq->body->is_entries;
-
- for (code_index=0; code_index<iseq_size;) {
- const VALUE insn = code[code_index++];
- const char *types = insn_op_types(insn);
- int op_index;
-
- for (op_index=0; types[op_index]; op_index++, code_index++) {
- VALUE op = code[code_index];
-
- switch (types[op_index]) {
- case TS_CDHASH:
- case TS_VALUE:
- code[code_index] = ibf_load_object(load, op);
- break;
- case TS_ISEQ:
- code[code_index] = (VALUE)ibf_load_iseq(load, (const rb_iseq_t *)op);
- break;
- case TS_IC:
- code[code_index] = (VALUE)&is_entries[(int)op];
- break;
- case TS_CALLINFO:
- code[code_index] = op ? (VALUE)ci_kw_entries++ : (VALUE)ci_entries++; /* op is Qtrue (kw) or Qfalse (!kw) */
- break;
- case TS_CALLCACHE:
- code[code_index] = (VALUE)cc_entries++;
- break;
- case TS_ID:
- code[code_index] = ibf_load_id(load, (ID)op);
- break;
- case TS_GENTRY:
- code[code_index] = ibf_load_gentry(load, (const struct rb_global_entry *)op);
- break;
- case TS_FUNCPTR:
- rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
- break;
- default:
- /* code[code_index] = op; */
- break;
- }
- }
- assert(insn_len(insn) == op_index+1);
- };
-
-
- return code;
-}
-
-static VALUE *
-ibf_dump_param_opt_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- int opt_num = iseq->body->param.opt_num;
-
- if (opt_num > 0) {
- return IBF_W(iseq->body->param.opt_table, VALUE, opt_num + 1);
- }
- else {
- return NULL;
- }
-}
-
-static VALUE *
-ibf_load_param_opt_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- int opt_num = body->param.opt_num;
-
- if (opt_num > 0) {
- ibf_offset_t offset = IBF_OFFSET(body->param.opt_table);
- VALUE *table = ALLOC_N(VALUE, opt_num+1);
- MEMCPY(table, load->buff + offset, VALUE, opt_num+1);
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static struct rb_iseq_param_keyword *
-ibf_dump_param_keyword(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const struct rb_iseq_param_keyword *kw = iseq->body->param.keyword;
-
- if (kw) {
- struct rb_iseq_param_keyword dump_kw = *kw;
- int dv_num = kw->num - kw->required_num;
- ID *ids = kw->num > 0 ? ALLOCA_N(ID, kw->num) : NULL;
- VALUE *dvs = dv_num > 0 ? ALLOCA_N(VALUE, dv_num) : NULL;
- int i;
-
- for (i=0; i<kw->num; i++) ids[i] = (ID)ibf_dump_id(dump, kw->table[i]);
- for (i=0; i<dv_num; i++) dvs[i] = (VALUE)ibf_dump_object(dump, kw->default_values[i]);
-
- dump_kw.table = IBF_W(ids, ID, kw->num);
- dump_kw.default_values = IBF_W(dvs, VALUE, dv_num);
- return IBF_W(&dump_kw, struct rb_iseq_param_keyword, 1);
- }
- else {
- return NULL;
- }
-}
-
-static const struct rb_iseq_param_keyword *
-ibf_load_param_keyword(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- if (body->param.keyword) {
- struct rb_iseq_param_keyword *kw = IBF_R(body->param.keyword, struct rb_iseq_param_keyword, 1);
- ID *ids = IBF_R(kw->table, ID, kw->num);
- int dv_num = kw->num - kw->required_num;
- VALUE *dvs = IBF_R(kw->default_values, VALUE, dv_num);
- int i;
-
- for (i=0; i<kw->num; i++) {
- ids[i] = ibf_load_id(load, ids[i]);
- }
- for (i=0; i<dv_num; i++) {
- dvs[i] = ibf_load_object(load, dvs[i]);
- }
-
- kw->table = ids;
- kw->default_values = dvs;
- return kw;
- }
- else {
- return NULL;
- }
-}
-
-static struct iseq_line_info_entry *
-ibf_dump_line_info_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- return IBF_W(iseq->body->line_info_table, struct iseq_line_info_entry, iseq->body->line_info_size);
-}
-
-static struct iseq_line_info_entry *
-ibf_load_line_info_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- return IBF_R(body->line_info_table, struct iseq_line_info_entry, body->line_info_size);
-}
-
-static ID *
-ibf_dump_local_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const int size = iseq->body->local_size - 1;
- ID *table = ALLOCA_N(ID, size);
- int i;
-
- for (i=0; i<size; i++) {
- table[i] = ibf_dump_id(dump, iseq->body->local_table[i]);
- }
-
- return IBF_W(table, ID, size);
-}
-
-static ID *
-ibf_load_local_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- const int size = body->local_size - 1;
-
- if (size > 0) {
- ID *table = IBF_R(body->local_table, ID, size);
- int i;
-
- for (i=0; i<size; i++) {
- table[i] = ibf_load_id(load, table[i]);
- }
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static struct iseq_catch_table *
-ibf_dump_catch_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const struct iseq_catch_table *table = iseq->body->catch_table;
-
- if (table) {
- int byte_size = iseq_catch_table_bytes(iseq->body->catch_table->size);
- struct iseq_catch_table *dump_table = (struct iseq_catch_table *)ALLOCA_N(char, byte_size);
- unsigned int i;
- dump_table->size = table->size;
- for (i=0; i<table->size; i++) {
- dump_table->entries[i] = table->entries[i];
- dump_table->entries[i].iseq = ibf_dump_iseq(dump, table->entries[i].iseq);
- }
- return (struct iseq_catch_table *)(VALUE)ibf_dump_write(dump, dump_table, byte_size);
- }
- else {
- return NULL;
- }
-}
-
-static struct iseq_catch_table *
-ibf_load_catch_table(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- if (body->catch_table) {
- struct iseq_catch_table *table;
- unsigned int i;
- unsigned int size;
- size = *(unsigned int *)(load->buff + IBF_OFFSET(body->catch_table));
- table = ibf_load_alloc(load, IBF_OFFSET(body->catch_table), iseq_catch_table_bytes(size));
- for (i=0; i<size; i++) {
- table->entries[i].iseq = ibf_load_iseq(load, table->entries[i].iseq);
- }
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static struct rb_call_info *
-ibf_dump_ci_entries(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const unsigned int ci_size = iseq->body->ci_size;
- const unsigned int ci_kw_size = iseq->body->ci_kw_size;
- const struct rb_call_info *ci_entries = iseq->body->ci_entries;
- struct rb_call_info *dump_ci_entries;
- struct rb_call_info_with_kwarg *dump_ci_kw_entries;
- int byte_size = ci_size * sizeof(struct rb_call_info) +
- ci_kw_size * sizeof(struct rb_call_info_with_kwarg);
- unsigned int i;
-
- dump_ci_entries = (struct rb_call_info *)ALLOCA_N(char, byte_size);
- dump_ci_kw_entries = (struct rb_call_info_with_kwarg *)&dump_ci_entries[ci_size];
- memcpy(dump_ci_entries, ci_entries, byte_size);
-
- for (i=0; i<ci_size; i++) { /* conver ID for each ci */
- dump_ci_entries[i].mid = ibf_dump_id(dump, dump_ci_entries[i].mid);
- }
- for (i=0; i<ci_kw_size; i++) {
- const struct rb_call_info_kw_arg *kw_arg = dump_ci_kw_entries[i].kw_arg;
- int j;
- VALUE *keywords = ALLOCA_N(VALUE, kw_arg->keyword_len);
- for (j=0; j<kw_arg->keyword_len; j++) {
- keywords[j] = (VALUE)ibf_dump_object(dump, kw_arg->keywords[j]); /* kw_arg->keywords[n] is Symbol */
- }
- dump_ci_kw_entries[i].kw_arg = (struct rb_call_info_kw_arg *)(VALUE)ibf_dump_write(dump, &kw_arg->keyword_len, sizeof(int));
- ibf_dump_write(dump, keywords, sizeof(VALUE) * kw_arg->keyword_len);
-
- dump_ci_kw_entries[i].ci.mid = ibf_dump_id(dump, dump_ci_kw_entries[i].ci.mid);
- }
- return (struct rb_call_info *)(VALUE)ibf_dump_write(dump, dump_ci_entries, byte_size);
-}
-
-static struct rb_call_info *
-ibf_load_ci_entries(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- unsigned int i;
- const unsigned int ci_size = body->ci_size;
- const unsigned int ci_kw_size = body->ci_kw_size;
- struct rb_call_info *ci_entries = ibf_load_alloc(load, IBF_OFFSET(body->ci_entries),
- sizeof(struct rb_call_info) * body->ci_size +
- sizeof(struct rb_call_info_with_kwarg) * body->ci_kw_size);
- struct rb_call_info_with_kwarg *ci_kw_entries = (struct rb_call_info_with_kwarg *)&ci_entries[ci_size];
-
- for (i=0; i<ci_size; i++) {
- ci_entries[i].mid = ibf_load_id(load, ci_entries[i].mid);
- }
- for (i=0; i<ci_kw_size; i++) {
- int j;
- ibf_offset_t kw_arg_offset = IBF_OFFSET(ci_kw_entries[i].kw_arg);
- const int keyword_len = *(int *)(load->buff + kw_arg_offset);
- const VALUE *keywords = (VALUE *)(load->buff + kw_arg_offset + sizeof(int));
- struct rb_call_info_kw_arg *kw_arg = ruby_xmalloc(sizeof(struct rb_call_info_kw_arg) + sizeof(VALUE) * (keyword_len - 1));
- kw_arg->keyword_len = keyword_len;
- for (j=0; j<kw_arg->keyword_len; j++) {
- kw_arg->keywords[j] = (VALUE)ibf_load_object(load, keywords[j]);
- }
- ci_kw_entries[i].kw_arg = kw_arg;
- ci_kw_entries[i].ci.mid = ibf_load_id(load, ci_kw_entries[i].ci.mid);
- }
-
- return ci_entries;
-}
-
-static ibf_offset_t
-ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- struct rb_iseq_constant_body dump_body;
- dump_body = *iseq->body;
-
- dump_body.location.path = ibf_dump_object(dump, dump_body.location.path);
- dump_body.location.absolute_path = ibf_dump_object(dump, dump_body.location.absolute_path);
- dump_body.location.base_label = ibf_dump_object(dump, dump_body.location.base_label);
- dump_body.location.label = ibf_dump_object(dump, dump_body.location.label);
-
- dump_body.iseq_encoded = ibf_dump_code(dump, iseq);
- dump_body.param.opt_table = ibf_dump_param_opt_table(dump, iseq);
- dump_body.param.keyword = ibf_dump_param_keyword(dump, iseq);
- dump_body.line_info_table = ibf_dump_line_info_table(dump, iseq);
- dump_body.local_table = ibf_dump_local_table(dump, iseq);
- dump_body.catch_table = ibf_dump_catch_table(dump, iseq);
- dump_body.parent_iseq = ibf_dump_iseq(dump, iseq->body->parent_iseq);
- dump_body.local_iseq = ibf_dump_iseq(dump, iseq->body->local_iseq);
- dump_body.is_entries = NULL;
- dump_body.ci_entries = ibf_dump_ci_entries(dump, iseq);
- dump_body.cc_entries = NULL;
- dump_body.mark_ary = ISEQ_FLIP_CNT(iseq);
-
- return ibf_dump_write(dump, &dump_body, sizeof(dump_body));
-}
-
-static VALUE
-ibf_load_location_str(const struct ibf_load *load, VALUE str_index)
-{
- VALUE str = ibf_load_object(load, str_index);
- if (str != Qnil) {
- str = rb_fstring(str);
- }
- return str;
-}
-
-static void
-ibf_load_iseq_each(const struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
-{
- struct rb_iseq_constant_body *load_body = iseq->body = ZALLOC(struct rb_iseq_constant_body);
- const struct rb_iseq_constant_body *body = (struct rb_iseq_constant_body *)(load->buff + offset);
-
- /* memcpy(load_body, load->buff + offset, sizeof(*load_body)); */
- load_body->type = body->type;
- load_body->stack_max = body->stack_max;
- load_body->local_size = body->local_size;
- load_body->iseq_size = body->iseq_size;
- load_body->param = body->param;
- load_body->local_table_size = body->local_table_size;
- load_body->is_size = body->is_size;
- load_body->ci_size = body->ci_size;
- load_body->ci_kw_size = body->ci_kw_size;
- load_body->line_info_size = body->line_info_size;
-
- RB_OBJ_WRITE(iseq, &load_body->mark_ary, iseq_mark_ary_create((int)body->mark_ary));
-
- RB_OBJ_WRITE(iseq, &load_body->location.path, ibf_load_location_str(load, body->location.path));
- RB_OBJ_WRITE(iseq, &load_body->location.absolute_path, ibf_load_location_str(load, body->location.absolute_path));
- RB_OBJ_WRITE(iseq, &load_body->location.base_label, ibf_load_location_str(load, body->location.base_label));
- RB_OBJ_WRITE(iseq, &load_body->location.label, ibf_load_location_str(load, body->location.label));
- load_body->location.first_lineno = body->location.first_lineno;
-
- load_body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, body->is_size);
- load_body->ci_entries = ibf_load_ci_entries(load, body);
- load_body->cc_entries = ZALLOC_N(struct rb_call_cache, body->ci_size + body->ci_kw_size);
- load_body->param.opt_table = ibf_load_param_opt_table(load, body);
- load_body->param.keyword = ibf_load_param_keyword(load, body);
- load_body->line_info_table = ibf_load_line_info_table(load, body);
- load_body->local_table = ibf_load_local_table(load, body);
- load_body->catch_table = ibf_load_catch_table(load, body);
- load_body->parent_iseq = ibf_load_iseq(load, body->parent_iseq);
- load_body->local_iseq = ibf_load_iseq(load, body->local_iseq);
-
- load_body->iseq_encoded = ibf_load_code(load, iseq, body);
-
- rb_iseq_translate_threaded_code(iseq);
-}
-
-
-static void
-ibf_dump_iseq_list(struct ibf_dump *dump, struct ibf_header *header)
-{
- const long size = RARRAY_LEN(dump->iseq_list);
- ibf_offset_t *list = ALLOCA_N(ibf_offset_t, size);
- long i;
-
- for (i=0; i<size; i++) {
- list[i] = (ibf_offset_t)NUM2LONG(rb_ary_entry(dump->iseq_list, i));
- }
-
- header->iseq_list_offset = ibf_dump_write(dump, list, sizeof(ibf_offset_t) * size);
- header->iseq_list_size = (unsigned int)size;
-}
-
-struct ibf_dump_id_list_i_arg {
- struct ibf_dump *dump;
- long *list;
- int current_i;
-};
-
-static int
-ibf_dump_id_list_i(st_data_t key, st_data_t val, st_data_t ptr)
-{
- struct ibf_dump_id_list_i_arg *arg = (struct ibf_dump_id_list_i_arg *)ptr;
- int i = (int)val;
- ID id = (ID)key;
- assert(arg->current_i == i);
- arg->current_i++;
-
- if (rb_id2name(id)) {
- arg->list[i] = (long)ibf_dump_object(arg->dump, rb_id2str(id));
- }
- else {
- arg->list[i] = 0;
- }
-
- return ST_CONTINUE;
-}
-
-static void
-ibf_dump_id_list(struct ibf_dump *dump, struct ibf_header *header)
-{
- const long size = dump->id_table->num_entries;
- struct ibf_dump_id_list_i_arg arg;
- arg.list = ALLOCA_N(long, size);
- arg.dump = dump;
- arg.current_i = 0;
-
- st_foreach(dump->id_table, ibf_dump_id_list_i, (st_data_t)&arg);
-
- header->id_list_offset = ibf_dump_write(dump, arg.list, sizeof(long) * size);
- header->id_list_size = (unsigned int)size;
-}
-
-#define IBF_OBJECT_INTERNAL FL_PROMOTED0
-
-/*
- * Binary format
- * - ibf_object_header
- * - ibf_object_xxx (xxx is type)
- */
-
-struct ibf_object_header {
- unsigned int type: 5;
- unsigned int special_const: 1;
- unsigned int frozen: 1;
- unsigned int internal: 1;
-};
-
-enum ibf_object_class_index {
- IBF_OBJECT_CLASS_OBJECT,
- IBF_OBJECT_CLASS_ARRAY,
- IBF_OBJECT_CLASS_STANDARD_ERROR
-};
-
-struct ibf_object_string {
- long encindex;
- long len;
- char ptr[1];
-};
-
-struct ibf_object_regexp {
- long srcstr;
- char option;
-};
-
-struct ibf_object_array {
- long len;
- long ary[1];
-};
-
-struct ibf_object_hash {
- long len;
- long keyval[1];
-};
-
-struct ibf_object_struct_range {
- long class_index;
- long len;
- long beg;
- long end;
- int excl;
-};
-
-struct ibf_object_bignum {
- ssize_t slen;
- BDIGIT digits[1];
-};
-
-enum ibf_object_data_type {
- IBF_OBJECT_DATA_ENCODING
-};
-
-struct ibf_object_complex_rational {
- long a, b;
-};
-
-struct ibf_object_symbol {
- long str;
-};
-
-#define IBF_OBJHEADER(offset) (struct ibf_object_header *)(load->buff + (offset))
-#define IBF_OBJBODY(type, offset) (type *)(load->buff + sizeof(struct ibf_object_header) + (offset))
-
-static void
-ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj)
-{
- rb_obj_info_dump(obj);
- rb_bug("ibf_dump_object_unsupported: unsupported");
-}
-
-static VALUE
-ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- rb_bug("unsupported");
- return Qnil;
-}
-
-static void
-ibf_dump_object_class(struct ibf_dump *dump, VALUE obj)
-{
- enum ibf_object_class_index cindex;
- if (obj == rb_cObject) {
- cindex = IBF_OBJECT_CLASS_OBJECT;
- }
- else if (obj == rb_cArray) {
- cindex = IBF_OBJECT_CLASS_ARRAY;
- }
- else if (obj == rb_eStandardError) {
- cindex = IBF_OBJECT_CLASS_STANDARD_ERROR;
- }
- else {
- rb_obj_info_dump(obj);
- rb_p(obj);
- rb_bug("unsupported class");
- }
- ibf_dump_write(dump, &cindex, sizeof(cindex));
-}
-
-static VALUE
-ibf_load_object_class(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- enum ibf_object_class_index *cindexp = IBF_OBJBODY(enum ibf_object_class_index, offset);
- enum ibf_object_class_index cindex = *cindexp;
-
- switch (cindex) {
- case IBF_OBJECT_CLASS_OBJECT:
- return rb_cObject;
- case IBF_OBJECT_CLASS_ARRAY:
- return rb_cArray;
- case IBF_OBJECT_CLASS_STANDARD_ERROR:
- return rb_eStandardError;
- }
-
- rb_bug("ibf_load_object_class: unknown class (%d)", (int)cindex);
-}
-
-
-static void
-ibf_dump_object_float(struct ibf_dump *dump, VALUE obj)
-{
- double dbl = RFLOAT_VALUE(obj);
- ibf_dump_write(dump, &dbl, sizeof(dbl));
-}
-
-static VALUE
-ibf_load_object_float(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- double *dblp = IBF_OBJBODY(double, offset);
- return DBL2NUM(*dblp);
-}
-
-static void
-ibf_dump_object_string(struct ibf_dump *dump, VALUE obj)
-{
- long encindex = (long)rb_enc_get_index(obj);
- long len = RSTRING_LEN(obj);
- const char *ptr = RSTRING_PTR(obj);
-
- if (encindex > RUBY_ENCINDEX_BUILTIN_MAX) {
- rb_encoding *enc = rb_enc_from_index((int)encindex);
- const char *enc_name = rb_enc_name(enc);
- encindex = RUBY_ENCINDEX_BUILTIN_MAX + ibf_dump_object(dump, rb_str_new2(enc_name));
- }
-
- IBF_WV(encindex);
- IBF_WV(len);
- IBF_WP(ptr, char, len);
-}
-
-static VALUE
-ibf_load_object_string(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_string *string = IBF_OBJBODY(struct ibf_object_string, offset);
- VALUE str = rb_str_new(string->ptr, string->len);
- int encindex = (int)string->encindex;
-
- if (encindex > RUBY_ENCINDEX_BUILTIN_MAX) {
- VALUE enc_name_str = ibf_load_object(load, encindex - RUBY_ENCINDEX_BUILTIN_MAX);
- encindex = rb_enc_find_index(RSTRING_PTR(enc_name_str));
- }
- rb_enc_associate_index(str, encindex);
-
- if (header->internal) rb_obj_hide(str);
- if (header->frozen) str = rb_fstring(str);
-
- return str;
-}
-
-static void
-ibf_dump_object_regexp(struct ibf_dump *dump, VALUE obj)
-{
- struct ibf_object_regexp regexp;
- regexp.srcstr = RREGEXP_SRC(obj);
- regexp.option = (char)rb_reg_options(obj);
- regexp.srcstr = (long)ibf_dump_object(dump, regexp.srcstr);
- IBF_WV(regexp);
-}
-
-static VALUE
-ibf_load_object_regexp(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_regexp *regexp = IBF_OBJBODY(struct ibf_object_regexp, offset);
- VALUE srcstr = ibf_load_object(load, regexp->srcstr);
- VALUE reg = rb_reg_compile(srcstr, (int)regexp->option, NULL, 0);
-
- if (header->internal) rb_obj_hide(reg);
- if (header->frozen) rb_obj_freeze(reg);
-
- return reg;
-}
-
-static void
-ibf_dump_object_array(struct ibf_dump *dump, VALUE obj)
-{
- long i, len = (int)RARRAY_LEN(obj);
- IBF_WV(len);
- for (i=0; i<len; i++) {
- long index = (long)ibf_dump_object(dump, RARRAY_AREF(obj, i));
- IBF_WV(index);
- }
-}
-
-static VALUE
-ibf_load_object_array(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_array *array = IBF_OBJBODY(struct ibf_object_array, offset);
- VALUE ary = rb_ary_new_capa(array->len);
- int i;
-
- for (i=0; i<array->len; i++) {
- rb_ary_push(ary, ibf_load_object(load, array->ary[i]));
- }
-
- if (header->internal) rb_obj_hide(ary);
- if (header->frozen) rb_obj_freeze(ary);
-
- return ary;
-}
-
-static int
-ibf_dump_object_hash_i(st_data_t key, st_data_t val, st_data_t ptr)
-{
- struct ibf_dump *dump = (struct ibf_dump *)ptr;
- long key_index = (long)ibf_dump_object(dump, (VALUE)key);
- long val_index = (long)ibf_dump_object(dump, (VALUE)val);
- IBF_WV(key_index);
- IBF_WV(val_index);
- return ST_CONTINUE;
-}
-
-static void
-ibf_dump_object_hash(struct ibf_dump *dump, VALUE obj)
-{
- long len = RHASH_SIZE(obj);
- IBF_WV(len);
- if (len > 0) st_foreach(RHASH(obj)->ntbl, ibf_dump_object_hash_i, (st_data_t)dump);
-}
-
-static VALUE
-ibf_load_object_hash(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_hash *hash = IBF_OBJBODY(struct ibf_object_hash, offset);
- VALUE obj = rb_hash_new();
- int i;
-
- for (i=0; i<hash->len; i++) {
- VALUE key = ibf_load_object(load, hash->keyval[i*2 ]);
- VALUE val = ibf_load_object(load, hash->keyval[i*2+1]);
- rb_hash_aset(obj, key, val);
- }
- rb_hash_rehash(obj);
-
- if (header->internal) rb_obj_hide(obj);
- if (header->frozen) rb_obj_freeze(obj);
-
- return obj;
-}
-
-static void
-ibf_dump_object_struct(struct ibf_dump *dump, VALUE obj)
-{
- if (rb_obj_is_kind_of(obj, rb_cRange)) {
- struct ibf_object_struct_range range;
- VALUE beg, end;
- range.len = 3;
- range.class_index = 0;
-
- rb_range_values(obj, &beg, &end, &range.excl);
- range.beg = (long)ibf_dump_object(dump, beg);
- range.end = (long)ibf_dump_object(dump, end);
-
- IBF_WV(range);
- }
- else {
- rb_bug("ibf_dump_object_struct: unsupported class");
- }
-}
-
-static VALUE
-ibf_load_object_struct(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_struct_range *range = IBF_OBJBODY(struct ibf_object_struct_range, offset);
- VALUE beg = ibf_load_object(load, range->beg);
- VALUE end = ibf_load_object(load, range->end);
- VALUE obj = rb_range_new(beg, end, range->excl);
- if (header->internal) rb_obj_hide(obj);
- if (header->frozen) rb_obj_freeze(obj);
- return obj;
-}
-
-static void
-ibf_dump_object_bignum(struct ibf_dump *dump, VALUE obj)
-{
- ssize_t len = BIGNUM_LEN(obj);
- ssize_t slen = BIGNUM_SIGN(obj) > 0 ? len : len * -1;
- BDIGIT *d = BIGNUM_DIGITS(obj);
-
- IBF_WV(slen);
- IBF_WP(d, BDIGIT, len);
-}
-
-static VALUE
-ibf_load_object_bignum(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_bignum *bignum = IBF_OBJBODY(struct ibf_object_bignum, offset);
- int sign = bignum->slen > 0;
- ssize_t len = sign > 0 ? bignum->slen : -1 * bignum->slen;
- VALUE obj = rb_integer_unpack(bignum->digits, len * 2, 2, 0,
- INTEGER_PACK_LITTLE_ENDIAN | (sign == 0 ? INTEGER_PACK_NEGATIVE : 0));
- if (header->internal) rb_obj_hide(obj);
- if (header->frozen) rb_obj_freeze(obj);
- return obj;
-}
-
-static void
-ibf_dump_object_data(struct ibf_dump *dump, VALUE obj)
-{
- if (rb_data_is_encoding(obj)) {
- rb_encoding *enc = rb_to_encoding(obj);
- const char *name = rb_enc_name(enc);
- enum ibf_object_data_type type = IBF_OBJECT_DATA_ENCODING;
- long len = strlen(name) + 1;
- IBF_WV(type);
- IBF_WV(len);
- IBF_WP(name, char, strlen(name) + 1);
- }
- else {
- ibf_dump_object_unsupported(dump, obj);
- }
-}
-
-static VALUE
-ibf_load_object_data(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const enum ibf_object_data_type *typep = IBF_OBJBODY(enum ibf_object_data_type, offset);
- /* const long *lenp = IBF_OBJBODY(long, offset + sizeof(enum ibf_object_data_type)); */
- const char *data = IBF_OBJBODY(char, offset + sizeof(enum ibf_object_data_type) + sizeof(long));
-
- switch (*typep) {
- case IBF_OBJECT_DATA_ENCODING:
- {
- VALUE encobj = rb_enc_from_encoding(rb_enc_find(data));
- return encobj;
- }
- }
-
- return ibf_load_object_unsupported(load, header, offset);
-}
-
-static void
-ibf_dump_object_complex_rational(struct ibf_dump *dump, VALUE obj)
-{
- long real = (long)ibf_dump_object(dump, RCOMPLEX(obj)->real);
- long imag = (long)ibf_dump_object(dump, RCOMPLEX(obj)->imag);
-
- IBF_WV(real);
- IBF_WV(imag);
-}
-
-static VALUE
-ibf_load_object_complex_rational(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const struct ibf_object_complex_rational *nums = IBF_OBJBODY(struct ibf_object_complex_rational, offset);
- VALUE a = ibf_load_object(load, nums->a);
- VALUE b = ibf_load_object(load, nums->b);
- VALUE obj = header->type == T_COMPLEX ?
- rb_complex_new(a, b) : rb_rational_new(a, b);
-
- if (header->internal) rb_obj_hide(obj);
- if (header->frozen) rb_obj_freeze(obj);
- return obj;
-}
-
-static void
-ibf_dump_object_symbol(struct ibf_dump *dump, VALUE obj)
-{
- VALUE str = rb_sym2str(obj);
- long str_index = (long)ibf_dump_object(dump, str);
- IBF_WV(str_index);
-}
-
-static VALUE
-ibf_load_object_symbol(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- /* const struct ibf_object_header *header = IBF_OBJHEADER(offset); */
- const struct ibf_object_symbol *symbol = IBF_OBJBODY(struct ibf_object_symbol, offset);
- VALUE str = ibf_load_object(load, symbol->str);
- ID id = rb_intern_str(str);
- return ID2SYM(id);
-}
-
-typedef void (*ibf_dump_object_function)(struct ibf_dump *dump, VALUE obj);
-static ibf_dump_object_function dump_object_functions[RUBY_T_MASK+1] = {
- ibf_dump_object_unsupported, /* T_NONE */
- ibf_dump_object_unsupported, /* T_OBJECT */
- ibf_dump_object_class, /* T_CLASS */
- ibf_dump_object_unsupported, /* T_MODULE */
- ibf_dump_object_float, /* T_FLOAT */
- ibf_dump_object_string, /* T_STRING */
- ibf_dump_object_regexp, /* T_REGEXP */
- ibf_dump_object_array, /* T_ARRAY */
- ibf_dump_object_hash, /* T_HASH */
- ibf_dump_object_struct, /* T_STRUCT */
- ibf_dump_object_bignum, /* T_BIGNUM */
- ibf_dump_object_unsupported, /* T_FILE */
- ibf_dump_object_data, /* T_DATA */
- ibf_dump_object_unsupported, /* T_MATCH */
- ibf_dump_object_complex_rational, /* T_COMPLEX */
- ibf_dump_object_complex_rational, /* T_RATIONAL */
- ibf_dump_object_unsupported, /* 0x10 */
- ibf_dump_object_unsupported, /* 0x11 T_NIL */
- ibf_dump_object_unsupported, /* 0x12 T_TRUE */
- ibf_dump_object_unsupported, /* 0x13 T_FALSE */
- ibf_dump_object_symbol, /* 0x14 T_SYMBOL */
- ibf_dump_object_unsupported, /* T_FIXNUM */
- ibf_dump_object_unsupported, /* T_UNDEF */
- ibf_dump_object_unsupported, /* 0x17 */
- ibf_dump_object_unsupported, /* 0x18 */
- ibf_dump_object_unsupported, /* 0x19 */
- ibf_dump_object_unsupported, /* T_IMEMO 0x1a */
- ibf_dump_object_unsupported, /* T_NODE 0x1b */
- ibf_dump_object_unsupported, /* T_ICLASS 0x1c */
- ibf_dump_object_unsupported, /* T_ZOMBIE 0x1d */
- ibf_dump_object_unsupported, /* 0x1e */
- ibf_dump_object_unsupported /* 0x1f */
-};
-
-static ibf_offset_t
-lbf_dump_object_object(struct ibf_dump *dump, VALUE obj)
-{
- struct ibf_object_header obj_header;
- ibf_offset_t current_offset = ibf_dump_pos(dump);
- obj_header.type = TYPE(obj);
-
- if (SPECIAL_CONST_P(obj)) {
- if (RB_TYPE_P(obj, T_SYMBOL) ||
- RB_TYPE_P(obj, T_FLOAT)) {
- obj_header.internal = FALSE;
- goto dump_object;
- }
- obj_header.special_const = TRUE;
- obj_header.frozen = TRUE;
- obj_header.internal = TRUE;
- IBF_WV(obj_header);
- IBF_WV(obj);
- }
- else {
- obj_header.internal = (RBASIC_CLASS(obj) == 0) ? TRUE : FALSE;
- dump_object:
- obj_header.special_const = FALSE;
- obj_header.frozen = FL_TEST(obj, FL_FREEZE) ? TRUE : FALSE;
- IBF_WV(obj_header);
- (*dump_object_functions[obj_header.type])(dump, obj);
- }
-
- return current_offset;
-}
-
-typedef VALUE (*ibf_load_object_function)(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t);
-static ibf_load_object_function load_object_functions[RUBY_T_MASK+1] = {
- ibf_load_object_unsupported, /* T_NONE */
- ibf_load_object_unsupported, /* T_OBJECT */
- ibf_load_object_class, /* T_CLASS */
- ibf_load_object_unsupported, /* T_MODULE */
- ibf_load_object_float, /* T_FLOAT */
- ibf_load_object_string, /* T_STRING */
- ibf_load_object_regexp, /* T_REGEXP */
- ibf_load_object_array, /* T_ARRAY */
- ibf_load_object_hash, /* T_HASH */
- ibf_load_object_struct, /* T_STRUCT */
- ibf_load_object_bignum, /* T_BIGNUM */
- ibf_load_object_unsupported, /* T_FILE */
- ibf_load_object_data, /* T_DATA */
- ibf_load_object_unsupported, /* T_MATCH */
- ibf_load_object_complex_rational, /* T_COMPLEX */
- ibf_load_object_complex_rational, /* T_RATIONAL */
- ibf_load_object_unsupported, /* 0x10 */
- ibf_load_object_unsupported, /* T_NIL */
- ibf_load_object_unsupported, /* T_TRUE */
- ibf_load_object_unsupported, /* T_FALSE */
- ibf_load_object_symbol,
- ibf_load_object_unsupported, /* T_FIXNUM */
- ibf_load_object_unsupported, /* T_UNDEF */
- ibf_load_object_unsupported, /* 0x17 */
- ibf_load_object_unsupported, /* 0x18 */
- ibf_load_object_unsupported, /* 0x19 */
- ibf_load_object_unsupported, /* T_IMEMO 0x1a */
- ibf_load_object_unsupported, /* T_NODE 0x1b */
- ibf_load_object_unsupported, /* T_ICLASS 0x1c */
- ibf_load_object_unsupported, /* T_ZOMBIE 0x1d */
- ibf_load_object_unsupported, /* 0x1e */
- ibf_load_object_unsupported /* 0x1f */
-};
-
-static VALUE
-ibf_load_object(const struct ibf_load *load, VALUE object_index)
-{
- if (object_index == 0) {
- return Qnil;
- }
- else if (object_index >= load->header->object_list_size) {
- rb_raise(rb_eIndexError, "object index out of range: %"PRIdVALUE, object_index);
- }
- else {
- VALUE obj = rb_ary_entry(load->obj_list, (long)object_index);
- if (obj == Qnil) { /* TODO: avoid multiple Qnil load */
- ibf_offset_t *offsets = (ibf_offset_t *)(load->header->object_list_offset + load->buff);
- ibf_offset_t offset = offsets[object_index];
- const struct ibf_object_header *header = IBF_OBJHEADER(offset);
-
- if (header->special_const) {
- VALUE *vp = IBF_OBJBODY(VALUE, offset);
- obj = *vp;
- }
- else {
- obj = (*load_object_functions[header->type])(load, header, offset);
- }
-
- rb_ary_store(load->obj_list, (long)object_index, obj);
- }
- iseq_add_mark_object(load->iseq, obj);
- return obj;
- }
-}
-
-static void
-ibf_dump_object_list(struct ibf_dump *dump, struct ibf_header *header)
-{
- VALUE list = rb_ary_tmp_new(RARRAY_LEN(dump->obj_list));
- int i, size;
-
- for (i=0; i<RARRAY_LEN(dump->obj_list); i++) {
- VALUE obj = RARRAY_AREF(dump->obj_list, i);
- ibf_offset_t offset = lbf_dump_object_object(dump, obj);
- rb_ary_push(list, UINT2NUM(offset));
- }
- size = i;
- header->object_list_offset = ibf_dump_pos(dump);
-
- for (i=0; i<size; i++) {
- ibf_offset_t offset = NUM2UINT(RARRAY_AREF(list, i));
- IBF_WV(offset);
- }
-
- header->object_list_size = size;
-}
-
-static void
-ibf_dump_mark(void *ptr)
-{
- struct ibf_dump *dump = (struct ibf_dump *)ptr;
- rb_gc_mark(dump->str);
- rb_gc_mark(dump->iseq_list);
- rb_gc_mark(dump->obj_list);
-}
-
-static void
-ibf_dump_free(void *ptr)
-{
- struct ibf_dump *dump = (struct ibf_dump *)ptr;
- if (dump->iseq_table) {
- st_free_table(dump->iseq_table);
- dump->iseq_table = 0;
- }
- if (dump->id_table) {
- st_free_table(dump->id_table);
- dump->id_table = 0;
- }
- ruby_xfree(dump);
-}
-
-static size_t
-ibf_dump_memsize(const void *ptr)
-{
- struct ibf_dump *dump = (struct ibf_dump *)ptr;
- size_t size = sizeof(*dump);
- if (dump->iseq_table) size += st_memsize(dump->iseq_table);
- if (dump->id_table) size += st_memsize(dump->id_table);
- return size;
-}
-
-static const rb_data_type_t ibf_dump_type = {
- "ibf_dump",
- {ibf_dump_mark, ibf_dump_free, ibf_dump_memsize,},
- 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-static void
-ibf_dump_setup(struct ibf_dump *dump, VALUE dumper_obj)
-{
- RB_OBJ_WRITE(dumper_obj, &dump->str, rb_str_new(0, 0));
- RB_OBJ_WRITE(dumper_obj, &dump->iseq_list, rb_ary_tmp_new(0));
- RB_OBJ_WRITE(dumper_obj, &dump->obj_list, rb_ary_tmp_new(1));
- rb_ary_push(dump->obj_list, Qnil); /* 0th is nil */
- dump->iseq_table = st_init_numtable(); /* need free */
- dump->id_table = st_init_numtable(); /* need free */
-
- ibf_table_index(dump->id_table, 0); /* id_index:0 is 0 */
-}
-
-VALUE
-iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt)
-{
- struct ibf_dump *dump;
- struct ibf_header header = {{0}};
- VALUE dump_obj;
- VALUE str;
-
- if (iseq->body->parent_iseq != NULL ||
- iseq->body->local_iseq != iseq) {
- rb_raise(rb_eRuntimeError, "should be top of iseq");
- }
- if (RTEST(ISEQ_COVERAGE(iseq))) {
- rb_raise(rb_eRuntimeError, "should not compile with coverage");
- }
-
- dump_obj = TypedData_Make_Struct(0, struct ibf_dump, &ibf_dump_type, dump);
- ibf_dump_setup(dump, dump_obj);
-
- ibf_dump_write(dump, &header, sizeof(header));
- ibf_dump_write(dump, RUBY_PLATFORM, strlen(RUBY_PLATFORM) + 1);
- ibf_dump_iseq(dump, iseq);
-
- header.magic[0] = 'Y'; /* YARB */
- header.magic[1] = 'A';
- header.magic[2] = 'R';
- header.magic[3] = 'B';
- header.major_version = ISEQ_MAJOR_VERSION;
- header.minor_version = ISEQ_MINOR_VERSION;
- ibf_dump_iseq_list(dump, &header);
- ibf_dump_id_list(dump, &header);
- ibf_dump_object_list(dump, &header);
- header.size = ibf_dump_pos(dump);
-
- if (RTEST(opt)) {
- VALUE opt_str = opt;
- const char *ptr = StringValuePtr(opt_str);
- header.extra_size = RSTRING_LENINT(opt_str);
- ibf_dump_write(dump, ptr, header.extra_size);
- }
- else {
- header.extra_size = 0;
- }
-
- ibf_dump_overwrite(dump, &header, sizeof(header), 0);
-
- str = dump->str;
- ibf_dump_free(dump);
- DATA_PTR(dump_obj) = NULL;
- RB_GC_GUARD(dump_obj);
- return str;
-}
-
-static const ibf_offset_t *
-ibf_iseq_list(const struct ibf_load *load)
-{
- return (ibf_offset_t *)(load->buff + load->header->iseq_list_offset);
-}
-
-void
-ibf_load_iseq_complete(rb_iseq_t *iseq)
-{
- struct ibf_load *load = RTYPEDDATA_DATA(iseq->aux.loader.obj);
- rb_iseq_t *prev_src_iseq = load->iseq;
- load->iseq = iseq;
- ibf_load_iseq_each(load, iseq, ibf_iseq_list(load)[iseq->aux.loader.index]);
- ISEQ_COMPILE_DATA(iseq) = NULL;
- FL_UNSET(iseq, ISEQ_NOT_LOADED_YET);
- load->iseq = prev_src_iseq;
-}
-
-#if USE_LAZY_LOAD
-const rb_iseq_t *
-rb_iseq_complete(const rb_iseq_t *iseq)
-{
- ibf_load_iseq_complete((rb_iseq_t *)iseq);
- return iseq;
-}
-#endif
-
-static rb_iseq_t *
-ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq)
-{
- int iseq_index = (int)(VALUE)index_iseq;
-
- if (iseq_index == -1) {
- return NULL;
- }
- else {
- VALUE iseqv = rb_ary_entry(load->iseq_list, iseq_index);
-
- if (iseqv != Qnil) {
- return (rb_iseq_t *)iseqv;
- }
- else {
- rb_iseq_t *iseq = iseq_imemo_alloc();
- FL_SET(iseq, ISEQ_NOT_LOADED_YET);
- iseq->aux.loader.obj = load->loader_obj;
- iseq->aux.loader.index = iseq_index;
- rb_ary_store(load->iseq_list, iseq_index, (VALUE)iseq);
-
-#if !USE_LAZY_LOAD
- ibf_load_iseq_complete(iseq);
-#endif /* !USE_LAZY_LOAD */
-
- if (load->iseq) {
- iseq_add_mark_object(load->iseq, (VALUE)iseq);
- }
- return iseq;
- }
- }
-}
-
-static void
-ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str)
-{
- rb_check_safe_obj(str);
-
- if (RSTRING_LENINT(str) < (int)sizeof(struct ibf_header)) {
- rb_raise(rb_eRuntimeError, "broken binary format");
- }
- RB_OBJ_WRITE(loader_obj, &load->str, str);
- load->loader_obj = loader_obj;
- load->buff = StringValuePtr(str);
- load->header = (struct ibf_header *)load->buff;
- RB_OBJ_WRITE(loader_obj, &load->iseq_list, rb_ary_tmp_new(0));
- RB_OBJ_WRITE(loader_obj, &load->obj_list, rb_ary_tmp_new(0));
- load->id_list = ZALLOC_N(ID, load->header->id_list_size);
- load->iseq = NULL;
-
- if (RSTRING_LENINT(str) < (int)load->header->size) {
- rb_raise(rb_eRuntimeError, "broken binary format");
- }
- if (strncmp(load->header->magic, "YARB", 4) != 0) {
- rb_raise(rb_eRuntimeError, "unknown binary format");
- }
- if (load->header->major_version != ISEQ_MAJOR_VERSION ||
- load->header->minor_version != ISEQ_MINOR_VERSION) {
- rb_raise(rb_eRuntimeError, "unmatched version file (%u.%u for %u.%u)",
- load->header->major_version, load->header->minor_version, ISEQ_MAJOR_VERSION, ISEQ_MINOR_VERSION);
- }
- if (strcmp(load->buff + sizeof(struct ibf_header), RUBY_PLATFORM) != 0) {
- rb_raise(rb_eRuntimeError, "unmatched platform");
- }
-}
-
-static void
-ibf_loader_mark(void *ptr)
-{
- if (ptr) {
- struct ibf_load *load = (struct ibf_load *)ptr;
- rb_gc_mark(load->str);
- rb_gc_mark(load->iseq_list);
- rb_gc_mark(load->obj_list);
- }
-}
-
-static void
-ibf_loader_free(void *ptr)
-{
- if (ptr) {
- struct ibf_load *load = (struct ibf_load *)ptr;
- ruby_xfree(load->id_list);
- ruby_xfree(load);
- }
-}
-
-static size_t
-ibf_loader_memsize(const void *ptr)
-{
- struct ibf_load *load = (struct ibf_load *)ptr;
- return sizeof(struct ibf_load) + load->header->id_list_size * sizeof(ID);
-}
-
-static const rb_data_type_t ibf_load_type = {
- "ibf_loader",
- {ibf_loader_mark, ibf_loader_free, ibf_loader_memsize,},
- 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-const rb_iseq_t *
-iseq_ibf_load(VALUE str)
-{
- struct ibf_load *load;
- const rb_iseq_t *iseq;
- VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
-
- ibf_load_setup(load, loader_obj, str);
- iseq = ibf_load_iseq(load, 0);
-
- RB_GC_GUARD(loader_obj);
- return iseq;
-}
-
-VALUE
-iseq_ibf_load_extra_data(VALUE str)
-{
- struct ibf_load *load;
- VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
- VALUE extra_str;
-
- ibf_load_setup(load, loader_obj, str);
- extra_str = rb_str_new(load->buff + load->header->size, load->header->extra_size);
- RB_GC_GUARD(loader_obj);
- return extra_str;
-}
-
diff --git a/complex.c b/complex.c
index 5199dcc7c2..2efe6a4676 100644
--- a/complex.c
+++ b/complex.c
@@ -5,13 +5,9 @@
which is written in ruby.
*/
-#include "ruby/config.h"
-#if defined _MSC_VER
-/* Microsoft Visual C does not define M_PI and others by default */
-# define _USE_MATH_DEFINES 1
-#endif
-#include <math.h>
+#include "ruby.h"
#include "internal.h"
+#include <math.h>
#define NDEBUG
#include <assert.h>
@@ -19,21 +15,13 @@
#define ZERO INT2FIX(0)
#define ONE INT2FIX(1)
#define TWO INT2FIX(2)
-#define RFLOAT_0 DBL2NUM(0)
-#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
- !defined(signbit)
-extern int signbit(double);
-#endif
VALUE rb_cComplex;
-static VALUE nucomp_abs(VALUE self);
-static VALUE nucomp_arg(VALUE self);
-
-static ID id_abs, id_arg, id_convert,
- id_denominator, id_eqeq_p, id_expt, id_fdiv,
- id_negate, id_numerator, id_quo,
- id_real_p, id_to_f, id_to_i, id_to_r,
+static ID id_abs, id_abs2, id_arg, id_cmp, id_conj, id_convert,
+ id_denominator, id_divmod, id_eqeq_p, id_expt, id_fdiv, id_floor,
+ id_idiv, id_imag, id_inspect, id_negate, id_numerator, id_quo,
+ id_real, id_real_p, id_to_f, id_to_i, id_to_r, id_to_s,
id_i_real, id_i_imag;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -88,6 +76,20 @@ f_add(VALUE x, VALUE y)
}
inline static VALUE
+f_cmp(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y)) {
+ long c = FIX2LONG(x) - FIX2LONG(y);
+ if (c > 0)
+ c = 1;
+ else if (c < 0)
+ c = -1;
+ return INT2FIX(c);
+ }
+ return rb_funcall(x, id_cmp, 1, y);
+}
+
+inline static VALUE
f_div(VALUE x, VALUE y)
{
if (FIXNUM_P(y) && FIX2LONG(y) == 1)
@@ -104,6 +106,16 @@ f_gt_p(VALUE x, VALUE y)
}
inline static VALUE
+f_lt_p(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
+ return rb_funcall(x, '<', 1, y);
+}
+
+binop(mod, '%')
+
+inline static VALUE
f_mul(VALUE x, VALUE y)
{
#ifndef PRESERVE_SIGNEDZERO
@@ -140,10 +152,16 @@ f_sub(VALUE x, VALUE y)
}
fun1(abs)
+fun1(abs2)
fun1(arg)
+fun1(conj)
fun1(denominator)
+fun1(floor)
+fun1(imag)
+fun1(inspect)
fun1(negate)
fun1(numerator)
+fun1(real)
fun1(real_p)
inline static VALUE
@@ -162,6 +180,9 @@ f_to_f(VALUE x)
}
fun1(to_r)
+fun1(to_s)
+
+fun2(divmod)
inline static VALUE
f_eqeq_p(VALUE x, VALUE y)
@@ -173,6 +194,7 @@ f_eqeq_p(VALUE x, VALUE y)
fun2(expt)
fun2(fdiv)
+fun2(idiv)
fun2(quo)
inline static VALUE
@@ -188,16 +210,17 @@ f_negative_p(VALUE x)
inline static VALUE
f_zero_p(VALUE x)
{
- if (RB_TYPE_P(x, T_FIXNUM)) {
+ switch (TYPE(x)) {
+ case T_FIXNUM:
return f_boolcast(FIX2LONG(x) == 0);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
+ case T_BIGNUM:
return Qfalse;
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- VALUE num = RRATIONAL(x)->num;
+ case T_RATIONAL:
+ {
+ VALUE num = RRATIONAL(x)->num;
- return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
+ }
}
return rb_funcall(x, id_eqeq_p, 1, ZERO);
}
@@ -207,18 +230,19 @@ f_zero_p(VALUE x)
inline static VALUE
f_one_p(VALUE x)
{
- if (RB_TYPE_P(x, T_FIXNUM)) {
+ switch (TYPE(x)) {
+ case T_FIXNUM:
return f_boolcast(FIX2LONG(x) == 1);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
+ case T_BIGNUM:
return Qfalse;
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- VALUE num = RRATIONAL(x)->num;
- VALUE den = RRATIONAL(x)->den;
+ case T_RATIONAL:
+ {
+ VALUE num = RRATIONAL(x)->num;
+ VALUE den = RRATIONAL(x)->den;
- return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
- FIXNUM_P(den) && FIX2LONG(den) == 1);
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
+ FIXNUM_P(den) && FIX2LONG(den) == 1);
+ }
}
return rb_funcall(x, id_eqeq_p, 1, ONE);
}
@@ -236,6 +260,12 @@ k_numeric_p(VALUE x)
}
inline static VALUE
+k_integer_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cInteger);
+}
+
+inline static VALUE
k_fixnum_p(VALUE x)
{
return f_kind_of_p(x, rb_cFixnum);
@@ -266,8 +296,10 @@ k_complex_p(VALUE x)
}
#define k_exact_p(x) (!k_float_p(x))
+#define k_inexact_p(x) k_float_p(x)
#define k_exact_zero_p(x) (k_exact_p(x) && f_zero_p(x))
+#define k_exact_one_p(x) (k_exact_p(x) && f_one_p(x))
#define get_dat1(x) \
struct RComplex *dat;\
@@ -281,10 +313,10 @@ k_complex_p(VALUE x)
inline static VALUE
nucomp_s_new_internal(VALUE klass, VALUE real, VALUE imag)
{
- NEWOBJ_OF(obj, struct RComplex, klass, T_COMPLEX | (RGENGC_WB_PROTECTED_COMPLEX ? FL_WB_PROTECTED : 0));
+ NEWOBJ_OF(obj, struct RComplex, klass, T_COMPLEX);
- RCOMPLEX_SET_REAL(obj, real);
- RCOMPLEX_SET_IMAG(obj, imag);
+ obj->real = real;
+ obj->imag = imag;
return (VALUE)obj;
}
@@ -346,17 +378,18 @@ nucomp_canonicalization(int f)
{
canonicalization = f;
}
-#else
-#define canonicalization 0
#endif
inline static void
nucomp_real_check(VALUE num)
{
- if (!RB_TYPE_P(num, T_FIXNUM) &&
- !RB_TYPE_P(num, T_BIGNUM) &&
- !RB_TYPE_P(num, T_FLOAT) &&
- !RB_TYPE_P(num, T_RATIONAL)) {
+ switch (TYPE(num)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ case T_RATIONAL:
+ break;
+ default:
if (!k_numeric_p(num) || !f_real_p(num))
rb_raise(rb_eTypeError, "not a real");
}
@@ -429,6 +462,13 @@ nucomp_s_new(int argc, VALUE *argv, VALUE klass)
}
inline static VALUE
+f_complex_new1(VALUE klass, VALUE x)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_canonicalize_internal(klass, x, ZERO);
+}
+
+inline static VALUE
f_complex_new2(VALUE klass, VALUE x, VALUE y)
{
assert(!k_complex_p(x));
@@ -443,30 +483,6 @@ f_complex_new2(VALUE klass, VALUE x, VALUE y)
*
* Complex(1, 2) #=> (1+2i)
* Complex('1+2i') #=> (1+2i)
- * Complex(nil) #=> TypeError
- * Complex(1, nil) #=> TypeError
- *
- * Syntax of string form:
- *
- * string form = extra spaces , complex , extra spaces ;
- * complex = real part | [ sign ] , imaginary part
- * | real part , sign , imaginary part
- * | rational , "@" , rational ;
- * real part = rational ;
- * imaginary part = imaginary unit | unsigned rational , imaginary unit ;
- * rational = [ sign ] , unsigned rational ;
- * unsigned rational = numerator | numerator , "/" , denominator ;
- * numerator = integer part | fractional part | integer part , fractional part ;
- * denominator = digits ;
- * integer part = digits ;
- * fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ;
- * imaginary unit = "i" | "I" | "j" | "J" ;
- * sign = "-" | "+" ;
- * digits = digit , { digit | "_" , digit };
- * digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
- * extra spaces = ? \s* ? ;
- *
- * See String#to_c.
*/
static VALUE
nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
@@ -504,6 +520,7 @@ m_log_bang(VALUE x)
imp1(sin)
imp1(sinh)
+imp1(sqrt)
static VALUE
m_cos(VALUE x)
@@ -536,8 +553,6 @@ m_sin(VALUE x)
}
#if 0
-imp1(sqrt)
-
static VALUE
m_sqrt(VALUE x)
{
@@ -561,44 +576,11 @@ m_sqrt(VALUE x)
}
#endif
-static VALUE
+inline static VALUE
f_complex_polar(VALUE klass, VALUE x, VALUE y)
{
assert(!k_complex_p(x));
assert(!k_complex_p(y));
- if (f_zero_p(x) || f_zero_p(y)) {
- if (canonicalization) return x;
- return nucomp_s_new_internal(klass, x, RFLOAT_0);
- }
- if (RB_FLOAT_TYPE_P(y)) {
- const double arg = RFLOAT_VALUE(y);
- if (arg == M_PI) {
- x = f_negate(x);
- if (canonicalization) return x;
- y = RFLOAT_0;
- }
- else if (arg == M_PI_2) {
- y = x;
- x = RFLOAT_0;
- }
- else if (arg == M_PI_2+M_PI) {
- y = f_negate(x);
- x = RFLOAT_0;
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- const double abs = RFLOAT_VALUE(x);
- const double real = abs * cos(arg), imag = abs * sin(arg);
- x = DBL2NUM(real);
- if (canonicalization && imag == 0.0) return x;
- y = DBL2NUM(imag);
- }
- else {
- y = f_mul(x, DBL2NUM(sin(arg)));
- x = f_mul(x, DBL2NUM(cos(arg)));
- if (canonicalization && f_zero_p(y)) return x;
- }
- return nucomp_s_new_internal(klass, x, y);
- }
return nucomp_s_canonicalize_internal(klass,
f_mul(x, m_cos(y)),
f_mul(x, m_sin(y)));
@@ -623,8 +605,8 @@ nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
switch (rb_scan_args(argc, argv, "11", &abs, &arg)) {
case 1:
nucomp_real_check(abs);
- if (canonicalization) return abs;
- return nucomp_s_new_internal(klass, abs, ZERO);
+ arg = ZERO;
+ break;
default:
nucomp_real_check(abs);
nucomp_real_check(arg);
@@ -717,12 +699,11 @@ f_addsub(VALUE self, VALUE other,
* Complex(9, 8) + 4 #=> (13+8i)
* Complex(20, 9) + 9.8 #=> (29.8+9i)
*/
-VALUE
-rb_nucomp_add(VALUE self, VALUE other)
+static VALUE
+nucomp_add(VALUE self, VALUE other)
{
return f_addsub(self, other, f_add, '+');
}
-#define nucomp_add rb_nucomp_add
/*
* call-seq:
@@ -742,19 +723,6 @@ nucomp_sub(VALUE self, VALUE other)
return f_addsub(self, other, f_sub, '-');
}
-static VALUE
-safe_mul(VALUE a, VALUE b, int az, int bz)
-{
- double v;
- if (!az && bz && RB_FLOAT_TYPE_P(a) && (v = RFLOAT_VALUE(a), !isnan(v))) {
- a = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
- }
- if (!bz && az && RB_FLOAT_TYPE_P(b) && (v = RFLOAT_VALUE(b), !isnan(v))) {
- b = signbit(v) ? DBL2NUM(-1.0) : DBL2NUM(1.0);
- }
- return f_mul(a, b);
-}
-
/*
* call-seq:
* cmp * numeric -> complex
@@ -767,24 +735,18 @@ safe_mul(VALUE a, VALUE b, int az, int bz)
* Complex(9, 8) * 4 #=> (36+32i)
* Complex(20, 9) * 9.8 #=> (196.0+88.2i)
*/
-VALUE
-rb_nucomp_mul(VALUE self, VALUE other)
+static VALUE
+nucomp_mul(VALUE self, VALUE other)
{
if (k_complex_p(other)) {
VALUE real, imag;
- VALUE areal, aimag, breal, bimag;
- int arzero, aizero, brzero, bizero;
get_dat2(self, other);
- arzero = !!f_zero_p(areal = adat->real);
- aizero = !!f_zero_p(aimag = adat->imag);
- brzero = !!f_zero_p(breal = bdat->real);
- bizero = !!f_zero_p(bimag = bdat->imag);
- real = f_sub(safe_mul(areal, breal, arzero, brzero),
- safe_mul(aimag, bimag, aizero, bizero));
- imag = f_add(safe_mul(areal, bimag, arzero, bizero),
- safe_mul(aimag, breal, aizero, brzero));
+ real = f_sub(f_mul(adat->real, bdat->real),
+ f_mul(adat->imag, bdat->imag));
+ imag = f_add(f_mul(adat->real, bdat->imag),
+ f_mul(adat->imag, bdat->real));
return f_complex_new2(CLASS_OF(self), real, imag);
}
@@ -797,7 +759,6 @@ rb_nucomp_mul(VALUE self, VALUE other)
}
return rb_num_coerce_bin(self, other, '*');
}
-#define nucomp_mul rb_nucomp_mul
inline static VALUE
f_divide(VALUE self, VALUE other,
@@ -1020,8 +981,8 @@ nucomp_coerce(VALUE self, VALUE other)
if (RB_TYPE_P(other, T_COMPLEX))
return rb_assoc_new(other, self);
- rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
- rb_obj_class(other), rb_obj_class(self));
+ rb_raise(rb_eTypeError, "%s can't be coerced into %s",
+ rb_obj_classname(other), rb_obj_classname(self));
return Qnil;
}
@@ -1255,9 +1216,15 @@ nucomp_eql_p(VALUE self, VALUE other)
inline static VALUE
f_signbit(VALUE x)
{
- if (RB_TYPE_P(x, T_FLOAT)) {
+#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
+ !defined(signbit)
+ extern int signbit(double);
+#endif
+ switch (TYPE(x)) {
+ case T_FLOAT: {
double f = RFLOAT_VALUE(x);
return f_boolcast(!isnan(f) && signbit(f));
+ }
}
return f_negative_p(x);
}
@@ -1303,7 +1270,7 @@ f_format(VALUE self, VALUE (*func)(VALUE))
static VALUE
nucomp_to_s(VALUE self)
{
- return f_format(self, rb_String);
+ return f_format(self, f_to_s);
}
/*
@@ -1324,7 +1291,7 @@ nucomp_inspect(VALUE self)
VALUE s;
s = rb_usascii_str_new2("(");
- rb_str_concat(s, f_format(self, rb_inspect));
+ rb_str_concat(s, f_format(self, f_inspect));
rb_str_cat2(s, ")");
return s;
@@ -1343,8 +1310,8 @@ nucomp_loader(VALUE self, VALUE a)
{
get_dat1(self);
- RCOMPLEX_SET_REAL(dat, rb_ivar_get(a, id_i_real));
- RCOMPLEX_SET_IMAG(dat, rb_ivar_get(a, id_i_imag));
+ dat->real = rb_ivar_get(a, id_i_real);
+ dat->imag = rb_ivar_get(a, id_i_imag);
return self;
}
@@ -1357,7 +1324,6 @@ nucomp_marshal_dump(VALUE self)
get_dat1(self);
a = rb_assoc_new(dat->real, dat->imag);
- rb_copy_generic_ivar(a, self);
return a;
}
@@ -1368,8 +1334,8 @@ nucomp_marshal_load(VALUE self, VALUE a)
Check_Type(a, T_ARRAY);
if (RARRAY_LEN(a) != 2)
rb_raise(rb_eArgError, "marshaled complex must have an array whose length is 2 but %ld", RARRAY_LEN(a));
- rb_ivar_set(self, id_i_real, RARRAY_AREF(a, 0));
- rb_ivar_set(self, id_i_imag, RARRAY_AREF(a, 1));
+ rb_ivar_set(self, id_i_real, RARRAY_PTR(a)[0]);
+ rb_ivar_set(self, id_i_imag, RARRAY_PTR(a)[1]);
return self;
}
@@ -1404,20 +1370,6 @@ rb_Complex(VALUE x, VALUE y)
return nucomp_s_convert(2, a, rb_cComplex);
}
-VALUE
-rb_complex_set_real(VALUE cmp, VALUE r)
-{
- RCOMPLEX_SET_REAL(cmp, r);
- return cmp;
-}
-
-VALUE
-rb_complex_set_imag(VALUE cmp, VALUE i)
-{
- RCOMPLEX_SET_IMAG(cmp, i);
- return cmp;
-}
-
/*
* call-seq:
* cmp.to_i -> integer
@@ -1434,9 +1386,10 @@ nucomp_to_i(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
- rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Integer",
- self);
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Integer",
+ StringValuePtr(s));
}
return f_to_i(dat->real);
}
@@ -1457,9 +1410,10 @@ nucomp_to_f(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
- rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
- self);
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Float",
+ StringValuePtr(s));
}
return f_to_f(dat->real);
}
@@ -1482,9 +1436,10 @@ nucomp_to_r(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
- rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
- self);
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Rational",
+ StringValuePtr(s));
}
return f_to_r(dat->real);
}
@@ -1509,9 +1464,10 @@ nucomp_rationalize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", NULL);
- if (!k_exact_zero_p(dat->imag)) {
- rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
- self);
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Rational",
+ StringValuePtr(s));
}
return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
}
@@ -1696,6 +1652,8 @@ isimagunit(int c)
c == 'j' || c == 'J');
}
+VALUE rb_cstr_to_rat(const char *, int);
+
static VALUE
str2num(char *s)
{
@@ -1800,26 +1758,19 @@ parse_comp(const char *s, int strict,
VALUE *num)
{
char *buf, *b;
- VALUE tmp;
- int ret = 1;
- buf = ALLOCV_N(char, tmp, strlen(s) + 1);
+ buf = ALLOCA_N(char, strlen(s) + 1);
b = buf;
skip_ws(&s);
- if (!read_comp(&s, strict, num, &b)) {
- ret = 0;
- }
- else {
- skip_ws(&s);
-
- if (strict)
- if (*s != '\0')
- ret = 0;
- }
- ALLOCV_END(tmp);
+ if (!read_comp(&s, strict, num, &b))
+ return 0;
+ skip_ws(&s);
- return ret;
+ if (strict)
+ if (*s != '\0')
+ return 0;
+ return 1;
}
static VALUE
@@ -1845,8 +1796,9 @@ string_to_c_strict(VALUE self)
s = (char *)"";
if (!parse_comp(s, 1, &num)) {
- rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
- self);
+ VALUE ins = f_inspect(self);
+ rb_raise(rb_eArgError, "invalid value for convert(): %s",
+ StringValuePtr(ins));
}
return num;
@@ -1872,8 +1824,6 @@ string_to_c_strict(VALUE self)
* '-0.0-0.0i'.to_c #=> (-0.0-0.0i)
* '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i)
* 'ruby'.to_c #=> (0+0i)
- *
- * See Kernel.Complex.
*/
static VALUE
string_to_c(VALUE self)
@@ -1912,17 +1862,30 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
backref = rb_backref_get();
rb_match_busy(backref);
- if (RB_TYPE_P(a1, T_STRING)) {
+ switch (TYPE(a1)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ break;
+ case T_STRING:
a1 = string_to_c_strict(a1);
+ break;
}
- if (RB_TYPE_P(a2, T_STRING)) {
+ switch (TYPE(a2)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_FLOAT:
+ break;
+ case T_STRING:
a2 = string_to_c_strict(a2);
+ break;
}
rb_backref_set(backref);
- if (RB_TYPE_P(a1, T_COMPLEX)) {
+ switch (TYPE(a1)) {
+ case T_COMPLEX:
{
get_dat1(a1);
@@ -1931,7 +1894,8 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
}
}
- if (RB_TYPE_P(a2, T_COMPLEX)) {
+ switch (TYPE(a2)) {
+ case T_COMPLEX:
{
get_dat1(a2);
@@ -1940,7 +1904,8 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
}
}
- if (RB_TYPE_P(a1, T_COMPLEX)) {
+ switch (TYPE(a1)) {
+ case T_COMPLEX:
if (argc == 1 || (k_exact_zero_p(a2)))
return a1;
}
@@ -2028,7 +1993,6 @@ numeric_arg(VALUE self)
/*
* call-seq:
* num.rect -> array
- * num.rectangular -> array
*
* Returns an array; [num, 0].
*/
@@ -2087,10 +2051,9 @@ float_arg(VALUE self)
* and i is imaginary unit. Real a equals complex a+0i
* mathematically.
*
- * Complex object can be created as literal, and also by using
- * Kernel#Complex, Complex::rect, Complex::polar or to_c method.
+ * In ruby, you can create complex object with Complex, Complex::rect,
+ * Complex::polar or to_c method.
*
- * 2+1i #=> (2+1i)
* Complex(1) #=> (1+0i)
* Complex(2, 3) #=> (2+3i)
* Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
@@ -2124,19 +2087,29 @@ Init_Complex(void)
assert(fprintf(stderr, "assert() is now active\n"));
id_abs = rb_intern("abs");
+ id_abs2 = rb_intern("abs2");
id_arg = rb_intern("arg");
+ id_cmp = rb_intern("<=>");
+ id_conj = rb_intern("conj");
id_convert = rb_intern("convert");
id_denominator = rb_intern("denominator");
+ id_divmod = rb_intern("divmod");
id_eqeq_p = rb_intern("==");
id_expt = rb_intern("**");
id_fdiv = rb_intern("fdiv");
+ id_floor = rb_intern("floor");
+ id_idiv = rb_intern("div");
+ id_imag = rb_intern("imag");
+ id_inspect = rb_intern("inspect");
id_negate = rb_intern("-@");
id_numerator = rb_intern("numerator");
id_quo = rb_intern("quo");
+ id_real = rb_intern("real");
id_real_p = rb_intern("real?");
id_to_f = rb_intern("to_f");
id_to_i = rb_intern("to_i");
id_to_r = rb_intern("to_r");
+ id_to_s = rb_intern("to_s");
id_i_real = rb_intern("@real");
id_i_imag = rb_intern("@image"); /* @image, not @imag */
@@ -2176,6 +2149,10 @@ Init_Complex(void)
rb_undef_method(rb_cComplex, "truncate");
rb_undef_method(rb_cComplex, "i");
+#if 0 /* NUBY */
+ rb_undef_method(rb_cComplex, "//");
+#endif
+
rb_define_method(rb_cComplex, "real", nucomp_real, 0);
rb_define_method(rb_cComplex, "imaginary", nucomp_imag, 0);
rb_define_method(rb_cComplex, "imag", nucomp_imag, 0);
@@ -2223,11 +2200,8 @@ Init_Complex(void)
rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
- rb_undef_method(rb_cComplex, "positive?");
- rb_undef_method(rb_cComplex, "negative?");
-
rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
- compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject); /* :nodoc: */
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject);
rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
@@ -2269,8 +2243,6 @@ Init_Complex(void)
*/
rb_define_const(rb_cComplex, "I",
f_complex_new_bang2(rb_cComplex, ZERO, ONE));
-
- rb_provide("complex.so"); /* for backward compatibility */
}
/*
diff --git a/configure.in b/configure.in
index 29b63c2401..b87b325248 100644
--- a/configure.in
+++ b/configure.in
@@ -3,38 +3,12 @@ AC_INIT()
{
AC_CONFIG_AUX_DIR(tool)
-AC_PREREQ(2.67)
+AC_PREREQ(2.60)
AC_DEFUN([RUBY_PREREQ_AC],
[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), [-1],
AC_MSG_ERROR([Autoconf version ]$1[ or higher is required]$2))])
-AC_DISABLE_OPTION_CHECKING
-
-AC_ARG_VAR([cflags], [additional CFLAGS])
-AC_ARG_VAR([cppflags], [additional CPPFLAGS])
-AC_ARG_VAR([cxxflags], [additional CXXFLAGS])
-
-AC_DEFUN([RUBY_RM_RECURSIVE], [
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [2.70]), [-1], [
-# suppress error messages, rm: cannot remove 'conftest.dSYM', from
-# AC_EGREP_CPP with CFLAGS=-g on Darwin.
-#
-# TODO: remove this hack when AC_PREREQ() becomes 2.70 or later.
-AS_CASE([$build_os], [darwin*], [
-rm() {
- rm_recursive=''
- for arg do
- AS_CASE("$arg",
- [--*], [],
- [-*r*], [break],
- [conftest.*], [if test -d "$arg"; then rm_recursive=-r; break; fi],
- [])
- done
- command rm $rm_recursive "[$]@"
-}
-])])])
-
{ # environment section
AC_ARG_WITH(baseruby,
@@ -43,20 +17,16 @@ AC_ARG_WITH(baseruby,
AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
],
[
- AC_PATH_PROG([BASERUBY], [ruby], [false])
+ BASERUBY="ruby"
])
-if test "`RUBYOPT=- $BASERUBY -e 'print 42' 2>/dev/null`" = 42; then
- if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42' 2>/dev/null`" = 42; then
+if test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42; then
+ if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'p 42' 2>/dev/null`" = 42; then
BASERUBY="$BASERUBY --disable=gems"
fi
- $BASERUBY -C "$srcdir/tool" downloader.rb -e gnu config.guess config.sub
- HAVE_BASERUBY=yes
else
BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
- HAVE_BASERUBY=no
fi
AC_SUBST(BASERUBY)
-AC_SUBST(HAVE_BASERUBY)
AC_DEFUN([RUBY_MINGW32],
[AS_CASE(["$host_os"],
@@ -102,15 +72,8 @@ AC_DEFUN([RUBY_NACL],
[no], [nacl_cv_build_variant=glibc],
[yes], [nacl_cv_build_variant=newlib])])
- AS_CASE(["$target_cpu"],
- [x86_64], [nacl_cv_cpu_nick=x86
- nacl_cv_cpu_nick2=x86_64],
- [i?86], [nacl_cv_cpu_nick=x86
- nacl_cv_cpu_nick2=x86_32],
- [le32], [nacl_cv_cpu_nick=pnacl
- nacl_cv_cpu_nick2=pnacl
- ac_cv_exeext=.pexe],
- [nacl_cv_cpu_nick=$target_cpu])
+ AS_CASE(["$build_cpu"],
+ [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
AS_CASE(["$build_os"],
[linux*], [nacl_cv_os_nick=linux],
[darwin*], [nacl_cv_os_nick=mac],
@@ -121,15 +84,9 @@ AC_DEFUN([RUBY_NACL],
ac_tool_prefix="$host_cpu-nacl-"
AC_MSG_CHECKING([NativeClient toolchain])
- if test x"$nacl_cv_cpu_nick" = xpnacl; then
- NACL_TOOLCHAIN="${nacl_cv_os_nick}_pnacl"
- ac_tool_prefix=pnacl-
- elif test -d \
+ if test -d \
"${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
- elif test -d \
- "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
- NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
else
AS_CASE(
["${nacl_cv_build_variant}"],
@@ -157,32 +114,10 @@ AC_DEFUN([RUBY_NACL],
if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
fi
- AC_MSG_RESULT(${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin)
-
- RUBY_APPEND_OPTIONS(XCFLAGS, '-I$(NACL_SDK_ROOT)/include')
- if test x"${nacl_cv_cpu_nick}" = xpnacl; then
- RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/pnacl')
- elif test x"${nacl_cv_build_variant}" = xnewlib; then
- RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/newlib')
- fi
-
- AC_MSG_CHECKING([nacl library path])
- if test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"; then
- nacl_cv_libpath="${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}"
- elif test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"; then
- nacl_cv_libpath="${nacl_cv_cpu_nick2}"
- else
- AC_MSG_ERROR([not found])
- fi
- AC_MSG_RESULT([${nacl_cv_libpath}])
- RUBY_APPEND_OPTIONS(XLDFLAGS, '-L$(NACL_SDK_ROOT)/'"lib/${nacl_cv_libpath}/Release")
AC_SUBST(NACL_TOOLCHAIN)
AC_SUBST(NACL_SDK_ROOT)
- AC_SUBST(NACL_SDK_VARIANT, "${nacl_cv_build_variant}")
- AC_SUBST(NACL_LIB_PATH, "${nacl_cv_libpath}")
- AC_CHECK_TOOLS(CC, [clang gcc])
- AC_CHECK_TOOLS(CXX, [clang++ g++])
+ AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
])])
AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
@@ -235,11 +170,11 @@ AC_SUBST(MINOR)
AC_SUBST(TEENY)
RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
AC_SUBST(RUBY_PROGRAM_VERSION)
-RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
+RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
+AC_SUBST(RUBY_RELEASE_DATE)
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
AC_CANONICAL_BUILD
-RUBY_RM_RECURSIVE
AC_ARG_WITH(gcc,
AS_HELP_STRING([--without-gcc], [never use gcc]),
[
@@ -254,85 +189,46 @@ then
(it is also a good idea to do 'make clean' before compiling))
fi
AS_CASE(["$build_os"],
- [darwin1*.*], [
+ [darwin11.*], [
AS_CASE(["x$CC"],
[xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
[xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
[xcc|x/usr/bin/cc], [: ${CXX=c++}],
- [xicc], [: ${CXX=icpc}],
[xclang|x/usr/bin/clang], [: ${CXX=clang++}])
])
test -z "$CC" || ac_cv_prog_CC="$CC"
-test -z "$CXX" || ac_cv_prog_CXX="$CXX"
if test "$program_prefix" = NONE; then
program_prefix=
fi
-if test "$prefix" -ef .; then
- AC_MSG_ERROR(--prefix cannot be the current working directory.)
-fi
RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME)
AC_SUBST(RUBYW_BASE_NAME)
-AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
AC_CANONICAL_TARGET
-test x"$target_alias" = x &&
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
-AC_ARG_WITH(os-version-style,
- AS_HELP_STRING([--with-os-version-style=TYPE],
- [OS version number for target and target_os [[full]]]
- [(full|teeny|minor+0|minor|major+0|major|none)]),
- [os_version_style=$withval],
- [os_version_style=full
- AS_CASE($target_os, [[*[0-9].*]],
- [AS_CASE([`/usr/bin/ruby -e 'puts RUBY_PLATFORM' 2>/dev/null`],
- [[*-*[0-9].*.0]], [os_version_style=minor+0],
- [[*-*[0-9].*.*]], [os_version_style=full],
- [[*-*[0-9].0] ], [os_version_style=major+0],
- [[*-*[0-9].*] ], [os_version_style=minor],
- [[*-*[0-9]] ], [os_version_style=major],
- )])
- ])
-os_version_style_transform=
-AS_CASE("${os_version_style}",
- [full|teeny], [],
- [minor+0], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1.0/']],
- [minor], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1/']],
- [major+0], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1.0/']],
- [major], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1/']],
- [none], [os_version_style_transform=['s/[0-9]\.[0-9][.0-9]*$//']],
- [AC_MSG_ERROR(unknown --with-os-version-style: $withval)])
-AS_IF([test -z "$target_alias" -a -n "$os_version_style_transform"],
- [
- target=`echo ${target} | sed "$os_version_style_transform"`
- target_os=`echo ${target_os} | sed "$os_version_style_transform"`
- ])
-
AC_DEFUN([RUBY_APPEND_OPTION],
- [# RUBY_APPEND_OPTION($1)
+ [# RUBY_APPEND_OPTION($1, $2)
AS_CASE([" [$]{$1-} "],
[*' $2 '*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
AC_DEFUN([RUBY_APPEND_OPTIONS],
- [# RUBY_APPEND_OPTIONS($1)
- for rb_opt in $2; do
+ [{ for rb_opt in $2; do # RUBY_APPEND_OPTIONS($1, $2)
AS_CASE([" [$]{$1-} "],
[*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
- done])
+ done; }])
AC_DEFUN([RUBY_PREPEND_OPTION],
- [# RUBY_PREPEND_OPTION($1)
+ [# RUBY_PREPEND_OPTION($1, $2)
AS_CASE([" [$]{$1-} "],
[*' $2 '*], [], [' '], [ $1="$2"], [ $1="$2 [$]$1"])])
AC_DEFUN([RUBY_PREPEND_OPTIONS],
- [# RUBY_PREPEND_OPTIONS($1)
- unset rb_opts; for rb_opt in $2; do
+ [{ unset rb_opts; for rb_opt in $2; do # RUBY_PREPEND_OPTIONS($1, $2)
AS_CASE([" [$]{rb_opts} [$]{$1-} "],
[*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
done
- $1="[$]{rb_opts}[$]$1"])
+ $1="[$]{rb_opts}[$]$1"; }])
AC_ARG_WITH(arch,
AS_HELP_STRING([--with-arch=ARCHS],
@@ -355,11 +251,9 @@ AC_MSG_RESULT([$ARCH_FLAG])
AC_DEFUN([RUBY_UNIVERSAL_ARCH], [
# RUBY_UNIVERSAL_ARCH begin
-ARCH_FLAG=`expr " $CXXFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
-test ${CXXFLAGS+set} && CXXFLAGS=`echo "$CXXFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
ARCH_FLAG=`expr " $CFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
-test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
-test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']`
+test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
+test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
unset universal_binary universal_archnames
if test ${target_archs+set}; then
AC_MSG_CHECKING([target architectures])
@@ -388,6 +282,7 @@ if test ${target_archs+set}; then
target=`echo $target | sed "s/^$target_cpu-/-/"`
target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
if test "${universal_binary-no}" = yes; then
+ RUBY_PREREQ_AC(2.63, [ to compile universal binary])
AC_SUBST(try_header,try_compile)
target_cpu=universal
real_cross_compiling=$cross_compiling
@@ -437,8 +332,8 @@ else
rb_cv_target_archs=${target_archs}
fi
if test "x${ARCH_FLAG}" != x; then
- CFLAGS="${CFLAGS:+$CFLAGS }${ARCH_FLAG}"
- LDFLAGS="${LDFLAGS:+$LDFLAGS }${ARCH_FLAG}"
+ CFLAGS="$CFLAGS ${ARCH_FLAG}"
+ LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
fi
# RUBY_UNIVERSAL_ARCH end
])
@@ -472,18 +367,7 @@ fi
RUBY_NACL
AS_CASE(["$host_os:$build_os"],
[darwin*:darwin*], [
- AC_CHECK_TOOLS(CC, [clang gcc cc])
- # Following Apple deployed clang are broken
- # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported)
- # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)
- # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
- if ! $CC -E -xc - <<SRC >/dev/null; then
- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
- @%:@error premature clang
- @%:@endif
-SRC
- AC_MSG_ERROR([clang version 3.0 or later is required])
- fi
+ AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
])
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
@@ -501,11 +385,7 @@ AC_SUBST(LD)
if test "$GCC" = yes; then
linker_flag=-Wl,
: ${optflags=-O3}
- gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'`
- gcc_minor=`echo =__GNUC_MINOR__ | $CC -E -xc - | sed '/^=/!d;s///'`
- test -n "$gcc_major" || gcc_major=0
- test -n "$gcc_minor" || gcc_minor=0
- # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
+ RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
else
linker_flag=
fi
@@ -518,44 +398,11 @@ RUBY_CPPOUTFILE
AC_SUBST(OUTFLAG)
AC_SUBST(COUTFLAG)
-cc_version=
-for option in --version -v -V -qversion; do
- cc_version_message=`$CC $option 2>&1`
- cc_version_status=$?
- AS_CASE($cc_version_status, [0], [:], [continue])
- AS_CASE($cc_version_message, [*Warning*], [continue])
- cc_version='$(CC) '$option
-done
-AC_SUBST(CC_VERSION, $cc_version)
-
RUBY_UNIVERSAL_ARCH
if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then
RUBY_DEFAULT_ARCH("$target_cpu")
fi
-AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
- AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
- AC_TRY_LINK([unsigned long atomic_var;],
- [
- __sync_val_compare_and_swap(&atomic_var, 0, 1);
- ],
- [rb_cv_gcc_compiler_cas=yes],
- [rb_cv_gcc_compiler_cas=no])])
- if test "$rb_cv_gcc_compiler_cas" = no; then
- unset rb_cv_gcc_compiler_cas
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -march=i486"
- AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [
- AC_TRY_LINK([unsigned long atomic_var;],
- [
- __sync_val_compare_and_swap(&atomic_var, 0, 1);
- ],
- [rb_cv_gcc_compiler_cas=yes
- ARCH_FLAG="-march=i486"],
- [rb_cv_gcc_compiler_cas=no])])
- CFLAGS="$save_CFLAGS"
- fi])
-
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar)
if test -z "$AR"; then
@@ -622,10 +469,8 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE],
[
echo "provider conftest{ probe fire(); };" > conftest_provider.d
if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then
- AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
- # DTrace is available on the system
- rb_cv_dtrace_available=yes
- ], [rb_cv_dtrace_available=no])
+ # DTrace is available on the system
+ rb_cv_dtrace_available=yes
else
# DTrace is not available while dtrace command exists
# for example FreeBSD 8 or FreeBSD 9 without DTrace build option
@@ -638,30 +483,15 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE],
AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
[
- rb_cv_prog_dtrace_g=no
- if {
- cat >conftest_provider.d <<_PROBES &&
- provider conftest {
- probe fire();
- };
-_PROBES
- $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
- :
- }; then
- AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
- if {
- cp -p conftest.${ac_objext} conftest.${ac_objext}.save &&
- $DTRACE -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null &&
- :
- }; then
- if cmp -s conftest.o conftest.${ac_objext}.save; then
- rb_cv_prog_dtrace_g=yes
- else
- rb_cv_prog_dtrace_g=rebuild
- fi
- fi])
- fi
- rm -f conftest.[co] conftest_provider.[dho]
+ echo "int main(void){ return 0; }" > conftest.c
+ echo "provider conftest{};" > conftest_provider.d
+ $CC $CFLAGS -c -o conftest.o conftest.c
+ if $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null; then
+ rb_cv_prog_dtrace_g=yes
+ else
+ rb_cv_prog_dtrace_g=no
+ fi
+ rm -f conftest.o conftest.c conftest_provider.d conftest_provider.o
])
])
@@ -732,35 +562,7 @@ else
unset ac_c_werror_flag
fi])
-RUBY_WERROR_FLAG([
- AC_MSG_CHECKING([whether CFLAGS is valid])
- AC_TRY_COMPILE([], [],
- [AC_MSG_RESULT(yes)],
- [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
- ]
- )
- AC_MSG_CHECKING([whether LDFLAGS is valid])
- {
- mkdir tmp.$$.try_link &&
- cd tmp.$$.try_link &&
- cp ../confdefs.h . &&
- echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist &&
- :
- } || AC_MSG_ERROR([failed to make temporary directory])
- AC_TRY_LINK([], [],
- [AC_MSG_RESULT(yes)],
- [
- cd .. && rm -fr tmp.$$.try_link
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"])
- ]
- )
- cd .. && rm -fr tmp.$$.try_link
-])
-
-AC_DEFUN([RUBY_TRY_CFLAGS], [
+AC_DEFUN(RUBY_TRY_CFLAGS, [
AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
RUBY_WERROR_FLAG([
CFLAGS="[$]CFLAGS $1"
@@ -772,7 +574,7 @@ AC_DEFUN([RUBY_TRY_CFLAGS], [
])
])
-AC_DEFUN([RUBY_TRY_LDFLAGS], [
+AC_DEFUN(RUBY_TRY_LDFLAGS, [
save_LDFLAGS="$LDFLAGS"
LDFLAGS="[$]LDFLAGS $1"
AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
@@ -787,40 +589,21 @@ AC_DEFUN([RUBY_TRY_LDFLAGS], [
save_LDFLAGS=
])
-AS_CASE([$RUBY_PATCHLEVEL], [-*],
- [particular_werror_flags=yes], [particular_werror_flags=no])
-AC_ARG_ENABLE(werror,
- AS_HELP_STRING([--disable-werror],
- [don't make warnings into errors
- even if a compiler support -Werror feature
- [[disabled by default unless development version]]]),
- [particular_werror_flags=$enableval])
-
rb_cv_warnflags="$warnflags"
if test "$GCC:${warnflags+set}:no" = yes::no; then
- if test $gcc_major -ge 4; then
- extra_warning=-Werror=extra-tokens
- else
- extra_warning=
- fi
- if test $gcc_major -eq 5; then
- extra_warning="$extra_warning -Wno-maybe-uninitialized"
- fi
+ particular_werror_flags=yes
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
- -diag-disable=2259 \
-Wno-missing-field-initializers \
-Wunused-variable \
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
-Werror=shorten-64-to-32 \
- -Werror=implicit-function-declaration \
- -Werror=division-by-zero \
- -Werror=deprecated-declarations \
- -Wno-packed-bitfield-compat \
- $extra_warning \
+ -Werror-implicit-function-declaration \
; do
- if test "$particular_werror_flags" != yes; then
+ if test "$particular_werror_flags" = yes; then
+ wflag=`echo x$wflag | sed 's/^x-Werror-/-Werror=/;s/^x//'`
+ else
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
fi
ok=no
@@ -843,45 +626,25 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
rb_cv_warnflags="$warnflags"
warnflags=
fi
-RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
-
-for n in infinity nan; do
- m=AS_TR_CPP($n)
- AC_CACHE_CHECK([whether $m is available without C99 option], rb_cv_$n,
- [AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([@%:@include <math.h>
-@%:@ifndef $m
-@%:@error no $m
-@%:@endif
-]), [1])], [eval rb_cv_$n=yes], [eval rb_cv_$n=no])])
- if eval test '"$rb_cv_'$n'"' = yes; then
- AC_DEFINE_UNQUOTED([HAVE_]$m)
- fi
-done
-
if test "$GCC" = yes; then
- # NaCl's glibc build generates undefined references to __memset_chk.
- # TODO(sbc): Remove this once NaCl's glibc is fixed.
- AS_CASE(["$target_os"], [nacl], [], [
- # -D_FORTIFY_SOURCE
- # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
- # argument check. The performance drop is very little and Ubuntu enables
- # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
- # a mistake of silly C extensions.
- RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
- ])
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
+
+ # -D_FORTIFY_SOURCE
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
# -fstack-protector
AS_CASE(["$target_os"],
- [mingw*|nacl], [
+ [mingw*|nacl|haiku], [
stack_protector=no
- ])
- if test -z "${stack_protector+set}"; then
+ ],
+ [
RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
if test "x$stack_protector" = xyes; then
RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
fi
- fi
+ ])
if test "x$stack_protector" = xyes; then
RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
@@ -895,26 +658,24 @@ if test "$GCC" = yes; then
# comments. We bypass ANSI C mode for them. Otherwise
# extension libs cannot include those headers.
],
- [cygwin*|darwin*|netbsd*|nacl], [
+ [cygwin*|darwin*|netbsd*], [
# need lgamma_r(), finite()
],
+ [haiku], [
+ # Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
+ # with ANSI standard flags. Anonumous union is required to compile
+ # socket extension where <net/if.h> uses anonymous union.
+ ],
[
# ANSI (no XCFLAGS because this is C only)
- for ansi_options in -std=iso9899:1999 "-ansi -std=iso9899:199409"; do
- RUBY_TRY_CFLAGS(${ansi_options}, [
- RUBY_APPEND_OPTIONS(warnflags, ${ansi_options})
- RUBY_APPEND_OPTIONS(strict_warnflags, ${ansi_options})
- ], [ansi_options=])
- test "x${ansi_options}" = x || break
- done
+ RUBY_TRY_CFLAGS(-ansi -std=iso9899:199409, [
+ RUBY_APPEND_OPTION(warnflags, -ansi -std=iso9899:199409)
+ RUBY_APPEND_OPTION(strict_warnflags, -ansi -std=iso9899:199409)
+ ])
])
# suppress annoying -Wstrict-overflow warnings
RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
-
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
fi
test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
@@ -922,14 +683,18 @@ if test "$GCC" = ""; then
AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
fi
if test "$GCC" = yes; then
- if test "$gcc_major" -ge 4; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ @%:@if !(defined __GNUC__ && __GNUC__ >= 4)
+ @%:@error not GCC 4 or later
+ >>>not GCC 4 or later<<<
+ @%:@endif])],
+ [visibility_option=yes], [visibility_option=no])
+ if test "$visibility_option" = yes; then
RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
fi
AC_SUBST(WERRORFLAG, "-Werror")
if test "$visibility_option" = yes; then
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
- AC_DEFINE(RUBY_SYMBOL_EXPORT_BEGIN, [_Pragma("GCC visibility push(default)")])
- AC_DEFINE(RUBY_SYMBOL_EXPORT_END, [_Pragma("GCC visibility pop")])
else
RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
fi
@@ -941,432 +706,32 @@ if test "$GCC" = yes; then
AS_CASE(["$target_os"], [mingw*], [
RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
- RUBY_TRY_CFLAGS(-static-libgcc, [static_libgcc=yes], [static_libgcc=no])
- if test "$static_libgcc" = yes; then
- RUBY_APPEND_OPTION(EXTLDFLAGS, -static-libgcc)
- fi
])
# disable fast-math
- for oflag in -fno-fast-math -fp-model\ precise; do
+ for oflag in -fno-fast-math; do
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
done
fi
-AC_ARG_WITH(opt-dir,
- AS_HELP_STRING([--with-opt-dir=DIR-LIST],
- [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
- [
- val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
- CPPFLAGS="$CPPFLAGS $val"
- val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib|g;s/^ //"`
- LDFLAGS="$LDFLAGS $val"
- LDFLAGS_OPTDIR="$val"
- OPT_DIR="$withval"
- ], [OPT_DIR=])
-
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
-}
-{ # header and library section
-
-AC_ARG_WITH(winnt-ver,
- AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
- [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
-AS_CASE(["$target_os"],
-[mingw*], [
- RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
- RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
-])
-
-AS_CASE(["$target_os"],
-[freebsd*], [
- AC_CACHE_CHECK([whether pthread should be enabled by default],
- rb_cv_enable_pthread_default,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 502102
-#error pthread should be disabled on this platform
-#endif
- ],
- rb_cv_enable_pthread_default=yes,
- rb_cv_enable_pthread_default=no)])
- enable_pthread=$rb_cv_enable_pthread_default
- ],
-[mingw*], [
- enable_pthread=no
- ],
-[
- enable_pthread=yes
- ])
-
-AC_ARG_ENABLE(pthread,
- AS_HELP_STRING([--enable-pthread], [obsolete, and ignored]))
-
-dnl Checks for libraries.
-AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
-
-POSTLINK=:
-AC_SUBST(POSTLINK)
-AS_CASE(["$target_os"],
-[nextstep*], [ ],
-[openstep*], [ ],
-[rhapsody*], [ ],
-[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
- AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
- AC_TRY_CPP([#include <AvailabilityMacros.h>
- #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
- #error pre OS X 10.4
- [!<===== pre OS X 10.4 =====>]
- #endif
- ],
- [macosx_10_5=yes], [macosx_10_5=no])
- AC_MSG_RESULT($macosx_10_5)
- if test $macosx_10_5 = yes; then
- ac_cv_func_getcontext=no
- ac_cv_func_setcontext=no
- else
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- fi
- incs=`$CC -v -E -xc - < /dev/null 2>&1 | sed ['1,/^@%:@include </d;s/^ *//;s|[^./][^/]*/\.\./||g;/\/include$/!d;s||/lib|;/\/usr\/lib/d']`
- for d in `$CC -print-search-dirs | sed -e '/^libraries: */!d;s///' | tr : '\012' | fgrep -v /../ | sed -n 's|^\(/.*/lib\)/$|\1|p'`; do
- incs=`echo "$incs" | fgrep -v "$d"`
- done
- for d in $incs; do
- test -d "$d" && RUBY_APPEND_OPTIONS(LDFLAGS, "-L$d")
- done
- ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
- ac_cv_lib_crypt_crypt=no
- ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
- ac_cv_func_vfork=no
- if test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \); then
- ac_cv_func___builtin_setjmp=no
- fi
- AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-int
-main()
-{
- int i;
- for (i = 0; i < 128*128; i++) {
- char salt[2], buf[256], *s;
- salt[0] = 0x80 | (i & 0x7f);
- salt[1] = 0x80 | (i >> 7);
- strcpy(buf, crypt("", salt));
- if (strcmp(buf, s = crypt("", salt))) {
-#if 0
- printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
- buf+2, s+2);
-#endif
- return 1;
- }
- }
- return 0;
-}
-],
- rb_cv_broken_crypt=no,
- rb_cv_broken_crypt=yes,
- rb_cv_broken_crypt=yes)])
- if test "$rb_cv_broken_crypt" = yes; then
- AC_DEFINE(BROKEN_CRYPT, 1)
- fi
- AC_CHECK_PROGS(codesign, codesign)
- if test -n "$codesign"; then
- POSTLINK="test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@"
- LINK_SO="$LINK_SO
-\$(POSTLINK)"
- fi
- AC_CHECK_HEADERS(crt_externs.h, [], [], [
- #include <crt_externs.h>
- ])
- ],
-[hpux*], [ LIBS="-lm $LIBS"
- ac_cv_c_inline=no],
-[solaris*], [ LIBS="-lm $LIBS"
- ac_cv_func_vfork=no
- AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
- AC_TRY_COMPILE([#include <unistd.h>
- #ifndef _XOPEN_SOURCE
- #error _XOPEN_SOURCE is not defined
- #endif
- ], [],
- [given_xopen_source=yes], [given_xopen_source=no])
- AC_MSG_RESULT($given_xopen_source)
- if test $given_xopen_source = no; then
- # On Solaris, with gcc, -std=iso9899:1999 in $ansi_options
- # is often also needed in CPPFLAGS, because some feature
- # definitions vary depending on such standards options.
- AS_CASE(["${ansi_options}"],
- [*-std=iso9899:1999*], [
- RUBY_APPEND_OPTIONS(CPPFLAGS, ${ansi_options})
- ])
- AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
- define_xopen_source=""
- for tmp_xpg in 7 6 5; do
- if test x"$define_xopen_source" != x; then
- break
- fi
- # Both AC_TRY_CPP and AC_TRY_COMPILE should pass
- # because some options may not be set to CPPFLAGS.
- AC_TRY_CPP([
- #define _XOPEN_SOURCE ${tmp_xpg}00
- #include <unistd.h>
- #ifndef _XPG${tmp_xpg}
- #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
- #endif
- ], [
- AC_TRY_COMPILE([
- #define _XOPEN_SOURCE ${tmp_xpg}00
- #include <unistd.h>
- #ifndef _XPG${tmp_xpg}
- #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
- #endif
- ], [],
- [define_xopen_source=${tmp_xpg}00], [])
- ], [])
- done
- if test x"$define_xopen_source" = x; then
- define_xopen_source=no
- fi
- AC_MSG_RESULT($define_xopen_source)
- if test x"$define_xopen_source" != xno; then
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- fi
- fi
- ],
-[haiku*], [
- LIBS="$LIBS" # m lib is include in root
- ],
-[cygwin*], [ ac_cv_header_langinfo_h=yes
- AC_CHECK_FUNCS(cygwin_conv_path)
- AC_LIBOBJ([langinfo])
- ],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi $LIBS"
- ac_cv_header_a_out_h=no
- ac_cv_header_pwd_h=no
- ac_cv_header_utime_h=no
- ac_cv_header_sys_ioctl_h=no
- ac_cv_header_sys_param_h=no
- ac_cv_header_sys_resource_h=no
- ac_cv_header_sys_select_h=no
- ac_cv_header_sys_time_h=no
- ac_cv_header_sys_times_h=no
- ac_cv_header_sys_socket_h=no
- ac_cv_func_lstat=yes
- ac_cv_func_times=yes
- ac_cv_func_waitpid=yes
- ac_cv_func_fsync=yes
- ac_cv_func_seekdir=yes
- ac_cv_func_telldir=yes
- ac_cv_func_isinf=yes
- ac_cv_func_isnan=yes
- ac_cv_func_finite=yes
- ac_cv_func_lchown=yes
- ac_cv_func_link=yes
- ac_cv_func_readlink=yes
- ac_cv_func_symlink=yes
- ac_cv_lib_crypt_crypt=no
- ac_cv_func_getpgrp_void=no
- ac_cv_func_memcmp_working=yes
- ac_cv_lib_dl_dlopen=no
- rb_cv_binary_elf=no
- rb_cv_negative_time_t=no
- ac_cv_func_fcntl=yes
- ac_cv_func_flock=yes
- ac_cv_func_gmtime_r=yes
- rb_cv_large_fd_select=yes
- ac_cv_type_struct_timeval=yes
- ac_cv_func_clock_gettime=yes
- ac_cv_func_clock_getres=yes
- ac_cv_func_malloc_usable_size=no
- { test "$target_cpu" = x64 && ac_cv_func___builtin_setjmp=no; }
- AC_CHECK_TYPE([NET_LUID], [], [],
- [@%:@include <winsock2.h>
- @%:@include <iphlpapi.h>])
- if test x"$ac_cv_type_NET_LUID" = xyes; then
- AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
- fi
- AC_CHECK_FUNCS(_gmtime64_s)
- AC_CHECK_FUNCS(_wfreopen_s)
- AC_LIBOBJ([langinfo])
- ],
-[bsdi*], [ LIBS="-lm $LIBS"
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ac_cv_sizeof_rlim_t=8],
-[freebsd*], [ LIBS="-lm $LIBS"
- ac_cv_func_getpeername=no
- ac_cv_func_getsockname=no
- ac_cv_func_shutdown=no
- ac_cv_func_close=no
- ],
-[netbsd*], [ LIBS="-lm $LIBS"
- ],
-[dragonfly*], [ LIBS="-lm $LIBS"
- # isinf() and isnan() are macros on DragonFly.
- ac_cv_func_isinf=yes
- ac_cv_func_isnan=yes
- ],
-[aix*],[ LIBS="-lm $LIBS"
- ac_cv_func_round=no
- ],
-[nacl], [
- LIBS="-lm $LIBS"
- if test "${nacl_cv_build_variant}" = "newlib"; then
- RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
- else
- RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
- fi
- ],
-[ LIBS="-lm $LIBS"])
-
-AC_CHECK_LIB(crypt, crypt) # glibc (GNU/Linux, GNU/Hurd, GNU/kFreeBSD)
-AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
-AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
-AC_CHECK_LIB(socket, shutdown) # SunOS/Solaris
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
-AC_HEADER_STDBOOL
-AC_HEADER_SYS_WAIT
-
-AC_CHECK_HEADERS(a.out.h)
-AC_CHECK_HEADERS(atomic.h)
-AC_CHECK_HEADERS(direct.h)
-AC_CHECK_HEADERS(grp.h)
-AC_CHECK_HEADERS(fcntl.h)
-AC_CHECK_HEADERS(float.h)
-AC_CHECK_HEADERS(ieeefp.h)
-AC_CHECK_HEADERS(intrinsics.h)
-AC_CHECK_HEADERS(langinfo.h)
-AC_CHECK_HEADERS(limits.h)
-AC_CHECK_HEADERS(locale.h)
-AC_CHECK_HEADERS(malloc.h)
-AC_CHECK_HEADERS(malloc/malloc.h)
-AC_CHECK_HEADERS(malloc_np.h)
-AC_CHECK_HEADERS(net/socket.h)
-AC_CHECK_HEADERS(process.h)
-AC_CHECK_HEADERS(pwd.h)
-AC_CHECK_HEADERS(setjmpex.h)
-AC_CHECK_HEADERS(sys/attr.h)
-AC_CHECK_HEADERS(sys/fcntl.h)
-AC_CHECK_HEADERS(sys/file.h)
-AC_CHECK_HEADERS(sys/id.h)
-AC_CHECK_HEADERS(sys/ioctl.h)
-AC_CHECK_HEADERS(sys/mkdev.h)
-AC_CHECK_HEADERS(sys/param.h)
-AC_CHECK_HEADERS(sys/prctl.h)
-AC_CHECK_HEADERS(sys/resource.h)
-AC_CHECK_HEADERS(sys/select.h)
-AC_CHECK_HEADERS(sys/sendfile.h)
-AC_CHECK_HEADERS(sys/socket.h)
-AC_CHECK_HEADERS(sys/syscall.h)
-AC_CHECK_HEADERS(sys/time.h)
-AC_CHECK_HEADERS(sys/times.h)
-AC_CHECK_HEADERS(sys/uio.h)
-AC_CHECK_HEADERS(sys/utime.h)
-AC_CHECK_HEADERS(syscall.h)
-AC_CHECK_HEADERS(time.h)
-AC_CHECK_HEADERS(ucontext.h)
-AC_CHECK_HEADERS(utime.h)
-
-AC_ARG_WITH([gmp],
- [AS_HELP_STRING([--without-gmp],
- [disable GNU GMP to accelerate Bignum operations])],
- [],
- [with_gmp=yes])
-AS_IF([test "x$with_gmp" != xno],
- [AC_CHECK_HEADERS(gmp.h)
- AS_IF([test "x$ac_cv_header_gmp_h" != xno],
- AC_CHECK_LIB([gmp], [__gmpz_init]))
- with_gmp="$ac_cv_lib_gmp___gmpz_init"
- AS_IF([test -z "$with_gmp"], [with_gmp=no])])
-
-AC_ARG_WITH([jemalloc],
- [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
- [with_jemalloc=$withval], [with_jemalloc=no])
-AS_IF([test "x$with_jemalloc" = xyes],[
- AC_CHECK_LIB([jemalloc], [malloc_conf], [], [with_jemalloc=no])
- AC_CHECK_HEADER(jemalloc/jemalloc.h, [
- AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
- ])
- AS_IF([test "x$with_jemalloc" = xno], [
- AC_CACHE_CHECK([for jemalloc with JEMALLOC_MANGLE], rb_cv_jemalloc_demangle,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@define JEMALLOC_MANGLE 1
- @%:@ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
- @%:@include RUBY_ALTERNATIVE_MALLOC_HEADER
- @%:@else
- @%:@include <jemalloc.h>
- @%:@endif], [return !&malloc_conf])],
- [rb_cv_jemalloc_demangle=yes],
- [rb_cv_jemalloc_demangle=no])
- ])
- ])
- AS_IF([test "x$rb_cv_jemalloc_demangle" = xyes], [
- AC_DEFINE(JEMALLOC_MANGLE)
- with_jemalloc=yes
- ])
- AS_IF([test "x$with_jemalloc" = xyes],
- [
- ac_cv_func_malloc_usable_size=yes
- ],
- [AC_MSG_ERROR([jemalloc requested but not found])
- ])
-])
-
dnl check for large file stuff
mv confdefs.h confdefs1.h
: > confdefs.h
AC_SYS_LARGEFILE
-# On 32-bit Solaris, it is safe to define _LARGEFILE_SOURCE
-# which is not added by AC_SYS_LARGEFILE.
-if test x"$enable_largefile" != xno; then
- AS_CASE(["$target_os"], [solaris*], [
- AC_MSG_CHECKING([wheather _LARGEFILE_SOURCE should be defined])
- AS_CASE(["${ac_cv_sys_file_offset_bits}:${ac_cv_sys_large_files}"],
- ["64:"|"64:no"|"64:unknown"], [
- # insert _LARGEFILE_SOURCE before _FILE_OFFSET_BITS line
- # that is the same order as "getconf LFS_CFLAGS" output
- mv confdefs.h largefile0.h
- : > confdefs.h
- AC_DEFINE(_LARGEFILE_SOURCE)
- cat largefile0.h >> confdefs.h
- rm largefile0.h
- AC_MSG_RESULT([yes])
- ], [AC_MSG_RESULT([no])])
- ])
-fi
mv confdefs.h largefile.h
mv confdefs1.h confdefs.h
cat largefile.h >> confdefs.h
-AS_CASE(["$target_os"],
- [mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8],
- [aix*], [
- AS_CASE(["$target_cpu:$ac_cv_sys_large_files"],
- [ppc64:*|powerpc64:*], [],
- [*:no|*:unknown], [],
- [
- # AIX currently does not support a 32-bit call to posix_fadvise()
- # if _LARGE_FILES is defined.
- ac_cv_func_posix_fadvise=no
- ])
- ])
+AS_CASE(["$target_os"],[mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8])
AC_C_BIGENDIAN
AC_C_CONST
AC_C_CHAR_UNSIGNED
AC_C_INLINE
AC_C_VOLATILE
-AC_C_TYPEOF
AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
[*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])
@@ -1470,31 +835,11 @@ RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
RUBY_CHECK_SIZEOF(float)
RUBY_CHECK_SIZEOF(double)
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
-RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
-
-AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
- [rb_cv_packed_struct=no
- for mac in \
- "__pragma(pack(push, 1)) x __pragma(pack(pop))" \
- "x __attribute__((packed))" \
- ; do
- AC_TRY_COMPILE([@%:@define PACKED_STRUCT(x) $mac
- PACKED_STRUCT(struct { int a; });], [],
- [rb_cv_packed_struct=$mac; break])
- done])
-packed_struct_unaligned=x
-if test "$rb_cv_packed_struct" != no; then
- AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
-else
- AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
-fi
-AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED(x), $packed_struct_unaligned)
AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
- RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
- for pri in $2; do
+ RUBY_WERROR_FLAG(for pri in $2; do
AC_TRY_COMPILE(
[@%:@include <stdio.h>
@%:@include <stddef.h>
@@ -1521,11 +866,6 @@ elif test "x$ac_cv_type___int64" = xyes; then
RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
fi
-dnl RUBY_CHECK_SIZEOF [typename] [if-signed] [if-unsigned] [included]
-AC_DEFUN([RUBY_CHECK_SIGNEDNESS], [dnl
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($1)-1 > 0])],
- [$3], [$2])])
-
dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
AC_CHECK_TYPE([$1],
@@ -1538,7 +878,10 @@ AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
[*" signed "*], [ ],
[*" unsigned "*], [
u=U],
- [RUBY_CHECK_SIGNEDNESS($n, [], [u=U], [$4])])
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($n)-1 > 0])],
+ [u=U])])
if test x"$t" = x; then
for t in "long long" long int short; do
test -n "$u" && t="unsigned $t"
@@ -1562,19 +905,8 @@ AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
[
t=INT])
rb_cv_[$1]_convertible=${u}${t}])
- if test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes"; then
- n="$1"
- else
- AS_CASE(["${rb_cv_[$1]_convertible}"],
- [*LL], [n="long long"],
- [*LONG], [n="long"],
- [n="int"])
- AS_CASE(["${rb_cv_[$1]_convertible}"],
- [U*], [n="unsigned $n"])
- fi
- AS_CASE("${rb_cv_[$1]_convertible}", [U*], [u=+1], [u=-1])
+ test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
AC_DEFINE_UNQUOTED(rb_[$1], $n)
- AC_DEFINE_UNQUOTED([SIGNEDNESS_OF_]AS_TR_CPP($1), $u)
AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
AC_DEFINE_UNQUOTED(PRI_[$3]_PREFIX,
@@ -1586,17 +918,7 @@ RUBY_REPLACE_TYPE(gid_t, int, GIDT)
RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
-RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [
-@%:@ifdef HAVE_SYS_TYPES_H
-@%:@include <sys/types.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TYPES_H
-@%:@include <sys/time.h>
-@%:@endif
-@%:@include <sys/resource.h>
-])
-RUBY_REPLACE_TYPE(off_t, [], OFFT)
-RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID)
+RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [@%:@include <sys/resource.h>])
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
@@ -1693,81 +1015,48 @@ EOH
])dnl
])dnl
-dnl RUBY_DECL_ATTRIBUTE(attrib, macroname, cachevar, condition, type, code)
-AC_DEFUN([RUBY_DECL_ATTRIBUTE], [dnl
+dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
+AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
- [AS_VAR_PUSHDEF([attrib], m4_bpatsubst([$2], [(.*)], []))], dnl
- [AS_VAR_PUSHDEF([attrib], m4_toupper(m4_format(%.4s, [$5]))[_]AS_TR_CPP($1))] dnl
+ [AS_VAR_PUSHDEF([attrib],[$2])], dnl
+ [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
)dnl
m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
- [AS_VAR_PUSHDEF([rbcv],[rb_cv_]m4_format(%.4s, [$5])[_][$1])]dnl
+ [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
-m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])dnl
-m4_pushdef([attrib_params],[m4_bpatsubst([$2(x)],[^[^()]*(\([^()]*\)).*],[\1])])dnl
m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
-AC_CACHE_CHECK(for m4_ifval([$2],[m4_bpatsubst([$2], [(.*)], [])],[$1]) [$5] attribute, rbcv, dnl
+AC_CACHE_CHECK(for [$1] function attribute, rbcv,
[rbcv=x
RUBY_WERROR_FLAG([
-for mac in \
- "__attribute__ ((attrib_code)) x" \
- "x __attribute__ ((attrib_code))" \
- "__declspec(attrib_code) x" \
- x; do
+for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE(
m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
-[@%:@define ]attrib[](attrib_params)[ $mac]
+[@%:@define ]attrib[(x) $mac]
m4_ifval([$4],${rbcv_cond+[@%:@else]}
-${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]}
+${rbcv_cond+[@%:@define ]attrib[(x) x]}
${rbcv_cond+[@%:@endif]})
-$6
- attrib[](attrib_params)[;], [],
+ attrib[(void conftest_attribute_check(void));], [],
[rbcv="$mac"; break])
done
])])
if test "$rbcv" != x; then
- RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv)
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
fi
-m4_ifval([$4], [unset rbcv_cond]) dnl
-m4_popdef([attrib_params])dnl
-m4_popdef([attrib_code])dnl
+m4_ifval([$4], [unset rbcv_cond])dnl
AS_VAR_POPDEF([attrib])dnl
AS_VAR_POPDEF([rbcv])dnl
])
-dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
-AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
- RUBY_DECL_ATTRIBUTE([$1], [$2], [$3], [$4],
- [function], [@%:@define x void conftest_attribute_check(void)]
- )
-])
-
-dnl RUBY_TYPE_ATTRIBUTE(attrib, macroname, cachevar, condition)
-AC_DEFUN([RUBY_TYPE_ATTRIBUTE], [dnl
- RUBY_DECL_ATTRIBUTE([$1], [$2], [$3], [$4],
- [type], [
-@%:@define x struct conftest_attribute_check {int i;}
-@%:@define mesg ("")
-])
-])
-
RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
-RUBY_FUNC_ATTRIBUTE(deprecated("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
-RUBY_TYPE_ATTRIBUTE(deprecated mesg, DEPRECATED_TYPE(mesg,x), rb_cv_type_deprecated)
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
-RUBY_FUNC_ATTRIBUTE(weak, WEAK, rb_cv_func_weak)
-if test "$rb_cv_func_weak" != x; then
- AC_DEFINE(HAVE_FUNC_WEAK)
-fi
if_i386=${universal_binary+[defined __i386__]}
RUBY_FUNC_ATTRIBUTE(stdcall, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(cdecl, [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
-RUBY_FUNC_ATTRIBUTE(optimize("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized)
-RUBY_FUNC_ATTRIBUTE(optimize("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
if test "$GCC" = yes; then
AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
@@ -1778,48 +1067,29 @@ if test "$GCC" = yes; then
[rb_cv_gcc_function_alias=$a; break])
done])
if test "$rb_cv_gcc_function_alias" != no; then
- AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS)
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
[type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
fi
-
- AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
- AC_TRY_LINK([unsigned char atomic_var;],
- [
- __atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
- __atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
- __atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST);
- __atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST);
- __atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST);
- ],
- [rb_cv_gcc_atomic_builtins=yes],
- [rb_cv_gcc_atomic_builtins=no])])
- if test "$rb_cv_gcc_atomic_builtins" = yes; then
- AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
- fi
-
- AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
+ AC_CACHE_CHECK([for atomic builtins], [rb_cv_gcc_atomic_builtins], [
AC_TRY_LINK([unsigned char atomic_var;],
[
__sync_lock_test_and_set(&atomic_var, 0);
__sync_lock_test_and_set(&atomic_var, 1);
__sync_fetch_and_add(&atomic_var, 1);
__sync_fetch_and_sub(&atomic_var, 1);
- __sync_or_and_fetch(&atomic_var, 1);
- __sync_val_compare_and_swap(&atomic_var, 0, 1);
],
- [rb_cv_gcc_sync_builtins=yes],
- [rb_cv_gcc_sync_builtins=no])])
- if test "$rb_cv_gcc_sync_builtins" = yes; then
- AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
+ [rb_cv_gcc_atomic_builtins=yes],
+ [rb_cv_gcc_atomic_builtins=no])])
+ if test "$rb_cv_gcc_atomic_builtins" = yes; then
+ AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
fi
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
[RUBY_WERROR_FLAG(
- [AC_TRY_LINK([volatile int zero;],
- [if (zero) __builtin_unreachable();],
+ [AC_TRY_LINK([@%:@include <stdlib.h>],
+ [exit(0); __builtin_unreachable();],
[rb_cv_func___builtin_unreachable=yes],
[rb_cv_func___builtin_unreachable=no])
])
@@ -1844,53 +1114,202 @@ fi
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-AC_CACHE_CHECK(for function name string predefined identifier,
- rb_cv_function_name_string,
- [rb_cv_function_name_string=no
- RUBY_WERROR_FLAG([
- for func in __func__ __FUNCTION__; do
- AC_TRY_LINK([@%:@include <stdio.h>],
- [puts($func);],
- [rb_cv_function_name_string=$func
- break])
- done
- ])]
-)
-if test "$rb_cv_function_name_string" != no; then
- AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
-fi
-
-AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [
- rb_cv_enum_over_int=no
- if test "x$ac_cv_type_long_long" = xyes; then
- type="unsigned long long" max="ULLONG_MAX"
- else
- type="unsigned long" max="ULONG_MAX"
- fi
- RUBY_WERROR_FLAG([
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([
- @%:@include <limits.h>
- enum {conftest_max = $max};
- ], [
- (conftest_max == $max) &&
- (sizeof(conftest_max) == sizeof($type))
- ]
- )],
- [rb_cv_enum_over_int=yes],
- [rb_cv_enum_over_int=no]
- )
- ])
-])
-if test $rb_cv_enum_over_int = yes; then
- AC_DEFINE(ENUM_OVER_INT, 1)
-fi
+}
+{ # header and library section
dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
@%:@include <errno.h>])
-AC_CHECK_DECLS([getenv])
+AC_ARG_WITH(winnt-ver,
+ AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
+ [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
+AS_CASE(["$target_os"],
+[mingw*], [
+ RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
+])
+
+AS_CASE(["$target_os"],
+[freebsd*], [
+ AC_CACHE_CHECK([whether pthread should be enabled by default],
+ rb_cv_enable_pthread_default,
+ [AC_TRY_CPP([
+#include <osreldate.h>
+#if __FreeBSD_version < 502102
+#error pthread should be disabled on this platform
+#endif
+ ],
+ rb_cv_enable_pthread_default=yes,
+ rb_cv_enable_pthread_default=no)])
+ enable_pthread=$rb_cv_enable_pthread_default
+ ],
+[mingw*], [
+ enable_pthread=no
+ ],
+[
+ enable_pthread=yes
+ ])
+
+AC_ARG_ENABLE(pthread,
+ AS_HELP_STRING([--enable-pthread], [obsolete, and ignored]))
+
+dnl Checks for libraries.
+AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
+
+POSTLINK=:
+AC_SUBST(POSTLINK)
+AS_CASE(["$target_os"],
+[nextstep*], [ ],
+[openstep*], [ ],
+[rhapsody*], [ ],
+[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
+ AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
+ AC_TRY_CPP([#include <AvailabilityMacros.h>
+ #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
+ #error pre OS X 10.4
+ [!<===== pre OS X 10.4 =====>]
+ #endif
+ ],
+ [macosx_10_5=yes], [macosx_10_5=no])
+ AC_MSG_RESULT($macosx_10_5)
+ if test $macosx_10_5 = yes; then
+ ac_cv_header_ucontext_h=no
+ else
+ AC_DEFINE(BROKEN_SETREUID, 1)
+ AC_DEFINE(BROKEN_SETREGID, 1)
+ fi
+ ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
+ ac_cv_lib_crypt_crypt=no
+ ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
+ AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int
+main()
+{
+ int i;
+ for (i = 0; i < 128*128; i++) {
+ char salt[2], buf[256], *s;
+ salt[0] = 0x80 | (i & 0x7f);
+ salt[1] = 0x80 | (i >> 7);
+ strcpy(buf, crypt("", salt));
+ if (strcmp(buf, s = crypt("", salt))) {
+#if 0
+ printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
+ buf+2, s+2);
+#endif
+ return 1;
+ }
+ }
+ return 0;
+}
+],
+ rb_cv_broken_crypt=no,
+ rb_cv_broken_crypt=yes,
+ rb_cv_broken_crypt=yes)])
+ if test "$rb_cv_broken_crypt" = yes; then
+ AC_DEFINE(BROKEN_CRYPT, 1)
+ fi
+ AC_CHECK_PROGS(codesign, codesign)
+ if test -n "$codesign"; then
+ POSTLINK="test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@"
+ LINK_SO="$LINK_SO
+$POSTLINK"
+ fi
+ AC_CHECK_HEADERS(crt_externs.h, [], [], [
+ #include <crt_externs.h>
+ ])
+ ],
+[hpux*], [ LIBS="-lm $LIBS"
+ ac_cv_c_inline=no],
+[beos*|haiku*], [
+ ac_cv_func_link=no
+ ac_cv_func_sched_yield=no
+ ac_cv_func_pthread_attr_setinheritsched=no
+ AS_CASE(["$target_os"],
+ [beos*], [ ac_cv_header_net_socket_h=yes],
+ [haiku*], [ ac_cv_func_shutdown=no])
+ LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
+ ],
+[cygwin*], [ ac_cv_header_langinfo_h=yes
+ AC_CHECK_FUNCS(cygwin_conv_path)
+ AC_LIBOBJ([langinfo])
+ ],
+[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"
+ ac_cv_header_a_out_h=no
+ ac_cv_header_pwd_h=no
+ ac_cv_header_utime_h=no
+ ac_cv_header_sys_ioctl_h=no
+ ac_cv_header_sys_param_h=no
+ ac_cv_header_sys_resource_h=no
+ ac_cv_header_sys_select_h=no
+ ac_cv_header_sys_time_h=no
+ ac_cv_header_sys_times_h=no
+ ac_cv_header_sys_socket_h=no
+ ac_cv_func_times=yes
+ ac_cv_func_waitpid=yes
+ ac_cv_func_fsync=yes
+ ac_cv_func_seekdir=yes
+ ac_cv_func_telldir=yes
+ ac_cv_func_isinf=yes
+ ac_cv_func_isnan=yes
+ ac_cv_func_finite=yes
+ ac_cv_func_link=yes
+ ac_cv_func_fseeko=yes
+ ac_cv_lib_crypt_crypt=no
+ ac_cv_func_getpgrp_void=no
+ ac_cv_func_memcmp_working=yes
+ ac_cv_lib_dl_dlopen=no
+ rb_cv_binary_elf=no
+ rb_cv_negative_time_t=no
+ ac_cv_func_fcntl=yes
+ ac_cv_func_flock=yes
+ ac_cv_func_gmtime_r=yes
+ rb_cv_large_fd_select=yes
+ AC_LIBOBJ([langinfo])
+ ],
+[os2-emx*], [ LIBS="-lm $LIBS"
+ ac_cv_lib_dir_opendir=no],
+[bsdi*], [ LIBS="-lm $LIBS"
+ AC_DEFINE(BROKEN_SETREUID, 1)
+ AC_DEFINE(BROKEN_SETREGID, 1)
+ ac_cv_sizeof_rlim_t=8],
+[freebsd*], [ LIBS="-lm $LIBS"
+ ac_cv_func_getpeername=no
+ ac_cv_func_getsockname=no
+ ac_cv_func_shutdown=no
+ ac_cv_func_close=no
+ ],
+[dragonfly*], [ LIBS="-lm $LIBS"
+ # isinf() and isnan() are macros on DragonFly.
+ ac_cv_func_isinf=yes
+ ac_cv_func_isnan=yes
+ ],
+[bow], [ ac_cv_func_setitimer=no
+ ],
+[superux*], [ ac_cv_func_setitimer=no
+ ],
+[nacl], [
+ LIBS="-lm $LIBS"
+ if test "${nacl_cv_build_variant}" = "newlib"; then
+ RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
+ RUBY_APPEND_OPTION(LIBS, '-lnosys')
+ else
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
+ fi
+ ac_cv_func_shutdown=no
+ ac_cv_func_fcntl=no
+ ],
+[ LIBS="-lm $LIBS"])
+AC_CHECK_LIB(crypt, crypt)
+AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
+AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
+AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
AS_CASE(["$target_cpu"],
[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
@@ -1908,10 +1327,19 @@ else
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
fi
+dnl Checks for header files.
+AC_HEADER_DIRENT
+dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
+AC_HEADER_STDBOOL
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
+ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
+ syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
+ sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
+ ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
+ net/socket.h sys/socket.h process.h sys/prctl.h)
AC_TYPE_SIZE_T
-RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [],
- [@%:@include <sys/types.h>])
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
RUBY_CHECK_PRINTF_PREFIX(size_t, z)
@@ -1919,11 +1347,10 @@ RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
-RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
+RUBY_CHECK_SIZEOF([struct stat.st_size], [int long "long long"], [], [@%:@include <sys/stat.h>])
if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
- RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
+ RUBY_CHECK_SIZEOF([struct stat.st_blocks], [int long "long long"], [], [@%:@include <sys/stat.h>])
fi
-RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec])
AC_CHECK_MEMBERS([struct stat.st_atimensec])
@@ -1933,32 +1360,6 @@ AC_CHECK_MEMBERS([struct stat.st_mtimensec])
AC_CHECK_MEMBERS([struct stat.st_ctim])
AC_CHECK_MEMBERS([struct stat.st_ctimespec])
AC_CHECK_MEMBERS([struct stat.st_ctimensec])
-AC_CHECK_MEMBERS([struct stat.st_birthtimespec])
-
-AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@include <sys/time.h>
-@%:@endif])
-
-if test "${ac_cv_type_struct_timeval}" = yes; then
- RUBY_CHECK_SIZEOF([struct timeval.tv_sec], [time_t long "long long"], [],
- [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@include <sys/time.h>
-@%:@endif])
- AS_CASE(${ac_cv_sizeof_struct_timeval_tv_sec},
- [SIZEOF_INT], [t=int],
- [SIZEOF_LONG], [t=long],
- [SIZEOF_LONG_LONG], [t=LONG_LONG],
- [t=])
- if test "${t}" != ""; then
- AC_DEFINE_UNQUOTED(TYPEOF_TIMEVAL_TV_SEC, [$t])
- fi
-fi
AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
@%:@include <time.h>
@@ -2021,6 +1422,8 @@ RUBY_DEFINT(int32_t, 4)
RUBY_DEFINT(uint32_t, 4, unsigned)
RUBY_DEFINT(int64_t, 8)
RUBY_DEFINT(uint64_t, 8, unsigned)
+RUBY_DEFINT(int128_t, 16)
+RUBY_DEFINT(uint128_t, 16, unsigned)
RUBY_DEFINT(intptr_t, void*)
RUBY_DEFINT(uintptr_t, void*, unsigned)
RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
@@ -2038,12 +1441,8 @@ if test $rb_cv_stack_end_address != no; then
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
fi
-# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE.
-# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901
-# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142)
-# MirOS #10semel has the problem but fixed in the repository. (src/lib/libc/stdlib/malloc.c:1.9)
AS_CASE(["$target_os"],
-[openbsd*|mirbsd*], [
+[openbsd*], [
AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
[rb_cv_page_size_log=no
for page_log in 12 13; do
@@ -2130,38 +1529,30 @@ AS_CASE(["$target_os"],[freebsd*],[
AC_DEFINE(BROKEN_CLOSE)
AC_REPLACE_FUNCS(close)
])
-
-AC_REPLACE_FUNCS(acosh)
-AC_REPLACE_FUNCS(cbrt)
-AC_REPLACE_FUNCS(crypt)
-AC_REPLACE_FUNCS(dup2)
-AC_REPLACE_FUNCS(erf)
-AC_REPLACE_FUNCS(explicit_bzero)
-AC_REPLACE_FUNCS(ffs)
-AC_REPLACE_FUNCS(finite)
-AC_REPLACE_FUNCS(flock)
-AC_REPLACE_FUNCS(hypot)
-AC_REPLACE_FUNCS(isinf)
-AC_REPLACE_FUNCS(isnan)
-AC_REPLACE_FUNCS(lgamma_r)
-AC_REPLACE_FUNCS(memmove)
-AC_REPLACE_FUNCS(nextafter)
-AC_REPLACE_FUNCS(setproctitle)
-AC_REPLACE_FUNCS(strchr)
-AC_REPLACE_FUNCS(strerror)
-AC_REPLACE_FUNCS(strlcat)
-AC_REPLACE_FUNCS(strlcpy)
-AC_REPLACE_FUNCS(strstr)
-AC_REPLACE_FUNCS(tgamma)
+AC_REPLACE_FUNCS(dup2 memmove strerror\
+ strchr strstr crypt flock\
+ isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
+ strlcpy strlcat ffs setproctitle)
# for missing/setproctitle.c
AS_CASE(["$target_os"],
[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
[])
-AC_CHECK_HEADERS(sys/pstat.h)
+AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
+ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
+ AC_TRY_LINK([unsigned long atomic_var;],
+ [
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
+ ],
+ [rb_cv_gcc_compiler_cas=yes],
+ [rb_cv_gcc_compiler_cas=no])])
+ if test "$rb_cv_gcc_compiler_cas" = no; then
+ ARCH_FLAG="-march=i486"
+ fi])
+
AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
[AC_TRY_LINK([
#include <math.h>
@@ -2173,319 +1564,20 @@ if test "$rb_cv_have_signbit" = yes; then
else
AC_LIBOBJ([signbit])
fi
-
-AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [
- AC_TRY_RUN([
-@%:@include <string.h>
-
-int
-main(int argc, char **argv)
-{
- const char *str = "hogefugafoobar";
- const char *rs = "foo";
- const char *empty = "";
- char *p;
-
- p = memmem(str, strlen(str), rs, strlen(rs));
- if (p == str+8) {
- p = memmem(str, strlen(str), empty, strlen(empty));
- if (p == str)
- return 0;
- }
- return 1;
-}
- ],
- rb_cv_broken_memmem=no,
- rb_cv_broken_memmem=yes,
- rb_cv_broken_memmem=yes)
-])
-test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no
-
-AC_FUNC_FORK
-
-AC_CHECK_FUNCS(__syscall)
-AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
-# we don't use _setjmp if _longjmp doesn't exist.
-test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
-AC_CHECK_FUNCS(_setjmp) # used for AC_ARG_WITH(setjmp-type)
-AC_CHECK_FUNCS(_setjmpex) # used for AC_ARG_WITH(setjmp-type)
-AC_CHECK_FUNCS(atan2l atan2f)
-AC_CHECK_FUNCS(chroot)
-AC_CHECK_FUNCS(chsize)
-AC_CHECK_FUNCS(clock_gettime)
-AC_CHECK_FUNCS(cosh)
-AC_CHECK_FUNCS(daemon)
-AC_CHECK_FUNCS(dirfd)
-AC_CHECK_FUNCS(dl_iterate_phdr)
-AC_CHECK_FUNCS(dlopen)
-AC_CHECK_FUNCS(dladdr)
-AC_CHECK_FUNCS(dup)
-AC_CHECK_FUNCS(dup3)
-AC_CHECK_FUNCS(eaccess)
-AC_CHECK_FUNCS(endgrent)
-AC_CHECK_FUNCS(fchmod)
-AC_CHECK_FUNCS(fchown)
-AC_CHECK_FUNCS(fcntl)
-AC_CHECK_FUNCS(fdatasync)
-AC_CHECK_FUNCS(fgetattrlist)
-AC_CHECK_FUNCS(fmod)
-AC_CHECK_FUNCS(fsync)
-AC_CHECK_FUNCS(ftruncate)
-AC_CHECK_FUNCS(ftruncate64) # used for Win32 platform
-AC_CHECK_FUNCS(getattrlist)
-AC_CHECK_FUNCS(getcwd)
-AC_CHECK_FUNCS(getgidx)
-AC_CHECK_FUNCS(getgrnam)
-AC_CHECK_FUNCS(getgrnam_r)
-AC_CHECK_FUNCS(getgroups)
-AC_CHECK_FUNCS(getpgid)
-AC_CHECK_FUNCS(getpgrp)
-AC_CHECK_FUNCS(getpriority)
-AC_CHECK_FUNCS(getpwnam_r)
-AC_CHECK_FUNCS(getresgid)
-AC_CHECK_FUNCS(getresuid)
-AC_CHECK_FUNCS(getrlimit)
-AC_CHECK_FUNCS(getsid)
-AC_CHECK_FUNCS(gettimeofday) # for making ac_cv_func_gettimeofday
-AC_CHECK_FUNCS(getuidx)
-AC_CHECK_FUNCS(gmtime_r)
-AC_CHECK_FUNCS(initgroups)
-AC_CHECK_FUNCS(ioctl)
-AC_CHECK_FUNCS(isfinite)
-AC_CHECK_FUNCS(issetugid)
-AC_CHECK_FUNCS(killpg)
-AC_CHECK_FUNCS(lchmod)
-AC_CHECK_FUNCS(lchown)
-AC_CHECK_FUNCS(link)
-AC_CHECK_FUNCS(llabs)
-AC_CHECK_FUNCS(lockf)
-AC_CHECK_FUNCS(log2)
-AC_CHECK_FUNCS(lstat)
-AC_CHECK_FUNCS(malloc_usable_size)
-AC_CHECK_FUNCS(malloc_size)
-AC_CHECK_FUNCS(mblen)
-AC_CHECK_FUNCS(memalign)
-AC_CHECK_FUNCS(memset_s)
-AC_CHECK_FUNCS(writev)
-AC_CHECK_FUNCS(memrchr)
-AC_CHECK_FUNCS(memmem)
-AC_CHECK_FUNCS(mkfifo)
-AC_CHECK_FUNCS(mknod)
-AC_CHECK_FUNCS(mktime)
-AC_CHECK_FUNCS(pipe2)
-AC_CHECK_FUNCS(poll)
-AC_CHECK_FUNCS(posix_fadvise)
-AC_CHECK_FUNCS(posix_memalign)
-AC_CHECK_FUNCS(ppoll)
-AC_CHECK_FUNCS(pread)
-AC_CHECK_FUNCS(qsort_r)
-AC_CHECK_FUNCS(readlink)
-AC_CHECK_FUNCS(round)
-AC_CHECK_FUNCS(sched_getaffinity)
-AC_CHECK_FUNCS(seekdir)
-AC_CHECK_FUNCS(select_large_fdset)
-AC_CHECK_FUNCS(sendfile)
-AC_CHECK_FUNCS(setegid)
-AC_CHECK_FUNCS(setenv)
-AC_CHECK_FUNCS(seteuid)
-AC_CHECK_FUNCS(setgid)
-AC_CHECK_FUNCS(setgroups)
-AC_CHECK_FUNCS(setpgid)
-AC_CHECK_FUNCS(setpgrp)
-AC_CHECK_FUNCS(setregid)
-AC_CHECK_FUNCS(setresgid)
-AC_CHECK_FUNCS(setresuid)
-AC_CHECK_FUNCS(setreuid)
-AC_CHECK_FUNCS(setrgid)
-AC_CHECK_FUNCS(setrlimit)
-AC_CHECK_FUNCS(setruid)
-AC_CHECK_FUNCS(setsid)
-AC_CHECK_FUNCS(setuid)
-AC_CHECK_FUNCS(shutdown)
-AC_CHECK_FUNCS(sigaction)
-AC_CHECK_FUNCS(sigaltstack)
-AC_CHECK_FUNCS(sigprocmask)
-AC_CHECK_FUNCS(sinh)
-AC_CHECK_FUNCS(spawnv)
-AC_CHECK_FUNCS(symlink)
-AC_CHECK_FUNCS(syscall)
-AC_CHECK_FUNCS(sysconf)
-AC_CHECK_FUNCS(tanh)
-AC_CHECK_FUNCS(telldir)
-AC_CHECK_FUNCS(timegm)
-AC_CHECK_FUNCS(times)
-AC_CHECK_FUNCS(truncate)
-AC_CHECK_FUNCS(truncate64) # used for Win32
-AC_CHECK_FUNCS(unsetenv)
-AC_CHECK_FUNCS(utimensat)
-AC_CHECK_FUNCS(utimes)
-AC_CHECK_FUNCS(wait4)
-AC_CHECK_FUNCS(waitpid)
-
-AS_IF([test "$ac_cv_func_memset_s" = yes],
- [RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
-
-AS_IF([test "$ac_cv_func_getcwd" = yes], [
- AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc],
- [AC_TRY_RUN([
-@%:@include <stddef.h>
-@%:@include <stdio.h>
-@%:@ifdef HAVE_UNISTD_H
-@%:@include <unistd.h>
-@%:@endif
-@%:@ifndef EXIT_SUCCESS
-@%:@define EXIT_SUCCESS 0
-@%:@endif
-@%:@ifndef EXIT_FAILURE
-@%:@define EXIT_FAILURE 1
-@%:@endif
-
-int
-main(int argc, char **argv)
-{
- if (!getcwd(NULL, 0)) return EXIT_FAILURE;
- return EXIT_SUCCESS;
-}
-],
- rb_cv_getcwd_malloc=yes,
- rb_cv_getcwd_malloc=no,
- AS_CASE($target_os,
- [linux*|darwin*|*bsd|cygwin*|mingw*|mswin*],
- [rb_cv_getcwd_malloc=yes],
- [rb_cv_getcwd_malloc=no]))])
- AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
-])
-
-AC_DEFUN([RUBY_CHECK_BUILTIN_FUNC], [dnl
-AC_CACHE_CHECK([for $1], AS_TR_SH(rb_cv_builtin_$1),
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([int foo;], [$2;])],
- [AS_TR_SH(rb_cv_builtin_$1)=yes],
- [AS_TR_SH(rb_cv_builtin_$1)=no])])
-if test "${AS_TR_SH(rb_cv_builtin_$1)}" != no; then
- AC_DEFINE(AS_TR_CPP(HAVE_BUILTIN_$1))
-fi])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap16, [__builtin_bswap16(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap32, [__builtin_bswap32(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_clz, [__builtin_clz(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_clzl, [__builtin_clzl(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_clzll, [__builtin_clzll(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [
- [int x[__extension__(__builtin_choose_expr(1, 1, -1))]];
- [int y[__extension__(__builtin_choose_expr(0, -1, 1))]];
- ])
-if test x$rb_cv_builtin___builtin_choose_expr = xyes; then
- RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [
- [int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))]];
- [int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1))]];
- ])
-fi
-RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)])
-
-if test "$ac_cv_func_qsort_r" != no; then
- AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r,
- [AC_TRY_COMPILE([
-@%:@include <stdlib.h>
-void qsort_r(void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *, void *),
- void *arg);
-],[ ],
- [rb_cv_gnu_qsort_r=yes],
- [rb_cv_gnu_qsort_r=no])
- ])
- AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r,
- [AC_TRY_COMPILE([
-@%:@include <stdlib.h>
-void qsort_r(void *base, size_t nmemb, size_t size,
- void *arg, int (*compar)(void *, const void *, const void *));
-],[ ],
- [rb_cv_bsd_qsort_r=yes],
- [rb_cv_bsd_qsort_r=no])
- ])
- AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r",
- [yes:no], [
- AC_DEFINE(HAVE_GNU_QSORT_R, 1)
- ],
- [no:yes], [
- AC_DEFINE(HAVE_BSD_QSORT_R, 1)
- ])
-fi
-
-AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [
- AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [
- AC_TRY_RUN([
-@%:@include <math.h>
-@%:@ifdef HAVE_UNISTD_H
-@%:@include <unistd.h>
-@%:@endif
-@%:@ifndef EXIT_SUCCESS
-@%:@define EXIT_SUCCESS 0
-@%:@endif
-@%:@ifndef EXIT_FAILURE
-@%:@define EXIT_FAILURE 1
-@%:@endif
-
-int
-main(int argc, char **argv)
-{
- if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS;
- return EXIT_FAILURE;
-}
-],
- [rb_cv_atan2_inf_c99=yes],
- [rb_cv_atan2_inf_c99=no],
- [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])]
- )
- ], [rb_cv_atan2_inf_c99=no])
-])
-AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)])
-
-AS_IF([test "x$ac_cv_func_lgamma_r" = xyes], [
- AC_CACHE_CHECK(whether lgamma_r handles -0.0, rb_cv_lgamma_r_m0, [
- AC_TRY_RUN([
-@%:@include <math.h>
-@%:@ifdef HAVE_UNISTD_H
-@%:@include <unistd.h>
-@%:@endif
-@%:@ifndef EXIT_SUCCESS
-@%:@define EXIT_SUCCESS 0
-@%:@endif
-@%:@ifndef EXIT_FAILURE
-@%:@define EXIT_FAILURE 1
-@%:@endif
-
-int
-main(int argc, char **argv)
-{
- int sign;
- double x = lgamma_r(-0.0, &sign);
-
- /* should be [+inf, -1] */
- if (x <= 0) return EXIT_FAILURE;
- if (!isinf(x)) return EXIT_FAILURE;
- if (sign != -1) return EXIT_FAILURE;
- return EXIT_SUCCESS;
-}
-],
- [rb_cv_lgamma_r_m0=yes],
- [rb_cv_lgamma_r_m0=no],
- [rb_cv_lgamma_r_m0=yes]
- )
- ])
- AS_IF([test "x$rb_cv_lgamma_r_m0" = xno], [AC_DEFINE(LGAMMA_R_M0_FIX)])
-])
-
-# Some platform need -lrt for clock_gettime, but the other don't.
-if test x"$ac_cv_func_clock_gettime" != xyes; then
- # glibc 2.17 moves clock_* functions from librt to the main C library.
- # http://sourceware.org/ml/libc-announce/2012/msg00001.html
- AC_CHECK_LIB(rt, clock_gettime)
- if test x"$ac_cv_lib_rt_clock_gettime" = xyes; then
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
- fi
-fi
-AC_CHECK_FUNCS(clock_getres) # clock_getres should be tested after clock_gettime test including librt test.
+AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\
+ truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
+ truncate64 ftruncate64 ftello64 fseeko fseeko64 \
+ link symlink readlink readdir_r fsync fdatasync fchown posix_fadvise\
+ setitimer setruid seteuid setreuid setresuid socketpair\
+ setrgid setegid setregid setresgid issetugid pause lchown lchmod\
+ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
+ getpriority getrlimit setrlimit sysconf close getpwnam_r getgrnam_r\
+ dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp\
+ getsid setsid telldir seekdir fchmod cosh sinh tanh log2 round llabs\
+ setuid setgid daemon select_large_fdset setenv unsetenv\
+ mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
+ pread sendfile shutdown sigaltstack dl_iterate_phdr\
+ dup dup3 pipe2 posix_memalign memalign ioctl)
AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
[AC_TRY_COMPILE([
@@ -2497,86 +1589,49 @@ if test "$rb_cv_unsetenv_return_value" = no; then
AC_DEFINE(VOID_UNSETENV)
fi
-# used for AC_ARG_WITH(setjmp-type)
-AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp,
- [AC_TRY_COMPILE([
-#include <setjmp.h>
-], [sigjmp_buf env; sigsetjmp(env,1);],
- ac_cv_func_sigsetjmp=yes,
- ac_cv_func_sigsetjmp=no)])
-
-AC_DEFUN([RUBY_CHECK_BUILTIN_SETJMP], [
-if test x"${ac_cv_func___builtin_setjmp}" = xyes; then
- unset ac_cv_func___builtin_setjmp
-fi
AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
- [
- ac_cv_func___builtin_setjmp=no
- for cast in "" "(void **)"; do
- RUBY_WERROR_FLAG(
- [AC_TRY_LINK([@%:@include <setjmp.h>
- @%:@include <stdio.h>
- jmp_buf jb;
- void t(void) {__builtin_longjmp($cast jb, 1);}
- int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}],
- [
- void (*volatile f)(void) = t;
- if (!jump()) printf("%d\n", f != 0);
- ],
- [ac_cv_func___builtin_setjmp="yes with cast ($cast)"])
- ])
- test "$ac_cv_func___builtin_setjmp" = no || break
- done])
+[AC_TRY_LINK([@%:@include <setjmp.h>
+ jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
+ [__builtin_setjmp(jb);],
+ [ac_cv_func___builtin_setjmp=yes],
+ [ac_cv_func___builtin_setjmp=no])
])
-AC_DEFUN([RUBY_SETJMP_TYPE], [
-RUBY_CHECK_BUILTIN_SETJMP
+test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
+
AC_MSG_CHECKING(for setjmp type)
-setjmp_suffix=
AC_ARG_WITH(setjmp-type,
AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
[
AS_CASE([$withval],
- [__builtin_setjmp], [setjmp=__builtin_setjmp],
+ [__builtin_setjmp], [ setjmp_prefix=__builtin_],
[_setjmp], [ setjmp_prefix=_],
[sigsetjmp], [ setjmp_prefix=sig],
[setjmp], [ setjmp_prefix=],
- [setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
[''], [ unset setjmp_prefix],
[ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
-setjmp_cast=
if test ${setjmp_prefix+set}; then
- if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no; then
- AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
+ if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
+ AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
fi
-elif { AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]) }; then
- setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
+elif test "$ac_cv_func___builtin_setjmp" = yes; then
setjmp_prefix=__builtin_
- setjmp_suffix=
-elif test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes; then
- setjmp_prefix=
- setjmp_suffix=ex
elif test "$ac_cv_func__setjmp" = yes; then
setjmp_prefix=_
- setjmp_suffix=
elif test "$ac_cv_func_sigsetjmp" = yes; then
AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
- setjmp_suffix=
else
setjmp_prefix=
- setjmp_suffix=
fi
if test x$setjmp_prefix = xsig; then
setjmp_sigmask=yes
else
unset setjmp_sigmask
fi
-AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+\($setjmp_cast\)})
-AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask+,0})])
-AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp($setjmp_cast(env),val)])
+AC_MSG_RESULT(${setjmp_prefix}setjmp)
+AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})])
+AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
-])
-# End of setjmp check.
AC_ARG_ENABLE(setreuid,
AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
@@ -2722,7 +1777,7 @@ main()
],
rb_cv_localtime_overflow=yes,
rb_cv_localtime_overflow=no,
- rb_cv_localtime_overflow=no)])
+ rb_cv_localtime_overflow=yes)])
if test "$rb_cv_localtime_overflow" = no; then
AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
fi
@@ -2760,27 +1815,12 @@ main()
fi
if test "$ac_cv_func_getpgid" = no; then
- # AC_FUNC_GETPGRP fails when cross-compiling with old autoconf.
- # autoconf is changed between 2.52d and 2.52f?
- # http://lists.gnu.org/archive/html/bug-gnu-utils/2001-09/msg00181.html
- # "autoconf cleanup for AC_FUNC_GETPGRP and GETPGRP_VOID"
AC_FUNC_GETPGRP
fi
if test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes; then
- # AC_FUNC_SETPGRP fails when cross-compiling. (until autoconf 2.69?)
- # https://lists.gnu.org/archive/html/bug-autoconf/2013-02/msg00002.html
- # "AC_FUNC_SETPGRP fails to work properly when cross-compiling"
AC_FUNC_SETPGRP
fi
-if test x"$ac_cv_func_dirfd" = xno; then
- AS_CASE(["$target_os"],[solaris*],
- [AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[
-#include <sys/types.h>
-#include <dirent.h>
-])])
-fi
-
if test x"$target_cpu" = xia64; then
AC_LIBOBJ([ia64])
AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
@@ -2806,8 +1846,96 @@ else
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
fi
-if test x"$ac_cv_func_gettimeofday" != xyes; then
- AC_MSG_ERROR(gettimeofday() must exist)
+# win32.c still use this. Don't remove it.
+test "$rb_cv_fcnt" = "not found" && rb_cv_fcnt="not found (OK if using GNU libc)"
+AC_CACHE_CHECK([read count field in FILE structures], rb_cv_fcnt,
+[rb_cv_fcnt="not found (OK if using GNU libc)"
+for fcnt in dnl
+ _cnt dnl
+ __cnt dnl
+ _r dnl
+ readCount dnl
+ _rcount dnl for emx0.9c
+; do
+ AC_TRY_COMPILE([#include <stdio.h>
+],
+ [FILE *f = stdin; f->$fcnt = 0;],
+ [rb_cv_fcnt="$fcnt"; break])
+done])
+AS_CASE("$rb_cv_fcnt",
+ ["not found"*], [rb_cv_fcnt="not found"],
+ [AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)])
+
+# win32.c still use this. Don't remove it.
+AC_CACHE_CHECK([read buffer ptr field in FILE structures], rb_cv_frptr,
+[for frptr in dnl
+ _IO_read_ptr dnl
+ _ptr dnl
+ __ptr dnl
+ bufpos dnl
+ _p dnl
+ __bufpos dnl
+; do
+ AC_TRY_COMPILE([#include <stdio.h>
+],
+ [FILE *f = stdin; char buf[256]; f->$frptr = buf;],
+ rb_cv_frptr="$frptr"; break,
+ rb_cv_frptr="not found")
+done])
+if test "$rb_cv_frptr" != "not found"; then
+ AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
+
+ if test "$rb_cv_fcnt" = "not found"; then
+ AC_CACHE_CHECK([read buffer end field in FILE structures], rb_cv_frend,
+ [for frend in dnl
+ _IO_read_end dnl
+ bufread dnl
+ __bufread dnl
+ ; do
+ AC_TRY_COMPILE([#include <stdio.h>
+ ],
+ [FILE *f = stdin; char buf[256]; f->$frend = buf;],
+ rb_cv_frend="$frend"; break,
+ rb_cv_frend="not found")
+ done])
+ if test "$rb_cv_frend" != "not found"; then
+ AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
+ fi
+ fi
+fi
+
+RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
+
+AC_CACHE_CHECK([whether struct dirent.d_name is too small], rb_cv_sizeof_struct_dirent_too_small,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([
+@%:@if defined _WIN32
+@%:@ error <<<struct direct in win32/dir.h has variable length d_name>>>
+@%:@elif defined HAVE_DIRENT_H
+@%:@ include <dirent.h>
+@%:@elif defined HAVE_DIRECT_H
+@%:@ include <direct.h>
+@%:@else
+@%:@ define dirent direct
+@%:@ if HAVE_SYS_NDIR_H
+@%:@ include <sys/ndir.h>
+@%:@ endif
+@%:@ if HAVE_SYS_DIR_H
+@%:@ include <sys/dir.h>
+@%:@ endif
+@%:@ if HAVE_NDIR_H
+@%:@ include <ndir.h>
+@%:@ endif
+@%:@endif
+@%:@include <stddef.h>
+@%:@define numberof(array) [(int)(sizeof(array) / sizeof((array)[0]))]
+struct dirent d;
+])],
+ [offsetof(struct dirent, [d_name[numberof(d.d_name)]]) - offsetof(struct dirent, d_name) < 256])],
+ [rb_cv_sizeof_struct_dirent_too_small=yes],
+ [rb_cv_sizeof_struct_dirent_too_small=no])])
+if test "$rb_cv_sizeof_struct_dirent_too_small" = yes; then
+ AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
fi
if test "$ac_cv_func_sysconf" = yes; then
@@ -2826,7 +1954,7 @@ if test "$ac_cv_func_sysconf" = yes; then
RUBY_CHECK_SYSCONF(CLK_TCK)
fi
-AC_DEFUN([RUBY_STACK_GROW_DIRECTION], [
+AC_DEFUN(RUBY_STACK_GROW_DIRECTION, [
AS_VAR_PUSHDEF([stack_grow_dir], [rb_cv_stack_grow_dir_$1])
AC_CACHE_CHECK(stack growing direction on $1, stack_grow_dir, [
AS_CASE(["$1"],
@@ -2902,109 +2030,30 @@ if test x"$enable_pthread" = xyes; then
[root], [],
[c_r], [MAINLIBS="-pthread $MAINLIBS"],
[AS_CASE(["$target_os"],
- [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
+ [openbsd*], [LIBS="-pthread $LIBS"],
[LIBS="-l$pthread_lib $LIBS"])])
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
- AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [
- AC_TRY_COMPILE([
- @%:@include <pthread.h>
- ], [
- pthread_t thread_id;
- thread_id = 0;
- if (!thread_id) return 0;
- ], [rb_cv_scalar_pthread_t=yes], [rb_cv_scalar_pthread_t=no])
- ])
- if test x"$rb_cv_scalar_pthread_t" = xyes; then
- : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>])
- else
- AC_DEFINE(NON_SCALAR_THREAD_ID)
- fi
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
- pthread_attr_get_np pthread_attr_getstack\
+ pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\
pthread_get_stackaddr_np pthread_get_stacksize_np \
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
pthread_cond_init pthread_condattr_setclock pthread_condattr_init \
- pthread_sigmask pthread_setname_np pthread_set_name_np)
- AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
+ pthread_sigmask)
if test "${host_os}" = "nacl"; then
ac_cv_func_pthread_attr_init=no
else
AC_CHECK_FUNCS(pthread_attr_init)
fi
- set_current_thread_name=
- if test "$ac_cv_func_pthread_setname_np" = yes; then
- AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
- [rb_cv_func_pthread_setname_np_arguments=
- # Linux,AIX, (pthread_self(), name)
- # NetBSD (pthread_self(), name, \"%s\")
- # Darwin (name)
- for mac in \
- "(pthread_self(), name)" \
- "(pthread_self(), name, \"%s\")" \
- "(name)" \
- ; do
- AC_TRY_COMPILE([
- @%:@include <pthread.h>
- @%:@ifdef HAVE_PTHREAD_NP_H
- @%:@include <pthread_np.h>
- @%:@endif
- @%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
- ],
- [if (SET_THREAD_NAME("conftest")) return 1;],
- [rb_cv_func_pthread_setname_np_arguments="${mac}"
- break])
- done
- ]
- )
- if test -n "${rb_cv_func_pthread_setname_np_arguments}"; then
- set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setname_np_arguments}"
- fi
- elif test "$ac_cv_func_pthread_set_name_np" = yes; then
- set_current_thread_name="pthread_set_name_np(pthread_self(), name)"
- fi
- AS_IF([test -n "$set_current_thread_name"], [
- AC_DEFINE_UNQUOTED(SET_CURRENT_THREAD_NAME(name), $set_current_thread_name)
- AS_CASE([$set_current_thread_name],
- [*'pthread_self()'*], [
- set_another_thread_name=`echo "$set_current_thread_name" | sed 's/pthread_self()/thid/'`
- AC_DEFINE_UNQUOTED(SET_ANOTHER_THREAD_NAME(thid,name), $set_another_thread_name)
- ])
- ])
-fi
-
-if test x"$ac_cv_header_ucontext_h" = xno; then
- AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h],
- [AC_TRY_COMPILE([@%:@include <signal.h>],
- [size_t size = sizeof(ucontext_t);],
- [rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])])
- if test x"$rb_cv_ucontext_in_signal_h" = xyes; then
- AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1)
- fi
fi
-if test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes; then
- AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
- [AC_TRY_COMPILE([
- @%:@include <signal.h>
- @%:@ifdef HAVE_UCONTEXT_H
- @%:@include <ucontext.h>
- @%:@endif
- mcontext_t test(mcontext_t mc) {return mc+1;}
- ],
- [test(0);],
- [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])])
- if test x"$rb_cv_mcontext_t_ptr" = xyes; then
- AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
- else
- AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext)
- fi
+if test x"$ac_cv_header_ucontext_h" = xyes; then
if test x"$rb_with_pthread" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
fi
fi
-if test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"; then
+if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
[AC_TRY_RUN([
#include <stdlib.h>
@@ -3088,8 +2137,8 @@ AC_ARG_WITH(dln-a-out,
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
[AC_TRY_LINK([],[], [
-AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"],
-[.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
+AS_CASE(["`head -1 conftest$EXEEXT | cat -e`"],
+['^?ELF'*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
rb_cv_binary_elf=no)])
if test "$rb_cv_binary_elf" = yes; then
@@ -3122,7 +2171,6 @@ AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
-AC_SUBST(ASMEXT, S)dnl
STATIC=
: ${PATHFLAG=''}
@@ -3141,7 +2189,7 @@ if test "$with_dln_a_out" != yes; then
# mkmf.rb's have_header() to fail if the desired resource happens to be
# installed in the /usr/local tree.
RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
- [bsdi*|cygwin*|mingw*|aix*|interix*], [ ],
+ [bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
[
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
else
@@ -3158,6 +2206,9 @@ if test "$with_dln_a_out" != yes; then
AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
enabled by default on ELF platforms]),
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
+ if test "$enable_rpath" = yes; then
+ RPATHFLAG=" ${linker_flag}-R%1\$-s"
+ fi
AS_CASE(["$target_os"],
[hpux*], [ DLDFLAGS="$DLDFLAGS -E"
@@ -3168,7 +2219,7 @@ if test "$with_dln_a_out" != yes; then
RPATHFLAG=' +b %1$-s'
fi
rb_cv_dlopen=yes],
- [solaris*], [ if test "$GCC" = yes; then
+ [solaris*], [ if test "$GCC" = yes; then
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_prog_gnu_ld" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
@@ -3178,10 +2229,6 @@ if test "$with_dln_a_out" != yes; then
fi
if test "$ac_cv_sizeof_voidp" = 8; then
: ${LIBPATHENV=LD_LIBRARY_PATH_64}
- : ${PRELOADENV=LD_PRELOAD_64}
- else
- : ${LIBPATHENV=LD_LIBRARY_PATH_32}
- : ${PRELOADENV=LD_PRELOAD_32}
fi
rb_cv_dlopen=yes],
[sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
@@ -3199,7 +2246,7 @@ if test "$with_dln_a_out" != yes; then
[bsdi3*], [ AS_CASE(["$CC"],
[*shlicc*], [ : ${LDSHARED='$(CC) -r'}
rb_cv_dlopen=yes])],
- [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [
+ [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
@@ -3213,20 +2260,28 @@ if test "$with_dln_a_out" != yes; then
: ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
+ DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
else
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
fi
rb_cv_dlopen=yes],
- [openbsd*|mirbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
+ [openbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
rb_cv_dlopen=yes],
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
+ : ${DLDFLAGS="${linker_flag}-undefined${linker_flag:+,}dynamic_lookup ${linker_flag}-multiply_defined${linker_flag:+,}suppress"}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
- : ${PRELOADENV=DYLD_INSERT_LIBRARIES}
+ # /usr/local/include is always searched for
+ # some reason, but /usr/local/lib is not.
+ hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'`
+ if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null 2>/dev/null | fgrep -q "$hdr"; then
+ $CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' ||
+ echo " $LDFLAGS " | grep -q ' -L */usr/local/lib/* ' ||
+ LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib"
+ fi
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
LDSHARED="$LDSHARED ${linker_flag}-G"
@@ -3239,6 +2294,32 @@ if test "$with_dln_a_out" != yes; then
: ${LIBPATHENV=LIBPATH}
RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
rb_cv_dlopen=yes],
+ [beos*], [ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
+ ],
+ [i586*], [
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lroot"
+ LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lroot"
+ ])
+ : ${LIBPATHENV=LIBRARY_PATH}
+ rb_cv_dlopen=yes],
+ [haiku*], [ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ ],
+ [i586*], [
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lroot"
+ ])
+ : ${LIBPATHENV=LIBRARY_PATH}
+ rb_cv_dlopen=yes ],
[nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
: ${LDSHARED='$(LD) -Bshareable -x'}
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
@@ -3248,46 +2329,15 @@ if test "$with_dln_a_out" != yes; then
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
- : ${PRELOADENV=""}
rb_cv_dlopen=yes],
[hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
[atheos*], [ : ${LDSHARED='$(CC) -shared'}
rb_cv_dlopen=yes],
+ [os2-emx*], [ LDFLAGS="$LDFLAGS -Zomf"
+ ],
[nacl], [ LDSHARED='$(CC) -shared' ],
- [ : ${LDSHARED='$(LD)'}])
+ [ : ${LDSHARED='$(LD)'}])
AC_MSG_RESULT($rb_cv_dlopen)
-
- if test "$rb_cv_dlopen" = yes; then
- AS_CASE(["$target_os"],
- [darwin*], [
- for flag in \
- "-undefined dynamic_lookup" \
- "-multiply_defined suppress" \
- ; do
- test "x${linker_flag}" = x || flag="${linker_flag}`echo ${flag} | tr ' ' ,`"
- RUBY_TRY_LDFLAGS([$flag], [], [flag=])
- if test "x$flag" != x; then
- RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
- fi
- done
- ])
- fi
-
- if test "$enable_rpath" = yes; then
- if test x"${RPATHFLAG}" = x; then
- for rpathflag in -R "-rpath "; do
- AS_CASE("$rpathflag",
- [*" "], [AS_CASE(["${linker_flag}"],
- [*,], [rpathflag=`echo "$rpathflag" | tr ' ' ,`])])
- rpathflag="${linker_flag}${rpathflag}"
- RUBY_TRY_LDFLAGS([${rpathflag}.], [], [rpathflag=])
- if test "x${rpathflag}" != x; then
- RPATHFLAG=" ${rpathflag}%1\$-s"
- break
- fi
- done
- fi
- fi
fi
if test "${LDSHAREDXX}" = ""; then
AS_CASE(["${LDSHARED}"],
@@ -3309,106 +2359,39 @@ AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
-AC_SUBST(PRELOADENV, "${PRELOADENV-LD_PRELOAD}")
AC_SUBST(TRY_LINK)
-if test "x$OPT_DIR" != x; then
- pat=`echo "${LDFLAGS_OPTDIR}" | sed ['s/[][\\.*|]/\\\\&/']`
- LDFLAGS=`echo "${LDFLAGS}" | sed "s| ${pat}||"`
- val=`IFS="$PATH_SEPARATOR"
- for dir in $OPT_DIR; do
- echo x ${LIBPATHFLAG} ${RPATHFLAG} |
- sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
- done | tr '\012' ' ' | sed 's/ *$//'`
- if test x"$val" != x; then
- test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
- LDFLAGS="$LDFLAGS$val"
- test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
- DLDFLAGS="$DLDFLAGS$val"
- fi
- LDFLAGS_OPTDIR="$val"
-fi
+AC_ARG_WITH(opt-dir,
+ AS_HELP_STRING([--with-opt-dir=DIR-LIST],
+ [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
+ [
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
+ CPPFLAGS="$CPPFLAGS $val"
+ set -x
+ val=`IFS="$PATH_SEPARATOR"
+ for dir in $withval; do
+ echo x ${LIBPATHFLAG} ${RPATHFLAG} |
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
+ done | tr '\012' ' '`
+ set +x
+ LDFLAGS="$LDFLAGS${LDFLAGS:+ }$val"
+ DLDFLAGS="$DLDFLAGS${DLDFLAGS:+ }$val"
+ ])
-AS_CASE(["$target_os"],
-[freebsd*], [
- AC_CHECK_LIB([procstat], [procstat_open_sysctl])
- if test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes; then
- AC_CHECK_FUNCS(procstat_getvmmap)
- fi
- ])
AS_CASE(["$target_cpu-$target_os"],
-[*-darwin*], [
- AC_CHECK_HEADERS([execinfo.h])
- if test "x$ac_cv_header_execinfo_h" = xyes; then
- AC_CHECK_LIB([execinfo], [backtrace])
- AC_CHECK_HEADERS([libunwind.h])
- fi],
[*-freebsd*|x86_64-netbsd*], [
AC_CHECK_HEADERS([execinfo.h])
if test "x$ac_cv_header_execinfo_h" = xyes; then
AC_CHECK_LIB([execinfo], [backtrace])
- AC_CHECK_LIB([unwind], [unw_backtrace])
+ execinfo_frame_pointer=no
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [execinfo_frame_pointer=yes])
+ if test "x$execinfo_frame_pointer" = xyes; then
+ optflags="${optflags+$optflags }-fno-omit-frame-pointer"
+ CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+ fi
fi])
AC_CHECK_FUNCS(backtrace)
-if test "x$ac_cv_func_backtrace" = xyes; then
- AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace,
- [AC_TRY_RUN([
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <signal.h>
-#include <execinfo.h>
-
-#define TRACE_SIZE 256
-
-void sigsegv(int signum, siginfo_t *info, void *ctx){
- void *trace[TRACE_SIZE];
- int n = backtrace(trace, TRACE_SIZE);
- if (n > 0) {
- /*fprintf(stdout, "backtrace:%d\n",n);*/
- } else {
- _exit(EXIT_FAILURE);
- }
- _exit(EXIT_SUCCESS);
-}
-int
-main(void)
-{
- volatile int *a = NULL;
- stack_t ss;
- ss.ss_sp = malloc(SIGSTKSZ);
- if (ss.ss_sp == NULL) {
- fprintf(stderr, "cannot allocate memory for sigaltstack\n");
- return EXIT_FAILURE;
- }
- ss.ss_size = SIGSTKSZ;
- ss.ss_flags = 0;
- if (sigaltstack(&ss, NULL) == -1) {
- fprintf(stderr, "sigaltstack failed\n");
- return EXIT_FAILURE;
- }
- struct sigaction sa;
- memset(&sa, 0, sizeof(struct sigaction));
- sigemptyset(&sa.sa_mask);
- sa.sa_sigaction = sigsegv;
- sa.sa_flags |= SA_SIGINFO;
- sa.sa_flags |= SA_ONSTACK;
- sigaction(SIGSEGV, &sa, NULL);
- a[0] = 1;
- return EXIT_SUCCESS;
-}
-],
- rb_cv_broken_backtrace=no,
- rb_cv_broken_backtrace=yes,
- rb_cv_broken_backtrace=no)])
- if test "$rb_cv_broken_backtrace" = yes; then
- AC_DEFINE(BROKEN_BACKTRACE, 1)
- fi
-fi
-
AC_ARG_WITH(valgrind,
AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
[], with_valgrind=yes)
@@ -3449,6 +2432,9 @@ else
[darwin*], [
RUBY_APPEND_OPTION(XLDFLAGS, [-Wl,-u,_objc_msgSend])
DLEXT=bundle],
+ [os2-emx*], [
+ LOAD_RELATIVE=1
+ DLEXT=dll],
[cygwin*|mingw*|*djgpp*], [
LOAD_RELATIVE=1
DLEXT=so],
@@ -3456,6 +2442,7 @@ else
DLEXT=so])
fi
if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
+ AC_CHECK_FUNCS(dladdr)
if test "$ac_cv_func_dladdr" = yes; then
LOAD_RELATIVE=1
fi
@@ -3496,66 +2483,35 @@ EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
- [AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTATIC="$withval"])])
-AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [
+ [AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static])])
+if test x"$EXTSTATIC" = xstatic; then
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
EXTOBJS='ext/extinit.$(OBJEXT)'
AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
- AC_SUBST(ENCSTATIC, static)
-], [
- ENCOBJS='dmyenc.$(OBJEXT)'
- EXTOBJS='dmyext.$(OBJEXT)'
-])
+fi
AC_SUBST(ENCOBJS)
AC_SUBST(EXTOBJS)
-AC_ARG_WITH(setup,
- AS_HELP_STRING([--with-setup=SETUP], [use extension libraries setup]),
- [setup=$withval])
-if test -n "$setup"; then
- if ! test -f "ext/$setup" -o -f "$srcdir/ext/$setup"; then
- AC_MSG_ERROR(Setup file $setup not found under ext or $srcdir/ext)
- fi
-elif test -f "$srcdir/ext/Setup.$target_os"; then
- setup="Setup.$target_os"
-else
- setup=
- for file in "$srcdir"/ext/Setup.*; do
- AS_CASE(["$file"], [*~|*.bak|*.orig|*.rej|*.tmp], [continue])
- setup=`basename "$file"`
- AS_CASE(["$target_os"], [`expr "$setup" : 'Setup.\(.*\)'`*], [break])
- platform=`sed '/^option *platform */!d;s///;s/|/*|/g;q' "$file"`
- if test "x$platform" != x; then
- eval "AS_CASE([\"\$target_os\"], [$platform*], [break])"
- fi
- setup=
- done
- : ${setup:=Setup}
-fi
-AC_SUBST(setup)
+AS_CASE(["$target_os"],
+ dnl OS/2 environment w/ Autoconf 2.1x for EMX
+ [os2-emx], [
+ setup=Setup.emx
+ ],
+ [*djgpp*], [
+ setup=Setup.dj
+ ],
+ [nacl], [
+ setup=Setup.nacl
+ ],
+ [
+ setup=Setup
+ ])
-rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
-AC_ARG_WITH(rubylibprefix,
- AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
- [if test "x$withval" = xno; then
- AC_MSG_ERROR([No ruby, No libprefix])
- fi
- rubylibprefix="$withval"])
-AC_SUBST(rubylibprefix)
+AC_SUBST(setup)
-if test x"${exec_prefix}" != xNONE; then
- RUBY_EXEC_PREFIX="$exec_prefix"
-elif test x"$prefix" != xNONE; then
- RUBY_EXEC_PREFIX="$prefix"
-else
- RUBY_EXEC_PREFIX=$ac_default_prefix
+if test "$prefix" = NONE; then
+ prefix=$ac_default_prefix
fi
-pat=`echo "${RUBY_EXEC_PREFIX}" | tr -c '\012' .`'\(.*\)'
-for var in bindir libdir rubylibprefix; do
- eval val='"$'$var'"'
- AS_CASE(["$val"], ["${RUBY_EXEC_PREFIX}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
- eval $var='"$val"'
-done
BTESTRUBY='$(MINIRUBY)'
if test x"$cross_compiling" = xyes; then
@@ -3567,10 +2523,8 @@ if test x"$cross_compiling" = xyes; then
AC_SUBST(XRUBY_RUBYLIBDIR)
AC_SUBST(XRUBY_RUBYHDRDIR)
PREP='$(arch)-fake.rb'
- RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
- RUNRUBY='$(RUNRUBY_COMMAND)'
+ RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
XRUBY='$(MINIRUBY)'
- BOOTSTRAPRUBY='$(BASERUBY)'
TEST_RUNNABLE=no
CROSS_COMPILING=yes
@@ -3591,10 +2545,8 @@ else
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
PREP='miniruby$(EXEEXT)'
- RUNRUBY_COMMAND='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
- RUNRUBY='$(RUNRUBY_COMMAND) --'
+ RUNRUBY='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT)'
XRUBY='$(RUNRUBY)'
- BOOTSTRAPRUBY='$(MINIRUBY)'
TEST_RUNNABLE=yes
CROSS_COMPILING=no
fi
@@ -3603,10 +2555,8 @@ AC_SUBST(CROSS_COMPILING)
AC_SUBST(MINIRUBY)
AC_SUBST(BTESTRUBY)
AC_SUBST(PREP)
-AC_SUBST(RUNRUBY_COMMAND)
AC_SUBST(RUNRUBY)
AC_SUBST(XRUBY)
-AC_SUBST(BOOTSTRAPRUBY)
AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
FIRSTMAKEFILE=""
@@ -3617,25 +2567,13 @@ LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
AS_CASE(["$target_os"],
- [cygwin*|mingw*|haiku*|darwin*], [
+ [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
: ${DLDLIBS=""}
],
[
DLDLIBS="$DLDLIBS -lc"
])
-AC_ARG_ENABLE(multiarch,
- AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
- [multiarch=], [unset multiarch])
-if test ${multiarch+set}; then
- AC_DEFINE(ENABLE_MULTIARCH)
-fi
-
-archlibdir='${libdir}/${arch}'
-sitearchlibdir='${libdir}/${sitearch}'
-archincludedir='${includedir}/${arch}'
-sitearchincludedir='${includedir}/${sitearch}'
-
AC_ARG_WITH(soname,
AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
[RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
@@ -3649,7 +2587,7 @@ ENABLE_SHARED=no
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
-libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
+libprefix='$(libdir)'
LIBRUBY_RELATIVE=${load_relative-no}
AS_CASE("$enable_shared", [yes], [
LIBRUBY='$(LIBRUBY_SO)'
@@ -3668,7 +2606,6 @@ AS_CASE("$enable_shared", [yes], [
AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
fi
AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
- libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}
AS_CASE(["$target_os"],
[freebsd*|dragonfly*], [],
@@ -3685,12 +2622,11 @@ AS_CASE("$enable_shared", [yes], [
[sunos4*], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
],
- [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu | haiku*], [
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'" $LDFLAGS_OPTDIR"
+ [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
if test "$load_relative" = yes; then
- libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
- LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
+ LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../${libdir_basename}'"
LIBRUBY_RELATIVE=yes
fi
],
@@ -3705,14 +2641,14 @@ AS_CASE("$enable_shared", [yes], [
[netbsd*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'" $LDFLAGS_OPTDIR"
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
if test "$rb_cv_binary_elf" = yes; then # ELF platforms
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
else # a.out platforms
LIBRUBY_ALIASES=""
fi
],
- [openbsd*|mirbsd*], [
+ [openbsd*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
],
@@ -3733,10 +2669,16 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
],
[aix*], [
- LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS $LDFLAGS_OPTDIR"
+ LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
SOLIBS='-lm -lc'
],
+ [beos*], [
+ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
+ ])
+ ],
[darwin*], [
RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
@@ -3746,16 +2688,14 @@ AS_CASE("$enable_shared", [yes], [
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(RUBY_PROGRAM_VERSION)'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
if test "$visibility_option" = ld; then
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
- SOLIBS='$(LIBS)'
],
[interix*], [
LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
@@ -3767,10 +2707,12 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBYARG_SHARED=
# enable PIE if possible
- AC_ARG_ENABLE(pie,
- AS_HELP_STRING([--disable-pie], [disable PIE feature]),
- [pie=$enableval], [pie=])
+ pie=
AS_CASE(["$target_os"],
+ [haiku], [
+ # gcc supports PIE, but doesn't work correctly in Haiku
+ pie=no
+ ],
[nacl], [
# -pie implies -shared for NaCl.
pie=no
@@ -3798,13 +2740,7 @@ AS_CASE("$enable_shared", [yes], [
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
- rpathflag="${RPATHFLAG}"
- AS_CASE(["${cross_compiling}${load_relative}"], [*yes*], [], [rpathflag="$RPATHFLAG$LIBPATHFLAG"])
- rpathflag=`IFS="$PATH_SEPARATOR"
- echo x "$rpathflag" |
- sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g"
- `
- LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}"
+ LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi
@@ -3820,15 +2756,6 @@ if test "$EXEEXT" = .exe; then
AC_SUBST(EXECUTABLE_EXTS)
fi
-AS_CASE("$cross_compiling:${LIBPATHENV}", [yes:* | no:], [], [
- AC_MSG_CHECKING(whether wrapper for $LIBPATHENV is needed)
- AS_IF([env ${LIBPATHENV}=/lib /bin/sh -c ': ${'${LIBPATHENV}'?}' 2>/dev/null],
- [AC_MSG_RESULT(no)],
- [PREP="$PREP"' ruby-runner$(EXEEXT)'
- AC_MSG_RESULT(yes)]
- )
-])
-
AC_ARG_ENABLE(dtrace,
AS_HELP_STRING([--enable-dtrace],
[enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
@@ -3844,7 +2771,6 @@ if test "${enable_dtrace}" = "auto"; then
fi
LIBRUBY_A_OBJS='$(OBJS)'
-DTRACE_REBUILD=
if test "${enable_dtrace}" = "yes"; then
if test -z "$DTRACE"; then
AC_MSG_ERROR([dtrace(1) is missing])
@@ -3857,11 +2783,9 @@ if test "${enable_dtrace}" = "yes"; then
AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
fi
RUBY_DTRACE_POSTPROCESS()
- if test "$rb_cv_prog_dtrace_g" != 'no'; then
+ if test "$rb_cv_prog_dtrace_g" = 'yes'; then
DTRACE_OBJ='probes.$(OBJEXT)'
- fi
- if test "$rb_cv_prog_dtrace_g" = 'rebuild'; then
- DTRACE_REBUILD=yes
+ DTRACE_GLOMMED_OBJ='ruby-glommed.$(OBJEXT)'
LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
fi
AS_CASE("${target_os}", [freebsd*], [
@@ -3875,10 +2799,9 @@ else
fi
AC_SUBST(DTRACE_EXT)
AC_SUBST(DTRACE_OBJ)
-AC_SUBST(DTRACE_REBUILD)
+AC_SUBST(DTRACE_GLOMMED_OBJ)
AC_SUBST(LIBRUBY_A_OBJS)
-RUBY_SETJMP_TYPE
}
{ # build section
@@ -3886,14 +2809,14 @@ dnl build rdoc index if requested
RDOCTARGET=""
CAPITARGET=""
AC_ARG_ENABLE(install-doc,
- AS_HELP_STRING([--disable-install-doc], [do not install either rdoc indexes or C API documents during install]),
+ AS_HELP_STRING([--disable-install-doc], [do not install neither rdoc indexes nor C API documents during install]),
[install_doc=$enableval], [install_doc=yes])
AC_ARG_ENABLE(install-rdoc,
AS_HELP_STRING([--disable-install-rdoc], [do not install rdoc indexes during install]),
[install_rdoc=$enableval], [install_rdoc=yes])
AC_ARG_ENABLE(install-capi,
AS_HELP_STRING([--disable-install-capi], [do not install C API documents during install]),
- [install_capi=$enableval], [install_capi=no])
+ [install_capi=$enableval], [install_capi=yes])
if test "$install_doc" != no; then
if test "$install_rdoc" != no; then
@@ -3945,8 +2868,13 @@ AS_CASE(["$target_os"],
],
[darwin*], [
RUBY_APPEND_OPTION(CFLAGS, -pipe)
- RUBY_APPEND_OPTION(XLDFLAGS, [-framework CoreFoundation])
- RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework CoreFoundation])
+ ],
+ [os2-emx], [
+ AC_LIBOBJ([os2])
+ CFLAGS="$CFLAGS -DOS2"
+ LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
+ LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
+ LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
],
[osf*], [
if test "$GCC" != "yes" ; then
@@ -3963,6 +2891,10 @@ AS_CASE(["$target_os"],
CFLAGS="$CFLAGS -std"
fi
],
+ [beos*], [
+ AS_CASE(["$target_cpu"],[powerpc*], [CFLAGS="$CFLAGS -relax_pointers"])
+ CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
+ ],
[cygwin*|mingw*], [
RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)'
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
@@ -4011,13 +2943,6 @@ AS_CASE(["$target_os"],
[nacl], [
FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
])
-
-AS_CASE(["$with_gmp: $SOLIBS "], [no:* | *' -lgmp '*|*' $(LIBS) '*], [],
- [SOLIBS="-lgmp $SOLIBS"])
-
-AS_CASE(["$with_jemalloc: $LIBS "], [no:* | *' -ljemalloc '*], [],
- [LIBS="-ljemalloc $LIBS"])
-
MINIOBJS="$MINIDLNOBJ"
AS_CASE(["$THREAD_MODEL"],
@@ -4039,7 +2964,10 @@ AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
rm -fr conftest.dir
AS_CASE(["$gnumake"],
[*yes*], [
- FIRSTMAKEFILE=GNUmakefile:template/GNUmakefile.in
+ echo '@%:@ -*- makefile -*-' > GNUmakefile
+ echo 'override MFLAGS := $(filter-out -j%,$(MFLAGS))' >> GNUmakefile
+ echo "include Makefile" >> GNUmakefile
+ echo "-include uncommon.mk" >> GNUmakefile
gnumake=yes],
[
gnumake=no])
@@ -4096,12 +3024,44 @@ if test "${universal_binary-no}" = yes ; then
mv -f confdefs1.h confdefs.h
AC_MSG_ERROR([failed])
])])
- AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
- AC_TRY_COMPILE([@%:@include <stdio.h>
- const char arch[[]] = __ARCHITECTURE__;], [puts(arch);],
- [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
fi
+AC_CHECK_FUNC(memmem, [
+ AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [
+ AC_TRY_RUN([
+#include <string.h>
+
+int
+main()
+{
+ char *str = "hogefugafoobar";
+ char *rs = "foo";
+ char *empty = "";
+ char *p;
+
+ p = memmem(str, strlen(str), rs, strlen(rs));
+ if (p == str+8) {
+ p = memmem(str, strlen(str), empty, strlen(empty));
+ if (p == str)
+ return 0;
+ else
+ return 1;
+ }
+ else {
+ return 1;
+ }
+}
+ ],
+ rb_cv_broken_memmem=no,
+ rb_cv_broken_memmem=yes,
+ rb_cv_broken_memmem=yes)
+ ])
+ if test "$rb_cv_broken_memmem" = no; then
+ AC_DEFINE(HAVE_MEMMEM, 1)
+ fi
+])
+
+
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
if test -n "${cflags+set}"; then
@@ -4119,7 +3079,7 @@ if test "${ARCH_FLAG}"; then
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
fi
warnflags="$rb_cv_warnflags"
-AC_SUBST(cppflags)dnl
+AC_SUBST(cppflags, [])dnl
AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
AC_SUBST(optflags)dnl
@@ -4156,9 +3116,7 @@ AC_SUBST(MINIOBJS)
AC_SUBST(THREAD_MODEL)
AC_SUBST(PLATFORM_DIR)
-firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
-firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
-MAKEFILES="Makefile $firstmf"
+MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
MAKEFILES="`echo $MAKEFILES`"
AC_SUBST(MAKEFILES)
@@ -4177,28 +3135,22 @@ AS_CASE(["$target_os"],
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
])
-rubylibdir='${rubylibprefix}/${ruby_version}'
-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
-
-rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
-AC_ARG_WITH(rubyarchprefix,
- AS_HELP_STRING([--with-rubyarchprefix=DIR],
- [prefix for architecture dependent ruby libraries [[RUBYLIBPREFIX/ARCH]]]),
- [rubyarchprefix="$withval"])
-AC_SUBST(rubyarchprefix)
-
-rubysitearchprefix=${multiarch+'${sitearchlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${sitearch}'}
-AC_ARG_WITH(rubysitearchprefix,
- AS_HELP_STRING([--with-rubysitearchprefix=DIR],
- [prefix for architecture dependent site libraries [[RUBYLIBPREFIX/SITEARCH]]]),
- [rubysitearchprefix="$withval"])
-AC_SUBST(rubysitearchprefix)
+rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
+AC_ARG_WITH(rubylibprefix,
+ AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
+ [if test "x$withval" = xno; then
+ AC_MSG_ERROR([No ruby, No libprefix])
+ fi
+ rubylibprefix="$withval"])
+RUBY_LIB_PREFIX=`eval echo \\"${rubylibprefix}\\"`
+AC_SUBST(rubylibprefix)
RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
ridir='${datarootdir}/${RI_BASE_NAME}'
AC_ARG_WITH(ridir,
AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
[ridir=$withval])
+RIDIR=`eval echo \\"${ridir}\\"`
AC_SUBST(ridir)
AC_SUBST(RI_BASE_NAME)
@@ -4223,69 +3175,99 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
test -f verconf.h || > verconf.h
ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
eval $ruby_version
-elif test -z "${ruby_version}"; then
- AC_MSG_ERROR([No ruby version, No place for bundled libraries])
else
- RUBY_LIB_VERSION="${ruby_version}"
+ RUBY_LIB_VERSION="\"${ruby_version}\""
fi
-AC_SUBST(RUBY_LIB_VERSION_STYLE)
-AC_SUBST(RUBY_LIB_VERSION)
AC_ARG_WITH(sitedir,
AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
[sitedir=$withval],
[sitedir='${rubylibprefix}/site_ruby'])
-sitelibdir='${sitedir}/${ruby_version}'
-
-AC_ARG_WITH(sitearchdir,
- AS_HELP_STRING([--with-sitearchdir=DIR],
- [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
- [sitearchdir=$withval],
- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
+dir="${sitedir}"
+until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
+ dir="${SITE_DIR}"
+done
AC_ARG_WITH(vendordir,
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
[vendordir=$withval],
[vendordir='${rubylibprefix}/vendor_ruby'])
-vendorlibdir='${vendordir}/${ruby_version}'
-
-AC_ARG_WITH(vendorarchdir,
- AS_HELP_STRING([--with-vendorarchdir=DIR],
- [architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
- [vendorarchdir=$withval],
- [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
+dir="${vendordir}"
+until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
+ dir="${VENDOR_DIR}"
+done
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
- RUBY_EXEC_PREFIX=''
+ RUBY_EXEC_PREFIX=""
+ RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+else
+ RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
+ RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
+ RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
fi
-AC_SUBST(RUBY_EXEC_PREFIX)
+pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
+AS_CASE(["$RUBY_SITE_LIB_PATH"],
+ ["$RUBY_LIB_PREFIX/"*], [
+ RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
+ ])
+AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
+ ["$RUBY_LIB_PREFIX/"*], [
+ RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
+ ])
+pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
+AS_CASE(["$RUBY_LIB_PREFIX"],
+ ["$RUBY_EXEC_PREFIX/"*], [
+ RUBY_LIB_PREFIX='RUBY_EXEC_PREFIX"/'"`expr \"$RUBY_LIB_PREFIX\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_LIB_PREFIX="\"${RUBY_LIB_PREFIX}\""
+ ])
+
+if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
+fi
+AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
+AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
+if test "x$SITE_DIR" = xno; then
+ AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
+fi
+if test "x$VENDOR_DIR" = xno; then
+ AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !<verconf>!)
+else
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
+fi
-AC_SUBST(libdirname, ${multiarch+arch}libdir)
-AC_SUBST(archlibdir)dnl
-AC_SUBST(sitearchlibdir)dnl
-AC_SUBST(archincludedir)dnl
-AC_SUBST(sitearchincludedir)dnl
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)dnl
-AC_SUBST(rubylibdir)dnl
-AC_SUBST(rubyarchdir)dnl
AC_SUBST(sitedir)dnl
-AC_SUBST(sitelibdir)dnl
-AC_SUBST(sitearchdir)dnl
AC_SUBST(vendordir)dnl
-AC_SUBST(vendorlibdir)dnl
-AC_SUBST(vendorarchdir)dnl
-AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
-AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
+configure_args=$ac_configure_args
+AC_SUBST(configure_args)dnl
if test "${universal_binary-no}" = yes ; then
arch="universal-${target_os}"
+ AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
+ AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
+ [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
if test "${rb_cv_architecture_available}" = yes; then
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__ !<verconf>!)
else
for archs in ${universal_archnames}; do
cpu=`echo $archs | sed 's/.*=//'`
@@ -4297,71 +3279,50 @@ if test "${universal_binary-no}" = yes ; then
test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
AC_SUBST(UNIVERSAL_INTS, "${ints}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}" !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS !<verconf>!)
else
arch="${target_cpu}-${target_os}"
- AS_CASE(["$arch"], [le32-nacl], [arch="pnacl"])
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}" !<verconf>!)
fi
unset sitearch
AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
+test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}" !<verconf>!)
: ${sitearch='${arch}'}
AC_ARG_WITH(search-path,
AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
[search_path=$withval])
if test "$search_path" != ""; then
- AC_SUBST(RUBY_SEARCH_PATH, $search_path)
+ AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path" !<verconf>!)
fi
AC_ARG_WITH(rubyhdrdir,
AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
[rubyhdrdir=$withval],
- [rubyhdrdir='${includedir}/${RUBY_VERSION_NAME}'])
-
-AC_ARG_WITH(rubyarchhdrdir,
- AS_HELP_STRING([--with-rubyarchhdrdir=DIR],
- [architecture dependent core headers in DIR [[$(rubyhdrdir)/$(arch)]]]),
- [rubyarchhdrdir=$withval],
- [rubyarchhdrdir=${multiarch+'${archincludedir}/${RUBY_VERSION_NAME}'}${multiarch-'${rubyhdrdir}/${arch}'}])
+ [rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}'])
AC_ARG_WITH(sitehdrdir,
AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
[sitehdrdir=$withval],
[sitehdrdir='${rubyhdrdir}/site_ruby'])
-AC_ARG_WITH(sitearchhdrdir,
- AS_HELP_STRING([--with-sitearchhdrdir=DIR],
- [architecture dependent core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
- [sitearchhdrdir=$withval],
- [sitearchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/site_ruby'}${multiarch-'${sitehdrdir}/${sitearch}'}])
-
AC_ARG_WITH(vendorhdrdir,
AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
[vendorhdrdir=$withval],
[vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
-AC_ARG_WITH(vendorarchhdrdir,
- AS_HELP_STRING([--with-vendorarchhdrdir=DIR],
- [architecture dependent core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
- [vendorarchhdrdir=$withval],
- [vendorarchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/vendor_ruby'}${multiarch-'${vendorhdrdir}/${sitearch}'}])
-
AC_SUBST(rubyhdrdir)dnl
AC_SUBST(sitehdrdir)dnl
AC_SUBST(vendorhdrdir)dnl
-AC_SUBST(rubyarchhdrdir)dnl
-AC_SUBST(sitearchhdrdir)dnl
-AC_SUBST(vendorarchhdrdir)dnl
AC_ARG_WITH(mantype,
AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
[
AS_CASE(["$withval"],
- [man|man.gz|man.bz2|doc|doc.gz|doc.bz2], [MANTYPE=$withval],
+ [man|doc], [MANTYPE=$withval],
[AC_MSG_ERROR(invalid man type: $withval)])
])
if test -z "$MANTYPE"; then
@@ -4392,13 +3353,11 @@ guard=INCLUDE_RUBY_CONFIG_H
{
echo "#ifndef $guard"
echo "#define $guard 1"
- grep -v "^#define PACKAGE_" confdefs.h
+ grep -v "^#define PACKAGE_" confdefs.h | grep -v ' !<verconf>!$'
echo "#endif /* $guard */"
} | tr -d '\015' |
-(
- if test "x$CONFIGURE_TTY" = xyes; then color=--color; else color=; fi
- exec ${srcdir}/tool/ifchange $color "${config_h}" -
-) || AC_MSG_ERROR([failed to create ${config_h}])
+${srcdir}/tool/ifchange "${config_h}" -
+sed -n 's/ !<verconf>!$//p' confdefs.h | ${srcdir}/tool/ifchange verconf.h -
tr -d '\015' < largefile.h > confdefs.h
rm largefile.h
@@ -4406,7 +3365,7 @@ BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
-e '}' "${srcdir}/enc/Makefile.in"`"]
BUILTIN_ENCOBJS=
-for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS "`echo $e | sed 's/\.c$/.$(OBJEXT)/'`; done
+for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
AC_SUBST(BUILTIN_ENCOBJS)
BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
@@ -4415,21 +3374,19 @@ BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
BUILTIN_TRANSSRCS=
BUILTIN_TRANSOBJS=
for e in $BUILTIN_TRANSES; do
- BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS "`echo $e | sed 's/\.trans$/.c/'`
- BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS "`echo $e | sed 's/\.trans$/.$(OBJEXT)/'`
+ BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS `basename $e .trans`"'.c';
+ BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS `basename $e .trans`"'.$(OBJEXT)';
done
AC_SUBST(BUILTIN_TRANSSRCS)
AC_SUBST(BUILTIN_TRANSOBJS)
PACKAGE=$RUBY_BASE_NAME
AC_SUBST(PACKAGE)
-AS_MESSAGE([$PACKAGE library version = $ruby_version])
+AC_MSG_RESULT($PACKAGE library version = $ruby_version)
AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
-if test x"$firstmf" != x; then
- AC_CONFIG_FILES($firstmf:$firsttmpl, [], [firstmf="$firstmf" firsttmpl="$firsttmpl"])
-fi
+AC_CONFIG_FILES($FIRSTMAKEFILE)
AC_CONFIG_FILES(Makefile, [
tmpmk=confmk$$.tmp
{
@@ -4449,7 +3406,6 @@ AC_CONFIG_FILES(Makefile, [
["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
[git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
[VCSUP='$(VCS)'])
- sed -n 's/^@%:@define \(RUBY_RELEASE_DATE\) "\(.*\)"/\1 = \2/p' "$srcdir/version.h"
sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
if test "$gnumake" != yes; then
@@ -4475,17 +3431,12 @@ AC_CONFIG_FILES(Makefile, [
[EXEEXT='$EXEEXT' gnumake='$gnumake'])
AC_ARG_WITH([ruby-pc],
- AC_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]),
+ AC_HELP_STRING([pc file basename]),
[ruby_pc="$withval"],
[ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
AC_SUBST(ruby_pc)
AC_SUBST(exec, [exec])
-AC_ARG_WITH(destdir,
- AS_HELP_STRING([--with-destdir=DESTDIR], [specify default directory to install]),
- [DESTDIR="$withval"])
-AC_SUBST(DESTDIR)
-
AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
[
if sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
diff --git a/constant.h b/constant.h
index 23d17ac24c..9354241961 100644
--- a/constant.h
+++ b/constant.h
@@ -12,32 +12,19 @@
#define CONSTANT_H
typedef enum {
- CONST_DEPRECATED = 0x100,
-
- CONST_VISIBILITY_MASK = 0xff,
CONST_PUBLIC = 0x00,
- CONST_PRIVATE,
- CONST_VISIBILITY_MAX
+ CONST_PRIVATE = 0x01
} rb_const_flag_t;
-#define RB_CONST_PRIVATE_P(ce) \
- (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
-#define RB_CONST_PUBLIC_P(ce) \
- (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
-
-#define RB_CONST_DEPRECATED_P(ce) \
- ((ce)->flag & CONST_DEPRECATED)
-
typedef struct rb_const_entry_struct {
rb_const_flag_t flag;
+ VALUE value; /* should be mark */
+ VALUE file;
int line;
- const VALUE value; /* should be mark */
- const VALUE file; /* should be mark */
} rb_const_entry_t;
-VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
-VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
-VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_mod_private_constant(int argc, VALUE *argv, VALUE obj);
+VALUE rb_mod_public_constant(int argc, VALUE *argv, VALUE obj);
void rb_free_const_table(st_table *tbl);
VALUE rb_public_const_get(VALUE klass, ID id);
VALUE rb_public_const_get_at(VALUE klass, ID id);
@@ -45,6 +32,5 @@ VALUE rb_public_const_get_from(VALUE klass, ID id);
int rb_public_const_defined(VALUE klass, ID id);
int rb_public_const_defined_at(VALUE klass, ID id);
int rb_public_const_defined_from(VALUE klass, ID id);
-rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
#endif /* CONSTANT_H */
diff --git a/cont.c b/cont.c
index 10b1cc602c..43a60fa149 100644
--- a/cont.c
+++ b/cont.c
@@ -9,11 +9,15 @@
**********************************************************************/
+#include "ruby/ruby.h"
#include "internal.h"
#include "vm_core.h"
#include "gc.h"
#include "eval_intern.h"
+#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(__sun) && !defined(FIBER_USE_NATIVE)
+#define FIBER_USE_NATIVE 1
+
/* FIBER_USE_NATIVE enables Fiber performance improvement using system
* dependent method such as make/setcontext on POSIX system or
* CreateFiber() API on Windows.
@@ -25,45 +29,12 @@
* in Proc. of 51th Programming Symposium, pp.21--28 (2010) (in Japanese).
*/
-#if !defined(FIBER_USE_NATIVE)
-# if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
-# if 0
-# elif defined(__NetBSD__)
/* On our experience, NetBSD doesn't support using setcontext() and pthread
* simultaneously. This is because pthread_self(), TLS and other information
* are represented by stack pointer (higher bits of stack pointer).
* TODO: check such constraint on configure.
*/
-# define FIBER_USE_NATIVE 0
-# elif defined(__sun)
-/* On Solaris because resuming any Fiber caused SEGV, for some reason.
- */
-# define FIBER_USE_NATIVE 0
-# elif defined(__ia64)
-/* At least, Linux/ia64's getcontext(3) doesn't save register window.
- */
-# define FIBER_USE_NATIVE 0
-# elif defined(__GNU__)
-/* GNU/Hurd doesn't fully support getcontext, setcontext, makecontext
- * and swapcontext functions. Disabling their usage till support is
- * implemented. More info at
- * http://darnassus.sceen.net/~hurd-web/open_issues/glibc/#getcontext
- */
-# define FIBER_USE_NATIVE 0
-# else
-# define FIBER_USE_NATIVE 1
-# endif
-# elif defined(_WIN32)
-# if _WIN32_WINNT >= 0x0400
-/* only when _WIN32_WINNT >= 0x0400 on Windows because Fiber APIs are
- * supported only such building (and running) environments.
- * [ruby-dev:41192]
- */
-# define FIBER_USE_NATIVE 1
-# endif
-# endif
-#endif
-#if !defined(FIBER_USE_NATIVE)
+#elif !defined(FIBER_USE_NATIVE)
#define FIBER_USE_NATIVE 0
#endif
@@ -88,28 +59,24 @@ enum context_type {
typedef struct rb_context_struct {
enum context_type type;
- int argc;
VALUE self;
+ int argc;
VALUE value;
VALUE *vm_stack;
#ifdef CAPTURE_JUST_VALID_VM_STACK
size_t vm_stack_slen; /* length of stack (head of th->stack) */
size_t vm_stack_clen; /* length of control frames (tail of th->stack) */
#endif
- struct {
- VALUE *stack;
- VALUE *stack_src;
- size_t stack_size;
+ VALUE *machine_stack;
+ VALUE *machine_stack_src;
#ifdef __ia64
- VALUE *register_stack;
- VALUE *register_stack_src;
- int register_stack_size;
+ VALUE *machine_register_stack;
+ VALUE *machine_register_stack_src;
+ int machine_register_stack_size;
#endif
- } machine;
- rb_thread_t saved_thread; /* selected properties of GET_THREAD() (see cont_save_thread) */
+ rb_thread_t saved_thread;
rb_jmpbuf_t jmpbuf;
- rb_ensure_entry_t *ensure_array;
- rb_ensure_list_t *ensure_list;
+ size_t machine_stack_size;
} rb_context_t;
enum fiber_status {
@@ -119,40 +86,36 @@ enum fiber_status {
};
#if FIBER_USE_NATIVE && !defined(_WIN32)
-#define MAX_MACHINE_STACK_CACHE 10
+#define MAX_MAHINE_STACK_CACHE 10
static int machine_stack_cache_index = 0;
typedef struct machine_stack_cache_struct {
void *ptr;
size_t size;
} machine_stack_cache_t;
-static machine_stack_cache_t machine_stack_cache[MAX_MACHINE_STACK_CACHE];
+static machine_stack_cache_t machine_stack_cache[MAX_MAHINE_STACK_CACHE];
static machine_stack_cache_t terminated_machine_stack;
#endif
-struct rb_fiber_struct {
+typedef struct rb_fiber_struct {
rb_context_t cont;
- struct rb_fiber_struct *prev;
+ VALUE prev;
enum fiber_status status;
+ struct rb_fiber_struct *prev_fiber;
+ struct rb_fiber_struct *next_fiber;
/* If a fiber invokes "transfer",
* then this fiber can't "resume" any more after that.
* You shouldn't mix "transfer" and "resume".
*/
- int transferred;
+ int transfered;
#if FIBER_USE_NATIVE
#ifdef _WIN32
void *fib_handle;
#else
ucontext_t context;
- /* Because context.uc_stack.ss_sp and context.uc_stack.ss_size
- * are not necessarily valid after makecontext() or swapcontext(),
- * they are saved in these variables for later use.
- */
- void *ss_sp;
- size_t ss_size;
#endif
#endif
-};
+} rb_fiber_t;
static const rb_data_type_t cont_data_type, fiber_data_type;
static VALUE rb_cContinuation;
@@ -188,32 +151,32 @@ cont_mark(void *ptr)
rb_gc_mark_locations(cont->vm_stack,
cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
#else
- rb_gc_mark_locations(cont->vm_stack,
+ rb_gc_mark_localtion(cont->vm_stack,
cont->vm_stack, cont->saved_thread.stack_size);
#endif
}
- if (cont->machine.stack) {
+ if (cont->machine_stack) {
if (cont->type == CONTINUATION_CONTEXT) {
/* cont */
- rb_gc_mark_locations(cont->machine.stack,
- cont->machine.stack + cont->machine.stack_size);
+ rb_gc_mark_locations(cont->machine_stack,
+ cont->machine_stack + cont->machine_stack_size);
}
else {
/* fiber */
rb_thread_t *th;
rb_fiber_t *fib = (rb_fiber_t*)cont;
GetThreadPtr(cont->saved_thread.self, th);
- if ((th->fiber != fib) && fib->status == RUNNING) {
- rb_gc_mark_locations(cont->machine.stack,
- cont->machine.stack + cont->machine.stack_size);
+ if ((th->fiber != cont->self) && fib->status == RUNNING) {
+ rb_gc_mark_locations(cont->machine_stack,
+ cont->machine_stack + cont->machine_stack_size);
}
}
}
#ifdef __ia64
- if (cont->machine.register_stack) {
- rb_gc_mark_locations(cont->machine.register_stack,
- cont->machine.register_stack + cont->machine.register_stack_size);
+ if (cont->machine_register_stack) {
+ rb_gc_mark_locations(cont->machine_register_stack,
+ cont->machine_register_stack + cont->machine_register_stack_size);
}
#endif
}
@@ -226,31 +189,30 @@ cont_free(void *ptr)
RUBY_FREE_ENTER("cont");
if (ptr) {
rb_context_t *cont = ptr;
- RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack);
+ RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack); fflush(stdout);
#if FIBER_USE_NATIVE
if (cont->type == CONTINUATION_CONTEXT) {
/* cont */
- ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine.stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine_stack);
}
else {
/* fiber */
- rb_fiber_t *fib = (rb_fiber_t*)cont;
- const rb_thread_t *const th = GET_THREAD();
#ifdef _WIN32
- if (th && th->fiber != fib && cont->type != ROOT_FIBER_CONTEXT) {
+ if (GET_THREAD()->fiber != cont->self && cont->type != ROOT_FIBER_CONTEXT) {
/* don't delete root fiber handle */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
if (fib->fib_handle) {
DeleteFiber(fib->fib_handle);
}
}
#else /* not WIN32 */
- if (th && th->fiber != fib) {
- if (fib->ss_sp) {
+ if (GET_THREAD()->fiber != cont->self) {
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->context.uc_stack.ss_sp) {
if (cont->type == ROOT_FIBER_CONTEXT) {
rb_bug("Illegal root fiber parameter");
}
- munmap((void*)fib->ss_sp, fib->ss_size);
+ munmap((void*)fib->context.uc_stack.ss_sp, fib->context.uc_stack.ss_size);
}
}
else {
@@ -261,11 +223,10 @@ cont_free(void *ptr)
#endif
}
#else /* not FIBER_USE_NATIVE */
- ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine.stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine_stack);
#endif
#ifdef __ia64
- RUBY_FREE_UNLESS_NULL(cont->machine.register_stack);
+ RUBY_FREE_UNLESS_NULL(cont->machine_register_stack);
#endif
RUBY_FREE_UNLESS_NULL(cont->vm_stack);
@@ -280,48 +241,63 @@ cont_memsize(const void *ptr)
{
const rb_context_t *cont = ptr;
size_t size = 0;
-
- size = sizeof(*cont);
- if (cont->vm_stack) {
+ if (cont) {
+ size = sizeof(*cont);
+ if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
- size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
+ size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
#else
- size_t n = cont->saved_thread.stack_size;
+ size_t n = cont->saved_thread.stack_size;
#endif
- size += n * sizeof(*cont->vm_stack);
- }
+ size += n * sizeof(*cont->vm_stack);
+ }
- if (cont->machine.stack) {
- size += cont->machine.stack_size * sizeof(*cont->machine.stack);
- }
+ if (cont->machine_stack) {
+ size += cont->machine_stack_size * sizeof(*cont->machine_stack);
+ }
#ifdef __ia64
- if (cont->machine.register_stack) {
- size += cont->machine.register_stack_size * sizeof(*cont->machine.register_stack);
- }
+ if (cont->machine_register_stack) {
+ size += cont->machine_register_stack_size * sizeof(*cont->machine_register_stack);
+ }
#endif
+ }
return size;
}
-void
-rb_fiber_mark_self(rb_fiber_t *fib)
-{
- if (fib)
- rb_gc_mark(fib->cont.self);
-}
-
static void
fiber_mark(void *ptr)
{
RUBY_MARK_ENTER("cont");
if (ptr) {
rb_fiber_t *fib = ptr;
- rb_fiber_mark_self(fib->prev);
+ rb_gc_mark(fib->prev);
cont_mark(&fib->cont);
}
RUBY_MARK_LEAVE("cont");
}
static void
+fiber_link_join(rb_fiber_t *fib)
+{
+ VALUE current_fibval = rb_fiber_current();
+ rb_fiber_t *current_fib;
+ GetFiberPtr(current_fibval, current_fib);
+
+ /* join fiber link */
+ fib->next_fiber = current_fib->next_fiber;
+ fib->prev_fiber = current_fib;
+ current_fib->next_fiber->prev_fiber = fib;
+ current_fib->next_fiber = fib;
+}
+
+static void
+fiber_link_remove(rb_fiber_t *fib)
+{
+ fib->prev_fiber->next_fiber = fib->next_fiber;
+ fib->next_fiber->prev_fiber = fib->prev_fiber;
+}
+
+static void
fiber_free(void *ptr)
{
RUBY_FREE_ENTER("fiber");
@@ -331,6 +307,7 @@ fiber_free(void *ptr)
fib->cont.saved_thread.local_storage) {
st_free_table(fib->cont.saved_thread.local_storage);
}
+ fiber_link_remove(fib);
cont_free(&fib->cont);
}
@@ -342,13 +319,13 @@ fiber_memsize(const void *ptr)
{
const rb_fiber_t *fib = ptr;
size_t size = 0;
-
- size = sizeof(*fib);
- if (fib->cont.type != ROOT_FIBER_CONTEXT &&
- fib->cont.saved_thread.local_storage != NULL) {
- size += st_memsize(fib->cont.saved_thread.local_storage);
+ if (ptr) {
+ size = sizeof(*fib);
+ if (fib->cont.type != ROOT_FIBER_CONTEXT) {
+ size += st_memsize(fib->cont.saved_thread.local_storage);
+ }
+ size += cont_memsize(&fib->cont);
}
- size += cont_memsize(&fib->cont);
return size;
}
@@ -368,82 +345,62 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{
size_t size;
- SET_MACHINE_STACK_END(&th->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
#ifdef __ia64
- th->machine.register_stack_end = rb_ia64_bsp();
+ th->machine_register_stack_end = rb_ia64_bsp();
#endif
- if (th->machine.stack_start > th->machine.stack_end) {
- size = cont->machine.stack_size = th->machine.stack_start - th->machine.stack_end;
- cont->machine.stack_src = th->machine.stack_end;
+ if (th->machine_stack_start > th->machine_stack_end) {
+ size = cont->machine_stack_size = th->machine_stack_start - th->machine_stack_end;
+ cont->machine_stack_src = th->machine_stack_end;
}
else {
- size = cont->machine.stack_size = th->machine.stack_end - th->machine.stack_start;
- cont->machine.stack_src = th->machine.stack_start;
+ size = cont->machine_stack_size = th->machine_stack_end - th->machine_stack_start;
+ cont->machine_stack_src = th->machine_stack_start;
}
- if (cont->machine.stack) {
- REALLOC_N(cont->machine.stack, VALUE, size);
+ if (cont->machine_stack) {
+ REALLOC_N(cont->machine_stack, VALUE, size);
}
else {
- cont->machine.stack = ALLOC_N(VALUE, size);
+ cont->machine_stack = ALLOC_N(VALUE, size);
}
FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine.stack, cont->machine.stack_src, VALUE, size);
+ MEMCPY(cont->machine_stack, cont->machine_stack_src, VALUE, size);
#ifdef __ia64
rb_ia64_flushrs();
- size = cont->machine.register_stack_size = th->machine.register_stack_end - th->machine.register_stack_start;
- cont->machine.register_stack_src = th->machine.register_stack_start;
- if (cont->machine.register_stack) {
- REALLOC_N(cont->machine.register_stack, VALUE, size);
+ size = cont->machine_register_stack_size = th->machine_register_stack_end - th->machine_register_stack_start;
+ cont->machine_register_stack_src = th->machine_register_stack_start;
+ if (cont->machine_register_stack) {
+ REALLOC_N(cont->machine_register_stack, VALUE, size);
}
else {
- cont->machine.register_stack = ALLOC_N(VALUE, size);
+ cont->machine_register_stack = ALLOC_N(VALUE, size);
}
- MEMCPY(cont->machine.register_stack, cont->machine.register_stack_src, VALUE, size);
+ MEMCPY(cont->machine_register_stack, cont->machine_register_stack_src, VALUE, size);
#endif
}
static const rb_data_type_t cont_data_type = {
"continuation",
{cont_mark, cont_free, cont_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
-static inline void
+static void
cont_save_thread(rb_context_t *cont, rb_thread_t *th)
{
- rb_thread_t *sth = &cont->saved_thread;
-
/* save thread context */
- sth->stack = th->stack;
- sth->stack_size = th->stack_size;
- sth->local_storage = th->local_storage;
- sth->cfp = th->cfp;
- sth->safe_level = th->safe_level;
- sth->raised_flag = th->raised_flag;
- sth->state = th->state;
- sth->status = th->status;
- sth->tag = th->tag;
- sth->protect_tag = th->protect_tag;
- sth->errinfo = th->errinfo;
- sth->first_proc = th->first_proc;
- sth->root_lep = th->root_lep;
- sth->root_svar = th->root_svar;
- sth->ensure_list = th->ensure_list;
-
- sth->trace_arg = th->trace_arg;
-
- /* saved_thread->machine.stack_(start|end) should be NULL */
+ cont->saved_thread = *th;
+ /* saved_thread->machine_stack_(start|end) should be NULL */
/* because it may happen GC afterward */
- sth->machine.stack_start = 0;
- sth->machine.stack_end = 0;
+ cont->saved_thread.machine_stack_start = 0;
+ cont->saved_thread.machine_stack_end = 0;
#ifdef __ia64
- sth->machine.register_stack_start = 0;
- sth->machine.register_stack_end = 0;
+ cont->saved_thread.machine_register_stack_start = 0;
+ cont->saved_thread.machine_register_stack_end = 0;
#endif
}
@@ -452,12 +409,7 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
{
/* save thread context */
cont_save_thread(cont, th);
- cont->saved_thread.self = th->self;
- cont->saved_thread.machine.stack_maxsize = th->machine.stack_maxsize;
- cont->saved_thread.fiber = th->fiber;
cont->saved_thread.local_storage = 0;
- cont->saved_thread.local_storage_recursive_hash = Qnil;
- cont->saved_thread.local_storage_recursive_hash_for_trace = Qnil;
}
static rb_context_t *
@@ -476,22 +428,19 @@ cont_new(VALUE klass)
static VALUE
cont_capture(volatile int *stat)
-#if defined(__clang__) && \
- __clang_major__ == 3 && __clang_minor__ == 8 && __clang_patch__ == 0
-__attribute__ ((optnone))
-#endif
{
rb_context_t *cont;
- rb_thread_t *th = GET_THREAD();
+ rb_thread_t *th = GET_THREAD(), *sth;
volatile VALUE contval;
THREAD_MUST_BE_RUNNING(th);
rb_vm_stack_to_heap(th);
cont = cont_new(rb_cContinuation);
contval = cont->self;
+ sth = &cont->saved_thread;
#ifdef CAPTURE_JUST_VALID_VM_STACK
- cont->vm_stack_slen = th->cfp->sp - th->stack;
+ cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - th->stack;
cont->vm_stack_clen = th->stack + th->stack_size - (VALUE*)th->cfp;
cont->vm_stack = ALLOC_N(VALUE, cont->vm_stack_slen + cont->vm_stack_clen);
MEMCPY(cont->vm_stack, th->stack, VALUE, cont->vm_stack_slen);
@@ -500,30 +449,13 @@ __attribute__ ((optnone))
cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
#endif
- cont->saved_thread.stack = 0;
+ sth->stack = 0;
cont_save_machine_stack(th, cont);
- /* backup ensure_list to array for search in another context */
- {
- rb_ensure_list_t *p;
- int size = 0;
- rb_ensure_entry_t *entry;
- for (p=th->ensure_list; p; p=p->next)
- size++;
- entry = cont->ensure_array = ALLOC_N(rb_ensure_entry_t,size+1);
- for (p=th->ensure_list; p; p=p->next) {
- if (!p->entry.marker)
- p->entry.marker = rb_ary_tmp_new(0); /* dummy object */
- *entry++ = p->entry;
- }
- entry->marker = 0;
- }
-
if (ruby_setjmp(cont->jmpbuf)) {
- VALUE value;
+ volatile VALUE value;
- VAR_INITIALIZED(cont);
value = cont->value;
if (cont->argc == -1) rb_exc_raise(value);
cont->value = Qnil;
@@ -536,7 +468,7 @@ __attribute__ ((optnone))
}
}
-static inline void
+static void
cont_restore_thread(rb_context_t *cont)
{
rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
@@ -544,14 +476,16 @@ cont_restore_thread(rb_context_t *cont)
/* restore thread context */
if (cont->type == CONTINUATION_CONTEXT) {
/* continuation */
- rb_fiber_t *fib;
+ VALUE fib;
th->fiber = sth->fiber;
fib = th->fiber ? th->fiber : th->root_fiber;
if (fib) {
- th->stack_size = fib->cont.saved_thread.stack_size;
- th->stack = fib->cont.saved_thread.stack;
+ rb_fiber_t *fcont;
+ GetFiberPtr(fib, fcont);
+ th->stack_size = fcont->cont.saved_thread.stack_size;
+ th->stack = fcont->cont.saved_thread.stack;
}
#ifdef CAPTURE_JUST_VALID_VM_STACK
MEMCPY(th->stack, cont->vm_stack, VALUE, cont->vm_stack_slen);
@@ -566,9 +500,7 @@ cont_restore_thread(rb_context_t *cont)
th->stack = sth->stack;
th->stack_size = sth->stack_size;
th->local_storage = sth->local_storage;
- th->local_storage_recursive_hash = sth->local_storage_recursive_hash;
- th->local_storage_recursive_hash_for_trace = sth->local_storage_recursive_hash_for_trace;
- th->fiber = (rb_fiber_t*)cont;
+ th->fiber = cont->self;
}
th->cfp = sth->cfp;
@@ -580,10 +512,6 @@ cont_restore_thread(rb_context_t *cont)
th->protect_tag = sth->protect_tag;
th->errinfo = sth->errinfo;
th->first_proc = sth->first_proc;
- th->root_lep = sth->root_lep;
- th->root_svar = sth->root_svar;
- th->ensure_list = sth->ensure_list;
-
}
#if FIBER_USE_NATIVE
@@ -595,7 +523,7 @@ fiber_set_stack_location(void)
VALUE *ptr;
SET_MACHINE_STACK_END(&ptr);
- th->machine.stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
+ th->machine_stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
}
static VOID CALLBACK
@@ -638,10 +566,9 @@ fiber_machine_stack_alloc(size_t size)
void *page;
STACK_GROW_DIR_DETECTION;
- errno = 0;
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
if (ptr == MAP_FAILED) {
- rb_raise(rb_eFiberError, "can't alloc machine stack to fiber: %s", strerror(errno));
+ rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
}
/* guard page setup */
@@ -661,10 +588,6 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
rb_thread_t *sth = &fib->cont.saved_thread;
#ifdef _WIN32
-# if defined(_MSC_VER) && _MSC_VER <= 1200
-# define CreateFiberEx(cs, stacksize, flags, entry, param) \
- CreateFiber((stacksize), (entry), (param))
-# endif
fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
if (!fib->fib_handle) {
/* try to release unnecessary fibers & retry to create */
@@ -674,7 +597,7 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
rb_raise(rb_eFiberError, "can't create fiber");
}
}
- sth->machine.stack_maxsize = size;
+ sth->machine_stack_maxsize = size;
#else /* not WIN32 */
ucontext_t *context = &fib->context;
char *ptr;
@@ -685,14 +608,12 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
context->uc_link = NULL;
context->uc_stack.ss_sp = ptr;
context->uc_stack.ss_size = size;
- fib->ss_sp = ptr;
- fib->ss_size = size;
makecontext(context, rb_fiber_start, 0);
- sth->machine.stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
- sth->machine.stack_maxsize = size - RB_PAGE_SIZE;
+ sth->machine_stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
+ sth->machine_stack_maxsize = size - RB_PAGE_SIZE;
#endif
#ifdef __ia64
- sth->machine.register_stack_maxsize = sth->machine.stack_maxsize;
+ sth->machine_register_stack_maxsize = sth->machine_stack_maxsize;
#endif
}
@@ -709,31 +630,31 @@ fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
/* restore thread context */
cont_restore_thread(&newfib->cont);
- th->machine.stack_maxsize = sth->machine.stack_maxsize;
- if (sth->machine.stack_end && (newfib != oldfib)) {
- rb_bug("fiber_setcontext: sth->machine.stack_end has non zero value");
+ th->machine_stack_maxsize = sth->machine_stack_maxsize;
+ if (sth->machine_stack_end && (newfib != oldfib)) {
+ rb_bug("fiber_setcontext: sth->machine_stack_end has non zero value");
}
/* save oldfib's machine stack */
if (oldfib->status != TERMINATED) {
STACK_GROW_DIR_DETECTION;
- SET_MACHINE_STACK_END(&th->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
if (STACK_DIR_UPPER(0, 1)) {
- oldfib->cont.machine.stack_size = th->machine.stack_start - th->machine.stack_end;
- oldfib->cont.machine.stack = th->machine.stack_end;
+ oldfib->cont.machine_stack_size = th->machine_stack_start - th->machine_stack_end;
+ oldfib->cont.machine_stack = th->machine_stack_end;
}
else {
- oldfib->cont.machine.stack_size = th->machine.stack_end - th->machine.stack_start;
- oldfib->cont.machine.stack = th->machine.stack_start;
+ oldfib->cont.machine_stack_size = th->machine_stack_end - th->machine_stack_start;
+ oldfib->cont.machine_stack = th->machine_stack_start;
}
}
/* exchange machine_stack_start between oldfib and newfib */
- oldfib->cont.saved_thread.machine.stack_start = th->machine.stack_start;
- th->machine.stack_start = sth->machine.stack_start;
- /* oldfib->machine.stack_end should be NULL */
- oldfib->cont.saved_thread.machine.stack_end = 0;
+ oldfib->cont.saved_thread.machine_stack_start = th->machine_stack_start;
+ th->machine_stack_start = sth->machine_stack_start;
+ /* oldfib->machine_stack_end should be NULL */
+ oldfib->cont.saved_thread.machine_stack_end = 0;
#ifndef _WIN32
- if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib) {
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib->cont.self) {
rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
}
#endif
@@ -764,16 +685,16 @@ cont_restore_1(rb_context_t *cont)
((_JUMP_BUFFER*)(&buf))->Frame;
}
#endif
- if (cont->machine.stack_src) {
+ if (cont->machine_stack_src) {
FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine.stack_src, cont->machine.stack,
- VALUE, cont->machine.stack_size);
+ MEMCPY(cont->machine_stack_src, cont->machine_stack,
+ VALUE, cont->machine_stack_size);
}
#ifdef __ia64
- if (cont->machine.register_stack_src) {
- MEMCPY(cont->machine.register_stack_src, cont->machine.register_stack,
- VALUE, cont->machine.register_stack_size);
+ if (cont->machine_register_stack_src) {
+ MEMCPY(cont->machine_register_stack_src, cont->machine_register_stack,
+ VALUE, cont->machine_register_stack_size);
}
#endif
@@ -808,7 +729,7 @@ register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
E(k) = E(l) = E(m) = E(n) = E(o) =
E(p) = E(q) = E(r) = E(s) = E(t) = 0;
}
- if (curr_bsp < cont->machine.register_stack_src+cont->machine.register_stack_size) {
+ if (curr_bsp < cont->machine_register_stack_src+cont->machine_register_stack_size) {
register_stack_extend(cont, vp, (VALUE*)rb_ia64_bsp());
}
cont_restore_0(cont, vp);
@@ -820,7 +741,7 @@ register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
static void
cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
{
- if (cont->machine.stack_src) {
+ if (cont->machine_stack_src) {
#ifdef HAVE_ALLOCA
#define STACK_PAD_SIZE 1
#else
@@ -833,7 +754,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
/* Stack grows downward */
#endif
#if STACK_GROW_DIRECTION <= 0
- volatile VALUE *const end = cont->machine.stack_src;
+ volatile VALUE *const end = cont->machine_stack_src;
if (&space[0] > end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
@@ -849,7 +770,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
/* Stack grows upward */
#endif
#if STACK_GROW_DIRECTION >= 0
- volatile VALUE *const end = cont->machine.stack_src + cont->machine.stack_size;
+ volatile VALUE *const end = cont->machine_stack_src + cont->machine_stack_size;
if (&space[STACK_PAD_SIZE] < end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
@@ -895,24 +816,6 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
* Ron
* Max
*
- * Also you can call callcc in other methods:
- *
- * require "continuation"
- *
- * def g
- * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
- * cc = callcc { |cc| cc }
- * puts arr.shift
- * return cc, arr.size
- * end
- *
- * def f
- * c, size = g
- * c.call(c) if size > 1
- * end
- *
- * f
- *
* This (somewhat contrived) example allows the inner loop to abandon
* processing early:
*
@@ -967,7 +870,7 @@ rb_callcc(VALUE self)
}
static VALUE
-make_passing_arg(int argc, const VALUE *argv)
+make_passing_arg(int argc, VALUE *argv)
{
switch (argc) {
case 0:
@@ -979,80 +882,6 @@ make_passing_arg(int argc, const VALUE *argv)
}
}
-/* CAUTION!! : Currently, error in rollback_func is not supported */
-/* same as rb_protect if set rollback_func to NULL */
-void
-ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE (*rollback_func)(ANYARGS))
-{
- st_table **table_p = &GET_VM()->ensure_rollback_table;
- if (UNLIKELY(*table_p == NULL)) {
- *table_p = st_init_numtable();
- }
- st_insert(*table_p, (st_data_t)ensure_func, (st_data_t)rollback_func);
-}
-
-static inline VALUE
-lookup_rollback_func(VALUE (*ensure_func)(ANYARGS))
-{
- st_table *table = GET_VM()->ensure_rollback_table;
- st_data_t val;
- if (table && st_lookup(table, (st_data_t)ensure_func, &val))
- return (VALUE) val;
- return Qundef;
-}
-
-
-static inline void
-rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *target)
-{
- rb_ensure_list_t *p;
- rb_ensure_entry_t *entry;
- size_t i;
- size_t cur_size;
- size_t target_size;
- size_t base_point;
- VALUE (*func)(ANYARGS);
-
- cur_size = 0;
- for (p=current; p; p=p->next)
- cur_size++;
- target_size = 0;
- for (entry=target; entry->marker; entry++)
- target_size++;
-
- /* search common stack point */
- p = current;
- base_point = cur_size;
- while (base_point) {
- if (target_size >= base_point &&
- p->entry.marker == target[target_size - base_point].marker)
- break;
- base_point --;
- p = p->next;
- }
-
- /* rollback function check */
- for (i=0; i < target_size - base_point; i++) {
- if (!lookup_rollback_func(target[i].e_proc)) {
- rb_raise(rb_eRuntimeError, "continuation called from out of critical rb_ensure scope");
- }
- }
- /* pop ensure stack */
- while (cur_size > base_point) {
- /* escape from ensure block */
- (*current->entry.e_proc)(current->entry.data2);
- current = current->next;
- cur_size--;
- }
- /* push ensure stack */
- while (i--) {
- func = (VALUE (*)(ANYARGS)) lookup_rollback_func(target[i].e_proc);
- if ((VALUE)func != Qundef) {
- (*func)(target[i].data2);
- }
- }
-}
-
/*
* call-seq:
* cont.call(args, ...)
@@ -1083,11 +912,13 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
}
if (cont->saved_thread.fiber) {
+ rb_fiber_t *fcont;
+ GetFiberPtr(cont->saved_thread.fiber, fcont);
+
if (th->fiber != cont->saved_thread.fiber) {
rb_raise(rb_eRuntimeError, "continuation called across fiber");
}
}
- rollback_ensure_stack(contval, th->ensure_list, cont->ensure_array);
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
@@ -1116,7 +947,7 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
* comes with a small 4KB stack. This enables the fiber to be paused from deeply
* nested function calls within the fiber block.
*
- * When a fiber is created it will not run automatically. Rather it must
+ * When a fiber is created it will not run automatically. Rather it must be
* be explicitly asked to run using the <code>Fiber#resume</code> method.
* The code running inside the fiber can give up control by calling
* <code>Fiber.yield</code> in which case it yields control back to caller
@@ -1168,7 +999,6 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
static const rb_data_type_t fiber_data_type = {
"fiber",
{fiber_mark, fiber_free, fiber_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -1188,11 +1018,12 @@ fiber_t_alloc(VALUE fibval)
}
THREAD_MUST_BE_RUNNING(th);
- fib = ZALLOC(rb_fiber_t);
+ fib = ALLOC(rb_fiber_t);
+ memset(fib, 0, sizeof(rb_fiber_t));
fib->cont.self = fibval;
fib->cont.type = FIBER_CONTEXT;
cont_init(&fib->cont, th);
- fib->prev = NULL;
+ fib->prev = Qnil;
fib->status = CREATED;
DATA_PTR(fibval) = fib;
@@ -1206,7 +1037,6 @@ fiber_init(VALUE fibval, VALUE proc)
rb_fiber_t *fib = fiber_t_alloc(fibval);
rb_context_t *cont = &fib->cont;
rb_thread_t *th = &cont->saved_thread;
- rb_thread_t *cth = GET_THREAD();
/* initialize cont */
cont->vm_stack = 0;
@@ -1214,33 +1044,34 @@ fiber_init(VALUE fibval, VALUE proc)
th->stack = 0;
th->stack_size = 0;
- th->stack_size = cth->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
+ fiber_link_join(fib);
+
+ th->stack_size = th->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
th->stack = ALLOC_N(VALUE, th->stack_size);
th->cfp = (void *)(th->stack + th->stack_size);
th->cfp--;
th->cfp->pc = 0;
- th->cfp->sp = th->stack + 2;
+ th->cfp->sp = th->stack + 1;
#if VM_DEBUG_BP_CHECK
th->cfp->bp_check = 0;
#endif
- th->cfp->ep = th->stack + 1;
- th->cfp->ep[ 0] = VM_ENVVAL_BLOCK_PTR(0);
- th->cfp->ep[-1] = 0;
+ th->cfp->ep = th->stack;
+ *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
th->cfp->self = Qnil;
- th->cfp->flag = VM_FRAME_MAGIC_DUMMY | VM_FRAME_FLAG_FINISH;
+ th->cfp->klass = Qnil;
+ th->cfp->flag = 0;
th->cfp->iseq = 0;
th->cfp->proc = 0;
th->cfp->block_iseq = 0;
+ th->cfp->me = 0;
th->tag = 0;
th->local_storage = st_init_numtable();
- th->local_storage_recursive_hash = Qnil;
- th->local_storage_recursive_hash_for_trace = Qnil;
th->first_proc = proc;
#if !FIBER_USE_NATIVE
- MEMCPY(&cont->jmpbuf, &cth->root_jmpbuf, rb_jmpbuf_t, 1);
+ MEMCPY(&cont->jmpbuf, &th->root_jmpbuf, rb_jmpbuf_t, 1);
#endif
return fibval;
@@ -1259,30 +1090,72 @@ rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
}
-static void rb_fiber_terminate(rb_fiber_t *fib);
+static VALUE
+return_fiber(void)
+{
+ rb_fiber_t *fib;
+ VALUE curr = rb_fiber_current();
+ VALUE prev;
+ GetFiberPtr(curr, fib);
+
+ prev = fib->prev;
+ if (NIL_P(prev)) {
+ const VALUE root_fiber = GET_THREAD()->root_fiber;
+
+ if (root_fiber == curr) {
+ rb_raise(rb_eFiberError, "can't yield from root fiber");
+ }
+ return root_fiber;
+ }
+ else {
+ fib->prev = Qnil;
+ return prev;
+ }
+}
+
+VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
+
+static void
+rb_fiber_terminate(rb_fiber_t *fib)
+{
+ VALUE value = fib->cont.value;
+ fib->status = TERMINATED;
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+ /* Ruby must not switch to other thread until storing terminated_machine_stack */
+ terminated_machine_stack.ptr = fib->context.uc_stack.ss_sp;
+ terminated_machine_stack.size = fib->context.uc_stack.ss_size / sizeof(VALUE);
+ fib->context.uc_stack.ss_sp = NULL;
+ fib->cont.machine_stack = NULL;
+ fib->cont.machine_stack_size = 0;
+#endif
+ rb_fiber_transfer(return_fiber(), 1, &value);
+}
void
rb_fiber_start(void)
{
rb_thread_t *th = GET_THREAD();
- rb_fiber_t *fib = th->fiber;
+ rb_fiber_t *fib;
+ rb_context_t *cont;
rb_proc_t *proc;
int state;
+ GetFiberPtr(th->fiber, fib);
+ cont = &fib->cont;
+
TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
- rb_context_t *cont = &VAR_FROM_MEMORY(fib)->cont;
int argc;
- const VALUE *argv, args = cont->value;
+ VALUE *argv, args;
GetProcPtr(cont->saved_thread.first_proc, proc);
- argv = (argc = cont->argc) > 1 ? RARRAY_CONST_PTR(args) : &args;
+ args = cont->value;
+ argv = (argc = cont->argc) > 1 ? RARRAY_PTR(args) : &args;
cont->value = Qnil;
th->errinfo = Qnil;
th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
- th->root_svar = Qfalse;
- fib->status = RUNNING;
+ th->root_svar = Qnil;
- EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
+ fib->status = RUNNING;
cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
TH_POP_TAG();
@@ -1316,117 +1189,90 @@ root_fiber_alloc(rb_thread_t *th)
#endif
#endif
fib->status = RUNNING;
+ fib->prev_fiber = fib->next_fiber = fib;
return fib;
}
-static inline rb_fiber_t*
-fiber_current(void)
+VALUE
+rb_fiber_current(void)
{
rb_thread_t *th = GET_THREAD();
if (th->fiber == 0) {
/* save root */
rb_fiber_t *fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib;
+ th->root_fiber = th->fiber = fib->cont.self;
}
return th->fiber;
}
-static inline rb_fiber_t*
-return_fiber(void)
-{
- rb_fiber_t *fib = fiber_current();
- rb_fiber_t *prev = fib->prev;
-
- if (!prev) {
- rb_fiber_t *root_fiber = GET_THREAD()->root_fiber;
-
- if (root_fiber == fib) {
- rb_raise(rb_eFiberError, "can't yield from root fiber");
- }
- return root_fiber;
- }
- else {
- fib->prev = NULL;
- return prev;
- }
-}
-
-VALUE
-rb_fiber_current(void)
-{
- return fiber_current()->cont.self;
-}
-
-static inline VALUE
-fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
+static VALUE
+fiber_store(rb_fiber_t *next_fib)
{
+ rb_thread_t *th = GET_THREAD();
rb_fiber_t *fib;
if (th->fiber) {
- fib = th->fiber;
+ GetFiberPtr(th->fiber, fib);
cont_save_thread(&fib->cont, th);
}
else {
/* create current fiber */
fib = root_fiber_alloc(th);
- th->root_fiber = th->fiber = fib;
+ th->root_fiber = th->fiber = fib->cont.self;
}
+#if !FIBER_USE_NATIVE
+ cont_save_machine_stack(th, &fib->cont);
+#endif
+
+ if (FIBER_USE_NATIVE || ruby_setjmp(fib->cont.jmpbuf)) {
#if FIBER_USE_NATIVE
- fiber_setcontext(next_fib, fib);
- /* restored */
+ fiber_setcontext(next_fib, fib);
#ifndef _WIN32
- if (terminated_machine_stack.ptr) {
- if (machine_stack_cache_index < MAX_MACHINE_STACK_CACHE) {
- machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
- machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
- machine_stack_cache_index++;
- }
- else {
- if (terminated_machine_stack.ptr != fib->cont.machine.stack) {
- munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
+ if (terminated_machine_stack.ptr) {
+ if (machine_stack_cache_index < MAX_MAHINE_STACK_CACHE) {
+ machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
+ machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
+ machine_stack_cache_index++;
}
else {
- rb_bug("terminated fiber resumed");
+ if (terminated_machine_stack.ptr != fib->cont.machine_stack) {
+ munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
+ }
+ else {
+ rb_bug("terminated fiber resumed");
+ }
}
+ terminated_machine_stack.ptr = NULL;
+ terminated_machine_stack.size = 0;
}
- terminated_machine_stack.ptr = NULL;
- terminated_machine_stack.size = 0;
- }
-#endif /* not _WIN32 */
- fib = th->fiber;
- if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
- return fib->cont.value;
-
-#else /* FIBER_USE_NATIVE */
- cont_save_machine_stack(th, &fib->cont);
- if (ruby_setjmp(fib->cont.jmpbuf)) {
+#endif
+#endif
/* restored */
- fib = th->fiber;
+ GetFiberPtr(th->fiber, fib);
if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
- if (next_fib->cont.value == Qundef) {
- cont_restore_0(&next_fib->cont, &next_fib->cont.value);
- rb_bug("rb_fiber_resume: unreachable");
- }
return fib->cont.value;
}
+#if !FIBER_USE_NATIVE
else {
- VALUE undef = Qundef;
- cont_restore_0(&next_fib->cont, &undef);
- rb_bug("rb_fiber_resume: unreachable");
+ return Qundef;
}
-#endif /* FIBER_USE_NATIVE */
+#endif
}
static inline VALUE
-fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
+fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
{
VALUE value;
- rb_context_t *cont = &fib->cont;
+ rb_fiber_t *fib;
+ rb_context_t *cont;
rb_thread_t *th = GET_THREAD();
- if (th->fiber == fib) {
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
+
+ if (th->fiber == fibval) {
/* ignore fiber context switch
* because destination fiber is same as current fiber
*/
@@ -1441,25 +1287,34 @@ fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
}
else if (fib->status == TERMINATED) {
value = rb_exc_new2(rb_eFiberError, "dead fiber called");
-
- if (th->fiber->status != TERMINATED) rb_exc_raise(value);
-
- /* th->fiber is also dead => switch to root fiber */
- /* (this means we're being called from rb_fiber_terminate, */
- /* and the terminated fiber's return_fiber() is already dead) */
- cont = &th->root_fiber->cont;
+ if (th->fiber != fibval) {
+ GetFiberPtr(th->fiber, fib);
+ if (fib->status != TERMINATED) rb_exc_raise(value);
+ fibval = th->root_fiber;
+ }
+ else {
+ fibval = fib->prev;
+ if (NIL_P(fibval)) fibval = th->root_fiber;
+ }
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
cont->argc = -1;
cont->value = value;
#if FIBER_USE_NATIVE
- fiber_setcontext(th->root_fiber, th->fiber);
+ {
+ VALUE oldfibval;
+ rb_fiber_t *oldfib;
+ oldfibval = rb_fiber_current();
+ GetFiberPtr(oldfibval, oldfib);
+ fiber_setcontext(fib, oldfib);
+ }
#else
cont_restore_0(cont, &value);
#endif
- /* unreachable */
}
if (is_resume) {
- fib->prev = fiber_current();
+ fib->prev = rb_fiber_current();
}
else {
/* restore `tracing' context. see [Feature #4347] */
@@ -1469,69 +1324,56 @@ fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
- value = fiber_store(fib, th);
+ value = fiber_store(fib);
+#if !FIBER_USE_NATIVE
+ if (value == Qundef) {
+ cont_restore_0(cont, &value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+#endif
RUBY_VM_CHECK_INTS(th);
- EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
-
return value;
}
VALUE
-rb_fiber_transfer(VALUE fibval, int argc, const VALUE *argv)
+rb_fiber_transfer(VALUE fib, int argc, VALUE *argv)
{
- rb_fiber_t *fib;
- GetFiberPtr(fibval, fib);
return fiber_switch(fib, argc, argv, 0);
}
-static void
-rb_fiber_terminate(rb_fiber_t *fib)
-{
- VALUE value = fib->cont.value;
- fib->status = TERMINATED;
-#if FIBER_USE_NATIVE && !defined(_WIN32)
- /* Ruby must not switch to other thread until storing terminated_machine_stack */
- terminated_machine_stack.ptr = fib->ss_sp;
- terminated_machine_stack.size = fib->ss_size / sizeof(VALUE);
- fib->ss_sp = NULL;
- fib->context.uc_stack.ss_sp = NULL;
- fib->cont.machine.stack = NULL;
- fib->cont.machine.stack_size = 0;
-#endif
- fiber_switch(return_fiber(), 1, &value, 0);
-}
-
VALUE
-rb_fiber_resume(VALUE fibval, int argc, const VALUE *argv)
+rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- if (fib->prev != 0 || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ if (fib->prev != Qnil || fib->cont.type == ROOT_FIBER_CONTEXT) {
rb_raise(rb_eFiberError, "double resume");
}
- if (fib->transferred != 0) {
+ if (fib->transfered != 0) {
rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
}
- return fiber_switch(fib, argc, argv, 1);
+ return fiber_switch(fibval, argc, argv, 1);
}
VALUE
-rb_fiber_yield(int argc, const VALUE *argv)
+rb_fiber_yield(int argc, VALUE *argv)
{
- return fiber_switch(return_fiber(), argc, argv, 0);
+ return rb_fiber_transfer(return_fiber(), argc, argv);
}
void
rb_fiber_reset_root_local_storage(VALUE thval)
{
rb_thread_t *th;
+ rb_fiber_t *fib;
GetThreadPtr(thval, th);
if (th->root_fiber && th->root_fiber != th->fiber) {
- th->local_storage = th->root_fiber->cont.saved_thread.local_storage;
+ GetFiberPtr(th->root_fiber, fib);
+ th->local_storage = fib->cont.saved_thread.local_storage;
}
}
@@ -1611,7 +1453,7 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
* fiber2.resume
* fiber3.resume
*
- * <em>produces</em>
+ * <em>produces</em>
*
* In fiber 2
* In fiber 1
@@ -1623,8 +1465,8 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- fib->transferred = 1;
- return fiber_switch(fib, argc, argv, 0);
+ fib->transfered = 1;
+ return rb_fiber_transfer(fibval, argc, argv);
}
/*
@@ -1685,7 +1527,7 @@ Init_Cont(void)
#else /* not WIN32 */
pagesize = sysconf(_SC_PAGESIZE);
#endif
- SET_MACHINE_STACK_END(&th->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine_stack_end);
#endif
rb_cFiber = rb_define_class("Fiber", rb_cObject);
@@ -1696,7 +1538,9 @@ Init_Cont(void)
rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
}
-RUBY_SYMBOL_EXPORT_BEGIN
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
void
ruby_Init_Continuation_body(void)
@@ -1717,4 +1561,6 @@ ruby_Init_Fiber_as_Coroutine(void)
rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0);
}
-RUBY_SYMBOL_EXPORT_END
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
diff --git a/coverage/README b/coverage/README
deleted file mode 100644
index 7e4ff59e2a..0000000000
--- a/coverage/README
+++ /dev/null
@@ -1,17 +0,0 @@
-Usage
-
-The make task `update-coverage' retrieves simplecov for coverage report.
-
-COVERAGE=1 make test-all TESTS=test/cgi
-
-it generate test coverage to coverage directory.
-
-Limitation
-
- * test_coverage.rb and test_process.rb broke test suit with SimpleCov
- * some tests failed randomly.
-
-TODO
-
- * more reduce bundled simplecov(additional configuration, formatter, etc)
- * measure rubyspec coverage
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index edf02242ee..5bd414d786 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -33,7 +33,7 @@ WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
-include uncommon.mk
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
-override EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
+EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
RUBYDEF = $(DLL_BASE_NAME).def
@@ -67,11 +67,11 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
$(ECHO) linking $@
$(Q) $(PURIFY) $(CC) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
-$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ win32/stub.@OBJEXT@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
@rm -f $@
$(ECHO) linking $@
$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
- win32/stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+ stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
$(ECHO) creating $@
@@ -86,15 +86,7 @@ GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
$(OBJS) $(MAINOBJ): win32.h
-dir.$(OBJEXT) win32/win32.$(OBJEXT): win32/dir.h
-file.$(OBJEXT) win32/win32.$(OBJEXT): win32/file.h
-
-MSYS2_ARG_CONV_EXCL_PARAM = --exclude=;--name=
-
-yes-test-ruby: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
-yes-test-all: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
-yes-test-almost: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
-
+dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
endif
$(LIBRUBY_SO): $(RUBYDEF)
diff --git a/debug.c b/debug.c
index a600259818..4909a45d17 100644
--- a/debug.c
+++ b/debug.c
@@ -24,12 +24,42 @@ const union {
enum ruby_tag_type tag_type;
enum node_type node_type;
enum ruby_method_ids method_ids;
- enum ruby_id_types id_types;
- enum ruby_fl_type fl_types;
- enum ruby_encoding_consts encoding_consts;
- enum ruby_coderange_type enc_coderange_types;
- enum ruby_econv_flag_type econv_flag_types;
enum {
+ RUBY_ENCODING_INLINE_MAX = ENCODING_INLINE_MAX,
+ RUBY_ENCODING_SHIFT = ENCODING_SHIFT,
+ RUBY_ENC_CODERANGE_MASK = ENC_CODERANGE_MASK,
+ RUBY_ENC_CODERANGE_UNKNOWN = ENC_CODERANGE_UNKNOWN,
+ RUBY_ENC_CODERANGE_7BIT = ENC_CODERANGE_7BIT,
+ RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
+ RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
+ RUBY_FL_RESERVED1 = FL_RESERVED1,
+ RUBY_FL_RESERVED2 = FL_RESERVED2,
+ RUBY_FL_FINALIZE = FL_FINALIZE,
+ RUBY_FL_TAINT = FL_TAINT,
+ RUBY_FL_UNTRUSTED = FL_UNTRUSTED,
+ RUBY_FL_EXIVAR = FL_EXIVAR,
+ RUBY_FL_FREEZE = FL_FREEZE,
+ RUBY_FL_SINGLETON = FL_SINGLETON,
+ RUBY_FL_USER0 = FL_USER0,
+ RUBY_FL_USER1 = FL_USER1,
+ RUBY_FL_USER2 = FL_USER2,
+ RUBY_FL_USER3 = FL_USER3,
+ RUBY_FL_USER4 = FL_USER4,
+ RUBY_FL_USER5 = FL_USER5,
+ RUBY_FL_USER6 = FL_USER6,
+ RUBY_FL_USER7 = FL_USER7,
+ RUBY_FL_USER8 = FL_USER8,
+ RUBY_FL_USER9 = FL_USER9,
+ RUBY_FL_USER10 = FL_USER10,
+ RUBY_FL_USER11 = FL_USER11,
+ RUBY_FL_USER12 = FL_USER12,
+ RUBY_FL_USER13 = FL_USER13,
+ RUBY_FL_USER14 = FL_USER14,
+ RUBY_FL_USER15 = FL_USER15,
+ RUBY_FL_USER16 = FL_USER16,
+ RUBY_FL_USER17 = FL_USER17,
+ RUBY_FL_USER18 = FL_USER18,
+ RUBY_FL_USHIFT = FL_USHIFT,
RUBY_NODE_TYPESHIFT = NODE_TYPESHIFT,
RUBY_NODE_TYPEMASK = NODE_TYPEMASK,
RUBY_NODE_LSHIFT = NODE_LSHIFT,
@@ -37,7 +67,9 @@ const union {
} various;
} ruby_dummy_gdb_enums;
+const VALUE RUBY_FL_USER19 = FL_USER19;
const SIGNED_VALUE RUBY_NODE_LMASK = NODE_LMASK;
+const VALUE RUBY_ENCODING_MASK = ENCODING_MASK;
int
ruby_debug_print_indent(int level, int debug_level, int indent_level)
@@ -107,20 +139,18 @@ ruby_debug_breakpoint(void)
static void
set_debug_option(const char *str, int len, void *arg)
{
-#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
- extern int ruby_w32_rtc_error;
-#endif
-#define SET_WHEN(name, var, val) do { \
+#define SET_WHEN(name, var) do { \
if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \
- (var) = (val); \
+ extern int var; \
+ var = 1; \
return; \
} \
} while (0)
- SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
- SET_WHEN("core", ruby_enable_coredump, 1);
-#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
- SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
+ SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
+ SET_WHEN("core", ruby_enable_coredump);
+#if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400
+ SET_WHEN("rtc_error", ruby_w32_rtc_error);
#endif
fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
}
diff --git a/defs/default_gems b/defs/default_gems
new file mode 100644
index 0000000000..e73e383b26
--- /dev/null
+++ b/defs/default_gems
@@ -0,0 +1,5 @@
+# gem base directory versioning file [executable files under bin]
+rake lib/rake lib/rake/version.rb [rake]
+rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
+minitest lib/minitest lib/minitest/unit.rb
+json ext/json ext/json/lib/json/version.rb
diff --git a/defs/gmake.mk b/defs/gmake.mk
deleted file mode 100644