summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio/readlines_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/readlines_spec.rb')
0 files changed, 0 insertions, 0 deletions
908676c9d1366f43df12af46540fc5'>.editorconfig16
-rw-r--r--.gdbinit916
-rw-r--r--.gitignore157
-rw-r--r--.indent.pro21
-rw-r--r--.travis.yml98
-rw-r--r--BSDL22
-rw-r--r--CONTRIBUTING.md4
-rw-r--r--COPYING4
-rw-r--r--COPYING.ja72
-rw-r--r--ChangeLog28064
-rw-r--r--GPL39
-rw-r--r--KNOWNBUGS.rb5
-rw-r--r--LEGAL406
-rw-r--r--LGPL504
-rw-r--r--Makefile.in458
-rw-r--r--NEWS979
-rw-r--r--README118
-rw-r--r--README.EXT1625
-rw-r--r--README.EXT.ja2098
-rw-r--r--README.ja164
-rw-r--r--README.ja.md163
-rw-r--r--README.md161
-rw-r--r--ToDo126
-rw-r--r--addr2line.c1208
-rw-r--r--addr2line.h21
-rw-r--r--array.c5631
-rw-r--r--bcc32/Makefile.sub549
-rw-r--r--bcc32/README.bcc32137
-rwxr-xr-xbcc32/configure.bat152
-rwxr-xr-xbcc32/mkexports.rb27
-rw-r--r--bcc32/setup.mak163
-rw-r--r--benchmark/bm_app_answer.rb15
-rw-r--r--benchmark/bm_app_aobench.rb291
-rw-r--r--benchmark/bm_app_erb.rb26
-rw-r--r--benchmark/bm_app_factorial.rb11
-rw-r--r--benchmark/bm_app_fib.rb10
-rw-r--r--benchmark/bm_app_lc_fizzbuzz.rb52
-rw-r--r--benchmark/bm_app_mandelbrot.rb23
-rw-r--r--benchmark/bm_app_pentomino.rb259
-rw-r--r--benchmark/bm_app_raise.rb8
-rw-r--r--benchmark/bm_app_strconcat.rb5
-rw-r--r--benchmark/bm_app_tak.rb13
-rw-r--r--benchmark/bm_app_tarai.rb10
-rw-r--r--benchmark/bm_app_uri.rb8
-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_values.rb9
-rw-r--r--benchmark/bm_io_file_create.rb13
-rw-r--r--benchmark/bm_io_file_read.rb15
-rw-r--r--benchmark/bm_io_file_write.rb14
-rw-r--r--benchmark/bm_io_select.rb9
-rw-r--r--benchmark/bm_io_select2.rb22
-rw-r--r--benchmark/bm_io_select3.rb21
-rw-r--r--benchmark/bm_loop_for.rb3
-rw-r--r--benchmark/bm_loop_generator.rb14
-rw-r--r--benchmark/bm_loop_times.rb1
-rw-r--r--benchmark/bm_loop_whileloop.rb4
-rw-r--r--benchmark/bm_loop_whileloop2.rb4
-rw-r--r--benchmark/bm_marshal_dump_flo.rb2
-rw-r--r--benchmark/bm_securerandom.rb5
-rw-r--r--benchmark/bm_so_ackermann.rb19
-rw-r--r--benchmark/bm_so_array.rb23
-rw-r--r--benchmark/bm_so_binary_trees.rb62
-rw-r--r--benchmark/bm_so_concatenate.rb18
-rw-r--r--benchmark/bm_so_count_words.rb19
-rw-r--r--benchmark/bm_so_exception.rb61
-rw-r--r--benchmark/bm_so_fannkuch.rb45
-rw-r--r--benchmark/bm_so_fasta.rb81
-rw-r--r--benchmark/bm_so_k_nucleotide.rb48
-rw-r--r--benchmark/bm_so_lists.rb47
-rw-r--r--benchmark/bm_so_mandelbrot.rb57
-rw-r--r--benchmark/bm_so_matrix.rb48
-rw-r--r--benchmark/bm_so_meteor_contest.rb564
-rw-r--r--benchmark/bm_so_nbody.rb148
-rw-r--r--benchmark/bm_so_nested_loop.rb24
-rw-r--r--benchmark/bm_so_nsieve.rb35
-rw-r--r--benchmark/bm_so_nsieve_bits.rb43
-rw-r--r--benchmark/bm_so_object.rb56
-rw-r--r--benchmark/bm_so_partial_sums.rb31
-rw-r--r--benchmark/bm_so_pidigits.rb92
-rw-r--r--benchmark/bm_so_random.rb20
-rw-r--r--benchmark/bm_so_reverse_complement.rb30
-rw-r--r--benchmark/bm_so_sieve.rb24
-rw-r--r--benchmark/bm_so_spectralnorm.rb50
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
-rw-r--r--benchmark/bm_vm1_attr_ivar_set.rb14
-rw-r--r--benchmark/bm_vm1_block.rb10
-rw-r--r--benchmark/bm_vm1_const.rb8
-rw-r--r--benchmark/bm_vm1_ensure.rb11
-rw-r--r--benchmark/bm_vm1_float_simple.rb7
-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.rb10
-rw-r--r--benchmark/bm_vm1_gc_wb_obj.rb13
-rw-r--r--benchmark/bm_vm1_ivar.rb8
-rw-r--r--benchmark/bm_vm1_ivar_set.rb6
-rw-r--r--benchmark/bm_vm1_length.rb9
-rw-r--r--benchmark/bm_vm1_lvar_init.rb18
-rw-r--r--benchmark/bm_vm1_lvar_set.rb5
-rw-r--r--benchmark/bm_vm1_neq.rb8
-rw-r--r--benchmark/bm_vm1_not.rb7
-rw-r--r--benchmark/bm_vm1_rescue.rb7
-rw-r--r--benchmark/bm_vm1_simplereturn.rb9
-rw-r--r--benchmark/bm_vm1_swap.rb8
-rw-r--r--benchmark/bm_vm1_yield.rb10
-rw-r--r--benchmark/bm_vm2_array.rb5
-rw-r--r--benchmark/bm_vm2_bigarray.rb106
-rw-r--r--benchmark/bm_vm2_bighash.rb5
-rw-r--r--benchmark/bm_vm2_case.rb14
-rw-r--r--benchmark/bm_vm2_defined_method.rb9
-rw-r--r--benchmark/bm_vm2_dstr.rb6
-rw-r--r--benchmark/bm_vm2_eval.rb6
-rw-r--r--benchmark/bm_vm2_method.rb9
-rw-r--r--benchmark/bm_vm2_method_missing.rb12
-rw-r--r--benchmark/bm_vm2_method_with_block.rb9
-rw-r--r--benchmark/bm_vm2_mutex.rb9
-rw-r--r--benchmark/bm_vm2_newlambda.rb5
-rw-r--r--benchmark/bm_vm2_poly_method.rb20
-rw-r--r--benchmark/bm_vm2_poly_method_ov.rb20
-rw-r--r--benchmark/bm_vm2_proc.rb14
-rw-r--r--benchmark/bm_vm2_raise1.rb18
-rw-r--r--benchmark/bm_vm2_raise2.rb18
-rw-r--r--benchmark/bm_vm2_regexp.rb6
-rw-r--r--benchmark/bm_vm2_send.rb12
-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_small_aref.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aset.rb7
-rw-r--r--benchmark/bm_vm2_super.rb20
-rw-r--r--benchmark/bm_vm2_unif1.rb8
-rw-r--r--benchmark/bm_vm2_zsuper.rb20
-rw-r--r--benchmark/bm_vm3_backtrace.rb22
-rw-r--r--benchmark/bm_vm3_clearmethodcache.rb8
-rwxr-xr-xbenchmark/bm_vm3_gc.rb7
-rw-r--r--benchmark/bm_vm_thread_alive_check1.rb6
-rw-r--r--benchmark/bm_vm_thread_close.rb6
-rw-r--r--benchmark/bm_vm_thread_create_join.rb6
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb20
-rw-r--r--benchmark/bm_vm_thread_pass.rb15
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb8
-rw-r--r--benchmark/bm_vm_thread_pipe.rb17
-rw-r--r--benchmark/bm_vm_thread_queue.rb18
-rw-r--r--benchmark/driver.rb321
-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/make_fasta_output.rb19
-rw-r--r--benchmark/other-lang/ack.pl11
-rw-r--r--benchmark/other-lang/ack.py16
-rw-r--r--benchmark/other-lang/ack.rb12
-rw-r--r--benchmark/other-lang/ack.scm7
-rw-r--r--benchmark/other-lang/eval.rb66
-rw-r--r--benchmark/other-lang/fact.pl13
-rw-r--r--benchmark/other-lang/fact.py18
-rw-r--r--benchmark/other-lang/fact.rb13
-rw-r--r--benchmark/other-lang/fact.scm8
-rw-r--r--benchmark/other-lang/fib.pl11
-rw-r--r--benchmark/other-lang/fib.py7
-rw-r--r--benchmark/other-lang/fib.rb9
-rw-r--r--benchmark/other-lang/fib.scm7
-rw-r--r--benchmark/other-lang/loop.pl3
-rw-r--r--benchmark/other-lang/loop.py2
-rw-r--r--benchmark/other-lang/loop.rb4
-rw-r--r--benchmark/other-lang/loop.scm1
-rw-r--r--benchmark/other-lang/loop2.rb1
-rw-r--r--benchmark/other-lang/tak.pl11
-rw-r--r--benchmark/other-lang/tak.py8
-rw-r--r--benchmark/other-lang/tak.rb13
-rw-r--r--benchmark/other-lang/tak.scm10
-rw-r--r--benchmark/prepare_so_count_words.rb15
-rw-r--r--benchmark/prepare_so_k_nucleotide.rb2
-rw-r--r--benchmark/prepare_so_reverse_complement.rb2
-rw-r--r--benchmark/report.rb79
-rw-r--r--benchmark/run.rb127
-rw-r--r--benchmark/runc.rb27
-rw-r--r--benchmark/wc.input.base25
-rw-r--r--bignum.c7356
-rwxr-xr-xbin/erb100
-rwxr-xr-xbin/gem25
-rwxr-xr-x[-rw-r--r--]bin/irb16
-rwxr-xr-xbin/rake33
-rwxr-xr-x[-rw-r--r--]bin/rdoc81
-rwxr-xr-xbin/ri53
-rwxr-xr-xbin/testrb5
-rw-r--r--bootstraptest/pending.rb39
-rwxr-xr-xbootstraptest/runner.rb505
-rw-r--r--bootstraptest/test_attr.rb36
-rw-r--r--bootstraptest/test_autoload.rb70
-rw-r--r--bootstraptest/test_block.rb613
-rw-r--r--bootstraptest/test_class.rb169
-rw-r--r--bootstraptest/test_eval.rb324
-rw-r--r--bootstraptest/test_exception.rb432
-rw-r--r--bootstraptest/test_finalizer.rb8
-rw-r--r--bootstraptest/test_flip.rb1
-rw-r--r--bootstraptest/test_flow.rb591
-rw-r--r--bootstraptest/test_fork.rb75
-rw-r--r--bootstraptest/test_gc.rb34
-rw-r--r--bootstraptest/test_io.rb112
-rw-r--r--bootstraptest/test_jump.rb308
-rw-r--r--bootstraptest/test_literal.rb231
-rw-r--r--bootstraptest/test_literal_suffix.rb54
-rw-r--r--bootstraptest/test_load.rb27
-rw-r--r--bootstraptest/test_marshal.rb5
-rw-r--r--bootstraptest/test_massign.rb183
-rw-r--r--bootstraptest/test_method.rb1220
-rw-r--r--bootstraptest/test_objectspace.rb46
-rw-r--r--bootstraptest/test_proc.rb483
-rw-r--r--bootstraptest/test_string.rb3
-rw-r--r--bootstraptest/test_struct.rb5
-rw-r--r--bootstraptest/test_syntax.rb902
-rw-r--r--bootstraptest/test_thread.rb476
-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.h635
-rw-r--r--ccan/str/str.h16
-rw-r--r--class.c1906
-rw-r--r--common.mk2379
-rw-r--r--compar.c141
-rw-r--r--compile.c6415
-rw-r--r--complex.c2217
-rw-r--r--config.guess1459
-rw-r--r--config.sub1537
-rw-r--r--configure.in4666
-rw-r--r--constant.h43
-rw-r--r--cont.c1699
-rw-r--r--coverage/README17
-rw-r--r--cygwin/GNUmakefile.in67
-rw-r--r--debug.c165
-rw-r--r--defines.h273
-rw-r--r--defs/default_gems4
-rw-r--r--defs/gmake.mk63
-rw-r--r--defs/id.def122
-rw-r--r--defs/keywords53
-rw-r--r--defs/known_errors.def148
-rw-r--r--defs/lex.c.src53
-rw-r--r--defs/opt_insn_unif.def29
-rw-r--r--defs/opt_operand.def22
-rw-r--r--dir.c1845
-rw-r--r--distruby.rb59
-rw-r--r--djgpp/GNUmakefile.in2
-rw-r--r--djgpp/README.djgpp21
-rw-r--r--djgpp/config.hin114
-rw-r--r--djgpp/config.sed128
-rwxr-xr-xdjgpp/configure.bat20
-rw-r--r--djgpp/mkver.sed1
-rw-r--r--dln.c855
-rw-r--r--dln.h21
-rw-r--r--dln_find.c295
-rw-r--r--dmydln.c11
-rw-r--r--dmyenc.c10
-rw-r--r--dmyext.c2
-rw-r--r--doc/.document4
-rw-r--r--doc/ChangeLog-1.8.0163
-rw-r--r--doc/ChangeLog-1.9.392772
-rw-r--r--doc/ChangeLog-2.0.024015
-rw-r--r--doc/ChangeLog-2.1.018060
-rw-r--r--doc/ChangeLog-YARV6917
-rw-r--r--doc/NEWS-1.8.0837
-rw-r--r--doc/NEWS-1.8.7669
-rw-r--r--doc/NEWS-1.9.1429
-rw-r--r--doc/NEWS-1.9.2509
-rw-r--r--doc/NEWS-1.9.3341
-rw-r--r--doc/NEWS-2.0.0531
-rw-r--r--doc/NEWS-2.1.0376
-rw-r--r--doc/contributing.rdoc466
-rw-r--r--doc/contributors.rdoc778
-rw-r--r--doc/dtrace_probes.rdoc178
-rw-r--r--doc/etc.rd.ja75
-rw-r--r--doc/forwardable.rd84
-rw-r--r--doc/forwardable.rd.ja47
-rw-r--r--doc/globals.rdoc70
-rw-r--r--doc/images/boottime-classes.pngbin0 -> 28677 bytes-rw-r--r--doc/irb/irb-tools.rd.ja117
-rw-r--r--doc/irb/irb.rd392
-rw-r--r--doc/irb/irb.rd.ja375
-rw-r--r--doc/keywords.rdoc158
-rw-r--r--doc/maintainers.rdoc322
-rw-r--r--doc/marshal.rdoc313
-rw-r--r--doc/pty/README.expect.ja21
-rw-r--r--doc/pty/README.ja76
-rw-r--r--doc/regexp.rdoc691
-rw-r--r--doc/security.rdoc144
-rw-r--r--doc/shell.rd348
-rw-r--r--doc/shell.rd.ja151
-rw-r--r--doc/standard_library.rdoc124
-rw-r--r--doc/syntax.rdoc34
-rw-r--r--doc/syntax/assignment.rdoc455
-rw-r--r--doc/syntax/calling_methods.rdoc349
-rw-r--r--doc/syntax/control_expressions.rdoc500
-rw-r--r--doc/syntax/exceptions.rdoc96
-rw-r--r--doc/syntax/literals.rdoc305
-rw-r--r--doc/syntax/methods.rdoc456
-rw-r--r--doc/syntax/miscellaneous.rdoc107
-rw-r--r--doc/syntax/modules_and_classes.rdoc345
-rw-r--r--doc/syntax/precedence.rdoc60
-rw-r--r--doc/syntax/refinements.rdoc261
-rw-r--r--enc/Makefile.in82
-rw-r--r--enc/ascii.c96
-rw-r--r--enc/big5.c373
-rw-r--r--enc/cp949.c221
-rw-r--r--enc/depend568
-rw-r--r--enc/emacs_mule.c341
-rw-r--r--enc/encdb.c26
-rw-r--r--enc/encinit.c.erb37
-rw-r--r--enc/euc_jp.c615
-rw-r--r--enc/euc_kr.c194
-rw-r--r--enc/euc_tw.c227
-rw-r--r--enc/gb18030.c603
-rw-r--r--enc/gb2312.c13
-rw-r--r--enc/gbk.c224
-rw-r--r--enc/iso_2022_jp.h47
-rw-r--r--enc/iso_8859_1.c277
-rw-r--r--enc/iso_8859_10.c246
-rw-r--r--enc/iso_8859_11.c113
-rw-r--r--enc/iso_8859_13.c249
-rw-r--r--enc/iso_8859_14.c248
-rw-r--r--enc/iso_8859_15.c242
-rw-r--r--enc/iso_8859_16.c244
-rw-r--r--enc/iso_8859_2.c242
-rw-r--r--enc/iso_8859_3.c242
-rw-r--r--enc/iso_8859_4.c245
-rw-r--r--enc/iso_8859_5.c232
-rw-r--r--enc/iso_8859_6.c109
-rw-r--r--enc/iso_8859_7.c239
-rw-r--r--enc/iso_8859_8.c109
-rw-r--r--enc/iso_8859_9.c245
-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.c221
-rw-r--r--enc/koi8_u.c223
-rwxr-xr-xenc/make_encmake.rb137
-rw-r--r--enc/mktable.c1162
-rw-r--r--enc/prelude.rb4
-rw-r--r--enc/shift_jis.c583
-rw-r--r--enc/trans/CP/CP932UDA%UCS.src1912
-rw-r--r--enc/trans/CP/CP932VDC@IBM%UCS.src420
-rw-r--r--enc/trans/CP/CP932VDC@NEC_IBM%UCS.src406
-rw-r--r--enc/trans/CP/UCS%CP932UDA.src1912
-rw-r--r--enc/trans/CP/UCS%CP932VDC@IBM.src420
-rw-r--r--enc/trans/CP/UCS%CP932VDC@NEC_IBM.src406
-rw-r--r--enc/trans/EMOJI/EMOJI_ISO-2022-JP-KDDI%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-DOCOMO%UCS.src293
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI-UNDOC%UCS.src658
-rw-r--r--enc/trans/EMOJI/EMOJI_SHIFT_JIS-SOFTBANK%UCS.src496
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI-UNDOC.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-DOCOMO.src293
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI-UNDOC.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI.src658
-rw-r--r--enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-SOFTBANK.src496
-rw-r--r--enc/trans/GB/GB12345%UCS.src7618
-rw-r--r--enc/trans/GB/GB2312%UCS.src7535
-rw-r--r--enc/trans/GB/UCS%GB12345.src7620
-rw-r--r--enc/trans/GB/UCS%GB2312.src7531
-rw-r--r--enc/trans/JIS/JISX0201-KANA%UCS.src124
-rw-r--r--enc/trans/JIS/JISX0208@1990%UCS.src6964
-rw-r--r--enc/trans/JIS/JISX0208@MS%UCS.src6893
-rw-r--r--enc/trans/JIS/JISX0208UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0208VDC@NEC%UCS.src97
-rw-r--r--enc/trans/JIS/JISX0212%UCS.src6159
-rw-r--r--enc/trans/JIS/JISX0212@MS%UCS.src6081
-rw-r--r--enc/trans/JIS/JISX0212UDC%UCS.src954
-rw-r--r--enc/trans/JIS/JISX0212VDC@IBM%UCS.src120
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@BMP.src1926
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@SIP.src60
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@BMP.src2193
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@SIP.src311
-rw-r--r--enc/trans/JIS/UCS%JISX0201-KANA.src125
-rw-r--r--enc/trans/JIS/UCS%JISX0208@1990.src6965
-rw-r--r--enc/trans/JIS/UCS%JISX0208@MS.src6894
-rw-r--r--enc/trans/JIS/UCS%JISX0208UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0208VDC@NEC.src98
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src6163
-rw-r--r--enc/trans/JIS/UCS%JISX0212@MS.src6082
-rw-r--r--enc/trans/JIS/UCS%JISX0212UDC.src955
-rw-r--r--enc/trans/JIS/UCS%JISX0212VDC@IBM.src121
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-1.src1922
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-2.src2189
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-1.src56
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-2.src307
-rw-r--r--enc/trans/big5-hkscs-tbl.rb37302
-rw-r--r--enc/trans/big5-uao-tbl.rb19784
-rw-r--r--enc/trans/big5.trans32
-rw-r--r--enc/trans/chinese.trans31
-rw-r--r--enc/trans/cp850-tbl.rb130
-rw-r--r--enc/trans/cp852-tbl.rb130
-rw-r--r--enc/trans/cp855-tbl.rb130
-rw-r--r--enc/trans/cp949-tbl.rb8831
-rw-r--r--enc/trans/emoji-exchange-tbl.rb8407
-rw-r--r--enc/trans/emoji.trans36
-rw-r--r--enc/trans/emoji_iso2022_kddi.trans216
-rw-r--r--enc/trans/emoji_sjis_docomo.trans32
-rw-r--r--enc/trans/emoji_sjis_kddi.trans33
-rw-r--r--enc/trans/emoji_sjis_softbank.trans32
-rw-r--r--enc/trans/escape.trans93
-rw-r--r--enc/trans/euckr-tbl.rb8230
-rw-r--r--enc/trans/gb18030-tbl.rb63362
-rw-r--r--enc/trans/gb18030.trans183
-rw-r--r--enc/trans/gbk-tbl.rb21794
-rw-r--r--enc/trans/gbk.trans15
-rw-r--r--enc/trans/ibm437-tbl.rb130
-rw-r--r--enc/trans/ibm737-tbl.rb130
-rw-r--r--enc/trans/ibm775-tbl.rb130
-rw-r--r--enc/trans/ibm852-tbl.rb130
-rw-r--r--enc/trans/ibm855-tbl.rb130
-rw-r--r--enc/trans/ibm857-tbl.rb127
-rw-r--r--enc/trans/ibm860-tbl.rb130
-rw-r--r--enc/trans/ibm861-tbl.rb130
-rw-r--r--enc/trans/ibm862-tbl.rb130
-rw-r--r--enc/trans/ibm863-tbl.rb130
-rw-r--r--enc/trans/ibm865-tbl.rb130
-rw-r--r--enc/trans/ibm866-tbl.rb130
-rw-r--r--enc/trans/ibm869-tbl.rb121
-rw-r--r--enc/trans/iso-8859-1-tbl.rb98
-rw-r--r--enc/trans/iso-8859-10-tbl.rb98
-rw-r--r--enc/trans/iso-8859-11-tbl.rb90
-rw-r--r--enc/trans/iso-8859-13-tbl.rb98
-rw-r--r--enc/trans/iso-8859-14-tbl.rb98
-rw-r--r--enc/trans/iso-8859-15-tbl.rb98
-rw-r--r--enc/trans/iso-8859-16-tbl.rb98
-rw-r--r--enc/trans/iso-8859-2-tbl.rb98
-rw-r--r--enc/trans/iso-8859-3-tbl.rb91
-rw-r--r--enc/trans/iso-8859-4-tbl.rb98
-rw-r--r--enc/trans/iso-8859-5-tbl.rb98
-rw-r--r--enc/trans/iso-8859-6-tbl.rb53
-rw-r--r--enc/trans/iso-8859-7-tbl.rb95
-rw-r--r--enc/trans/iso-8859-8-tbl.rb62
-rw-r--r--enc/trans/iso-8859-9-tbl.rb98
-rw-r--r--enc/trans/iso2022.trans567
-rw-r--r--enc/trans/japanese.trans97
-rw-r--r--enc/trans/japanese_euc.trans57
-rw-r--r--enc/trans/japanese_sjis.trans33
-rw-r--r--enc/trans/koi8-r-tbl.rb130
-rw-r--r--enc/trans/koi8-u-tbl.rb130
-rw-r--r--enc/trans/korean.trans18
-rw-r--r--enc/trans/maccroatian-tbl.rb129
-rw-r--r--enc/trans/maccyrillic-tbl.rb130
-rw-r--r--enc/trans/macgreek-tbl.rb129
-rw-r--r--enc/trans/maciceland-tbl.rb129
-rw-r--r--enc/trans/macroman-tbl.rb129
-rw-r--r--enc/trans/macromania-tbl.rb129
-rw-r--r--enc/trans/macturkish-tbl.rb128
-rw-r--r--enc/trans/macukraine-tbl.rb130
-rw-r--r--enc/trans/newline.trans135
-rw-r--r--enc/trans/single_byte.trans91
-rw-r--r--enc/trans/tis-620-tbl.rb89
-rw-r--r--enc/trans/transdb.c18
-rw-r--r--enc/trans/ucm/glibc-BIG5-2.3.3.ucm14087
-rw-r--r--enc/trans/ucm/glibc-BIG5HKSCS-2.3.3.ucm18332
-rw-r--r--enc/trans/ucm/windows-950-2000.ucm20379
-rw-r--r--enc/trans/ucm/windows-950_hkscs-2001.ucm23446
-rw-r--r--enc/trans/utf8_mac-tbl.rb23154
-rw-r--r--enc/trans/utf8_mac.trans256
-rw-r--r--enc/trans/utf_16_32.trans556
-rw-r--r--enc/trans/windows-1250-tbl.rb125
-rw-r--r--enc/trans/windows-1251-tbl.rb129
-rw-r--r--enc/trans/windows-1252-tbl.rb125
-rw-r--r--enc/trans/windows-1253-tbl.rb113
-rw-r--r--enc/trans/windows-1254-tbl.rb123
-rw-r--r--enc/trans/windows-1255-tbl.rb141
-rw-r--r--enc/trans/windows-1256-tbl.rb130
-rw-r--r--enc/trans/windows-1257-tbl.rb118
-rw-r--r--enc/trans/windows-874-tbl.rb99
-rw-r--r--enc/unicode.c607
-rwxr-xr-xenc/unicode/case-folding.rb196
-rw-r--r--enc/unicode/casefold.h5619
-rw-r--r--enc/unicode/name2ctype.h32679
-rw-r--r--enc/unicode/name2ctype.h.blt28722
-rw-r--r--enc/unicode/name2ctype.kwd26550
-rw-r--r--enc/unicode/name2ctype.src26550
-rw-r--r--enc/us_ascii.c33
-rw-r--r--enc/utf_16_32.h5
-rw-r--r--enc/utf_16be.c254
-rw-r--r--enc/utf_16le.c246
-rw-r--r--enc/utf_32be.c193
-rw-r--r--enc/utf_32le.c192
-rw-r--r--enc/utf_7.h5
-rw-r--r--enc/utf_8.c457
-rw-r--r--enc/windows_1250.c220
-rw-r--r--enc/windows_1251.c210
-rw-r--r--enc/windows_1252.c211
-rw-r--r--enc/windows_31j.c80
-rw-r--r--enc/x_emoji.h26
-rw-r--r--encoding.c1967
-rw-r--r--enum.c3121
-rw-r--r--enumerator.c2126
-rw-r--r--env.h60
-rw-r--r--error.c2390
-rw-r--r--eval.c14093
-rw-r--r--eval_error.c306
-rw-r--r--eval_intern.h275
-rw-r--r--eval_jump.c145
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/array/resize/resize.c14
-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.rb7
-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.c23
-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/bug.c14
-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.rb1
-rw-r--r--ext/-test-/class/class2name.c14
-rw-r--r--ext/-test-/class/extconf.rb7
-rw-r--r--ext/-test-/class/init.c11
-rw-r--r--ext/-test-/debug/depend32
-rw-r--r--ext/-test-/debug/extconf.rb6
-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.rb1
-rw-r--r--ext/-test-/exception/dataerror.c31
-rw-r--r--ext/-test-/exception/depend43
-rw-r--r--ext/-test-/exception/enc_raise.c15
-rw-r--r--ext/-test-/exception/ensured.c25
-rw-r--r--ext/-test-/exception/extconf.rb6
-rw-r--r--ext/-test-/exception/init.c11
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/fatal/rb_fatal.c19
-rw-r--r--ext/-test-/file/depend36
-rw-r--r--ext/-test-/file/extconf.rb22
-rw-r--r--ext/-test-/file/fs.c105
-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.rb7
-rw-r--r--ext/-test-/float/init.c11
-rw-r--r--ext/-test-/float/nextafter.c36
-rw-r--r--ext/-test-/funcall/extconf.rb2
-rw-r--r--ext/-test-/funcall/passing_block.c30
-rw-r--r--ext/-test-/hash/delete.c16
-rw-r--r--ext/-test-/hash/extconf.rb7
-rw-r--r--ext/-test-/hash/init.c11
-rw-r--r--ext/-test-/iseq_load/extconf.rb1
-rw-r--r--ext/-test-/iseq_load/iseq_load.c21
-rw-r--r--ext/-test-/iter/break.c25
-rw-r--r--ext/-test-/iter/extconf.rb7
-rw-r--r--ext/-test-/iter/init.c11
-rw-r--r--ext/-test-/iter/yield.c16
-rw-r--r--ext/-test-/load/dot.dot/dot.dot.c1
-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/compat/usrcompat.c32
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/marshal/usr/usrmarshal.c50
-rw-r--r--ext/-test-/method/arity.c22
-rw-r--r--ext/-test-/method/extconf.rb6
-rw-r--r--ext/-test-/method/init.c11
-rw-r--r--ext/-test-/num2int/extconf.rb1
-rw-r--r--ext/-test-/num2int/num2int.c136
-rw-r--r--ext/-test-/path_to_class/extconf.rb6
-rw-r--r--ext/-test-/path_to_class/path_to_class.c15
-rw-r--r--ext/-test-/postponed_job/depend1
-rw-r--r--ext/-test-/postponed_job/extconf.rb1
-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.c101
-rw-r--r--ext/-test-/proc/extconf.rb7
-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.rb7
-rw-r--r--ext/-test-/rational/rat.c37
-rw-r--r--ext/-test-/recursion/extconf.rb2
-rw-r--r--ext/-test-/recursion/recursion.c28
-rw-r--r--ext/-test-/st/foreach/extconf.rb1
-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.c138
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/st/update/update.c34
-rw-r--r--ext/-test-/string/coderange.c47
-rw-r--r--ext/-test-/string/cstr.c57
-rw-r--r--ext/-test-/string/depend115
-rw-r--r--ext/-test-/string/ellipsize.c13
-rw-r--r--ext/-test-/string/enc_associate.c14
-rw-r--r--ext/-test-/string/enc_str_buf_cat.c14
-rw-r--r--ext/-test-/string/extconf.rb7
-rw-r--r--ext/-test-/string/init.c11
-rw-r--r--ext/-test-/string/modify.c22
-rw-r--r--ext/-test-/string/nofree.c13
-rw-r--r--ext/-test-/string/normalize.c17
-rw-r--r--ext/-test-/string/qsort.c61
-rw-r--r--ext/-test-/string/set_len.c14
-rw-r--r--ext/-test-/struct/duplicate.c24
-rw-r--r--ext/-test-/struct/extconf.rb7
-rw-r--r--ext/-test-/struct/init.c11
-rw-r--r--ext/-test-/struct/member.c18
-rw-r--r--ext/-test-/symbol/extconf.rb7
-rw-r--r--ext/-test-/symbol/init.c25
-rw-r--r--ext/-test-/symbol/type.c78
-rw-r--r--ext/-test-/tracepoint/depend22
-rw-r--r--ext/-test-/tracepoint/extconf.rb1
-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-/typeddata/typeddata.c20
-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/depend14
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb1
-rw-r--r--ext/-test-/wait_for_single_fd/wait_for_single_fd.c30
-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.rb8
-rw-r--r--ext/-test-/win32/console/init.c11
-rw-r--r--ext/-test-/win32/dln/dlntest.c17
-rw-r--r--ext/-test-/win32/dln/extconf.rb37
-rw-r--r--ext/-test-/win32/dln/libdlntest.c4
-rw-r--r--ext/-test-/win32/dln/libdlntest.def2
-rw-r--r--ext/-test-/win32/fd_setsize/depend1
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb3
-rw-r--r--ext/-test-/win32/fd_setsize/fd_setsize.c55
-rw-r--r--ext/.cvsignore2
-rw-r--r--ext/.document102
-rw-r--r--ext/Setup10
-rw-r--r--ext/Setup.atheos9
-rw-r--r--ext/Setup.dj34
-rw-r--r--ext/Setup.emx11
-rw-r--r--ext/Setup.nacl45
-rw-r--r--ext/Setup.nt10
-rw-r--r--ext/Setup.x6834
-rw-r--r--ext/Win32API/.cvsignore3
-rw-r--r--ext/Win32API/Win32API.c215
-rw-r--r--ext/Win32API/depend1
-rw-r--r--ext/Win32API/extconf.rb6
-rw-r--r--ext/Win32API/getch.rb5
-rw-r--r--ext/Win32API/lib/win32/registry.rb831
-rw-r--r--ext/Win32API/lib/win32/resolv.rb366
-rw-r--r--ext/Win32API/point.rb18
-rw-r--r--ext/bigdecimal/.cvsignore3
-rw-r--r--ext/bigdecimal/README60
-rw-r--r--ext/bigdecimal/bigdecimal.c6789
-rw-r--r--ext/bigdecimal/bigdecimal.def2
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec31
-rw-r--r--ext/bigdecimal/bigdecimal.h222
-rw-r--r--ext/bigdecimal/bigdecimal_en.html796
-rw-r--r--ext/bigdecimal/bigdecimal_ja.html799
-rw-r--r--ext/bigdecimal/depend14
-rw-r--r--ext/bigdecimal/extconf.rb8
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb36
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb44
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb176
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb16
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb144
-rw-r--r--ext/bigdecimal/sample/linear.rb21
-rw-r--r--ext/bigdecimal/sample/nlsolve.rb23
-rw-r--r--ext/continuation/continuation.c13
-rw-r--r--ext/continuation/extconf.rb3
-rw-r--r--ext/coverage/coverage.c110
-rw-r--r--ext/coverage/depend41
-rw-r--r--ext/coverage/extconf.rb4
-rw-r--r--ext/curses/.cvsignore3
-rw-r--r--ext/curses/curses.c2101
-rw-r--r--ext/curses/depend1
-rw-r--r--ext/curses/extconf.rb31
-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.rb115
-rw-r--r--ext/date/date_core.c9649
-rw-r--r--ext/date/date_parse.c3128
-rw-r--r--ext/date/date_strftime.c638
-rw-r--r--ext/date/date_strptime.c701
-rw-r--r--ext/date/date_tmx.h56
-rw-r--r--ext/date/depend53
-rw-r--r--ext/date/extconf.rb5
-rw-r--r--ext/date/lib/date.rb60
-rw-r--r--ext/dbm/.cvsignore3
-rw-r--r--ext/dbm/dbm.c761
-rw-r--r--ext/dbm/depend1
-rw-r--r--ext/dbm/extconf.rb284
-rw-r--r--ext/digest/.cvsignore3
-rw-r--r--ext/digest/bubblebabble/.cvsignore3
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c40
-rw-r--r--ext/digest/bubblebabble/depend16
-rw-r--r--ext/digest/bubblebabble/extconf.rb1
-rw-r--r--ext/digest/defs.h14
-rw-r--r--ext/digest/depend15
-rw-r--r--ext/digest/digest.c162
-rw-r--r--ext/digest/digest.h6
-rw-r--r--ext/digest/extconf.rb2
-rw-r--r--ext/digest/lib/digest.rb78
-rw-r--r--ext/digest/lib/md5.rb23
-rw-r--r--ext/digest/lib/sha1.rb23
-rw-r--r--ext/digest/md5/.cvsignore3
-rw-r--r--ext/digest/md5/depend22
-rw-r--r--ext/digest/md5/extconf.rb15
-rw-r--r--ext/digest/md5/md5.c14
-rw-r--r--ext/digest/md5/md5.h6
-rw-r--r--ext/digest/md5/md5init.c14
-rw-r--r--ext/digest/rmd160/.cvsignore3
-rw-r--r--ext/digest/rmd160/depend34
-rw-r--r--ext/digest/rmd160/extconf.rb14
-rw-r--r--ext/digest/rmd160/rmd160.c16
-rw-r--r--ext/digest/rmd160/rmd160.h8
-rw-r--r--ext/digest/rmd160/rmd160init.c14
-rw-r--r--ext/digest/rmd160/rmd160ossl.c2
-rw-r--r--ext/digest/sha1/.cvsignore3
-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.h10
-rw-r--r--ext/digest/sha1/sha1init.c18
-rw-r--r--ext/digest/sha1/sha1ossl.c2
-rw-r--r--ext/digest/sha2/.cvsignore3
-rw-r--r--ext/digest/sha2/depend33
-rw-r--r--ext/digest/sha2/extconf.rb29
-rw-r--r--ext/digest/sha2/lib/sha2.rb50
-rw-r--r--ext/digest/sha2/sha2.c312
-rw-r--r--ext/digest/sha2/sha2.h170
-rw-r--r--ext/digest/sha2/sha2init.c15
-rw-r--r--ext/digest/sha2/sha2ossl.c13
-rw-r--r--ext/digest/sha2/sha2ossl.h17
-rw-r--r--ext/dl/.cvsignore8
-rw-r--r--ext/dl/depend46
-rw-r--r--ext/dl/dl.c736
-rw-r--r--ext/dl/dl.def59
-rw-r--r--ext/dl/dl.h313
-rw-r--r--ext/dl/doc/dl.txt266
-rw-r--r--ext/dl/extconf.rb193
-rw-r--r--ext/dl/h2rb500
-rw-r--r--ext/dl/handle.c215
-rw-r--r--ext/dl/install.rb49
-rw-r--r--ext/dl/lib/dl/import.rb225
-rw-r--r--ext/dl/lib/dl/struct.rb149
-rw-r--r--ext/dl/lib/dl/types.rb245
-rw-r--r--ext/dl/lib/dl/win32.rb25
-rw-r--r--ext/dl/mkcall.rb62
-rw-r--r--ext/dl/mkcallback.rb56
-rw-r--r--ext/dl/mkcbtable.rb18
-rw-r--r--ext/dl/ptr.c1058
-rw-r--r--ext/dl/sample/c++sample.C35
-rw-r--r--ext/dl/sample/c++sample.rb60
-rw-r--r--ext/dl/sample/drives.rb70
-rw-r--r--ext/dl/sample/getch.rb5
-rw-r--r--ext/dl/sample/libc.rb69
-rw-r--r--ext/dl/sample/msgbox.rb19
-rw-r--r--ext/dl/sample/msgbox2.rb18
-rw-r--r--ext/dl/sample/stream.rb87
-rw-r--r--ext/dl/sym.c993
-rw-r--r--ext/dl/test/libtest.def28
-rw-r--r--ext/dl/test/test.c247
-rw-r--r--ext/dl/test/test.rb306
-rw-r--r--ext/dl/type.rb115
-rw-r--r--ext/etc/.cvsignore3
-rw-r--r--ext/etc/depend10
-rw-r--r--ext/etc/etc.c1038
-rw-r--r--ext/etc/etc.txt72
-rw-r--r--ext/etc/etc.txt.ja72
-rw-r--r--ext/etc/extconf.rb74
-rw-r--r--ext/etc/mkconstants.rb331
-rwxr-xr-x[-rw-r--r--]ext/extmk.rb427
-rw-r--r--ext/fcntl/.cvsignore3
-rw-r--r--ext/fcntl/depend1
-rw-r--r--ext/fcntl/fcntl.c192
-rw-r--r--ext/fiber/extconf.rb3
-rw-r--r--ext/fiber/fiber.c8
-rw-r--r--ext/fiddle/closure.c316
-rw-r--r--ext/fiddle/closure.h8
-rw-r--r--ext/fiddle/conversions.c141
-rw-r--r--ext/fiddle/conversions.h44
-rw-r--r--ext/fiddle/depend55
-rw-r--r--ext/fiddle/extconf.rb168
-rw-r--r--ext/fiddle/extlibs2
-rw-r--r--ext/fiddle/fiddle.c454
-rw-r--r--ext/fiddle/fiddle.h138
-rw-r--r--ext/fiddle/function.c279
-rw-r--r--ext/fiddle/function.h8
-rw-r--r--ext/fiddle/handle.c482
-rw-r--r--ext/fiddle/lib/fiddle.rb55
-rw-r--r--ext/fiddle/lib/fiddle/closure.rb48
-rw-r--r--ext/fiddle/lib/fiddle/cparser.rb176
-rw-r--r--ext/fiddle/lib/fiddle/function.rb17
-rw-r--r--ext/fiddle/lib/fiddle/import.rb314
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb128
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb243
-rw-r--r--ext/fiddle/lib/fiddle/types.rb71
-rw-r--r--ext/fiddle/lib/fiddle/value.rb112
-rw-r--r--ext/fiddle/pointer.c721
-rwxr-xr-xext/fiddle/win32/fficonfig.h29
-rw-r--r--ext/fiddle/win32/libffi-3.2.1-mswin.patch132
-rwxr-xr-xext/fiddle/win32/libffi-config.rb47
-rwxr-xr-xext/fiddle/win32/libffi.mk.tmpl96
-rw-r--r--ext/gdbm/.cvsignore3
-rw-r--r--ext/gdbm/depend1
-rw-r--r--ext/gdbm/extconf.rb11
-rw-r--r--ext/gdbm/gdbm.c492
-rw-r--r--ext/iconv/.cvsignore5
-rw-r--r--ext/iconv/charset_alias.rb103
-rw-r--r--ext/iconv/depend2
-rw-r--r--ext/iconv/extconf.rb51
-rw-r--r--ext/iconv/iconv.c913
-rw-r--r--ext/io/console/console.c774
-rw-r--r--ext/io/console/depend4
-rw-r--r--ext/io/console/extconf.rb21
-rw-r--r--ext/io/console/io-console.gemspec21
-rw-r--r--ext/io/console/lib/console/size.rb22
-rw-r--r--ext/io/nonblock/depend4
-rw-r--r--ext/io/nonblock/extconf.rb8
-rw-r--r--ext/io/nonblock/nonblock.c138
-rw-r--r--ext/io/wait/.cvsignore2
-rw-r--r--ext/io/wait/depend4
-rw-r--r--ext/io/wait/extconf.rb5
-rw-r--r--ext/io/wait/lib/nonblock.rb23
-rw-r--r--ext/io/wait/wait.c163
-rw-r--r--ext/json/extconf.rb3
-rw-r--r--ext/json/fbuffer/fbuffer.h190
-rw-r--r--ext/json/generator/depend21
-rw-r--r--ext/json/generator/extconf.rb4
-rw-r--r--ext/json/generator/generator.c1458
-rw-r--r--ext/json/generator/generator.h152
-rw-r--r--ext/json/lib/json.rb62
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb28
-rw-r--r--ext/json/lib/json/add/complex.rb22
-rw-r--r--ext/json/lib/json/add/core.rb11
-rw-r--r--ext/json/lib/json/add/date.rb33
-rw-r--r--ext/json/lib/json/add/date_time.rb49
-rw-r--r--ext/json/lib/json/add/exception.rb30
-rw-r--r--ext/json/lib/json/add/ostruct.rb30
-rw-r--r--ext/json/lib/json/add/range.rb28
-rw-r--r--ext/json/lib/json/add/rational.rb22
-rw-r--r--ext/json/lib/json/add/regexp.rb29
-rw-r--r--ext/json/lib/json/add/struct.rb29
-rw-r--r--ext/json/lib/json/add/symbol.rb24
-rw-r--r--ext/json/lib/json/add/time.rb37
-rw-r--r--ext/json/lib/json/common.rb484
-rw-r--r--ext/json/lib/json/ext.rb21
-rw-r--r--ext/json/lib/json/generic_object.rb70
-rw-r--r--ext/json/lib/json/version.rb8
-rw-r--r--ext/json/parser/depend20
-rw-r--r--ext/json/parser/extconf.rb5
-rw-r--r--ext/json/parser/parser.c2235
-rw-r--r--ext/json/parser/parser.h78
-rw-r--r--ext/json/parser/parser.rl958
-rw-r--r--ext/json/parser/prereq.mk10
-rw-r--r--ext/mathn/complex/complex.c7
-rw-r--r--ext/mathn/complex/extconf.rb3
-rw-r--r--ext/mathn/rational/extconf.rb3
-rw-r--r--ext/mathn/rational/rational.c7
-rw-r--r--ext/nkf/.cvsignore3
-rw-r--r--ext/nkf/depend23
-rw-r--r--ext/nkf/lib/kconv.rb285
-rw-r--r--ext/nkf/nkf-utf8/config.h77
-rw-r--r--ext/nkf/nkf-utf8/nkf.c10013
-rw-r--r--ext/nkf/nkf-utf8/nkf.h189
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c7346
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h38
-rw-r--r--ext/nkf/nkf.c405
-rw-r--r--ext/objspace/depend66
-rw-r--r--ext/objspace/extconf.rb3
-rw-r--r--ext/objspace/object_tracing.c492
-rw-r--r--ext/objspace/objspace.c777
-rw-r--r--ext/objspace/objspace.h20
-rw-r--r--ext/objspace/objspace_dump.c434
-rw-r--r--ext/openssl/.cvsignore5
-rw-r--r--ext/openssl/depend1091
-rw-r--r--ext/openssl/deprecation.rb21
-rw-r--r--ext/openssl/extconf.rb100
-rw-r--r--ext/openssl/lib/net/ftptls.rb53
-rw-r--r--ext/openssl/lib/net/telnets.rb251
-rw-r--r--ext/openssl/lib/openssl.rb5
-rw-r--r--ext/openssl/lib/openssl/bn.rb48
-rw-r--r--ext/openssl/lib/openssl/buffering.rb268
-rw-r--r--ext/openssl/lib/openssl/cipher.rb40
-rw-r--r--ext/openssl/lib/openssl/config.rb472
-rw-r--r--ext/openssl/lib/openssl/digest.rb95
-rw-r--r--ext/openssl/lib/openssl/pkcs7.rb25
-rw-r--r--ext/openssl/lib/openssl/ssl.rb179
-rw-r--r--ext/openssl/lib/openssl/x509.rb80
-rw-r--r--ext/openssl/openssl_missing.c37
-rw-r--r--ext/openssl/openssl_missing.h59
-rw-r--r--ext/openssl/ossl.c843
-rw-r--r--ext/openssl/ossl.h71
-rw-r--r--ext/openssl/ossl_asn1.c1262
-rw-r--r--ext/openssl/ossl_asn1.h4
-rw-r--r--ext/openssl/ossl_bio.c9
-rw-r--r--ext/openssl/ossl_bn.c278
-rw-r--r--ext/openssl/ossl_cipher.c638
-rw-r--r--ext/openssl/ossl_config.c431
-rw-r--r--ext/openssl/ossl_digest.c249
-rw-r--r--ext/openssl/ossl_engine.c273
-rw-r--r--ext/openssl/ossl_hmac.c194
-rw-r--r--ext/openssl/ossl_ns_spki.c201
-rw-r--r--ext/openssl/ossl_ocsp.c661
-rw-r--r--ext/openssl/ossl_pkcs12.c42
-rw-r--r--ext/openssl/ossl_pkcs5.c123
-rw-r--r--ext/openssl/ossl_pkcs7.c183
-rw-r--r--ext/openssl/ossl_pkey.c250
-rw-r--r--ext/openssl/ossl_pkey.h27
-rw-r--r--ext/openssl/ossl_pkey_dh.c244
-rw-r--r--ext/openssl/ossl_pkey_dsa.c252
-rw-r--r--ext/openssl/ossl_pkey_ec.c309
-rw-r--r--ext/openssl/ossl_pkey_rsa.c346
-rw-r--r--ext/openssl/ossl_rand.c116
-rw-r--r--ext/openssl/ossl_ssl.c1330
-rw-r--r--ext/openssl/ossl_ssl.h16
-rw-r--r--ext/openssl/ossl_ssl_session.c142
-rw-r--r--ext/openssl/ossl_version.h2
-rw-r--r--ext/openssl/ossl_x509.c2
-rw-r--r--ext/openssl/ossl_x509attr.c66
-rw-r--r--ext/openssl/ossl_x509cert.c290
-rw-r--r--ext/openssl/ossl_x509crl.c98
-rw-r--r--ext/openssl/ossl_x509ext.c117
-rw-r--r--ext/openssl/ossl_x509name.c222
-rw-r--r--ext/openssl/ossl_x509req.c96
-rw-r--r--ext/openssl/ossl_x509revoked.c54
-rw-r--r--ext/openssl/ossl_x509store.c186
-rw-r--r--ext/openssl/ruby_missing.h17
-rw-r--r--ext/pathname/depend3
-rw-r--r--ext/pathname/extconf.rb3
-rw-r--r--ext/pathname/lib/pathname.rb579
-rw-r--r--ext/pathname/pathname.c1463
-rw-r--r--ext/psych/.gitignore11
-rw-r--r--ext/psych/depend3
-rw-r--r--ext/psych/extconf.rb38
-rw-r--r--ext/psych/lib/psych.rb498
-rw-r--r--ext/psych/lib/psych/class_loader.rb101
-rw-r--r--ext/psych/lib/psych/coder.rb94
-rw-r--r--ext/psych/lib/psych/core_ext.rb35
-rw-r--r--ext/psych/lib/psych/deprecated.rb85
-rw-r--r--ext/psych/lib/psych/exception.rb13
-rw-r--r--ext/psych/lib/psych/handler.rb249
-rw-r--r--ext/psych/lib/psych/handlers/document_stream.rb22
-rw-r--r--ext/psych/lib/psych/handlers/recorder.rb39
-rw-r--r--ext/psych/lib/psych/json/ruby_events.rb19
-rw-r--r--ext/psych/lib/psych/json/stream.rb16
-rw-r--r--ext/psych/lib/psych/json/tree_builder.rb12
-rw-r--r--ext/psych/lib/psych/json/yaml_events.rb29
-rw-r--r--ext/psych/lib/psych/nodes.rb77
-rw-r--r--ext/psych/lib/psych/nodes/alias.rb18
-rw-r--r--ext/psych/lib/psych/nodes/document.rb60
-rw-r--r--ext/psych/lib/psych/nodes/mapping.rb56
-rw-r--r--ext/psych/lib/psych/nodes/node.rb55
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb67
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb81
-rw-r--r--ext/psych/lib/psych/nodes/stream.rb37
-rw-r--r--ext/psych/lib/psych/omap.rb4
-rw-r--r--ext/psych/lib/psych/parser.rb51
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb149
-rw-r--r--ext/psych/lib/psych/set.rb4
-rw-r--r--ext/psych/lib/psych/stream.rb37
-rw-r--r--ext/psych/lib/psych/streaming.rb27
-rw-r--r--ext/psych/lib/psych/syntax_error.rb21
-rw-r--r--ext/psych/lib/psych/tree_builder.rb96
-rw-r--r--ext/psych/lib/psych/visitors.rb6
-rw-r--r--ext/psych/lib/psych/visitors/depth_first.rb26
-rw-r--r--ext/psych/lib/psych/visitors/emitter.rb51
-rw-r--r--ext/psych/lib/psych/visitors/json_tree.rb24
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb389
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb19
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb565
-rw-r--r--ext/psych/lib/psych/y.rb9
-rw-r--r--ext/psych/psych.c34
-rw-r--r--ext/psych/psych.gemspec23
-rw-r--r--ext/psych/psych.h20
-rw-r--r--ext/psych/psych_emitter.c556
-rw-r--r--ext/psych/psych_emitter.h8
-rw-r--r--ext/psych/psych_parser.c597
-rw-r--r--ext/psych/psych_parser.h6
-rw-r--r--ext/psych/psych_to_ruby.c43
-rw-r--r--ext/psych/psych_to_ruby.h8
-rw-r--r--ext/psych/psych_yaml_tree.c24
-rw-r--r--ext/psych/psych_yaml_tree.h8
-rw-r--r--ext/psych/yaml/LICENSE19
-rw-r--r--ext/psych/yaml/api.c1415
-rw-r--r--ext/psych/yaml/config.h10
-rw-r--r--ext/psych/yaml/dumper.c394
-rw-r--r--ext/psych/yaml/emitter.c2329
-rw-r--r--ext/psych/yaml/loader.c459
-rw-r--r--ext/psych/yaml/parser.c1370
-rw-r--r--ext/psych/yaml/reader.c469
-rw-r--r--ext/psych/yaml/scanner.c3583
-rw-r--r--ext/psych/yaml/writer.c141
-rw-r--r--ext/psych/yaml/yaml.h1971
-rw-r--r--ext/psych/yaml/yaml_private.h664
-rw-r--r--ext/pty/.cvsignore3
-rw-r--r--ext/pty/README65
-rw-r--r--ext/pty/README.expect22
-rw-r--r--ext/pty/README.expect.ja21
-rw-r--r--ext/pty/README.ja89
-rw-r--r--ext/pty/depend18
-rw-r--r--ext/pty/expect_sample.rb48
-rw-r--r--ext/pty/extconf.rb8
-rw-r--r--ext/pty/lib/expect.rb39
-rw-r--r--ext/pty/pty.c845
-rw-r--r--ext/pty/script.rb37
-rw-r--r--ext/purelib.rb10
-rw-r--r--ext/racc/cparse/.cvsignore3
-rw-r--r--ext/racc/cparse/README11
-rw-r--r--ext/racc/cparse/cparse.c161
-rw-r--r--ext/racc/cparse/depend1
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/rbconfig/sizeof/depend15
-rw-r--r--ext/rbconfig/sizeof/extconf.rb3
-rw-r--r--ext/readline/.cvsignore3
-rw-r--r--ext/readline/README68
-rw-r--r--ext/readline/README.ja393
-rw-r--r--ext/readline/depend18
-rw-r--r--ext/readline/extconf.rb112
-rw-r--r--ext/readline/readline.c1929
-rw-r--r--ext/ripper/README30
-rw-r--r--ext/ripper/depend75
-rw-r--r--ext/ripper/eventids2.c305
-rw-r--r--ext/ripper/extconf.rb21
-rw-r--r--ext/ripper/lib/ripper.rb73
-rw-r--r--ext/ripper/lib/ripper/core.rb70
-rw-r--r--ext/ripper/lib/ripper/filter.rb77
-rw-r--r--ext/ripper/lib/ripper/lexer.rb186
-rw-r--r--ext/ripper/lib/ripper/sexp.rb118
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb14
-rwxr-xr-xext/ripper/tools/generate.rb161
-rwxr-xr-xext/ripper/tools/preproc.rb91
-rwxr-xr-xext/ripper/tools/strip.rb12
-rw-r--r--ext/sdbm/.cvsignore3
-rw-r--r--ext/sdbm/_sdbm.c251
-rw-r--r--ext/sdbm/depend21
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c757
-rw-r--r--ext/sdbm/sdbm.h10
-rw-r--r--ext/socket/.cvsignore3
-rw-r--r--ext/socket/.document17
-rw-r--r--ext/socket/addrinfo.h54
-rw-r--r--ext/socket/ancdata.c1842
-rw-r--r--ext/socket/basicsocket.c767
-rw-r--r--ext/socket/constants.c145
-rw-r--r--ext/socket/depend298
-rw-r--r--ext/socket/extconf.rb718
-rw-r--r--ext/socket/getaddrinfo.c104
-rw-r--r--ext/socket/getnameinfo.c62
-rw-r--r--ext/socket/ifaddr.c459
-rw-r--r--ext/socket/init.c622
-rw-r--r--ext/socket/ipsocket.c338
-rw-r--r--ext/socket/lib/socket.rb871
-rw-r--r--ext/socket/mkconstants.rb804
-rw-r--r--ext/socket/option.c1479
-rw-r--r--ext/socket/raddrinfo.c2575
-rw-r--r--ext/socket/rubysocket.h423
-rw-r--r--ext/socket/socket.c5001
-rw-r--r--ext/socket/sockport.h84
-rw-r--r--ext/socket/sockssocket.c68
-rw-r--r--ext/socket/tcpserver.c178
-rw-r--r--ext/socket/tcpsocket.c82
-rw-r--r--ext/socket/udpsocket.c266
-rw-r--r--ext/socket/unixserver.c155
-rw-r--r--ext/socket/unixsocket.c534
-rw-r--r--ext/stringio/.cvsignore3
-rw-r--r--ext/stringio/README3
-rw-r--r--ext/stringio/depend6
-rw-r--r--ext/stringio/stringio.c1121
-rw-r--r--ext/strscan/.cvsignore3
-rw-r--r--ext/strscan/depend18
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c384
-rw-r--r--ext/syck/.cvsignore3
-rw-r--r--ext/syck/bytecode.c1166
-rw-r--r--ext/syck/depend12
-rw-r--r--ext/syck/emitter.c1242
-rw-r--r--ext/syck/extconf.rb5
-rw-r--r--ext/syck/gram.c1894
-rw-r--r--ext/syck/gram.h79
-rw-r--r--ext/syck/handler.c174
-rw-r--r--ext/syck/implicit.c2990
-rw-r--r--ext/syck/node.c408
-rw-r--r--ext/syck/rubyext.c2367
-rw-r--r--ext/syck/syck.c504
-rw-r--r--ext/syck/syck.h458
-rw-r--r--ext/syck/token.c2725
-rw-r--r--ext/syck/yaml2byte.c257
-rw-r--r--ext/syck/yamlbyte.h170
-rw-r--r--ext/syslog/.cvsignore3
-rw-r--r--ext/syslog/depend14
-rw-r--r--ext/syslog/lib/syslog/logger.rb208
-rw-r--r--ext/syslog/syslog.c393
-rw-r--r--ext/syslog/syslog.txt4
-rw-r--r--ext/syslog/test.rb164
-rw-r--r--ext/thread/extconf.rb8
-rw-r--r--ext/thread/lib/thread.rb5
-rw-r--r--ext/thread/thread.c1379
-rw-r--r--ext/tk/.cvsignore3
-rw-r--r--ext/tk/ChangeLog.tkextlib57
-rw-r--r--ext/tk/MANUAL_tcltklib.eng322
-rw-r--r--ext/tk/MANUAL_tcltklib.eucj579
-rw-r--r--ext/tk/MANUAL_tcltklib.ja584
-rw-r--r--ext/tk/README.1st26
-rw-r--r--ext/tk/README.ActiveTcl35
-rw-r--r--ext/tk/README.fork14
-rw-r--r--ext/tk/README.macosx-aqua20
-rw-r--r--ext/tk/README.tcltklib135
-rw-r--r--ext/tk/config_list.in41
-rw-r--r--ext/tk/depend4
-rw-r--r--ext/tk/extconf.rb2066
-rw-r--r--ext/tk/lib/README4
-rw-r--r--ext/tk/lib/multi-tk.rb817
-rw-r--r--ext/tk/lib/remote-tk.rb38
-rw-r--r--ext/tk/lib/tcltk.rb26
-rw-r--r--ext/tk/lib/tk.rb794
-rw-r--r--ext/tk/lib/tk/autoload.rb494
-rw-r--r--ext/tk/lib/tk/bindtag.rb2
-rw-r--r--ext/tk/lib/tk/busy.rb118
-rw-r--r--ext/tk/lib/tk/button.rb5
-rw-r--r--ext/tk/lib/tk/canvas.rb121
-rw-r--r--ext/tk/lib/tk/canvastag.rb33
-rw-r--r--ext/tk/lib/tk/checkbutton.rb8
-rw-r--r--ext/tk/lib/tk/composite.rb48
-rw-r--r--ext/tk/lib/tk/console.rb6
-rw-r--r--ext/tk/lib/tk/dialog.rb30
-rw-r--r--ext/tk/lib/tk/encodedstr.rb6
-rw-r--r--ext/tk/lib/tk/entry.rb5
-rw-r--r--ext/tk/lib/tk/event.rb222
-rw-r--r--ext/tk/lib/tk/font.rb139
-rw-r--r--ext/tk/lib/tk/fontchooser.rb180
-rw-r--r--ext/tk/lib/tk/frame.rb5
-rw-r--r--ext/tk/lib/tk/grid.rb34
-rw-r--r--ext/tk/lib/tk/image.rb136
-rw-r--r--ext/tk/lib/tk/itemconfig.rb151
-rw-r--r--ext/tk/lib/tk/itemfont.rb36
-rw-r--r--ext/tk/lib/tk/kinput.rb6
-rw-r--r--ext/tk/lib/tk/label.rb5
-rw-r--r--ext/tk/lib/tk/labelframe.rb6
-rw-r--r--ext/tk/lib/tk/listbox.rb38
-rw-r--r--ext/tk/lib/tk/macpkg.rb4
-rw-r--r--ext/tk/lib/tk/menu.rb117
-rw-r--r--ext/tk/lib/tk/menubar.rb46
-rw-r--r--ext/tk/lib/tk/menuspec.rb235
-rw-r--r--ext/tk/lib/tk/message.rb6
-rw-r--r--ext/tk/lib/tk/mngfocus.rb4
-rw-r--r--ext/tk/lib/tk/msgcat.rb79
-rw-r--r--ext/tk/lib/tk/namespace.rb35
-rw-r--r--ext/tk/lib/tk/optiondb.rb48
-rw-r--r--ext/tk/lib/tk/optionobj.rb18
-rw-r--r--ext/tk/lib/tk/palette.rb4
-rw-r--r--ext/tk/lib/tk/panedwindow.rb44
-rw-r--r--ext/tk/lib/tk/place.rb12
-rw-r--r--ext/tk/lib/tk/radiobutton.rb8
-rw-r--r--ext/tk/lib/tk/root.rb10
-rw-r--r--ext/tk/lib/tk/scale.rb13
-rw-r--r--ext/tk/lib/tk/scrollbar.rb22
-rw-r--r--ext/tk/lib/tk/selection.rb6
-rw-r--r--ext/tk/lib/tk/spinbox.rb45
-rw-r--r--ext/tk/lib/tk/text.rb170
-rw-r--r--ext/tk/lib/tk/textimage.rb10
-rw-r--r--ext/tk/lib/tk/textmark.rb12
-rw-r--r--ext/tk/lib/tk/texttag.rb27
-rw-r--r--ext/tk/lib/tk/textwindow.rb20
-rw-r--r--ext/tk/lib/tk/timer.rb42
-rw-r--r--ext/tk/lib/tk/tk_mac.rb158
-rw-r--r--ext/tk/lib/tk/toplevel.rb22
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb94
-rw-r--r--ext/tk/lib/tk/validation.rb28
-rw-r--r--ext/tk/lib/tk/variable.rb182
-rw-r--r--ext/tk/lib/tk/virtevent.rb12
-rw-r--r--ext/tk/lib/tk/winfo.rb10
-rw-r--r--ext/tk/lib/tk/winpkg.rb11
-rw-r--r--ext/tk/lib/tk/wm.rb16
-rw-r--r--ext/tk/lib/tk/xim.rb4
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb8
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS89
-rw-r--r--ext/tk/lib/tkextlib/blt.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb1
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb183
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb23
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb3
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb6
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb15
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb93
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb110
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb5
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb60
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb63
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb8
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb4
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb2
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb12
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb13
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb27
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb6
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb7
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb14
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb12
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb6
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb9
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb18
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb81
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb4
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb10
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb18
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb22
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb14
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb64
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb18
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb5
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb17
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb2
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb4
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb6
-rw-r--r--ext/tk/lib/tkextlib/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb29
-rw-r--r--ext/tk/lib/tkextlib/tcllib/README14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb24
-rw-r--r--ext/tk/lib/tkextlib/tcllib/calendar.rb55
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb36
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb21
-rw-r--r--ext/tk/lib/tkextlib/tcllib/chatwidget.rb151
-rw-r--r--ext/tk/lib/tkextlib/tcllib/crosshair.rb117
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ctext.rb12
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb14
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb62
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb12
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb224
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb4
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb46
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb15
-rw-r--r--ext/tk/lib/tkextlib/tcllib/khim.rb68
-rw-r--r--ext/tk/lib/tkextlib/tcllib/menuentry.rb47
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ntext.rb146
-rw-r--r--ext/tk/lib/tkextlib/tcllib/panelframe.rb10
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb716
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb57
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb79
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb2
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb10
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb7
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb328
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb22
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb22
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb175
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb13
-rw-r--r--ext/tk/lib/tkextlib/tcllib/validator.rb65
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb34
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile.rb76
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb6
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb11
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb46
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb22
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb46
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb12
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb140
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb13
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb21
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb9
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb107
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb2
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb54
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb8
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tkimg/README2
-rw-r--r--ext/tk/lib/tkextlib/tkimg/dted.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/raw.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb127
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb241
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/version.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb10
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb2
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb6
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb8
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb2
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb4
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb32
-rw-r--r--ext/tk/old-README.tcltklib.eucj159
-rw-r--r--ext/tk/old-README.tcltklib.ja159
-rw-r--r--ext/tk/old-extconf.rb440
-rw-r--r--ext/tk/sample/24hr_clock.rb130
-rw-r--r--ext/tk/sample/binding_sample.rb8
-rw-r--r--ext/tk/sample/bindtag_sample.rb38
-rw-r--r--ext/tk/sample/binstr_usage.rb2
-rw-r--r--ext/tk/sample/cd_timer.rb16
-rw-r--r--ext/tk/sample/cmd_res_test.rb2
-rw-r--r--ext/tk/sample/demos-en/ChangeLog.prev2
-rw-r--r--ext/tk/sample/demos-en/README130
-rw-r--r--ext/tk/sample/demos-en/README.1st8
-rw-r--r--ext/tk/sample/demos-en/README.tkencoding22
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb14
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb10
-rw-r--r--ext/tk/sample/demos-en/arrow.rb66
-rw-r--r--ext/tk/sample/demos-en/bind.rb34
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb8
-rw-r--r--ext/tk/sample/demos-en/browse122
-rw-r--r--ext/tk/sample/demos-en/browse222
-rw-r--r--ext/tk/sample/demos-en/button.rb10
-rw-r--r--ext/tk/sample/demos-en/check.rb10
-rw-r--r--ext/tk/sample/demos-en/check2.rb34
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb8
-rw-r--r--ext/tk/sample/demos-en/colors.rb2
-rw-r--r--ext/tk/sample/demos-en/combo.rb42
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb26
-rw-r--r--ext/tk/sample/demos-en/ctext.rb44
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms2
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms.tk802
-rw-r--r--ext/tk/sample/demos-en/entry1.rb6
-rw-r--r--ext/tk/sample/demos-en/entry2.rb4
-rw-r--r--ext/tk/sample/demos-en/entry3.rb28
-rw-r--r--ext/tk/sample/demos-en/filebox.rb32
-rw-r--r--ext/tk/sample/demos-en/floor.rb550
-rw-r--r--ext/tk/sample/demos-en/floor2.rb550
-rw-r--r--ext/tk/sample/demos-en/form.rb6
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb402
-rw-r--r--ext/tk/sample/demos-en/icon.rb4
-rw-r--r--ext/tk/sample/demos-en/image1.rb2
-rw-r--r--ext/tk/sample/demos-en/image2.rb6
-rw-r--r--ext/tk/sample/demos-en/image3.rb16
-rw-r--r--ext/tk/sample/demos-en/items.rb86
-rw-r--r--ext/tk/sample/demos-en/ixset28
-rw-r--r--ext/tk/sample/demos-en/ixset254
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb32
-rw-r--r--ext/tk/sample/demos-en/label.rb16
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb14
-rw-r--r--ext/tk/sample/demos-en/mclist.rb56
-rw-r--r--ext/tk/sample/demos-en/menu.rb48
-rw-r--r--ext/tk/sample/demos-en/menu84.rb60
-rw-r--r--ext/tk/sample/demos-en/menubu.rb4
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb24
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb28
-rw-r--r--ext/tk/sample/demos-en/paned1.rb8
-rw-r--r--ext/tk/sample/demos-en/paned2.rb46
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb32
-rw-r--r--ext/tk/sample/demos-en/plot.rb30
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb6
-rw-r--r--ext/tk/sample/demos-en/radio.rb12
-rw-r--r--ext/tk/sample/demos-en/radio2.rb28
-rw-r--r--ext/tk/sample/demos-en/radio3.rb50
-rw-r--r--ext/tk/sample/demos-en/rmt68
-rw-r--r--ext/tk/sample/demos-en/rolodex8
-rw-r--r--ext/tk/sample/demos-en/ruler.rb36
-rw-r--r--ext/tk/sample/demos-en/sayings.rb8
-rw-r--r--ext/tk/sample/demos-en/search.rb32
-rw-r--r--ext/tk/sample/demos-en/spin.rb16
-rw-r--r--ext/tk/sample/demos-en/square12
-rw-r--r--ext/tk/sample/demos-en/states.rb22
-rw-r--r--ext/tk/sample/demos-en/style.rb38
-rw-r--r--ext/tk/sample/demos-en/tcolor18
-rw-r--r--ext/tk/sample/demos-en/text.rb8
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb8
-rw-r--r--ext/tk/sample/demos-en/timer2
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb34
-rw-r--r--ext/tk/sample/demos-en/tree.rb28
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb48
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb18
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb22
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb46
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb22
-rw-r--r--ext/tk/sample/demos-en/twind.rb60
-rw-r--r--ext/tk/sample/demos-en/twind2.rb130
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb40
-rw-r--r--ext/tk/sample/demos-en/widget149
-rw-r--r--ext/tk/sample/demos-jp/README104
-rw-r--r--ext/tk/sample/demos-jp/README.1st28
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb36
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb20
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb84
-rw-r--r--ext/tk/sample/demos-jp/bind.rb56
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb26
-rw-r--r--ext/tk/sample/demos-jp/browse122
-rw-r--r--ext/tk/sample/demos-jp/browse222
-rw-r--r--ext/tk/sample/demos-jp/button.rb22
-rw-r--r--ext/tk/sample/demos-jp/check.rb34
-rw-r--r--ext/tk/sample/demos-jp/check2.rb56
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb34
-rw-r--r--ext/tk/sample/demos-jp/colors.rb22
-rw-r--r--ext/tk/sample/demos-jp/combo.rb68
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb46
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb74
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb12
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb12
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms2
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms.tk802
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb34
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb34
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb82
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb58
-rw-r--r--ext/tk/sample/demos-jp/floor.rb570
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb570
-rw-r--r--ext/tk/sample/demos-jp/form.rb30
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb424
-rw-r--r--ext/tk/sample/demos-jp/hello6
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb14
-rw-r--r--ext/tk/sample/demos-jp/icon.rb26
-rw-r--r--ext/tk/sample/demos-jp/image1.rb24
-rw-r--r--ext/tk/sample/demos-jp/image2.rb36
-rw-r--r--ext/tk/sample/demos-jp/image3.rb30
-rw-r--r--ext/tk/sample/demos-jp/items.rb140
-rw-r--r--ext/tk/sample/demos-jp/ixset30
-rw-r--r--ext/tk/sample/demos-jp/ixset278
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb42
-rw-r--r--ext/tk/sample/demos-jp/label.rb34
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb44
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb82
-rw-r--r--ext/tk/sample/demos-jp/menu.rb128
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb100
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb148
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb32
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb54
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb60
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb24
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb68
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb42
-rw-r--r--ext/tk/sample/demos-jp/plot.rb50
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb36
-rw-r--r--ext/tk/sample/demos-jp/radio.rb32
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb44
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb56
-rw-r--r--ext/tk/sample/demos-jp/rmt68
-rw-r--r--ext/tk/sample/demos-jp/rolodex8
-rw-r--r--ext/tk/sample/demos-jp/rolodex-j136
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb54
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb28
-rw-r--r--ext/tk/sample/demos-jp/search.rb66
-rw-r--r--ext/tk/sample/demos-jp/spin.rb58
-rw-r--r--ext/tk/sample/demos-jp/square12
-rw-r--r--ext/tk/sample/demos-jp/states.rb36
-rw-r--r--ext/tk/sample/demos-jp/style.rb218
-rw-r--r--ext/tk/sample/demos-jp/tcolor52
-rw-r--r--ext/tk/sample/demos-jp/text.rb104
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb40
-rw-r--r--ext/tk/sample/demos-jp/timer2
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb80
-rw-r--r--ext/tk/sample/demos-jp/tree.rb46
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb90
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb60
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb58
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb64
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb44
-rw-r--r--ext/tk/sample/demos-jp/twind.rb134
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb220
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb76
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb16
-rw-r--r--ext/tk/sample/demos-jp/widget461
-rw-r--r--ext/tk/sample/editable_listbox.rb135
-rw-r--r--ext/tk/sample/encstr_usage.rb4
-rw-r--r--ext/tk/sample/figmemo_sample.rb98
-rw-r--r--ext/tk/sample/irbtk.rb4
-rw-r--r--ext/tk/sample/irbtkw.rbw26
-rw-r--r--ext/tk/sample/menubar1.rb22
-rw-r--r--ext/tk/sample/menubar2.rb28
-rw-r--r--ext/tk/sample/menubar3.rb72
-rw-r--r--ext/tk/sample/msgs_rb/README4
-rw-r--r--ext/tk/sample/msgs_rb/es.msg2
-rw-r--r--ext/tk/sample/msgs_rb/ru.msg4
-rw-r--r--ext/tk/sample/msgs_rb2/README2
-rw-r--r--ext/tk/sample/msgs_rb2/ja.msg154
-rw-r--r--ext/tk/sample/msgs_tk/README4
-rw-r--r--ext/tk/sample/msgs_tk/el.msg2
-rw-r--r--ext/tk/sample/msgs_tk/es.msg2
-rw-r--r--ext/tk/sample/msgs_tk/license.terms2
-rw-r--r--ext/tk/sample/msgs_tk/ru.msg4
-rw-r--r--ext/tk/sample/multi-ip_sample.rb7
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb2
-rw-r--r--ext/tk/sample/optobj_sample.rb30
-rw-r--r--ext/tk/sample/propagate.rb2
-rw-r--r--ext/tk/sample/remote-ip_sample.rb10
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb20
-rw-r--r--ext/tk/sample/safe-tk.rb57
-rw-r--r--ext/tk/sample/scrollframe.rb30
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb12
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb304
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb118
-rw-r--r--ext/tk/sample/tkalignbox.rb102
-rw-r--r--ext/tk/sample/tkballoonhelp.rb118
-rw-r--r--ext/tk/sample/tkbiff.rb6
-rw-r--r--ext/tk/sample/tkbrowse.rb2
-rw-r--r--ext/tk/sample/tkcombobox.rb133
-rw-r--r--ext/tk/sample/tkdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb38
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb22
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb54
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb4056
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb10
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb36
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb2
-rw-r--r--ext/tk/sample/tkextlib/blt/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb8
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb2
-rw-r--r--ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt12
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb96
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb84
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb16
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb28
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb56
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb162
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb96
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt24
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb36
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb66
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb6
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb4
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb2
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb32
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb2
-rw-r--r--ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt8
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb4
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb22
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb8
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb20
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb2
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb174
-rw-r--r--ext/tk/sample/tkextlib/tile/readme.txt4
-rw-r--r--ext/tk/sample/tkextlib/tile/repeater.tcl10
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl8
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl28
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl2
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb108
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl38
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl2
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl2
-rw-r--r--ext/tk/sample/tkextlib/tile/toolbutton.tcl34
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/README6
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb48
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/index.html2
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/index.html48
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/index.html38
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/index.html2
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb82
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb10
-rw-r--r--ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension4
-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.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb12
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb22
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb16
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb14
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb16
-rw-r--r--[-rwxr-xr-x]ext/tk/sample/tkextlib/tktable/tcllogo.gifbin2341 -> 2341 bytes-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb12
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb32
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb342
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb126
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb106
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb30
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb26
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb100
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb52
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb102
-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb68
-rw-r--r--ext/tk/sample/tkextlib/treectrl/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb72
-rw-r--r--ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt4
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb68
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb4
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb4
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb62
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb16
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb10
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb14
-rw-r--r--ext/tk/sample/tkfrom.rb2
-rw-r--r--ext/tk/sample/tkhello.rb2
-rw-r--r--ext/tk/sample/tkmenubutton.rb56
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb16
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb22
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb114
-rw-r--r--ext/tk/sample/tkmultilistbox.rb96
-rw-r--r--ext/tk/sample/tkmultilistframe.rb168
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb30
-rw-r--r--ext/tk/sample/tkoptdb.rb34
-rw-r--r--ext/tk/sample/tkrttimer.rb12
-rw-r--r--ext/tk/sample/tktextframe.rb267
-rw-r--r--ext/tk/sample/tktextio.rb56
-rw-r--r--ext/tk/sample/tktimer2.rb8
-rw-r--r--ext/tk/sample/tktimer3.rb8
-rw-r--r--ext/tk/sample/tktree.rb26
-rw-r--r--ext/tk/sample/ttk_wrapper.rb12
-rw-r--r--ext/tk/stubs.c116
-rw-r--r--ext/tk/stubs.h10
-rw-r--r--ext/tk/tcltklib.c2894
-rw-r--r--ext/tk/tkutil/.cvsignore3
-rw-r--r--ext/tk/tkutil/extconf.rb12
-rw-r--r--ext/tk/tkutil/tkutil.c429
-rw-r--r--ext/win32/extconf.rb3
-rw-r--r--ext/win32/lib/Win32API.rb37
-rw-r--r--ext/win32/lib/win32/importer.rb8
-rw-r--r--ext/win32/lib/win32/registry.rb909
-rw-r--r--ext/win32/lib/win32/resolv.rb378
-rw-r--r--ext/win32/lib/win32/sspi.rb330
-rw-r--r--ext/win32ole/.cvsignore4
-rw-r--r--ext/win32ole/depend13
-rw-r--r--ext/win32ole/doc/win32ole.rd294
-rw-r--r--ext/win32ole/extconf.rb41
-rw-r--r--ext/win32ole/sample/excel1.rb16
-rw-r--r--ext/win32ole/sample/excel2.rb20
-rw-r--r--ext/win32ole/sample/excel3.rb7
-rw-r--r--ext/win32ole/sample/ieconst.rb2
-rw-r--r--ext/win32ole/sample/ienavi.rb2
-rw-r--r--ext/win32ole/sample/ienavi2.rb40
-rw-r--r--ext/win32ole/sample/oledirs.rb2
-rw-r--r--ext/win32ole/sample/olegen.rb33
-rw-r--r--ext/win32ole/sample/xml.rb36
-rw-r--r--ext/win32ole/tests/oleserver.rb10
-rw-r--r--ext/win32ole/tests/testNIL2VTEMPTY.rb28
-rw-r--r--ext/win32ole/tests/testOLEMETHOD.rb92
-rw-r--r--ext/win32ole/tests/testOLEPARAM.rb65
-rw-r--r--ext/win32ole/tests/testOLETYPE.rb96
-rw-r--r--ext/win32ole/tests/testOLEVARIABLE.rb49
-rw-r--r--ext/win32ole/tests/testVARIANT.rb32
-rw-r--r--ext/win32ole/tests/testWIN32OLE.rb373
-rw-r--r--ext/win32ole/tests/test_ole_methods.rb36
-rw-r--r--ext/win32ole/tests/test_propertyputref.rb19
-rw-r--r--ext/win32ole/tests/test_win32ole_event.rb133
-rw-r--r--ext/win32ole/tests/test_word.rb37
-rw-r--r--ext/win32ole/tests/testall.rb16
-rw-r--r--ext/win32ole/win32ole.c6258
-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.c1275
-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.c846
-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.c734
-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/.cvsignore3
-rw-r--r--ext/zlib/depend5
-rw-r--r--ext/zlib/doc/zlib.rd911
-rw-r--r--ext/zlib/extconf.rb13
-rw-r--r--ext/zlib/zlib.c2961
-rw-r--r--file.c4474
-rw-r--r--gc.c9711
-rw-r--r--gc.h107
-rw-r--r--gem_prelude.rb1
-rw-r--r--gems/bundled_gems3
-rw-r--r--golf_prelude.rb123
-rw-r--r--goruby.c60
-rw-r--r--hash.c3367
-rw-r--r--ia64.s11
-rw-r--r--include/ruby.h35
-rw-r--r--include/ruby/backward/classext.h18
-rw-r--r--include/ruby/backward/rubyio.h6
-rw-r--r--include/ruby/backward/rubysig.h47
-rw-r--r--include/ruby/backward/st.h6
-rw-r--r--include/ruby/backward/util.h6
-rw-r--r--include/ruby/debug.h110
-rw-r--r--include/ruby/defines.h289
-rw-r--r--include/ruby/encoding.h359
-rw-r--r--include/ruby/intern.h990
-rw-r--r--include/ruby/io.h182
-rw-r--r--include/ruby/missing.h258
-rw-r--r--include/ruby/oniguruma.h841
-rw-r--r--include/ruby/re.h72
-rw-r--r--include/ruby/regex.h46
-rw-r--r--include/ruby/ruby.h1905
-rw-r--r--include/ruby/st.h157
-rw-r--r--include/ruby/subst.h19
-rw-r--r--include/ruby/thread.h45
-rw-r--r--include/ruby/thread_native.h56
-rw-r--r--include/ruby/util.h102
-rw-r--r--include/ruby/version.h74
-rw-r--r--include/ruby/vm.h64
-rw-r--r--include/ruby/win32.h843
-rw-r--r--inits.c121
-rw-r--r--insns.def2251
-rwxr-xr-xinstruby.rb411
-rw-r--r--intern.h531
-rw-r--r--internal.h1197
-rw-r--r--io.c12423
-rw-r--r--iseq.c2371
-rw-r--r--iseq.h158
-rw-r--r--keywords42
-rw-r--r--lex.c136
-rw-r--r--lex.c.blt219
-rw-r--r--lib/.document106
-rw-r--r--lib/English.rb56
-rw-r--r--lib/Env.rb18
-rw-r--r--lib/README96
-rw-r--r--lib/abbrev.rb134
-rw-r--r--lib/base64.rb142
-rw-r--r--lib/benchmark.rb465
-rw-r--r--lib/cgi-lib.rb272
-rw-r--r--lib/cgi.rb2215
-rw-r--r--lib/cgi/.document2
-rw-r--r--lib/cgi/cookie.rb170
-rw-r--r--lib/cgi/core.rb880
-rw-r--r--lib/cgi/html.rb1034
-rw-r--r--lib/cgi/session.rb251
-rw-r--r--lib/cgi/session/pstore.rb71
-rw-r--r--lib/cgi/util.rb194
-rw-r--r--lib/cmath.rb442
-rw-r--r--lib/complex.rb663
-rw-r--r--lib/csv.rb3043
-rw-r--r--lib/date.rb1778
-rw-r--r--lib/date/format.rb1190
-rw-r--r--lib/date2.rb5
-rw-r--r--lib/debug.rb1706
-rw-r--r--lib/delegate.rb552
-rw-r--r--lib/drb/acl.rb166
-rw-r--r--lib/drb/drb.rb692
-rw-r--r--lib/drb/eq.rb4
-rw-r--r--lib/drb/extserv.rb49
-rw-r--r--lib/drb/extservm.rb30
-rw-r--r--lib/drb/gw.rb42
-rw-r--r--lib/drb/invokemethod.rb14
-rw-r--r--lib/drb/observer.rb23
-rw-r--r--lib/drb/ssl.rb341
-rw-r--r--lib/drb/timeridconv.rb106
-rw-r--r--lib/drb/unix.rb61
-rw-r--r--lib/e2mmap.rb129
-rw-r--r--lib/erb.rb630
-rw-r--r--lib/eregex.rb37
-rw-r--r--lib/fileutils.rb697
-rw-r--r--lib/finalize.rb193
-rw-r--r--lib/find.rb63
-rw-r--r--lib/forwardable.rb313
-rw-r--r--lib/ftools.rb261
-rw-r--r--lib/generator.rb418
-rw-r--r--lib/getoptlong.rb297
-rw-r--r--lib/getopts.rb127
-rw-r--r--lib/gserver.rb253
-rw-r--r--lib/importenv.rb33
-rw-r--r--lib/ipaddr.rb558
-rw-r--r--lib/irb.rb687
-rw-r--r--lib/irb/cmd/chws.rb16
-rw-r--r--lib/irb/cmd/fork.rb41
-rw-r--r--lib/irb/cmd/help.rb25
-rw-r--r--lib/irb/cmd/load.rb61
-rw-r--r--lib/irb/cmd/nop.rb23
-rw-r--r--lib/irb/cmd/pushws.rb19
-rw-r--r--lib/irb/cmd/subirb.rb19
-rw-r--r--lib/irb/completion.rb336
-rw-r--r--lib/irb/context.rb324
-rw-r--r--lib/irb/ext/change-ws.rb57
-rw-r--r--lib/irb/ext/history.rb84
-rw-r--r--lib/irb/ext/loader.rb144
-rw-r--r--lib/irb/ext/math-mode.rb28
-rw-r--r--lib/irb/ext/multi-irb.rb242
-rw-r--r--lib/irb/ext/save-history.rb94
-rw-r--r--lib/irb/ext/tracer.rb46
-rw-r--r--lib/irb/ext/use-loader.rb46
-rw-r--r--lib/irb/ext/workspaces.rb46
-rw-r--r--lib/irb/extend-command.rb302
-rw-r--r--lib/irb/frame.rb25
-rw-r--r--lib/irb/help.rb33
-rw-r--r--lib/irb/init.rb253
-rw-r--r--lib/irb/input-method.rb141
-rw-r--r--lib/irb/inspector.rb131
-rw-r--r--lib/irb/lc/.document4
-rw-r--r--lib/irb/lc/error.rb13
-rw-r--r--lib/irb/lc/help-message43
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb10
-rw-r--r--lib/irb/lc/ja/error.rb33
-rw-r--r--lib/irb/lc/ja/help-message71
-rw-r--r--lib/irb/locale.rb191
-rw-r--r--lib/irb/magic-file.rb37
-rw-r--r--lib/irb/notifier.rb192
-rw-r--r--lib/irb/output-method.rb74
-rw-r--r--lib/irb/ruby-lex.rb815
-rw-r--r--lib/irb/ruby-token.rb57
-rw-r--r--lib/irb/slex.rb308
-rw-r--r--lib/irb/src_encoding.rb4
-rw-r--r--lib/irb/version.rb11
-rw-r--r--lib/irb/workspace.rb133
-rw-r--r--lib/irb/ws-for-case-2.rb9
-rw-r--r--lib/irb/xmp.rb115
-rw-r--r--lib/jcode.rb220
-rw-r--r--lib/logger.rb548
-rw-r--r--lib/mailread.rb62
-rw-r--r--lib/mathn.rb379
-rw-r--r--lib/matrix.rb2041
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb882
-rw-r--r--lib/matrix/lup_decomposition.rb218
-rw-r--r--lib/mkmf.rb3826
-rw-r--r--lib/monitor.rb362
-rw-r--r--lib/mutex_m.rb129
-rw-r--r--lib/net/ftp.rb932
-rw-r--r--lib/net/http.rb2644
-rw-r--r--lib/net/http/backward.rb25
-rw-r--r--lib/net/http/exceptions.rb25
-rw-r--r--lib/net/http/generic_request.rb337
-rw-r--r--lib/net/http/header.rb452
-rw-r--r--lib/net/http/proxy_delta.rb16
-rw-r--r--lib/net/http/request.rb20
-rw-r--r--lib/net/http/requests.rb122
-rw-r--r--lib/net/http/response.rb416
-rw-r--r--lib/net/http/responses.rb273
-rw-r--r--lib/net/https.rb163
-rw-r--r--lib/net/imap.rb1587
-rw-r--r--lib/net/pop.rb166
-rw-r--r--lib/net/protocol.rb72
-rw-r--r--lib/net/smtp.rb257
-rw-r--r--lib/net/telnet.rb251
-rw-r--r--lib/observer.rb107
-rw-r--r--lib/open-uri.rb453
-rw-r--r--lib/open3.rb684
-rw-r--r--lib/optionparser.rb1
-rw-r--r--lib/optparse.rb445
-rw-r--r--lib/optparse/ac.rb50
-rw-r--r--lib/optparse/version.rb12
-rw-r--r--lib/ostruct.rb207
-rw-r--r--lib/parsearg.rb87
-rw-r--r--lib/parsedate.rb53
-rw-r--r--lib/pathname.rb1076
-rw-r--r--lib/ping.rb64
-rw-r--r--lib/pp.rb478
-rw-r--r--lib/prettyprint.rb772
-rw-r--r--lib/prime.rb487
-rw-r--r--lib/profile.rb4
-rw-r--r--lib/profiler.rb157
-rw-r--r--lib/pstore.rb389
-rw-r--r--lib/racc/parser.rb288
-rw-r--r--lib/racc/rdoc/grammar.en.rdoc219
-rw-r--r--lib/rake.rb79
-rw-r--r--lib/rake/alt_system.rb110
-rw-r--r--lib/rake/application.rb790
-rw-r--r--lib/rake/backtrace.rb23
-rw-r--r--lib/rake/clean.rb76
-rw-r--r--lib/rake/cloneable.rb16
-rw-r--r--lib/rake/contrib/.document1
-rw-r--r--lib/rake/contrib/compositepublisher.rb21
-rw-r--r--lib/rake/contrib/ftptools.rb137
-rw-r--r--lib/rake/contrib/publisher.rb81
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb18
-rw-r--r--lib/rake/contrib/sshpublisher.rb61
-rw-r--r--lib/rake/contrib/sys.rb4
-rw-r--r--lib/rake/cpu_counter.rb125
-rw-r--r--lib/rake/default_loader.rb14
-rw-r--r--lib/rake/dsl_definition.rb201
-rw-r--r--lib/rake/early_time.rb21
-rw-r--r--lib/rake/ext/core.rb25
-rw-r--r--lib/rake/ext/module.rb2
-rw-r--r--lib/rake/ext/pathname.rb25
-rw-r--r--lib/rake/ext/string.rb173
-rw-r--r--lib/rake/ext/time.rb16
-rw-r--r--lib/rake/file_creation_task.rb24
-rw-r--r--lib/rake/file_list.rb428
-rw-r--r--lib/rake/file_task.rb46
-rw-r--r--lib/rake/file_utils.rb128
-rw-r--r--lib/rake/file_utils_ext.rb144
-rw-r--r--lib/rake/gempackagetask.rb4
-rw-r--r--lib/rake/invocation_chain.rb56
-rw-r--r--lib/rake/invocation_exception_mixin.rb16
-rw-r--r--lib/rake/late_time.rb17
-rw-r--r--lib/rake/linked_list.rb103
-rw-r--r--lib/rake/loaders/makefile.rb40
-rw-r--r--lib/rake/multi_task.rb13
-rw-r--r--lib/rake/name_space.rb38
-rw-r--r--lib/rake/packagetask.rb199
-rw-r--r--lib/rake/pathmap.rb3
-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.rb29
-rw-r--r--lib/rake/rake_module.rb38
-rw-r--r--lib/rake/rake_test_loader.rb22
-rw-r--r--lib/rake/rdoctask.rb4
-rw-r--r--lib/rake/ruby182_test_unit_fix.rb29
-rw-r--r--lib/rake/rule_recursion_overflow_error.rb20
-rw-r--r--lib/rake/runtest.rb27
-rw-r--r--lib/rake/scope.rb42
-rw-r--r--lib/rake/task.rb383
-rw-r--r--lib/rake/task_argument_error.rb7
-rw-r--r--lib/rake/task_arguments.rb98
-rw-r--r--lib/rake/task_manager.rb310
-rw-r--r--lib/rake/tasklib.rb24
-rw-r--r--lib/rake/testtask.rb212
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb164
-rw-r--r--lib/rake/trace_output.rb22
-rw-r--r--lib/rake/version.rb7
-rw-r--r--lib/rake/win32.rb56
-rw-r--r--lib/rational.rb564
-rw-r--r--lib/rbconfig/.document1
-rw-r--r--lib/rbconfig/datadir.rb13
-rw-r--r--lib/rdoc.rb185
-rw-r--r--lib/rdoc/README489
-rw-r--r--lib/rdoc/alias.rb111
-rw-r--r--lib/rdoc/anon_class.rb10
-rw-r--r--lib/rdoc/any_method.rb316
-rw-r--r--lib/rdoc/attr.rb175
-rw-r--r--lib/rdoc/class_module.rb799
-rw-r--r--lib/rdoc/code_object.rb429
-rw-r--r--lib/rdoc/code_objects.rb766
-rw-r--r--lib/rdoc/comment.rb229
-rw-r--r--lib/rdoc/constant.rb186
-rw-r--r--lib/rdoc/context.rb1211
-rw-r--r--lib/rdoc/context/section.rb238
-rw-r--r--lib/rdoc/cross_reference.rb183
-rw-r--r--lib/rdoc/diagram.rb335
-rw-r--r--lib/rdoc/dot/dot.rb255
-rw-r--r--lib/rdoc/encoding.rb99
-rw-r--r--lib/rdoc/erb_partial.rb18
-rw-r--r--lib/rdoc/erbio.rb37
-rw-r--r--lib/rdoc/extend.rb9
-rw-r--r--lib/rdoc/generator.rb51
-rw-r--r--lib/rdoc/generator/darkfish.rb760
-rw-r--r--lib/rdoc/generator/json_index.rb292
-rw-r--r--lib/rdoc/generator/markup.rb169
-rw-r--r--lib/rdoc/generator/pot.rb97
-rw-r--r--lib/rdoc/generator/pot/message_extractor.rb67
-rw-r--r--lib/rdoc/generator/pot/po.rb83
-rw-r--r--lib/rdoc/generator/pot/po_entry.rb140
-rw-r--r--lib/rdoc/generator/ri.rb30
-rw-r--r--lib/rdoc/generator/template/darkfish/.document (renamed from install-sh)0
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml5
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml19
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml19
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml15
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml15
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml15
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml11
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml11
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml14
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml11
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml174
-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.ttfbin0 -> 94668 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttfbin0 -> 94196 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttfbin0 -> 96184 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttfbin0 -> 95316 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttfbin0 -> 71200 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttfbin0 -> 71692 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/add.pngbin0 -> 733 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/arrow_up.pngbin0 -> 372 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/brick.pngbin0 -> 452 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/brick_link.pngbin0 -> 764 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bug.pngbin0 -> 774 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_black.pngbin0 -> 211 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.pngbin0 -> 207 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.pngbin0 -> 209 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/date.pngbin0 -> 626 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/delete.pngbin0 -> 715 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/find.pngbin0 -> 659 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/loadingAnimation.gifbin0 -> 5886 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/macFFBgHack.pngbin0 -> 207 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/package.pngbin0 -> 853 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_green.pngbin0 -> 621 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_white_text.pngbin0 -> 342 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/page_white_width.pngbin0 -> 309 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/plugin.pngbin0 -> 591 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/ruby.pngbin0 -> 592 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/tag_blue.pngbin0 -> 1880 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/tag_green.pngbin0 -> 613 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/transparent.pngbin0 -> 97 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/wrench.pngbin0 -> 610 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/wrench_orange.pngbin0 -> 584 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/zoom.pngbin0 -> 692 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/index.rhtml23
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js161
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js4
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js109
-rw-r--r--lib/rdoc/generator/template/darkfish/page.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_root.rhtml63
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml58
-rw-r--r--lib/rdoc/generator/template/json_index/.document1
-rw-r--r--lib/rdoc/generator/template/json_index/js/navigation.js142
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js228
-rw-r--r--lib/rdoc/generators/chm_generator.rb112
-rw-r--r--lib/rdoc/generators/html_generator.rb1509
-rw-r--r--lib/rdoc/generators/ri_generator.rb268
-rw-r--r--lib/rdoc/generators/template/chm/chm.rb87
-rw-r--r--lib/rdoc/generators/template/html/hefss.rb418
-rw-r--r--lib/rdoc/generators/template/html/html.rb711
-rw-r--r--lib/rdoc/generators/template/html/kilmer.rb435
-rw-r--r--lib/rdoc/generators/template/html/old_html.rb728
-rw-r--r--lib/rdoc/generators/template/html/one_page_html.rb122
-rw-r--r--lib/rdoc/generators/template/xml/rdf.rb112
-rw-r--r--lib/rdoc/generators/template/xml/xml.rb112
-rw-r--r--lib/rdoc/generators/xml_generator.rb130
-rw-r--r--lib/rdoc/ghost_method.rb6
-rw-r--r--lib/rdoc/i18n.rb9
-rw-r--r--lib/rdoc/i18n/locale.rb101
-rw-r--r--lib/rdoc/i18n/text.rb125
-rw-r--r--lib/rdoc/include.rb9
-rw-r--r--lib/rdoc/known_classes.rb72
-rw-r--r--lib/rdoc/markdown.rb16133
-rw-r--r--lib/rdoc/markdown/entities.rb2131
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb420
-rw-r--r--lib/rdoc/markup.rb869
-rw-r--r--lib/rdoc/markup/.document2
-rw-r--r--lib/rdoc/markup/attr_changer.rb22
-rw-r--r--lib/rdoc/markup/attr_span.rb29
-rw-r--r--lib/rdoc/markup/attribute_manager.rb343
-rw-r--r--lib/rdoc/markup/attributes.rb70
-rw-r--r--lib/rdoc/markup/blank_line.rb27
-rw-r--r--lib/rdoc/markup/block_quote.rb14
-rw-r--r--lib/rdoc/markup/document.rb164
-rw-r--r--lib/rdoc/markup/formatter.rb264
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb767
-rw-r--r--lib/rdoc/markup/hard_break.rb31
-rw-r--r--lib/rdoc/markup/heading.rb78
-rw-r--r--lib/rdoc/markup/include.rb42
-rw-r--r--lib/rdoc/markup/indented_paragraph.rb47
-rw-r--r--lib/rdoc/markup/inline.rb1
-rw-r--r--lib/rdoc/markup/list.rb101
-rw-r--r--lib/rdoc/markup/list_item.rb99
-rw-r--r--lib/rdoc/markup/paragraph.rb28
-rw-r--r--lib/rdoc/markup/parser.rb558
-rw-r--r--lib/rdoc/markup/pre_process.rb293
-rw-r--r--lib/rdoc/markup/raw.rb69
-rw-r--r--lib/rdoc/markup/rule.rb20
-rw-r--r--lib/rdoc/markup/sample/rdoc2latex.rb16
-rw-r--r--lib/rdoc/markup/sample/sample.rb42
-rw-r--r--lib/rdoc/markup/simple_markup.rb476
-rw-r--r--lib/rdoc/markup/simple_markup/fragments.rb328
-rw-r--r--lib/rdoc/markup/simple_markup/inline.rb340
-rw-r--r--lib/rdoc/markup/simple_markup/lines.rb151
-rw-r--r--lib/rdoc/markup/simple_markup/preprocess.rb73
-rw-r--r--lib/rdoc/markup/simple_markup/to_flow.rb188
-rw-r--r--lib/rdoc/markup/simple_markup/to_html.rb289
-rw-r--r--lib/rdoc/markup/simple_markup/to_latex.rb333
-rw-r--r--lib/rdoc/markup/special.rb40
-rw-r--r--lib/rdoc/markup/test/AllTests.rb2
-rw-r--r--lib/rdoc/markup/test/TestInline.rb154
-rw-r--r--lib/rdoc/markup/test/TestParse.rb503
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb114
-rw-r--r--lib/rdoc/markup/to_ansi.rb93
-rw-r--r--lib/rdoc/markup/to_bs.rb78
-rw-r--r--lib/rdoc/markup/to_html.rb398
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb160
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb284
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb71
-rw-r--r--lib/rdoc/markup/to_label.rb74
-rw-r--r--lib/rdoc/markup/to_markdown.rb191
-rw-r--r--lib/rdoc/markup/to_rdoc.rb333
-rw-r--r--lib/rdoc/markup/to_table_of_contents.rb87
-rw-r--r--lib/rdoc/markup/to_test.rb69
-rw-r--r--lib/rdoc/markup/to_tt_only.rb120
-rw-r--r--lib/rdoc/markup/verbatim.rb83
-rw-r--r--lib/rdoc/meta_method.rb6
-rw-r--r--lib/rdoc/method_attr.rb418
-rw-r--r--lib/rdoc/mixin.rb120
-rw-r--r--lib/rdoc/normal_class.rb92
-rw-r--r--lib/rdoc/normal_module.rb73
-rw-r--r--lib/rdoc/options.rb1661
-rw-r--r--lib/rdoc/parser.rb310
-rw-r--r--lib/rdoc/parser/c.rb1229
-rw-r--r--lib/rdoc/parser/changelog.rb198
-rw-r--r--lib/rdoc/parser/markdown.rb23
-rw-r--r--lib/rdoc/parser/rd.rb22
-rw-r--r--lib/rdoc/parser/ruby.rb2160
-rw-r--r--lib/rdoc/parser/ruby_tools.rb167
-rw-r--r--lib/rdoc/parser/simple.rb61
-rw-r--r--lib/rdoc/parser/text.rb11
-rw-r--r--lib/rdoc/parsers/parse_c.rb773
-rw-r--r--lib/rdoc/parsers/parse_f95.rb1841
-rw-r--r--lib/rdoc/parsers/parse_rb.rb2609
-rw-r--r--lib/rdoc/parsers/parse_simple.rb41
-rw-r--r--lib/rdoc/parsers/parserfactory.rb99
-rw-r--r--lib/rdoc/rd.rb99
-rw-r--r--lib/rdoc/rd/block_parser.rb1055
-rw-r--r--lib/rdoc/rd/inline.rb71
-rw-r--r--lib/rdoc/rd/inline_parser.rb1207
-rw-r--r--lib/rdoc/rdoc.rb726
-rw-r--r--lib/rdoc/require.rb51
-rw-r--r--lib/rdoc/ri.rb20
-rw-r--r--lib/rdoc/ri/driver.rb1497
-rw-r--r--lib/rdoc/ri/formatter.rb5
-rw-r--r--lib/rdoc/ri/paths.rb187
-rw-r--r--lib/rdoc/ri/ri_cache.rb187
-rw-r--r--lib/rdoc/ri/ri_descriptions.rb154
-rw-r--r--lib/rdoc/ri/ri_display.rb255
-rw-r--r--lib/rdoc/ri/ri_driver.rb143
-rw-r--r--lib/rdoc/ri/ri_formatter.rb672
-rw-r--r--lib/rdoc/ri/ri_options.rb319
-rw-r--r--lib/rdoc/ri/ri_paths.rb101
-rw-r--r--lib/rdoc/ri/ri_reader.rb100
-rw-r--r--lib/rdoc/ri/ri_util.rb75
-rw-r--r--lib/rdoc/ri/ri_writer.rb62
-rw-r--r--lib/rdoc/ri/store.rb6
-rw-r--r--lib/rdoc/ri/task.rb71
-rw-r--r--lib/rdoc/ruby_lex.rb1377
-rw-r--r--lib/rdoc/ruby_token.rb460
-rw-r--r--lib/rdoc/rubygems_hook.rb253
-rw-r--r--lib/rdoc/servlet.rb441
-rw-r--r--lib/rdoc/single_class.rb25
-rw-r--r--lib/rdoc/stats.rb461
-rw-r--r--lib/rdoc/stats/normal.rb59
-rw-r--r--lib/rdoc/stats/quiet.rb59
-rw-r--r--lib/rdoc/stats/verbose.rb45
-rw-r--r--lib/rdoc/store.rb979
-rw-r--r--lib/rdoc/task.rb330
-rw-r--r--lib/rdoc/template.rb234
-rw-r--r--lib/rdoc/test_case.rb217
-rw-r--r--lib/rdoc/text.rb324
-rw-r--r--lib/rdoc/token_stream.rb95
-rw-r--r--lib/rdoc/tokenstream.rb25
-rw-r--r--lib/rdoc/tom_doc.rb257
-rw-r--r--lib/rdoc/top_level.rb282
-rw-r--r--lib/rdoc/usage.rb210
-rw-r--r--lib/readbytes.rb41
-rw-r--r--lib/resolv-replace.rb21
-rw-r--r--lib/resolv.rb838
-rw-r--r--lib/rexml/attlistdecl.rb112
-rw-r--r--lib/rexml/attribute.rb304
-rw-r--r--lib/rexml/cdata.rb96
-rw-r--r--lib/rexml/child.rb164
-rw-r--r--lib/rexml/comment.rb117
-rw-r--r--lib/rexml/doctype.rb46
-rw-r--r--lib/rexml/document.rb320
-rw-r--r--lib/rexml/dtd/attlistdecl.rb14
-rw-r--r--lib/rexml/dtd/dtd.rb77
-rw-r--r--lib/rexml/dtd/elementdecl.rb26
-rw-r--r--lib/rexml/dtd/entitydecl.rb98
-rw-r--r--lib/rexml/dtd/notationdecl.rb64
-rw-r--r--lib/rexml/element.rb235
-rw-r--r--lib/rexml/encoding.rb95
-rw-r--r--lib/rexml/encodings/CP-1252.rb103
-rw-r--r--lib/rexml/encodings/EUC-JP.rb35
-rw-r--r--lib/rexml/encodings/ICONV.rb22
-rw-r--r--lib/rexml/encodings/ISO-8859-1.rb7
-rw-r--r--lib/rexml/encodings/ISO-8859-15.rb72
-rw-r--r--lib/rexml/encodings/SHIFT-JIS.rb37
-rw-r--r--lib/rexml/encodings/SHIFT_JIS.rb1
-rw-r--r--lib/rexml/encodings/UNILE.rb34
-rw-r--r--lib/rexml/encodings/US-ASCII.rb30
-rw-r--r--lib/rexml/encodings/UTF-16.rb35
-rw-r--r--lib/rexml/encodings/UTF-8.rb18
-rw-r--r--lib/rexml/entity.rb295
-rw-r--r--lib/rexml/formatters/default.rb10
-rw-r--r--lib/rexml/formatters/pretty.rb19
-rw-r--r--lib/rexml/formatters/transitive.rb7
-rw-r--r--lib/rexml/functions.rb56
-rw-r--r--lib/rexml/instruction.rb98
-rw-r--r--lib/rexml/light/node.rb381
-rw-r--r--lib/rexml/namespace.rb78
-rw-r--r--lib/rexml/node.rb76
-rw-r--r--lib/rexml/output.rb29
-rw-r--r--lib/rexml/parent.rb53
-rw-r--r--lib/rexml/parseexception.rb8
-rw-r--r--lib/rexml/parsers/baseparser.rb151
-rw-r--r--lib/rexml/parsers/lightparser.rb84
-rw-r--r--lib/rexml/parsers/pullparser.rb2
-rw-r--r--lib/rexml/parsers/sax2parser.rb432
-rw-r--r--lib/rexml/parsers/streamparser.rb10
-rw-r--r--lib/rexml/parsers/treeparser.rb15
-rw-r--r--lib/rexml/parsers/ultralightparser.rb80
-rw-r--r--lib/rexml/parsers/xpathparser.rb144
-rw-r--r--lib/rexml/quickpath.rb495
-rw-r--r--lib/rexml/rexml.rb19
-rw-r--r--lib/rexml/sax2listener.rb184
-rw-r--r--lib/rexml/security.rb27
-rw-r--r--lib/rexml/source.rb145
-rw-r--r--lib/rexml/streamlistener.rb180
-rw-r--r--lib/rexml/syncenumerator.rb7
-rw-r--r--lib/rexml/text.rb233
-rw-r--r--lib/rexml/validation/relaxng.rb57
-rw-r--r--lib/rexml/validation/validation.rb22
-rw-r--r--lib/rexml/xmldecl.rb122
-rw-r--r--lib/rexml/xmltokens.rb94
-rw-r--r--lib/rexml/xpath.rb120
-rw-r--r--lib/rexml/xpath_parser.rb183
-rw-r--r--lib/rinda/rinda.rb68
-rw-r--r--lib/rinda/ring.rb353
-rw-r--r--lib/rinda/tuplespace.rb28
-rw-r--r--lib/rss.rb80
-rw-r--r--lib/rss/0.9.rb73
-rw-r--r--lib/rss/1.0.rb80
-rw-r--r--lib/rss/2.0.rb37
-rw-r--r--lib/rss/atom.rb98
-rw-r--r--lib/rss/content.rb2
-rw-r--r--lib/rss/content/1.0.rb1
-rw-r--r--lib/rss/content/2.0.rb1
-rw-r--r--lib/rss/converter.rb36
-rw-r--r--lib/rss/dublincore.rb18
-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.rb22
-rw-r--r--lib/rss/itunes.rb2
-rw-r--r--lib/rss/maker.rb46
-rw-r--r--lib/rss/maker/0.9.rb87
-rw-r--r--lib/rss/maker/1.0.rb13
-rw-r--r--lib/rss/maker/2.0.rb22
-rw-r--r--lib/rss/maker/base.rb162
-rw-r--r--lib/rss/maker/dublincore.rb5
-rw-r--r--lib/rss/maker/entry.rb6
-rw-r--r--lib/rss/maker/feed.rb9
-rw-r--r--lib/rss/maker/image.rb6
-rw-r--r--lib/rss/maker/itunes.rb2
-rw-r--r--lib/rss/maker/taxonomy.rb8
-rw-r--r--lib/rss/maker/trackback.rb2
-rw-r--r--lib/rss/parser.rb81
-rw-r--r--lib/rss/rexmlparser.rb15
-rw-r--r--lib/rss/rss.rb96
-rw-r--r--lib/rss/slash.rb2
-rw-r--r--lib/rss/syndication.rb9
-rw-r--r--lib/rss/taxonomy.rb22
-rw-r--r--lib/rss/trackback.rb40
-rw-r--r--lib/rss/utils.rb96
-rw-r--r--lib/rss/xml-stylesheet.rb4
-rw-r--r--lib/rss/xmlparser.rb17
-rw-r--r--lib/rss/xmlscanner.rb10
-rw-r--r--lib/rubygems.rb1245
-rw-r--r--lib/rubygems/LICENSE.txt54
-rw-r--r--lib/rubygems/available_set.rb164
-rw-r--r--lib/rubygems/basic_specification.rb290
-rw-r--r--lib/rubygems/command.rb582
-rw-r--r--lib/rubygems/command_manager.rb218
-rw-r--r--lib/rubygems/commands/build_command.rb60
-rw-r--r--lib/rubygems/commands/cert_command.rb276
-rw-r--r--lib/rubygems/commands/check_command.rb93
-rw-r--r--lib/rubygems/commands/cleanup_command.rb165
-rw-r--r--lib/rubygems/commands/contents_command.rb190
-rw-r--r--lib/rubygems/commands/dependency_command.rb207
-rw-r--r--lib/rubygems/commands/environment_command.rb158
-rw-r--r--lib/rubygems/commands/fetch_command.rb77
-rw-r--r--lib/rubygems/commands/generate_index_command.rb84
-rw-r--r--lib/rubygems/commands/help_command.rb384
-rw-r--r--lib/rubygems/commands/install_command.rb347
-rw-r--r--lib/rubygems/commands/list_command.rb40
-rw-r--r--lib/rubygems/commands/lock_command.rb110
-rw-r--r--lib/rubygems/commands/mirror_command.rb25
-rw-r--r--lib/rubygems/commands/open_command.rb74
-rw-r--r--lib/rubygems/commands/outdated_command.rb32
-rw-r--r--lib/rubygems/commands/owner_command.rb99
-rw-r--r--lib/rubygems/commands/pristine_command.rb165
-rw-r--r--lib/rubygems/commands/push_command.rb98
-rw-r--r--lib/rubygems/commands/query_command.rb343
-rw-r--r--lib/rubygems/commands/rdoc_command.rb96
-rw-r--r--lib/rubygems/commands/search_command.rb40
-rw-r--r--lib/rubygems/commands/server_command.rb86
-rw-r--r--lib/rubygems/commands/setup_command.rb483
-rw-r--r--lib/rubygems/commands/sources_command.rb210
-rw-r--r--lib/rubygems/commands/specification_command.rb145
-rw-r--r--lib/rubygems/commands/stale_command.rb38
-rw-r--r--lib/rubygems/commands/uninstall_command.rb164
-rw-r--r--lib/rubygems/commands/unpack_command.rb182
-rw-r--r--lib/rubygems/commands/update_command.rb277
-rw-r--r--lib/rubygems/commands/which_command.rb90
-rw-r--r--lib/rubygems/commands/yank_command.rb107
-rw-r--r--lib/rubygems/compatibility.rb59
-rw-r--r--lib/rubygems/config_file.rb483
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb73
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb139
-rw-r--r--lib/rubygems/defaults.rb177
-rw-r--r--lib/rubygems/dependency.rb334
-rw-r--r--lib/rubygems/dependency_installer.rb480
-rw-r--r--lib/rubygems/dependency_list.rb240
-rw-r--r--lib/rubygems/deprecate.rb70
-rw-r--r--lib/rubygems/doctor.rb131
-rw-r--r--lib/rubygems/errors.rb137
-rw-r--r--lib/rubygems/exceptions.rb270
-rw-r--r--lib/rubygems/ext.rb18
-rw-r--r--lib/rubygems/ext/build_error.rb6
-rw-r--r--lib/rubygems/ext/builder.rb218
-rw-r--r--lib/rubygems/ext/cmake_builder.rb16
-rw-r--r--lib/rubygems/ext/configure_builder.rb23
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb78
-rw-r--r--lib/rubygems/ext/rake_builder.rb36
-rw-r--r--lib/rubygems/gem_runner.rb81
-rw-r--r--lib/rubygems/gemcutter_utilities.rb154
-rw-r--r--lib/rubygems/indexer.rb498
-rw-r--r--lib/rubygems/install_default_message.rb12
-rw-r--r--lib/rubygems/install_message.rb12
-rw-r--r--lib/rubygems/install_update_options.rb186
-rw-r--r--lib/rubygems/installer.rb819
-rw-r--r--lib/rubygems/installer_test_case.rb193
-rw-r--r--lib/rubygems/local_remote_options.rb148
-rw-r--r--lib/rubygems/mock_gem_ui.rb88
-rw-r--r--lib/rubygems/name_tuple.rb123
-rw-r--r--lib/rubygems/package.rb614
-rw-r--r--lib/rubygems/package/digest_io.rb64
-rw-r--r--lib/rubygems/package/file_source.rb33
-rw-r--r--lib/rubygems/package/io_source.rb45
-rw-r--r--lib/rubygems/package/old.rb178
-rw-r--r--lib/rubygems/package/source.rb3
-rw-r--r--lib/rubygems/package/tar_header.rb229
-rw-r--r--lib/rubygems/package/tar_reader.rb123
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb147
-rw-r--r--lib/rubygems/package/tar_test_case.rb137
-rw-r--r--lib/rubygems/package/tar_writer.rb326
-rw-r--r--lib/rubygems/package_task.rb128
-rw-r--r--lib/rubygems/path_support.rb87
-rw-r--r--lib/rubygems/platform.rb204
-rw-r--r--lib/rubygems/psych_additions.rb9
-rw-r--r--lib/rubygems/psych_tree.rb31
-rw-r--r--lib/rubygems/rdoc.rb335
-rw-r--r--lib/rubygems/remote_fetcher.rb404
-rw-r--r--lib/rubygems/request.rb244
-rw-r--r--lib/rubygems/request/connection_pools.rb83
-rw-r--r--lib/rubygems/request/http_pool.rb47
-rw-r--r--lib/rubygems/request/https_pool.rb10
-rw-r--r--lib/rubygems/request_set.rb413
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb801
-rw-r--r--lib/rubygems/request_set/lockfile.rb650
-rw-r--r--lib/rubygems/requirement.rb273
-rw-r--r--lib/rubygems/resolver.rb485
-rw-r--r--lib/rubygems/resolver/activation_request.rb172
-rw-r--r--lib/rubygems/resolver/api_set.rb125
-rw-r--r--lib/rubygems/resolver/api_specification.rb85
-rw-r--r--lib/rubygems/resolver/best_set.rb78
-rw-r--r--lib/rubygems/resolver/composed_set.rb66
-rw-r--r--lib/rubygems/resolver/conflict.rb160
-rw-r--r--lib/rubygems/resolver/current_set.rb13
-rw-r--r--lib/rubygems/resolver/dependency_request.rb116
-rw-r--r--lib/rubygems/resolver/git_set.rb122
-rw-r--r--lib/rubygems/resolver/git_specification.rb59
-rw-r--r--lib/rubygems/resolver/index_set.rb80
-rw-r--r--lib/rubygems/resolver/index_specification.rb69
-rw-r--r--lib/rubygems/resolver/installed_specification.rb58
-rw-r--r--lib/rubygems/resolver/installer_set.rb224
-rw-r--r--lib/rubygems/resolver/local_specification.rb41
-rw-r--r--lib/rubygems/resolver/lock_set.rb84
-rw-r--r--lib/rubygems/resolver/lock_specification.rb84
-rw-r--r--lib/rubygems/resolver/requirement_list.rb81
-rw-r--r--lib/rubygems/resolver/set.rb56
-rw-r--r--lib/rubygems/resolver/spec_specification.rb56
-rw-r--r--lib/rubygems/resolver/specification.rb110
-rw-r--r--lib/rubygems/resolver/stats.rb44
-rw-r--r--lib/rubygems/resolver/vendor_set.rb87
-rw-r--r--lib/rubygems/resolver/vendor_specification.rb24
-rw-r--r--lib/rubygems/security.rb595
-rw-r--r--lib/rubygems/security/policies.rb115
-rw-r--r--lib/rubygems/security/policy.rb295
-rw-r--r--lib/rubygems/security/signer.rb154
-rw-r--r--lib/rubygems/security/trust_dir.rb118
-rw-r--r--lib/rubygems/server.rb868
-rw-r--r--lib/rubygems/source.rb234
-rw-r--r--lib/rubygems/source/git.rb240
-rw-r--r--lib/rubygems/source/installed.rb40
-rw-r--r--lib/rubygems/source/local.rb129
-rw-r--r--lib/rubygems/source/lock.rb48
-rw-r--r--lib/rubygems/source/specific_file.rb72
-rw-r--r--lib/rubygems/source/vendor.rb27
-rw-r--r--lib/rubygems/source_list.rb149
-rw-r--r--lib/rubygems/source_local.rb5
-rw-r--r--lib/rubygems/source_specific_file.rb4
-rw-r--r--lib/rubygems/spec_fetcher.rb269
-rw-r--r--lib/rubygems/specification.rb2800
-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.pem32
-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/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/stub_specification.rb196
-rw-r--r--lib/rubygems/syck_hack.rb76
-rw-r--r--lib/rubygems/test_case.rb1441
-rw-r--r--lib/rubygems/test_utilities.rb383
-rw-r--r--lib/rubygems/text.rb75
-rw-r--r--lib/rubygems/uninstaller.rb345
-rw-r--r--lib/rubygems/uri_formatter.rb49
-rw-r--r--lib/rubygems/user_interaction.rb711
-rw-r--r--lib/rubygems/util.rb134
-rw-r--r--lib/rubygems/util/list.rb48
-rw-r--r--lib/rubygems/util/stringio.rb34
-rw-r--r--lib/rubygems/validator.rb165
-rw-r--r--lib/rubygems/version.rb356
-rw-r--r--lib/rubygems/version_option.rb71
-rw-r--r--lib/rubyunit.rb6
-rw-r--r--lib/runit/assert.rb73
-rw-r--r--lib/runit/cui/testrunner.rb51
-rw-r--r--lib/runit/error.rb9
-rw-r--r--lib/runit/testcase.rb45
-rw-r--r--lib/runit/testresult.rb44
-rw-r--r--lib/runit/testsuite.rb26
-rw-r--r--lib/runit/topublic.rb8
-rw-r--r--lib/scanf.rb780
-rw-r--r--lib/securerandom.rb280
-rw-r--r--lib/set.rb1184
-rw-r--r--lib/shell.rb323
-rw-r--r--lib/shell/builtin-command.rb78
-rw-r--r--lib/shell/command-processor.rb726
-rw-r--r--lib/shell/error.rb11
-rw-r--r--lib/shell/filter.rb91
-rw-r--r--lib/shell/process-controller.rb344
-rw-r--r--lib/shell/system-command.rb148
-rw-r--r--lib/shell/version.rb15
-rw-r--r--lib/shellwords.rb173
-rw-r--r--lib/singleton.rb403
-rw-r--r--lib/soap/attachment.rb107
-rw-r--r--lib/soap/baseData.rb942
-rw-r--r--lib/soap/element.rb258
-rw-r--r--lib/soap/encodingstyle/aspDotNetHandler.rb213
-rw-r--r--lib/soap/encodingstyle/handler.rb100
-rw-r--r--lib/soap/encodingstyle/literalHandler.rb226
-rw-r--r--lib/soap/encodingstyle/soapHandler.rb582
-rw-r--r--lib/soap/generator.rb268
-rw-r--r--lib/soap/header/handler.rb57
-rw-r--r--lib/soap/header/handlerset.rb70
-rw-r--r--lib/soap/header/simplehandler.rb44
-rw-r--r--lib/soap/httpconfigloader.rb119
-rw-r--r--lib/soap/mapping.rb10
-rw-r--r--lib/soap/mapping/factory.rb355
-rw-r--r--lib/soap/mapping/mapping.rb381
-rw-r--r--lib/soap/mapping/registry.rb541
-rw-r--r--lib/soap/mapping/rubytypeFactory.rb475
-rw-r--r--lib/soap/mapping/typeMap.rb50
-rw-r--r--lib/soap/mapping/wsdlencodedregistry.rb280
-rw-r--r--lib/soap/mapping/wsdlliteralregistry.rb418
-rw-r--r--lib/soap/marshal.rb59
-rw-r--r--lib/soap/mimemessage.rb240
-rw-r--r--lib/soap/netHttpClient.rb190
-rw-r--r--lib/soap/parser.rb251
-rw-r--r--lib/soap/processor.rb66
-rw-r--r--lib/soap/property.rb333
-rw-r--r--lib/soap/rpc/cgistub.rb206
-rw-r--r--lib/soap/rpc/driver.rb254
-rw-r--r--lib/soap/rpc/element.rb325
-rw-r--r--lib/soap/rpc/httpserver.rb129
-rw-r--r--lib/soap/rpc/proxy.rb497
-rw-r--r--lib/soap/rpc/router.rb594
-rw-r--r--lib/soap/rpc/rpc.rb25
-rw-r--r--lib/soap/rpc/soaplet.rb162
-rw-r--r--lib/soap/rpc/standaloneServer.rb43
-rw-r--r--lib/soap/soap.rb140
-rw-r--r--lib/soap/streamHandler.rb229
-rw-r--r--lib/soap/wsdlDriver.rb575
-rw-r--r--lib/sync.rb342
-rw-r--r--lib/tempfile.rb408
-rw-r--r--lib/test/unit.rb280
-rw-r--r--lib/test/unit/assertionfailederror.rb14
-rw-r--r--lib/test/unit/assertions.rb622
-rw-r--r--lib/test/unit/autorunner.rb220
-rw-r--r--lib/test/unit/collector.rb43
-rw-r--r--lib/test/unit/collector/dir.rb107
-rw-r--r--lib/test/unit/collector/objectspace.rb34
-rw-r--r--lib/test/unit/error.rb56
-rw-r--r--lib/test/unit/failure.rb51
-rw-r--r--lib/test/unit/testcase.rb160
-rw-r--r--lib/test/unit/testresult.rb80
-rw-r--r--lib/test/unit/testsuite.rb76
-rw-r--r--lib/test/unit/ui/console/testrunner.rb127
-rw-r--r--lib/test/unit/ui/fox/testrunner.rb268
-rw-r--r--lib/test/unit/ui/gtk/testrunner.rb416
-rw-r--r--lib/test/unit/ui/gtk2/testrunner.rb465
-rw-r--r--lib/test/unit/ui/testrunnermediator.rb68
-rw-r--r--lib/test/unit/ui/testrunnerutilities.rb46
-rw-r--r--lib/test/unit/ui/tk/testrunner.rb260
-rw-r--r--lib/test/unit/util/backtracefilter.rb40
-rw-r--r--lib/test/unit/util/observable.rb90
-rw-r--r--lib/test/unit/util/procwrapper.rb48
-rw-r--r--lib/thread.rb479
-rw-r--r--lib/thwait.rb99
-rw-r--r--lib/time.rb805
-rw-r--r--lib/timeout.rb185
-rw-r--r--lib/tmpdir.rb130
-rw-r--r--lib/tracer.rb245
-rw-r--r--lib/tsort.rb316
-rw-r--r--lib/ubygems.rb10
-rw-r--r--lib/un.rb230
-rw-r--r--lib/unicode_normalize.rb78
-rw-r--r--lib/unicode_normalize/normalize.rb168
-rw-r--r--lib/unicode_normalize/tables.rb1163
-rw-r--r--lib/uri.rb94
-rw-r--r--lib/uri/common.rb805
-rw-r--r--lib/uri/ftp.rb120
-rw-r--r--lib/uri/generic.rb919
-rw-r--r--lib/uri/http.rb52
-rw-r--r--lib/uri/https.rb4
-rw-r--r--lib/uri/ldap.rb78
-rw-r--r--lib/uri/ldaps.rb8
-rw-r--r--lib/uri/mailto.rb177
-rw-r--r--lib/uri/rfc2396_parser.rb543
-rw-r--r--lib/uri/rfc3986_parser.rb124
-rw-r--r--lib/weakref.rb166
-rw-r--r--lib/webrick.rb201
-rw-r--r--lib/webrick/accesslog.rb101
-rw-r--r--lib/webrick/cgi.rb107
-rw-r--r--lib/webrick/compat.rb20
-rw-r--r--lib/webrick/config.rb64
-rw-r--r--lib/webrick/cookie.rb71
-rw-r--r--lib/webrick/htmlutils.rb10
-rw-r--r--lib/webrick/httpauth.rb56
-rw-r--r--lib/webrick/httpauth/authenticator.rb69
-rw-r--r--lib/webrick/httpauth/basicauth.rb47
-rw-r--r--lib/webrick/httpauth/digestauth.rb101
-rw-r--r--lib/webrick/httpauth/htdigest.rb48
-rw-r--r--lib/webrick/httpauth/htgroup.rb32
-rw-r--r--lib/webrick/httpauth/htpasswd.rb51
-rw-r--r--lib/webrick/httpauth/userdb.rb31
-rw-r--r--lib/webrick/httpproxy.rb313
-rw-r--r--lib/webrick/httprequest.rb323
-rw-r--r--lib/webrick/httpresponse.rb215
-rw-r--r--lib/webrick/https.rb29
-rw-r--r--lib/webrick/httpserver.rb84
-rw-r--r--lib/webrick/httpservlet/abstract.rb92
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb5
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb55
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb49
-rw-r--r--lib/webrick/httpservlet/filehandler.rb142
-rw-r--r--lib/webrick/httpservlet/prochandler.rb21
-rw-r--r--lib/webrick/httpstatus.rb184
-rw-r--r--lib/webrick/httputils.rb166
-rw-r--r--lib/webrick/httpversion.rb30
-rw-r--r--lib/webrick/log.rb77
-rw-r--r--lib/webrick/server.rb241
-rw-r--r--lib/webrick/ssl.rb86
-rw-r--r--lib/webrick/utils.rb192
-rw-r--r--lib/webrick/version.rb6
-rw-r--r--lib/wsdl/binding.rb65
-rw-r--r--lib/wsdl/data.rb64
-rw-r--r--lib/wsdl/definitions.rb250
-rw-r--r--lib/wsdl/documentation.rb32
-rw-r--r--lib/wsdl/import.rb80
-rw-r--r--lib/wsdl/importer.rb38
-rw-r--r--lib/wsdl/info.rb39
-rw-r--r--lib/wsdl/message.rb54
-rw-r--r--lib/wsdl/operation.rb130
-rw-r--r--lib/wsdl/operationBinding.rb108
-rw-r--r--lib/wsdl/param.rb85
-rw-r--r--lib/wsdl/parser.rb163
-rw-r--r--lib/wsdl/part.rb52
-rw-r--r--lib/wsdl/port.rb84
-rw-r--r--lib/wsdl/portType.rb73
-rw-r--r--lib/wsdl/service.rb61
-rw-r--r--lib/wsdl/soap/address.rb40
-rw-r--r--lib/wsdl/soap/binding.rb49
-rw-r--r--lib/wsdl/soap/body.rb56
-rw-r--r--lib/wsdl/soap/cgiStubCreator.rb76
-rw-r--r--lib/wsdl/soap/classDefCreator.rb314
-rw-r--r--lib/wsdl/soap/classDefCreatorSupport.rb126
-rw-r--r--lib/wsdl/soap/clientSkeltonCreator.rb78
-rw-r--r--lib/wsdl/soap/complexType.rb161
-rw-r--r--lib/wsdl/soap/data.rb42
-rw-r--r--lib/wsdl/soap/definitions.rb149
-rw-r--r--lib/wsdl/soap/driverCreator.rb95
-rw-r--r--lib/wsdl/soap/element.rb28
-rw-r--r--lib/wsdl/soap/fault.rb56
-rw-r--r--lib/wsdl/soap/header.rb86
-rw-r--r--lib/wsdl/soap/headerfault.rb56
-rw-r--r--lib/wsdl/soap/mappingRegistryCreator.rb92
-rw-r--r--lib/wsdl/soap/methodDefCreator.rb228
-rw-r--r--lib/wsdl/soap/operation.rb122
-rw-r--r--lib/wsdl/soap/servantSkeltonCreator.rb67
-rw-r--r--lib/wsdl/soap/standaloneServerStubCreator.rb85
-rw-r--r--lib/wsdl/soap/wsdl2ruby.rb176
-rw-r--r--lib/wsdl/types.rb43
-rw-r--r--lib/wsdl/wsdl.rb23
-rw-r--r--lib/wsdl/xmlSchema/all.rb69
-rw-r--r--lib/wsdl/xmlSchema/annotation.rb34
-rw-r--r--lib/wsdl/xmlSchema/any.rb56
-rw-r--r--lib/wsdl/xmlSchema/attribute.rb127
-rw-r--r--lib/wsdl/xmlSchema/choice.rb69
-rw-r--r--lib/wsdl/xmlSchema/complexContent.rb92
-rw-r--r--lib/wsdl/xmlSchema/complexType.rb139
-rw-r--r--lib/wsdl/xmlSchema/content.rb96
-rw-r--r--lib/wsdl/xmlSchema/data.rb80
-rw-r--r--lib/wsdl/xmlSchema/element.rb154
-rw-r--r--lib/wsdl/xmlSchema/enumeration.rb36
-rw-r--r--lib/wsdl/xmlSchema/import.rb65
-rw-r--r--lib/wsdl/xmlSchema/importer.rb87
-rw-r--r--lib/wsdl/xmlSchema/include.rb54
-rw-r--r--lib/wsdl/xmlSchema/length.rb35
-rw-r--r--lib/wsdl/xmlSchema/parser.rb166
-rw-r--r--lib/wsdl/xmlSchema/pattern.rb36
-rw-r--r--lib/wsdl/xmlSchema/schema.rb143
-rw-r--r--lib/wsdl/xmlSchema/sequence.rb69
-rw-r--r--lib/wsdl/xmlSchema/simpleContent.rb65
-rw-r--r--lib/wsdl/xmlSchema/simpleExtension.rb54
-rw-r--r--lib/wsdl/xmlSchema/simpleRestriction.rb73
-rw-r--r--lib/wsdl/xmlSchema/simpleType.rb73
-rw-r--r--lib/wsdl/xmlSchema/unique.rb34
-rw-r--r--lib/wsdl/xmlSchema/xsd2ruby.rb107
-rw-r--r--lib/xmlrpc.rb301
-rw-r--r--lib/xmlrpc/.document1
-rw-r--r--lib/xmlrpc/README.txt31
-rw-r--r--lib/xmlrpc/base64.rb71
-rw-r--r--lib/xmlrpc/client.rb713
-rw-r--r--lib/xmlrpc/config.rb35
-rw-r--r--lib/xmlrpc/create.rb218
-rw-r--r--lib/xmlrpc/datetime.rb129
-rw-r--r--lib/xmlrpc/httpserver.rb178
-rw-r--r--lib/xmlrpc/marshal.rb20
-rw-r--r--lib/xmlrpc/parser.rb541
-rw-r--r--lib/xmlrpc/server.rb673
-rw-r--r--lib/xmlrpc/utils.rb74
-rw-r--r--lib/xsd/charset.rb187
-rw-r--r--lib/xsd/codegen.rb12
-rw-r--r--lib/xsd/codegen/classdef.rb203
-rw-r--r--lib/xsd/codegen/commentdef.rb34
-rw-r--r--lib/xsd/codegen/gensupport.rb166
-rw-r--r--lib/xsd/codegen/methoddef.rb63
-rw-r--r--lib/xsd/codegen/moduledef.rb191
-rw-r--r--lib/xsd/datatypes.rb1269
-rw-r--r--lib/xsd/datatypes1999.rb20
-rw-r--r--lib/xsd/iconvcharset.rb33
-rw-r--r--lib/xsd/mapping.rb42
-rw-r--r--lib/xsd/namedelements.rb95
-rw-r--r--lib/xsd/ns.rb140
-rw-r--r--lib/xsd/qname.rb78
-rw-r--r--lib/xsd/xmlparser.rb61
-rw-r--r--lib/xsd/xmlparser/parser.rb96
-rw-r--r--lib/xsd/xmlparser/rexmlparser.rb54
-rw-r--r--lib/xsd/xmlparser/xmlparser.rb50
-rw-r--r--lib/xsd/xmlparser/xmlscanner.rb147
-rw-r--r--lib/yaml.rb469
-rw-r--r--lib/yaml/baseemitter.rb247
-rw-r--r--lib/yaml/basenode.rb216
-rw-r--r--lib/yaml/constants.rb45
-rw-r--r--lib/yaml/dbm.rb200
-rw-r--r--lib/yaml/encoding.rb33
-rw-r--r--lib/yaml/error.rb34
-rw-r--r--lib/yaml/loader.rb14
-rw-r--r--lib/yaml/rubytypes.rb408
-rw-r--r--lib/yaml/store.rb60
-rw-r--r--lib/yaml/stream.rb40
-rw-r--r--lib/yaml/stringio.rb83
-rw-r--r--lib/yaml/syck.rb19
-rw-r--r--lib/yaml/tag.rb91
-rw-r--r--lib/yaml/types.rb192
-rw-r--r--lib/yaml/yamlnode.rb54
-rw-r--r--lib/yaml/ypath.rb52
-rw-r--r--load.c1234
-rw-r--r--loadpath.c92
-rw-r--r--localeinit.c68
-rw-r--r--main.c45
-rw-r--r--man/erb.1157
-rw-r--r--man/goruby.139
-rw-r--r--man/irb.1173
-rw-r--r--man/rake.1141
-rw-r--r--man/ri.1181
-rw-r--r--man/ruby.1629
-rw-r--r--marshal.c1874
-rw-r--r--math.c941
-rwxr-xr-xmdoc2man.rb465
-rw-r--r--method.h144
-rw-r--r--miniinit.c30
-rw-r--r--misc/README6
-rw-r--r--misc/inf-ruby.el249
-rw-r--r--misc/rb_optparse.bash20
-rwxr-xr-xmisc/rb_optparse.zsh38
-rw-r--r--misc/rdoc-mode.el166
-rw-r--r--misc/ruby-additional.el126
-rw-r--r--misc/ruby-electric.el561
-rw-r--r--misc/ruby-mode.el1910
-rw-r--r--misc/ruby-style.el37
-rw-r--r--misc/rubydb3x.el42
-rw-r--r--missing.h142
-rw-r--r--missing/acosh.c19
-rw-r--r--missing/alloca.c13
-rw-r--r--missing/cbrt.c11
-rw-r--r--missing/close.c72
-rw-r--r--missing/crt_externs.h8
-rw-r--r--missing/crypt.c182
-rw-r--r--missing/dup2.c5
-rw-r--r--missing/erf.c13
-rw-r--r--missing/ffs.c49
-rw-r--r--missing/file.h2
-rw-r--r--missing/finite.c5
-rw-r--r--missing/flock.c25
-rw-r--r--missing/hypot.c4
-rw-r--r--missing/isinf.c19
-rw-r--r--missing/isnan.c25
-rw-r--r--missing/langinfo.c148
-rw-r--r--missing/lgamma_r.c80
-rw-r--r--missing/memcmp.c10
-rw-r--r--missing/memmove.c18
-rw-r--r--missing/nextafter.c77
-rw-r--r--missing/os2.c29
-rw-r--r--missing/setproctitle.c175
-rw-r--r--missing/signbit.c19
-rw-r--r--missing/strcasecmp.c16
-rw-r--r--missing/strchr.c22
-rw-r--r--missing/strerror.c5
-rw-r--r--missing/strftime.c903
-rw-r--r--missing/strlcat.c74
-rw-r--r--missing/strlcpy.c70
-rw-r--r--missing/strncasecmp.c21
-rw-r--r--missing/strstr.c15
-rw-r--r--missing/strtod.c271
-rw-r--r--missing/strtol.c10
-rw-r--r--missing/strtoul.c184
-rw-r--r--missing/tgamma.c92
-rw-r--r--missing/vsnprintf.c1135
-rw-r--r--missing/x68.c40
-rw-r--r--missing/x86_64-chkstk.s10
-rwxr-xr-xmkconfig.rb195
-rw-r--r--nacl/GNUmakefile.in100
-rw-r--r--nacl/README.nacl51
-rw-r--r--nacl/create_nmf.rb70
-rw-r--r--nacl/dirent.h15
-rw-r--r--nacl/example.html150
-rwxr-xr-xnacl/nacl-config.rb61
-rw-r--r--nacl/package.rb113
-rw-r--r--nacl/pepper_main.c732
-rw-r--r--nacl/resource.h8
-rw-r--r--nacl/select.h7
-rw-r--r--nacl/signal.h6
-rw-r--r--nacl/stat.h10
-rw-r--r--nacl/unistd.h9
-rw-r--r--nacl/utime.h11
-rw-r--r--node.c1082
-rw-r--r--node.h432
-rw-r--r--numeric.c3526
-rw-r--r--object.c3148
-rw-r--r--pack.c1978
-rw-r--r--parse.y11281
-rw-r--r--prec.c141
-rw-r--r--prelude.rb15
-rw-r--r--probes.d234
-rw-r--r--probes_helper.h67
-rw-r--r--proc.c2886
-rw-r--r--process.c6806
-rw-r--r--random.c1407
-rw-r--r--range.c1305
-rw-r--r--rational.c2625
-rw-r--r--re.c3679
-rw-r--r--re.h42
-rw-r--r--regcomp.c6722
-rw-r--r--regenc.c957
-rw-r--r--regenc.h234
-rw-r--r--regerror.c408
-rw-r--r--regex.c4693
-rw-r--r--regex.h221
-rw-r--r--regexec.c4365
-rw-r--r--regint.h972
-rw-r--r--regparse.c6496
-rw-r--r--regparse.h363
-rw-r--r--regsyntax.c387
-rw-r--r--ruby.1351
-rw-r--r--ruby.c2202
-rw-r--r--ruby.h776
-rw-r--r--ruby_atomic.h170
-rw-r--r--rubyio.h91
-rw-r--r--rubysig.h105
-rwxr-xr-xrubytest.rb49
-rwxr-xr-xrunruby.rb71
-rw-r--r--safe.c133
-rw-r--r--sample/README12
-rw-r--r--sample/benchmark.rb19
-rw-r--r--sample/biorhythm.rb134
-rw-r--r--sample/cal.rb10
-rw-r--r--sample/cgi-session-pstore.rb11
-rw-r--r--sample/coverage.rb62
-rw-r--r--sample/dbmtest.rb14
-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/darray.rb2
-rw-r--r--sample/drb/darrayc.rb16
-rw-r--r--sample/drb/dbiff.rb24
-rw-r--r--sample/drb/dchatc.rb4
-rw-r--r--sample/drb/dchats.rb22
-rw-r--r--sample/drb/dhasen.rb4
-rw-r--r--sample/drb/dhasenc.rb7
-rw-r--r--sample/drb/dlogc.rb2
-rw-r--r--sample/drb/dlogd.rb6
-rw-r--r--sample/drb/dqin.rb2
-rw-r--r--sample/drb/dqout.rb2
-rw-r--r--sample/drb/dqueue.rb2
-rw-r--r--sample/drb/drbc.rb2
-rw-r--r--sample/drb/drbch.rb2
-rw-r--r--sample/drb/drbm.rb6
-rw-r--r--sample/drb/drbmc.rb2
-rw-r--r--sample/drb/drbs-acl.rb6
-rw-r--r--sample/drb/drbs.rb4
-rw-r--r--sample/drb/extserv_test.rb12
-rw-r--r--sample/drb/gw_cu.rb2
-rw-r--r--sample/drb/holderc.rb2
-rw-r--r--sample/drb/holders.rb6
-rw-r--r--sample/drb/http0.rb64
-rw-r--r--sample/drb/http0serv.rb118
-rw-r--r--sample/drb/name.rb16
-rw-r--r--sample/drb/namec.rb2
-rw-r--r--sample/drb/old_tuplespace.rb80
-rw-r--r--sample/drb/ring_echo.rb2
-rw-r--r--sample/drb/ring_place.rb6
-rw-r--r--sample/drb/simpletuple.rb14
-rw-r--r--sample/drb/speedc.rb2
-rw-r--r--sample/drb/speeds.rb4
-rw-r--r--sample/dualstack-fetch.rb2
-rw-r--r--sample/dualstack-httpd.rb34
-rw-r--r--sample/erb/erb4html.rb60
-rw-r--r--sample/exyacc.rb32
-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.rb161
-rw-r--r--sample/fullpath.rb2
-rw-r--r--sample/getopts.test36
-rw-r--r--sample/list.rb1
-rw-r--r--sample/list2.rb2
-rw-r--r--sample/list3.rb2
-rw-r--r--sample/logger/app.rb2
-rwxr-xr-x[-rw-r--r--]sample/mine.rb39
-rw-r--r--sample/mkproto.rb24
-rw-r--r--sample/mrshtest.rb13
-rw-r--r--sample/net-imap.rb167
-rw-r--r--sample/observ.rb8
-rw-r--r--sample/occur.pl8
-rw-r--r--sample/occur.rb6
-rw-r--r--sample/occur2.rb13
-rw-r--r--sample/open3.rb12
-rw-r--r--sample/openssl/c_rehash.rb38
-rw-r--r--sample/openssl/cert_store_view.rb911
-rw-r--r--sample/openssl/certstore.rb54
-rw-r--r--sample/openssl/cipher.rb73
-rw-r--r--sample/openssl/crlstore.rb32
-rw-r--r--sample/openssl/echo_cli.rb21
-rw-r--r--sample/openssl/echo_svr.rb15
-rw-r--r--sample/openssl/gen_csr.rb13
-rw-r--r--sample/openssl/smime_read.rb10
-rw-r--r--sample/openssl/smime_write.rb12
-rw-r--r--sample/openssl/wget.rb17
-rwxr-xr-x[-rw-r--r--]sample/optparse/opttest.rb76
-rw-r--r--sample/pstore.rb19
-rw-r--r--sample/pty/expect_sample.rb48
-rw-r--r--sample/pty/script.rb37
-rw-r--r--sample/pty/shl.rb (renamed from ext/pty/shl.rb)0
-rw-r--r--sample/rcs.awk54
-rw-r--r--sample/rdoc/markup/rdoc2latex.rb15
-rw-r--r--sample/rdoc/markup/sample.rb40
-rw-r--r--sample/regx.rb23
-rw-r--r--sample/rinda-ring.rb22
-rw-r--r--sample/ripper/ruby2html.rb112
-rw-r--r--sample/ripper/strip-comment.rb19
-rwxr-xr-xsample/rss/list_description.rb4
-rwxr-xr-xsample/rss/re_read.rb4
-rwxr-xr-xsample/rss/rss_recent.rb4
-rw-r--r--sample/simple-bench.rb140
-rw-r--r--sample/svr.rb4
-rw-r--r--sample/tempfile.rb8
-rwxr-xr-x[-rw-r--r--]sample/test.rb910
-rw-r--r--sample/timeout.rb42
-rw-r--r--sample/trick2013/README.md13
-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.mp4bin0 -> 580724 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/trojan.rb4
-rw-r--r--sample/tsvr.rb2
-rw-r--r--sample/weakref.rb9
-rw-r--r--sample/webrick/httpproxy.rb7
-rw-r--r--signal.c1446
-rw-r--r--siphash.c484
-rw-r--r--siphash.h48
-rw-r--r--sparc.c40
-rw-r--r--spec/README31
-rw-r--r--spec/default.mspec22
-rw-r--r--sprintf.c1281
-rw-r--r--st.c1774
-rw-r--r--st.h72
-rw-r--r--strftime.c1163
-rw-r--r--string.c9191
-rw-r--r--struct.c1124
-rw-r--r--symbol.c1128
-rw-r--r--symbol.h88
-rw-r--r--template/Doxyfile.tmpl265
-rw-r--r--template/GNUmakefile.in6
-rw-r--r--template/encdb.h.tmpl91
-rw-r--r--template/fake.rb.in30
-rw-r--r--template/id.c.tmpl27
-rw-r--r--template/id.h.tmpl118
-rw-r--r--template/insns.inc.tmpl20
-rw-r--r--template/insns_info.inc.tmpl83
-rw-r--r--template/known_errors.inc.tmpl14
-rw-r--r--template/minsns.inc.tmpl14
-rw-r--r--template/opt_sc.inc.tmpl32
-rw-r--r--template/optinsn.inc.tmpl30
-rw-r--r--template/optunifs.inc.tmpl35
-rw-r--r--template/prelude.c.tmpl178
-rw-r--r--template/ruby.pc.in56
-rw-r--r--template/sizes.c.tmpl30
-rw-r--r--template/transdb.h.tmpl59
-rw-r--r--template/unicode_norm_gen.tmpl225
-rw-r--r--template/verconf.h.tmpl61
-rw-r--r--template/vm.inc.tmpl29
-rw-r--r--template/vmtc.inc.tmpl18
-rw-r--r--template/yarvarch.en7
-rw-r--r--template/yarvarch.ja454
-rw-r--r--template/yasmdata.rb.tmpl20
-rw-r--r--test/-ext-/array/test_resize.rb29
-rw-r--r--test/-ext-/bignum/test_big2str.rb29
-rw-r--r--test/-ext-/bignum/test_bigzero.rb13
-rw-r--r--test/-ext-/bignum/test_div.rb28
-rw-r--r--test/-ext-/bignum/test_mul.rb137
-rw-r--r--test/-ext-/bignum/test_pack.rb398
-rw-r--r--test/-ext-/bignum/test_str2big.rb37
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb25
-rw-r--r--test/-ext-/class/test_class2name.rb18
-rw-r--r--test/-ext-/debug/test_debug.rb58
-rw-r--r--test/-ext-/debug/test_profile_frames.rb104
-rw-r--r--test/-ext-/exception/test_data_error.rb13
-rw-r--r--test/-ext-/exception/test_enc_raise.rb15
-rw-r--r--test/-ext-/exception/test_ensured.rb31
-rw-r--r--test/-ext-/file/test_stat.rb14
-rw-r--r--test/-ext-/float/test_nextafter.rb64
-rw-r--r--test/-ext-/funcall/test_passing_block.rb22
-rw-r--r--test/-ext-/hash/test_delete.rb19
-rw-r--r--test/-ext-/iseq_load/test_iseq_load.rb104
-rw-r--r--test/-ext-/iter/test_iter_break.rb15
-rw-r--r--test/-ext-/iter/test_yield_block.rb21
-rw-r--r--test/-ext-/load/test_dot_dot.rb10
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb32
-rw-r--r--test/-ext-/method/test_arity.rb37
-rw-r--r--test/-ext-/num2int/test_num2int.rb267
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb12
-rw-r--r--test/-ext-/postponed_job/test_postponed_job.rb28
-rw-r--r--test/-ext-/proc/test_bmethod.rb37
-rw-r--r--test/-ext-/rational/test_rat.rb31
-rw-r--r--test/-ext-/st/test_foreach.rb15
-rw-r--r--test/-ext-/st/test_numhash.rb49
-rw-r--r--test/-ext-/st/test_update.rb50
-rw-r--r--test/-ext-/string/test_coderange.rb59
-rw-r--r--test/-ext-/string/test_cstr.rb119
-rw-r--r--test/-ext-/string/test_ellipsize.rb46
-rw-r--r--test/-ext-/string/test_enc_associate.rb12
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb15
-rw-r--r--test/-ext-/string/test_modify_expand.rb25
-rw-r--r--test/-ext-/string/test_nofree.rb10
-rw-r--r--test/-ext-/string/test_normalize.rb106
-rw-r--r--test/-ext-/string/test_qsort.rb19
-rw-r--r--test/-ext-/string/test_set_len.rb25
-rw-r--r--test/-ext-/struct/test_duplicate.rb22
-rw-r--r--test/-ext-/struct/test_member.rb15
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb473
-rw-r--r--test/-ext-/symbol/test_type.rb124
-rw-r--r--test/-ext-/test_bug-3571.rb20
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb21
-rw-r--r--test/-ext-/test_printf.rb186
-rw-r--r--test/-ext-/test_recursion.rb35
-rw-r--r--test/-ext-/tracepoint/test_tracepoint.rb79
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb16
-rw-r--r--test/-ext-/vm/test_at_exit.rb19
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb45
-rw-r--r--test/-ext-/win32/test_console_attr.rb43
-rw-r--r--test/-ext-/win32/test_dln.rb34
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb24
-rw-r--r--test/base64/test_base64.rb100
-rw-r--r--test/benchmark/test_benchmark.rb161
-rw-r--r--test/bigdecimal/test_bigdecimal.rb1567
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb50
-rw-r--r--test/bigdecimal/test_bigmath.rb80
-rw-r--r--test/bigdecimal/testbase.rb27
-rw-r--r--test/cgi/test_cgi_cookie.rb110
-rw-r--r--test/cgi/test_cgi_core.rb312
-rw-r--r--test/cgi/test_cgi_header.rb181
-rw-r--r--test/cgi/test_cgi_modruby.rb146
-rw-r--r--test/cgi/test_cgi_multipart.rb380
-rw-r--r--test/cgi/test_cgi_session.rb172
-rw-r--r--test/cgi/test_cgi_tag_helper.rb353
-rw-r--r--test/cgi/test_cgi_util.rb104
-rw-r--r--test/cgi/testdata/file1.html10
-rw-r--r--test/cgi/testdata/large.pngbin0 -> 156414 bytes-rw-r--r--test/cgi/testdata/small.pngbin0 -> 82 bytes-rw-r--r--test/coverage/test_coverage.rb73
-rw-r--r--test/csv/base.rb8
-rw-r--r--test/csv/line_endings.gzbin0 -> 59 bytes-rw-r--r--test/csv/test_csv.rb1753
-rwxr-xr-xtest/csv/test_csv_parsing.rb221
-rwxr-xr-xtest/csv/test_csv_writing.rb97
-rwxr-xr-xtest/csv/test_data_converters.rb263
-rwxr-xr-xtest/csv/test_encodings.rb337
-rwxr-xr-xtest/csv/test_features.rb327
-rwxr-xr-xtest/csv/test_headers.rb297
-rwxr-xr-xtest/csv/test_interface.rb368
-rwxr-xr-xtest/csv/test_row.rb355
-rwxr-xr-xtest/csv/test_table.rb434
-rw-r--r--test/csv/ts_all.rb20
-rw-r--r--test/date/test_date.rb150
-rw-r--r--test/date/test_date_arith.rb264
-rw-r--r--test/date/test_date_attr.rb103
-rw-r--r--test/date/test_date_base.rb442
-rw-r--r--test/date/test_date_compat.rb21
-rw-r--r--test/date/test_date_conv.rb137
-rw-r--r--test/date/test_date_marshal.rb41
-rw-r--r--test/date/test_date_new.rb271
-rw-r--r--test/date/test_date_parse.rb1124
-rw-r--r--test/date/test_date_strftime.rb430
-rw-r--r--test/date/test_date_strptime.rb512
-rw-r--r--test/date/test_switch_hitter.rb664
-rw-r--r--test/dbm/test_dbm.rb216
-rw-r--r--test/digest/digest/foo.rb10
-rw-r--r--test/digest/test_digest.rb168
-rw-r--r--test/digest/test_digest_extend.rb158
-rw-r--r--test/drb/drbtest.rb117
-rw-r--r--test/drb/ignore_test_drb.rb19
-rw-r--r--test/drb/test_acl.rb4
-rw-r--r--test/drb/test_drb.rb120
-rw-r--r--test/drb/test_drbssl.rb24
-rw-r--r--test/drb/test_drbunix.rb23
-rw-r--r--test/drb/ut_array.rb3
-rw-r--r--test/drb/ut_array_drbssl.rb18
-rw-r--r--test/drb/ut_array_drbunix.rb1
-rw-r--r--test/drb/ut_drb.rb9
-rw-r--r--test/drb/ut_drb_drbssl.rb20
-rw-r--r--test/drb/ut_drb_drbunix.rb3
-rw-r--r--test/drb/ut_eq.rb36
-rw-r--r--test/drb/ut_eval.rb7
-rw-r--r--test/drb/ut_large.rb9
-rw-r--r--test/drb/ut_port.rb1
-rw-r--r--test/drb/ut_safe1.rb3
-rw-r--r--test/drb/ut_timerholder.rb74
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb50
-rw-r--r--test/dtrace/test_array_create.rb35
-rw-r--r--test/dtrace/test_cmethod.rb49
-rw-r--r--test/dtrace/test_function_entry.rb87
-rw-r--r--test/dtrace/test_gc.rb26
-rw-r--r--test/dtrace/test_hash_create.rb52
-rw-r--r--test/dtrace/test_load.rb52
-rw-r--r--test/dtrace/test_method_cache.rb28
-rw-r--r--test/dtrace/test_object_create_start.rb35
-rw-r--r--test/dtrace/test_raise.rb29
-rw-r--r--test/dtrace/test_require.rb34
-rw-r--r--test/dtrace/test_singleton_function.rb55
-rw-r--r--test/dtrace/test_string.rb27
-rw-r--r--test/erb/test_erb.rb146
-rw-r--r--test/erb/test_erb_command.rb11
-rw-r--r--test/erb/test_erb_m17n.rb123
-rw-r--r--test/etc/test_etc.rb169
-rw-r--r--test/fiddle/helper.rb124
-rw-r--r--test/fiddle/test_c_struct_entry.rb76
-rw-r--r--test/fiddle/test_c_union_entity.rb34
-rw-r--r--test/fiddle/test_closure.rb84
-rw-r--r--test/fiddle/test_cparser.rb35
-rw-r--r--test/fiddle/test_fiddle.rb16
-rw-r--r--test/fiddle/test_func.rb92
-rw-r--r--test/fiddle/test_function.rb82
-rw-r--r--test/fiddle/test_handle.rb212
-rw-r--r--test/fiddle/test_import.rb150
-rw-r--r--test/fiddle/test_pointer.rb237
-rw-r--r--test/fileutils/clobber.rb91
-rw-r--r--test/fileutils/fileasserts.rb128
-rw-r--r--test/fileutils/test_dryrun.rb20
-rw-r--r--test/fileutils/test_fileutils.rb817
-rw-r--r--test/fileutils/test_nowrite.rb90
-rw-r--r--test/fileutils/test_verbose.rb18
-rw-r--r--test/fileutils/visibility_tests.rb41
-rw-r--r--test/gdbm/test_gdbm.rb263
-rw-r--r--test/iconv/test_basic.rb49
-rw-r--r--test/iconv/test_option.rb31
-rw-r--r--test/iconv/test_partial.rb41
-rw-r--r--test/iconv/utils.rb26
-rw-r--r--test/io/console/test_io_console.rb332
-rw-r--r--test/io/nonblock/test_flush.rb48
-rw-r--r--test/io/wait/test_io_wait.rb112
-rw-r--r--test/irb/test_completion.rb21
-rw-r--r--test/irb/test_option.rb11
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb13
-rw-r--r--test/json/fixtures/fail1.json1
-rw-r--r--test/json/fixtures/fail10.json1
-rw-r--r--test/json/fixtures/fail11.json1
-rw-r--r--test/json/fixtures/fail12.json1
-rw-r--r--test/json/fixtures/fail13.json1
-rw-r--r--test/json/fixtures/fail14.json1
-rw-r--r--test/json/fixtures/fail18.json1
-rw-r--r--test/json/fixtures/fail19.json1
-rw-r--r--test/json/fixtures/fail2.json1
-rw-r--r--test/json/fixtures/fail20.json1
-rw-r--r--test/json/fixtures/fail21.json1
-rw-r--r--test/json/fixtures/fail22.json1
-rw-r--r--test/json/fixtures/fail23.json1
-rw-r--r--test/json/fixtures/fail24.json1
-rw-r--r--test/json/fixtures/fail25.json1
-rw-r--r--test/json/fixtures/fail27.json2
-rw-r--r--test/json/fixtures/fail28.json2
-rw-r--r--test/json/fixtures/fail3.json1
-rw-r--r--test/json/fixtures/fail4.json1
-rw-r--r--test/json/fixtures/fail5.json1
-rw-r--r--test/json/fixtures/fail6.json1
-rw-r--r--test/json/fixtures/fail7.json1
-rw-r--r--test/json/fixtures/fail8.json1
-rw-r--r--test/json/fixtures/fail9.json1
-rw-r--r--test/json/fixtures/pass1.json56
-rw-r--r--test/json/fixtures/pass15.json1
-rw-r--r--test/json/fixtures/pass16.json1
-rw-r--r--test/json/fixtures/pass17.json1
-rw-r--r--test/json/fixtures/pass2.json1
-rw-r--r--test/json/fixtures/pass26.json1
-rw-r--r--test/json/fixtures/pass3.json6
-rw-r--r--test/json/setup_variant.rb11
-rwxr-xr-xtest/json/test_json.rb557
-rwxr-xr-xtest/json/test_json_addition.rb196
-rw-r--r--test/json/test_json_encoding.rb65
-rwxr-xr-xtest/json/test_json_fixtures.rb35
-rwxr-xr-xtest/json/test_json_generate.rb322
-rw-r--r--test/json/test_json_generic_object.rb75
-rw-r--r--test/json/test_json_string_matching.rb39
-rwxr-xr-xtest/json/test_json_unicode.rb72
-rw-r--r--test/lib/envutil.rb604
-rw-r--r--test/lib/find_executable.rb21
-rw-r--r--test/lib/leakchecker.rb167
-rw-r--r--test/lib/memory_status.rb111
-rw-r--r--test/lib/minitest/README.txt457
-rw-r--r--test/lib/minitest/autorun.rb13
-rw-r--r--test/lib/minitest/benchmark.rb417
-rw-r--r--test/lib/minitest/mock.rb195
-rw-r--r--test/lib/minitest/unit.rb1419
-rw-r--r--test/lib/profile_test_all.rb90
-rw-r--r--test/lib/test/unit.rb896
-rw-r--r--test/lib/test/unit/assertions.rb501
-rw-r--r--test/lib/test/unit/parallel.rb190
-rw-r--r--test/lib/test/unit/testcase.rb34
-rw-r--r--test/lib/tracepointchecker.rb118
-rw-r--r--test/lib/with_different_ofs.rb17
-rw-r--r--test/logger/test_logdevice.rb511
-rw-r--r--test/logger/test_logger.rb152
-rw-r--r--test/logger/test_severity.rb15
-rw-r--r--test/matrix/test_matrix.rb540
-rw-r--r--test/matrix/test_vector.rb176
-rw-r--r--test/minitest/metametameta.rb69
-rw-r--r--test/minitest/test_minitest_benchmark.rb130
-rw-r--r--test/minitest/test_minitest_mock.rb403
-rw-r--r--test/minitest/test_minitest_unit.rb1803
-rw-r--r--test/misc/test_ruby_mode.rb182
-rw-r--r--test/mkmf/base.rb139
-rw-r--r--test/mkmf/test_config.rb16
-rw-r--r--test/mkmf/test_constant.rb37
-rw-r--r--test/mkmf/test_convertible.rb34
-rw-r--r--test/mkmf/test_find_executable.rb50
-rw-r--r--test/mkmf/test_flags.rb56
-rw-r--r--test/mkmf/test_framework.rb48
-rw-r--r--test/mkmf/test_have_func.rb14
-rw-r--r--test/mkmf/test_have_library.rb55
-rw-r--r--test/mkmf/test_have_macro.rb35
-rw-r--r--test/mkmf/test_libs.rb86
-rw-r--r--test/mkmf/test_signedness.rb29
-rw-r--r--test/mkmf/test_sizeof.rb47
-rw-r--r--test/monitor/test_monitor.rb142
-rw-r--r--test/net/ftp/test_buffered_socket.rb40
-rw-r--r--test/net/ftp/test_ftp.rb850
-rw-r--r--test/net/http/test_buffered_io.rb17
-rw-r--r--test/net/http/test_http.rb993
-rw-r--r--test/net/http/test_http_request.rb79
-rw-r--r--test/net/http/test_httpheader.rb29
-rw-r--r--test/net/http/test_httpresponse.rb394
-rw-r--r--test/net/http/test_httpresponses.rb24
-rw-r--r--test/net/http/test_https.rb194
-rw-r--r--test/net/http/test_https_proxy.rb39
-rw-r--r--test/net/http/utils.rb108
-rw-r--r--test/net/imap/Makefile15
-rw-r--r--test/net/imap/cacert.pem66
-rw-r--r--test/net/imap/server.crt48
-rw-r--r--test/net/imap/server.key15
-rw-r--r--test/net/imap/test_imap.rb549
-rw-r--r--test/net/imap/test_imap_response_parser.rb292
-rw-r--r--test/net/pop/test_pop.rb30
-rw-r--r--test/net/protocol/test_protocol.rb28
-rw-r--r--test/net/smtp/test_response.rb99
-rw-r--r--test/net/smtp/test_smtp.rb54
-rw-r--r--test/net/smtp/test_ssl_socket.rb91
-rw-r--r--test/nkf/test_kconv.rb104
-rw-r--r--test/nkf/test_nkf.rb6
-rw-r--r--test/objspace/test_objspace.rb292
-rw-r--r--test/open-uri/test_open-uri.rb832
-rw-r--r--test/open-uri/test_ssl.rb390
-rw-r--r--test/openssl/ssl_server.rb81
-rw-r--r--test/openssl/test_asn1.rb428
-rw-r--r--test/openssl/test_bn.rb60
-rw-r--r--test/openssl/test_buffering.rb87
-rw-r--r--test/openssl/test_cipher.rb181
-rw-r--r--test/openssl/test_config.rb297
-rw-r--r--test/openssl/test_digest.rb65
-rw-r--r--test/openssl/test_ec.rb113
-rw-r--r--test/openssl/test_engine.rb75
-rw-r--r--test/openssl/test_fips.rb14
-rw-r--r--test/openssl/test_hmac.rb33
-rw-r--r--test/openssl/test_ns_spki.rb14
-rw-r--r--test/openssl/test_ocsp.rb47
-rw-r--r--test/openssl/test_pair.rb295
-rw-r--r--test/openssl/test_partial_record_read.rb34
-rw-r--r--test/openssl/test_pkcs12.rb209
-rw-r--r--test/openssl/test_pkcs5.rb97
-rw-r--r--test/openssl/test_pkcs7.rb181
-rw-r--r--test/openssl/test_pkey_dh.rb82
-rw-r--r--test/openssl/test_pkey_dsa.rb240
-rw-r--r--test/openssl/test_pkey_ec.rb211
-rw-r--r--test/openssl/test_pkey_rsa.rb278
-rw-r--r--test/openssl/test_ssl.rb1124
-rw-r--r--test/openssl/test_ssl_session.rb381
-rw-r--r--test/openssl/test_x509cert.rb135
-rw-r--r--test/openssl/test_x509crl.rb36
-rw-r--r--test/openssl/test_x509ext.rb9
-rw-r--r--test/openssl/test_x509name.rb117
-rw-r--r--test/openssl/test_x509req.rb58
-rw-r--r--test/openssl/test_x509store.rb53
-rw-r--r--test/openssl/utils.rb208
-rw-r--r--test/optparse/test_acceptable.rb195
-rw-r--r--test/optparse/test_autoconf.rb63
-rw-r--r--test/optparse/test_bash_completion.rb42
-rw-r--r--test/optparse/test_cclass.rb18
-rw-r--r--test/optparse/test_getopts.rb5
-rw-r--r--test/optparse/test_noarg.rb14
-rw-r--r--test/optparse/test_optarg.rb4
-rw-r--r--test/optparse/test_optparse.rb22
-rw-r--r--test/optparse/test_placearg.rb13
-rw-r--r--test/optparse/test_reqarg.rb22
-rw-r--r--test/optparse/test_summary.rb31
-rw-r--r--test/optparse/test_zsh_completion.rb22
-rw-r--r--test/ostruct/test_ostruct.rb108
-rw-r--r--test/pathname/test_pathname.rb952
-rw-r--r--test/psych/handlers/test_recorder.rb25
-rw-r--r--test/psych/helper.rb114
-rw-r--r--test/psych/json/test_stream.rb109
-rw-r--r--test/psych/nodes/test_enumerable.rb43
-rw-r--r--test/psych/test_alias_and_anchor.rb96
-rw-r--r--test/psych/test_array.rb57
-rw-r--r--test/psych/test_boolean.rb36
-rw-r--r--test/psych/test_class.rb36
-rw-r--r--test/psych/test_coder.rb184
-rw-r--r--test/psych/test_date_time.rb38
-rw-r--r--test/psych/test_deprecated.rb214
-rw-r--r--test/psych/test_document.rb46
-rw-r--r--test/psych/test_emitter.rb93
-rw-r--r--test/psych/test_encoding.rb259
-rw-r--r--test/psych/test_exception.rb157
-rw-r--r--test/psych/test_hash.rb49
-rw-r--r--test/psych/test_json_tree.rb65
-rw-r--r--test/psych/test_marshalable.rb54
-rw-r--r--test/psych/test_merge_keys.rb180
-rw-r--r--test/psych/test_nil.rb18
-rw-r--r--test/psych/test_null.rb19
-rw-r--r--test/psych/test_numeric.rb45
-rw-r--r--test/psych/test_object.rb44
-rw-r--r--test/psych/test_object_references.rb71
-rw-r--r--test/psych/test_omap.rb75
-rw-r--r--test/psych/test_parser.rb339
-rw-r--r--test/psych/test_psych.rb168
-rw-r--r--test/psych/test_safe_load.rb97
-rw-r--r--test/psych/test_scalar.rb11
-rw-r--r--test/psych/test_scalar_scanner.rb106
-rw-r--r--test/psych/test_serialize_subclasses.rb38
-rw-r--r--test/psych/test_set.rb49
-rw-r--r--test/psych/test_stream.rb93
-rw-r--r--test/psych/test_string.rb166
-rw-r--r--test/psych/test_struct.rb49
-rw-r--r--test/psych/test_symbol.rb25
-rw-r--r--test/psych/test_tainted.rb130
-rw-r--r--test/psych/test_to_yaml_properties.rb63
-rw-r--r--test/psych/test_tree_builder.rb79
-rw-r--r--test/psych/test_yaml.rb1288
-rw-r--r--test/psych/test_yamldbm.rb193
-rw-r--r--test/psych/test_yamlstore.rb85
-rw-r--r--test/psych/visitors/test_depth_first.rb49
-rw-r--r--test/psych/visitors/test_emitter.rb144
-rw-r--r--test/psych/visitors/test_to_ruby.rb326
-rw-r--r--test/psych/visitors/test_yaml_tree.rb173
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb129
-rw-r--r--test/rake/support/rakefile_definitions.rb478
-rw-r--r--test/rake/support/ruby_runner.rb34
-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.rb643
-rw-r--r--test/rake/test_rake_application_options.rb466
-rw-r--r--test/rake/test_rake_backtrace.rb119
-rw-r--r--test/rake/test_rake_clean.rb61
-rw-r--r--test/rake/test_rake_cpu_counter.rb68
-rw-r--r--test/rake/test_rake_definitions.rb84
-rw-r--r--test/rake/test_rake_directory_task.rb76
-rw-r--r--test/rake/test_rake_dsl.rb40
-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.rb655
-rw-r--r--test/rake/test_rake_file_list_path_map.rb8
-rw-r--r--test/rake/test_rake_file_task.rb197
-rw-r--r--test/rake/test_rake_file_utils.rb309
-rw-r--r--test/rake/test_rake_ftp_file.rb74
-rw-r--r--test/rake/test_rake_functional.rb482
-rw-r--r--test/rake/test_rake_invocation_chain.rb64
-rw-r--r--test/rake/test_rake_late_time.rb18
-rw-r--r--test/rake/test_rake_linked_list.rb84
-rw-r--r--test/rake/test_rake_makefile_loader.rb46
-rw-r--r--test/rake/test_rake_multi_task.rb64
-rw-r--r--test/rake/test_rake_name_space.rb57
-rw-r--r--test/rake/test_rake_package_task.rb79
-rw-r--r--test/rake/test_rake_path_map.rb168
-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_pathname_extensions.rb15
-rw-r--r--test/rake/test_rake_pseudo_status.rb21
-rw-r--r--test/rake/test_rake_rake_test_loader.rb20
-rw-r--r--test/rake/test_rake_reduce_compat.rb26
-rw-r--r--test/rake/test_rake_require.rb40
-rw-r--r--test/rake/test_rake_rules.rb388
-rw-r--r--test/rake/test_rake_scope.rb44
-rw-r--r--test/rake/test_rake_task.rb393
-rw-r--r--test/rake/test_rake_task_argument_parsing.rb119
-rw-r--r--test/rake/test_rake_task_arguments.rb127
-rw-r--r--test/rake/test_rake_task_lib.rb9
-rw-r--r--test/rake/test_rake_task_manager.rb178
-rw-r--r--test/rake/test_rake_task_manager_argument_resolution.rb19
-rw-r--r--test/rake/test_rake_task_with_arguments.rb172
-rw-r--r--test/rake/test_rake_test_task.rb146
-rw-r--r--test/rake/test_rake_thread_pool.rb145
-rw-r--r--test/rake/test_rake_top_level_functions.rb71
-rw-r--r--test/rake/test_rake_win32.rb72
-rw-r--r--test/rake/test_thread_history_display.rb101
-rw-r--r--test/rake/test_trace_output.rb52
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Amps and angle encoding.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Auto links.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Backslash escapes.text120
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Blockquotes with code blocks.text11
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Blocks.text14
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Spans.text6
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text8
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Horizontal rules.text67
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Advanced).text15
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Simple).text69
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML comments.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, inline style.text12
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, reference style.text71
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, shortcut references.text20
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Literal quotes in titles.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text306
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text888
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Nested blockquotes.text5
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Ordered and unordered lists.text131
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Strong and em together.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tabs.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tidyness.text5
-rw-r--r--test/rdoc/README1
-rw-r--r--test/rdoc/binary.datbin0 -> 1024 bytes-rw-r--r--test/rdoc/hidden.zip.txt1
-rw-r--r--test/rdoc/parsers/test_parse_c.rb261
-rw-r--r--test/rdoc/test.ja.largedoc3
-rw-r--r--test/rdoc/test.ja.rdoc10
-rw-r--r--test/rdoc/test.ja.txt8
-rw-r--r--test/rdoc/test.txt1
-rw-r--r--test/rdoc/test_rdoc_alias.rb13
-rw-r--r--test/rdoc/test_rdoc_any_method.rb460
-rw-r--r--test/rdoc/test_rdoc_attr.rb190
-rw-r--r--test/rdoc/test_rdoc_class_module.rb1492
-rw-r--r--test/rdoc/test_rdoc_code_object.rb450
-rw-r--r--test/rdoc/test_rdoc_comment.rb504
-rw-r--r--test/rdoc/test_rdoc_constant.rb181
-rw-r--r--test/rdoc/test_rdoc_context.rb901
-rw-r--r--test/rdoc/test_rdoc_context_section.rb130
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb192
-rw-r--r--test/rdoc/test_rdoc_encoding.rb227
-rw-r--r--test/rdoc/test_rdoc_extend.rb94
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb229
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb320
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb59
-rw-r--r--test/rdoc/test_rdoc_generator_pot.rb91
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po.rb51
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po_entry.rb139
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb78
-rw-r--r--test/rdoc/test_rdoc_i18n_locale.rb73
-rw-r--r--test/rdoc/test_rdoc_i18n_text.rb123
-rw-r--r--test/rdoc/test_rdoc_include.rb108
-rw-r--r--test/rdoc/test_rdoc_markdown.rb980
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb1884
-rw-r--r--test/rdoc/test_rdoc_markup.rb95
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb364
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb39
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb207
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb175
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb31
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb29
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb19
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb53
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb32
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb1680
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb473
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb22
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb369
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb366
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb663
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb225
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb711
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb32
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb112
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb389
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb377
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb126
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb246
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb29
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb193
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb47
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb42
-rw-r--r--test/rdoc/test_rdoc_options.rb766
-rw-r--r--test/rdoc/test_rdoc_parser.rb327
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb1896
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb315
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb61
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb55
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb3322
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb115
-rw-r--r--test/rdoc/test_rdoc_rd.rb30
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb535
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb63
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb177
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb455
-rw-r--r--test/rdoc/test_rdoc_require.rb25
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb1436
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb155
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb421
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb19
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb251
-rw-r--r--test/rdoc/test_rdoc_servlet.rb535
-rw-r--r--test/rdoc/test_rdoc_single_class.rb20
-rw-r--r--test/rdoc/test_rdoc_stats.rb722
-rw-r--r--test/rdoc/test_rdoc_store.rb993
-rw-r--r--test/rdoc/test_rdoc_task.rb170
-rw-r--r--test/rdoc/test_rdoc_text.rb557
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb42
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb520
-rw-r--r--test/rdoc/test_rdoc_top_level.rb287
-rw-r--r--test/rdoc/xref_data.rb76
-rw-r--r--test/rdoc/xref_test_case.rb67
-rw-r--r--test/readline/test_readline.rb530
-rw-r--r--test/readline/test_readline_history.rb292
-rw-r--r--test/resolv/test_addr.rb29
-rw-r--r--test/resolv/test_dns.rb200
-rw-r--r--test/resolv/test_resource.rb21
-rw-r--r--test/rexml/data/LostineRiver.kml.gzbin0 -> 50154 bytes-rw-r--r--test/rexml/data/ProductionSupport.xml29
-rw-r--r--test/rexml/data/axis.xml25
-rw-r--r--test/rexml/data/bad.xml5
-rw-r--r--test/rexml/data/basic.xml11
-rw-r--r--test/rexml/data/basicupdate.xml47
-rw-r--r--test/rexml/data/broken.rss20
-rw-r--r--test/rexml/data/contents.xml70
-rw-r--r--test/rexml/data/dash.xml12
-rw-r--r--test/rexml/data/defaultNamespace.xml6
-rw-r--r--test/rexml/data/doctype_test.xml34
-rw-r--r--test/rexml/data/documentation.xml542
-rw-r--r--test/rexml/data/euc.xml296
-rw-r--r--test/rexml/data/evaluate.xml28
-rw-r--r--test/rexml/data/fibo.xml29
-rw-r--r--test/rexml/data/foo.xml10
-rw-r--r--test/rexml/data/google.2.xml156
-rw-r--r--test/rexml/data/id.xml21
-rw-r--r--test/rexml/data/iso8859-1.xml4
-rw-r--r--test/rexml/data/jaxen24.xml2
-rw-r--r--test/rexml/data/jaxen3.xml15
-rw-r--r--test/rexml/data/lang.xml11
-rw-r--r--test/rexml/data/lang0.xml18
-rw-r--r--test/rexml/data/message.xml27
-rw-r--r--test/rexml/data/moreover.xml244
-rw-r--r--test/rexml/data/much_ado.xml6850
-rw-r--r--test/rexml/data/namespaces.xml18
-rw-r--r--test/rexml/data/nitf.xml67
-rw-r--r--test/rexml/data/numbers.xml18
-rw-r--r--test/rexml/data/ofbiz-issues-full-177.xml13971
-rw-r--r--test/rexml/data/pi.xml13
-rw-r--r--test/rexml/data/pi2.xml6
-rw-r--r--test/rexml/data/project.xml1
-rw-r--r--test/rexml/data/simple.xml2
-rw-r--r--test/rexml/data/stream_accents.xml4
-rw-r--r--test/rexml/data/t63-1.xmlbin0 -> 161690 bytes-rw-r--r--test/rexml/data/t63-2.svg2828
-rw-r--r--test/rexml/data/t75.xml31
-rw-r--r--test/rexml/data/test/tests.xml683
-rw-r--r--test/rexml/data/test/tests.xsl369
-rw-r--r--test/rexml/data/testNamespaces.xml22
-rw-r--r--test/rexml/data/testsrc.xml64
-rw-r--r--test/rexml/data/text.xml10
-rw-r--r--test/rexml/data/ticket_61.xml4
-rw-r--r--test/rexml/data/ticket_68.xml590
-rw-r--r--test/rexml/data/tutorial.xml678
-rw-r--r--test/rexml/data/underscore.xml6
-rw-r--r--test/rexml/data/utf16.xmlbin0 -> 207464 bytes-rw-r--r--test/rexml/data/web.xml42
-rw-r--r--test/rexml/data/web2.xml7
-rw-r--r--test/rexml/data/working.rss202
-rw-r--r--test/rexml/data/xmlfile-bug.xml15
-rw-r--r--test/rexml/data/xp.tst27
-rw-r--r--test/rexml/data/yahoo.xml80
-rw-r--r--test/rexml/listener.rb50
-rw-r--r--test/rexml/parse/test_document_type_declaration.rb49
-rw-r--r--test/rexml/parse/test_notation_declaration.rb99
-rw-r--r--test/rexml/parser/test_sax2.rb202
-rw-r--r--test/rexml/parser/test_tree.rb42
-rw-r--r--test/rexml/parser/test_ultra_light.rb69
-rw-r--r--test/rexml/rexml_test_utils.rb6
-rw-r--r--test/rexml/test_attributes.rb222
-rw-r--r--test/rexml/test_attributes_mixin.rb31
-rw-r--r--test/rexml/test_changing_encoding.rb44
-rw-r--r--test/rexml/test_comment.rb25
-rw-r--r--test/rexml/test_contrib.rb584
-rw-r--r--test/rexml/test_core.rb1467
-rw-r--r--test/rexml/test_doctype.rb106
-rw-r--r--test/rexml/test_document.rb403
-rw-r--r--test/rexml/test_elements.rb118
-rw-r--r--test/rexml/test_encoding.rb107
-rw-r--r--test/rexml/test_entity.rb205
-rw-r--r--test/rexml/test_functions.rb224
-rw-r--r--test/rexml/test_functions_number.rb34
-rw-r--r--test/rexml/test_jaxen.rb129
-rw-r--r--test/rexml/test_light.rb106
-rw-r--r--test/rexml/test_lightparser.rb15
-rw-r--r--test/rexml/test_listener.rb130
-rw-r--r--test/rexml/test_martin_fowler.rb39
-rw-r--r--test/rexml/test_namespace.rb40
-rw-r--r--test/rexml/test_order.rb109
-rw-r--r--test/rexml/test_preceding_sibling.rb40
-rw-r--r--test/rexml/test_pullparser.rb102
-rw-r--r--test/rexml/test_rexml_issuezilla.rb18
-rw-r--r--test/rexml/test_sax.rb286
-rw-r--r--test/rexml/test_stream.rb129
-rw-r--r--test/rexml/test_text.rb21
-rw-r--r--test/rexml/test_ticket_80.rb58
-rw-r--r--test/rexml/test_validation_rng.rb792
-rw-r--r--test/rexml/test_xml_declaration.rb35
-rw-r--r--test/rexml/xpath/test_attribute.rb29
-rw-r--r--test/rexml/xpath/test_axis_preceding_sibling.rb39
-rw-r--r--test/rexml/xpath/test_base.rb1089
-rw-r--r--test/rexml/xpath/test_node.rb42
-rw-r--r--test/rexml/xpath/test_predicate.rb82
-rw-r--r--test/rexml/xpath/test_text.rb74
-rw-r--r--test/rinda/test_rinda.rb569
-rw-r--r--test/rinda/test_tuplebag.rb172
-rw-r--r--test/ripper/dummyparser.rb220
-rw-r--r--test/ripper/test_files.rb23
-rw-r--r--test/ripper/test_filter.rb83
-rw-r--r--test/ripper/test_parser_events.rb1232
-rw-r--r--test/ripper/test_ripper.rb74
-rw-r--r--test/ripper/test_scanner_events.rb909
-rw-r--r--test/ripper/test_sexp.rb49
-rw-r--r--test/rss/rss-assertions.rb92
-rw-r--r--test/rss/rss-testcase.rb14
-rw-r--r--test/rss/test_1.0.rb151
-rw-r--r--test/rss/test_2.0.rb119
-rw-r--r--test/rss/test_accessor.rb34
-rw-r--r--test/rss/test_atom.rb42
-rw-r--r--test/rss/test_content.rb10
-rw-r--r--test/rss/test_dublincore.rb24
-rw-r--r--test/rss/test_image.rb2
-rw-r--r--test/rss/test_inherit.rb2
-rw-r--r--test/rss/test_itunes.rb2
-rw-r--r--test/rss/test_maker_0.9.rb70
-rw-r--r--test/rss/test_maker_1.0.rb78
-rw-r--r--test/rss/test_maker_2.0.rb146
-rw-r--r--test/rss/test_maker_atom_entry.rb28
-rw-r--r--test/rss/test_maker_atom_feed.rb67
-rw-r--r--test/rss/test_maker_content.rb4
-rw-r--r--test/rss/test_maker_dc.rb15
-rw-r--r--test/rss/test_maker_image.rb6
-rw-r--r--test/rss/test_maker_itunes.rb8
-rw-r--r--test/rss/test_maker_slash.rb2
-rw-r--r--test/rss/test_maker_sy.rb6
-rw-r--r--test/rss/test_maker_taxo.rb8
-rw-r--r--test/rss/test_maker_trackback.rb4
-rw-r--r--test/rss/test_maker_xml-stylesheet.rb8
-rw-r--r--test/rss/test_parser.rb12
-rw-r--r--test/rss/test_parser_1.0.rb21
-rw-r--r--test/rss/test_parser_2.0.rb2
-rw-r--r--test/rss/test_parser_atom_entry.rb2
-rw-r--r--test/rss/test_parser_atom_feed.rb2
-rw-r--r--test/rss/test_setup_maker_0.9.rb26
-rw-r--r--test/rss/test_setup_maker_1.0.rb86
-rw-r--r--test/rss/test_setup_maker_2.0.rb44
-rw-r--r--test/rss/test_setup_maker_atom_entry.rb2
-rw-r--r--test/rss/test_setup_maker_atom_feed.rb4
-rw-r--r--test/rss/test_setup_maker_itunes.rb3
-rw-r--r--test/rss/test_setup_maker_slash.rb2
-rw-r--r--test/rss/test_slash.rb2
-rw-r--r--test/rss/test_syndication.rb38
-rw-r--r--test/rss/test_taxonomy.rb16
-rw-r--r--test/rss/test_to_s.rb64
-rw-r--r--test/rss/test_trackback.rb30
-rw-r--r--test/rss/test_version.rb4
-rw-r--r--test/rss/test_xml-stylesheet.rb18
-rw-r--r--test/ruby/allpairs.rb102
-rw-r--r--test/ruby/beginmainend.rb2
-rw-r--r--test/ruby/enc/test_big5.rb28
-rw-r--r--test/ruby/enc/test_cp949.rb28
-rw-r--r--test/ruby/enc/test_emoji.rb442
-rw-r--r--test/ruby/enc/test_euc_jp.rb24
-rw-r--r--test/ruby/enc/test_euc_kr.rb36
-rw-r--r--test/ruby/enc/test_euc_tw.rb28
-rw-r--r--test/ruby/enc/test_gb18030.rb126
-rw-r--r--test/ruby/enc/test_gbk.rb28
-rw-r--r--test/ruby/enc/test_iso_8859.rb163
-rw-r--r--test/ruby/enc/test_koi8.rb22
-rw-r--r--test/ruby/enc/test_shift_jis.rb27
-rw-r--r--test/ruby/enc/test_utf16.rb384
-rw-r--r--test/ruby/enc/test_utf32.rb93
-rw-r--r--test/ruby/enc/test_windows_1251.rb16
-rw-r--r--test/ruby/enc/test_windows_1252.rb25
-rw-r--r--test/ruby/endblockwarn_rb (renamed from test/ruby/endblockwarn.rb)0
-rw-r--r--test/ruby/envutil.rb28
-rw-r--r--test/ruby/lbtest.rb49
-rw-r--r--test/ruby/marshaltestlib.rb192
-rw-r--r--test/ruby/sentence.rb668
-rw-r--r--test/ruby/suicide.rb2
-rw-r--r--test/ruby/test_alias.rb188
-rw-r--r--test/ruby/test_argf.rb878
-rw-r--r--test/ruby/test_arity.rb69
-rw-r--r--test/ruby/test_array.rb1417
-rw-r--r--test/ruby/test_assignment.rb783
-rw-r--r--test/ruby/test_autoload.rb207
-rw-r--r--test/ruby/test_backtrace.rb246
-rw-r--r--test/ruby/test_basicinstructions.rb700
-rw-r--r--test/ruby/test_beginendblock.rb190
-rw-r--r--test/ruby/test_bignum.rb627
-rw-r--r--test/ruby/test_call.rb19
-rw-r--r--test/ruby/test_case.rb75
-rw-r--r--test/ruby/test_class.rb421
-rw-r--r--test/ruby/test_clone.rb2
-rw-r--r--test/ruby/test_comparable.rb94
-rw-r--r--test/ruby/test_complex.rb1014
-rw-r--r--test/ruby/test_complex2.rb735
-rw-r--r--test/ruby/test_complexrational.rb407
-rw-r--r--test/ruby/test_const.rb49
-rw-r--r--test/ruby/test_continuation.rb134
-rw-r--r--test/ruby/test_defined.rb197
-rw-r--r--test/ruby/test_dir.rb308
-rw-r--r--test/ruby/test_dir_m17n.rb389
-rw-r--r--test/ruby/test_econv.rb927
-rw-r--r--test/ruby/test_encoding.rb126
-rw-r--r--test/ruby/test_enum.rb498
-rw-r--r--test/ruby/test_enumerator.rb537
-rw-r--r--test/ruby/test_env.rb506
-rw-r--r--test/ruby/test_eval.rb465
-rw-r--r--test/ruby/test_exception.rb700
-rw-r--r--test/ruby/test_fiber.rb347
-rw-r--r--test/ruby/test_file.rb453
-rw-r--r--test/ruby/test_file_exhaustive.rb975
-rw-r--r--test/ruby/test_fixnum.rb289
-rw-r--r--test/ruby/test_flip.rb41
-rw-r--r--test/ruby/test_float.rb636
-rw-r--r--test/ruby/test_fnmatch.rb131
-rw-r--r--test/ruby/test_gc.rb357
-rw-r--r--test/ruby/test_hash.rb785
-rw-r--r--test/ruby/test_ifunless.rb14
-rw-r--r--test/ruby/test_integer.rb793
-rw-r--r--test/ruby/test_integer_comb.rb631
-rw-r--r--test/ruby/test_io.rb3159
-rw-r--r--test/ruby/test_io_m17n.rb2618
-rw-r--r--test/ruby/test_iseq.rb164
-rw-r--r--test/ruby/test_iterator.rb150
-rw-r--r--test/ruby/test_keyword.rb599
-rw-r--r--test/ruby/test_lambda.rb180
-rw-r--r--test/ruby/test_lazy_enumerator.rb494
-rw-r--r--test/ruby/test_literal.rb470
-rw-r--r--test/ruby/test_m17n.rb1640
-rw-r--r--test/ruby/test_m17n_comb.rb1643
-rw-r--r--test/ruby/test_marshal.rb654
-rw-r--r--test/ruby/test_math.rb301
-rw-r--r--test/ruby/test_metaclass.rb167
-rw-r--r--test/ruby/test_method.rb861
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb25
-rw-r--r--test/ruby/test_module.rb2039
-rw-r--r--test/ruby/test_not.rb12
-rw-r--r--test/ruby/test_notimp.rb84
-rw-r--r--test/ruby/test_numeric.rb366
-rw-r--r--test/ruby/test_object.rb861
-rw-r--r--test/ruby/test_objectspace.rb76
-rw-r--r--test/ruby/test_optimization.rb385
-rw-r--r--test/ruby/test_pack.rb648
-rw-r--r--test/ruby/test_parse.rb882
-rw-r--r--test/ruby/test_path.rb57
-rw-r--r--test/ruby/test_pipe.rb17
-rw-r--r--test/ruby/test_primitive.rb423
-rw-r--r--test/ruby/test_proc.rb1255
-rw-r--r--test/ruby/test_process.rb2045
-rw-r--r--test/ruby/test_rand.rb556
-rw-r--r--test/ruby/test_range.rb576
-rw-r--r--test/ruby/test_rational.rb927
-rw-r--r--test/ruby/test_rational2.rb1386
-rw-r--r--test/ruby/test_readpartial.rb14
-rw-r--r--test/ruby/test_refinement.rb1450
-rw-r--r--test/ruby/test_regexp.rb1114
-rw-r--r--test/ruby/test_require.rb733
-rw-r--r--test/ruby/test_rubyoptions.rb803
-rw-r--r--test/ruby/test_rubyvm.rb17
-rw-r--r--test/ruby/test_settracefunc.rb1546
-rw-r--r--test/ruby/test_signal.rb312
-rw-r--r--test/ruby/test_sleep.rb12
-rw-r--r--test/ruby/test_sprintf.rb424
-rw-r--r--test/ruby/test_sprintf_comb.rb553
-rw-r--r--test/ruby/test_string.rb2299
-rw-r--r--test/ruby/test_stringchar.rb65
-rw-r--r--test/ruby/test_struct.rb363
-rw-r--r--test/ruby/test_super.rb400
-rw-r--r--test/ruby/test_symbol.rb225
-rw-r--r--test/ruby/test_syntax.rb698
-rw-r--r--test/ruby/test_system.rb185
-rw-r--r--test/ruby/test_thread.rb1051
-rw-r--r--test/ruby/test_threadgroup.rb57
-rw-r--r--test/ruby/test_time.rb990
-rw-r--r--test/ruby/test_time_tz.rb402
-rw-r--r--test/ruby/test_trace.rb46
-rw-r--r--test/ruby/test_transcode.rb2124
-rw-r--r--test/ruby/test_undef.rb37
-rw-r--r--test/ruby/test_unicode_escape.rb270
-rw-r--r--test/ruby/test_variable.rb87
-rw-r--r--test/ruby/test_weakmap.rb133
-rw-r--r--test/ruby/test_whileuntil.rb113
-rw-r--r--test/ruby/test_yield.rb417
-rw-r--r--test/ruby/ut_eof.rb16
-rw-r--r--test/rubygems/alternate_cert.pem18
-rw-r--r--test/rubygems/alternate_cert_32.pem18
-rw-r--r--test/rubygems/alternate_key.pem27
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/bogussources.rb8
-rw-r--r--test/rubygems/ca_cert.pem68
-rw-r--r--test/rubygems/child_cert.pem18
-rw-r--r--test/rubygems/child_cert_32.pem18
-rw-r--r--test/rubygems/child_key.pem27
-rw-r--r--test/rubygems/client.pem49
-rw-r--r--test/rubygems/data/gem-private_key.pem27
-rw-r--r--test/rubygems/data/gem-public_cert.pem20
-rw-r--r--test/rubygems/data/null-type.gemspec.rzbin0 -> 554 bytes-rw-r--r--test/rubygems/encrypted_private_key.pem30
-rw-r--r--test/rubygems/expired_cert.pem18
-rw-r--r--test/rubygems/fake_certlib/openssl.rb7
-rw-r--r--test/rubygems/fix_openssl_warnings.rb12
-rw-r--r--test/rubygems/foo/discover.rb (renamed from test/wsdl/datetime/datetime.rb)0
-rw-r--r--test/rubygems/future_cert.pem18
-rw-r--r--test/rubygems/future_cert_32.pem18
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/grandchild_cert.pem18
-rw-r--r--test/rubygems/grandchild_cert_32.pem18
-rw-r--r--test/rubygems/grandchild_key.pem27
-rw-r--r--test/rubygems/invalid_client.pem49
-rw-r--r--test/rubygems/invalid_issuer_cert.pem18
-rw-r--r--test/rubygems/invalid_issuer_cert_32.pem18
-rw-r--r--test/rubygems/invalid_key.pem27
-rw-r--r--test/rubygems/invalid_signer_cert.pem18
-rw-r--r--test/rubygems/invalid_signer_cert_32.pem18
-rw-r--r--test/rubygems/invalidchild_cert.pem18
-rw-r--r--test/rubygems/invalidchild_cert_32.pem18
-rw-r--r--test/rubygems/invalidchild_key.pem27
-rw-r--r--test/rubygems/plugin/exception/rubygems_plugin.rb2
-rw-r--r--test/rubygems/plugin/load/rubygems_plugin.rb3
-rw-r--r--test/rubygems/plugin/standarderror/rubygems_plugin.rb2
-rw-r--r--test/rubygems/private_key.pem27
-rw-r--r--test/rubygems/public_cert.pem18
-rw-r--r--test/rubygems/public_cert_32.pem18
-rw-r--r--test/rubygems/public_key.pem9
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb5
-rw-r--r--test/rubygems/rubygems_plugin.rb21
-rw-r--r--test/rubygems/sff/discover.rb (renamed from test/wsdl/qualified/lp.rb)0
-rw-r--r--test/rubygems/simple_gem.rb66
-rw-r--r--test/rubygems/specifications/bar-0.0.2.gemspec9
-rw-r--r--test/rubygems/specifications/foo-0.0.1.gemspecbin0 -> 269 bytes-rw-r--r--test/rubygems/ssl_cert.pem (renamed from test/soap/ssl/server.cert)0
-rw-r--r--test/rubygems/ssl_key.pem (renamed from test/soap/ssl/server.key)0
-rw-r--r--test/rubygems/test_bundled_ca.rb60
-rw-r--r--test/rubygems/test_config.rb14
-rw-r--r--test/rubygems/test_deprecate.rb76
-rw-r--r--test/rubygems/test_gem.rb1576
-rw-r--r--test/rubygems/test_gem_available_set.rb128
-rw-r--r--test/rubygems/test_gem_command.rb243
-rw-r--r--test/rubygems/test_gem_command_manager.rb263
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb110
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb670
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb167
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb239
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb221
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb153
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb126
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb50
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb74
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb997
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb32
-rw-r--r--test/rubygems/test_gem_commands_open_command.rb46
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb204
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb462
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb262
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb668
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb17
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb59
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb136
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb248
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb250
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb40
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb281
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb210
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb543
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb85
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb97
-rw-r--r--test/rubygems/test_gem_config_file.rb467
-rw-r--r--test/rubygems/test_gem_dependency.rb357
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb1208
-rw-r--r--test/rubygems/test_gem_dependency_list.rb259
-rw-r--r--test/rubygems/test_gem_dependency_resolution_error.rb28
-rw-r--r--test/rubygems/test_gem_doctor.rb168
-rw-r--r--test/rubygems/test_gem_ext_builder.rb334
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb84
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb82
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb206
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb64
-rw-r--r--test/rubygems/test_gem_gem_runner.rb68
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb234
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb61
-rw-r--r--test/rubygems/test_gem_indexer.rb366
-rw-r--r--test/rubygems/test_gem_install_update_options.rb184
-rw-r--r--test/rubygems/test_gem_installer.rb1533
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb133
-rw-r--r--test/rubygems/test_gem_name_tuple.rb44
-rw-r--r--test/rubygems/test_gem_package.rb824
-rw-r--r--test/rubygems/test_gem_package_old.rb89
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb146
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb89
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb134
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb254
-rw-r--r--test/rubygems/test_gem_package_task.rb80
-rw-r--r--test/rubygems/test_gem_path_support.rb84
-rw-r--r--test/rubygems/test_gem_platform.rb296
-rw-r--r--test/rubygems/test_gem_rdoc.rb269
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb987
-rw-r--r--test/rubygems/test_gem_request.rb362
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb120
-rw-r--r--test/rubygems/test_gem_request_set.rb597
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb823
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb1276
-rw-r--r--test/rubygems/test_gem_requirement.rb376
-rw-r--r--test/rubygems/test_gem_resolver.rb733
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb73
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb208
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb144
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb137
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb45
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb87
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb84
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb189
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb112
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb89
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb89
-rw-r--r--test/rubygems/test_gem_resolver_installed_specification.rb49
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb261
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb45
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb63
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb98
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb20
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb64
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb83
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb83
-rw-r--r--test/rubygems/test_gem_security.rb306
-rw-r--r--test/rubygems/test_gem_security_policy.rb540
-rw-r--r--test/rubygems/test_gem_security_signer.rb208
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb98
-rw-r--r--test/rubygems/test_gem_server.rb404
-rw-r--r--test/rubygems/test_gem_silent_ui.rb116
-rw-r--r--test/rubygems/test_gem_source.rb241
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb19
-rw-r--r--test/rubygems/test_gem_source_git.rb308
-rw-r--r--test/rubygems/test_gem_source_installed.rb36
-rw-r--r--test/rubygems/test_gem_source_list.rb111
-rw-r--r--test/rubygems/test_gem_source_local.rb106
-rw-r--r--test/rubygems/test_gem_source_lock.rb114
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb75
-rw-r--r--test/rubygems/test_gem_source_vendor.rb31
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb310
-rw-r--r--test/rubygems/test_gem_specification.rb3138
-rw-r--r--test/rubygems/test_gem_stream_ui.rb238
-rw-r--r--test/rubygems/test_gem_stub_specification.rb199
-rw-r--r--test/rubygems/test_gem_text.rb74
-rw-r--r--test/rubygems/test_gem_uninstaller.rb483
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb32
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb28
-rw-r--r--test/rubygems/test_gem_util.rb31
-rw-r--r--test/rubygems/test_gem_validator.rb45
-rw-r--r--test/rubygems/test_gem_version.rb213
-rw-r--r--test/rubygems/test_gem_version_option.rb151
-rw-r--r--test/rubygems/test_kernel.rb85
-rw-r--r--test/rubygems/test_require.rb275
-rw-r--r--test/rubygems/wrong_key_cert.pem18
-rw-r--r--test/rubygems/wrong_key_cert_32.pem18
-rw-r--r--test/runner.rb46
-rw-r--r--test/scanf/data.txt6
-rw-r--r--test/scanf/test_scanf.rb303
-rw-r--r--test/scanf/test_scanfblocks.rb81
-rw-r--r--test/scanf/test_scanfio.rb20
-rw-r--r--test/sdbm/test_sdbm.rb145
-rw-r--r--test/shell/test_command_processor.rb68
-rw-r--r--test/soap/asp.net/hello.wsdl96
-rw-r--r--test/soap/asp.net/test_aspdotnet.rb111
-rw-r--r--test/soap/calc/calc.rb17
-rw-r--r--test/soap/calc/calc2.rb29
-rw-r--r--test/soap/calc/server.cgi13
-rw-r--r--test/soap/calc/server.rb17
-rw-r--r--test/soap/calc/server2.rb20
-rw-r--r--test/soap/calc/test_calc.rb49
-rw-r--r--test/soap/calc/test_calc2.rb53
-rw-r--r--test/soap/calc/test_calc_cgi.rb69
-rw-r--r--test/soap/fault/test_customfault.rb58
-rw-r--r--test/soap/header/server.cgi119
-rw-r--r--test/soap/header/test_authheader.rb240
-rw-r--r--test/soap/header/test_authheader_cgi.rb121
-rw-r--r--test/soap/header/test_simplehandler.rb116
-rw-r--r--test/soap/helloworld/hw_s.rb16
-rw-r--r--test/soap/helloworld/test_helloworld.rb40
-rw-r--r--test/soap/marshal/test_digraph.rb56
-rw-r--r--test/soap/marshal/test_marshal.rb26
-rw-r--r--test/soap/marshal/test_struct.rb47
-rw-r--r--test/soap/ssl/README1
-rw-r--r--test/soap/ssl/ca.cert23
-rw-r--r--test/soap/ssl/client.cert19
-rw-r--r--test/soap/ssl/client.key15
-rw-r--r--test/soap/ssl/sslsvr.rb57
-rw-r--r--test/soap/ssl/subca.cert21
-rw-r--r--test/soap/ssl/test_ssl.rb204
-rw-r--r--test/soap/struct/test_struct.rb77
-rw-r--r--test/soap/swa/test_file.rb73
-rw-r--r--test/soap/test_basetype.rb970
-rw-r--r--test/soap/test_envelopenamespace.rb92
-rw-r--r--test/soap/test_httpconfigloader.rb39
-rw-r--r--test/soap/test_mapping.rb59
-rw-r--r--test/soap/test_no_indent.rb86
-rw-r--r--test/soap/test_property.rb424
-rw-r--r--test/soap/test_soapelement.rb122
-rw-r--r--test/soap/test_streamhandler.rb209
-rw-r--r--test/soap/test_styleuse.rb333
-rw-r--r--test/soap/wsdlDriver/README.txt2
-rw-r--r--test/soap/wsdlDriver/calc.wsdl126
-rw-r--r--test/soap/wsdlDriver/document.wsdl54
-rw-r--r--test/soap/wsdlDriver/echo_version.rb20
-rw-r--r--test/soap/wsdlDriver/simpletype.wsdl63
-rw-r--r--test/soap/wsdlDriver/test_calc.rb100
-rw-r--r--test/soap/wsdlDriver/test_document.rb78
-rw-r--r--test/soap/wsdlDriver/test_simpletype.rb87
-rw-r--r--test/socket/test_addrinfo.rb658
-rw-r--r--test/socket/test_ancdata.rb66
-rw-r--r--test/socket/test_basicsocket.rb107
-rw-r--r--test/socket/test_nonblock.rb172
-rw-r--r--test/socket/test_socket.rb675
-rw-r--r--test/socket/test_sockopt.rb78
-rw-r--r--test/socket/test_tcp.rb79
-rw-r--r--test/socket/test_udp.rb72
-rw-r--r--test/socket/test_unix.rb561
-rw-r--r--test/stringio/test_stringio.rb576
-rw-r--r--test/strscan/test_stringscanner.rb241
-rw-r--r--test/syslog/test_syslog_logger.rb572
-rw-r--r--test/test_abbrev.rb54
-rw-r--r--test/test_cmath.rb16
-rw-r--r--test/test_delegate.rb240
-rw-r--r--test/test_find.rb301
-rw-r--r--test/test_forwardable.rb229
-rw-r--r--test/test_ipaddr.rb273
-rw-r--r--test/test_mathn.rb119
-rw-r--r--test/test_mutex_m.rb26
-rw-r--r--test/test_open3.rb268
-rw-r--r--test/test_pp.rb195
-rw-r--r--test/test_prettyprint.rb519
-rw-r--r--test/test_prime.rb174
-rw-r--r--test/test_pstore.rb144
-rw-r--r--test/test_pty.rb241
-rw-r--r--test/test_rbconfig.rb53
-rw-r--r--test/test_securerandom.rb185
-rw-r--r--test/test_set.rb697
-rw-r--r--test/test_shellwords.rb61
-rw-r--r--test/test_singleton.rb103
-rw-r--r--test/test_syslog.rb189
-rw-r--r--test/test_tempfile.rb343
-rw-r--r--test/test_time.rb500
-rw-r--r--test/test_timeout.rb100
-rw-r--r--test/test_tmpdir.rb39
-rw-r--r--test/test_tracer.rb60
-rw-r--r--test/test_tsort.rb113
-rw-r--r--test/test_unicode_normalize.rb184
-rw-r--r--test/test_weakref.rb71
-rw-r--r--test/test_win32api.rb23
-rw-r--r--test/testunit/collector/test_dir.rb406
-rw-r--r--test/testunit/collector/test_objectspace.rb98
-rw-r--r--test/testunit/runit/test_assert.rb402
-rw-r--r--test/testunit/runit/test_testcase.rb91
-rw-r--r--test/testunit/runit/test_testresult.rb144
-rw-r--r--test/testunit/runit/test_testsuite.rb49
-rw-r--r--test/testunit/test4test_hideskip.rb9
-rw-r--r--test/testunit/test4test_redefinition.rb13
-rw-r--r--test/testunit/test4test_sorting.rb17
-rw-r--r--test/testunit/test_assertion.rb8
-rw-r--r--test/testunit/test_assertions.rb528
-rw-r--r--test/testunit/test_error.rb26
-rw-r--r--test/testunit/test_failure.rb33
-rw-r--r--test/testunit/test_hideskip.rb16
-rw-r--r--test/testunit/test_parallel.rb191
-rw-r--r--test/testunit/test_rake_integration.rb35
-rw-r--r--test/testunit/test_redefinition.rb15
-rw-r--r--test/testunit/test_sorting.rb17
-rw-r--r--test/testunit/test_testcase.rb275
-rw-r--r--test/testunit/test_testresult.rb104
-rw-r--r--test/testunit/test_testsuite.rb129
-rw-r--r--test/testunit/tests_for_parallel/ptest_first.rb7
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb29
-rw-r--r--test/testunit/tests_for_parallel/ptest_second.rb11
-rw-r--r--test/testunit/tests_for_parallel/ptest_third.rb10
-rw-r--r--test/testunit/tests_for_parallel/runner.rb13
-rw-r--r--test/testunit/util/test_backtracefilter.rb41
-rw-r--r--test/testunit/util/test_observable.rb102
-rw-r--r--test/testunit/util/test_procwrapper.rb36
-rwxr-xr-xtest/thread/lbtest.rb51
-rw-r--r--test/thread/test_cv.rb221
-rw-r--r--test/thread/test_queue.rb280
-rw-r--r--test/thread/test_sync.rb63
-rw-r--r--test/thread/test_thread.rb90
-rw-r--r--test/uri/test_common.rb171
-rw-r--r--test/uri/test_ftp.rb20
-rw-r--r--test/uri/test_generic.rb242
-rw-r--r--test/uri/test_http.rb5
-rw-r--r--test/uri/test_ldap.rb32
-rw-r--r--test/uri/test_mailto.rb53
-rw-r--r--test/uri/test_parser.rb47
-rw-r--r--test/webrick/test_cgi.rb136
-rw-r--r--test/webrick/test_cookie.rb27
-rw-r--r--test/webrick/test_filehandler.rb201
-rw-r--r--test/webrick/test_htmlutils.rb20
-rw-r--r--test/webrick/test_httpauth.rb202
-rw-r--r--test/webrick/test_httpproxy.rb284
-rw-r--r--test/webrick/test_httprequest.rb145
-rw-r--r--test/webrick/test_httpresponse.rb149
-rw-r--r--test/webrick/test_httpserver.rb224
-rw-r--r--test/webrick/test_httputils.rb40
-rw-r--r--test/webrick/test_server.rb99
-rw-r--r--test/webrick/test_utils.rb64
-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.rb9
-rw-r--r--test/win32ole/orig_data.csv5
-rw-r--r--test/win32ole/test_err_in_callback.rb55
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb65
-rw-r--r--test/win32ole/test_nil2vtempty.rb36
-rw-r--r--test/win32ole/test_ole_methods.rb36
-rw-r--r--test/win32ole/test_propertyputref.rb30
-rw-r--r--test/win32ole/test_thread.rb33
-rw-r--r--test/win32ole/test_win32ole.rb564
-rw-r--r--test/win32ole/test_win32ole_event.rb391
-rw-r--r--test/win32ole/test_win32ole_method.rb146
-rw-r--r--test/win32ole/test_win32ole_param.rb106
-rw-r--r--test/win32ole/test_win32ole_record.rb313
-rw-r--r--test/win32ole/test_win32ole_type.rb249
-rw-r--r--test/win32ole/test_win32ole_typelib.rb116
-rw-r--r--test/win32ole/test_win32ole_variable.rb61
-rw-r--r--test/win32ole/test_win32ole_variant.rb725
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb35
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb68
-rw-r--r--test/win32ole/test_word.rb71
-rw-r--r--test/wsdl/any/any.wsdl50
-rw-r--r--test/wsdl/any/expectedDriver.rb54
-rw-r--r--test/wsdl/any/expectedEcho.rb14
-rw-r--r--test/wsdl/any/expectedService.rb52
-rw-r--r--test/wsdl/any/test_any.rb58
-rw-r--r--test/wsdl/axisArray/axisArray.wsdl60
-rw-r--r--test/wsdl/axisArray/itemList.rb27
-rw-r--r--test/wsdl/axisArray/test_axisarray.rb69
-rw-r--r--test/wsdl/datetime/DatetimeService.rb44
-rw-r--r--test/wsdl/datetime/datetime.wsdl45
-rw-r--r--test/wsdl/datetime/datetimeServant.rb21
-rw-r--r--test/wsdl/datetime/test_datetime.rb82
-rw-r--r--test/wsdl/document/document.wsdl74
-rw-r--r--test/wsdl/document/echo.rb92
-rw-r--r--test/wsdl/document/number.wsdl54
-rw-r--r--test/wsdl/document/ping_nosoapaction.wsdl66
-rw-r--r--test/wsdl/document/test_nosoapaction.rb109
-rw-r--r--test/wsdl/document/test_number.rb99
-rw-r--r--test/wsdl/document/test_rpc.rb177
-rw-r--r--test/wsdl/emptycomplextype.wsdl31
-rw-r--r--test/wsdl/map/map.wsdl92
-rw-r--r--test/wsdl/map/map.xml43
-rw-r--r--test/wsdl/map/test_map.rb99
-rw-r--r--test/wsdl/marshal/person.wsdl21
-rw-r--r--test/wsdl/marshal/person_org.rb22
-rw-r--r--test/wsdl/marshal/test_wsdlmarshal.rb80
-rw-r--r--test/wsdl/multiplefault.wsdl68
-rw-r--r--test/wsdl/qualified/lp.wsdl47
-rw-r--r--test/wsdl/qualified/lp.xsd26
-rw-r--r--test/wsdl/qualified/np.wsdl50
-rw-r--r--test/wsdl/qualified/test_qualified.rb154
-rw-r--r--test/wsdl/qualified/test_unqualified.rb143
-rw-r--r--test/wsdl/raa/RAA.rb243
-rw-r--r--test/wsdl/raa/RAAServant.rb99
-rw-r--r--test/wsdl/raa/RAAService.rb100
-rw-r--r--test/wsdl/raa/README.txt8
-rw-r--r--test/wsdl/raa/raa.wsdl264
-rw-r--r--test/wsdl/raa/server.rb103
-rw-r--r--test/wsdl/raa/test_raa.rb71
-rw-r--r--test/wsdl/ref/expectedProduct.rb90
-rw-r--r--test/wsdl/ref/product.wsdl86
-rw-r--r--test/wsdl/ref/test_ref.rb54
-rw-r--r--test/wsdl/rpc/echoDriver.rb55
-rw-r--r--test/wsdl/rpc/echo_serviceClient.rb23
-rw-r--r--test/wsdl/rpc/rpc.wsdl75
-rw-r--r--test/wsdl/rpc/test-rpc-lit.wsdl364
-rw-r--r--test/wsdl/rpc/test-rpc-lit12.wsdl455
-rw-r--r--test/wsdl/rpc/test_rpc.rb118
-rw-r--r--test/wsdl/rpc/test_rpc_lit.rb399
-rw-r--r--test/wsdl/simpletype/rpc/expectedClient.rb34
-rw-r--r--test/wsdl/simpletype/rpc/expectedDriver.rb62
-rw-r--r--test/wsdl/simpletype/rpc/expectedEchoVersion.rb23
-rw-r--r--test/wsdl/simpletype/rpc/expectedServant.rb32
-rw-r--r--test/wsdl/simpletype/rpc/expectedService.rb60
-rw-r--r--test/wsdl/simpletype/rpc/rpc.wsdl80
-rw-r--r--test/wsdl/simpletype/rpc/test_rpc.rb62
-rw-r--r--test/wsdl/simpletype/simpletype.wsdl95
-rw-r--r--test/wsdl/simpletype/test_simpletype.rb99
-rw-r--r--test/wsdl/soap/soapbodyparts.wsdl103
-rw-r--r--test/wsdl/soap/test_soapbodyparts.rb79
-rw-r--r--test/wsdl/test_emptycomplextype.rb21
-rw-r--r--test/wsdl/test_fault.rb51
-rw-r--r--test/wsdl/test_multiplefault.rb39
-rw-r--r--test/xmlrpc/data/blog.xml18
-rw-r--r--test/xmlrpc/htpasswd2
-rw-r--r--test/xmlrpc/test_client.rb322
-rw-r--r--test/xmlrpc/test_cookie.rb28
-rw-r--r--test/xmlrpc/test_datetime.rb66
-rw-r--r--test/xmlrpc/test_features.rb10
-rw-r--r--test/xmlrpc/test_marshal.rb25
-rw-r--r--test/xmlrpc/test_parser.rb20
-rw-r--r--test/xmlrpc/test_webrick_server.rb77
-rw-r--r--test/xmlrpc/webrick_testing.rb68
-rw-r--r--test/xsd/codegen/test_classdef.rb214
-rw-r--r--test/xsd/noencoding.xml4
-rw-r--r--test/xsd/test_noencoding.rb32
-rw-r--r--test/xsd/test_xmlschemaparser.rb22
-rw-r--r--test/xsd/test_xsd.rb1511
-rw-r--r--test/xsd/xmlschema.xml12
-rw-r--r--test/yaml/test_yaml.rb1292
-rw-r--r--test/yaml/test_yamlstore.rb74
-rw-r--r--test/zlib/test_zlib.rb1071
-rw-r--r--thread.c5261
-rw-r--r--thread_pthread.c1733
-rw-r--r--thread_pthread.h54
-rw-r--r--thread_win32.c802
-rw-r--r--thread_win32.h36
-rw-r--r--time.c5414
-rw-r--r--timev.h42
-rw-r--r--tool/asm_parse.rb51
-rwxr-xr-xtool/bisect.sh42
-rwxr-xr-xtool/build-transcode16
-rwxr-xr-xtool/change_maker.rb34
-rw-r--r--tool/downloader.rb178
-rw-r--r--tool/enc-emoji-citrus-gen.rb131
-rw-r--r--tool/enc-emoji4unicode.rb133
-rwxr-xr-xtool/enc-unicode.rb371
-rw-r--r--tool/eval.rb159
-rwxr-xr-xtool/expand-config.rb7
-rwxr-xr-xtool/extlibs.rb143
-rw-r--r--tool/fake.rb32
-rwxr-xr-xtool/file2lastrev.rb68
-rwxr-xr-xtool/gen_dummy_probes.rb28
-rwxr-xr-xtool/gen_ruby_tapset.rb105
-rw-r--r--tool/generic_erb.rb42
-rwxr-xr-xtool/id2token.rb24
-rwxr-xr-xtool/ifchange61
-rwxr-xr-xtool/insns2vm.rb15
-rw-r--r--tool/install-sh17
-rwxr-xr-xtool/instruction.rb1343
-rw-r--r--tool/jisx0208.rb84
-rwxr-xr-xtool/make-snapshot378
-rwxr-xr-xtool/mdoc2man.rb465
-rwxr-xr-xtool/merger.rb259
-rwxr-xr-xtool/mkconfig.rb290
-rwxr-xr-xtool/mkrunnable.rb122
-rwxr-xr-xtool/node_name.rb6
-rw-r--r--tool/parse.rb13
-rw-r--r--tool/probes_to_wiki.rb16
-rwxr-xr-xtool/rbinstall.rb763
-rwxr-xr-xtool/rbuninstall.rb67
-rwxr-xr-xtool/redmine-backporter.rb416
-rwxr-xr-xtool/release.sh38
-rwxr-xr-xtool/rmdirs11
-rwxr-xr-xtool/rubytest.rb30
-rwxr-xr-xtool/runruby.rb100
-rwxr-xr-xtool/strip-rdoc.rb23
-rw-r--r--tool/test/test_jisx0208.rb40
-rw-r--r--tool/transcode-tblgen.rb1074
-rwxr-xr-xtool/update-deps615
-rw-r--r--tool/vcs.rb256
-rw-r--r--tool/vpath.rb87
-rw-r--r--tool/vtlh.rb15
-rwxr-xr-xtool/ytab.sed37
-rw-r--r--transcode.c4575
-rw-r--r--transcode_data.h123
-rw-r--r--util.c1030
-rw-r--r--util.h67
-rw-r--r--variable.c2365
-rw-r--r--version.c98
-rw-r--r--version.h70
-rw-r--r--vm.c3088
-rw-r--r--vm_args.c813
-rw-r--r--vm_backtrace.c1376
-rw-r--r--vm_core.h1163
-rw-r--r--vm_debug.h37
-rw-r--r--vm_dump.c1065
-rw-r--r--vm_eval.c2185
-rw-r--r--vm_exec.c170
-rw-r--r--vm_exec.h182
-rw-r--r--vm_insnhelper.c2151
-rw-r--r--vm_insnhelper.h233
-rw-r--r--vm_method.c1796
-rw-r--r--vm_opts.h56
-rw-r--r--vm_trace.c1583
-rw-r--r--vms/config.h102
-rw-r--r--vms/vms.h10
-rw-r--r--vms/vmsruby_private.c52
-rw-r--r--vms/vmsruby_private.h7
-rw-r--r--vsnprintf.c1347
-rw-r--r--win32/Makefile.sub914
-rw-r--r--win32/README.win3283
-rwxr-xr-xwin32/configure.bat197
-rw-r--r--win32/dir.h26
-rw-r--r--win32/enc-setup.mak10
-rw-r--r--win32/file.c682
-rwxr-xr-xwin32/ifchange.bat77
-rwxr-xr-xwin32/makedirs.bat3
-rwxr-xr-xwin32/mkexports.rb187
-rwxr-xr-xwin32/resource.rb32
-rwxr-xr-xwin32/rm.bat12
-rwxr-xr-xwin32/rmdirs.bat29
-rw-r--r--win32/rtname.cmd18
-rw-r--r--win32/setup.mak205
-rw-r--r--win32/stub.c42
-rw-r--r--win32/win32.c6043
-rw-r--r--win32/win32.h556
-rw-r--r--win32/winmain.c4
-rw-r--r--wince/Makefile.sub46
-rw-r--r--wince/README.wince121
-rw-r--r--wince/assert.c11
-rw-r--r--wince/assert.h6
-rwxr-xr-xwince/configure.bat102
-rw-r--r--wince/direct.c54
-rw-r--r--wince/direct.h22
-rw-r--r--wince/errno.c11
-rw-r--r--wince/errno.h55
-rw-r--r--wince/fcntl.h42
-rw-r--r--wince/io.h76
-rw-r--r--wince/io_wce.c230
-rw-r--r--wince/process.h46
-rw-r--r--wince/process_wce.c47
-rw-r--r--wince/setup.mak245
-rw-r--r--wince/signal.h71
-rw-r--r--wince/signal_wce.c26
-rw-r--r--wince/stddef.h5
-rw-r--r--wince/stdio.c36
-rw-r--r--wince/stdlib.c57
-rw-r--r--wince/string_wce.c89
-rw-r--r--wince/sys/stat.c102
-rw-r--r--wince/sys/stat.h68
-rw-r--r--wince/sys/timeb.c25
-rw-r--r--wince/sys/timeb.h26
-rw-r--r--wince/sys/types.h60
-rw-r--r--wince/sys/utime.c44
-rw-r--r--wince/sys/utime.h27
-rw-r--r--wince/time.h63
-rw-r--r--wince/time_wce.c301
-rw-r--r--wince/varargs.h34
-rw-r--r--wince/wince.c583
-rw-r--r--wince/wince.h191
-rw-r--r--wince/wincemain.c19
-rw-r--r--wince/wincon.h7
-rw-r--r--wince/winsock2.c338
-rw-r--r--x68/_dtos18.c250
-rw-r--r--x68/_round.c45
-rw-r--r--x68/fconvert.c81
-rw-r--r--x68/select.c167
4439 files changed, 1408871 insertions, 266630 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index a72211d03f..0000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,48 +0,0 @@
-*.bak
-*.orig
-*.rej
-*.sav
-*~
-.*.list
-.*.time
-.ccmalloc
-.ppack
-.ext
-.git
-.svn
-.pc
-COPYING.LIB
-ChangeLog.pre-alpha
-ChangeLog.pre1_1
-Makefile
-README.fat-patch
-README.v6
-README.atheos
-archive
-autom4te*.cache
-automake
-beos
-config.cache
-config.h
-config.h.in
-config.log
-config.status
-configure
-libruby.so.*
-miniruby
-newdate.rb
-newver.rb
-parse.c
-patches
-ppack
-preview
-rbconfig.rb
-repack
-riscos
-rubicon
-ruby
-ruby-man.rd.gz
-tmp
-web
-y.output
-y.tab.c
diff --git a/.document b/.document
index 230c50e387..9a5067bc52 100644
--- a/.document
+++ b/.document
@@ -6,11 +6,23 @@
# Process all the C source files
*.c
-# the lib/ directory (which has its own .document file)
+# prelude
+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
+ChangeLog
+
+NEWS
+
+README
+README.EXT
+README.EXT.ja
+README.ja
+
+doc
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..67abf4b978
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+tab_width = 8
+indent_style = tab
+indent_size = 4
+
+[**.bat]
+end_of_line = crlf
+
+[**.rb]
+indent_style = space
+indent_size = 2
diff --git a/.gdbinit b/.gdbinit
new file mode 100644
index 0000000000..d1279ea046
--- /dev/null
+++ b/.gdbinit
@@ -0,0 +1,916 @@
+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
+ 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
+ else
+ if ($arg0) == RUBY_Qfalse
+ echo false\n
+ else
+ if ($arg0) == RUBY_Qtrue
+ echo true\n
+ else
+ if ($arg0) == RUBY_Qnil
+ echo nil\n
+ else
+ if ($arg0) == RUBY_Qundef
+ echo undef\n
+ 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)
+ 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
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_NIL
+ printf "%sT_NIL%s: ", $color_type, $color_end
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
+ printf "%sT_OBJECT%s: ", $color_type, $color_end
+ 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
+ rp_class $arg0
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
+ printf "%sT_ICLASS%s: ", $color_type, $color_end
+ rp_class $arg0
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
+ printf "%sT_MODULE%s: ", $color_type, $color_end
+ 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)
+ 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
+ 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
+ set print address off
+ output (char *)(($rsflags & RUBY_FL_USER1) ? \
+ ((struct RString*)$regsrc)->as.heap.ptr : \
+ ((struct RString*)$regsrc)->as.ary)
+ set print address on
+ printf " len:%ld ", ($rsflags & RUBY_FL_USER1) ? \
+ ((struct RString*)$regsrc)->as.heap.len : \
+ (($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ if $flags & RUBY_FL_USER6
+ printf "(none) "
+ end
+ if $flags & RUBY_FL_USER5
+ printf "(literal) "
+ end
+ if $flags & RUBY_FL_USER4
+ printf "(fixed) "
+ end
+ printf "encoding:%d ", ($flags & RUBY_ENCODING_MASK) >> RUBY_ENCODING_SHIFT
+ print (struct RRegexp *)($arg0)
+ else
+ 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 "(embed) "
+ if ($len == 0)
+ printf "{(empty)} "
+ else
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len
+ printf " "
+ end
+ else
+ set $len = ((struct RArray*)($arg0))->as.heap.len
+ printf "%sT_ARRAY%s: len=%ld ", $color_type, $color_end, $len
+ if ($flags & RUBY_FL_USER2)
+ printf "(shared) shared="
+ output/x ((struct RArray*)($arg0))->as.heap.aux.shared
+ printf " "
+ else
+ printf "(ownership) capa=%ld ", ((struct RArray*)($arg0))->as.heap.aux.capa
+ end
+ if ($len == 0)
+ printf "{(empty)} "
+ else
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len
+ printf " "
+ end
+ end
+ print (struct RArray *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FIXNUM
+ printf "%sT_FIXNUM%s: ", $color_type, $color_end
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_HASH
+ printf "%sT_HASH%s: ", $color_type, $color_end,
+ 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, \
+ (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ ($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
+ ((struct RStruct *)($arg0))->as.heap.len)
+ print (struct RStruct *)($arg0)
+ x/xw (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ ((struct RStruct *)($arg0))->as.ary : \
+ ((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, \
+ (($flags & RUBY_FL_USER1) != 0), \
+ (($flags & RUBY_FL_USER2) ? \
+ ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
+ ((struct RBignum*)($arg0))->as.heap.len)
+ if $flags & RUBY_FL_USER2
+ printf "(embed) "
+ end
+ print (struct RBignum *)($arg0)
+ x/xw (($flags & RUBY_FL_USER2) ? \
+ ((struct RBignum*)($arg0))->as.ary : \
+ ((struct RBignum*)($arg0))->as.heap.digits)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
+ printf "%sT_RATIONAL%s: ", $color_type, $color_end
+ print (struct RRational *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_COMPLEX
+ printf "%sT_COMPLEX%s: ", $color_type, $color_end
+ print (struct RComplex *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FILE
+ printf "%sT_FILE%s: ", $color_type, $color_end
+ 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
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_FALSE
+ printf "%sT_FALSE%s: ", $color_type, $color_end
+ 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
+ print (struct RTypedData *)($arg0)
+ else
+ printf "%sT_DATA%s: ", $color_type, $color_end
+ print (struct RData *)($arg0)
+ end
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_MATCH
+ printf "%sT_MATCH%s: ", $color_type, $color_end
+ 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
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_UNDEF
+ printf "%sT_UNDEF%s: ", $color_type, $color_end
+ print (struct RBasic *)($arg0)
+ else
+ if ($flags & RUBY_T_MASK) == RUBY_T_NODE
+ printf "%sT_NODE%s(", $color_type, $color_end
+ 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
+ print (struct RData *)($arg0)
+ else
+ printf "%sunknown%s: ", $color_type, $color_end
+ print (struct RBasic *)($arg0)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ 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
+ end
+ printf "\n"
+ rb_classname $arg0
+ print *(struct RClass *)($arg0)
+ print *((struct RClass *)($arg0))->ptr
+end
+document rp_class
+ Print the content of a Class/Module.
+end
+
+define nd_type
+ print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
+end
+document nd_type
+ Print a Ruby' node type.
+end
+
+define nd_file
+ print ((NODE*)($arg0))->nd_file
+end
+document nd_file
+ Print the source file name of a node.
+end
+
+define nd_line
+ print ((unsigned int)((((NODE*)($arg0))->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK))
+end
+document nd_line
+ Print the source line number of a node.
+end
+
+# Print members of ruby node.
+
+define nd_head
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_alen
+ printf "%su2.argc%s: ", $color_highlite, $color_end
+ p ($arg0).u2.argc
+end
+
+define nd_next
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_cond
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_body
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+define nd_else
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_orig
+ printf "%su3.value%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.value
+end
+
+
+define nd_resq
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+define nd_ensr
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_1st
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_2nd
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+
+define nd_stts
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+
+define nd_entry
+ printf "%su3.entry%s: ", $color_highlite, $color_end
+ p ($arg0).u3.entry
+end
+
+define nd_vid
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_cflag
+ printf "%su2.id%s: ", $color_highlite, $color_end
+ p ($arg0).u2.id
+end
+
+define nd_cval
+ printf "%su3.value%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.value
+end
+
+
+define nd_cnt
+ printf "%su3.cnt%s: ", $color_highlite, $color_end
+ p ($arg0).u3.cnt
+end
+
+define nd_tbl
+ printf "%su1.tbl%s: ", $color_highlite, $color_end
+ p ($arg0).u1.tbl
+end
+
+
+define nd_var
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_ibdy
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+define nd_iter
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_value
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+define nd_aid
+ printf "%su3.id%s: ", $color_highlite, $color_end
+ p ($arg0).u3.id
+end
+
+
+define nd_lit
+ printf "%su1.value%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.value
+end
+
+
+define nd_frml
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_rest
+ printf "%su2.argc%s: ", $color_highlite, $color_end
+ p ($arg0).u2.argc
+end
+
+define nd_opt
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+
+define nd_recv
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_mid
+ printf "%su2.id%s: ", $color_highlite, $color_end
+ p ($arg0).u2.id
+end
+
+define nd_args
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_noex
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_defn
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_old
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_new
+ printf "%su2.id%s: ", $color_highlite, $color_end
+ p ($arg0).u2.id
+end
+
+
+define nd_cfnc
+ printf "%su1.cfunc%s: ", $color_highlite, $color_end
+ p ($arg0).u1.cfunc
+end
+
+define nd_argc
+ printf "%su2.argc%s: ", $color_highlite, $color_end
+ p ($arg0).u2.argc
+end
+
+
+define nd_cname
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_super
+ printf "%su3.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u3.node
+end
+
+
+define nd_modl
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_clss
+ printf "%su1.value%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.value
+end
+
+
+define nd_beg
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
+define nd_end
+ printf "%su2.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.node
+end
+
+define nd_state
+ printf "%su3.state%s: ", $color_highlite, $color_end
+ p ($arg0).u3.state
+end
+
+define nd_rval
+ printf "%su2.value%s: ", $color_highlite, $color_end
+ rp ($arg0).u2.value
+end
+
+
+define nd_nth
+ printf "%su2.argc%s: ", $color_highlite, $color_end
+ p ($arg0).u2.argc
+end
+
+
+define nd_tag
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
+define nd_tval
+ printf "%su2.value%s: ", $color_highlite, $color_end
+ 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
+
+define rb_numtable_entry
+ set $rb_numtable_tbl = $arg0
+ set $rb_numtable_id = (st_data_t)$arg1
+ set $rb_numtable_key = 0
+ set $rb_numtable_rec = 0
+ if $rb_numtable_tbl->entries_packed
+ set $rb_numtable_p = $rb_numtable_tbl->as.packed.bins
+ while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->as.packed.bins+$rb_numtable_tbl->num_entries
+ if $rb_numtable_p.k == $rb_numtable_id
+ set $rb_numtable_key = $rb_numtable_p.k
+ set $rb_numtable_rec = $rb_numtable_p.v
+ set $rb_numtable_p = 0
+ else
+ set $rb_numtable_p = $rb_numtable_p + 1
+ end
+ end
+ else
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[st_numhash($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
+ set $rb_numtable_rec = $rb_numtable_p->record
+ set $rb_numtable_p = 0
+ else
+ set $rb_numtable_p = $rb_numtable_p->next
+ end
+ end
+ end
+end
+
+define rb_id2name
+ ruby_gdb_init
+ printf "%sID%s: ", $color_type, $color_end
+ rp_id $arg0
+end
+document rb_id2name
+ Print the name of id
+end
+
+define rb_method_entry
+ set $rb_method_entry_klass = (struct RClass *)$arg0
+ 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
+ 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)
+ end
+ end
+ if $rb_method_entry_me
+ print *$rb_method_entry_klass
+ print *$rb_method_entry_me
+ else
+ echo method not found\n
+ end
+end
+document rb_method_entry
+ Search method entry by class and id
+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
+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)
+ end
+end
+document rb_ancestors
+ Print ancestors.
+end
+
+define rb_backtrace
+ call rb_backtrace()
+end
+
+define iseq
+ if ruby_dummy_gdb_enums.special_consts
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_NONE
+ echo [none]\n
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_LABEL
+ print *(LABEL*)($arg0)
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_INSN
+ print *(INSN*)($arg0)
+ if ((INSN*)($arg0))->insn_id != YARVINSN_jump
+ set $i = 0
+ set $operand_size = ((INSN*)($arg0))->operand_size
+ set $operands = ((INSN*)($arg0))->operands
+ while $i < $operand_size
+ rp $operands[$i++]
+ end
+ end
+ end
+ if ($arg0)->type == ISEQ_ELEMENT_ADJUST
+ print *(ADJUST*)($arg0)
+ end
+end
+
+define rb_ps
+ rb_ps_vm ruby_current_vm
+end
+document rb_ps
+Dump all threads and their callstacks
+end
+
+define rb_ps_vm
+ print $ps_vm = (rb_vm_t*)$arg0
+ 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
+ end
+end
+document rb_ps_vm
+Dump all threads in a (rb_vm_t*) and their callstacks
+end
+
+define rb_ps_thread
+ set $ps_thread = (struct RTypedData*)$arg0
+ 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
+define trace_machine_instructions
+ set logging on
+ set height 0
+ set width 0
+ display/i $pc
+ while !$exit_code
+ info line *$pc
+ si
+ end
+end
+
+define SDR
+ call rb_vmdebug_stack_dump_raw_current()
+end
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..a9104e9ed5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,157 @@
+*-*-*.def
+*.a
+*.bak
+*.dSYM
+*.dmyh
+*.dylib
+*.elc
+*.inc
+*.log
+*.o
+*.orig
+*.rej
+*.sav
+*.swp
+*~
+.*-*
+.*.list
+.*.time
+.DS_Store
+.ccmalloc
+.ext
+.pc
+.ppack
+.svn
+Makefile
+Makefile.old
+extconf.h
+y.output
+y.tab.c
+
+# /
+/*-fake.rb
+/*.pc
+/*_prelude.c
+/COPYING.LIB
+/ChangeLog-*
+/ChangeLog.pre-alpha
+/ChangeLog.pre1_1
+/Doxyfile
+/GNUmakefile
+/GNUmakefile.old
+/README.atheos
+/README.fat-patch
+/README.v6
+/TAGS
+/archive
+/autom4te*.cache
+/automake
+/beos
+/bmlog-*
+/breakpoints.gdb
+/config.cache
+/config.h
+/config.h.in
+/config.status
+/config.status.lineno
+/configure
+/coverage/simplecov
+/coverage/.last_run.json
+/coverage/.resultset.json*
+/coverage/assets
+/coverage/index.html
+/doc/capi
+/enc.mk
+/encdb.h
+/exts.mk
+/goruby
+/id.[ch]
+/largefile.h
+/lex.c
+/libruby*.*
+/miniprelude.c
+/miniruby
+/newdate.rb
+/newline.c
+/newver.rb
+/parse.c
+/parse.h
+/patches
+/patches-master
+/pitest.rb
+/ppack
+/prelude.c
+/preview
+/probes.h
+/rbconfig.rb
+/rename2.h
+/repack
+/revision.h
+/riscos
+/rubicon
+/ruby
+/ruby-man.rd.gz
+/sizes.c
+/test.rb
+/tmp
+/transdb.h
+/uncommon.mk
+/verconf.h
+/web
+/yasmdata.rb
+
+# /benchmark/
+/benchmark/bmx_*.rb
+/benchmark/fasta.output.*
+/benchmark/wc.input
+
+/enc/unicode/data
+
+# /enc/trans/
+/enc/trans/*.c
+
+# /ext/
+/ext/extinit.c
+
+# /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
+/ext/ripper/ripper.*
+/ext/ripper/ids1
+/ext/ripper/ids2
+
+# /ext/socket/
+/ext/socket/constants.h
+/ext/socket/constdefs.h
+/ext/socket/constdefs.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/.indent.pro b/.indent.pro
new file mode 100644
index 0000000000..6a207a0554
--- /dev/null
+++ b/.indent.pro
@@ -0,0 +1,21 @@
+-bap
+-nbbb
+-nbc
+-br
+-nbs
+-ncdb
+-ce
+-cli0.5
+-ndj
+-ei
+-nfc1
+-i4
+-l120
+-lp
+-npcs
+-psl
+-sc
+-sob
+
+-TID
+-TVALUE
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..0052fdfc41
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,98 @@
+# Copyright (C) 2011 Urabe, Shyouhei. All rights reserved.
+#
+# This file is a part of the programming language Ruby. Permission is hereby
+# granted, to either redistribute or modify this file, provided that the
+# conditions mentioned in the file COPYING are met. Consult the file for
+# details.
+
+# This is a Travis-CI build configuration file. The list of configurations
+# available is located in
+#
+# http://about.travis-ci.org/docs/user/build-configuration/
+#
+# and as Ruby itself is a project written in C language,
+#
+# http://about.travis-ci.org/docs/user/languages/c/
+#
+# is also a good place to look at.
+
+# 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
+
+# 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'"
+
+# 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"
+
+# Branch matrix. Not all branches are Travis-ready so we limit branches here.
+branches:
+ only:
+ - trunk
+ - ruby_2_1
+ - ruby_2_2
+ - ruby_2_3
+ - /^feature\//
+ - /^bug\//
+
+# We want to be notified when something happens.
+notifications:
+ irc:
+ channels:
+ - "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
+ 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
+
+# Local Variables:
+# mode: YAML
+# coding: utf-8-unix
+# indent-tabs-mode: nil
+# tab-width: 4
+# fill-column: 79
+# default-justification: full
+# End:
diff --git a/BSDL b/BSDL
new file mode 100644
index 0000000000..a009caefea
--- /dev/null
+++ b/BSDL
@@ -0,0 +1,22 @@
+Copyright (C) 1993-2013 Yukihiro Matsumoto. 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.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..ffdf2dd4b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+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/COPYING b/COPYING
index 9043404a83..a1f19ff99d 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
-You can redistribute it and/or modify it under either the terms of the GPL
-version 2 (see the file GPL), or the conditions below:
+You can redistribute it and/or modify it under either the terms of the
+2-clause BSDL (see the file BSDL), or the conditions below:
1. You may make and give away verbatim copies of the source form of the
software without restriction, provided that you duplicate all of the
diff --git a/COPYING.ja b/COPYING.ja
index 933cc7cb9a..e50d01c8d1 100644
--- a/COPYING.ja
+++ b/COPYING.ja
@@ -1,51 +1,51 @@
-$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(BGPL(the GNU General
-Public License)$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G(B
-$B$-$^$9!%(BGPL$B$K$D$$$F$O(BGPL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
+本プログラムã¯ãƒ•リーソフトウェアã§ã™ï¼Ž2-clause BSDL
+ã¾ãŸã¯ä»¥ä¸‹ã«ç¤ºã™æ¡ä»¶ã§æœ¬ãƒ—ログラムをå†é…布ã§ãã¾ã™
+2-clause BSDLã«ã¤ã„ã¦ã¯BSDLファイルをå‚ç…§ã—ã¦ä¸‹ã•ã„.
- 1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B
+ 1. 複製ã¯åˆ¶é™ãªã自由ã§ã™ï¼Ž
- 2. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$N%=!<%9$r(B
- $B<+M3$KJQ99$G$-$^$9!%(B
+ 2. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムã®ã‚½ãƒ¼ã‚¹ã‚’
+ 自由ã«å¤‰æ›´ã§ãã¾ã™ï¼Ž
- (a) $B%M%C%H%K%e!<%:$K%]%9%H$7$?$j!$:n<T$KJQ99$rAwIU$9$k(B
- $B$J$I$NJ}K!$G!$JQ99$r8x3+$9$k!%(B
+ (a) ãƒãƒƒãƒˆãƒ‹ãƒ¥ãƒ¼ã‚ºã«ãƒã‚¹ãƒˆã—ãŸã‚Šï¼Œä½œè€…ã«å¤‰æ›´ã‚’é€ä»˜ã™ã‚‹
+ ãªã©ã®æ–¹æ³•ã§ï¼Œå¤‰æ›´ã‚’公開ã™ã‚‹ï¼Ž
- (b) $BJQ99$7$?K\%W%m%0%i%`$r<+J,$N=jB0$9$kAH?%FbIt$@$1$G(B
- $B;H$&!%(B
+ (b) 変更ã—ãŸæœ¬ãƒ—ãƒ­ã‚°ãƒ©ãƒ ã‚’è‡ªåˆ†ã®æ‰€å±žã™ã‚‹çµ„織内部ã ã‘ã§
+ 使ã†ï¼Ž
- (c) $BJQ99E@$rL@<($7$?$&$(!$%=%U%H%&%'%"$NL>A0$rJQ99$9$k!%(B
- $B$=$N%=%U%H%&%'%"$rG[I[$9$k;~$K$OJQ99A0$NK\%W%m%0%i(B
- $B%`$bF1;~$KG[I[$9$k!%$^$?$OJQ99A0$NK\%W%m%0%i%`$N%=!<(B
- $B%9$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更点を明示ã—ãŸã†ãˆï¼Œã‚½ãƒ•トウェアã®åå‰ã‚’変更ã™ã‚‹ï¼Ž
+ ãã®ã‚½ãƒ•トウェアをé…布ã™ã‚‹æ™‚ã«ã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラ
+ ãƒ ã‚‚åŒæ™‚ã«é…布ã™ã‚‹ï¼Žã¾ãŸã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラムã®ã‚½ãƒ¼
+ スã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (d) $B$=$NB>$NJQ99>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) ãã®ä»–ã®å¤‰æ›´æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
- 3. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$r%3%s%Q%$(B
- $B%k$7$?%*%V%8%'%/%H%3!<%I$d<B9T7A<0$G$bG[I[$G$-$^$9!%(B
+ 3. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムをコンパイ
+ ルã—ãŸã‚ªãƒ–ジェクトコードや実行形å¼ã§ã‚‚é…布ã§ãã¾ã™ï¼Ž
- (a) $B%P%$%J%j$r<u$1<h$C$??M$,%=!<%9$rF~<j$G$-$k$h$&$K!$(B
- $B%=!<%9$NF~<jK!$rL@<($9$k!%(B
+ (a) ãƒã‚¤ãƒŠãƒªã‚’å—ã‘å–ã£ãŸäººãŒã‚½ãƒ¼ã‚¹ã‚’入手ã§ãるよã†ã«ï¼Œ
+ ソースã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (b) $B5!3#2DFI$J%=!<%9%3!<%I$rE:IU$9$k!%(B
+ (b) 機械å¯èª­ãªã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’添付ã™ã‚‹ï¼Ž
- (c) $BJQ99$r9T$C$?%P%$%J%j$OL>A0$rJQ99$7$?$&$(!$%*%j%8%J(B
- $B%k$N%=!<%9%3!<%I$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更を行ã£ãŸãƒã‚¤ãƒŠãƒªã¯åå‰ã‚’変更ã—ãŸã†ãˆï¼Œã‚ªãƒªã‚¸ãƒŠ
+ ルã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- (d) $B$=$NB>$NG[I[>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) ãã®ä»–ã®é…布æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
- 4. $BB>$N%W%m%0%i%`$X$N0zMQ$O$$$+$J$kL\E*$G$"$l<+M3$G$9!%$?(B
- $B$@$7!$K\%W%m%0%i%`$K4^$^$l$kB>$N:n<T$K$h$k%3!<%I$O!$$=(B
- $B$l$>$l$N:n<T$N0U8~$K$h$k@)8B$,2C$($i$l$k>l9g$,$"$j$^$9!%(B
+ 4. ä»–ã®ãƒ—ログラムã¸ã®å¼•用ã¯ã„ã‹ãªã‚‹ç›®çš„ã§ã‚れ自由ã§ã™ï¼ŽãŸ
+ ã ã—,本プログラムã«å«ã¾ã‚Œã‚‹ä»–ã®ä½œè€…ã«ã‚ˆã‚‹ã‚³ãƒ¼ãƒ‰ã¯ï¼Œã
+ れãžã‚Œã®ä½œè€…ã®æ„å‘ã«ã‚ˆã‚‹åˆ¶é™ãŒåŠ ãˆã‚‰ã‚Œã‚‹å ´åˆãŒã‚りã¾ã™ï¼Ž
- $B$=$l$i%U%!%$%k$N0lMw$H$=$l$>$l$NG[I[>r7o$J$I$KIU$$$F$O(B
- LEGAL$B%U%!%$%k$r;2>H$7$F$/$@$5$$!%(B
+ ãれらファイルã®ä¸€è¦§ã¨ãれãžã‚Œã®é…布æ¡ä»¶ãªã©ã«ä»˜ã„ã¦ã¯
+ LEGALファイルをå‚ç…§ã—ã¦ãã ã•ã„.
- 5. $BK\%W%m%0%i%`$X$NF~NO$H$J$k%9%/%j%W%H$*$h$S!$K\%W%m%0%i(B
- $B%`$+$i$N=PNO$N8"Mx$OK\%W%m%0%i%`$N:n<T$G$O$J$/!$$=$l$>(B
- $B$l$NF~=PNO$r@8@.$7$??M$KB0$7$^$9!%$^$?!$K\%W%m%0%i%`$K(B
- $BAH$_9~$^$l$k$?$a$N3HD%%i%$%V%i%j$K$D$$$F$bF1MM$G$9!%(B
+ 5. 本プログラムã¸ã®å…¥åŠ›ã¨ãªã‚‹ã‚¹ã‚¯ãƒªãƒ—トãŠã‚ˆã³ï¼Œæœ¬ãƒ—ログラ
+ ムã‹ã‚‰ã®å‡ºåŠ›ã®æ¨©åˆ©ã¯æœ¬ãƒ—ログラムã®ä½œè€…ã§ã¯ãªã,ãれãž
+ れã®å…¥å‡ºåŠ›ã‚’ç”Ÿæˆã—ãŸäººã«å±žã—ã¾ã™ï¼Žã¾ãŸï¼Œæœ¬ãƒ—ログラムã«
+ 組ã¿è¾¼ã¾ã‚Œã‚‹ãŸã‚ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¤ã„ã¦ã‚‚åŒæ§˜ã§ã™ï¼Ž
- 6. $BK\%W%m%0%i%`$OL5J]>Z$G$9!%:n<T$OK\%W%m%0%i%`$r%5%]!<%H(B
- $B$9$k0U;V$O$"$j$^$9$,!$%W%m%0%i%`<+?H$N%P%0$"$k$$$OK\%W(B
- $B%m%0%i%`$N<B9T$J$I$+$iH/@8$9$k$$$+$J$kB;32$KBP$7$F$b@U(B
- $BG$$r;}$A$^$;$s!%(B
+ 6. 本プログラムã¯ç„¡ä¿è¨¼ã§ã™ï¼Žä½œè€…ã¯æœ¬ãƒ—ログラムをサãƒãƒ¼ãƒˆ
+ ã™ã‚‹æ„å¿—ã¯ã‚りã¾ã™ãŒï¼Œãƒ—ログラム自身ã®ãƒã‚°ã‚ã‚‹ã„ã¯æœ¬ãƒ—
+ ログラムã®å®Ÿè¡Œãªã©ã‹ã‚‰ç™ºç”Ÿã™ã‚‹ã„ã‹ãªã‚‹æå®³ã«å¯¾ã—ã¦ã‚‚責
+ 任をæŒã¡ã¾ã›ã‚“.
diff --git a/ChangeLog b/ChangeLog
index 59ff55ffa8..f8f303e59c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,24139 +1,14841 @@
-Sat Jul 25 21:26:18 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 15 15:29:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * enum.c (first_i): Enumerator#first should consume only what is
- needed. a patch from Marc-Andre Lafortune. [ruby-core:23661]
+ * 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]
- * enum.c (take_i): ditto.
+Tue Nov 15 03:55:45 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * enum.c (enum_first): call to_int once for an argument. a patch
- from Marc-Andre Lafortune.
+ * ext/-test/file/fs.c (get_atime_p): Updating of file access times
+ is enabled or not.
-Fri Jul 24 17:19:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 15 03:55:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cgi.rb (HTTP_STATUS): typo fixed. [ruby-dev:38538]
+ * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case.
+ [ruby-core:77943] [Bug #12903]
-Wed Jul 22 23:39:34 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 15 03:54:14 2016 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rexml/text.rb (REXML::Text.normalize): call to_s for input.
- [ruby-talk:337069]
+ * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast,
+ test_make_socket_ipv6_multicast_hops): skip if IPv6 multicast
+ address is not available.
-Tue Jul 21 18:21:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 15 03:39:07 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (SRC_EXT): should be flat.
- http://twitter.com/_tad_/status/1825862632
+ * lib/net/http.rb (transport_request): other than HTTPContinue
+ in 1xx (HTTPInformation) also needs to continue. [Bug #12890]
-Sat Jul 18 00:44:43 2009 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sat Nov 12 07:48:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_gc_call_finalizer_at_exit): finalizer_table can be NULL.
- [ruby-core:24395]
+ * proc.c (mnew_internal): follow the original class, not to loop
+ the prepended module. [ruby-core:77591] [Bug #12832]
-Thu Jul 16 09:35:06 2009 Akinori MUSHA <knu@iDaemons.org>
+Sat Nov 12 07:47:19 2016 Shugo Maeda <shugo@ruby-lang.org>
- * lib/delegate.rb (Delegator#method_missing)
- (DelegateClass()#method_missing): Properly pass a given block
- through. [ruby-dev:38390]
+ * cont.c (cont_new): disable optimization if clang's version is
+ 3.8.0. [ruby-core:77894] [Bug #12893]
-Wed Jul 15 11:40:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 07:37:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (rb_file_join): recursive array has no meaning as path
- name. [ruby-core:23329]
+ * sprintf.c (rb_str_format): format exact number more exactly.
-Tue Jul 14 19:57:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 07:34:03 2016 Kazuki Yamaguchi <k@rhe.jp>
- * eval.c (get_ts): use readtime clock. [ruby-dev:38354]
+ * 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.
- * eval.c (rb_thread_stop_timer): clear thread_init while locking.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto.
-Tue Jul 14 19:57:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto.
+ (ossl_x509stctx_verify): ditto.
- * eval.c (rb_thread_start_timer): guard condition was inverted.
- [ruby-dev:38319]
+ * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations
+ of ossl_store_{ctx_,}ex_verify_cb_idx.
-Tue Jul 14 19:57:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and
+ X509_STORE_get_ex_data.
- * eval.c (safe_mutex_lock): pthread_cleanup_push() must not be
- inside parens.
+ * 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.
-Mon Jul 13 01:36:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 07:32:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (time_timeval): rounds subsecond toward zero.
+ * thread.c (rb_thread_pending_interrupt_p): no pending interrupt
+ before initialization.
-Mon Jul 13 01:36:54 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_raise_m, rb_thread_kill): uninitialized thread
+ cannot interrupt. [ruby-core:72732] [Bug #11959]
- * time.c (time_timeval): check out-of-range. [ruby-core:23282]
- [Bug #1396]
+Thu Oct 27 16:47:57 2016 Kazuki Yamaguchi <k@rhe.jp>
-Thu Jul 9 17:58:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * eval.c (proc_invoke): shares dmethod scope local variables.
- a patch from coderrr at [ruby-core:23050]
+ * test/ruby/test_exception.rb (test_throw_false): Add a test case for
+ this.
- * gc.c (obj_free): do not free cloned scope local variables.
+Thu Oct 27 16:39:56 2016 Aurelien Jacobs <aurel@gnuage.org>
-Wed Jul 8 19:28:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * eval.c (rb_thread_remove): stops timer thread unless other
- threads exist. [ruby-core:18444]
+Thu Oct 27 16:27:06 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Jul 6 16:01:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c: Improve documentation for Float conversion.
+ [ruby-core:71661][Bug #11736][ci skip]
- * eval.c (rb_eval): checks for interrupt, stack and finalizers too.
- [ruby-dev:38208], [Bug #1329]
+Fri Oct 7 02:44:57 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (eval): replaces the message if frozen.
+ * lib/rubygems/ssl_certs/GlobalSignRootCA.pem: add for RubyGems.org.
-Sun Jul 5 03:50:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 1 01:02:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb: use Kernel.exit to get rid of using
- IRB::ExtendCommandBundle#exit. a patch from Dmitry Vazhov by
- [ruby-core:22986].
+ * variable.c (rb_const_search): raise with the actual class/module
+ name which defines the private constant.
-Fri Jul 3 09:05:38 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Oct 1 00:57:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/drb/drb.rb (open_server_inaddr_any): fixed multiple network
- families problem. a patch from Charl Matthee at [ruby-core:21033].
+ * 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]
-Wed Jul 1 15:46:30 2009 Tanaka Akira <akr@fsij.org>
+Sat Oct 1 00:56:19 2016 Aaron Patterson <tenderlove@ruby-lang.org>
- * lib/pathname.rb (Pathname#sub): set $~ in block.binding.
- [ruby-dev:38173]
+ * lib/uri/generic.rb (def check_password): don't include bad password
+ in URI exception output
-Mon Jun 29 13:18:42 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/uri/test_generic.rb (def test_set_component): test for behavior
- * lib/fileutils.rb (FileUtils#fu_get_gid): stringify group
- argument before making regexp match. [ruby-dev:38155]
+Sat Oct 1 00:55:19 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jun 12 16:36:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * 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.
- * ext/bigdecimal/bigdecimal.c (VpToString): fixed a bug introduced
- in r23613. [ruby-talk:338957]
+Sat Oct 1 00:53:28 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon Jun 8 10:58:41 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+ * 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]
- * eval.c (rb_thread_schedule): mswin32 doesn't have F_GETFD, so check
- with another method.
+Sat Oct 1 00:52:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 8 08:15:36 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * man/irb.1: remove useless -width option.
+ [ruby-dev:49767] [Bug #12692]
- * ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoid
- segmentation fault caused by (insanely) long decimal values.
- backported from 1.9. CVE-2009-1904
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i,
- BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split,
- BigDecimal_inspect): ditto.
+Sat Oct 1 00:49:40 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Jun 8 08:15:36 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c (Init_win32ole): should not use atexit to
+ free allocated hash table to avoid error on Cygwin.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): returns Inf if
- exp is bigger than DBL_MANT_DIG.
+Sat Oct 1 00:43:11 2016 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jun 3 21:16:30 2009 Tanaka Akira <akr@fsij.org>
+ * 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]
- * file.c: include fcntl.h for O_RDONLY on Solaris.
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jun 3 21:09:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (str_buf_cat): Fix capa size for embed string.
+ Fix bug in r55547. [Bug #12536]
- * util.c (rv_strdup): macro to duplicate nul-terminated string.
- [ruby-core:22852]
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
- * util.c (ruby_dtoa): allocates one more byte to get rid of buffer
- overrun. a patch from Charlie Savage at [ruby-core:22604].
+ * 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]
-Wed Jun 3 21:09:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h: declaration for rb_str_change_terminator_length.
- * util.c (ruby_dtoa): allocates one more byte to get rid of buffer
- overrun. a patch from Charlie Savage at [ruby-core:22604].
+ * 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.
-Wed Jun 3 21:05:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * encoding.c (rb_enc_associate_index): rb_str_change_terminator_length
+ is used, and it should be called whenever the termlen is changed.
- * ext/bigdecimal/bigdecimal.c (gfDebug): uncommented out.
- [ruby-core:22600]
+ * 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.
-Wed Jun 3 20:54:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_capacity): Use str_capacity.
- * eval.c (rb_eval): needs to guard intermediate string objects.
- based on a patch from Brent Roman <brent AT mbari.org> a
- [ruby-core:22584].
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 26 21:24:01 2009 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * 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]
- * Makefile.in (update-rubyspec, test-rubyspec): Catch up to
- rubyspec merge. A patch by Brian Ford at [ruby-core:21032]
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 26 21:21:49 2009 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * lib/soap/mimemessage.rb (MIMEMessage#to_s): Fix a fatal
- method name typo. [Bug #1173]
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
-Tue May 26 21:16:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c: Specify termlen as far as possible.
+ Additional fix for [Bug #12536] [ruby-dev:49699].
- * file.c (rb_file_s_extname): fix for spaces before extention.
- [ruby-dev:38044]
+ * string.c (str_new_static): Specify termlen from the given encoding
+ when creating a new String object is needed.
-Tue May 26 21:09:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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.
- * win32/win32.c (_CrtDbgReportW): prevent from false positive
- assertions in msvcrtd. [ruby-core:22116]
+ * string.c (rb_external_str_new_with_enc): Use encoding by using the
+ above rb_tainted_str_new_with_enc().
-Tue May 26 21:02:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
- * lib/ostruct.rb (OpenStruct#new_ostruct_member): checks if frozen.
- [ruby-talk:328195], [ruby-core:22142]
+ * 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].
-Tue May 26 21:00:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
- * lib/ostruct.rb (OpenStruct#inspect): fixed the recursion check.
- Patch by Kornelius Kalnbach. [ruby-core:20992].
+ * string.c: Fix memory corruptions when using UTF-16/32 strings.
+ [Bug #12536] [ruby-dev:49699]
- * test/ostruct/test_ostruct.rb: test for inspect.
- Patch by Kornelius Kalnbach. [ruby-core:20992].
+ * string.c (rb_str_new_with_class): Use TERM_LEN of the "obj".
-Tue May 26 20:50:32 2009 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_str_plus, rb_str_justify): Use str_new0 which is aware
+ of termlen.
- * eval.c (rb_thread_schedule): handle EBADF of select as well.
- [ruby-core:21264]
+ * string.c (str_shared_replace): Copy +termlen bytes instead of +1.
-Wed Apr 8 18:59:52 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+ * string.c (rb_str_times): termlen should not be included in capa.
- * win32/win32.c (subtruct): check tv_sec.
+ * 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.
-Thu Apr 2 16:06:17 2009 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * string.c (rb_str_capacity, str_shared_replace, str_buf_cat): ditto.
- * test/rss/test_atom.rb (RSS::TestAtomCore::assert_atom_content_inline_other_base64_to_s):
- ditto. [ruby-dev:38248]
+ * string.c (rb_str_drop_bytes, rb_str_setbyte, str_byte_substr): ditto.
-Thu Apr 2 15:43:46 2009 Kouhei Sutou <kou@cozmixng.org>
+Sat Oct 1 00:00:13 2016 Eric Wong <e@80x24.org>
- * test/rss/rss-assertions.rb (RSS::Assertions::assert_atom_content_inline_other_text):
- newlines are valid for Base64 data. [ruby-dev:38248]
+ * 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]
-Thu Apr 2 14:17:09 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Aug 16 21:12:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/openssl/test_ssl.rb (OpenSSL#test_client_session):
- Debian's openssl 0.9.8g-13 failed at assert(ssl.session_reused?),
- when use default SSLContext. [ruby-dev:36167]
- backported r19268 from trunk. [ruby-core:22843]
+ * compile.c (ADD_TRACE): ignore trace instruction on non-positive
+ line.
-Thu Mar 31 18:18:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (coverage): get rid of ArgumentError when the starting
+ line number is not positive. [ruby-core:76141] [Bug #12517]
- * lib/mkmf.rb (mkintpath): new function which converts native path
- to format acceptable in Makefile.
+Tue Aug 16 21:12:07 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/mkmf.rb (configuration): leaves PATH_SEPARATOR unchanged.
+ * test/coverage/test_coverage.rb: ignored test when enabled to coverage.
+ It lead to crash with `make test-all`.
- * lib/mkmf.rb (configuration): convers srcdir, topdir and hdrdir.
- a patch by Alexey Borzenkov <snaury AT gmail.com> at
- [ruby-core:21448].
+Tue Aug 16 21:01:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Mar 27 19:22:02 2009 Nobuyoshi Nakada <nobu@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>
- * gc.c (run_final): frees zombies only. [ruby-dev:38171]
+Tue Aug 16 20:59:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 27 19:22:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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>.
- * gc.c (rb_gc_call_finalizer_at_exit): leave Thread objects
- unfinalized. [ruby-dev:38168]
+Tue Aug 16 20:58:11 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Mar 27 19:22:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * gc.c (run_final): calls free function. [ruby-core:22578]
+Tue Aug 16 20:56:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 23 19:17:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * missing/crypt.c: fix size macros to use configured values
+ for platforms long is larger than 32bit.
+ [ruby-core:75792] [Bug #12446]
- * ext/thread/thread.c (rb_queue_pop, rb_queue_push): should not lock
- mutex if got an exception while waiting, and should ensure unlocked
- after signaled. [ruby-dev:37545]
+Tue Aug 16 20:40:36 2016 Kazuki Yamaguchi <k@rhe.jp>
-Mon Mar 23 18:26:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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.
- * eval.c (rb_thread_value): missed to change at r17874. [ruby-core:17595]
+ * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash.
-Mon Mar 23 18:26:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash
- * eval.c (rb_thread_join): new API.
+Tue Aug 16 20:34:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/thread/thread.c (wait_mutex, lock_mutex): wait until the locking
- thread exits. [ruby-dev:34856]
+ * 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]
-Mon Mar 23 17:41:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 16 20:30:53 2016 Kazuki Yamaguchi <k@rhe.jp>
- * file.c (file_load_ok): checks if regular file, except for the
- platform disallows to open directories, e.g. dosish.
- [ruby-dev:38097], [Bug #1221]
+ * 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]
-Mon Mar 9 20:59:24 2009 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does
+ not check dsa->q.
- * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
- returns positive value on success, not non-zero. [ruby-core:21762]
- backported r22440 from trunk.
-
-Mon Mar 9 10:02:15 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (match_check): check if MatchData is initialized.
- [ruby-core:18749]
-
-Mon Mar 9 09:56:34 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/rexml/rexml.rb: incremented Ruby::VERSION. Thanks, Jeremy
- Kemper. [ruby-core:20113]
-
-Mon Mar 9 09:52:53 2009 Tanaka Akira <akr@fsij.org>
-
- * io.c (io_getpartial): fflush after read for updating pos in FILE.
- not portable, I guess. [ruby-core:21561]
-
-Mon Mar 9 09:04:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (define_final): cannot define finalizer for immediate
- values. [ruby-core:21500]
-
- * gc.c (define_final): freezes or hides internal values.
-
-Mon Mar 9 08:54:47 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (IS_BEG): EXPR_CLASS should be treated like EXPR_BEG.
- [ruby-core:21453]
-
-Wed Feb 25 15:15:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.h (rb_thread_raised_clear): should not clear flags other than
- raised flags. a patch by Tomoyuki Chikanaga <chikanag AT
- nippon-control-system.co.jp> at [ruby-dev:37794]. [ruby-dev:37776]
-
-Wed Feb 25 15:05:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/extconf.rb (gai_strerror): checks if available and if
- returns const pointer.
-
- * ext/socket/getaddrinfo.c (gai_strerror): defines only if non
- available. [ruby-core:21328]
-
-Wed Feb 25 14:57:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.
-
- * win32/win32.c (winnt_stat): gets rid of strange behavior of
- GetFileAttributes(). [ruby-core:21269]
-
-Tue Feb 24 02:44:39 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb (PercentScanner): remove PercentScanner. fixed % after
- %> bug. [ruby-dev:37751] [Bug #997]
-
- * test/erb/test_erb.rb: ditto
-
-Tue Feb 24 02:35:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_s_create): set nil as the value if assoc length
- is not enough. [ruby-core:21249]
-
-Sun Feb 22 22:08:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (stack_extend): streamlined rb_thread_restore_context()
- to ensure O(1) time. based on a patch by Brent Roman <brent AT
- mbari.org>.
-
-Sun Feb 22 22:03:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (cc_mark): frees the continuation's stack if its thread
- is dead to avoid recursive gc that segfaults. [ruby-core:13889]
- a patch by Brent Roman <brent AT mbari.org>.
-
- * eval.c (rb_cont_check): checks for valid continuation instance.
-
- * eval.c (rb_callcc): assigns th->thread before scope_dup() to
- avoid segfaults if this scope_dup() triggers a gc pass.
- a patch by Brent Roman <brent AT mbari.org>.
-
-Sun Feb 22 21:43:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (ruby_float_step): extracted from num_step().
-
- * range.c (range_step): uses ruby_float_step() for float range.
- [ruby-dev:37691]
-
-Sun Feb 22 00:49:36 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): does not use both of makefile.rb and
- extconf.rb at the same time.
-
- * lib/mkmf.rb (DLLIB): depends on Makefile. [ruby-core:21096]
-
-Sun Feb 22 00:19:05 2009 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_thread_schedule): Don't change status of threads which
- don't run next even if select notify readability/writability.
- [ruby-core:20446]
-
-Fri Feb 20 20:43:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::List#summarize): gives priority
- to latter switches. [ruby-dev:36692]
-
- * lib/optparse.rb (OptionParser#summarize): do not append
- unnecessary line terminator.
-
-Fri Feb 20 19:35:08 2009 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/session.rb: ignore session_id options fixed.[Bug #605]
-
-Fri Feb 20 18:06:40 2009 James Edward Gray II <jeg2@ruby-lang.org>
-
- Merged 20854 from trunk.
-
- * lib/xmlrpc/server.rb: Restricting method inspection to show only
- non-inherited public methods. [ruby-core:20603]
-
- * lib/xmlrpc/server.rb: Fixing method inspection so it doesn't
- trigger XMLRPC::FaultException when used. [ruby-core:20604]
-
-Fri Feb 20 01:41:08 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/sync.rb (Sync_m#sync_try_lock): wrong variable name fixed.
- a patch from [ruby-core:20561]
-
- * lib/sync.rb (Sync_m::Err.Fail): turn off Thread.critical before
- exit.
-
-Thu Feb 19 18:02:10 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * pack.c (pack_pack): fixed odd act of 'm*', 'M*', and 'P*'.
- just ignores '*' in these cases.
- [ruby-dev:37289]
-
-Thu Feb 19 17:26:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * pack.c (pack_pack): fixed length for odd length string.
- [ruby-dev:37283]
-
-Thu Feb 19 17:13:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_yield_0): Qundef means no argument. [ruby-Bugs-22525]
-
-Wed Feb 18 22:28:00 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_isatty): check whether fd is valid.
-
-Wed Feb 18 22:24:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (waitpid): fix bug of checking child slot.
-
- * win32/win32.c (FindChildSlotByHandle): new.
-
-Wed Feb 18 22:17:04 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_pack): propagate taint status from format string to
- result string.
-
-Wed Feb 18 22:07:44 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/gdbm/gdbm.c: do not set members of RSTRING(str) directly.
- [ruby-dev:37182]
-
- * ext/gdbm/gdbm.c (rb_gdbm_nextkey): fix memory leak.
-
-Tue Feb 17 11:58:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_independent): no independent string points null_str.
- [ruby-core:20082]
-
-Mon Feb 16 23:30:24 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
- fix NameError bug.
-
-Mon Feb 16 23:08:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_s_alloc, rb_str_replace): use null_str as well as
- rb_string_value so that extension libraries do not segfault.
- [ruby-core:19971]
-
- * string.c (rb_str_replace): reduced unnecessary malloc and copy.
-
-Mon Feb 16 22:45:41 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119].
- thanks, shinichiro.h.
-
-Mon Feb 16 22:36:37 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb (DRbConn::alive?): fixed NoMethodError problem
- from NaHi [ruby-dev:37110].
-
-Sun Feb 15 04:21:42 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/ftp.rb (Net::FTP#open_socket): SOCKSsocket is obsolete.
- a patch from Alan Johnson <alan.wayne.johnson at gmail.com> in
- [ruby-core:19982].
-
-Fri Feb 13 19:18:42 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/logger.rb (ProgName): fixed for svn, based on a patch from
- Nobuhiro IMAI at [ruby-dev:37108].
-
-Sun Feb 15 04:17:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line):
- use non-greedy match for path retrieval to avoid huge recursion
- for insanely long path.
-
-Fri Feb 13 19:04:54 2009 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * shell/command-processor.rb: undefined method `top_level_test' in
- Shell#test. [ruby-list:45634]
-
-Tue Feb 10 20:00:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (load_lock): makes circular require deadlock.
- [ruby-core:19821]
-
-Tue Feb 10 19:40:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_feature_p): returns found feature name if loading.
- [ruby-core:19798]
-
- * eval.c (search_required): ditto.
-
-Wed Feb 11 23:37:35 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bug
- pointed by Ryan Platte fixed(Patch to the patch from "NATORI
- Shin"). [ruby-talk:273360]
- back ported from 1.9. fix [ruby-core:19791]
-
-Mon Feb 9 17:35:38 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_accept): secure fd before accept because if
- error causes in securing, cannot restore the state of accepted
- socket.
- fixed [ruby-core:19728]
-
-Mon Feb 9 13:42:15 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (ifs_open_socket): should retry without proto_buffer
- if cannot find the suitable protocol. a patch from Heesob Park.
- fixed [ruby-core:19713]
-
-Mon Feb 9 13:40:21 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_ungetc): should allow ungetc at
- the top of the buffer. ref #701
-
-Thu Feb 5 09:38:48 2009 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (h_conv): can't guess UTF-8 input in
- conversion. [ruby-list:45609]
-
-Thu Feb 5 09:03:21 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/rexml/entity.rb (unnormalized): do not call
- document.record_entity_expansion if document is nil.
- see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
- Thanks, Naohisa Goto. backported from trunk.
-
- * test/rexml/test_document.rb: ditto.
-
-Thu Feb 5 08:55:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_join): do not repeat self in a recursive array.
- [ruby-dev:37019]
-
-Wed Feb 4 14:26:58 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (dir_globs): need taint check. reported by steve
- <oksteev at gmail.com>
-
-Tue Feb 3 14:35:26 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/net/pop.rb: check for invalid APOP timestamp. (CVE-2007-1558)
- [ruby-dev:36631]
-
- * test/net/pop/test_pop.rb: ditto.
-
-Mon Feb 2 20:03:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_mdump, time_mload): preserves GMT status.
- [ruby-core:19252]
-
-Mon Feb 2 11:34:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (autoload_delete, autoload_file): should not delete
- autoload table, since it may be shared with duplicated modules.
- [ruby-core:19181]
-
-Thu Jan 29 11:54:22 2009 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date.rb (today,now): should produce own instances.
- [ruby-talk:317020]
-
-Wed Jan 28 22:51:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_mod_modfunc): method undefined in included module
- may not have nd_body. [ruby-core:18738]
-
-Wed Jan 28 20:53:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (marshal_dump): fixed for check_dump_arg.
-
-Tue Jan 27 17:30:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (marshal_dump): initializes dump_arg before any funcall.
- [ruby-dev:36648]
-
-Tue Jan 27 15:17:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (host_str): numeric address should be unsigned.
- [ruby-core:18971]
-
-Mon Jan 26 11:12:03 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/tmpdir.rb: setup buffer with nul characters instead of spaces.
- fixed [ruby-dev:36493]
-
-Sun Jan 25 00:07:23 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
- abandon wrapping if the line contains no space. [ruby-dev:36045]
- fix: #342
-
-Sun Jan 25 00:02:23 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
-
- * lib/matrix.rb (Vector#eql?): typo of the method name as "eqn?".
- (Vector#eqn?): removed. Defined by mistake.
- Fixes [ruby-dev:36294]. Reported by weda <weda AT
- issp.u-tokyo.ac.jp> and an anonymous user.
-
- * test/matrix/test_matrix.rb: added.
-
- * test/matrix/test_vector.rb: added.
-
-Fri Jan 23 11:49:45 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * NEWS: added an entry for REXML.
-
- * lib/rexml/document.rb: fixed typo.
-
-Fri Jan 23 11:49:45 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/rexml/document.rb: limit entity expansion. Thanks, Luka
- Treiber, Mitja Kolsek, and Michael Koziarski. backported from
- trunk r19033, r19317, r19318.
-
- * lib/rexml/entity.rb: ditto.
-
- * test/rexml/test_document.rb: ditto.
-
-Thu Jan 22 15:19:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (marshal_load): arg.data is no longer a VALUE but a
- st_table, and freed in load_ensure. pointed out by pegacorn.
- [ruby-dev:37008]
-
-Thu Jan 22 15:19:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_mark_set): new function to mark keys.
-
- * marshal.c (struct dump_arg, struct load_arg): added wrappers to mark
- data entries. backport from trunk r13527,r13528,r13961,r16533.
- [ruby-dev:36082]
-
-Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (filetime_to_timeval): new function, split from
- gettimeofday().
-
- * win32/win32.c (gettimeofday): use above function.
-
- * win32/win32.c (filetime_to_unixtime): ditto. [ruby-dev:36135]
-
-Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (gettimeofday): tv_usec is usec, not msec.
- [ruby-dev:36094]
-
-Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (gettimeofday): calc tv_sec and tv_usec from system
- time by myself. [ruby-dev:36084]
-
-Wed Jan 21 11:12:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (gettimeofday): shouldn't use mktime(2) because it's
- buggy about handling summer time.
- reported by Yoshikawa <yoshixool AT gmail.com> at [ruby-dev:36071]
-
-Tue Jan 20 12:23:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should accept
- single digit decimal. [ruby-core:18355]
-
-Mon Jan 19 18:25:28 2009 Tanaka Akira <akr@fsij.org>
-
- * configure.in (rb_cv_broken_glibc_ia64_erfc): renamed from
- rb_broken_glibc_ia64_erfc.
- [ruby-core:18228]
-
-Sat Jan 17 12:16:10 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * random.c (Init_Random): always initialize seed.
-
-Fri Jan 16 10:59:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * class.c (clone_method): should copy cbase in cref as well.
- [ruby-dev:35116]
-
- * node.h (NEW_CREF): new NEW_ macro.
-
- * eval.c (PUSH_CREF): use NEW_CREF().
-
-Thu Jan 15 14:34:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (STACK_LEVEL_MAX, ruby_stack_length): returns size_t.
- [ruby-core:18207]
-Wed Jan 14 10:39:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * stable/ext/socket/socket.c (NI_MAXHOST, NI_MAXSERV): fixed invalid
- preprocessor directives. a patch from Peter Bowen at
- [ruby-core:18211].
-
-Tue Jan 13 04:40:30 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (login): raise FTPReplyError if passwd or acct
- is not supplied. backported from trunk. fixed [ruby-core:18058].
-
-Mon Jan 12 00:23:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_sweep, obj_free, run_final): defer finalizers of IO and
- Data. [ruby-dev:35578]
-
- * gc.c (rb_gc_call_finalizer_at_exit): self-referencing finalizers
- cannot be invoked. [ruby-dev:35681]
-
-Sun Jan 11 11:33:27 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (chdir): handle 5xx errors correctly.
- backported from trunk. fixed [ruby-core:18057].
-
-Fri Jan 9 19:25:25 2009 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (disconnect): do not refer SSL::SSLSocket for
- environments without OpenSSL. backported from trunk.
- fixed [ruby-dev:35755].
-
-Thu Jan 8 13:24:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (deferred_nodes, compstmt, arg, fixup_nodes, range_op): fix
- up fixnum range literal in conditional as automagical line number
- comparison. [ruby-core:12124], [ruby-dev:35731]
-
-Wed Jan 7 10:09:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (timeofday): use monotonic clock. based on a patch
- from zimbatm <zimbatm@oree.ch> in [ruby-core:16627].
-
-Tue Jan 6 09:03:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (yylex): 8 and 9 in octal integer should cause compile
- error. [ruby-dev:35729]
-
-Mon Jan 5 11:14:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_schedule): runs deferred finalizers.
-
- * gc.c (gc_sweep): sets rb_thread_pending to run deferred finalizers.
-
- * rubysig.h (CHECK_INTS): now checks rb_thread_pending even on
- platforms where setitimer is not available. [ruby-core:18045]
-
-Mon Jan 5 11:14:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rubysig.h (CHECK_INTS): gives the chance to perform to deferred
- finalizers before explicit GC.start or the process termination.
- [ruby-core:18045]
-
-Sun Jan 4 04:49:01 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_telldir): just returns loc.
-
- * win32/win32.c (rb_w32_rewinddir): needs to intialize loc.
- [ruby-core:18041]
-
-Sun Jan 4 04:45:26 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_select): recalc the rest of timeout for each
- iterations. [ruby-core:18015]
-
-Fri Jan 2 03:08:47 2009 Kouhei Sutou <kou@cozmixng.org>
-
- * test/rss/: use PNG instead of zlib as binary data. [ruby-dev:35666]
-
-Tue Nov 11 01:07:32 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * configure.in: fix SEGV on Mac OS X 10.5.3 with --enable-pthread.
- a patch from Wataru Kimura in Bug #193 [ruby-core:17333].
-
-Mon Aug 11 09:37:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dl/dl.c (rb_str_to_ptr): should propagate taint to dlptr.
-
- * ext/dl/dl.c (rb_ary_to_ptr): ditto.
-
- * ext/dl/sym.c (rb_dlsym_call): should check taint of DLPtrData as
- well.
-
-Fri Aug 8 10:53:52 2008 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb: randomize source port and transaction id.
- CVE-2008-1447.
-
- * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is
- "".
-
-Mon Aug 4 14:49:35 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP::rcptto): fix a typo. a patch from
- Masao Takaku <masao at nii.ac.jp>
- fix [ruby-dev:35489].
-
-Mon Aug 4 14:13:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regex.c (xmalloc, xrealloc, xfree): not to use ruby managed memory.
-
- * regex.c (DOUBLE_STACK, re_compile_fastmap0, re_adjust_startpos),
- (re_search, re_match_exec): check if failed to allocate memory.
-
-Mon Aug 4 13:53:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big2str0, bigsqr): made interruptible. [ruby-Bugs-20622]
-
-Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (check_uint, rb_num2uint, rb_fix2uint): fixed wrong check
- about 64bit positive value.
-Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (check_uint, rb_num2uint, rb_fix2uint): strict check.
- fixed [ruby-dev:33683]
-
-Thu Jul 17 21:42:07 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP::start): revert to avoid RFC2821
- violation. [ruby-dev:35487]
-
-Thu Jul 17 21:32:49 2008 Tanaka Akira <akr@fsij.org>
-
- * string.c (rb_str_format_m): make tmp volatile to avoid possible GC
- problem.
-
-Thu Jul 17 21:30:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#environment): requires shellwords.
- [ruby-dev:35466]
-
-Thu Jul 17 02:05:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): requires
- webrick/cookie. [ ruby-Bugs-21139 ]
-
-Thu Jul 17 01:38:31 2008 Yusuke Endoh <mame@tsg.ne.jp>
-
- * ext/zlib/zlib.c (rb_gzfile_set_mtime): fix typo. [ruby-core:17713]
-
-Sun Jul 13 00:08:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ipaddr.rb (IPAddr#initialize): get rid of ArgumentError in
- IPAddr#to_range. a patch from okkez <okkez000 AT gmail.com> in
- [ruby-dev:35091].
-
-Sun Jul 13 00:04:38 2008 Tanaka Akira <akr@fsij.org>
-
- * configure.in (erfc): erfc of glibc comes with Debian GNU/Linux Etch
- on IA64 is broken. erfc(10000.0) aborts.
- use missing/erf.c instead.
- http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
-
-Thu Jul 10 18:50:48 2008 Tanaka Akira <akr@fsij.org>
-
- * common.mk (SPEC_GIT_BASE): update RubySpec GIT URL.
-
-Thu Jul 10 18:46:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_extname): fix for file name with spaces.
- [ruby-talk:307404]
-
-Thu Jul 10 18:42:37 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb (PercentScanner#scan): fix %% line bug. [ruby-core:17491]
-
- * test/erb/test_erb.rb (test_percent): ditto.
-
-Thu Jul 10 18:40:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557]
-
-Thu Jul 10 18:36:53 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ruby.c: Mac OS X needs origargc times of '\0' in
- origargv. [ruby-dev:35308]
-
-Thu Jul 10 13:53:08 2008 Tanaka Akira <akr@fsij.org>
-
- * include/ruby/ruby.h (POSFIXABLE): use FIXNUM_MAX+1 instead of
- FIXNUM_MAX to make it possible to convert to double accurately.
- It assumes FLT_RADIX is 2.
- fix RubyForge bug #14102.
- backported from 1.9.
-
-Mon Jul 7 16:21:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/smtp.rb (Net::SMTP::start): use 'localhost' instead of
- 'localhost.localdomain'. [ruby-dev:35333]
-
- * lib/net/smtp.rb (Net::SMTP::SMTP.start): ditto.
-
-Mon Jul 7 15:02:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
- if it was frozen. clear all raised flags.
-
- * eval.c (stack_check): leave clearing flag to rb_longjmp.
-
- * eval.c (rb_thread_set_raised, rb_thread_reset_raised): use generic
- flags.
-
- * eval.c (Init_Proc), gc.c (Init_GC): freeze preallocated special exceptions.
-
- * gc.c (rb_memerror): use thread raised flag instead of static flag,
- and raise nomem_error without backtrace if failed to make backtrace.
- [ruby-dev:34724]
-
- * gc.c (ruby_xmalloc): increase malloc_increase only if malloc
- succeeds. failed malloc size can be huge. it may increase
- malloc_limit too big which cause less GC and memory full.
- (ruby_xrealloc): ditto.
-
-Mon Jul 7 12:23:05 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: avoid creating Ruby object during
- GC. thanks to arton <artonx AT yahoo.co.jp>. [ruby-dev:35313]
-
- * ext/win32ole/tests: add test_win32ole_event.rb, remove
- testOLEEVENT.rb
-
- * ext/win32ole/tests/testWIN32OLE.rb(test_convert_bignum):
- fix test.
-
-Mon Jul 7 12:23:05 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
- yahoo.co.jp> at [ruby-dev:35313].
-
- * intern.h: ditto.
-
-Thu Jul 3 20:13:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
- public methods only. [ruby-core:17283]
-
- * object.c (convert_type): ditto.
-
- * lib/singleton.rb (Singleton#_dump): conversion method should be
- public.
-
-Wed Jul 2 19:06:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/cgi.rb (CGI::QueryExtension.read_multipart): blanks inside
- double quotes are allowed. [ruby-list:45140]
-
-Wed Jul 2 19:03:37 2008 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (num_coerce): call rb_Float(x) first. don't depend on
- evaluation order of function arguments.
-
-Wed Jul 2 18:57:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syslog/syslog.c (syslog_write): syslog operations should be
- protected from $SAFE level 4. a patch from Keita Yamaguchi
- <keita.yamaguchi at gmail.com>.
-
- * ext/syslog/syslog.c (mSyslog_close): ditto.
-
- * ext/syslog/syslog.c (mSyslog_set_mask): ditto.
-
-Wed Jul 2 18:26:20 2008 Tanaka Akira <akr@fsij.org>
-
- * math.c (domain_check): fix preprocess condition.
-
-Wed Jul 2 18:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/tmpdir.rb (@@systmpdir): prior LOCAL_APPDATA if possible, and
- should be clean. based on a patch from arton <artonx AT
- yahoo.co.jp> at [ruby-dev:35269]
-
-Wed Jul 2 18:16:19 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (date2time_str): fix the overflow in
- some situation. [ruby-bugs-20793]
-
-Tue Jul 1 15:11:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_fill): check if beg is too big.
-
-Mon Jun 30 20:35:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_buf_cat): check for self concatenation.
-
-Sun Jun 29 21:39:54 2008 Tanaka Akira <akr@fsij.org>
-
- * eval.c (rb_obj_respond_to): use RTEST to test the result of
- respond_to? method.
-
-Sun Jun 29 21:20:17 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * array.c (rb_ary_fill): (compatibility) do not raise
- ArgumentError on negative length. This behaviour shall change
- in a future release.
-
-Sun Jun 29 20:08:11 2008 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_timeval): fix rounding negative float.
-
-Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/inlinetest.rb (InlineTest.in_progname): workaround for frozen
- $0. [ruby-dev:35261]
-
- * lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto.
-
-Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (set_arg0, ruby_prog_init): freeze $0. a patch from Keita
- Yamaguchi <keita.yamaguchi at gmail.com>.
-
-Sun Jun 29 18:33:33 2008 Tanaka Akira <akr@fsij.org>
-
- * process.c: include sys/resource.h if HAVE_SYS_RESOURCE_H is defined.
- pointed by TOYOFUKU Chikanobu. [ruby-dev:35258]
-
-Sun Jun 29 18:26:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_f_trace_var): should not be allowed at safe level 4.
- a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>.
-
- * eval.c (rb_call0): wrong condition to check insecure method.
- a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>.
-
-Sun Jun 29 18:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_fill): not depend on unspecified behavior at integer
- overflow. reported by Vincenzo Iozzo <snagg AT openssl.it>.
-
-Sun Jun 29 18:22:06 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c(ole_invoke): fix memory leak.
- [ruby-bugs-20792]
-
-Sun Jun 29 18:19:11 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * eval.c (PUSH_FRAME, PUSH_CLASS): Add volatile to avoid a
- possible optimization bug on OS X/PPC. This at least makes
- build with gcc -O1 and `make test' pass.
-
-Sun Jun 29 17:24:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
- magic comment.
-
-Sun Jun 29 17:22:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_each, strio_readlines): IO#each and
- IO#readlines do not affect $_. [ruby-core:17277]
-
-Sun Jun 29 17:19:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_readline, strio_each)
- (strio_readlines): set lastline. [ruby-core:17257]
-
-Sun Jun 29 17:15:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl.h: include winsock.h if USE_WINSOCK2 is not defined.
- a patch from arton <artonx at yahoo.co.jp> in [ruby-dev:35078]
-
-Sun Jun 29 17:09:48 2008 wanabe <s.wanabe@gmail.com>
-
- * util.c (ruby_strtod): ruby_strtod don't allow a trailing
- decimal point like "7.". [ruby-dev:34835] [ruby-dev:35009]
-
-Sat Jun 28 19:23:40 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * class.c (clone_method): use rb_copy_node_scope.
- fixed [ruby-list:45102]
- fixed [ruby-core:17393]
-
-Sat Jun 28 18:49:50 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * class.c: revert to r15855.
-
-Fri Jun 20 18:25:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_buf_append): should infect.
-
-Fri Jun 20 16:33:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_store, rb_ary_splice): not depend on unspecified
- behavior at integer overflow.
-
- * string.c (str_buf_cat): ditto.
-
-Wed Jun 18 22:24:46 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * array.c (ary_new, rb_ary_initialize, rb_ary_store,
- rb_ary_aplice, rb_ary_times): integer overflows should be
- checked. based on patches from Drew Yao <ayao at apple.com>
- fixed CVE-2008-2726
-
- * string.c (rb_str_buf_append): fixed unsafe use of alloca,
- which led memory corruption. based on a patch from Drew Yao
- <ayao at apple.com> fixed CVE-2008-2726
-
- * sprintf.c (rb_str_format): backported from trunk.
-
- * intern.h: ditto.
-
-Tue Jun 17 15:09:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): no need to expand root path which has no
- short file name. [ruby-dev:35095]
-
-Sun Jun 15 19:27:40 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * configure.in: Fix $LOAD_PATH. Properly expand vendor_ruby
- directories; submitted by Takahiro Kambe <taca at
- back-street.net> in [ruby-dev:35099].
-
-Mon Jun 9 17:56:30 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#delete_if): Call to_a.
- (SortedSet#delete_if, TC_SortedSet#test_sortedset): Use super to
- yield elements in sorted order; [ruby-core:17144] by Arthur
- Schreiber.
- (SortedSet#each, SortedSet#each, TC_Set#test_each)
- (TC_SortedSet#test_sortedset): Return self; [ruby-dev:35002] by
- Arthur Schreiber.
-
-Mon Jun 9 03:28:05 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up
- initialize_copy; [ruby-list:45016], [ruby-list:45018].
-
-Mon Jun 9 03:26:03 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: Mention new constants.
-
-Mon Jun 9 03:24:18 2008 Tanaka Akira <akr@fsij.org>
-
- * hash.c (hash_i): make Hash#hash order insensitive.
-
-Mon Jun 9 03:22:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (VENDOR_DIR): use LIBDIR instead of PREFIX as well as
- SITE_DIR. a patch from Richard Brown <rbrown AT exherbo.org> in
- [ruby-core:17129].
-
-Mon Jun 9 03:21:20 2008 Tanaka Akira <akr@fsij.org>
-
- * gc.c (os_obj_of): assure to not free the scanning heap.
-
-Mon Jun 9 03:20:12 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.
- fixed [ruby-dev:34979]
-
-Fri Jun 6 21:16:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (COMMON_HEADERS): include ws2tcpip.h.
-
- * ext/socket/addrinfo.h (addrinfo, getaddrinfo, getnameinfo,
- freehostent, freeaddrinfo): undef before define because these are
- macros in some versions of Windows SDK.
-
- * win32/setup.mak: maybe commit miss.
-
-Fri Jun 6 19:34:22 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * mkconfig.rb: hide build path from rbconfig.rb.
-
- * util.c (ruby_strtod, dtoa): initialize more variables for error
- handling.
-
- * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
- (path2class, path2module): constified.
-
- * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.
-
- * suppress warnings on cygwin, mingw and mswin.
-
-Fri Jun 6 19:23:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): fix for non-existent files and SFN of
- symlinks. [ruby-talk:303736]
-
-Fri Jun 6 18:25:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/iconv: Tests fixed.
-
-Fri Jun 6 17:04:56 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * win32/win32.h: include ws2tcpip.h. fixed [ruby-Bugs-20528]
-
- * lib/time.rb (Time.xmlschema): don't use float. fix
- http://rubyforge.org/tracker/index.php?func=detail&group_id=426&atid=1698&aid=20504
-
- * object.c (rb_obj_alloc): RDoc updated. a patch from Gaston
- Ramos <ramos.gaston at gmail.com> in [ruby-core:17073].
-
- * lib/rdoc.rb: massive spelling correction patch from Evan Farrar
- <evanfarrar at gmail.com> in [ruby-doc:1382] applied.
-
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize):
- Add a null check for ssl; submitted by akira yamada
- in [ruby-dev:34950].
-
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Define OP_NO_TICKET if
- SSL_OP_NO_TICKET is present; submitted by akira yamada
- in [ruby-dev:34944].
-
- * test/openssl/test_ssl.rb (OpenSSL#test_server_session): Add a
- workaround for the case where OpenSSL is configured with
- --enable-tlsext; submitted by akira yamada in [ruby-dev:34944].
-
-Fri Jun 6 16:58:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (iconv_iconv): fix for length argument and now
- allows range. [ruby-core:17092] [ruby-core:17115]
-
-Wed Jun 4 17:22:30 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: Fix typos and move misplaced entries.
- NEWS: Somehow optflags and warnflags were not actually included
- in this release.
-
-Tue Jun 3 19:33:22 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_init_copy): Take care of
- initialize_copy as well as initialize.
-
- * test/ruby/test_enumerator.rb: Pull in the test suite for
- enumerator from trunk.
-
-Tue Jun 3 12:51:57 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_allocate, enumerator_ptr): Properly
- detect if the object is initialized and raise error when
- appropriate.
- (enumerator_initialize): Fix a typo in rdoc. [ruby-core:17052]
-
-Tue Jun 3 10:16:40 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Fix a bug
- where tokens are not yilelded one by one.
- (ERB::Compiler::TrimScanner#explicit_trim_line): Fix without-
- strscan problems. [ruby_core:17028].
-
- * test/erb/test_erb.rb (TestERBCore#_test_01)
- (TestERBCore#test_02_safe_04): The expected value should come
- first for assert_equal().
- (TestERBCoreWOStrScan): Add test class for without-strscan.
-
-Mon Jun 2 19:47:16 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/delegate.rb (DelegateClass, Delegator#respond_to?):
- respond_to? must take optional second argument. This was a
- latent bug exposed by a recent internal change of marshal.c to
- call respond_to? with a second argument; submitted by Jeremy
- Kemper <jeremy at bitsweat.net> in [ruby-core:17045].
-
-Sat May 31 23:53:35 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * .: Release as Ruby 1.8.7.
-
-Sat May 31 23:33:34 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * README, README.ja: Add a note about default C flags.
+ * 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.
-Sat May 31 22:11:15 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Aug 16 20:28:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * version.c (ruby_description, ruby_copyright): backported from
- 1.9. bug#19002, [ruby-dev:34883]
+ * transcode.c (enc_arg, str_transcode_enc_args, econv_args):
+ remove volatile, and add GC guards in callers.
+ [ruby-core:75664] [Bug #12411]
- * error.c (report_bug): uses ruby_description.
+Tue Aug 16 14:58:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 31 20:56:04 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * array.c (rb_ary_delete_if): should return enumerator if no block
- is given. [ruby-dev:34901]
+Tue Aug 16 14:54:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 31 18:28:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (rb_local_constants_i): exclude private constants
+ when excluding inherited constants too. [Bug #12345]
- * suppress warnings with -Wwrite-string.
+Tue Aug 16 14:43:00 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Sat May 31 15:58:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342]
- * Makefile.in, configure.in (warnflags): defaulted to -Wall
- -Wno-parentheses with gcc. [ruby-dev:34810]
+ * test/drb/ut_timerholder.rb: ditto.
-Fri May 30 05:28:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Aug 16 14:07:18 2016 Marcus Stollsteimer <sto.mar@web.de>
- * enum.c (count_i, count_iter_i, count_all_i): add prototypes for VC.
+ * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
+ class description. [ci skip][Bug #12255][ruby-core:74835]
-Fri May 30 04:32:07 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Aug 16 14:06:04 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * enum.c (count_i, count_iter_i): Sync with trunk.
- enum.c (enum_count, count_all_i, Init_Enumerable),
- array.c (rb_ary_count): Sync with trunk. If no argument or
- block is given, count the number of all elements.
+ * 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]
-Fri May 30 03:12:18 2008 Akinori MUSHA <knu@iDaemons.org>
+ * pack.c (pack_unpack): ditto.
- * ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand):
- Int should be enough here.
+Tue Aug 16 13:59:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 30 02:35:00 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/socket/option.c, ext/socket/rubysocket.h (inet_ntop): share
+ the fallback definition. [ruby-core:76646] [Bug #12645]
- * ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),
- ext/openssl/ossl_pkey_dh.c (ossl_dh_s_generate)
- (ossl_dh_initialize),
- ext/openssl/ossl_pkey_dsa.c (ossl_dsa_s_generate),
- ext/openssl/ossl_rand.c (ossl_rand_bytes)
- (ossl_rand_pseudo_bytes, ossl_rand_egd_bytes),
- ext/openssl/ossl_x509store.c (ossl_x509stctx_set_error): Do not
- use FIX2INT() without checking the value type. Use NUM2INT()
- instead; found by akr in [ruby-dev:34890].
+Tue Aug 16 13:52:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 29 20:07:45 2008 Akinori MUSHA <knu@iDaemons.org>
+ * vm.c (vm_set_main_stack): remove unnecessary check. toplevel
+ binding must be initialized. [Bug #12611] (N1)
- * configure.in, win32/Makefile.sub, mkconfig.rb, instruby.rb,
- ruby.c, lib/mkmf.rb, README.EXT, README.EXT.ja: Backport the
- vendor_ruby directory support.
+ * string.c (rb_str_split_m): simplify the condition.
+ [Bug #12611](N4)
-Thu May 29 17:52:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 16 13:42:42 2016 Naohisa Goto <ngotogenome@gmail.com>
- * ext/zlib/extconf.rb: search zlib1, and regard mswin32 later than VC6
- as WIN32. [ruby-core:16984]
+ * thread.c (rb_wait_for_single_fd): Clean up fds.revents every time
+ before calling ppoll(2). [Bug #12575] [ruby-dev:49725]
-Wed May 28 17:54:29 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Aug 16 13:40:26 2016 Eric Wong <e@80x24.org>
- * string.c (rb_str_start_with): Remove an unused variable.
- (rb_str_upto_m): Fix a prototype.
+ * 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]
-Wed May 28 17:48:28 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Aug 16 13:38:36 2016 Kouhei Sutou <kou@cozmixng.org>
- * range.c (range_step): Fix brokenness when a non-integer numeric
- value is specified as step. [rubyspec]
- (range_step): Make use of String#step internally if a string (or
- string-alike) range is given.
+ * 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!!!
- * string.c (rb_str_upto_m, Init_String): Add an optional second
- argument to specify if the last value should be included.
+Tue Aug 16 13:36:00 2016 Koichi Sasada <ko1@atdot.net>
-Wed May 28 16:53:39 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * array.c (rb_ary_slice_bang): Call rb_ary_modify_check() at the
- beginning. [rubyspec]
+ * test/ruby/test_gc.rb: add a test.
-Wed May 28 16:12:44 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Aug 16 13:29:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler#do_GET):
- Set the HTTP status code to 302 if a Location header field is
- present and the status code is not valid as a client
- redirection. cf. RFC 3875 6.2.3, 6.2.4.
+ * lib/rubygems/package.rb: Fixed potential perms issue unpacking of
+ gems on NFS. [Backport #12579]
-Wed May 28 15:18:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems.rb: bump version.
- * lib/singleton.rb (SingletonClassMethods): _load should be public.
+Fri Aug 12 11:48:27 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Wed May 28 12:52:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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
- * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
- private methods too. [ruby-dev:34671]
+Fri Aug 12 11:45:02 2016 Shugo Maeda <shugo@ruby-lang.org>
- * object.c (convert_type): ditto.
+ * lib/net/http/generic_rquest.rb (write_header): A Request-Line must
+ not contain CR or LF.
-Tue May 27 23:26:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Aug 12 11:41:41 2016 Shugo Maeda <shugo@ruby-lang.org>
- * error.c (rb_bug): description from rb_bug() should include
- patchlevel. [ruby-dev:34826]
+ * lib/net/ftp.rb (putline): raise an ArgumentError when
+ CR or LF is included in a line.
-Tue May 27 20:19:22 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Aug 12 11:21:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_slice_bang): Return an empty array instead of
- nil when pos is valid and len is adjusted from a valid value to
- zero; caught by RubySpec.
+ * string.c (tr_trans): consider terminator length and fix heap
+ overflow. reported by Guido Vranken <guido AT guidovranken.nl>.
-Tue May 27 19:45:20 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Jul 12 00:17:36 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * numeric.c (flo_divmod): Revert the behavior change; do not
- suppress an exception when div is NaN or Inf. [ruby-dev:34857]
+ * tool/fake.rb: don't fake libdir. use libdirname instead.
-Tue May 27 19:24:40 2008 Akinori MUSHA <knu@iDaemons.org>
+Thu Jul 7 00:05:00 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * enum.c (enum_to_a): Pass arguments through to #each().
- (enum_sort): Follow the enum_to_a signature change.
- (enum_reverse_each): Add #reverse_each().
+ * bignum.c (Init_Bignum): revert a part of previous commit (r55598),
+ because the implementation of Object#hash is a little difference from
+ trunk. cf. [Backport #12391]
-Tue May 27 18:54:02 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Jul 6 23:02:03 2016 Kenta Murata <mrkn@mrkn.jp>
- * ext/stringio/stringio.c (strio_each_char, Init_stringio): Add
- StringIO#{each_char,chars}.
+ * bignum.c (rb_big_hash): make it public function to be available in
+ other source files, and remove documentation comment for Bignum#hash.
-Tue May 27 17:59:34 2008 Akinori MUSHA <knu@iDaemons.org>
+ * bignum.c (Bignum#hash): remove its definition because it is unified
+ with Object#hash.
- * ext/stringio/stringio.c (strio_each): Return an enumerator if no
- block is given.
- (strio_each_byte): Return an enumerator if no block is given,
- and return self if one is given as the rdoc says.
+ * include/ruby/intern.h (rb_big_hash): add a prototype declaration.
- * io.c (rb_io_each_byte): Fix rdoc. IO#each_byte returns self,
- not nil.
+ * hash.c (any_hash): treat Bignum values directly.
-Tue May 27 16:02:58 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Jun 10 17:48:51 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_mod_module_exec, Init_eval): Add
- Module#{module_exec,class_exec}.
+ * lib/optparse.rb (OptionParser::Completion.candidate): get rid of
+ nil as key names. [ruby-core:75773] [Bug #12438]
-Tue May 27 15:36:37 2008 Akinori MUSHA <knu@iDaemons.org>
+ * lib/optparse.rb (OptionParser#make_switch): char class option
+ cannot be NoArgument, default to RequiredArgument.
- * io.c (rb_io_each_char, argf_each_char, Init_IO):
- Add {IO#,ARGF.}{each_char,chars}.
+Fri Jun 10 17:44:59 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Tue May 27 13:46:52 2008 Akinori MUSHA <knu@iDaemons.org>
+ * re.c (unescape_nonascii): scan hex up to only 3 characters.
+ [Bug #12420] [Bug #12423]
- * ext/stringio/stringio.c (Init_stringio): Define
- StringIO#{getbyte,readbyte}.
+Fri Jun 10 17:44:59 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Tue May 27 13:38:51 2008 Akinori MUSHA <knu@iDaemons.org>
+ * regparse.c (fetch_token_in_cc): raise error if given octal escaped
+ character is too big. [Bug #12420] [Bug #12423]
- * io.c (Init_IO): Define {IO#,ARGF.}{getbyte,readbyte}.
+Fri Jun 10 17:34:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 27 13:26:15 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * ext/stringio/stringio.c (Init_stringio): Define #bytes and
- #lines.
+Fri Jun 10 16:30:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 27 13:20:35 2008 Akinori MUSHA <knu@iDaemons.org>
+ * parse.y (new_if_gen): set newline flag to NODE_IF to trace all
+ if/elsif statements. [ruby-core:67720] [Bug #10763]
- * io.c: (rb_io_lines, rb_io_bytes, Init_IO): Define
- IO#{lines,bytes} and ARGF.{lines,bytes}.
+Fri Jun 10 16:24:29 2016 Marcus Stollsteimer <sto.mar@web.de>
-Tue May 27 12:13:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/date/date_core.c (Init_date_core): [DOC] Convert DateTime
+ documentation to RDoc from Markdown.
+ [ruby-core:75136] [Bug #12311]
- * file.c (BUFCHECK): wrong condition. [ruby-core:16921]
+Fri Jun 10 16:12:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (file_expand_buf): shouldn't use buflen for length of string.
+ * variable.c (rb_local_constants_i): exclude hidden constants.
+ [ruby-core:75575] [Bug #12389]
-Mon May 26 18:24:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 10 16:10:23 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * file.c (BUFCHECK): no resize if enough room.
+ * regcomp.c (compile_length_tree): return error code immediately
+ if compile_length_tree raised error [Bug #12418]
- * file.c (file_expand_path): use BUFCHECK.
+Fri Jun 10 16:06:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 26 16:46:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/missing.h (isfinite): move from numeric.c.
- * file.c (ntfs_tail): filename which starts with '.' is valid.
+Fri Jun 10 16:06:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * file.c (file_expand_path): cygwin symlink support.
+ * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
+ cygwin. [Bug #12417][ruby-core:75691]
-Mon May 26 12:16:43 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Jun 10 16:06:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * .: Release as Ruby 1.8.7-preview4.
+ * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always
+ exist. fixed build error on Windows introduced at r55123.
-Mon May 26 12:12:26 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Jun 10 16:06:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * marshal.c (dump_ensure, load_ensure): should return values.
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider
+ non-finite float values not to raise FloatDomainError.
+ [ruby-core:75682] [Bug #12414]
- * eval.c (yield_under, yield_under_i, yield_args_under_i)
- (specific_eval, rb_obj_instance_exec, Init_eval): Implement
- Object#instance_exec(), a 1.9 feature.
+Fri Jun 10 16:00:27 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon May 26 11:53:21 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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.
- * eval.c (rb_yield_0, proc_invoke, proc_arity): allow passing a
- block to a Proc. [ruby-dev:23533]; by nobu; backported from
- 1.9. This implementation in current shape is known to be
- buggy/broken, especially with nested block invocation. Take
- this as an experimental feature.
+Fri Jun 10 15:56:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (block_par, block_var): ditto.
+ * string.c (rb_str_modify_expand): check integer overflow.
+ [ruby-core:75592] [Bug #12390]
-Mon May 26 08:00:52 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Jun 10 15:54:05 2016 Benoit Daloze <eregontp@gmail.com>
- * marshal.c (r_object0, Init_marshal): Fix the garbled s_call
- definition; fixes [ruby-dev:34843].
+ * 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]
-Mon May 26 03:16:20 2008 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_class.rb: test for above.
- * hash.c (rb_hash_default): Fix rdoc.
- (rb_hash_each, env_each_value, env_each_pair): Return an
- enumerator if no block is given.
- (rb_hash_update): Update rdoc.
- (envix): Conditionalize the definition itself.
- (rb_f_getenv, env_fetch, env_keys, env_values, env_values_at)
- (env_select, env_inspect, env_to_a, env_empty_p, env_has_key)
- (env_has_value, env_index, env_indexes, env_to_hash, env_shift)
- (env_update): Require secure level 4.
- (env_each_value, env_each_i): Delay variable initialization.
- (env_each_key, env_each_value, env_reject_bang)
- (env_clear, env_replace): Omit duplicated secure level check.
- (env_has_value): Do to_str conversion.
+Fri Jun 10 15:46:24 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun May 25 19:48:12 2008 Akinori MUSHA <knu@iDaemons.org>
+ * bignum.c: [DOC] Update result of 123456789 ** -2.
+ [ruby-dev:49606] [Bug #12339]
- * hash.c (env_delete_if): Return an enumerator if no block is
- given.
- (env_each_key): Delay a variable initialization after
- RETURN_ENUMERATOR().
+Fri Jun 10 15:37:25 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-Sun May 25 05:07:19 2008 Akinori MUSHA <knu@iDaemons.org>
+ * internal.h (RCOMPLEX_SET_IMAG): undef RCOMPLEX_SET_IMAG
+ instead of duplicated undef RCOMPLEX_SET_REAL.
- * array.c (rb_ary_slice_bang): Be consistent with Array#slice()
- and String#slice!(). Just return nil when a negative length or
- out of boundary index is given instead of raising an exception
- via internal functions.
- (rb_ary_slice_bang): should not use rb_ary_subseq() which shares
- internal pointer. splice modifies the receiver right after
- subseq. [ruby-dev:34005]
- (rb_ary_slice_bang): should adjust length before making
- sub-array.
+Fri Jun 10 15:37:25 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
- * enumerator.c (Init_Enumerator): Override
- Enumerable::Enumerator#each_with_index with #with_index.
+ * complex.c (rb_complex_set_imag): Fix to properly set imag
+ of complex.
-Sun May 25 03:13:09 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Jun 10 15:05:41 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (Init_Thread): Initialize recursive_key.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements new
+ truncate alternative which accepts UTF-8 path.
-Sun May 25 02:45:49 2008 Akinori MUSHA <knu@iDaemons.org>
+ * file.c (truncate): use above function.
+ [Bug #12340]
- * error.c (syserr_eqq): Use en.
+Fri Apr 29 20:11:38 2016 Tanaka Akira <akr@fsij.org>
-Sat May 24 22:32:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * 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.
- * object.c (rb_cstr_to_dbl): should clear errno before calling
- strtod(3). [ruby-dev:34834]
+Wed Apr 27 22:16:04 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat May 24 22:27:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (new_label_body): missed backporting r54548 in r54698.
+ this fixes randomly test failure introduced by r54698.
+ cf. [Bug #12082]
- * marshal.c (marshal_load): should initialize arg.data used for
- reentrant check. [ruby-dev:34837]
+Tue Apr 26 13:38:31 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat May 24 00:34:59 2008 Tanaka Akira <akr@fsij.org>
+ * README.EXT{,.ja}: `nul` should be uppercase.
+ change 'nul' => 'NUL'. [Fix GH-1172]
+ derived from a patch by craft4coder <yooobuntu@163.com>
- * lib/rational.rb (Rational#to_i): fix rdoc. Rational(-7,4).to_i
- should be -1.
+ * doc/extension.rdoc: Improvements to english grammers.
+ [Bug #12246][ruby-core:74792][ci skip]
+ derived from a patch by Marcus Stollsteimer <sto.mar@web.de>
-Fri May 23 20:22:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Apr 26 13:25:25 2016 Marcus Stollsteimer <sto.mar@web.de>
- * marshal.c (reentrant_check): check reentrance via callcc.
- [ruby-dev:34802]
+ * 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`
-Fri May 23 16:46:28 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Apr 26 13:22:45 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * enumerator.c (proc_call): Remove an unused static function.
+ * configure.in: add missing -lm for AIX.
-Fri May 23 13:46:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 26 13:22:45 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * configure.in (cflags): commit miss.
+ * 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.
-Fri May 23 09:52:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 26 13:18:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (MINIRUBY), common.mk (RUBYOPT): add purelib.rb.
- [ruby-core:16642]
+ * ruby.c: cygwin does not use w32_cmdvector, command line can be
+ other than UTF-8. [ruby-dev:49519] [Bug #12184]
- * ext/extmk.rb: load purelib.rb only when not cross compiling.
+Tue Apr 26 13:16:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 23 08:47:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval_jump.c (exec_end_procs_chain): restore previous error info
+ for each end procs. [ruby-core:75038] [Bug #12302]
- * error.c (syserr_eqq): === should be able to handle delegated
- objects as well.
+Fri Apr 22 18:36:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 23 04:22:19 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * compile.c (new_label_body): initialize bit fields, since
+ compile_data_alloc does not clear the memory. [Bug #12082]
- * ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: fix memory leak.
+Fri Apr 22 18:36:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: avoid trouble when finalize TclTkIp.
+ * compile.c (iseq_optimize): disable tail call optimization in
+ rescued, rescue, and ensure blocks.
+ [ruby-core:73871] [Bug #12082]
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/*: help to fix troubles when
- use Ttk widgets on old Tk scripts.
+Fri Apr 22 18:34:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/*: update and add demo scripts. some of them are
- introduction about new features of Tcl/Tk8.5.
+ * doc/regexp.rdoc (comments): [DOC] terminators cannot appear in
+ comments. [ruby-core:74838] [Bug #12256]
-Fri May 23 03:48:10 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 18:30:50 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * class.c (clone_method): Just use ruby_cref as cref.
+ * 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.
+ patches are derived from Marcus Stollsteimer in [ruby-core:74690].
+ [Bug #12228]
-Fri May 23 01:03:23 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 18:22:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c (rb_singleton_class_clone): Pass Qnil, not 0.
+ * ext/nkf/nkf-utf8/nkf.c (mime_putc): fix typo.
+ [Bug #12202] [ruby-core:74802]
-Fri May 23 00:51:48 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 18:22:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c (clone_method): Totally revamp the previous fix which
- was incorrect.
- (rb_mod_init_copy): Ditto.
- (singleton_class_clone_int): Ditto.
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
+ patched by Anton Sivakov [Bug #12201] [Bug #12202]
-Fri May 23 00:48:10 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 18:16:51 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (rb_copy_node_scope), node.h: Rename from copy_node_scope
- and export.
+ * 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 directory (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
-Thu May 22 21:24:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Apr 22 18:13:22 2016 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * parse.y (top_local_setup): fixed memory leak bug based on a
- patch from Roger Pack <rogerpack2005 at gmail.com> in
- [ruby-core:16610].
+ * 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]
-Thu May 22 14:20:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 22 16:37:14 2016 multisnow <infinity.blick.winkel@gmail.com>
- * array.c (flatten): check if reentered. [ruby-dev:34798]
+ * ext/openssl/extconf.rb: check RAND_edg to support libressl.
-Thu May 22 08:28:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
+ is available. [Fix GH-829]
- * array.c (flatten): free memo hash table before raising exception.
- [ruby-dev:34789]
+Fri Apr 22 16:24:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 22 06:30:10 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (rb_cv_lgamma_r_m0): fix the condition for
+ lgamma_r(-0.0). [Bug #12249]
- * array.c (flatten): fix memory leak.
+Fri Apr 22 16:24:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 22 05:45:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)
+ returns negative infinity. [Bug #12249]
- * proc.c (proc_dup): should copy safe_level from src proc
- properly. a patch from Keita Yamaguchi
- <keita.yamaguchi at gmail.com>
+ * math.c (ruby_lgamma_r): define by the configured result.
-Wed May 21 23:31:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 22 16:24:00 2016 cremno phobia <cremno@mail.ru>
- * eval.c (rb_get_method_body, rb_alias, rb_eval): should not cache
- uninitialized value, since search_method doesn't set origin if the
- method wasn't found.
+ * math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
+ since msvcrt does not provide it.
- * eval.c (search_method, remove_method, error_print, rb_alias)
- (rb_eval, rb_rescue2, search_required, Init_eval, rb_thread_create),
- gc.c (rb_source_filename, Init_stack), io.c (rb_io_getline),
- parse.y (rb_id2name, rb_parser_free): suppress warnings.
+ * missing/lgamma_r.c (lgamma_r): fix lgamma(-0.0).
+ [ruby-core:74823] [Bug #12249]
-Wed May 21 12:34:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Apr 22 16:24:00 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * hash.c (rb_hash_delete): rdoc fix based on a patch from Gaston Ramos
- <ramos.gaston AT gmail.com>. [ruby-core:16825]
+ * math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
+ cf. [Bug #12249]
-Tue May 20 13:15:46 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 16:24:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (lchmod_internal): Remove a compiler warning.
+ * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
+ [ruby-core:74817] [Bug #12249]
-Mon May 19 18:22:35 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 16:00:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkcs5.c (ossl_pkcs5_pbkdf2_hmac): Fix the type
- of md; pointed out by Takahiro Kambe <taca at back-street.net>
- in [ruby-dev:34748].
+ * defs/keywords (alias, undef): symbol literals are allowed.
-Mon May 19 14:20:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (parse_percent): should parse symbol literals for alias
+ and undef. [ruby-dev:47681] [Bug #8851]
- * sprintf.c (rb_f_sprintf): fixed SEGV on win32 with "% 0e" % 1.0/0.0.
+Fri Apr 22 15:47:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 19 13:29:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * struct.c (struct_make_members_list): extract making member name
+ list from char* va_list, with creating symbols without
+ intermediate IDs.
- * process.c (rb_f_system): set last_status when status == -1 because
- there is no path to set it on win32. this patch is derived from
- [ruby-core:16787], submitted by Luis Lavena <luislavena at gmail.com>
+Fri Apr 22 15:19:01 2016 Joe Swatosh <joe.swatosh@gmail.com>
-Mon May 19 13:01:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix
+ API names. [ruby-core:74863] [Bug #12264]
- * common.mk ({MSPEC,RUBYSPEC}_GIT_URL): moved from Makefine.in.
+Fri Apr 22 15:13:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * {win32,bcc32}/Makefile.sub (update-rubyspec): added.
+ * 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]
-Mon May 19 11:53:45 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Apr 22 15:08:27 2016 Benoit Daloze <eregontp@gmail.com>
- * ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted
- prototype change in openssl bundled with newer OpenBSD.
- a patch from Takahiro Kambe <taca at back-street.net> in
- [ruby-dev:34691].
+ * thread.c (update_coverage): Do not track coverage in loaded files
+ after Coverage.result. Avoids out-of-bounds access. [Bug #12237]
-Mon May 19 06:36:37 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/coverage/coverage.c (coverage_clear_result_i): document.
- * .: Release as Ruby 1.8.7-preview3.
+Fri Apr 22 14:56:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 18 22:26:51 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
+ of DateTime. [ruby-core:74729] [Bug #12233]
- * lib/webrick/httpservlet/filehandler.rb: should normalize path
- name in path_info to prevent script disclosure vulnerability on
- DOSISH filesystems. (fix: CVE-2008-1891)
- Note: NTFS/FAT filesystem should not be published by the platforms
- other than Windows. Pathname interpretation (including short
- filename) is less than perfect.
+Fri Apr 22 14:48:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpservlet/abstract.rb
- (WEBrick::HTTPServlet::AbstracServlet#redirect_to_directory_uri):
- should escape the value of Location: header.
+ * parse.y (parse_ident): allow keyword arguments just after a
+ method where the same name local variable is defined.
+ [ruby-core:73816] [Bug#12073]
- * lib/webrick/httpservlet/cgi_runner.rb: accept interpreter
- command line arguments.
+Fri Apr 22 14:34:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 17 23:53:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (setup_exception): set the cause only if it is explicitly
+ given or not set yet. [Bug #12068]
- * file.c (file_expand_path): fix for short file name on Cygwin.
+Fri Apr 22 14:13:28 2016 sorah (Shota Fukumori) <her@sorah.jp>
-Sat May 17 11:29:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/forwardable.rb: Convert given accessors to String.
- * file.c (rb_file_s_extname): first dot is not an extension name.
+ 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.
-Sat May 17 10:18:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ def_delegator Foo, :some_method
- * re.c (rb_reg_search): need to free allocated buffer in re_register.
+ This change is to revert unexpected incompatibility. But this behavior
+ may change in the future.
-Fri May 16 17:01:44 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Apr 22 14:13:28 2016 Elliot Winkler <elliot.winkler@gmail.com>
- * win32/Makefile.sub (test-rubyspec): added.
+ * lib/forwardable.rb (def_instance_delegator) fix delegating to
+ 'args' and 'block', clashing with local variables in generated
+ methods. [ruby-core:72579] [Bug #11916]
-Fri May 16 16:22:40 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/forwardable.rb (def_single_delegator): ditto.
- * ext/tk/tcltklib.c: sometimes freeze when receive Interrupt signal.
+Fri Apr 22 13:41:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 16 14:54:56 2008 Tanaka Akira <akr@fsij.org>
+ * 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]
- * Makefile.in (update-rubyspec): move rubyspec to srcdir.
- (test-rubyspec): ditto.
+Thu Mar 31 05:06:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 16 14:25:22 2008 Tanaka Akira <akr@fsij.org>
+ * sprintf.c (rb_str_format): fix buffer overflow, length must be
+ greater than precision. reported by William Bowling <will AT
+ wbowling.info>.
- * Makefile.in (test-rubyspec): use RUNRUBY. suggested by nobu.
+Thu Mar 31 04:49:05 2016 Kimura Wataru <kimuraw@i.nifty.jp>
-Fri May 16 13:01:43 2008 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_io.rb: handled rlimit value same as r52277
+ [Bug #11852][ruby-dev:49446]
- * Makefile.in (update-rubyspec): new target to download rubyspec.
- (test-rubyspec): new target to run rubyspec. this doesn't work
- before install.
+Wed Mar 30 06:37:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 16 08:15:52 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * 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/tk/lib/tk.rb: fix memory (object) leak bug.
+Wed Mar 30 06:11:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/sample/demos-jp/aniwave.rb, ext/tk/sample/demos-en/aniwave.rb:
- bug fix.
+ * thread_pthread.c (reserve_stack): fix reserving position where
+ the stack growing bottom to top. [Bug #12118]
-Thu May 15 17:00:22 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * string.c (Init_String): Define #bytesize as an alias for #size
- for compatibility with 1.9.
+ * .travis.yml: removed commented-out code.
-Thu May 15 15:33:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * file.c (file_expand_path): support for alternative data stream
- and ignored trailing garbages of NTFS.
+ * .travis.yml: removed osx code. follow up with r53517
- * file.c (rb_file_s_basename): ditto.
+Wed Mar 30 06:04:18 2016 Aaron Patterson <tenderlove@ruby-lang.org>
- * file.c (rb_file_s_extname): ditto.
+ * .travis.yml: update libssl before running tests.
+ Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for figuring out the
+ travis settings!
-Wed May 14 19:24:59 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * array.c (rb_ary_count): Override Enumerable#count for better
- performance.
- (rb_ary_nitems): Undo the backport. Use #count {} instead.
+ * .travis.yml: removed Ruby 1.9.3 build on Travis CI
- * enumerator.c (enumerator_iter_i): Remove an unused function.
- (enumerator_with_index, enumerator_each): Remove unused
- variables.
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed May 14 17:15:11 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * .travis.yml: Remove redundant configuration option.
+ [fix GH-809] Patch by @gxworld
- * ext/tk/tkutil/extronf.rb: check stdndup() because it's not standard
- function of C.
+Wed Mar 30 05:15:04 2016 Kazuki Yamaguchi <k@rhe.jp>
- * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): use malloc() and
- strncpy() instead of strndup() if not available.
+ * 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]
-Wed May 14 09:52:02 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/openssl/ossl_ssl.c: update #ifdef(s) as above.
- * ext/tk/tkutil/tkutil.c: improve handling callback-subst-keys.
- Now, support longnam-keys (e.g. '%CTT' on tkdnd-2.0; however, still
- not support tkdnd-2.0 on tkextlib), and symbols of parameters (e.g.
- :widget=>'%W', :keycode=>'%k', '%x'=>:x, '%X'=>:root_x, and so on;
- those are attributes of event object). It means that Ruby/Tk accepts
- not only "widget.bind(ev, '%W', '%k', ...){|w, k, ...| ... }", but
- also "widget.bind(ev, :widget, :keycode, ...){|w, k, ...| ... }".
- It is potentially incompatible, when user passes symbols to the
- arguments of the callback block (the block receives the symbols as
- strings). I think that is very rare case (probably, used by Ruby/Tk
- experts only). When causes such trouble, please give strings instead
- of such symbol parameters (e.g. call Symbol#to_s method).
+ * test/openssl/test_ssl.rb: skip NPN tests if NPN is disabled.
- * ext/tk/lib/tk/event.rb, ext/tk/lib/tk/validation.rb,
- ext/tk/lib/tkextlib/blt/treeview.rb,
- ext/tk/lib/tkextlib/winico/winico.rb: ditto.
+Wed Mar 30 05:13:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tkutil/tkutil.c: strings are available on subst_tables on
- TkUtil::CallbackSubst class (it is useful on Ruby 1.9).
+ * lib/uri/http.rb (URI::HTTP#initialize): [DOC] fix example,
+ missing mandatory arguments. [ruby-core:74540] [Bug #12215]
- * ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tkextlib/iwidgets/hierarchy.rb,
- ext/tk/lib/tkextlib/iwidgets/spinner.rb,
- ext/tk/lib/tkextlib/iwidgets/entryfield.rb,
- ext/tk/lib/tkextlib/iwidgets/calendar.rb,
- ext/tk/lib/tkextlib/blt/dragdrop.rb,
- ext/tk/lib/tkextlib/tkDND/tkdnd.rb,
- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb,
- ext/tk/lib/tkextlib/tktable/tktable.rb: disable code piece became
- unnecessary by reason of the changes of ext/tk/tkutil/tkutil.c.
+Tue Mar 29 02:22:35 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-Tue May 13 15:10:50 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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
- * enumerator.c: Update rdoc.
- (enumerator_initialize): Discourage the use.
- (enum_each_slice, enum_each_cons, enumerator_each)
- (enumerator_with_index): Add a note about a call without a block.
+Tue Mar 29 02:08:40 2016 Koichi Sasada <ko1@atdot.net>
- * NEWS: Intentionally omit enum_slice and enum_cons, which are
- removed in 1.9.
+ * signal.c: should also clear ruby_disable_gc.
+ [Bug #11692]
-Tue May 13 07:56:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Mar 29 02:04:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_cat): fixed buffer overrun reported by
- Christopher Thompson <cthompson at nexopia.com> in [ruby-core:16746]
+ * 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]
-Mon May 12 13:57:19 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Mar 29 02:02:53 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * eval.c (is_defined): add NODE_OP_ASGN_{OR,AND}. "defined?(a||=1)"
- should not operate assignment. [ruby-dev:34645]
+ * 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.
-Mon May 12 12:59:23 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Mar 29 01:56:24 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to
- an invalid value.
+ * lib/rubygems/installer.rb: merge partially r49511.
+ cherry picking https://github.com/rubygems/rubygems/commit/f9232680
+ [Bug #12066]
- * ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom.
+Tue Mar 29 01:41:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 12 12:36:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * string.c (enc_succ_alnum_char): try to skip an invalid character
+ gap between GREEK CAPITAL RHO and SIGMA.
+ [ruby-core:74478] [Bug #12204]
- * win32/win32.c (rb_w32_select): backport from trunk.
- [ruby-talk:300743]
+Tue Mar 29 01:27:52 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
-Mon May 12 12:33:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * common.mk (RUBYLIB, RUBYOPT): clear.
+Tue Mar 29 01:24:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Mon May 12 10:41:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/trans/JIS: update Unicode's notice. [Bug #11844]
- * lib/delegate.rb (SimpleDelegator::dup): removed needless argument.
- [ruby-list:44910]
+Tue Mar 29 01:22:39 2016 Eric Hodel <drbrain@segment7.net>
- * lib/delegate.rb (clone, dup): keep relationship with the target
+ * marshal.c (r_object0): raise ArgumentError when linking to undefined
object.
-Sun May 11 23:19:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (all_iter_i, any_iter_i): reduced duplicated code.
-
-Sun May 11 17:57:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (MINIRUBY): should not include extension library path.
-
-Sun May 11 10:36:10 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * eval.c (method_name, method_owner): New methods; backported
- from 1.9. (UnboundMethod#name, UnboundMethod#owner)
-
-Sun May 11 02:48:13 2008 <nagai@orca16.orcabay.ddo.jp>
-
- * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: fail to do pack/grid
- without options.
-
- * ext/tk/lib/tk.rb: add TkWindow#grid_anchor, grid_column, grid_row.
-
-Sat May 10 18:19:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_each_line): RDoc updated. [ruby-dev:34586]
-
-Sat May 10 13:17:56 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: increase supported
- parameter patterns of configure method.
-
-Sat May 10 09:16:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): backported from 1.9. a patch from Satoshi
- Nakagawa <psychs at limechat.net> in [ruby-dev:34625].
- fixed: [ruby-dev:34623]
-
-Fri May 9 23:33:25 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/wm.rb: methods of Tk::Wm_for_General module cannot
- pass the given block to methods of Tk::Wm module.
-
- * ext/tk/lib/tk/grid.rb: lack of module-method definitions.
-
- * ext/tk/lib/tkextlib/tile.rb: lack of autoload definitions.
-
- * ext/tk/lib/tkextlib/tile/tnotebook.rb: cannot use kanji (not UTF-8)
- characters for headings.
-
- * ext/tk/tcltklib.c: maybe a little more stable about @encoding value
- of TclTkIp object.
-
-Wed May 7 08:46:44 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_s_def): to_str should be called only once.
- [ruby-core:16647]
-
-Wed May 7 00:54:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/zlib/zlib.c (gzreader_gets): may cause infinite loop.
- a patch from Kouya <kouyataifu4 at gmail.com> in
- [ruby-reference-manual:762].
-
-Sun May 4 09:35:51 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * sample/erb/erb4html.rb (ERB4Html) : add example of ERB#set_eoutvar.
- ERB4Html is an auto-quote ERB.
-
-Sat May 3 22:52:48 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb,
- ext/tk/sample/ttk_wrapper.rb: improve treating and control themes.
- add Tk::Tile.themes and Tk::Tile.set_theme(theme).
-
-Fri May 2 14:52:33 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el: move fontifying code from hook. a patch from
- Phil Hagelberg <phil at hagelb.org> in [ruby-core:16636].
-
-Fri May 2 13:47:51 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (match_select): restore previous behavior of MatchData#select.
- RDoc updated as well, mentioning the plan to remove this method
- in the future. [ruby-dev:34556]
-
-Fri May 2 13:04:04 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dbm/dbm.c (Init_dbm): defines DBM::VERSION even when
- DB_VERSION_STRING is not available. [ruby-dev:34569]
-
-Thu May 1 23:57:06 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- Merged 16257 from trunk.
-
- * lib/net/telnet.rb: This patch from Brian Candler adds a FailEOF mode which
- can be activated to have net/telnet raise EOFError exceptions when the
- remote connection is closed. The default behavior remains unchanged though.
-
-Thu May 1 23:43:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_step): check if step can be converted to an integer.
- [ruby-dev:34558]
-
- * range.c (range_step): allow float step bigger than zero but less
- than one. [ruby-dev:34557]
-
-Wed Apr 30 20:22:40 2008 James Edward Gray II <jeg2@ruby-lang.org>
-
- Merged 16241 from trunk.
-
- * lib/net/telnet.rb: Fixing a bug where line endings would not be properly
- escaped when the two character ending was broken up into separate TCP
- packets. Issue reported and patched by Brian Candler.
-
-Wed Apr 30 17:47:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_search): use local variable. a patch from wanabe
- <s.wanabe AT gmail.com> in [ruby-dev:34537]. [ruby-dev:34492]
-
-Sat Apr 26 19:40:34 2008 Guy Decoux <decoux@moulon.inra.fr>
-
- * class.c (struct clone_method_data): Add cref.
- (clone_method): Properly handle NODE_BMETHOD and NODE_DMETHOD.
- (rb_singleton_class_clone, singleton_class_clone_int): Set a
- proper value to klass and propagate cref. [ruby-core:16238]
-
- * eval.c (rb_block_dup, rb_method_dup), intern.h: Add duplicator
- methods for use from class.c#clone_method().
-
-Fri Apr 25 15:46:37 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/scrollbar.rb, ext/tk/lib/tk/scale.rb:
- improve unknonw-option check when create a widget.
-
- * ext/tk/lib/tkextlib/blt/unix_dnd.rb, ext/tk/lib/tkextlib/blt/ted.rb,
- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix on 'cget'.
-
- * ext/tk/lib/tk/menuspec.rb: option check will fail when
- TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.
-
- * ext/tk/lib/tk/palette.rb: bug fix.
-
-Fri Apr 25 12:37:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (flatten): returns an instance of same class.
- [ruby-core:16554]
-
-Thu Apr 24 23:47:50 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/net/pop.rb: backported from 1.9. bug#19003
-
- * ext/openssl/lib/openssl/ssl.rb: set_params; backported from 1.9.
- bug#19552, [ruby-dev:34402]
-
- * ext/openssl/ossl_ssl.c: ditto.
-
- * test/openssl/test_ssl.rb: ditto.
-
-Thu Apr 24 17:06:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (THREAD_SAVE_CONTEXT): remove unnecessary
- FLUSH_REGISTER_WINDOWS before calling setjmp(). [ruby-core:16285]
+Tue Mar 29 01:22:39 2016 Eric Hodel <drbrain@segment7.net>
-Thu Apr 24 14:15:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
- * dln.c (dln_find_1): prior files with extensions to files sans
- extensions. [ruby-core:16517]
+Tue Mar 29 01:20:37 2016 Eric Wong <e@80x24.org>
-Wed Apr 23 15:39:31 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): document as MT-unsafe
+ [ruby-core:73803] [Bug #12069]
- * eval.c (bind_eval): Add Binding#eval, a shorthand method for
- eval(str, binding, ..); backported from 1.9.
+Tue Mar 29 01:07:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Apr 23 15:28:52 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * insns.def (opt_mod): show its method name on ZeroDivisionError.
+ [Bug #12158]
- * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): failed
- notice moved from comment to assertion message. [ruby-dev:29127]
+Tue Mar 29 01:05:28 2016 Anthony Dmitriyev <antstorm@gmail.com>
-Wed Apr 23 14:00:05 2008 Akinori MUSHA <knu@iDaemons.org>
+ * net/ftp.rb: add NullSocket#closed? to fix closing not opened
+ connection. [Fix GH-1232]
- * lib/mkmf.rb (create_makefile): Add a missing dependency on the
- target directory for each .rb file. This will hopefully fix
- parallel make (-jN). Tested on FreeBSD.
+Tue Mar 29 01:02:49 2016 Koichi ITO <koic.ito@gmail.com>
-Wed Apr 23 11:49:54 2008 Akinori MUSHA <knu@iDaemons.org>
+ * variable.c: Added documentation about order of `Module#constants`
+ [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301]
- * lib/set.rb (Set#each, SortedSet#each, TC_Set#test_each): Return
- an enumerator if no block is given.
+Tue Mar 29 00:56:10 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Wed Apr 23 00:42:49 2008 Tanaka Akira <akr@fsij.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.
- * eval.c (error_print): show full stack grace except SystemStackError.
- backport from 1.9. [ruby-dev:31014]
+Tue Mar 29 00:53:26 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Wed Apr 23 00:18:45 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.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.
- * test/ruby/test_symbol.rb (TestSymbol#test_to_proc): Improve
- tests of Symbol#to_proc.
+Tue Mar 29 00:44:55 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Tue Apr 22 22:43:05 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * eval.c (rb_proc_new, YIELD_FUNC_LAMBDA): Add a new nd_state
- YIELD_FUNC_LAMBDA which avoids automatic `avalue' conversion for
- arguments. This fixes a bug where [1,[2,3]].map(&:object_id)
- fails.
-
- * intern.h, object.c: Hide rb_proc_new() from intern.h. It should
- not be considered an official API function yet.
-
-Tue Apr 22 21:24:32 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * eval.c (rb_proc_new): Turn the BLOCK_LAMBDA flag on.
-
- * object.c (sym_to_proc), test/ruby/test_symbol.rb: Add back
- Symbol#to_proc, now that it passes the tests.
-
-Tue Apr 22 19:35:03 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c (enumerator_initialize): Remove an undocumented
- feature (passing a block to the constructor) that's broken.
- This is not what I intended.
-
-Tue Apr 22 17:49:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): should protect temporary string from
- GC. [ruby-dev:34480]
-
-Tue Apr 22 17:12:05 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regex.c (re_search): string might be NULL. [ruby-core:16478]
-
-Tue Apr 22 16:44:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * object.c (rb_obj_tap): Correct documentation; pointed out by
- okkez in [ruby-dev:34472].
-
-Tue Apr 22 10:05:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (eaccess): workaround for recent msvcrt's behavior.
- [ruby-core:16460]
-
-Mon Apr 21 16:06:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enumerator.c (enumerator_init): preserve the method name in ID.
-
- * enumerator.c (enumerator_each): need not to call rb_to_id().
-
- * enumerator.c (enumerator_with_index): ditto.
-
-Mon Apr 21 17:19:52 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * eval.c (rb_f_method_name): New gloval function: __method__;
- backported from matzruby / 1.9.
-
- * eval.c (rb_frame_this_func), intern.h: New internal function.
-
- * intern.h (RETURN_ENUMERATOR): Use rb_frame_this_func() instead
- of rb_frame_last_func(), to accommodate the behavior to that of
- 1.9.
-
-Mon Apr 21 15:54:48 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile::_close): check @data before modifying
- it; backported from 1.9. [ruby-dev:34094]
-
- * lib/tempfile.rb (Tempfile::close): clear @data and @tmpname.
-
-Mon Apr 21 10:17:17 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c: should include <errno.h> to refer errno.
-
-Mon Apr 21 10:02:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * hash.c (recursive_hash): prototype.
-
-Mon Apr 21 10:00:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (rb_strftime): check errno to detect strftime(3)'s error.
- this is workaround for recent version of MSVCRT.
- [ruby-dev:34456]
-
-Sun Apr 20 21:10:04 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * .: Release as Ruby 1.8.7-preview2.
-
-Sun Apr 20 21:02:06 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * enumerator.c: Resolve the method every time an enumeration
- method is run, not once when the enumerator is initialized as it
- was before, so that method_missing() and method (re)definition
- afterwards are both in effect; pointed out in: [ruby-core:16441]
-
-Sun Apr 20 17:59:25 2008 Akinori MUSHA <knu@iDaemons.org>
-
- * object.c, NEWS, test/ruby/test_symbol.rb: Revert Symbol#to_proc
- since it does not pass the tests.
-
-Sun Apr 20 14:29:35 2008 Technorama Ltd. <oss-ruby@technorama.net>
-
- * ext/openssl/ossl_ssl.c: initialize session class.
-
-Sat Apr 19 20:54:42 2008 akira yamada <akira@arika.org>
-
- * lib/uri/ftp.rb, lib/uri/generic.rb, test/uri/test_common.rb,
- test/uri/test_ftp.rb, test/uri/test_generic.rb: backported from 1.9.
- [ruby-dev:31318]
+ * 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.
-Sat Apr 19 20:35:02 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Mar 29 00:43:40 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * lib/yaml/baseemitter.rb, lib/yaml/encoding.rb: performance
- tuning around String#gsub.
+ * 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.
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
+Tue Mar 29 00:42:10 2016 Rei Odaira <Rei.Odaira@gmail.com>
- * lib/yaml/store.rb (YAML::load): modified to support empty
- database.
+ * 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]
- * lib/yaml/store.rb (YAML::Store::marshal_dump_supports_canonical_option?):
- add a method to support faster PStore.
+Tue Mar 29 00:33:06 2016 Rei Odaira <Rei.Odaira@gmail.com>
-Sat Apr 19 20:16:52 2008 Akinori MUSHA <knu@iDaemons.org>
+ * thread_pthread.c (getstack): __pi_stacksize returned by
+ pthread_getthrds_np() is wrong on AIX. Use
+ __pi_stackend - __pi_stackaddr instead.
- * lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit;
- merged from 1.9.
+Tue Mar 29 00:06:58 2016 Alex Boyd <alex@opengroove.org>
- * lib/yaml.rb (quick_emit): use combination of object_id and hash to
- identify repeated object references, since GC will reuse memory of
- objects during output of YAML. [ruby-Bugs-8548] [ruby-Bugs-3698];
- merged from 1.9.
+ * lib/irb.rb: avoid to needless truncation when using back_trace_limit option.
+ [fix GH-1205][ruby-core:72773][Bug #11969]
-Sat Apr 19 20:05:39 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Mar 29 00:00:27 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):
- Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and
- handle recursive data properly.
+ * ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb: fix method name typo.
+ [ruby-core:72513] [Bug #11893] The patch provided by Akira Matsuda.
- * hash.c (hash_equal, rb_hash_hash): Make Hash#eql?, #hash and #==
- use rb_exec_recursive() and handle recursive data properly.
-Sat Apr 19 19:26:09 2008 Akinori MUSHA <knu@iDaemons.org>
+Mon Mar 28 23:58:27 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * intern.h, eval.c (rb_exec_recursive): New internal function to
- help perform recursive operation; backported from 1.9.
+ * ext/tk/lib/tkextlib/tcllib/toolbar.rb: fix method name typo.
+ [ruby-core:72511] [Bug #11891] The patch provided by Akira Matsuda.
-Sat Apr 19 18:42:04 2008 Akinori MUSHA <knu@iDaemons.org>
- * intern.h, hash.c (rb_hash_lookup): New internal function to
- check if a key exists in a hash, ignoring #default; backported
- from 1.9.
+Mon Mar 28 23:57:33 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri Apr 18 18:56:57 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/tk/lib/tkextlib/blt/tree.rb: fix method name typo.
+ [ruby-core:72510] [Bug #11890] The patch provided by Akira Matsuda.
- * ext/syck/rubyext.c (syck_genericresolver_node_import): should
- not set instance variable "@kind" before initializing it.
- [ruby-dev:32677]
- * ext/syck/rubyext.c (syck_resolver_initialize,
- syck_resolver_detect_implicit, syck_emitter_emit): remove unused
- variables.
+Mon Mar 28 23:56:17 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri Apr 18 18:54:57 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/tk/lib/tk/menubar.rb: fix a typo in font name. [ruby-core:72505]
+ [Bug #11886] The patch provided by Akira Matsuda.
- * ext/syck/rubyext.c: Node#value defined twice.
+ * ext/tk/sample/*.rb: ditto.
- * lib/yaml/: several method redefinitions causing warnings.
+Mon Mar 28 23:20:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 18 16:36:16 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * lib/rexml/node.rb (REXML::Node::indent): should initialize rv
- variable. a patch from Tadayoshi Funaba <tadf AT dotrb.org> in
- [ruby-dev:32783].
+Mon Mar 28 23:15:54 2016 Kenta Murata <mrkn@mrkn.jp>
-Fri Apr 18 16:01:37 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
+ and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++.
+ [ruby-core:72736] [Bug #11962]
- * lib/rexml: Merge fixes since 1.8.6 made solely on the ruby_1_8_6
- branch.
+Thu Mar 24 20:39:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 16 06:11:49 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/socket/option.c (inspect_tcpi_msec): more accurate condition
+ for TCPI msec member inspection function.
+ [ruby-core:74388] [Bug #12185]
- * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_event):
- Fix tests to reflect the following changes: r15833, r15759.
+Thu Mar 10 00:22:25 2016 Naotoshi Seo <sonots@gmail.com>
-Wed Apr 16 05:03:48 2008 Akinori MUSHA <knu@iDaemons.org>
+ * lib/logger.rb: Remove block from Logger.add as it's not needed
+ patch provided by Daniel Lobato Garcia [fix GH-1240] [Bug #12054]
- * .: Release as Ruby 1.8.7-preview1.
+Thu Mar 10 00:17:57 2016 Zachary Scott <zzak@ruby-lang.org>
-Wed Apr 16 02:09:14 2008 Kouhei Sutou <kou@cozmixng.org>
+ * re.c: Remove deprecated kcode argument from Regexp.new and compile
+ patch provided by Dylan Pulliam [Bug #11495]
- * lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403]
+Thu Mar 10 00:17:57 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * test/xmlrpc/test_cookie.rb: add a test for the above fix.
+ * re.c: Update documentation for Regexp class.
+ [fix GH-937][ci skip] Patch by @davydovanton
-Tue Apr 15 23:48:28 2008 Akinori MUSHA <knu@iDaemons.org>
+Thu Mar 10 00:04:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * version.h: Branch off ruby_1_8_7 from ruby_1_8 in preparation
- for the forthcoming 1.8.7 release.
+ * ext/socket/socket.c (sock_gethostname): support unlimited size
+ hostname.
-Tue Apr 15 23:40:39 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Mar 9 22:59:43 2016 Kouhei Sutou <kou@cozmixng.org>
- * ext/syck/rubyext.c (rb_syck_mktime): Avoid buffer overflow.
+ * lib/xmlrpc/client.rb: Support SSL options in async methods of
+ XMLRPC::Client.
+ [Bug #11489]
+ Reported by Aleksandar Kostadinov. Thanks!!!
-Tue Apr 15 20:32:03 2008 Tanaka Akira <akr@fsij.org>
+Wed Mar 9 22:46:56 2016 NARUSE, Yui <naruse@ruby-lang.org>
- * re.c (match_inspect): backported from 1.9.
+ * 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
-Tue Apr 15 19:03:28 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 9 22:26:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (method_receiver, method_name, method_owner): New
- methods; backported from 1.9. bug#19007
+ * 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]
-Tue Apr 15 18:39:14 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 9 05:14:20 2016 Eric Wong <e@80x24.org>
- * lib/uri.rb, lib/uri/ldaps.rb: added LDAPS
- scheme; backported from 1.9. bug#19015, [ruby-dev:31896]
+ * io.c (io_getpartial): remove unused kwarg from template
+ * test/ruby/test_io.rb (test_readpartial_bad_args): new
+ [Bug #11885]
-Tue Apr 15 17:45:43 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 9 05:14:20 2016 Eric Wong <e@80x24.org>
- * lib/net/smtp.rb: backported from 1.9. bug#19003
+ * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal):
+ do not process kwargs in blocking mode
+ * test/openssl/test_ssl.rb: test sysread
-Tue Apr 15 17:06:12 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 9 04:21:02 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_symbol.rb (TestSymbol#test_to_proc): add tests.
+ * process.c (rb_execarg_parent_start1): need to convert the encoding to
+ ospath's one.
-Tue Apr 15 16:58:55 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Mar 9 04:21:02 2016 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/menuspec.rb: option check will fail when
- TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__ is true.
+ * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
+ reported by naruse via twitter.
- * ext/tk/lib/tk/palette.rb: bug fix.
+ * process.c (rb_execarg_addopt): need to convert the encoding to
+ ospath's one.
-Tue Apr 15 16:47:48 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Wed Mar 9 04:15:20 2016 Eric Wong <e@80x24.org>
- * signal.c, gc.c: New methods: GC.stress, GC.stress=;
- backported from 1.9. a patch from Tadashi Saito
- in [ruby-dev:34394] and bug#19000
+ * ext/stringio/stringio.c (strio_binmode): implement to set encoding
+ * test/stringio/test_stringio.rb (test_binmode): new test
+ [ruby-core:72699] [Bug #11945]
-Tue Apr 15 12:35:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 9 03:53:37 2016 Tadashi Saito <tad.a.digger@gmail.com>
- * rubyio.h (rb_io_t): renamed from OpenFile.
+ * compile.c, cont.c, doc, man: fix common misspelling.
+ [ruby-core:72466] [Bug #11870]
- * ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
- ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
- ext/socket/socket.c: ditto.
+Wed Mar 9 03:51:48 2016 Eric Wong <e@80x24.org>
- * win32/win32.h: removed workaround for OpenFile.
+ * ext/socket/init.c (rsock_init_sock): reject reserved FDs
+ [ruby-core:72445] [Bug #11862]
-Tue Apr 15 00:15:29 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Mar 9 03:41:27 2016 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk/text.rb: typo. call a wrong method.
+ * 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]
- * ext/tk/lib/tk/itemconfig.rb: ditto.
+Wed Mar 9 03:34:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/ttk_wrapper.rb: bug fix.
+ * re.c (reg_names_iter): should consider encoding of regexp.
+ [ruby-core:72185] [Bug #11825]
- * ext/tk/sample/tktextio.rb: add binding for 'Ctrl-u' at console mode.
+Wed Feb 24 08:18:18 2016 Naohisa Goto <ngotogenome@gmail.com>
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/itemfont.rb, ext/tk/lib/font.rb:
- support __IGNORE_UNKNOWN_CONFIGURE_OPTION__ about font options.
+ * enc/windows_1250.c: Should not use C++ style comments (C99 feature).
+ [Bug #11843]
- * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb,
- ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: bug fix.
+Tue Feb 23 03:43:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
- * ext/tk/lib/tkextlib/tile/tpaned.rb: improve TPaned#add.
+ * enc/iso_8859_2.c, enc/windows_1250.c: separate Windows-1250
+ from ISO-8859-2 to fix 0x80..0x9e range (from Kimihito Matsui)
- * ext/tk/lib/tk/timer.rb: add TkTimer#at_end(proc) to register the
- procedure which called at end of the timer.
+Tue Feb 23 03:43:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 14 19:54:21 2008 Akinori MUSHA <knu@iDaemons.org>
+ * enc/windows_1252.c: separate from ISO-8859-1 to fix 0x80..0x9e
+ range. [ruby-core:64049] [Bug #10097]
- * array.c (rb_ary_flatten, rb_ary_flatten_bang): Take an optional
- argument that determines the level of recursion to flatten;
- backported from 1.9.
+Tue Feb 23 03:43:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
- * array.c (rb_ary_shuffle_bang, rb_ary_shuffle, rb_ary_choice,
- rb_ary_cycle, rb_ary_permutation, rb_ary_combination,
- rb_ary_product, rb_ary_take, rb_ary_take_while, rb_ary_drop,
- rb_ary_drop_while): New methods: Array#shuffle, #shuffle!,
- #choice, #cycle, #permutation, #combination, #product, #take,
- #take_while, #drop, #drop_while; backported from 1.9.
+ * enc/iso_8859_13.c: Added three missing lower/upper-case
+ character pairs (from Kimihito Matsui)
-Mon Apr 14 19:52:35 2008 Akinori MUSHA <knu@iDaemons.org>
+Tue Feb 23 03:43:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
- * ruby.h: New macro: RB_GC_GUARD().
+ * 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)
-Mon Apr 14 19:49:35 2008 Akinori MUSHA <knu@iDaemons.org>
+Mon Feb 15 02:05:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
+ * string.c (rb_str_scrub): the result should be infected by the
+ original string.
- * string.c (rb_str_tmp_new), intern.h: New function.
+Mon Feb 15 02:05:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 14 19:18:55 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * transcode.c (rb_econv_substr_append, econv_primitive_convert):
+ the result should be infected by the original string.
- * enum.c (inject_i, inject_op_i): prototype.
+Mon Feb 15 02:05:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 14 19:10:47 2008 Akinori MUSHA <knu@iDaemons.org>
+ * include/ruby/ruby.h: add raw FL macros, which assume always the
+ argument object is not a special constant.
- * enum.c New methods: Enumerable#take, #take_while, #drop and
- #drop_while; backported from 1.9.
+ * internal.h (STR_EMBED_P, STR_SHARED_P): valid only for T_STRING.
-Mon Apr 14 18:50:15 2008 Akinori MUSHA <knu@iDaemons.org>
+ * string.c: deal with taint flags directly across String instances.
- * enum.c: New methods: Enumerable#one?, #none?, #minmax, #min_by,
- #max_by, #minmax_by and #cycle; backported from 1.9.
+Mon Feb 15 01:20:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_find_index): Add support for find_index(obj);
- [ruby-dev:34313]; backported from 1.9.
+ * parse.y (regexp): set_yylval_num sets u1, should use nd_tag
+ instead of nd_state. [ruby-core:72638] [Bug #11932]
- * enum.c (enum_inject): Add support for Enumerable#inject(:binop);
- backported from 1.9.
+Tue Jan 26 21:52:16 2016 Joseph Tibbertsma <josephtibbertsma@gmail.com>
- * enum.c: Alias Enumerable#reject to #inject; backported from 1.9.
+ * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
+ [Fix GH-1221]
-Mon Apr 14 18:14:19 2008 Akinori MUSHA <knu@iDaemons.org>
+Mon Jan 18 00:34:41 2016 Koichi Sasada <ko1@atdot.net>
- * enum.c (enum_find, enum_reject): Return an enumerator if no
- block is given; backported from 1.9.
+ * vm_insnhelper.c (vm_call_method): should not set fastpath
+ with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods.
- * io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach,
- argf_each_line, argf_each_byte): Ditto.
+ 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]
- * string.c (str_gsub): Ditto.
+ * test/ruby/test_keyword.rb: add a test for this fix.
-Mon Apr 14 18:10:05 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Dec 23 06:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (find_index_i, find_index_iter_i): add prototype for VC.
+ * parse.y (parser_yylex): allow here documents in labeled
+ argument. [ruby-core:72396] [Bug #11849]
-Mon Apr 14 17:55:30 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Dec 23 05:52:06 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
- * array.c (rb_ary_collect_bang, rb_ary_select): Return an
- enumerator if no block is given; backported from 1.9.
+ * test/ruby/test_syntax.rb: fix typo in test
- * dir.c (dir_each, dir_foreach): Ditto.
+Wed Dec 23 05:52:06 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
- * enum.c (enum_partition, enum_sort_by): Ditto.
+ * parse.y (parse_percent): Allow %-literals in labeled arg as
+ r51624 did for parentheses.
+ Fixes [ruby-core:72084] [Bug #11812].
- * gc.c (os_each_obj): Ditto.
+Mon Dec 21 05:05:54 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select,
- rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair,
- env_each_key, env_each_value, env_each, env_each_pair,
- env_reject_bang, env_delete_if, env_select): Ditto.
+ * cont.c: fix a double word typo.
+ [Bug #11313][ruby-core:69749]
- * numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto.
+Mon Dec 21 05:04:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Apr 14 16:42:53 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/tk/lib/multi-tk.rb: fix typos.
+ [Bug #11764][ruby-core:71800]
- * ruby.h (rb_block_call_func): Fix prototype.
+Wed Dec 16 21:10:19 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * enumerator.c (enumerator_iter_i, enumerator_each_i): Ditto.
+ * ext/fiddle/handle.c: check tainted string arguments.
+ Patch provided by tenderlove and nobu.
-Mon Apr 14 15:49:05 2008 Akinori MUSHA <knu@iDaemons.org>
+ * test/fiddle/test_handle.rb (class TestHandle): add test for above.
- * enum.c (enum_count, enum_find_index): New methods:
- Enumerable#count and #find_index; backported from 1.9.
+Wed Dec 16 02:38:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 14 14:16:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (parse_mode_enc): fix buffer overflow.
- * enumerator.c (enumerator_mark, enumerator_iter_i, enumerator_each_i,
- enumerator_allocate): add prototype.
+Sat Dec 12 17:19:27 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * enumerator.c (enumerator_each_i): declare unused two arguments.
+ * doc/NEWS-0.2.2: add description about incompatible change in Hash
+ duplicated key overriding policy. [Bug #10315] [Bug #11501]
-Mon Apr 14 13:58:32 2008 Akinori MUSHA <knu@iDaemons.org>
+Fri Dec 11 22:41:15 2015 Eric Wong <e@80x24.org>
- * string.c (rb_str_each_char): New methods: String#chars and
- #each_char; backported from 1.9.
+ * insns.def (opt_case_dispatch): avoid converting Infinity
+ * test/ruby/test_optimization.rb (test_opt_case_dispatch_inf): new
+ [ruby-dev:49423] [Bug #11804]'
-Mon Apr 14 13:42:20 2008 Akinori MUSHA <knu@iDaemons.org>
+Thu Dec 10 00:23:07 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * string.c (rb_str_each_line, rb_str_each_byte): Reflect
- enumerator integration. #lines and #bytes are now aliases to
- #each_line and #each_byte, respectively.
+ * configure.in: pthread_getattr_np is broken on AIX.
+ More specifically, the stack address and size returned are
+ not correct.
-Mon Apr 14 13:19:36 2008 Akinori MUSHA <knu@iDaemons.org>
+Thu Dec 10 00:19:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * range.c (range_each, range_step): Return an enumerator if no
- block is given; backported from 1.9.
+ * common.mk (update-gems): use BASERUBY instead of RUNRUBY.
- * struct.c (rb_struct_each, rb_struct_each_pair): Ditto.
+Wed Dec 9 01:49:13 2015 Eric Wong <e@80x24.org>
-Mon Apr 14 13:07:59 2008 Akinori MUSHA <knu@iDaemons.org>
+ * insns.def (opt_case_dispatch): check Float#=== redefinition
+ * test/ruby/test_optimization.rb (test_opt_case_dispatch): new
+ [ruby-core:71920] [Bug #11784]
- * string.c (rb_str_partition, rb_str_rpartition,
- rb_str_start_with, rb_str_end_with): New methods:
- String#partition, #rpartition, #start_with? and #end_with?;
- backported from 1.9. These methods are $KCODE aware unlike
- #index, #rindex and #include?.
+Wed Dec 9 01:46:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Apr 13 15:55:52 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
+ InterlockedCompareExchange64. new value and then old value is
+ the last.
- * object.c (sym_to_proc): new method Symbol#to_proc; backported
- from 1.9. bug#19012
+Wed Dec 9 01:28:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 11 19:14:30 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * encoding.c (enc_m_loader): defer finding encoding object not to
+ be infected by marshal source. [ruby-core:71793] [Bug #11760]
- * object.c (rb_obj_tap): new method Object#tap; backported from
- 1.9. bug#19008
+ * 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.
-Fri Apr 11 18:58:09 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * marshal.c (compat_allocator_table): initialize
+ compat_allocator_tbl on demand.
- * process.c: new method Process.exec; backported from 1.9. bug#19006
+ * object.c (rb_undefined_alloc): extract from rb_obj_alloc.
-Fri Apr 11 12:43:56 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Dec 9 01:24:57 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * ext/tk/lib/tkextlib/tile.rb, ext/tk/lib/tkextlib/tile/style.rb,
- ext/tk/sample/tkextlib/tile/demo.rb: previous patch is not complete.
+ * ext/-test-/file/fs.c: need to include sys/statvfs.h
+ to use statvfs().
-Fri Apr 11 10:22:54 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/-test-/file/extconf.rb: check the existence of
+ sys/statvfs.h
- * ext/tk/lib/tkextlib/tile.rb:
- __define_LoadImages_proc_for_compatibility__! do nothing when the
- Tcl command exists.
+Fri Dec 4 04:46:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkextlib/tile/style.rb:
- __define_wrapper_proc_for_compatibility__! do nothing when the Tcl
- command exists.
+ * 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]
- * ext/tk/sample/tkextlib/tile/demo.rb: don't create 'step' theme if
- it already exists.
+Fri Dec 4 02:42:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 11 08:05:12 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * range.c (range_to_s): should be infected by the receiver.
+ str2 infects by appending. [ruby-core:71811] [Bug #11767]
- * marshal.c (w_object): add volatile to avoid potential GC bug. a
- patch from Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp>
- in [ruby-dev:34311].
+Wed Dec 2 03:17:01 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Apr 10 20:29:13 2008 Akinori MUSHA <knu@iDaemons.org>
+ * ext/readline/extconf.rb: call dir_config("libedit")
+ if --enable-libedit is spcified. [Bug #11751]
+ patched by John Hein
- * misc/rdebug.el, misc/README: Remove rdebug.el as per request
- from the maintainer and mention the ruby-debug project at
- RubyForge in README; bug#19043.
+Wed Dec 2 02:59:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 10 20:08:37 2008 Akinori MUSHA <knu@iDaemons.org>
+ * parse.y (parser_here_document): store dispatched result of
+ on_tstring_content at the last fragment of a here document.
- * enum.c (enum_first, enum_group_by): New methods:
- Enumerable#first and #group_by; backported from 1.9.
+Tue Dec 1 02:52:17 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Thu Apr 10 19:49:10 2008 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_gc.rb: merge partially r52391 to get rid of CI error.
- * enumerator.c (rb_eStopIteration), eval.c (rb_f_loop), ruby.h:
- Add a new exception class StopIteration, which breaks Kernel#loop
- iteration when raised; backported from 1.9.
+Tue Dec 1 02:27:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c (enumerator_next, enumerator_rewind): Implement
- #next and #rewind using the "generator" library.
+ * io.c (rb_io_each_codepoint): raise an exception at incomplete
+ character before EOF when conversion takes place. [Bug #11444]
- * lib/generator.rb: Implement Enumerable::Enumerator#next and
- #rewind.
+Sun Nov 29 18:02:44 2015 Shugo Maeda <shugo@ruby-lang.org>
-Thu Apr 10 19:29:48 2008 Akinori MUSHA <knu@iDaemons.org>
+ * io.c (argf_getpartial): should not resize str if the second
+ argument is not given.
+ [ruby-core:71668] [Bug #11738]
- * array.c (rb_ary_first, rb_ary_last): Return a shared array when
- possible.
+Sun Nov 29 17:48:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_pop, rb_ary_pop_m, rb_ary_shift, rb_ary_shift_m):
- Array#pop and Array#shift can take an optional argument
- specifying the number of elements to remove and return;
- backported from 1.9.
+ * 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]
-Thu Apr 10 14:00:44 2008 Tanaka Akira <akr@fsij.org>
+Sun Nov 29 17:13:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/resolv.rb (Resolv::DNS#each_address): backport from 1.9 for
- CNAME. [ruby-dev:34200]
+ * io.c (rb_io_each_codepoint): read more data when read partially.
+ [ruby-core:70379] [Bug #11444]
-Thu Apr 10 01:42:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Nov 29 16:46:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * enum.c (iterate_method): add prototype to avoid warning on VC++.
+ * lib/net/http.rb: set hostname before call ossl_ssl_set_session.
+ [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek
-Wed Apr 9 23:12:41 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Nov 29 16:33:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c: SEGV when tcltk-stubs is enabled.
+ * 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]
- * ext/tk/tcltklib.c: avoid error on a shared object.
+Sun Nov 29 16:11:32 2015 Eric Wong <e@80x24.org>
- * ext/tk/extconf.rb: support --with-tcltkversion
+ * 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]
- * ext/tk/README.tcltklib: add document about --with-tcltkversion
+Sun Nov 29 02:55:56 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget,
- ext/tk/sample/demos-jp/style.rb, ext/tk/sample/demos-en/style.rb,
- ext/tk/sample/demos-jp/bind.rb, ext/tk/sample/demos-en/bind.rb:
- bug fix.
+ * gc.c (__has_feature): move into internal.h.
-Wed Apr 9 21:54:45 2008 Akinori MUSHA <knu@iDaemons.org>
+ * internal.h (__has_feature): ditto.
- * array.c (rb_ary_pop): Do not reallocate too often; backported
- from 1.9.
+ * internal.h (__has_extension): new macro.
-Wed Apr 9 21:13:05 2008 Akinori MUSHA <knu@iDaemons.org>
+ * internal.h (STATIC_ASSERT): use _Static_assert with
+ clang. [ruby-core:69931] [Bug #11343]
- * array.c (rb_ary_each, rb_ary_each_index, rb_ary_reverse_each,
- rb_ary_reject, rb_ary_reject_bang): Array#each, #each_index,
- #reverse_each, #reject, #reject! and #delete_if return an
- enumerator if no block is given; backported from 1.9.
+Sat Nov 28 06:28:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 9 20:47:16 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * array.c (rb_ary_index, rb_ary_index): Array#index and #rindex
- can take a block instead of an argument; backported from 1.9.
+Sat Nov 28 06:12:32 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Apr 9 19:58:31 2008 Akinori MUSHA <knu@iDaemons.org>
+ * 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>
- * enumerator.c, inits.c (rb_call_inits), ruby.h, intern.h,
- ext/enumerator, common.mk (OBJS, enumerator.$(OBJEXT)): Make the
- enumerator module built-in.
+Sat Nov 28 05:50:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enumerator.c: New method: Enumerable::Enumerator#with_index.
+ * 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]
- * enum.c (enum_each_with_index): Enumerable#each_with_index now
- returns an enumerator instead of raising an exception if no
- block is given. Enumerable#enum_with_index, formerly defined in
- the enumerator module, is kept as an alias to each_with_index
- for backward compatibility.
+Sat Nov 28 05:47:27 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Wed Apr 9 19:43:51 2008 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]
- * eval.c (rb_obj_method, rb_proc_call), intern.h: Export.
+Sat Nov 28 05:47:27 2015 Rei Odaira <Rei.Odaira@gmail.com>
-Tue Apr 8 11:11:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_symbol.rb: avoid a false positive in AIX.
- * eval.c (EXEC_TAG): remove unnecessary FLUSH_REGISTER_WINDOWS for
- better performance on SPARC. [ruby-core:16159]
+Sat Nov 28 05:35:28 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Apr 8 10:49:54 2008 Yukihiro Matsumoto <matz@ruby-lang.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]
- * re.c (rb_reg_quote): should always copy the quoting string.
- [ruby-core:16235]
+Sat Nov 28 05:21:06 2015 Koichi Sasada <ko1@atdot.net>
-Mon Apr 7 21:35:08 2008 Akinori MUSHA <knu@iDaemons.org>
+ * insns.def (defined): skip respond_to_missing? when
+ a method is available.
+ [Bug #11211]
- * array.c (rb_ary_nitems): Backport Array#nitems with a block;
- suggested by Bertram Scharpf <lists@bertram-scharpf.de> in
- [ruby-talk:134083].
+ * test/ruby/test_defined.rb: add a test for this fix.
-Sun Apr 6 09:45:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 25 01:05:29 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * dir.c (dir_tell): check if closed. [ruby-core:16223]
+ * ext/digest/sha1/sha1ossl.c: fix defs.h path to catch up changes in
+ r52739.[Bug #3231]
-Sat Apr 5 10:05:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/digest/rmd160/rmd160ossl.c: ditto.
- * object.c (rb_check_to_integer): backported for range_step.
+Wed Nov 25 00:54:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 4 05:57:11 2008 Yukihiro Matsumoto <matz@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/net/pop.rb (Net::POP3::do_finish): clear @n_mails and
- @n_bytes as well. [ruby-core:16144]
+Wed Nov 25 00:47:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Apr 4 02:17:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
+ EOL string. Patch by @kachick [fix GH-942][Bug #11513]
- * range.c (range_step): should not round step into integer if
- begin and end are numeric. [ruby-core:15990]
+Wed Nov 25 00:32:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 1 14:43:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * configure.in: get rid of empty expansion.
+Wed Nov 25 00:14:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * {bcc,win}32/Makefile (config.h): need to define RUBY_SETJMP, etc.
+ * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
+ includeing ext/digest/extconf.h. [Bug #3231]
+ https://msdn.microsoft.com/library/36k2cdd4.aspx
-Tue Apr 1 11:36:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/digest/*/extconf.rb: remove ext/digest from include search path
+ to avoid confusion of cl.exe.
- * configure.in: _setjmp is available but _longjmp is not on mingw.
+ * ext/digest/*/*.[ch]: explicitly specify def.h's path.
-Tue Apr 1 03:20:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 25 00:03:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * configure.in (RUBY_SETJMP, RUBY_LONGJMP, RUBY_JMP_BUF): prefers
- _setjmp over setjmp and sigsetjmp. [ruby-core:16023]
- __builtin_setjmp cannot handle a variable.
+ * Added missing reference of GitHub
- * configure.in (--with-setjmp-type): new option to override the
- default rule in the above.
+Wed Nov 25 00:03:42 2015 Trevor Rowe <trevorrowe@gmail.com>
- * eval_intern.h (ruby_setjmp, ruby_longjmp), gc.c (rb_setjmp),
- vm_core.h (rb_jmpbuf_t): use RUBY_SETJMP, RUBY_LONGJMP and
- RUBY_JMP_BUF.
+ * 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.
-Tue Apr 1 01:55:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 23 00:19:51 2015 Koichi Sasada <ko1@atdot.net>
- * lib/resolv.rb (Resolv::Config.default_config_hash): requires
- win32/resolv to use Win32::Resolv. [ruby-dev:34138]
+ * vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
+ stable after invoking a block. [Bug #11451]
-Mon Mar 31 14:51:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_yield.rb: add a test. This test script is given by
+ Alex Dowad.
- * bignum.c (rb_big_div): Bignum#div should return integer for
- floating number operand.
+Thu Nov 19 01:06:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 30 07:00:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.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/tk/tcltklib.c: rb_hash_lookup has not been backported yet.
+Thu Nov 19 01:06:07 2015 Alex Dowad <alexinbeijing@gmail.com>
-Sat Mar 29 14:18:41 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * 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]
- * ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
+Thu Nov 19 01:06:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
- instate/state/identify method to avoid the conflict with standard
- widget options. Those methods are renamed to ttk_instate/ttk_state/
- ttk_identify (tile_instate/tile_state/tile_identify are available
- too). Although I don't recommend, if you realy need old methods,
- please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
- "require 'tkextlib/tile'".
+ * load.c (rb_load_internal0): do not raise any exceptions but
+ return the result tag state.
- * ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
- is obsolete. It outputs warning. To control default widget set,
- use "Tk.default_widget_set = :Ttk".
+ * load.c (rb_load_protect): reduce nested EXEC_TAGs.
- * ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
- __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
- as module methods of TkConfigMethod. It may help users to wrap old
- Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
- Ttk widgets don't have some options of standard widgets which are
- control the view of widgets. When set ignore-mode true, configure
- method tries to ignoure such unknown options with no exception.
- Of course, it may raise other troubles on the GUI design.
- So, those are a little danger methods.
+Thu Nov 19 00:41:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
- method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
- are defind as module methods of TkItemConfigMethod as the same
- purpose as TkConfigMethod's ones.
+ * enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
+ and if invalid, return 1. [Bug #11486]
- * ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
- wrapping old Ruby/Tk scripts (which use standard widgets) to use
- Ttk (Tile) widgets as default.
+Thu Nov 19 00:15:23 2015 Zachary Scott <zzak@ruby-lang.org>
- * ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
- method instead of instate/state method.
+ * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
- * ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
- ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
- are replaced to "instance_exec(self)".
+Thu Nov 19 00:01:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
- a character code on Ruby1.9).
+ * io.c (argf_next_argv): check ARGV element type, and try
+ conversion if necessary. [ruby-core:71140] [Bug #11610]
- * ext/tk/lib/tk/variable.rb: support new style of operation argument
- on Tcl/Tk's 'trace' command for variables.
+Wed Nov 18 23:29:32 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
+ * 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/tk/sammple/demos-jp/textpeer.rb,
- ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
+ * ext/openssl/extconf.rb: check for SSLv3 support in the SSL
+ implementation.
- * ext/tk/tcltklib.c: decrase SEGV troubles (probably)
+ * test/openssl/test_ssl.rb (class OpenSSL): Skip tests that need SSLv3
+ if there is no support.
- * ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
+Mon Nov 16 03:39:59 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
+ * tool/runruby.rb: rubyspec now requires other FDs not to be closed
+ since 7b6ce1fee.
- * ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
- to make Tcl/Tk theme sources (based on different version of Tile
- extension) available.
- (Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
+Sun Nov 8 23:30:56 2015 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
- (Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
- as toplevel widgets.
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig):
+ maintain trace_running counter on internal events.
- * ext/tk/lib/tkextlib/tile/style.rb: ditto.
- (Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
+ This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
+ [Bug #11603] https://github.com/ruby/ruby/pull/1059
- * ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
- properties as a hash. metrics_hash method returns a boolean value
- for 'fixed' option. But metrics method returns numeric value
- (0 or 1) for 'fixed' option, because of backward compatibility.
+Sun Nov 1 03:52:41 2015 Aaron Patterson <tenderlove@ruby-lang.org>
- * ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
+ * 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]
- * ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
- doesn't block the eventloop. It will be better to use the method
- in event callbacks.
+Sun Nov 1 03:40:43 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
+ * 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 Mar 29 04:08:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Oct 27 23:58:32 2015 Koichi Sasada <ko1@atdot.net>
- * class.c (clone_method): should copy cref as well.
- [ruby-core:15833]
+ * 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]
-Mon Mar 24 20:07:42 2008 Akinori MUSHA <knu@iDaemons.org>
+ * test/ruby/test_settracefunc.rb: add a test.
- * eval.c (rb_eval): Call trace hook for if expression after the
- condition has been evaluated, not before; submitted by Rocky
- Bernstein in #18722.
+Tue Oct 27 23:38:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 24 19:44:53 2008 Akinori MUSHA <knu@iDaemons.org>
+ * configure.in: check for libunwind.h, which is not available in
+ very old OS X SDK. [ruby-core:71080] [Bug #11591]
- * parse.y (yycompile): Always prepare a new array for each file's
- SCRIPT_LINES__ storage, instead of appending source lines every
- time a file is re-loaded; submitted by Rocky Bernstein in
- #18517.
+Tue Oct 27 23:32:51 2015 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-Mon Mar 24 10:25:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027]
+ patch by voxik.
- * configure.in: sitearch should use target_cpu. [ruby-core:15986]
+ * test/rinda/test_rinda.rb: ditto
-Mon Mar 24 01:24:24 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Oct 6 01:29:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/erb.rb (result): use proc instead of Thread. [ruby-dev:33692]
+ * parse.y (IS_BEG): include labeled argument state, which was
+ EXPR_LABELARG. [ruby-dev:49221] [Bug #11456]
-Fri Mar 21 21:26:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 6 01:29:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/resolv.rb (Resolv::Hosts): should not use win32/resolv on cygwin.
- [ruby-dev:29945], [ruby-dev:34095]
+ * 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]
- * lib/win32/registry.rb (Win32::Registry.expand_environ): try upcased
- name too for cygwin. [ruby-dev:29945]
+Mon Oct 5 03:29:23 2015 Tanaka Akira <akr@fsij.org>
- * lib/win32/resolv.rb (Win32::Resolv.get_hosts_path): use expand_path.
+ * enum.c (nmin_filter): Fix limit value.
+ patch by Helder Pereira.
+ [Bug #11471] [ruby-core:70477]
-Fri Mar 21 21:10:00 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed Sep 30 03:44:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/ipaddr.rb: Say that I am the current maintainer.
+ * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
+ digits. [ruby-core:70667] [Bug #11509]
- * lib/set.rb: Ditto.
+Wed Sep 30 03:34:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/shellwords.rb: Ditto.
+ * re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
+ till the end of string. [ruby-core:70592] [Bug #11488]
- * ext/syslog/syslog.txt: Ditto.
+ * test/ruby/test_m17n.rb (test_include?, test_index): add tests by
+ Tom Stuart.
-Fri Mar 21 09:24:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 30 03:24:29 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * instruby.rb (open_for_install): write block result and rewrite only
- if changed from existing file.
+ * thread_pthread.c (reserve_stack): ensure the memory is really
+ allocated. [Bug #11457]
-Wed Mar 19 21:01:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 25 01:01:01 2015 Koichi Sasada <ko1@atdot.net>
- * dir.c (dir_inspect, dir_path, dir_tell): check for frozen and closed
- is not needed. [ruby-dev:32640]
+ * insns.def (defineclass): introduce an ad-hoc patch to avoid
+ an issue reported on [Bug #10871].
-Wed Mar 19 20:25:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ This patch does not fix completely. For example, method definition
+ in a block (like 1.times{def ...; end}) still causes same issue.
+ To solve all, we need a huge patch and it seems difficult for
+ stable branch.
- * dir.c (Init_Dir): define inspect method. [ruby-core:15960]
+ Use Ruby 2.3 and later to solve this issue completely.
+ (See [Bug #10943])
-Wed Mar 19 14:59:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 18 22:52:50 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * misc/ruby-style.el (ruby-style-{case,label}-indent): fix for labels
- inside blocks in switch and function top level.
+ * tool/downloader.rb: support old versions of ruby.
-Wed Mar 19 14:36:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/downloader.rb: now can download gems by http if openssl is not
+ available (this may be danger!)
- * bignum.c (rb_cstr_to_inum): treat successive underscores as
- nondigit. [ruby-dev:34089]
+Tue Aug 18 20:10:13 2015 Tanaka Akira <akr@fsij.org>
-Wed Mar 19 00:01:23 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * numeric.c (Init_Numeric): Fix document for Float::MIN and
+ Float::EPSILON.
- * lib/erb.rb (ERB::Compiler): Make some minor code optimization.
+Mon Aug 17 23:07:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Mar 17 17:11:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems.rb: bump version to 2.4.5.1. this version fixed
+ CVE-2015-3900.
+ * lib/rubygems/remote_fetcher.rb: ditto.
+ * test/rubygems/test_gem_remote_fetcher.rb: added testcase for CVE-2015-3900
- * misc/ruby-mode.el (ruby-mode): should use `run-mode-hooks' instead
- of calling `run-hooks' directly to run the mode hook. patch from
- Chiyuan Zhang <pluskid AT gmail.com> in [ruby-core:15915]
+Mon Aug 17 23:00:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 17 16:41:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
+ be in bytes, not in chars. [ruby-core:70365] [Bug #11439]
- * configure.in: unset GREP_OPTIONS. [ruby-core:15918]
+Mon Aug 17 23:00:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 14 16:59:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32/lib/win32/registry.rb (API#SetValue): add terminator
+ size, not 1 byte. [ruby-core:70365] [Bug #11439]
- * configure.in (RUBY_LIB_PREFIX): fix for prefix.
+Sun Aug 16 03:14:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 14 16:35:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * re.c (rb_memsearch): should match only char boundaries in wide
+ character encodings. [ruby-core:70220] [Bug #11413]
- * lib/cgi.rb (CGI::Cookie::initialize): performance patch from
- Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048].
+Sun Aug 16 03:00:44 2015 Eric Wong <e@80x24.org>
-Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * configure.in (RUBY_LIB_PREFIX): use libdir.
+Fri Aug 14 16:30:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 14 10:12:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c (rb_econv_set_replacement): target encoding name can
+ be empty now. [ruby-core:69841] [Bug #11324]
- * configure.in (RUBY_CHECK_VARTYPE): should not indent preprocessor
- directives.
+Fri Aug 14 15:24:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 13 00:37:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
+ Fixnum, but not a long. [Bug #9381]
- * eval.c (rb_call0): yields the last executed node line number at
- return event. [ruby-core:15855]
+Fri Aug 14 15:09:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 12 02:12:20 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/json/parser/parser.rl: raise with messages in UTF-8
+ encoding. [ruby-core:67386] [Bug #10705]
- * lib/delegate.rb: check $@ to avoid NoMethodError.
+Fri Aug 14 00:44:34 2015 Eric Wong <e@80x24.org>
-Tue Mar 11 19:48:09 2008 Nobuyoshi Nakada <nobu@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]
- * numeric.c (fix_coerce): try conversion before type check.
- [ruby-core:15838]
+Thu Aug 13 01:25:26 2015 Benoit Daloze <eregontp@gmail.com>
-Tue Mar 11 17:03:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/ftp.rb (makeport): close the TCPServer
+ when sending the port fails.
- * lib/delegate.rb (Delegator#initialize, DelegateClass): skip correct
- backtrace. [ruby-dev:34019]
+ * test/net/ftp/test_ftp.rb: test for above.
-Tue Mar 11 16:43:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 13 01:03:13 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * win32/win32.c (rb_w32_cmdvector): terminate shrunken command line.
+ * 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]
-Tue Mar 11 12:39:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/net/http/test_httpresponse.rb: tests for the above.
- * common.mk (clean-local): removes MINOBJS.
+Thu Aug 13 01:03:13 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-Sat Mar 8 18:50:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http/response.rb (Net::HTTPResponse#inflater):
+ fix TypeError. An exception object might be nil.
+ [ruby-core:68846] [Bug #11058]
- * file.c (isdirsep): backslash is valid path separator on cygwin too.
+Thu Aug 13 00:03:24 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Fri Mar 7 19:56:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .travis.yml: update libssl before running tests.
+ Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for figuring out the
+ travis settings!
- * lib/mkmf.rb: rdoc added. [ruby-Patches-9762]
+Thu Aug 13 00:03:24 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Thu Mar 6 15:10:21 2008 NAKAMURA Usaku <usa@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.
- * {bcc32,win32}/Makefile.sub (RUNRUBY): use $(PROGRAM) instead of
- ruby$(EXEEXT).
- suggested by KIMURA Koichi <kimura.koichi at canon.co.jp>.
- [ruby-dev:34000]
+ * test/openssl/test_ssl.rb (class OpenSSL): test for change
-Thu Mar 6 12:15:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 12 23:57:01 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (opt_block_param): command can start just after block param
- definition. [ruby-list:44479]
+ * 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 Mar 6 00:34:11 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Aug 12 23:53:39 2015 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/erb.rb: update RDoc. Thanks Makoto Kuwata [ruby-dev:33702]
+ * win32/win32.c (waitpid): return immediately if interrupted.
+ reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]
-Mon Mar 3 23:28:34 2008 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Aug 12 01:05:58 2015 Jeremy Evans <merch-redmine@jeremyevans.net>
- * lib/webrick/httpservlet/filehandler.rb: should normalize path
- separators in path_info to prevent directory traversal attacks
- on DOSISH platforms.
- reported by Digital Security Research Group [DSECRG-08-026].
+ * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised
+ in OpenSSL tests. [ruby-core:70020][Bug #11368]
- * lib/webrick/httpservlet/filehandler.rb: pathnames which have
- not to be published should be checked case-insensitively.
+Wed Aug 12 00:54:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 3 16:14:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_repeated_permutation): fix buffer size, ALLOCV_N
+ already multiplies element size.
- * hash.c (rb_any_hash): shrinks all results in Fixnum range.
- [ruby-core:15713]
+Tue Aug 11 01:51:53 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sat Mar 1 02:35:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/timeout.rb (ExitException): leave Timeout::ExitException as an
+ alias of Timeout::Error for backward compatibility in stable branch.
+ [ruby-dev:49179] [Bug #11344]
- * bignum.c (big2str_find_n1): check integer overflow.
+Tue Aug 11 01:51:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 26 16:06:00 2008 Technorama Ltd. <oss-ruby@technorama.net>
+ * 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]
- * ext/openssl/ossl_pkey_{ec,dh,dsa,rsa}.c: Remove useless warnings.
+Tue Aug 11 01:37:28 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/openssl/ossl_asn1.c: Simplify code.
+ * test/net/http/test_httpresponse.rb
+ (HTTPResponseTest#test_read_body_content_encoding_deflate_uppercase):
+ fix a failure without zlib.
- * ext/openssl/ossl_ssl_session.c Fix compiler warnings.
- Undefine #id if SSL_SESSION_get_id is not supported.
+Tue Aug 11 01:37:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Feb 26 15:43:42 2008 Tanaka Akira <akr@fsij.org>
+ * lib/net/http/response.rb (inflater): CONTENT_ENCODING can be upper
+ case. [ruby-core:69670] [Bug #11285] patched by Andy Chu
- * parse.y (tokadd_escape): refactored. [ruby-core:15657]
+Tue Aug 11 01:21:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>
+ * vm.c (m_core_hash_merge_ptr): copy the arguments to the machine
+ stack before rewinding the control frame pointer and leaving the
+ arguments outside valid region of the value stack.
+ [ruby-core:69969] [Bug #11352]
- * ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:
- Commit patch #9280 from Akinori MUSHA.
- Simplify the OpenSSL::Digest class and make use of the
- existing Digest framework.
- Enhance performance.
+ * vm.c (REWIND_CFP): keep the arguments region inside the valid
+ value stack. [ruby-core:69969] [Bug #11352]
-Mon Feb 25 13:40:03 2008 Tanaka Akira <akr@fsij.org>
+Tue Aug 11 01:11:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (Init_process): share bignum objects for RLIM_INFINITY,
- RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal.
+ * 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]
-Sun Feb 24 23:29:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 11 00:42:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk, {bcc,win}32/Makefile.sub (clean-local): remove
- intermediate files.
+ * parse.y (lambda_body): pop cmdarg stack for lookahead
+ token. [ruby-core:70067] [Bug #11380]
-Sun Feb 24 03:52:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 11 00:21:56 2015 NARUSE, Yui <naruse@ruby-lang.org>
- * util.c (valid_filename): use O_EXCL to get rid of clobbering
- existing files in race conditions.
+ * ext/socket/extconf.rb: Solaris 11 has struct tcp_info.tcpi_ca_state,
+ but it is a dummy.
-Fri Feb 22 19:50:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/option.c: Solaris 11 doesn't have u_intN_t.
- * bignum.c (BIGZEROP): fix for longer Bignum zeros. [ruby-Bugs-17454]
+ * ext/socket/option.c: Solaris 11 needs inspect_tcpi_msec.
-Fri Feb 22 16:09:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/raddrinfo.c: Solaris 11 has AF_PACKET but doesn't have
+ related macros.
- * bignum.c (rb_big_lshift, rb_big_rshift, rb_big_aref): removed excess
- arguments.
+Tue Aug 4 04:11:34 2015 Tanaka Akira <akr@fsij.org>
-Thu Feb 21 00:01:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/time.rb (strptime): Support %s.%N.
+ [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi.
- * configure.in (RPATHFLAG): -R option of HP-UX ld is not for runtime
- load path. [ruby-list:44600]
+Tue Aug 4 03:43:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 20 23:55:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c (load_transcoder_entry): fix transcoder loading race
+ condition, by waiting in require. [ruby-dev:49106] [Bug #11277]
- * win32/win32.c (rb_w32_map_errno): exported.
+Tue Aug 4 03:13:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * instruby.rb (parse_args): added --dir-mode, --script-mode and
- --cmd-type options. [ruby-dev:33816]
+ * array.c (ary_ensure_room_for_unshift, rb_ary_splice): ditto.
- * instruby.rb (parse_args): added bin-arch and bin-comm to install
- type, for compiled files and script files.
+Sat Jul 4 23:08:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * instruby.rb (parse_args): deal with make style command line macros,
- and count as long syle options if prefixed with INSTALL_.
+ * file.c (rb_file_load_ok): try opening file without gvl not to
+ lock entire process. [Bug #11060]
- * instruby.rb (makedirs): use $dir_mode. [ruby-dev:33805]
+Sat Jul 4 05:00:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * instruby.rb (open_for_install): set file mode, which is now
- permission mode instead of access mode.
+ * 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]
- * instruby.rb (bin-comm): installs scripts with replacing shebang
- lines.
+Sat Jul 4 04:46:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 19 18:34:32 2008 Tanaka Akira <akr@fsij.org>
+ * compile.c (iseq_compile_each): out of range NTH_REF is always
+ nil.
- * gc.c (STACK_LENGTH) [SPARC] : 0x80 offset removed. [ruby-dev:33857]
+ * parse.y (parse_numvar): check overflow of NTH_REF and range.
+ [ruby-core:69393] [Bug #11192]
-Tue Feb 19 14:27:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * util.c (ruby_scan_digits): make public and add length parameter.
- * ext/readline/readline.c (readline_event): prevent polling. based on
- a patch from error errorsson in [ruby-Bugs-17675].
+Sat Jul 4 04:35:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 19 12:08:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (rb_method_call_status): resolve refined method entry
+ to check if undefined. [ruby-core:69064] [Bug #11117]
- * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
+Sat Jul 4 04:35:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 18 16:23:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (rb_method_call_status): undefined refined method is
+ not callable unless using. [ruby-core:69064] [Bug #11117]
- * parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
+Wed Jul 1 04:16:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Mon Feb 18 10:17:42 2008 Nobuyoshi Nakada <nobu@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.
- * ext/pty/lib/expect.rb (IO#expect): check if peer is closed.
- [ruby-Bugs-17940]
+Wed Jul 1 04:15:38 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-Fri Feb 15 20:37:06 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/zlib/zlib.c: Fix indentation for rdoc.
+ [Bug #11221][ruby-core:69465]
- * lib/rational.rb (floor, ceil, truncate, round): do not use
- definitions of Numeric.
+Sat Jun 27 22:51:59 2015 Shota Fukumori <her@sorah.jp>
- * lib/rational.rb (to_i): should returns truncated self.
+ * 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]
- * lib/complex.rb (numerator): requires
- Integer#{numerator,denominator}.
+ * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix.
- * lib/complex.rb (quo): do not use definition of Numeric.
- * lib/complex.rb (div, divmod, floor, ceil, truncate, round):
- undef'ed.
+Wed Jun 17 02:53:59 2015 Koichi Sasada <ko1@atdot.net>
-Fri Feb 15 15:23:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/objspace/test_objspace.rb (test_dump_flags): relax pattern
+ because long_lived flag and marked flag can be false at major GC.
+ [Bug #10852]
- * ext/iconv/iconv.c (iconv_convert): check upper bound. a patch from
- Daniel Luz at [ruby-Bugs-17910].
+Mon Jun 15 03:24:23 2015 Koichi Sasada <ko1@atdot.net>
-Fri Feb 15 02:42:25 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (lep_svar_set): add WBs.
- * configure.in (ftruncate): check if available.
+Fri Jun 12 01:39:49 2015 Eric Wong <e@80x24.org>
- * file.c (rb_file_truncate): check if ftruncate instead of truncate.
+ * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
+ [ruby-core:69419] [Feature #11198]
-Fri Feb 15 02:40:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 12 01:16:13 2015 Eric Wong <e@80x24.org>
- * configure.in (sigsetmask): check when signal semantics is not POSIX.
+ * 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]
- * signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is
- available.
+Fri Jun 12 01:14:00 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 14 17:44:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/win32.c (setup_overlapped): seek to the file end only when
+ writing (mode:a), not reading (mode:a+, read).
- * ext/dl/ptr.c (dlmem_each_i): typo fixed. a patch from IKOMA
- Yoshiki <ikoma AT mb.i-chubu.ne.jp> in [ruby-dev:33776].
+Fri Jun 12 01:11:52 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-Thu Feb 14 16:02:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * file.c (rb_file_s_utime): inhibits with secure level 2 or higher.
+ * test/ruby/test_autoload.rb: test for fix
-Thu Feb 14 01:43:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 03:56:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/timeout.rb (Timeout::timeout): made sensitive to location on the
- stack. [ruby-core:15458]
+ * marshal.c (r_symreal): register symbol names as strings first so
+ that r_symlink always returns valid names.
+ [ruby-core:68587] [Bug #10991]
-Thu Feb 14 00:49:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c (r_ivar, r_object0): now need to intern symbol names.
- * common.mk (INSTRUBY_ARGS): pass mode to install. [ruby-dev:33766]
+ * marshal.c (r_object0): compare with symbol names.
- * instruby.rb (parse_args): added --data-mode and --prog-mode options.
+Sun May 24 03:53:07 2015 Eric Wong <e@80x24.org>
-Tue Feb 12 11:33:26 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
+ [Bug #11123]
- * test/erb/test_erb.rb(TestERBCore): import from erb-2.0.4.
+Sun May 24 03:44:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/erb/hello.erb: ditto
+ * range.c (linear_object_p, range_include): test if covered for
+ linear objects. [ruby-core:69052] [Bug #11113]
-Mon Feb 11 17:25:21 2008 Kouhei Sutou <kou@cozmixng.org>
+Sun May 24 03:41:45 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rss/rss.rb (RSS::VERSION), test/rss/test_version.rb, NEWS:
- 0.2.3 -> 0.2.4.
+ * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
+ is omitted. [ruby-core:69093] [Bug #11128]
- * lib/rss/maker.rb, lib/rss/maker/, test/rss/test_maker_2.0.rb:
- fixed a bug that RSS::Maker.make("0.9")'s item doesn't make some
- elements if description is missed.
- Reported by Michael Auzenne. Thanks!!!
+Sun May 24 03:37:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * lib/rss/maker/0.9.rb, test/rss/test_maker_0.9.rb:
- RSS::Maker.make("0.9") generates RSS 0.92 not RSS 0.91.
+ * string.c: added documentation for character sequence \' with String#sub
+ [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127
-Mon Feb 11 16:57:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sun May 24 03:32:53 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
- * ChangeLog: format-time-string under C locale. [ruby-dev:33261]
+ * rational.c: Added documentation for rational literal.
+ [Bug #11075][fix GH-885][ci skip] Patch by @shishir127
-Mon Feb 11 16:31:47 2008 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+Sun May 24 03:06:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_newobj): prohibit call of rb_newobj() during gc.
- Submitted by Sylvain Joyeux [ruby-core:12099].
+ * ext/socket/ipsocket.c (init_inetsock_internal): preserve errno
+ before other library calls and use rb_syserr_fail.
+ [ruby-core:68531] [Bug #10975]
- * ext/dl/ptr.c: do not use LONG2NUM() inside dlptr_free().
- Slightly modified fix bassed on a patch by Sylvain Joyeux
- [ruby-core:12099] [ ruby-bugs-11859 ] [ ruby-bugs-11882 ]
- [ ruby-patches-13151 ].
+Sun May 24 03:01:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 11 00:22:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
+ conflict on cygwin. [ruby-core:68877] [Bug #11065]
- * lib/benchmark.rb (Job::Benchmark#item): fix typo.
+Sun May 24 02:44:53 2015 Koichi Sasada <ko1@atdot.net>
-Sat Feb 9 23:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (vm_exec): check other events when RETURN is thrown.
+ [Bug #10724]
- * ext/bigdecimal/extconf.rb: simplified the condition.
+ * test/ruby/test_settracefunc.rb: add a test.
-Sat Feb 9 17:51:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 02:21:47 2015 Masahiro Tomita <tommy@tmtm.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use strtod() for more
- precision. [ruby-talk:290296]
+ * ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of
+ addrinfo. [ruby-dev:48923] [Bug #11051]
- * ext/bigdecimal/bigdecimal.c (BASE_FIG): made constant.
+Sun May 24 02:17:05 2015 Kenta Murata <mrkn@cookpad.com>
- * ext/bigdecimal/extconf.rb: ditto. [ruby-dev:33658]
+ * bigdecimal: conform to ruby's license. [ruby-core:68466] [Bug #10952]
-Sat Feb 9 00:44:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 02:06:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/irb.rb (IRB::Irb::eval_input): rescues Interrupt and other than
- SystemExit and SignalException. [ruby-core:15359]
+ * ext/-test-/file/fs.c (get_fsname): try magic number only if
+ f_type is included. [ruby-dev:48913] [Bug #11000]
-Fri Feb 8 15:09:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 02:06:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (xsystem): expand macros like as make.
+ * ext/-test-/file/fs.c (get_fsname): return filesystem name by
+ statfs/statvfs. [ruby-core:68624] [Bug #10998]
-Tue Feb 5 11:14:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 02:02:00 2015 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (INSTALL_DIRS, install_dirs): added BINDIR.
+ * test/ruby/test_symbol.rb: fix syntax error.
- * lib/mkmf.rb (install_files): rejects files matching to
- $NONINSTALLFILES.
+Sun May 24 02:02:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (init_mkmf): defaults $NONINSTALLFILES to backup and
- temporary filse.
+ * hash.c (rb_any_hash): Symbols are compared by the identities
+ always. [ruby-core:68767] [Bug #11035]
-Mon Feb 4 16:44:24 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 24 02:01:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (darwin): NSIG is not defined if _XOPEN_SOURCE > 500L.
- [ruby-dev:33584]
+ * 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]
-Sat Feb 2 20:06:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu May 21 01:34:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
- a bit faster. a patch from Alexander Dymo <dymo AT ukrpost.ua> in
- [ruby-core:15337].
+ * gc.c (id2ref): prohibit from accessing internal objects.
+ [ruby-core:68348] [Bug #10918]
-Sat Feb 2 09:53:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 21 01:32:02 2015 Rei Odaira <Rei.Odaira@gmail.com>
- * configure.in (darwin): disabled fat-binary support which confuses
- configure much, since ``universal'' implies hidden cross-compiling.
- TODO: ruby and libruby.bundle might be possible to bound with `lipo'
- after builds for each archs. Anyway, config.h and rbconfig.rb must
- be separated definitely at least.
+ * ext/pty/pty.c: AIX supports autopush.
+ Patch by Perry Smith [ruby-core:58539] [Bug #9144]
-Fri Feb 1 21:42:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 21 01:07:41 2015 Misumi Rize <r@ayase-e.li>
- * configure.in (darwin): _XOPEN_SOURCE is necessary to make ucontext_t
- consistent with the library implementation of MacOS X 10.5.
- [ruby-dev:33461]
+ * 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]
- * configure.in (darwin): ucontext on PowerPC MacOS X 10.5 is broken.
+Thu May 21 00:55:45 2015 Koichi Sasada <ko1@atdot.net>
-Thu Jan 31 08:31:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_args.c: protect value stack from calling other methods
+ during complex parameter setting process (splat, kw, and so on).
+ [Bug #11027]
- * common.mk (ext/extmk.rb, instruby.rb): inlined $(MAKE) so that can
- be executed even with -n.
+ * vm_core.h: remove rb_thead_t::mark_stack_len.
+ With this modification, we don't need to use th->mark_stack_len.
-Thu Jan 31 07:00:19 2008 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/ruby/test_keyword.rb: add a test.
- * lib/rinda/tuplespace.rb (bin_for_find): should find a symbol by
- Symbol class.
+ * cont.c (cont_capture): catch up this fix.
- * test/rinda/test_rinda.rb (test_symbol_tuple): ditto.
+ * vm.c (rb_thread_mark): ditto.
-Wed Jan 30 22:07:58 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Thu May 21 00:07:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date.rb: refined deprecated methods.
+ * 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]
-Wed Jan 30 22:06:54 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Wed May 20 04:33:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_cstr_to_inum): '0_2' is a valid representation.
+ * string.c (STR_SET_EMBED): clear NOFREE flag at embedding as
+ embedded strings no longer refer static strings.
+ [ruby-core:68436] [Bug #10942]
-Tue Jan 29 22:40:12 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Wed May 20 03:46:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * range.c (step_i): rb_funcall receives VALUE as an argument.
+ * dir.c (need_normalization): use getattrlist() if fgetattrlist()
+ is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054]
-Tue Jan 29 11:53:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 20 03:25:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: rm largefile.h.
+ * 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]
-Mon Jan 28 01:21:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed May 20 03:25:34 2015 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_open_file): should check NUL in path.
- <http://www.rubyist.net/~matz/20080125.html#c01>.
+ * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.
- * io.c (rb_io_s_popen): ditto.
+ * vm.c: ditto.
- * io.c (rb_io_reopen): ditto.
+ * vm_dump.c: ditto.
- * io.c (next_argv): ditto.
+ * vm_insnhelper.c: ditto.
- * io.c (rb_io_s_foreach): ditto.
+ * vm_core.h: use RB_TYPE_P() instead of BUILTIN_TYPE().
- * io.c (rb_io_s_readlines): ditto.
+Wed May 20 03:10:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_s_read): ditto.
+ * benchmark/bm_hash_aref_flo.rb: make more realistic data.
+ [ruby-core:68632] [[Bug #10999]
-Fri Jan 25 22:33:38 2008 Yusuke Endoh <mame@tsg.ne.jp>
+Wed May 20 02:49:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * math.c: fix comment. [ruby-dev:33276]
+ * proc.c (respond_to_missing_p): check if the receiver responds to
+ the given method by respond_to_missing?.
-Fri Jan 25 10:31:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (mnew_missing): create Method object for method_missing.
+ [ruby-core:68564] [Bug #10985]
- * */*.bat: set svn:mime-type to text/batch.
+Wed May 20 02:16:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Jan 24 19:36:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (replace_real_basename): need to check the return value of
+ GLOB_REALLOC().
- * lib/uri/generic.rb (URI::Generic::inspect): use Kernel#to_s instead
- object_id with printf. [ruby-dev:33347]
+Wed May 20 02:16:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Jan 22 11:22:47 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+ * dir.c (replace_real_basename): shouldn't create Ruby object before
+ the object system is loaded.
+ [ruby-core:68430] [Bug #10941]
- * win32/setup.mak ($(ARCH)): if a macro is appended by $(APPEND),
- a space will be inserted on the top of the line.
+Wed May 20 01:58:12 2015 Tanaka Akira <akr@fsij.org>
- * win32/Makefile.sub (MKFILES): stop make process if Makefile is
- updated.
+ * lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
+ (Resolv::DNS::Name#initialize): Normalize labels as
+ Resolv::DNS::Label::Str objects.
-Mon Jan 21 17:34:41 2008 Akinori MUSHA <knu@iDaemons.org>
+Wed May 20 01:47:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_mode_flags, rb_io_mode_modenum): Ignore encoding
- options for forward compatibility.
+ * iseq.c (rb_iseq_compile_with_option): check source type, must be
+ an IO or a String. [ruby-core:69219] [Bug #11159]
-Mon Jan 21 12:50:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 15 05:01:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c, gc.c (setjmp): sigsetjmp is a macro on cygwin.
+ * 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]
-Sat Jan 19 11:21:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 14 00:50:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (sigsetjmp): check if available.
+ * parse.y (lambda): push and reset cmdarg_stack in lambda body.
+ [ruby-core:69017] [Bug #11107]
- * eval.c, gc.c (setjmp): do not use _setjmp if sigsetjmp is available.
+Thu May 14 00:39:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 19 11:10:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dln.c (dln_load): check if a different libruby is loaded by the
+ extension library, and then bail out to get rid of very frequent
+ reported stale bug reports.
- * configure.in: Remove wrong assumptions about Cygwin. a patch from
- Corinna Vinschen in [ruby-Bugs-17018].
+Thu May 14 00:29:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 17 21:06:01 2008 Tadayoshi Funaba <tadf@dotrb.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]
- * lib/date.rb (Date::Infinity#<=>): didn't work. A patch from
- Dirkjan Bussink <d.bussink AT gmail.com> [ruby-core:15098].
- This is a bug obviously. However it didn't affect the library's
- functions.
+Thu May 14 00:19:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date.rb, lib/date/format.rb: some trivial changes.
+ * thread_pthread.c (reserve_stack): keep sp safe zone to get rid
+ of crash by -fstack-check. [ruby-core:68740] [Bug #11030]
-Tue Jan 15 15:09:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 14 23:33:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/setup.mak: strip out empty lines from CPP output.
+ * configure.in: check also procstat_getvmmap, which is not
+ available on FreeBSD 9. [ruby-core:68468] [Bug #10954]
-Tue Jan 15 03:41:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c (procstat_vm): use kinfo_getvmmap instead if
+ procstat_getvmmap is not available.
- * eval.c (eval): check if backtrace is empty. [ruby-core:15040]
+Mon Apr 13 22:11:21 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Jan 15 01:28:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.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.
- * common.mk: simplified dummy objects dependencies.
+Mon Apr 13 13:03:33 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Jan 14 16:12:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/securerandom.rb: skip Win32 libraries in SecureRandom if
+ OpenSSL::Random is available.
+ https://github.com/ruby/ruby/pull/848 [Bug #10948] [Bug #10995]
- * lib/shellwords.rb: scape should be an alias to shellescape. a
- patch from Masahiro Kawato <m-kawato AT mwb.biglobe.ne.jp> in
- [ruby-dev:33060].
+Mon Apr 13 00:49:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 14 09:32:40 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * parse.y (arg): fix segfault by null caused by syntax error.
+ [ruby-core:68851] [Bug #10957]
- * lib/time.rb: do not reference Time directly from the inside of
- definitions. [ruby-dev:33059]
+Mon Apr 13 00:49:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 12 18:27:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (primary): empty parentheses at cmdarg can be null.
+ [ruby-core:68477] [Bug #10957]
- * eval.c (rb_define_alloc_func, rb_undef_alloc_func): should
- define/undef on a signleton class. [ruby-core:09959]
+Mon Apr 13 00:44:12 2015 Eric Wong <e@80x24.org>
-Sat Jan 12 12:04:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * 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
- * lib/date.rb, lib/date/format.rb: tuning for performance.
+Mon Apr 13 00:16:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 11 12:35:56 2008 Nobuyoshi Nakada <nobu@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]
- * configure.in: moved broken syscall checks from process.c etc.
+Mon Apr 13 00:09:48 2015 Koichi Sasada <ko1@atdot.net>
- * defines.h (WORDS_BIGENDIAN): honor __BIG_ENDIAN__ than the result of
- configure.
+ * class.c (rb_prepend_module): need a WB for klass -> origin.
- * dln.c: use dlopen on Mac OS X 10.3 or later. backport from trunk.
+Sun Apr 12 23:53:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/options.rb (check_diagram): more precise check, darwin
- is not Windows but minwg is on it.
+ * 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]
-Thu Jan 10 10:53:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Apr 12 23:53:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_open_osfhandle): reverted to old definition.
- [ ruby-Bugs-16948 ]
+ * ext/fiddle/extconf.rb: make PIC objects if it will be linked as
+ a shared object eventually. [ruby-core:67128]
-Tue Jan 8 20:02:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * win{32,ce}/Makefile.sub: merged.
+ * spec/default.mspec: use default configuration file name.
+ https://github.com/ruby/rubyspec/commit/cc69f337b06362e5607ffa3e3ad40ef7494960cf
-Sun Jan 6 09:39:02 2008 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/date.rb, lib/date/format.rb: introduced some constants
- (for internal use).
+ * spec/default.mspec: remove specific version number.
+ https://github.com/ruby/rubyspec/commit/7a909e925c1baa9c700bd44af9241aef6e596714
- * sample/cal.rb: trivial adjustments.
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Jan 4 23:08:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk: use ruby organization for rubyspec.
- * time.c (time_arg): use converted object. [ruby-core:14759]
+Thu Feb 26 15:48:41 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Jan 4 01:20:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * win32.h: only VC6 needs extern "C++" for math.h. [ruby-talk:285660]
+Wed Feb 25 15:36:26 2015 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 3 11:28:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/merger.rb: support 2.1+ versioning scheme.
- * io.c (fptr_finalize): clear errno first. [ruby-talk:284492]
+Tue Feb 24 17:41:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 2 10:18:56 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * time.c (time_zone_name): should be US-ASCII only if all 7-bits,
+ otherwise locale encoding. [ruby-core:68230] [Bug #10887]
- * sample/time.rb: use Process.times instead of Time.times.
+Tue Feb 24 17:41:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 2 09:18:11 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * time.c (time_zone_name): should be US-ASCII only if all 7-bits,
+ otherwise locale encoding. [ruby-core:68230] [Bug #10887]
- * sample/goodfriday.rb: examples for date are enough. retired.
+Tue Feb 24 17:41:27 2015 Benoit Daloze <eregontp@gmail.com>
-Wed Jan 2 09:06:55 2008 Tadayoshi Funaba <tadf@dotrb.org>
+ * time.c: Zone encoding should be US-ASCII if all 7-bits. Fix r46907.
- * sample/cal.rb: just updated with the newest version.
+ * test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests.
-Mon Dec 31 06:50:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 16:37:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * trunk/common.mk: not use -I$(srcdir)/lib with $(MINIRUBY) for cross
- compiling.
+ * string.c (chompped_length): enable smart chomp for all non-dummy
+ encoding strings, not only default_rs.
+ [ruby-core:68258] [Bug #10893]
- * configure.in, {win,bcc}32/Makefile.sub (MINIRUBY): -I$(srcdir)/lib
- moved.
+Tue Feb 24 16:31:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 30 22:48:37 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * string.c (rb_str_split_m): raise ArgumentError at broken string
+ not RegexpError, as Regexp is not involved in.
+ [ruby-core:68229] [Bug #10886]
- * lib/date.rb (_valid_time?): I'm not sure to recommend such an
- expression. but anyway it is acceptable now. [ruby-core:14580]
+Tue Feb 24 14:00:46 2015 Koichi Sasada <ko1@atdot.net>
-Fri Dec 28 16:36:33 2007 NARUSE, Yui <naruse@airemix.com>
+ * gc.c (rb_objspace_call_finalizer): control GC execution during
+ force firnalizations at the end of interpreter process.
+ [Bug #10768]
- * lib/resolv.rb (Resolv::DNS#each_address): now returns IPv6 address.
+ 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 Dec 28 13:21:32 2007 Kouhei Sutou <kou@cozmixng.org>
+ 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.
- * lib/rss/rss.rb, test/rss/test_version.rb, NEWS: 0.2.2 -> 0.2.3.
+Tue Feb 24 14:00:46 2015 Aman Gupta <ruby@tmm1.net>
- * lib/rss/parser.rb, test/rss/test_parser.rb: supported "-" in tag name.
- Reported by Ray Chen. Thanks.
+ * 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.
-Thu Dec 27 23:56:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 24 10:30:59 2015 Kazuki Tsujimoto <kazuki@callcc.net>
- * mkconfig.rb: should not use the libraries under the source directory
- at cross compiling.
+ * 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]
-Thu Dec 27 11:02:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h, class.c: change accordingly.
- * intern.h, string.c (rb_str_set_len): added for upgrading path from
- 1.8 to 1.9. [ruby-dev:32807]
+ * test/ruby/test_refinement.rb: add a test for above.
- * string.c (rb_str_lines, rb_str_bytes): ditto.
+Sun Feb 22 21:20:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 27 10:47:32 2007 Technorama Ltd. <oss-ruby@technorama.net>
+ * re.c (match_aref): RMatch::regexp is Qnil after matching by a
+ string since r45451. [ruby-core:68209] [Bug #10877]
- * ext/openssl/ossl_ssl.c: Only show a warning if the default
- DH callback is actually used.
+Sun Feb 22 17:11:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_rand.c: New method: random_add().
+ * Makefile.in (probes.stamp): rebuild dtrace dependent objects
+ only when `dtrace -G` modifies its input files.
-Wed Dec 26 22:27:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Feb 22 17:11:25 2015 Naohisa Goto <ngotogenome@gmail.com>
- * lib/resolv.rb (Resolv::DNS::Name.==): fix for other is array of
- Resolv::DNS::Label::Str.
+ * 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]
- * lib/resolv.rb (Resolv::DNS::MessageEncoder#put_label): String#string
- is not defined, so replace to_s.
+ * Makefile.in (ruby-glommed.o): ditto.
- * lib/resolv.rb (Resolv::IPv6#to_name): ip6.int is obsoleted by
- int.arpa.
+ * Makefile.in (ruby-glommed.o): remove excess $(DTRACE_OBJ) because
+ it is included in $(OBJS) since r49451.
-Mon Dec 24 16:18:57 2007 Eric Hodel <drbrain@segment7.net>
+ * Makefile.in (probes.o): should depend on $(DTRACE_DEPENDENT_OBJS)
- * lib/rdoc/ri/ri_options.rb: Fix ri --help listing of gem ri paths.
- Merge of r14567 and r14569 from trunk.
+Sun Feb 22 02:16:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/ri/ri_paths.rb: Fix duplication of ri data for multiple
- gems. Merge of r14567 from trunk
+ * file.c (rb_file_identical_p): fix handle leak, ensure to close
+ the handle of the first argument.
-Mon Dec 24 12:35:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 21 13:48:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win{32,ce}/Makefile.sub (MFLAGS): defaulted to -l.
+ * win32/win32.c (different_device_p): compare by volume serial
+ numbers, not by path names. [ruby-core:68162] [Bug #10865]
-Mon Dec 24 11:56:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 21 13:48:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * {bcc32,win{32,ce}}/Makefile.sub (SET_MAKE): set MFLAGS which is not
- set by default, to get rid of chaotic situation of MFLAGS/MAKEFLAGS.
+ * 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]
-Sat Dec 22 14:49:46 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Feb 21 12:46:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date.rb: don't freeze nil even if 1.8 will not be aware of
- the issue. [ruby-dev:32677]
+ * 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]
-Wed Dec 19 13:57:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 21 12:46:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (TIMEZONE_VOID): check whether timezone requires zero
- arguments. [ruby-dev:32631]
+ * 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]
-Wed Dec 19 12:01:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 21 12:45:54 2015 Matt Hoyle <matt@deployable.co>
- * parse.y (f_rest_arg): check if duplicated. [ruby-core:14140]
+ * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix a typo, 'expoennt'
+ to 'exponent'. [ruby-core:67980] [Bug #10823] [Fix GH-825]
-Wed Dec 19 10:52:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 20 17:47:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_cstr_to_inum): an underscore succeeding after octal
- prefix is allowed. [ruby-core:14139]
+ * 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]
-Mon Dec 17 13:43:15 2007 Tanaka Akira <akr@fsij.org>
+Fri Feb 20 15:08:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (stack_end_address): use local variable address instead of
- __builtin_frame_address(0) to avoid SEGV on SunOS 5.11 on x86 with
- gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802).
- stack_end_address returned a frame address of garbage_collect
- since stack_end_address doesn't create its own frame.
- So a VALUE stored in a callee saved register, %edi, pushed into
- the stack at the beginning of garbage_collect was not marked.
+ * dir.c (has_magic): always get long path name on Windows even if
+ no tilde is there. [ruby-core:68011] [Bug #10819]
-Mon Dec 17 12:21:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (replace_real_basename): FindFirstFile ignore redirection
+ character, check if exists before call it. cf. [Bug #8597]
- * Makefile.in (RUNRUBY): added RUNRUBYOPT.
+Fri Feb 20 15:08:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 14 12:36:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (glob_helper): obtain real name with FindFirstFile API
+ instead of matchin all entries, on Windows.
+ [ruby-core:67954] [Bug #10819]
- * configure.in (RUBY_CHECK_VARTYPE): check if a variable is defined
- and its type.
+Fri Feb 20 14:32:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (timezone, altzone): check for recent cygwin.
+ * dir.c (dir_initialize): workaround of opendir failure at symlink
+ directories on Windows via CIFS.
- * missing/strftime.c (strftime): fix for timezone. [ruby-dev:32536]
+Thu Feb 19 17:05:47 2015 Shugo Maeda <shugo@ruby-lang.org>
- * lib/mkmf.rb (try_var): should fail for functions.
+ * class.c (rb_obj_singleton_methods): should use RTEST() to convert
+ VALUE to int.
- * ext/readline/extconf.rb: should use have_func for functions instead
- of have_var.
+Thu Feb 19 16:14:04 2015 Shugo Maeda <shugo@ruby-lang.org>
-Tue Dec 11 00:04:05 2007 Akinori MUSHA <knu@iDaemons.org>
+ * 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]
- * array.c (rb_ary_slice_bang): If an invalid negative index (<
- -size) is given, do not raise an exception but return nil just
- like slice() does.
+Thu Feb 19 16:14:04 2015 Shugo Maeda <shugo@ruby-lang.org>
- * test/ruby/test_array.rb (TestArray::test_slice,
- TestArray::test_slice!): Pull in test cases from trunk.
+ * vm_method.c (remove_method): When remove refined
+ method, raise a NameError if the method is not
+ defined in refined class.
-Mon Dec 10 21:47:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ But if the method is defined in refined class,
+ it should keep refined method and remove original
+ method.
- * transcode.c (str_transcode): allow non-registered encodings.
- [ruby-dev:32520]
+ Patch by Seiei Higa. [ruby-core:67722] [Bug #10765]
-Mon Dec 10 21:00:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Feb 19 16:07:03 2015 Seiei Higa <hanachin@gmail.com>
- * array.c (rb_ary_slice_bang): should return nil if position out
- of range. a patch from Akinori MUSHA <knu AT iDaemons.org>.
- [ruby-dev:32518]
+ * proc.c (rb_obj_singleton_method): Kernel#singleton_method should
+ not use refinements, as well as Kernel#method.
+ [ruby-core:67603] [Bug #10744]
-Mon Dec 10 18:28:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Feb 19 15:32:26 2015 Dave Stevens <dave@crowdlab.com>
- * lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME
- regular expression. a patch from Ueda Satoshi
- <s-ueda AT livedoor.jp>. [ruby-dev:32514]
+ * string.c (str_make_independent_expand): terminate String when
+ moved from heap to embedded. [Fix GH-821].
-Sun Dec 9 12:39:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Feb 19 13:35:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cgi.rb (read_multipart): exclude blanks from header values.
- [ruby-list:44327]
+ * 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]
-Wed Dec 5 23:38:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 17 18:57:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * range.c (range_each): followed step_i change.
+ * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
+ returned by Kernel#instance_variables are Symbols now.
+ [ruby-core:68128] [Bug #10857]
-Wed Dec 5 18:08:45 2007 Tanaka Akira <akr@fsij.org>
+Tue Feb 17 15:39:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (int_odd_p): new method Integer#odd?.
- (int_even_p): new method Integer#even?.
- (int_pred): new method Integer#pred.
- (fix_odd_p): new method Fixnum#odd?.
- (fix_even_p): new method Fixnum#even?.
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide
+ versions of RegDeleteValue and RegDeleteKey.
+ [ruby-core:67958] [Bug #10820]
-Wed Dec 5 15:15:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 17 11:50:06 2015 Yusuke Endoh <mame@tsg.ne.jp>
- * range.c (step_i, range_step): support non-fixnum steps.
- [ruby-talk:282100]
+ * string.c (str_discard): does not free for STR_NOFREE string.
+ [Bug #10853][ruby-core:68110]
-Tue Dec 4 11:23:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bootstraptest/test_string.rb: test for above.
- * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezing
- preceeding 0s. [ruby-core:13873]
+Sun Feb 15 13:15:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 2 22:43:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/getaddrinfo.c (get_addr): reject too long hostname to
+ get rid of GHOST vulnerability on very old platforms.
- * eval.c (error_print): put newline unless multiple line message ends
- with a newline. [ruby-dev:32429]
+ * ext/socket/raddrinfo.c (make_hostent_internal): ditto, paranoic
+ check for the canonnical name.
-Sun Dec 2 15:49:20 2007 Kouhei Sutou <kou@cozmixng.org>
+Sat Feb 14 13:27:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/rss.rb, test/rss/test_version.rb, NEWS: 0.2.1 -> 0.2.2.
+ * 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]
- * lib/rss/maker/itunes.rb: fixed new_itunes_category.
- * lib/rss/maker/taxonomy.rb: new_taxo_topic -> new_topic because
- of consistency.
+ * vm_insnhelper.c (ci_missing_reason): return the reason of method
+ missing in call info.
- * test/rss/test_maker_itunes.rb, test/rss/test_itunes.rb: removed
- needless UTF-8 characters.
+ * vm_insnhelper.c (vm_call_opt_send): re-apply r49500 with the
+ proper missing reason. [Bug #10828]
-Sun Dec 2 01:12:15 2007 James Edward Gray II <jeg2@ruby-lang.org>
+Sat Feb 14 13:27:41 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- Merged 14070 from trunk.
+ * vm_insnhelper.c: Fix symbol leak with +send+ [Bug #10828]
- * lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
- pressing control-c in the controlling terminal or sending SIGTERM stops
- the XML-RPC server.
+Sat Feb 14 08:53:50 2015 Shugo Maeda <shugo@ruby-lang.org>
-Sat Dec 1 15:13:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * 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]
- * lib/resolv.rb: documentation update. backported from 1.9.
- [ruby-core:13273]
+Fri Feb 13 13:59:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 1 03:30:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * parse.y (newline_node): set line from outermost node before removing
- NODE_BEGIN. [ruby-dev:32406]
+Fri Feb 13 03:13:05 2015 Scott Francis <scott.francis@shopify.com>
-Fri Nov 30 21:53:28 2007 Kouhei Sutou <kou@cozmixng.org>
+ * 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]
- * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.0 -> 0.2.1.
+Fri Feb 6 12:05:13 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/content.rb, lib/rss/content/1.0.rb,
- lib/rss/content/2.0.rb, lib/rss/maker/content.rb,
- test/rss/rss-testcase.rb, test/rss/test_content.rb,
- test/rss/test_maker_content.rb: supported content:encoded with RSS
- 2.0.
- Suggested by Sam Lown. Thanks.
+ * thread.c: Improve documentation for Thread#value
+ [Bug #10694][ruby-core:67324][ci skip]
- * NEWS: added the above changes.
+Fri Feb 6 12:02:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
+Fri Feb 6 01:03:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 28 14:43:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c (w_object, marshal_dump): use indetity tables for
+ arbitrary VALUE keys, because of performance of FLONUM.
+ [Bug #10761]
- * ext/extmk.rb (extract_makefile): use dldflags instead of DLDFLAGS to
- get rid of mixing $LDFLAGS and $ARCH_FLAG.
+ * marshal.c (obj_alloc_by_klass, marshal_load): ditto.
- * lib/mkmf.rb (configuration): ditto.
+Fri Feb 6 01:03:38 2015 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (create_makefile): support for extensions which has no
- shared object.
+ * benchmark/bm_marshal_dump_flo.rb: new benchmark for [Bug #10761]
-Wed Nov 28 09:51:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 6 01:03:38 2015 Eric Wong <e@80x24.org>
- * bignum.c (rb_big2str0): do not clobber space for sign.
+ * 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]
- * sprintf.c (remove_sign_bits): extends sign bit first.
+Thu Feb 5 16:30:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 21 01:04:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (gettable_gen): disable warnings of possible reference
+ to a local variable defined in a past scope.
+ [ruby-core:67162] [Bug #10661]
- * object.c (nil_plus): remove unused function. [ruby-core:13737]
+Mon Jan 26 15:35:16 2015 Seiei Higa <hanachin@gmail.com>
-Sun Nov 18 14:03:44 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * eval.c (rb_alias): do not call hook functions until initialization
- finishes. [ruby-talk:279538]
+Thu Jan 22 11:47:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 18 09:09:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/syntax/literals.rdoc (Symbols): now Symbols created by
+ interpolation can be garbage collected. patch by Yihang Ho in
+ [ruby-core:67194]. [Bug #10671]
- * lib/mkmf.rb (String#tr_cpp): make preprocessor identifiers.
+Thu Jan 22 11:45:32 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-Sat Nov 17 13:58:11 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * 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]
- * ext/win32ole/win32ole.c (ole_invoke): bug fix. [ruby-talk:279100]
+ * test/ruby/test_settracefunc.rb: add a test.
-Fri Nov 16 17:41:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 20 14:05:08 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/iconv/iconv.c (Document-class): moved the simplest example to
- the top.
+ * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
+ variable is passed by reference. [ruby-dev:48803] [Bug #10697]
- * ext/iconv/iconv.c (iconv_s_iconv): Document-method: needs class
- prefix for class method. [ruby-core:13542]
+Mon Jan 19 15:45:33 2015 Seiei Higa <hanachin@gmail.com>
- * ext/iconv/iconv.c (iconv_iconv): also instance method needs to be
- qualified.
+ * vm_method.c (rb_method_entry): if no super class, no original
+ method entry. [ruby-core:67389] [Bug #10707]
-Fri Nov 16 11:16:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 19 12:03:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/yaml/rubytypes.rb (String#is_binary_data?): use Integer#fdiv.
+ * 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]
-Thu Nov 15 19:50:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jan 19 12:00:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/curses/extconf.rb: check macro if cannot find func.
- [ruby-list:44224]
+ * 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]
-Thu Nov 15 12:19:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jan 19 11:57:14 2015 Vit Ondruch <vondruch@redhat.com>
- * lib/cgi/session.rb (CGI::Session::FileStore::restore): use
- lockfile for exclusive locks. a patch from <tommy AT tmtm.org>.
- [ruby-dev:32296]
+ * configure.in (RUBY_SETJMP_TYPE): Remove superfluous semicolon
+ which causes a syntax error with autoconf 2.63.
+ [ruby-core:67429] [Bug #10716]
-Wed Nov 14 01:52:59 2007 Tanaka Akira <akr@fsij.org>
+Mon Jan 19 11:44:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * missing/isinf.c (isinf): don't define if the macro is defined.
+ * lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
+ CR. should check if substitution occurred too.
+ [ruby-dev:48813] [Bug #10732]
-Wed Nov 14 01:34:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jan 18 00:59:41 2015 Eric Wong <e@80x24.org>
- * numeric.c (round): fallback definition.
+ * 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
- * numeric.c (flo_divmod, flo_round): use round() always.
- [ruby-dev:32269]
+Sun Jan 18 00:53:38 2015 Seiei Higa <hanachin@gmail.com>
-Tue Nov 13 22:02:23 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * 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]
- * lib/drb/drb.rb: remove Thread.exclusive.
+Sat Jan 17 22:25:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/extservm.rb: ditto.
+ * dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
+ decomposed. [Bug #10704]
-Tue Nov 13 16:33:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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.
- * numeric.c (flodivmod): work around for infinity.
+Sat Jan 17 17:56:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (flo_divmod): work around for platforms have no round().
- [ruby-dev:32247]
+ * parse.y (assocs, assoc): eliminate splatting empty literal
+ hashes. [ruby-core:67446] [Bug #10719]
-Tue Nov 13 13:58:51 2007 Tanaka Akira <akr@fsij.org>
+ * compile.c (compile_array_): supprt splatted hash in hash type.
- * numeric.c (numeric.c): Integer#ord implemented. [ruby-dev:32206]
+Sat Jan 17 16:49:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 13 02:57:04 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * 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]
- * numeric.c (flo_divmod): round to the nearest integer.
- [ ruby-Bugs-14540 ]
+Sat Jan 17 16:47:20 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Nov 12 16:52:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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]
- * lib/mkmf.rb (create_makefile): rdoc about srcprefix. a patch from
- Daniel Berger <djberg96 AT gmail.com> in [ruby-core:13378].
+Sat Jan 17 16:35:59 2015 Seiei Higa <hanachin@gmail.com>
-Mon Nov 12 13:53:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_method.c (rb_export_method): bail out if the original method
+ is undefined when the method is refined.
+ [ruby-core:67387] [Bug #10706]
- * misc/ruby-mode.el (ruby-parse-partial): handle stringified
- symbols properly using ruby-forward-string.
+Sat Jan 17 16:16:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Nov 12 12:38:31 2007 Tanaka Akira <akr@fsij.org>
+ * dir.c (glob_helper): match in case-folding only if the directory
+ resides on a case-insensitve file system, on OSX.
+ [ruby-core:67364] [Bug #10700]
- * Makefile.in (lex.c): don't remove lex.c at first.
+Sat Jan 17 02:04:01 2015 Eric Wong <e@80x24.org>
-Fri Nov 9 07:26:04 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/resolv.rb: consider ENETUNREACH as ResolvTimeout
+ [ruby-core:67411] [Bug #10712]
- * random.c: update MT URL.[ruby-core:13305].
+Sat Jan 17 01:57:57 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Nov 7 03:32:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/zlib/zlib.c: fix document of method signatures.
+ [Bug #10668][ruby-core:67186][ci skip]
- * lib/rexml/encodings/SHIFT-JIS.rb (REXML::Encoding): place -x for
- nkf conversion. a patch from <moonwolf AT moonwolf.com>.
- [ruby-dev:32183]
+Sat Jan 17 01:52:42 2015 Tanaka Akira <akr@fsij.org>
-Mon Nov 5 05:17:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * 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.
- * lib/optparse.rb (OptionParser::Switch::summarize): fix for long form
- option with very long argument. a patch from Kobayashi Noritada
- <nori1 AT dolphin.c.u-tokyo.ac.jp> in [ruby-list:44179].
+Fri Jan 16 21:17:34 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Nov 5 01:20:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_io.rb: added timeout for AIX environment.
+ [ruby-core:62983][Bug #9917]
- * parse.y (call_args): remove "parenthesize argument(s) for future
- version" warning. when I added this warning, I had a plan to
- reimplement the parser that is simpler than the current one.
- since we abandoned the plan, warning no longer required.
+Fri Jan 16 18:25:57 2015 Tanaka Akira <akr@fsij.org>
-Fri Nov 2 00:13:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
+ objects. Label#Str#== is case-insensitive.
- * array.c (rb_ary_assoc): check and convert inner arrays (assocs)
- using #to_ary.
+Fri Jan 16 18:25:57 2015 Ben Miller <bmiller@rackspace.com>
- * hash.c (rb_hash_s_create): check and convert argument hash
- using #to_hash.
+ * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
+ comparison should be case-insensitive as well.
+ [ruby-core:66498] [Bug #10550]
- * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of
- hash conversion.
+Fri Jan 16 18:25:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 1 23:47:43 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/resolv.rb (Resolv::DNS::Name): names with different dots
+ should be different.
- * lib/drb/drb.rb (DRbTCPSocket): Improving with multiple network
- interface.
+Fri Jan 16 17:34:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/drbtest.rb: ditto.
+ * parse.y (f_label): return tLABEL value as it is.
+ [ruby-core:67315] [Bug #10693]
-Fri Oct 26 17:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 16 16:49:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * numeric.c (fix_pow): returns 1.0 for 0**0.0.
+ * lib/net/http.rb (Net::HTTP#send_request): there is no response body
+ with HEAD request. Patch by @rodrigosaito [fix GH-520]
- * numeric.c (fix_pow): returns infinity for 0**-1. [ruby-dev:32084]
+Fri Jan 16 16:49:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Oct 25 07:18:09 2007 James Edward Gray II <jeg2@ruby-lang.org>
+ * test/net/http/test_http.rb (_test_send_request__HEAD): Added
+ failing test for send_request with HEAD method.
- Merged 13781 from trunk.
+Fri Jan 16 14:56:08 2015 Eric Wong <e@80x24.org>
- * lib/net/telnet.rb (Net::Telnet#login): Allowing "passphrase" in
- addition to "password" for Telnet login prompts. [ruby-Bugs-10746]
+ * 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]
-Wed Oct 25 06:46:21 2007 James Edward Gray II <jeg2@ruby-lang.org>
+Fri Jan 16 14:20:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Merged 13779 from trunk.
+ * vm_args.c (keyword_hash_p): fix non-symbol keys hash.
+ rb_extract_keywords() returns 0 not Qnil when no symbol keys is
+ included.
- * lib/net/telnet.rb (Net::Telnet#login): Making the password prompt
- pattern case insensitive. [ruby-Bugs-10746]
+Fri Jan 16 11:06:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Oct 25 14:19:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/unicode_normalize.rb: typo fix. [ci skip]
+ [ruby-dev:48794][misc #10675]
+ included. [ruby-core:67264] [Bug #10685]
+Fri Jan 16 11:04:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]
+ * re.c (unescape_nonascii): append excape sequence as-is not
+ unescaped character, to get rid of unexpected meta-character.
+ [ruby-core:67193] [Bug #10670]
-Wed Oct 25 08:03:53 2007 James Edward Gray II <jeg2@ruby-lang.org>
+Sat Jan 3 21:17:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Merged 13767, 13768, 13769, and 13770 from trunk.
+ * 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]
- * lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
- caused time zone conversion to fail for some ISO 8601 date formats.
- [ruby-Bugs-12677]
+Thu Jan 1 08:29:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
- the HTTP connection to support keepalive requests. [ruby-Bugs-9353]
+ * cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
+ always. [ruby-core:67153] [Bug #10657]
- * lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
- message for Content-Type check failures. [ruby-core:12163]
+Wed Dec 31 15:26:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
- Making Content-Type checks case insensitive. [ruby-Bugs-3367]
+ * 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]
-Sun Oct 21 21:16:43 2007 Kouhei Sutou <kou@cozmixng.org>
+Wed Dec 31 14:11:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.
- - 0.1.6 -> 2.0.0.
- - fixed image module URI. Thanks to Dmitry Borodaenko.
- - supported Atom.
- - supported ITunes module.
- - supported Slash module.
+ * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix to invoke correct function
+ of tcllib. Patch by @zalt50 [fix GH-787]
- * NEWS: added an entry for RSS Parser.
+Wed Dec 31 13:26:22 2014 Eric Wong <e@80x24.org>
-Thu Oct 18 10:57:06 2007 Tanaka Akira <akr@fsij.org>
+ * vm_core.h (rb_vm_living_threads_insert): preserve order
+ [Bug #10660] [ruby-core:67154] [ruby-core:67159]
- * ruby.h (RCLASS_IV_TBL): defined.
- (RCLASS_M_TBL): ditto.
- (RCLASS_SUPER): ditto.
- (RMODULE_IV_TBL): ditto.
- (RMODULE_M_TBL): ditto.
- (RMODULE_SUPER): ditto.
+Fri Dec 26 15:42:27 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 15 22:08:55 2007 Akinori MUSHA <knu@iDaemons.org>
+ * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
+ [Bug #10647] [ruby-dev:48787]
- * NEWS: Merge some of the sub-sections, as the differences were
- unclear.
+Thu Dec 25 17:42:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 15 21:57:07 2007 Akinori MUSHA <knu@iDaemons.org>
+ * 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.
- * NEWS: Mention ipaddr enhancements.
+ * test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if
+ console.
- * lib/ipaddr.rb (in_addr, in6_addr, addr_mask): Make some minor
- code optimization.
+Thu Dec 25 17:37:47 2014 Naohisa Goto <ngotogenome@gmail.com>
- * lib/ipaddr.rb (<=>): Implement IPAddr#<=> and make IPAddr
- comparable.
+ * gc.c (wmap_final_func): fix memory size shortage when realloc wmap.
+ Fix SEGV during finilize of WeakRef on Solaris (though the SEGV
+ could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]
- * lib/ipaddr.rb (succ): Implement IPAddr#succ. You can now create
- a range between two IPAddr's, which (Range) object is
- enumerable.
+Thu Dec 25 17:31:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/ipaddr.rb (to_range): A new method to create a Range object
- for the (network) address.
+ * configure.in (NET_LUID): include winsock2.h instead of windows.h.
+ patch by Jon Forums in [ruby-core:67125]. [Bug #10640]
- * lib/ipaddr.rb (coerce_other): Support type coercion and make &,
- |, == and include? accept a string or an integer instead of an
- IPAddr object as the argument.
+Thu Dec 25 16:01:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/ipaddr.rb (initialize): Give better error messages.
+ * file.c (rb_file_expand_path_internal): drop characters ignored
+ by filesystem on Mac OS X.
- * lib/ipaddr.rb: Improve documentation.
+Thu Dec 25 15:36:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 15 21:24:25 2007 Akinori MUSHA <knu@iDaemons.org>
+ * dir.c (replace_real_basename): get the real name and replace the
+ base name with it by getattrlist(2) if available.
+ suggested by Matthew Draper at [ruby-core:67116]. [Bug #10015]
- * NEWS: Mention shellwords and tempfile enhancements.
+ * dir.c (glob_helper): get the real name of the whole path, not
+ only the last name.
- * NEWS: Move the entry about Tk::X_Scrollable to a better section.
+Thu Dec 25 13:59:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 15 17:28:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in (NET_LUID): include also ifdef.h as a workaround of
+ a bug in mingw-w64 header. [ruby-core:67103] [Bug #10640]
- * ext/openssl/lib/openssl/buffering.rb (read, readpartial): revert
- r12496. handling EOF is a little differnt in ruby 1.8 and ruby 1.9.
- [ruby-dev:31979]
+Thu Dec 25 12:47:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 15 11:45:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (gettable_gen): warn possible reference to a local
+ variable defined in a past scope.
- * marshal.c (r_bytes0): refined length check. [ruby-dev:32059]
+Thu Dec 25 10:09:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 15 09:58:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/io/console/console.c (console_dev): id_console is not a
+ constant name, use rb_const_remove() to get rid of NameError.
- * marshal.c (r_bytes0): check if source has enough data.
- [ruby-dev:32054]
+Thu Dec 25 09:18:55 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 15 01:15:09 2007 Tanaka Akira <akr@fsij.org>
+ * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
+ set timeout for recvfrom because if client thread is crashed, it
+ waits infinity.
- * ext/socket/socket.c (s_accept_nonblock): make accepted fd
- nonblocking. [ruby-talk:274079]
+Thu Dec 25 08:42:11 2014 Eric Wong <e@80x24.org>
-Sun Oct 14 04:08:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb (split_userinfo): fstring for 1-byte split
+ (set_port): reduce bytecode size
+ (check_path): reduce garbage via opt_str_freeze
+ (query=): ditto
+ (fragment=): ditto
+ [misc #10628]
+ * lib/uri/rfc3986_parser.rb (regexp): cache as attr
+ (initialize): setup and freeze regexp attr once
+ (split): reduce bytecode size, use opt_str_freeze
+ (parse): minor bytecode and garbage reduction
+ (default_regexp): rename for initialize
- * configure.in (AC_SYS_LARGEFILE): keep results also in command
- options, to vail out of mismatch. [ruby-list:44114]
+Wed Dec 24 20:38:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * mkconfig.rb, lib/mkmf.rb (configuration): add DEFS.
+ * dir.c (glob_make_pattern): restrict searching case-insensitive
+ name from the filesystem to only last part, for the performance.
+ [ruby-core:63591] [Bug #10015]
-Sun Oct 14 03:55:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 24 18:21:27 2014 Koichi Sasada <ko1@atdot.net>
- * win32/mkexports.rb: deal with __fastcall name decorations.
- [ruby-list:44111]
+ * gc.c: remove unused rb_objspace_t::rgengc::old_objects_at_gc_start.
-Sat Oct 13 09:02:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 24 13:25:22 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * {bcc,win}32/mkexports.rb: explicit data. [ruby-list:44108]
+ * tool/redmine-backporter.rb: require view_changesets permission.
-Sat Oct 13 00:35:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 24 13:00:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): typo
- fixed. [ruby-list:44099]
+ * tool/downloader.rb (Downloader.download): fix the exception to
+ re-raise. initialize methods of subclasses of Exception may
+ have different parameters. [ruby-core:67086] [Bug #10639]
-Fri Oct 12 11:22:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 24 12:16:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c (match_values_at): make #select to be alias to #values_at
- to adapt RDoc description. [ruby-core:12588]
+ * ruby.h (rb_data_type_t): revert r48647 and revise parent member.
+ [ruby-core:66969] [Bug #10621]
-Thu Oct 11 14:32:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Dec 24 05:40:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * {bcc32,win32}/Makefile.sub (COMMON_MACROS): workaround for old SDK's
- bug. [ruby-core:12584]
+ * tool/downloader.rb: use config.guess in gcc repo.
-Wed Oct 10 23:34:45 2007 Tanaka Akira <akr@fsij.org>
+Wed Dec 24 11:50:19 2014 Koichi Sasada <ko1@atdot.net>
- * lib/securerandom.rb: new file. [ruby-dev:31928]
+ * hash.c (rb_hash_delete): return Qnil if there are no corresponding
+ entry. [Bug #10623]
- * lib/cgi/session.rb (create_new_id): use securerandom if available.
+ * hash.c (rb_hash_delete_entry): try delete and return Qundef if there
+ are no corresponding entry.
-Tue Oct 9 01:01:55 2007 Tanaka Akira <akr@fsij.org>
+ * internal.h: add rb_hash_delete_entry()'s declaration.
- * re.c (rb_reg_s_union_m): Regexp.union accepts single
- argument which is an array of patterns. [ruby-list:44084]
+ * symbol.c: use rb_hash_delete_entry().
-Mon Oct 8 20:06:23 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * thread.c: use rb_hash_delete_entry().
- * lib/net/http.rb, lib/open-uri.rb: remove
- Net::HTTP#enable_post_connection_check. [ruby-dev:31960]
+ * ext/-test-/hash/delete.c: use rb_hash_delete_entry().
- * lib/net/imap.rb: hostname should be verified against server's
- indentity as persented in the server's certificate. [ruby-dev:31960]
+Wed Dec 24 09:35:11 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/lib/net/telnets.rb, ext/openssl/lib/net/ftptls.rb: ditto.
+ * ext/fiddle/extconf.rb: remove ffitarget.h generated by configure on
+ mswin, because it's not normal file (cygwin's symlink) and have
+ system attribute.
-Sat Oct 6 23:14:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 24 05:40:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_to_i): update RDoc since base can be any value
- between 2 and 36. [ruby-talk:272879]
+ * tool/downloader.rb: support ruby 1.8.
-Fri Oct 5 15:44:50 2007 Akinori MUSHA <knu@iDaemons.org>
+Wed Dec 24 02:44:06 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/shellwords.rb: Add shellescape() and shelljoin().
+ * lib/net/http/response.rb (Net::HTTPResponse): require one or more
+ spaces [Bug #10591].
+ by leriksen <leif.eriksen.au@gmail.com>
+ https://github.com/ruby/ruby/pull/782 fix GH-782
+ NOTE: graph.facebook.com returns without SP Reason-Phrase.
- * lib/shellwords.rb: Rename shellwords() to shellsplit() and make
- the former an alias to the latter.
+Wed Dec 24 02:12:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/shellwords.rb: Add escape(), split(), join() as class
- methods, which are aliases to their respective long names
- prefixed with `shell'.
+ * tool/make-snapshot (package): VCS#branch_list expects glob a
+ pattern string but not a regexp. based on the patch by Vit
+ Ondruch. in [ruby-core:67064]. [Bug #10636]
- * lib/shellwords.rb: Add String#shellescape(), String#shellsplit()
- and Array#shelljoin() for convenience.
+ * tool/vcs.rb (VCS::SVN#branch_list): strip newlines.
-Fri Oct 5 15:40:04 2007 Akinori MUSHA <knu@iDaemons.org>
+ * tool/vcs.rb (VCS::GIT.get_revisions): retrieve modified time
+ from toplevel log too.
- * lib/tempfile.rb (Tempfile::make_tmpname): Allow to specify a
- suffix for a temporary file name.
+ * tool/vcs.rb (VCS::GIT#branch_list): yield for each lines.
- * lib/tempfile.rb (Tempfile::make_tmpname): Make temporary file
- names less predictable by including a random string.
- [inspired by: akr]
+Wed Dec 24 00:23:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Oct 2 21:20:14 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * tool/extlibs.rb (do_extract): the pipe should be binmode.
- * win32/win32.c (make_cmdvector): adjust escaped successive
- double-quote handling. (merge from trunk)
+Wed Dec 24 00:21:44 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Oct 2 20:35:24 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * Makefile.in, common.mk: move common-srcs to Makefile.in because
+ it breaks build on mswin.
- * win32/win32.c (init_env): initialize HOME and USER environment
- variables unless set. [ruby-core:12328] (merge from trunk)
+Wed Dec 24 00:04:45 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c (NtInitialize, getlogin): ditto.
+ * lib/open-uri.rb (OpenURI.open_http): accept multiple certs path in
+ ssl_ca_certs.
- * configure.in, win32/Makefile.sub (LIBS): need to link shell32
- library for SH* functions on mswin32 and mingw32.
+ * tool/downloader.rb: use certs of rubygems for downloading gems.
-Mon Oct 1 12:50:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 23 22:39:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (id2ref): valid id should not refer T_VALUE nor T_ICLASS.
- [ruby-dev:31911]
+ * ext/fiddle/extlibs: libffi-3.2.1 and patch for mswin.
-Wed Sep 26 23:54:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 23 22:04:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/extmk.rb (extmake), lib/mkmf.rb (configuration): top_srcdir
- should not prefixed with DESTDIR.
+ * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^
+ on both rfc2396 and rfc3986. [Bug #10619]
-Wed Sep 26 08:36:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 23 16:03:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in (ext/extinit.o): use $(OUTFLAG) as well as other
- objects. [ruby-Bugs-14228]
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::Error#initialize):
+ try en_US message if the default message cannot be encoded to
+ locale. [ruby-core:65295] [Bug #10300]
-Wed Sep 26 05:12:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 23 11:42:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (yyerror): limit error message length. [ruby-dev:31848]
+ * ext/openssl/ossl_cipher.c (ossl_cipher_update_long): update huge
+ data gradually not to exceed INT_MAX. workaround of OpenSSL API
+ limitation. [ruby-core:67043] [Bug #10633]
- * regex.c (re_mbc_startpos): separated from re_adjust_startpos.
+Mon Dec 22 21:30:16 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Sep 25 13:47:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/win32ole/test_win32ole_event.rb: some tests are
+ executed on standard Windows OS without ADO.
- * eval.c (remove_method): should not remove undef place holder.
- [ruby-dev:31817]
+Mon Dec 22 14:08:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 24 16:52:11 2007 Urabe Shyouhei <shyouhei@ruby-lang.org>
+ * signal.c (received_signal): fix condition to define.
+ [ruby-core:67032] [Bug #10629]
- * lib/net/http.rb: fix typo.
+Sun Dec 21 10:51:51 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sun Sep 23 21:57:25 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/win32ole/test_win32ole_event.rb: test_s_new_exception is
+ executed on standard Windows OS without ADO.
- * lib/net/http.rb: an SSL verification (the server hostname should
- be matched with its certificate's commonName) is added.
- this verification can be skipped by
- "Net::HTTP#enable_post_connection_check=(false)".
- suggested by Chris Clark <cclark at isecpartners.com>
+Sun Dec 21 08:35:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/open-uri.rb: use Net::HTTP#enable_post_connection_check to
- perform SSL post connection check.
+ * configure.in (jemalloc): fix option argument, should use
+ `$withval` but not `yes` always. [ruby-core:66994] [Bug #10625]
- * ext/openssl/lib/openssl/ssl.c
- (OpenSSL::SSL::SSLSocket#post_connection_check): refine error message.
+ * configure.in (jemalloc): defer adding the liner option to get
+ rid of linking contest against jemalloc, so that it works
+ without runtime dynamic load path.
-Sun Sep 23 09:05:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 20 17:49:03 2014 Tanaka Akira <akr@fsij.org>
- * gc.c (os_obj_of, os_each_obj): hide objects to be finalized.
- [ruby-dev:31810]
+ * lib/tmpdir.rb (Dir.mktmpdir): Accept nil again, as Ruby 2.1.
+ [ruby-core:66943] [Bug #10616] Fixed by Alex Slynko.
-Sun Sep 23 08:58:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 20 11:22:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval_method.ci (rb_attr): should not use alloca for unknowen size
- input. [ruby-dev:31816]
+ * ext/fiddle/depend, ext/fiddle/extconf.rb: try to build bundled
+ libffi if existing.
- * parse.y (rb_intern_str): prevent str from optimization.
+Sat Dec 20 05:21:00 2014 Eric Wong <e@80x24.org>
-Sun Sep 23 05:42:35 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * test/test_weakref.rb (test_repeated_object_leak): increase timeout
+ [Bug #10618]
- * lib/rdoc/options.rb (Options::check_diagram): dot -V output
- changed. [ ruby-Bugs-11978 ], Thanks Florian Frank.
+Fri Dec 19 22:33:13 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 22 06:02:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/update-deps: Use $(hdrdir) if possible.
- * lib/optparse.rb (OptionParser::List::summarize): use each_line if
- defined rather than each. [ruby-Patches-14096]
+Fri Dec 19 22:10:00 2014 Kenta Murata <mrkn@cookpad.com>
-Sat Sep 22 05:19:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/depend: Fix dependencies to make bigdecimal
+ installable by rubygems.
- * ext/stringio/stringio.c (strio_init): separate from strio_initialize
- to share with strio_reopen properly. [ruby-Bugs-13919]
+ * ext/bigdecimal/bigdecimal.gemspec: version 1.2.6.
-Fri Sep 21 15:46:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 19 20:00:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (struct rb_exec_arg): proc should be a VALUE.
+ * include/ruby/ruby.h (PRIsVALUE): put a space after string
+ literals not to be confused with C++11 string literal suffix.
+ https://github.com/ruby/ruby/commit/a9f3eb7#commitcomment-9040169
- * process.c (rb_f_exec): suppress a warning.
+Fri Dec 19 15:36:02 2014 Simon Genier <simon.genier@shopify.com>
-Fri Sep 21 03:05:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (hash_equal): prefer true than the result of implicit
+ conversion from int returned by rb_eql() to VALUE. [Fix GH-789]
- * eval.c, intern.h, ext/thread/thread.c: should not free queue while
- any live threads are waiting. [ruby-dev:30653]
+Thu Dec 18 17:45:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 20 17:24:59 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (rb_cv_binary_elf): get rid of -e option of cat
+ which is not available on BusyBox, use tr instead.
+ [ruby-core:64824] [Bug #10210]
- * process.c (rb_detach_process): cast for the platforms where size of
- pointer differs from size of int.
+Thu Dec 18 14:25:17 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (rb_f_exec, rb_f_system): should not exceptions after
- fork. [ruby-core:08262]
+ * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT,
+ should be treated before calling signal(3).
+ [Bug #10615]
-Fri Sep 14 00:34:25 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Dec 17 12:20:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/extservm.rb (invoke_service): use Thread.exclusive instead of
- Thread.critical
+ * compile.c (rb_method_for_self_aref, rb_method_for_self_aset):
+ move from iseq.c to build from node instead of arrays.
-Wed Sep 12 23:12:22 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 17 10:50:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ruby.c (proc_options): -W should be allowed in RUBYOPT
- environment variable. [ruby-core:12118]
+ * test/gdbm/test_gdbm.rb: Added test for each_key called without a block.
+ Patch by @joeyates [fix GH-783]
-Mon Sep 10 01:05:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 17 10:18:42 2014 Koichi Sasada <ko1@atdot.net>
- * range.c (range_step): fixed integer overflow. [ruby-dev:31763]
+ * compile.c (iseq_compile_each): check
+ iseq->compile_data->option->specialized_instruction for opt_* insn.
-Sun Sep 9 09:14:45 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/ruby/test_iseq.rb: check no specialized_instructions option.
- * lib/date/format.rb (_strptime): now also attaches an element
- which denotes leftover substring if exists.
+Wed Dec 17 09:48:57 2014 Eric Wong <e@80x24.org>
-Sat Sep 8 10:22:20 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (iseq_compile_each): only emit opt_str_freeze,
+ opt_aref_with, and opt_aset_with insn when no block is given
+ [Bug #10557] [ruby-core:66595]
+ * test/ruby/test_optimization.rb (test_block_given_aset_aref):
+ new test for bug thanks to Bartosz Kopinski.
+ (test_string_freeze): additional assertion for object_id
- * struct.c (rb_struct_s_members): should raise TypeError instead
- of call rb_bug(). [ruby-dev:31709]
+Wed Dec 17 01:06:47 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * marshal.c (r_object0): no nil check require any more.
+ * ext/win32/lib/Win32API.rb (Win32API#call): need to splat. hmm, when
+ was this broken?
-Sat Sep 8 09:38:19 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Dec 16 15:18:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/format.rb (str[fp]time): now check specifications more
- strictly.
+ * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): call
+ accessor functions directly, not to be affected by [] and []=
+ methods. [ruby-core:66846] [Bug #10601]
-Fri Sep 7 05:36:19 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * struct.c (define_aref_method, define_aset_method): ditto.
- * test/rinda/test_rinda.rb (MockClock): correct synchronous problems
- of the MultiThreading. [ruby-dev:31692]
+ * vm_insnhelper.c (rb_vm_opt_struct_aref, rb_vm_opt_struct_aset):
+ direct accessors of Struct.
-Wed Sep 5 22:02:27 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Dec 16 12:01:29 2014 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_subseq): need integer overflow check.
- [ruby-dev:31736]
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ extend timeout seconds to 60 for RGENGC_CHECK_MODE > 0 environment.
- * array.c (rb_ary_splice): ditto. [ruby-dev:31737]
+Tue Dec 16 08:53:12 2014 Eric Wong <e@80x24.org>
- * array.c (rb_ary_fill): ditto. [ruby-dev:31738]
+ * tool/vcs.rb: fix Ruby 1.8 compatibility harder
- * string.c (rb_str_splice): integer overflow for length.
- [ruby-dev:31739]
+Tue Dec 16 07:37:18 2014 Eric Wong <e@80x24.org>
-Sun Sep 2 00:48:15 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order
+ (RUBY_GC_HEAP_GROWTH_SLOTS): s/factor/number of slots/
- * lib/date/format.rb (_parse): improved parsing of ordinal dates.
+ * man/ruby.1: add section for GC environment variables
+ [Feature #10197]
- * lib/date/format.rb (_parse): use named character classes in some
- regular expressions.
+Tue Dec 16 05:41:46 2014 Eric Wong <e@80x24.org>
-Sat Sep 1 08:13:36 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * tool/vcs.rb: fix Ruby 1.8 compatibility
- * ext/win32ole/win32ole.c: add WIN32OLE#ole_activex_initialize.
+Mon Dec 15 17:51:28 2014 Koichi Sasada <ko1@atdot.net>
-Thu Aug 30 13:13:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c: ObjectSpace.memsize_of(obj) returns
+ with sizeof(RVALUE). [Bug #8984]
- * lib/mkmf.rb (try_const, have_const): check for a const is defined.
- [ruby-core:04422]
+ * gc.c (obj_memsize_of): ditto.
-Thu Aug 30 13:10:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: add a NEWS entry.
- * configure.in (group_member): check if presents.
+ * test/objspace/test_objspace.rb: catch up this fix.
- * configure.in (XCFLAGS): add _GNU_SOURCE on linux.
+ * test/ruby/test_file_exhaustive.rb: ditto.
- * file.c (group_member): use system routine if available.
+Mon Dec 15 16:19:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 30 08:24:18 2007 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_enc_str_coderange): dummy wchar, non-endianness
+ encoding string cannot be ascii only.
+ [ruby-core:66835] [Bug #10598]
- * ruby.h (RHASH_TBL): defined for compatibility to 1.9.
- * (RHASH_ITER_LEV): ditto.
- * (RHASH_IFNONE): ditto.
- * (RHASH_SIZE): ditto.
- * (RHASH_EMPTY_P): ditto.
+Sun Dec 14 20:11:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 29 13:05:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (primary): restore current_arg so that circular
+ reference after a method definition is also warned.
+ [ruby-core:61299] [Bug #9593]
- * include/ruby/defines.h (flush_register_windows): call "ta 0x03"
- even on Linux/Sparc. [ruby-dev:31674]
+Sat Dec 13 20:41:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 28 23:26:12 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * vm_trace.c (rb_postponed_job_flush): mask signal trap interrupt
+ too to defer handling after finalizers finished.
+ [ruby-core:66825] [Bug #10595]
- * ext/win32ole/win32ole.c (ole_type_progid, reg_enum_key,
- reg_get_val, ole_wc2mb): fix the bug. Thanks, arton.
- [ruby-dev:31576]
+Sat Dec 13 18:33:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Aug 27 19:10:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_pkey_ec.rb: ignored tests with old OpenSSL.
- * ext/etc/etc.c (etc_getlogin): update documentation to note
- security issue. [ruby-Bugs-11821]
+Sat Dec 13 18:01:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 21 21:09:48 2007 Tanaka Akira <akr@fsij.org>
+ * signal.c (check_stack_overflow): check sp also on i386/x86_64
+ FreeBSD.
- * lib/tmpdir.rb (Dir.mktmpdir): make directory suffix specifiable.
+Sat Dec 13 09:58:41 2014 Eric Wong <e@80x24.org>
-Tue Aug 21 13:57:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (define_final0): avoid duplicate blocks
+ [Bug #10537]
+ * test/test_weakref.rb (test_repeated_object_leak): new test
- * hash.c (st_foreach_func, rb_foreach_func): typedefed.
+Sat Dec 13 04:59:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Aug 20 17:25:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bin/erb (ERB::Main#run): get rid of shadowing outer local
+ variables. [ruby-core:65772] [Feature #10395]
- * eval.c (mnew): should preserve noex as safe_level.
+Fri Dec 12 21:56:44 2014 Kouhei Sutou <kou@cozmixng.org>
- * eval.c (rb_call0): tighten security check condition..
+ * gems/bundled_gems: Upgrade to test-unit 3.0.8. assert_throw and
+ assert_nothing_thrown in test-unit 3.0.7 were broken by
+ UncaughtThrowError change introduced in Ruby 2.2.0
+ preview2. These assertions in test-unit 3.0.8 work well with
+ UncaughtThrowError in Ruby 2.2.0 preview2.
-Sat Aug 18 21:32:20 2007 Tanaka Akira <akr@fsij.org>
+Fri Dec 12 19:48:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tmpdir.rb (Dir.mktmpdir): new method.
- [ruby-dev:31462]
+ * bin/erb (ARGV.switch, ERB::Main#run): allow variables to be set
+ from the command line. [ruby-core:65772] [Feature #10395]
-Sat Aug 18 17:44:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 12 19:31:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c (Init_tcltklib): use rb_set_end_proc().
+ * lib/erb.rb (ERB#lineno): accessor for line number to eval.
-Sat Aug 18 15:59:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/erb.rb (ERB#location=): setter of file name and line number.
- * process.c (detach_process_watcher): should not pass the pointer
- to an auto variable to the thread to be created. pointed and
- fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618]
+Fri Dec 12 13:09:13 2014 Koichi Sasada <ko1@atdot.net>
-Sat Aug 18 12:24:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_latest_gc_info): return :state field to show current
+ GC state (none/marking/sweeping).
+ [Feature #10590]
- * sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
- comment lines first.
+Fri Dec 12 10:49:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 16 20:40:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (rb_str_crypt): check arguments more strictly.
+ * crypt() is not for wide char strings
+ * salt bytes should not be NUL
- * bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound
- access. [ruby-dev:31404]
+Fri Dec 12 08:16:01 2014 Matt Hoyle <matt@deployable.co>
-Thu Aug 16 16:46:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_read) Fix spelling in docco for read. [Fix GH-781]
+ try > tries
- * configure.in (aix): enable shared by default.
+Thu Dec 11 19:06:01 2014 Koichi Sasada <ko1@atdot.net>
- * configure.in (aix): for 64bit-mode AIX. [ruby-dev:31401]
- + use CC for LDSHARED if non-gcc,
- + moved -G option from *LDFLAGS to LDSHARED,
- + set -brtl only in XLDFLAGS.
+ * class.c (class_alloc): Start from age == 2.
+ Class and Module objects can be living long life.
-Thu Aug 16 13:06:08 2007 Tanaka Akira <akr@fsij.org>
+ * iseq.c: Same for ISeq objects.
- * bignum.c (big_lshift): make shift offset long type.
- (big_rshift): ditto.
- (rb_big_lshift): ditto.
- (big_rshift): ditto.
- [ruby-dev:31434]
+ * gc.c (RVALUE_AGE_RESET): added.
-Thu Aug 16 04:09:19 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c (newobj_of): allow to generate (age != 0) objects.
- * lib/rinda/tuplespace.rb (Rinda::TupleSpace#start_keeper): improve
- keeper thread.
+ * gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected
+ objects.
-Wed Aug 15 13:50:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended
+ flag.
- * hash.c (rb_hash_delete_key): delete the entry without calling block.
+Thu Dec 11 05:37:52 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * hash.c (rb_hash_shift): should consider iter_lev too.
+ * lib/prime.rb: Remove useless loop and block capture.
+ See [#10354]
- * hash.c (delete_if_i): use rb_hash_delete_key() so that the block
- isn't called twice. [ruby-core:11556]
+Thu Dec 11 04:27:24 2014 Koichi Sasada <ko1@atdot.net>
-Sun Arg 12 03:56:30 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * vm_core.h: introduce new field
+ rb_thread_t::local_storage_recursive_hash_for_trace to store
+ recursive hash to avoid creating new recursive (nested) hashes
+ for each trace events.
+ [Bug #10511]
- * lib/rinda/tuplespace.rb: fix Rinda::TupleSpace keeper thread bug.
- the thread is started too early. [ruby-talk:264062]
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): use it.
- * test/rinda/test_rinda.rb: ditto.
+ * cont.c: catch up this fix.
-Sat Aug 11 07:34:10 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm.c (rb_thread_mark): ditto.
- * lib/date/format.rb: reverted some wrongly erased "o" options
- (pointed out by nobu).
+Wed Dec 10 13:39:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 7 14:58:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * struct.c (define_aref_method, define_aset_method): use iseq
+ VALUE instead of rb_iseq_t to prevent from GC, as RB_GC_GUARD
+ makes sense only for local variables. [Feature #10575]
- * ext/pty/pty.c (establishShell): handshaking before close slave
- device. [ruby-talk:263410]
+Wed Dec 10 09:38:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): constified.
+ * thread.c (exec_recursive): use the same last method name as
+ recursive_push in the error message when recursive_pop failed.
+ [ruby-core:66742] [Bug #10579]
- * ext/pty/pty.c (SlaveName): removed static buffer.
+Wed Dec 10 02:48:46 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/pty/expect_sample.rb: support for autologin.
+ * test/net/http/test_https.rb
+ (TestNetHTTPS#test_certificate_verify_failure): on Windows,
+ Errno::ECONNRESET will be raised when the verify is failure at the
+ client side, and it'll be eaten by WEBrick.
-Tue Aug 7 12:45:13 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/open-uri/test_ssl.rb (TestOpenURISSL#test_validation_failure):
+ ditto.
- * configure.in (ac_cv_func_isinf): set yes also on OpenSolaris.
- [ruby-Bugs-12859]
+Wed Dec 10 00:42:13 2014 Eric Wong <e@80x24.org>
-Mon Aug 6 17:36:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset):
+ new methods to generate bytecode for struct.c
+ [Feature #10575]
+ * struct.c (rb_struct_ref, rb_struct_set): remove
+ (define_aref_method, define_aset_method): new functions
+ (setup_struct): use new functions
+ * test/ruby/test_struct.rb: add test for struct >10 members
+ * benchmark/bm_vm2_struct_big_aref_hi.rb: new benchmark
+ * benchmark/bm_vm2_struct_big_aref_lo.rb: ditto
+ * benchmark/bm_vm2_struct_big_aset.rb: ditto
+ * benchmark/bm_vm2_struct_small_aref.rb: ditto
+ * benchmark/bm_vm2_struct_small_aset.rb: ditto
- * lib/rexml/encodings/{ISO-8859-15,CP-1252}.rb: fixed invalid syntax.
+Tue Dec 9 20:24:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Aug 3 11:05:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c: [DOC] Add missing documentation around String#chomp.
+ Patch by @stderr [ci skip][fix GH-780]
- * ext/extmk.rb (extmake): save all CONFIG values.
+Tue Dec 9 18:20:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb (extmake): remove mkmf.log at clean, and extconf.h at
- distclean, respectively.
+ * object.c: [DOC] Revise documentation by Marcus Stollsteimer at
+ [ruby-core:66368]. [Bug #10526]
- * ext/extmk.rb: remove rdoc at clean, and installed list file at
- distclean, respectively.
+ * #inspect: be more specific about generated string, remove
+ obsolete example.
+ * #nil?: use code examples instead of different call-seq's.
+ * #tap: clarify what is yielded.
+ * Integer(): be more specific about to_int and to_i, remove
+ reference to Ruby 1.8.
+ * Array(): fix error.
+ * Class: fix variable name style and indentation in example.
+ * improve consistency, fix typos and formatting.
-Fri Aug 3 07:09:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 9 12:48:32 2014 Josef Simanek <josef.simanek@gmail.com>
- * lib/mkmf.rb: more verbose message. [ruby-Bugs-12766]
+ * vm_eval.c (rb_eval_string_wrap): [DOC] Fix `rb_eval_string_wrap`
+ documentation. It is referencing `require` instead of `load`.
+ The former does not have the optional argument. [Fix GH-779]
- * lib/mkmf.rb (have_type): suppress a warning with -Wall.
+Tue Dec 9 10:16:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (find_type): new method.
+ * eval.c (rb_frame_last_func): return the most recent frame method
+ name.
-Thu Aug 2 13:46:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (recursive_list_access): use the last method name,
+ instead of the current method name which can be unset in some
+ cases, not to use a symbol by the invalid ID.
+ [ruby-core:66742] [Bug #10579]
- * sprintf.c (rb_f_sprintf): should not check positional number as
- width. [ruby-core:11838]
+Sun Dec 7 19:36:12 2014 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon Jul 30 11:16:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/basicsocket.c, ext/socket/sockssocket.c:
+ remove code for $SAFE=4.
- * bignum.c (rb_big_aref): check for Bignum index range.
- [ruby-dev:31271]
+Sun Dec 7 10:20:55 2014 Eric Hodel <drbrain@segment7.net>
-Sat Jul 28 09:35:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rdoc: Update to RDoc 4.2.0.
+ * test/rdoc: ditto.
- * ext/digest/lib/digest.rb (Digest::self.const_missing): avoid
- infinite recursive const_missing call. [ruby-talk:262193]
+Sun Dec 7 09:52:30 2014 Eric Hodel <drbrain@segment7.net>
-Thu Jul 26 13:57:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems: Update to RubyGems 2.4.5.
+ * test/rubygems: ditto.
- * dln.c (load_1, dln_find_1): constified.
+Sat Dec 6 10:05:08 2014 Shugo Maeda <shugo@ruby-lang.org>
- * dln.c (conv_to_posix_path): removed.
+ * lib/net/imap.rb: Fix undefined variable usage & refactor/DRY
+ code. Patch by @aledovsky. [Fixes GH-770]
- * ruby.c (usage): constified.
+ * test/net/test_imap.rb: related test.
- * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): return
- VALUE instead of a pointer to static buffer.
+Sat Dec 6 10:09:44 2014 Eric Wong <e@80x24.org>
- * ruby.c (push_include_cygwin): fixed buffer overflow.
- [ruby-dev:31297]
+ * thread.c (do_select): rename parameters to avoid shadowing
- * ruby.c (ruby_init_loadpath): not convert built-in paths.
+Sat Dec 6 09:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Jul 22 16:07:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rake: Update to rake 10.4.2
+ * test/rake: ditto.
- * intern.h (is_ruby_native_thread): removed since declared as an int
- function in ruby.h already.
+Sat Dec 6 06:48:03 2014 Eric Wong <e@80x24.org>
-Sun Jul 22 14:33:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (rb_iseq_build_from_ary): remove misc handling
- * file.c (rb_file_s_rename): deleted code to get rid of a bug of
- old Cygwin.
+Sat Dec 6 06:14:23 2014 Vit Ondruch <vondruch@redhat.com>
- * file.c (rb_file_truncate): added prototype of GetLastError()
- on cygwin. [ruby-dev:31239]
+ * configure.in (RUBY_LIB_VERSION): Fix --with-ruby-version
+ configuration option. get rid of quoting in config.status.
- * intern.h (is_ruby_native_thread): prototype.
+ * template/verconf.h.tmpl: quote RUBY_LIB_VERSION here.
+ [ruby-core:66724] [Bug #10572]
- * missing/strftime.c (strftime): fix printf format and actual
- arguments.
+Sat Dec 6 04:33:52 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/Win32API/Win32API.c (Win32API_initialize): ditto.
+ * lib/pp.rb (File::Stat#pretty_print): some platforms (such as Windows)
+ does not have major/minor parts of device.
- * ext/tk/tcltklib.c (ip_finalize): ditto.
+Fri Dec 5 22:43:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/dl/ptr.c (rb_dlptr_inspect): ditto. [ruby-dev:31268]
+ * ext/psych/lib/psych.rb: bump version to 2.0.8
+ * ext/psych/psych.gemspec: ditto.
+ * ext/psych/psych_emitter.c: ditto.
+ * ext/psych/psych_parser.c: ditto.
- * ext/dl/sym.c (rb_dlsym_inspect): ditto.
+Fri Dec 5 17:09:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/getnameinfo.c: include stdio.h always.
+ * ext/socket/option.c (inet_ntop): link aliased inet_ntop in
+ libruby on mswin not rb_w32_inet_ntop which fails to link for
+ unknown reason.
- * ext/win32ole/win32ole.c (ole_hresult2msg, folevariable_name,
- folevariable_ole_type, folevariable_ole_type_detail,
- folevariable_value, folemethod_visible): missing return value.
+Fri Dec 5 11:09:54 2014 Eric Wong <e@80x24.org>
-Sat Jul 21 17:48:26 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (prepare_iseq_build): remove unused block_opt param
+ (rb_iseq_new_with_bopt_and_opt): remove
+ (rb_iseq_new_with_opt): inline removed function
+ (rb_iseq_new_with_bopt): remove
+ (iseq_load): adjust prepare_iseq_build call
+ [Feature #10565]
- * lib/mkmf.rb (create_makefile): make OBJS depend on RUBY_EXTCONF_H
- only if extconf.h is created.
+Fri Dec 5 09:46:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/{Makefile.sub,configure.bat,setup.mak: configure_args
- support.
+ * parse.y (parser_yylex): fix lex_state after tLABEL_END, should
+ be EXPR_LABELARG to be followed by "paren with arg".
+ [ruby-core:66705] [Feature #4935]
- * bcc32/setup.mak: check runtime version.
+Fri Dec 5 02:27:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_open_osfhandle): prototype has changed
- in bcc 5.82.
+ * ext/extmk.rb: as all extension objects including initializations
+ of ext and enc should be linked to libruby if enable-shared,
+ EXTOBJS should not be linked to main programs.
+ [ruby-core:66675] [Bug #10566]
- * {win32,wince,bcc32}/setup.mak (-version-): no RUBY_EXTERN magic.
+Thu Dec 4 07:06:02 2014 Eric Wong <e@80x24.org>
- * win32/resource.rb: include patchlevel number.
+ * compile.c (rb_iseq_build_from_exception): entry->sp is unsigned
+ (iseq_build_callinfo_from_hash): account for kw_arg
+ (iseq_build_from_ary_body): update for r35459
+ (CHECK_STRING, CHECK_INTEGER): remove unused checks
+ (int_param): new function for checking new `params' hash
+ (iseq_build_kw): new function for loading rb_iseq_param_keyword
+ (rb_iseq_build_from_ary): account for `misc' entry and general
+ structure changes
+ [Feature #8543]
+ * iseq.c (CHECK_HASH): new macro (for `misc' and `param' entries)
+ (iseq_load): account for `misc' and `params' hashes
+ (iseq_data_to_ary): add final opt to arg_opt_labels,
+ fix kw support, account for unsigned entry->sp
+ * ext/-test-/iseq_load/iseq_load.c: new ext for test
+ * ext/-test-/iseq_load/extconf.rb: ditto
+ * test/-ext-/iseq_load/test_iseq_load.rb: new test
-Sat Jul 21 12:06:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 4 06:56:57 2014 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (init_mkmf): should remove mkmf.log too.
+ * iseq.c (iseq_free): avoid segfault on incomplete iseq
+ * test/ruby/test_syntax.rb (test_invalid_next): new test
+ for syntax error, not segfault
-Sat Jul 21 01:53:17 2007 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Dec 4 04:20:34 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/format.rb (Date._parse): completes calendar week based year.
+ * load.c (ruby_require_internal): ignore error detail, just return
+ an error.
- * lib/date/format.rb (Date._parse): detects year of ordinal date in
- extended format.
+Wed Dec 3 17:13:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 20 15:22:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * encoding.c (load_encoding): use rb_require_internal instead of
+ calling rb_require_safe with protection.
- * ext/openssl/ossl_config.c (ossl_config_set_section): do not
- initialize aggregations with dynamic values. [ruby-talk:259306]
+Wed Dec 3 16:47:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 19 19:24:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (register_init_ext, ruby_init_ext): defer running the
+ registered initialization function until required, not to enable
+ extensions which have global effects just by loading, e.g.,
+ mathn/complex and mathn/rational. fix `make test` with
+ --with-static-linked-ext.
- * eval.c (get_backtrace): check the result more.
- [ruby-dev:31261] [ruby-bugs-12398]
+ * enc/encinit.c.erb (Init_enc): initialize encdb and transdb
+ directly.
-Thu Jul 19 14:38:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 3 14:51:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_lshift, rb_big_rshift): separated functions
- to get rid of infinite recursion. fixed calculation in edge
- cases. [ruby-dev:31244]
+ * load.c (ruby_require_internal): separate from rb_require_safe,
+ not to raise exceptions.
- * numeric.c (rb_fix_lshift, rb_fix_rshift): ditto.
+ * ruby.c (process_options): remove unnatural encoding search.
-Wed Jul 18 16:57:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 3 14:34:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_pow): refine overflow check. [ruby-dev:31242]
+ * string.c (setup_fake_str): fake string does not share another
+ string, but just should not free.
-Wed Jul 18 08:47:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 3 11:14:14 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * time.c (time_succ): Time#succ should return a time object in the
- same timezone mode to the original. [ruby-talk:260256]
+ * win32/win32.c (w32_spawn): `v2` is used not only for `shell` but also
+ `cmd`, so must not free before using `cmd`.
+ [ruby-core:66648] [Bug #10563]
-Tue Jul 17 00:50:53 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 3 09:48:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (fix_pow): integer power calculation: 0**n => 0,
- 1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).
+ * ext/racc/cparse/cparse.c (cparse_params_type): use typed data.
- * test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test
- suite. pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf.
+Tue Dec 2 21:33:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Jul 16 23:07:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c: use typed data for com_hash.
- * lib/base64.rb (Base64::b64encode): should not specify /o option
- for regular expression. [ruby-dev:31221]
+Tue Dec 2 15:30:30 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 16 18:29:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_plus): in documentation, added note about
+ inefficiency of repeated += operations.
- * string.c (rb_str_rindex_m): accept string-like object convertible
- with #to_str method, as well as rb_str_index_m. [ruby-core:11692]
+Tue Dec 2 07:20:21 2014 Eric Wong <e@80x24.org>
-Mon Jul 16 05:45:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (iseq_data_to_ary): keep hidden variables
+ Thanks to wanabe [ruby-core:66566]
- * sprintf.c (rb_f_sprintf): more checks for format argument.
- [ruby-core:11569], [ruby-core:11570], [ruby-core:11571],
- [ruby-core:11573]
+Tue Dec 2 06:46:57 2014 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Jul 16 00:26:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb: bumping version
- * bignum.c (rb_big_pow): removed invariant variable. [ruby-dev:31236]
+ * ext/psych/psych.gemspec: ditto
-Sun Jul 15 23:59:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 2 06:34:08 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * bignum.c (rb_big_neg): SIGNED_VALUE isn't in 1.8.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: support objects that are
+ marshalable, but inherit from basic object.
+ Thanks Sean Griffin <sean@thoughtbot.com>
-Sun Jul 15 22:24:49 2007 pegacorn <subscriber.jp AT gmail.com>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
- * ext/digest/digest.c (rb_digest_instance_update,
- rb_digest_instance_finish, rb_digest_instance_reset,
- rb_digest_instance_block_length): %s in rb_raise() expects char*.
- [ruby-dev:31222]
+ * test/psych/test_marshalable.rb: test for fix
- * ext/openssl/ossl.h: include ossl_pkcs5.h. [ruby-dev:31231]
+Tue Dec 2 06:32:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkcs5.h: new file for PKCS5. [ruby-dev:31231]
+ * parse.y (ripper_flush_string_content): preserve the dispatched
+ results at tSTRING_CONTENT. [ruby-dev:48714] [Bug #10437]
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise()
- instead of rb_raise(). [ruby-dev:31222]
+ * parse.y (regexp_contents): check in ripper only if the whole
+ content is a single regexp without interpolation.
+ [ruby-dev:48714] [Bug #10437]
- * ext/sdbm/_sdbm.c: DOSISH platforms need io.h. [ruby-dev:31232]
+Tue Dec 2 06:30:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/syck.h: include stdlib.h for malloc() and free().
- [ruby-dev:31232]
+ * re.c (rb_reg_region_copy): new function to try with GC if copy
+ failed and return the error.
- * ext/syck/syck.h (syck_parser_set_input_type): prototype added.
- [ruby-dev:31231]
+Tue Dec 2 04:43:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c: include mbstring.h for _mbspbrk(). [ruby-dev:31232]
+ * re.c (CHECK_REGION_COPIED): onig_region_copy() can fail when
+ memory exhausted but returns nothing, so check by if allocated.
- * win32.h (rb_w32_getcwd): prototype added. [ruby-dev:31232]
+Tue Dec 2 02:53:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jul 15 21:07:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (magic_comment_encoding): enable in ripper, since the
+ encoding is necessary to parse non-default encoding scripts.
- * bignum.c (bigtrunc): do not empty Bignum. [ruby-dev:31229]
+Tue Dec 2 02:30:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jul 15 19:05:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic.build):
+ use hostname= to detect and wrap IPv6 hosts.
+ Build is accepting URI components and users may not expect
+ that a host component needs to be wrapped with square brackets
+ since it's not providing a URI.
+ Note: initialize with arg_check => true does not wrap IPv6 hosts.
+ by Joe Rafaniello <jrafanie@redhat.com>
+ https://github.com/ruby/ruby/pull/765 fix GH-765
- * bignum.c (rb_cstr_to_inum): check leading non-digits.
- [ruby-core:11691]
+ * test/uri/test_generic.rb: Add more tests
-Sun Jul 15 04:42:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 1 20:01:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * bignum.c (get2comp): do nothing for empty Bignum. [ruby-dev:31225]
+ * ext/win32ole/win32ole.c: use typed data for WIN32OLE.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_event.c: ditto.
-Sat Jul 14 14:04:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 1 17:20:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (sort_by_cmp): check if reentered. [ruby-dev:24291]
+ * win32/Makefile.sub (verconf.h): so depends on verconf.mk, which
+ is rebuilt by setup.mak.
-Sat Jul 14 12:44:14 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Dec 1 11:05:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/openssl/test_pkcs7.rb: reverted the previous patch. it should
- be as it was to check interface compatibility. sorry for bothering
- with this.
+ * proc.c: fix grammar by @BenMorganIO [fix GH-764][ci skip]
-Sat Jul 14 12:16:17 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Dec 1 10:49:53 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/openssl/test_pkcs7.rb: follow the library change. applied a
- patch from <zn at mbf.nifty.com> [ruby-dev:31214].
- NOTE: r12496 imports the latest openssl libs from trunk to ruby_1_8
- though its's not ChangeLog-ed. maintainer should aware that.
+ * man/rake.1: Update latest man content by @aledovsky
+ [fix GH-771][ci skip]
-Sat Jul 14 02:51:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Dec 1 10:42:31 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * numeric.c (fix_pow): 0**2 should not raise floating point
- exception. [ruby-dev:31216]
+ * doc/syntax/refinements.rdoc: refinements are no longer experimental.
+ patch by @gaurish [fix GH-775][ci skip]
-Sat Jul 14 02:25:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 30 20:05:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31213]
+ * parse.y (regexp_contents): fix a typo. pointed out by wanabe.
+ [ruby-dev:48741] [Bug #10543]
- * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215]
+Sun Nov 30 18:55:32 2014 Tanaka Akira <akr@fsij.org>
-Fri Jul 13 16:10:00 2007 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ Don't raise Interrupt.
- * lib/open-uri.rb (URI::Generic#find_proxy): use ENV.to_hash to access
- http_proxy environment variable to avoid case insensitive
- environment search.
+Sun Nov 30 17:11:05 2014 Tanaka Akira <akr@fsij.org>
-Fri Jul 13 15:02:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): Use
+ assert_separately.
- * win32/win32.c (CreateChild): enclose command line except for
- command.com which can not handle quotes. [ruby-talk:258939]
+Sun Nov 30 00:02:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 13 10:10:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ruby.c (process_options, ruby_script): transcode script name and
+ program name to locale encoding as well as argv.
+ [ruby-dev:48752] [Bug #10555]
- * lib/mkmf.rb (link_command, cc_command, cpp_command): do not expand
- ::CONFIG which is an alias of MAKEFILE_CONFIG.
+ * ruby.c (translit_char_bin): should not use code page dependent
+ CharNext on UTF-8 string. [ruby-dev:48752] [Bug #10555]
-Thu Jul 12 17:03:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 29 16:53:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (rb_struct_init_copy): disallow changing the size.
- [ruby-dev:31168]
+ * ruby.c (ruby_set_argv): convert argv from UTF-8.
-Wed Jul 11 23:38:14 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * win32/win32.c (rb_w32_sysinit, cmdglob, w32_cmdvector): convert
+ wide char command line to UTF-8 argv, and glob in UTF-8 so that
+ metacharacters would match multibyte characters.
+ [ruby-dev:48752] [Bug #10555]
- * random.c: documentation fix. srand(0) initializes PRNG with '0',
- not with random_seed.
+Sat Nov 29 10:49:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 10 14:50:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (win32_direct_conv, rb_w32_readdir): convert UTF-8
+ and filesystem code page by using Win32 API directly.
- * bcc32/{Makefile.sub,setup.mak}: remove surplus slash from srcdir.
+Sat Nov 29 09:37:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 6 15:22:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (syserr_initialize): simplify message building and get
+ rid of potential invalid byte sequence.
- * eval.c (rb_interrupt): suppress a gcc's officious warning.
+Sat Nov 29 06:09:44 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Jul 5 16:44:28 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * eval_error.c (error_print): respect the encoding of the message.
- * numeric.c (int_pow): fix previous nubu's commit.
+ * io.c (rb_write_error_str): use rb_w32_write_console() on Windows
+ if stderr is a tty.
- * test/ruby/test_fixnum.rb: new test.
+Fri Nov 28 05:10:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 5 15:56:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (--with-setup): add option to select ext/Setup file.
- * numeric.c (int_pow): even number multiplication never be negative.
+Fri Nov 28 05:02:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 2 14:34:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dmyenc.c (Init_enc): separate from dmyext.c for statically
+ linked extension excluding encoding libraries.
- * sprintf.c (rb_f_sprintf): sign bit extension should not be done
- if FPLUS flag is specified. [ruby-list:39224]
+Thu Nov 27 21:58:30 2014 Tanaka Akira <akr@fsij.org>
-Sat Jun 30 16:05:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk (miniprelude.c): It does not depend on prelude.rb now.
- * array.c (rb_ary_initialize): should call rb_ary_modify() first.
- [ruby-core:11562]
+Thu Nov 27 21:49:49 2014 Tanaka Akira <akr@fsij.org>
-Sat Jun 30 00:17:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/update-deps: List up files built always in the source directory
+ and source files built always in the build directory.
- * parse.y (yylex): return non-valid token for an invalid
- instance/class variable name. a patch from Yusuke ENDOH
- <mame AT tsg.ne.jp>. [ruby-dev:31095]
+Thu Nov 27 21:24:55 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Fri Jun 29 11:23:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: add obsolete callcc.
- * parse.y (dsym): return non-null NODE even if yyerror(). based on a
- patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:31085]
+Thu Nov 27 19:59:49 2014 Koichi Sasada <ko1@atdot.net>
-Tue Jun 26 16:35:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (iseq_compile_each): remove duplicated line event.
+ [Bug #10449]
- * process.c (ruby_setreuid, ruby_setregid): rename to get rid of name
- clash.
+ * test/ruby/test_settracefunc.rb: add and fix tests.
- * process.c (proc_exec_v, rb_proc_exec): preserve errno.
+Thu Nov 27 19:04:50 2014 Koichi Sasada <ko1@atdot.net>
-Sat Jun 23 00:37:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_args.c: fix backtrace location for keyword related exceptions.
- * hash.c (rb_hash_select): remove unnecessary varargs for
- rb_hash_select. a patch from Daniel Berger
- <Daniel.Berger at qwest.com>. [ruby-core:11527]
+ For example, the following program
+ def foo(k1: 1); end # line 1
+ foo(k2: 2) # line 2
+ causes "unknown keyword: k2 (ArgumentError)".
- * hash.c: ditto.
+ Before this patch, the backtrace location is only line 2.
+ However, error should be located at line 1 (over line 2 in
+ stack trace). This patch fix this problem.
-Mon Jun 18 08:47:54 2007 Technorama Ltd. <oss-ruby@technorama.net>
+ * class.c (rb_keyword_error_new): separate exception creation logic
+ from rb_keyword_error(), to use in vm_args.c.
- * ext/openssl/{extconf.rb,ossl_ssl_session.c}:
- Fix ruby-Bugs-11513.
+ * vm_insnhelper.c (rb_arg_error_new): rename to rb_arity_error_new().
- * ext/openssl/ossl_pkey_ec.c
- New methods EC::Point.[eql,make_affine!,invert!,on_curve?,infinity?]
- By default output the same key form as the openssl command.
+ * vm_args.c (argument_arity_error): rename to argument_arity_error().
- * ext/openssl/ossl_rand.c
- New method Random.status?
+ * vm_args.c (argument_kw_error): added to fix backtrace.
-Mon Jun 18 13:54:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_keyword.rb: add tests.
- * eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
- in at_exit blocks. [ruby-core:11263]
+Thu Nov 27 17:31:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 18 01:14:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (prelude.c): no longer depends on miniruby, since not
+ depending on rbconfig.rb.
- * variable.c (rb_path2class): get rid of dangling pointer caused by
- optimized out value.
+Thu Nov 27 17:12:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * variable.c (rb_global_entry, rb_f_untrace_var, rb_alias_variable,
- rb_generic_ivar_table, generic_ivar_get, generic_ivar_set,
- generic_ivar_defined, generic_ivar_remove, rb_mark_generic_ivar,
- rb_free_generic_ivar, rb_copy_generic_ivar,
- rb_obj_instance_variables): suppress warnings.
+ * common.mk (miniprelude.c): miniruby needs no preludes.
-Fri Jun 15 22:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 27 17:10:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (realclean): separate local and ext.
+ * template/prelude.c.tmpl: no code if no prelude code is given.
- * ext/extmk.rb: not remove unrelated directories.
+Thu Nov 27 13:11:00 2014 Koichi Sasada <ko1@atdot.net>
-Fri Jun 15 17:01:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (objspace_malloc_increase): enable lazy sweep on GC by malloc()
+ (malloc_increase) to make GC incrementally.
- * ext/dl/lib/dl/win32.rb: seems that dl doesn't accept void argument.
- fixed [ruby-bugs:PR#5489].
+ This change can increase memory consumption. Report us if you find
+ any problem.
-Thu Jun 14 17:09:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 27 12:46:38 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser): handle more
- extensions. [ruby-dev:30972]
+ * time.c (time_s_mkutc): [DOC] Time.utc's 10 arguments form
+ doesn't examine wday, yday, isdst and tz.
+ (time_s_mktime): [DOC] Time.mktime's 10 arguments form
+ doesn't examine wday, yday and tz.
+ Suggested by naruse.
-Wed Jun 13 06:05:12 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 27 11:45:33 2014 Eric Wong <e@80x24.org>
- * configure.in (darwin): prohibit loading extension libraries to
- miniruby.
+ * iseq.c (iseq_data_to_ary): add missing GC guard
-Wed Jun 13 05:47:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 27 10:51:59 2014 Koichi Sasada <ko1@atdot.net>
- * eval.c (rb_kill_thread): renamed in order to get rid of conflict
- with a BeOS system function. [ruby-core:10830]
+ * vm_core.h: add rb_thread_t::local_storage_recursive_hash
+ to speed up Thread#[:__recursive_key__] access.
+ [Bug #10511]
-Tue Jun 12 14:53:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (threadptr_local_aref): add fast path for
+ :__recursive_data__.
- * lib/mkmf.rb (Logging.quiet, Logging.message): added quiet flag and
- use it. [ruby-core:10909]
+ * thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set):
+ add special accessor for recursive hash.
- * lib/mkmf.rb (find_header): use header names in the message.
+ * cont.c: store/restore local_storage_recursive_hash.
-Sun Jun 10 13:47:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c: init and mark local_storage_recursive_hash.
- * test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
- get rid of invoking shell. [ruby-dev:30942]
+ * vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore
+ local_storage_recursive_hash directly.
-Thu Jun 7 19:02:48 2007 Tanaka Akira <akr@fsij.org>
+Thu Nov 27 07:11:00 2014 Eric Wong <e@80x24.org>
- * lib/pp.rb: call original "method" method instead of redefined one.
+ * compile.c (iseq_calc_param_size): hoist out of iseq_set_arguments
-Mon Jun 4 11:11:12 2007 Shugo Maeda <shugo@ruby-lang.org>
+Wed Nov 26 22:28:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/imap.rb (ResponseParser#next_token): fixed
- error message. (backported from HEAD)
+ * include/ruby/ruby.h (rb_get_kwargs, rb_extract_keywords): export
+ keyword argument functions.
- * lib/net/imap.rb (ResponseParser#parse_error): fixed
- the condition not to refer @token.symbol unexpectedly.
- Thanks, Dick Monahan. (backported from HEAD)
+Wed Nov 26 21:18:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu May 31 17:27:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/inlinetest.rb: removed unused test helper.
- * lib/benchmark.rb (Benchmark::Job::item): avoid modifying the
- argument unintentionally. [ruby-talk:253676]
+Wed Nov 26 20:47:28 2014 Masaya Tarui <tarui@ruby-lang.org>
-Thu May 31 02:12:32 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/continuation/continuation.c (Init_continuation): obsolete callcc.
+ first step of [Feature #10548].
- * lib/rinda/tuplespace.rb (Rinda::TupleBag): create index on tuple bag
- by first column.
+Wed Nov 26 19:57:54 2014 Koichi Sasada <ko1@atdot.net>
-Wed May 30 13:27:40 2007 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_gc.rb (test_latest_gc_info): do test separately
+ to avoid mysterious behavior.
- * lib/net/ftp.rb (Net::FTP#transfercmd): skip 2XX
- responses for some FTP servers. (backported from HEAD)
+Wed Nov 26 19:54:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 30 05:17:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (constat_reset): do nothing on non-standard
+ console emulators. [ruby-core:66471] [Bug #10546]
- * eval.c (rb_eval): get rid of SEGV at ZSUPER in a block
- [ruby-dev:30836]
+Wed Nov 26 19:44:13 2014 Tanaka Akira <akr@fsij.org>
-Wed May 30 04:29:43 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tsort.rb: Returns an enumerator if no block is given.
+ [ruby-core:66270] [Feature #10508] Proposed by Andrey Savchenko.
- * eval.c (thread_timer): timer thread should not receive any
- signals. submitted by Sylvain Joyeux. [ruby-core:08546]
+Wed Nov 26 17:25:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 30 04:18:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (f_label, f_kw, formal_argument_gen): ignore invalid
+ formal argument in keyword argument definition.
+ [ruby-dev:48742] [Bug #10545]
- * eval.c (rb_eval_cmd): just return if no exceptions.
- [ruby-dev:30820]
+Wed Nov 26 15:32:06 2014 Koichi Sasada <ko1@atdot.net>
-Tue May 29 11:01:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (iseq_set_sequence): use "nop" insn instead of
+ "jump to next insn".
+ https://bugs.ruby-lang.org/issues/8543#change-50085
- * win32/win32.c (rb_w32_opendir): store attributes of the second
- entries or later too.
+Wed Nov 26 11:01:35 2014 Eric Wong <e@80x24.org>
- * win32/win32.c (rb_w32_opendir, rb_w32_readdir): eliminate magic
- numbers.
+ * iseq.c (iseq_s_compile_file): close IO when done
-Mon May 28 02:54:05 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Nov 26 06:06:23 2014 Tanaka Akira <akr@fsij.org>
- * lib/rinda/tuplespace.rb (Rinda::TupleBag#delete): use rindex and
- delete_at instead of delete for little improvement.
+ * common.mk: encdb.h and transdb.h depends on $(PREP).
+ So prebuild files for them in tarball are useless.
-Sat May 26 00:05:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 26 02:08:44 2014 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
- skip tests for exitstatus and termsig on the platforms where
- signals not supported.
+ * tool/make-snapshot: Don't generate enc/trans/newline.c in tarball.
-Wed May 23 06:51:46 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+Wed Nov 26 00:41:44 2014 Tanaka Akira <akr@fsij.org>
- * lib/cgi.rb (CGI#[]): get rid of exceptions being raised.
- [ruby-dev:30740], Thanks Kentaro KAWAMOTO.
+ * common.mk (prereq): Don't depends on prelude.c and golf_prelude.c.
+ Since they depend on $(PREP) which is miniruby, they are rebuilt
+ after miniruby is built, even if tarball contains them.
-Wed May 23 05:49:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 26 00:20:48 2014 Tanaka Akira <akr@fsij.org>
- * ext/extmk.rb, ext/purelib.rb, lib/mkmf.rb, runruby.rb: clear default
- load path to get rid of load pre-installed extensions/libraries.
- [ruby-core:11017]
+ * template/prelude.c.tmpl: Don't expand RbConfig::Config[...].
+ It is not used now.
-Sat May 19 10:29:18 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * common.mk: prelude.c and golf_prelude.c doesn't depend on rbconfig.
- * lib/date/format.rb (Date._parse): detects some OFX dates
- (Of course not fully).
+Tue Nov 25 17:07:06 2014 Koichi Sasada <ko1@atdot.net>
-Fri May 18 23:07:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * NEWS: add an "Implementation changes" section.
- * array.c (rb_ary_first): call rb_ary_subseq() instead of pushing
- values by itself. [ruby-talk:252062]
+Tue Nov 25 16:09:28 2014 Eric Hodel <drbrain@segment7.net>
- * array.c (rb_ary_first): add negative length check.
+ * lib/net/http.rb: Do not attempt SSL session resumption when the
+ session is expired. [Bug #10533]
-Fri May 18 17:10:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 25 15:59:46 2014 Eric Hodel <drbrain@segment7.net>
- * win32/win32.c (move_to_next_entry): loc also must move forward.
- [ruby-talk:251987]
+ * lib/rake: Update to rake 10.4.0
+ * test/rake: ditto.
+ * NEWS: ditto.
-Fri May 18 03:02:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/lib/minitest/unit.rb: Add compatibility shim for minitest 5.
+ This only provides minitest 5 unit test naming compatibility.
- * win32/mkexports.rb: preserve prefixed underscores for WINAPI
- symbols.
+Tue Nov 25 15:26:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * wince/mkconfig_wce.rb, wince/mkexports.rb: obsolete.
+ * tool/vcs.rb (get_revisions): use Time.new instead of Time.mktime
+ which does not accept UTC offset, and offset manually for older
+ versions than 1.9.
-Thu May 17 17:03:11 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 25 12:14:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * misc/ruby-style.el (ruby-style-label-indent): for yacc rules.
+ * process.c (Init_process): initialize static IDs before constant
+ definitions. [ruby-core:66445]
-Tue May 15 14:54:07 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 25 10:32:23 2014 Eric Wong <e@80x24.org>
- * win32/win32.c (init_stdhandle): stderr should be without buffering,
- but mswin32 use buffering when stderr is not connected to tty.
+ * compile.c (iseq_build_callinfo_from_hash): hoist out
+ (iseq_build_from_ary_body): shorten callinfo case
-Mon May 14 13:28:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 24 23:03:21 2014 Kouhei Sutou <kou@cozmixng.org>
- * ext/thread/thread.c (wait_list): supress a warning.
+ * gems/bundled_gems: Update to test-unit 3.0.7.
-Thu May 10 15:21:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Nov 24 12:44:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/iconv.c (iconv_s_conv): rdoc fix.
+ * process.c (check_exec_redirect_fd, check_exec_redirect),
+ (rb_execarg_addopt): get rid of inadvertent ID pindown.
-Thu May 10 10:14:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 24 02:03:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_thread_priority): rdoc fix; the initial value is
- inherited from the creating thread. [ruby-core:10607]
+ * string.c (rb_str_setter): preserve encoding of global variable
+ name in error message.
-Wed May 9 12:28:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 24 02:03:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv as
- aliases of quo. [ruby-dev:30771]
+ * iseq.c (rb_insn_operand_intern): preserve encoding of method
+ name in CALL_INFO at disassembling.
-Wed May 9 11:55:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 24 02:02:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bignum.c (rb_big_quo): now calculate in integer. [ruby-dev:30753]
+ * io.c (must_respond_to): preserve encodings of variable name and
+ class name in warning message.
-Wed May 9 11:51:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 23 10:46:23 2014 Eric Wong <e@80x24.org>
- * bignum.c (rb_big_pow): reduce multiplying for even number.
+ * internal.h (struct rb_execarg): 160 => 144 bytes on x86-64
+ * ruby.c (struct load_file_arg): 48 => 40 bytes on x86-64
+ * vm_args.c (struct args_info): ditto
- * bignum.c (rb_big_pow): truncate all zero BDIGITs. [ruby-dev:30733]
+Sun Nov 23 07:46:54 2014 Andy Maloney <asmaloney@gmail.com>
- * bignum.c (rb_big_pow): improvement by calculating from MSB and using
- factorization. <http://yowaken.dip.jp/tdiary/20070426.html#p01>
+ * io.c (rb_io_sysread): Remove redundant assignment of 'n'.
+ [Fix GH-767]
- * numeric.c (int_pow): calculate power in Fixnum as possible.
- [ruby-dev:30726]
+Sat Nov 22 09:48:33 2014 Tanaka Akira <akr@fsij.org>
-Tue May 8 23:42:51 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * tool/make-snapshot: Specify PWD macro for make.
+ PWD environment variable may not exist.
- * lib/date/format.rb (Date._parse): revised treatment of
- hyphened/separatorless dates.
+Fri Nov 21 11:58:58 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/date/format.rb: some trivial adjustments.
+ * lib/resolv.rb: fall back if canonicalization fails.
+ Thanks Vit Ondruch for the patch! [ruby-core:65836]
-Tue May 8 20:25:05 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/resolv/test_dns.rb: test for patch
- * lib/date/format.rb: reverted.
+Sat Nov 22 01:11:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 5 16:26:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (rb_mod_const_get, rb_mod_const_defined): ditto.
- * lib/date/format.rb (Format::Bag#method_missing): get rid of
- modifying orginal argument. [ruby-core:11090]
+ * variable.c (rb_const_missing, rb_mod_const_missing): call
+ const_missing without new ID to get rid of inadvertent ID
+ creation.
-Mon Apr 30 01:17:51 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Fri Nov 21 19:32:57 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rinda/tuplespace.rb (TupleSpace#create_entry, TupleBag#push,
- delete): extract method, and rename parameter.
+ * common.mk (ext/ripper/ripper.c): revert about srcdir and top_srcdir.
-Fri Apr 27 02:00:17 2007 Ryan Davis <ryand-ruby@zenspider.com>
+ * common.mk (ext/ripper/ripper.c): use $(PWD) for Unix,
+ $(MAKEDIR) for Windows.
- * signal.c: Fixed backwards compatibility for 'raise Interrupt'.
+Fri Nov 21 18:12:37 2014 Tanaka Akira <akr@fsij.org>
- * lib/yaml/tag.rb: Running rdoc over the 1.8.6 tree skips
- Module. Patch from James Britt
+ * tool/update-deps: Refactored.
-Thu Apr 26 13:54:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 21 14:25:40 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * misc/ruby-style.el: new file. C/C++ style for ruby source code.
+ * win32/Makefile.sub (top_srcdir): added because lacking this macro
+ causes build error at r48526.
-Wed Apr 25 19:49:16 2007 Tanaka Akira <akr@fsij.org>
+Fri Nov 21 12:00:58 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (unix_send_io, unix_recv_io): use CMSG_DATA to
- align file descriptor appropriately.
+ * tool/update-deps (in_makefile): Use FILES_NEED_VPATH and
+ FILES_CONFUSING.
-Tue Apr 24 09:33:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/extconf.rb: Add VPATH for id.h
- * dir.c (do_stat, do_lstat, do_opendir): should not warn ENOTDIR.
- [ruby-talk:248288]
+Fri Nov 21 09:10:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 23 22:14:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (ext/ripper/ripper.c): fix dependencies for the case
+ to make ripper.y and id.h under the build directory.
- * ext/extmk.rb ($ruby): add extout directory to include path.
- [ruby-core:11003]
+Fri Nov 21 08:42:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (libpathflag): not to append RPATHFLAG to current
+ * common.mk (ext/ripper/ripper.c): id.h in VPATH may exist in the build
directory.
- * lib/mkmf.rb (init_mkmf): add current directory to default
- library path with highest priority. [ruby-core:10960]
-
- * lib/mkmf.rb (LINK_SO): LIBPATH to be placed before DLDFLAGS.
-
-Fri Apr 20 16:05:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (LIBPATHFLAG, RPATHFLAG): no needs to be quoted,
- it is done by libpathflag in mkmf.rb.
-
-Fri Apr 20 12:27:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb: fix to override conv proc.
-
-Fri Apr 20 12:17:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): inversed the order of errinfos.
-
-Thu Apr 19 14:53:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/monitor.rb (ConditionVariable#wait, mon_enter, mon_exit_for_cond):
- ensures Thread.critical to be false. [ruby-talk:248300]
-
-Wed Apr 18 10:41:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (ext/ripper/ripper.c): $(RM) was not defined.
- * util.c (ruby_strtod): exponent is radix 10. [ruby-talk:248272]
+Fri Nov 21 00:36:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Apr 18 02:30:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/x509.rb
+ (OpenSSL::X509::Name::RFC2253DN::StringChar): get rid of a false
+ positive assertion in ripper's test.
- * configure.in (LDFLAGS): prepend -L. instead appending it to
- XLDFLAGS. [ruby-core:10933]
+Fri Nov 21 00:29:51 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (Makefile): remove $U for automake from MISSING.
- [ruby-talk:248171]
+ * lib/net/imap.rb (Net::IMAP::ResponseParser::BEG_REGEXP): no need to
+ use embed string.
-Tue Apr 17 16:46:46 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 21 00:19:17 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_yield_0): should not clear state on TAG_NEXT when
- it's invoked from within lambda body. [ruby-talk:248136]
+ * lib/uri/mailto.rb (URI::MailTo::EMAIL_REGEXP): should escape `#`.
- * eval.c (proc_invoke): handle TAG_NEXT which would be caused by
- next in the lambda body as well.
+Thu Nov 20 23:17:11 2014 Tanaka Akira <akr@fsij.org>
-Mon Apr 16 22:56:01 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/update-deps: Insert all dependencies found by compiler.
- * ext/pty/expect_sample.rb: avoid symbolic link representation for
- expect. a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>.
- [ruby-dev:30714]
+Thu Nov 20 15:51:01 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Apr 16 22:51:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/nkf/depend (nkf.o): add nkf.c as dependency.
+ bsdmake tries to make nkf.o with nkf-utf8/nkf.c without this.
- * sample: replace TRUE, FALSE with true, false respectively.
- a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>.
- [ruby-dev:30713]
+Thu Nov 20 08:54:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 16 17:08:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (struct parser_params): reduce size by reordering
+ members and an unused member.
- * lib/optparse.rb (make_switch): do not clobber converter if pattern
- has no convert method. reported by sheepman in [ruby-dev:30709].
+Thu Nov 20 02:44:27 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Apr 16 16:49:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/matrix.rb: Vector#independent? and associated class method
+ patch by gogo tanaka [#10451]
- * ext/stringio/stringio.c (strio_seek): consistent behavior with
- IO#seek. patch by sheepman in [ruby-dev:30710].
+Thu Nov 20 02:32:34 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Apr 16 16:34:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/matrix.rb: Add Vector#angle_with
+ Patch by Egunov Dmitriy [#10442]
- * parse.y (parser_yylex): should set command_start after block
- starting "do"s and braces. [ruby-core:10916]
+Thu Nov 20 02:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Apr 15 09:19:57 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * parse.y (ripper_flush_string_content, parser_parse_string):
+ preserve parsed string content. [ruby-dev:48714] [Bug #10437]
- * lib/date/format.rb: added some zone names.
+ * parse.y (ripper_new_yylval): abstract function to create ripper
+ wrapper, and make it able to hold another object.
- * lib/date/format.rb (_parse): now interprets doted numerical
- dates as a big endian (except dd.mm.yyyy).
+Thu Nov 20 01:00:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 10 17:37:36 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (reg_named_capture_assign_gen): use predefined ID
+ instead of rb_intern.
- * win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
- before calling original fclose()/close().
+Thu Nov 20 00:54:57 2014 Tanaka Akira <akr@fsij.org>
-Mon Apr 9 09:30:44 2007 Shugo Maeda <shugo@ruby-lang.org>
+ * internal.h (ruby_init_setproctitle): Declare here.
- * lib/net/imap.rb (disconnect): call shutdown for
- SSLSocket. Thanks, Technorama Ltd.
+Thu Nov 20 00:26:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 5 00:42:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_notimplement), io.c (pipe_open): removed definite
- articles and UNIX manual section from messages. [ruby-dev:30690]
-
-Wed Apr 4 17:09:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): refined the message of NotImplementedError.
- [ruby-dev:30685]
-
-Wed Apr 4 10:18:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (pipe_open): raise NotImplementedError for command "-" on
- platforms where fork(2) is not available. [ruby-dev:30681]
-
-Tue Apr 3 15:45:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
- windows) doesn't set fromlen if the socket is connection-oriented.
- reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061]
-
-Sat Mar 24 23:40:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.h (struct rb_thread.locals): explicit as struct.
- [ruby-core:10585]
-
- * eval.c, node.h (enum rb_thread_status, struct rb_thread,
- rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586]
-
- * file.c (chompdirsep): made an unprefixed name static.
-
- * io.c (io_fread): ditto.
-
-Sat Mar 24 01:54:03 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): exit by SystemExit and SignalException in END
- block. [ruby-core:10609]
-
- * test/ruby/test_beginendblock.rb (test_should_propagate_exit_code):
- test for exit in END block. [ruby-core:10760]
-
- * test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
- test for signal in END block.
-
-Thu Mar 22 23:13:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_provided): check for extension library if SOEXT is
- explicitly given. [ruby-dev:30657]
-
-Thu Mar 22 10:29:25 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_bignum.rb (test_to_s): add tests for Bignum#to_s.
-
-Wed Mar 21 17:04:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big2str0): round up for the most significant digit.
- [ruby-core:10686]
-
-Wed Mar 21 07:21:24 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (remove_one): Preserve List invariants;
- submitted by: MenTaLguY <mental AT rydia.net>
- in [ruby-core:10598] and [ruby-bugs:PR#9388].
-
-Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_extended): erroneous check condition when dump
- method is defined. [ruby-core:10646]
-
-Tue Mar 20 15:37:24 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * distruby.rb: Add zip generation.
-
-Tue Mar 20 11:28:41 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/matrix.rb (Matrix::inverse_from): adding partial pivoting to
- the Gauss-Jordan algorithm, making it stable. a patch from
- Peter Vanbroekhoven. [ruby-core:10641]
-
-Mon Mar 19 11:39:29 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/protocol.rb (rbuf_read): extend buffer size for speed.
-
-Sun Mar 18 04:23:52 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: Add a note about the new `date' library defining
- Time#to_date and Time#to_datetime private methods.
-
- * NEWS: Inform that the old `thread' library is considered to be
- stable.
-
- * NEWS: Sort library entries in alphabetical order.
-
-Fri Mar 16 21:48:11 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dl/dl.c (rb_ary2cary): Fix a bug in type validation;
- submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
- in [ruby-dev:30554].
-
-Fri Mar 16 18:28:06 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/etc/etc.c (etc_getgrgid): Fix a bug in Etc::getgrgid()
- always returning the (real) group entry of the running process;
- reported by: UEDA Hiroyuki <ueda AT netforest.ad.jp>
- in [ruby-dev:30586].
-
-Fri Mar 16 16:33:58 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (unlock_mutex_inner): Make sure that the
- given mutex is actually owned by the caller; submitted by:
- Sylvain Joyeux <sylvain.joyeux AT m4x.org> in [ruby-core:10598].
-
-Fri Mar 16 16:21:35 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (wait_condvar, lock_mutex): Fix a problem in
- ConditionVariable#wait that occurs when two threads that are
- trying to access the condition variable are also in concurrence
- for the given mutex; submitted by: Sylvain Joyeux
- <sylvain.joyeux AT m4x.org> and MenTaLguY <mental AT rydia.net>
- in [ruby-core:10598].
-
-Fri Mar 16 16:17:27 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * test/thread/test_thread.rb: Add a test script for the `thread'
- library. This should result in failure as of now with
- ext/thread; submitted by: Sylvain Joyeux <sylvain.joyeux AT
- m4x.org> in [ruby-core:10598].
-
-Wed Mar 14 12:30:00 2007 Shigeo Kobayashi <shigeo@tinyforest.jp>
-
- * ext/bigdecimal/bigdecimal.c: BigDecimal("-.31") is now
- treated as ("-0.31") not as ("0.31").
-
-Tue Mar 13 09:25:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (clear-installed-list): separated from install-prereq.
-
-Tue Mar 13 06:38:43 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: Reword and improve entries.
-
-Tue Mar 13 06:03:46 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * stable version 1.8.6 released from the ruby_1_8_6 branch.
-
-Tue Mar 13 03:24:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * runruby.rb: added --pure (turned on by default) and --debugger
- options.
-
-Tue Mar 13 02:50:28 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/cgi.rb (CGI::header): IIS >= 5.0 does not need the nph
- assumption any more; submitted by MIYASAKA Masaru <alkaid AT
- coral.ocn.ne.jp> in [ruby-dev:30537].
-
-Mon Mar 12 11:07:44 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/openssl/ossl_asn1.c (Init_ossl_asn1): Let rdoc know about
- externally defined modules; submitted by Technorama
- Ltd. <oss-ruby AT technorama.net> in [ruby-bugs:PR#4704].
-
- * ext/openssl/ossl_bn.c (Init_ossl_bn): Ditto.
-
- * ext/openssl/ossl_cipher.c (Init_ossl_cipher): Ditto.
-
- * ext/openssl/ossl_digest.c (Init_ossl_digest): Ditto.
-
- * ext/openssl/ossl_hmac.c (Init_ossl_hmac): Ditto.
-
- * ext/openssl/ossl_pkey.c (Init_ossl_pkey): Ditto.
-
- * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): Ditto.
-
- * ext/openssl/ossl_pkey_dsa.c (Init_ossl_dsa): Ditto.
-
- * ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): Ditto.
-
- * ext/openssl/ossl_rand.c (Init_ossl_rand): Ditto.
-
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Ditto.
-
-Mon Mar 12 01:05:17 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dl/sym.c (rb_dlsym_inspect): Use "0x%x" rather for pointers.
- This might not be very right but it is commonly used in other
- parts of the code; submitted by sheepman <sheepman AT
- sheepman.sakura.ne.jp> in [ruby-dev:30532].
-
- * ext/dl/ptr.c (rb_dlptr_inspect): Ditto.
-
-Mon Mar 12 00:59:19 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dl/lib/dl/import.rb (DL::Importable::Internal::import,
- DL::Importable::Internal::callback): Avoid race condition for an
- instance variable; submitted by sheepman <sheepman AT
- sheepman.sakura.ne.jp> in [ruby-dev:30530].
-
-Sun Mar 11 18:57:50 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/README: Add a note about ruby-electric.el.
-
- * misc/ruby-mode.el (ruby-non-block-do-re): Fix
- ruby-non-block-do-re. [ruby-core:03719]
-
- * misc/inf-ruby.el: Synchronize the comment section with trunk.
-
- * misc/README, misc/rdebug.el: Add rdebug.el, Emacs ruby-debug
- interface based on rubydb3x.el; submitted by Martin Nordholts
- <enselic AT gmail.com> in [ruby-bugs:PR#9023].
-
-Sun Mar 11 17:45:51 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/dl/mkcallback.rb (mkfunc): Make sure that a callback
- function is found in the function table before trying to call
- it; submitted by sheepman <sheepman AT sheepman.sakura.ne.jp>
- in [ruby-dev:30524].
-
-Sun Mar 11 12:09:37 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (error_handle): no message when exiting by signal.
-
- * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]
-
- * eval.c (rb_thread_interrupt): instantiate SignalException.
-
- * eval.c (rb_thread_signal_raise): now takes signal number instead
- of signal name.
-
- * intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.
-
- * signal.c (esignal_init): takes a signal number and an optional
- signal name.
-
- * signal.c (interrupt_init): pass SIGINT always.
-
- * signal.c (ruby_default_signal): invoke system default signal
- handler.
-
- * signal.c (rb_signal_exec, trap): handle SIGTERM. [ruby-dev:30505]
-
-Tue Mar 6 19:08:46 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Do not modify
- Digest::MD5.
-
- * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto.
-
-Tue Mar 6 18:58:37 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/shell/process-controller.rb: fix thread synchronization
- problem for [ruby-dev:30477].
-
-Tue Mar 6 18:44:26 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/md5.rb (MD5::new, MD5::md5): Catch up with
- Digest's API changes; noted by: Kazuhiro Yoshida <moriq AT
- moriq.com> in [ruby-dev:30500].
-
- * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto.
-
-Tue Mar 6 18:24:19 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * time.c (time_to_s): Back out the format changes; discussed
- in [ruby-dev:30495].
-
-Tue Mar 6 11:53:25 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/sample/irbtkw.rbw: fails to exit process.
-
-Mon Mar 5 20:14:49 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * time.c (time_to_s): Correct the wrong format which did not
- really conform to RFC 2822; pointed out by: OHARA Shigeki <os at
- iij.ad.jp> in [ruby-dev:30487].
-
-Sun Mar 4 23:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_stat_s_utime): fixed a commit miss for the platforms
- where utimes() does not exist.
-
- * lib/fileutils.rb (touch): ditto.
-
-Sun Mar 4 14:46:56 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * util.c (push_element): should return a int value.
-
-Sun Mar 4 01:05:57 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#^, Set#&): Correct documentation. Those methods
- return sets, not arrays; noted by Oliver Frank Wittich <nietz AT
- mangabrain.de>.
-
-Sat Mar 3 23:01:07 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (mv): could not move a directory between
- different filesystems. [ruby-dev:30411]
-
-Sat Mar 3 22:57:11 2007 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (touch): last commit causes error if :mtime
- option was not given.
-
-Sat Mar 3 22:37:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_utime): allow nil to set the current time.
-
- * lib/fileutils.rb (touch): ditto, and added :mtime and :nocreate
- options. fixed: [ruby-talk:219037]
-
-Sat Mar 3 21:17:35 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * eval.c (stack_check): Unset inline to fix build with GCC 3.4.6;
- submitted by: NISHIMATSU Takeshi <t_nissie AT yahoo.co.jp> in
- [ruby-list:43218].
- cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24556
-
-Sat Mar 3 19:05:31 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (push_list): Use ALLOC().
-
- * ext/thread/thread.c (rb_mutex_alloc): Ditto.
-
- * ext/thread/thread.c (rb_condvar_alloc): Ditto.
-
-Sat Mar 3 18:53:11 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: Add a note for String#intern.
-
-Sat Mar 3 16:23:13 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * env.h (SCOPE_CLONE): Introduce a new scope flag to prevent a
- local_tbl region from getting freed many times; submitted by
- Chikanaga Tomoyuki <chikanag AT nippon-control-system.co.jp> in
- [ruby-dev:30460].
-
- * eval.c (proc_invoke): Ditto.
-
- * gc.c (obj_free): Ditto.
-
- * parse.y (top_local_setup_gen): Ditto.
-
-Sat Mar 3 16:07:02 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * object.c (rb_obj_ivar_set): RDoc updated according to a
- suggestion from Brian Candler <B.Candler AT pobox.com>.
- [ruby-core:10469]
-
-Thu Mar 1 21:38:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt, arg): should not omit lhs of OP_ASGN1 even if
- empty. [ruby-dev:30455]
-
-Thu Mar 1 08:55:38 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_feature_p): check loading_tbl if the given ext is
- empty. [ruby-dev:30452]
-
- * eval.c (rb_feature_p): fix possible buffer overrun.
-
-Thu Mar 1 03:30:21 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/digest.c (get_digest_base_metadata): Allow inheriting
- Digest::Base subclasses, which was unintentionally made
- impossible while restructuring Digest classes.
-
-Thu Mar 1 02:05:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * mkconfig.rb (patchlevel): read from version.h.
-
-Thu Mar 1 00:09:39 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_provided): return true only for features loaded from
- .rb files, and not search actual library type. [ruby-dev:30414]
-
-Wed Feb 28 21:15:00 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (ac_cv_func_fcntl): fcntl support for MinGW.
-
- * missing/flock.c: workaround for MinGW.
-
-Wed Feb 28 20:51:32 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * pack.c (pack_unpack): properly ignore non-base64 octets such as
- UTF-8 encoded BOMs; submitted by SOUMA Yutaka <holon@radastery.jp>
- to fix [ruby-core:10437]
-
-Wed Feb 28 18:59:57 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: Add NEWS, a document file to keep user visible feature
- changes between releases.
-
-Wed Feb 28 18:35:50 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/extconf.rb: no need to check unistd.h and sys/time.h.
- they are already checked at configure.
- reported by KOBAYASHI Yasuhiro [ruby-list:43225]
-
-Wed Feb 28 18:34:48 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb ($DEFLIBPATH): default library paths ($(topdir), etc)
- should be the first elements of library paths list.
- reported by KOBAYASHI Yasuhiro [ruby-list:43225]
-
-Wed Feb 28 18:31:32 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * doc/NEWS-1.8.0: Rename NEWS to NEWS-1.8.0. This is way too old
- NEWS.
-
-Wed Feb 28 01:22:58 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/{dbm,gdbm}/test_{dbm,gdbm}.rb: shouldn't use host_os. use
- target_os instead. reported by KOBAYASHI Yasuhiro [ruby-list:43225]
-
-Wed Feb 28 00:08:11 2007 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
-
- * mkconfig.rb (RbConfig): add CONFIG['PATCHLEVEL']
-
- * common.mk: new target dist
-
- * distruby.rb: new file
-
-Tue Feb 27 22:18:45 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (--enable-auto-image-base): avoid the neccessity to
- rebase the shared libs as much as possible;
- submitted by Corinna Vinschen <spam at vinschen.de> in
- [ruby-talk:240964].
-
-Tue Feb 27 21:36:47 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * util.c (__crt0_glob_function): use ruby_glob() instead of rb_globi().
-
-Tue Feb 27 21:33:04 2007 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (ac_cv_func_setrlimit): workaround for djgpp.
-
-Tue Feb 27 19:38:52 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/base64.rb (Base64::b64encode): Fix documentation; submitted
- by David Symonds <dsymonds@gmail.com> in [ruby-core:10432].
-
-Tue Feb 27 19:36:57 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * regex.c (calculate_must_string, slow_search, re_search): Silence
- warnings regarding char * vs. unsigned char * mismatch;
- submitted by Lyle Johnson <lyle.johnson@gmail.com>
- in [ruby-core:10416].
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Ditto.
-
- * ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto.
-
- * ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto.
-
- * ext/digest/digest.c (rb_digest_base_finish,
- rb_digest_base_update): Ditto.
-
- * ext/nkf/nkf.c (rb_str_resize, rb_nkf_kconv, rb_nkf_guess1,
- rb_nkf_guess2): Ditto.
-
-Tue Feb 27 03:40:09 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (wait_list_cleanup, rb_mutex_try_lock):
- Eliminate rb_thread_critical switching where unnecessary;
- implied by shugo in [ruby-dev:30412].
-
- * ext/thread/thread.c (set_critical): Merge in
- thread_exclusive_ensure().
-
- * ext/thread/thread.c: Consistently use 0 and 1 for
- rb_thread_critical values.
-
-Mon Feb 26 15:18:23 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c: Use xmalloc()/xfree() instead of
- malloc()/free(); pointed out by shugo in [ruby-dev:30412].
-
-Sun Feb 25 23:02:55 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize):
- Initialize @workdir properly to silence a warning under -w.
- Submitted by <tommy at tmtm.org> in [ruby-dev:30400].
-
-Sun Feb 25 02:47:43 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * defines.h: Pull the RUBY_MBCHAR_MAXSIZE definition from trunk,
- which is necessary for dir.c to compile on djgpp and emx.
-
-Sat Feb 24 10:42:01 2007 Minero Aoki <aamine@loveruby.net>
-
- * ext/racc/cparse/cparse.c (cparse_params_mark): remove useless
- rb_gc_mark. Thanks Tomoyuki Chikanaga. [ruby-dev:30405]
-
-Fri Feb 23 15:10:46 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
- workaround. [ruby-core:10259]
-
- * win32/win32.c (NtInitialize): call above function.
-
-Fri Feb 23 14:19:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * signal.c (sighandler): need to tell to be interrupted to main
- context when handler is installed.
-
- * win32/win32.[ch] (rb_win32_interrupted): new function to listen
- interrupt.
-
-Fri Feb 23 13:02:17 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * numeric.c (fix_cmp, fix_equal): Remove FIX2LONG() to optimize.
- suggested in
- http://t-a-w.blogspot.com/2007/02/making-ruby-faster.html.
- [ruby-talk:240223]
-
-Fri Feb 23 12:43:17 2007 James Edward Gray II <james@grayproductions.net>
-
- * lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): Make the
- Content-Length parameter optional for responses in
- xmlrpc/client.rb; suggested by Daniel Berger
- <Daniel.Berger@qwest.com> and approved by the maintainer.
-
- * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Add DateTime
- support to xmlrpc; approved by the maintainer.
-
-Mon Feb 19 18:22:52 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, defines.h, eval.c (rb_feature_p, rb_provided,
- load_wait, search_required, rb_require_safe), ext/extmk.rb: Fix
- a bug where a statically linked extension cannot be autoloaded.
- [ruby-dev:30023] / [ruby-dev:30239]
-
-Mon Feb 19 17:14:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (unix_peeraddr): wrong syscall name in error
- message for #peeraddr. a patch from Sam Roberts
- <sroberts at uniserve.com>. [ruby-core:10366]
-
-Sun Feb 18 19:35:21 2007 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb: updated based on date2 4.0.3.
-
-Fri Feb 16 11:18:21 2007 Eric Hodel <drbrain@segment7.net>
-
- * lib/.document: Apply patch for irb, e2mmap and README by Hugh Sasse
- <hgs at dmu.ac.uk> from [ruby-core:10135]
-
- * lib/prettyprint.rb: Suppress RDoc for PrettyPrint test suite.
-
-Thu Feb 15 20:26:30 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/uri/ftp.rb: Revert the previous change pending discussion.
-
-Thu Feb 15 18:08:17 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * dir.c (glob_helper): Fix the function declaration.
-
-Thu Feb 15 17:13:32 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * version.h: Welcome to the post-1.8.6 world. Radical changes are
- inhibited in the ruby_1_8 branch until the 1.8.6 final release
- goes out of the door.
-
-Thu Feb 15 16:44:14 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/uri/generic.rb (URI::Generic::userinfo): Considering how
- `scheme://user:@...', `scheme://:password@...' and
- `scheme://:@...' are parsed, an empty user name or password
- should be allowed and represented as it is.
-
-Thu Feb 15 11:46:05 2007 KIMURA Koichi <hogemuta@gmail.com>
-
- * dir.c, win32/win32.c, win32/dir.h, ruby.h, intern.h: Bring
- encoding aware globbing support in from trunk. Dir.[] and
- Dir.glob() can now take many patterns in an array. Minor fixes
- will follow.
-
-Thu Feb 15 11:00:26 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/uri/generic.rb (URI::Generic::userinfo): should support
- empty password. [ruby-core:10290]
-
- * lib/uri/generic.rb (URI::Generic::set_password): password can be
- cleared by nil. [ruby-core:10290]
-
- * lib/uri/common.rb (escape): regard second string argument as a
- character set properly. [ruby-dev:27692]
-
- * lib/uri/ftp.rb: Attempt to conform to RFC 1738 with regard to
- relative/absolute paths.
-
- * lib/uri: Lovely RDOC patches from mathew (metaATpoboxDOTcom).
-
-Thu Feb 15 10:57:38 2007 Tietew <tietew@tietew.net>>
-
- * lib/cgi.rb (CGI::unescapeHTML): invalid decoding for single
- unescaped ampersand. a patch from Tietew
- <tietew+ruby-dev at tietew.net> in [ruby-dev:30292].
- fixed: [ruby-dev:30289]
-
-Thu Feb 15 10:48:40 2007 MenTaLguY <mental@rydia.net>
-
- * ext/thread/thread.c: Handle interrupted waits correctly.
- [ruby-bugs:PR#8663]
-
-Wed Feb 14 19:22:15 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/digest/lib/digest.rb (Digest::self.const_missing): Drop
- autoloads for sha2 classes in favor of handling in
- const_missing(), to work around a problem exposed on OS X.
-
-Tue Feb 13 02:21:12 2007 Sam Roberts <sroberts@uniserve.com>
-
- * io.c (rb_f_syscall): Fix buffer overflow with syscall
- arguments. [ruby-bugs:PR#8541]
-
-Sun Feb 11 07:46:45 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): Properly parse
- a quoted-string in a Content-Disposition value.
-
-Sun Feb 11 06:27:54 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * configure.in, ext/thread/extconf.rb, lib/thread.rb: Add a
- configure option `--disable-fastthread', to choose the original,
- pure ruby version of the "thread" library instead of the new,
- much faster implementation in ext/thread.
-
-Sun Feb 11 06:22:20 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/Setup: Add thread except for platforms without threads
- support.
-
-Sun Feb 11 06:15:16 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/lib/thread.rb: Add a replacement of thread.rb that
- loads this extension.
-
-Sun Feb 11 05:39:47 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/thread.rb: Remove an ineffective part of the code.
-
-Sun Feb 11 05:32:54 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c (rb_thread_exclusive): Implement
- Thread.exclusive.
-
-Sun Feb 11 05:26:51 2007 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/thread/thread.c: Get rid of use of a dummy function.
-
-Sun Feb 11 01:45:31 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/thread/thread.c (Init_thread): Define missing aliases:
- Queue#enq and SizedQueue#enq.
-
-Sat Feb 10 09:27:35 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_variant2val): fix compile error
- on VC++.
-
-Sat Feb 10 07:41:52 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_variant2val): fix the bug when
- SAFEARRAY pointer is NULL.
-
-Sat Feb 10 00:13:11 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fix typo (TkConfigMethod::__confinfo_cmd,
- __conv_keyonly_opts).
-
-Fri Feb 9 20:44:53 2007 Akinori MUSHA <knu@iDaemons.org>
+ * parse.y (parser_here_document): append byte sequence directly to
+ the delayed content instead of creating an intermediate string
+ object.
- * ext/thread: Make style fixes (mostly de-K&R'ism) to match the
- rest of the source code.
+Wed Nov 19 21:11:01 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/thread: Make USE_MEM_POOLS an extconf option.
+ * common.mk (ext/json/parser/parser.c): don't touch parse.c,
+ ruby repo is a downstream.
-Fri Feb 9 20:43:01 2007 Akinori MUSHA <knu@iDaemons.org>
+Wed Nov 19 20:38:11 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/thread: Import the "fastthread" implementation by MenTaLguY
- in the original form. This module is not hooked into the build
- yet since it needs some style fixes and adjustments.
+ * common.mk (ext/ripper/ripper.c): use $(PWD) to get
+ <build-directory>/ext/ripper.
-Fri Feb 9 15:46:09 2007 Akinori MUSHA <knu@iDaemons.org>
+Wed Nov 19 18:12:17 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/bigdecimal: Synchronize with trunk. Better function
- prototypes, removal of a useless method `!=', and document
- updates.
+ * tool/downloader.rb (RubyGems.download): Don't download gem if the
+ version is already downloaded. A gem file is versioned and
+ it must be identical if the version is the same.
-Tue Feb 06 22:06:45 2007 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Nov 19 17:59:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/nkf/nkf-utf8/{nkf.c,utf8tbl.c}:
- imported nkf 2007-01-28.
- * Fixed: can't decode MIME encode JIS string.
- * Fixed: Fullwitdh-halfwidth conversion.
- * Support DoCoMo's and Softbank's EMOJI
- * Support CP932, CP5022x, eucJP-ms UDC
- * Support UTF-32 encoding
- * Support beyond BMP
- [ruby-dev:29700] [ruby-dev:29922] [ruby-dev:30144]
+ * common.mk (ext/ripper/ripper.c): pass build directory as VPATH.
-Wed Jan 31 14:52:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/ripper/depend (.y.c): use VPATH for y.tab.c.
- * eval.c (rb_iterate): need to PUSH_ITER in proper order.
- [ruby-core:10125]
+Wed Nov 19 10:07:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_iterator.rb (TestIterator::test_block_given_within_iterator):
- add new test. [ruby-core:10125]
+ * template/prelude.c.tmpl (Prelude#translate): strip VPATH prefix
+ from prelude names, so that srcdir differences do not make the
+ generated code different.
-Tue Jan 30 14:58:51 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 19 07:45:11 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (rb_str_sub_bang): calling rb_str_modify() should be just
- before actually modifying the string.
- fixed: [ruby-dev:30211] (originally reported by zunda)
+ * win32/win32.c (rb_w32_write): should set the error of
+ GetOverlappedResult()'s, not WriteFile()'s (it's always
+ ERROR_IO_PENDING, of course).
-Tue Jan 30 12:05:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 18 14:16:47 2014 Koichi Sasada <ko1@atdot.net>
- * mkconfig.rb: autoconf 2.61 support. [ruby-core:10016]
+ * gc.c (gc_record): add information for debug print.
-Sat Jan 27 15:20:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 19 04:49:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * parse.y (dyna_var_lookup): should not alter dvar->val not to
- destroy living value. [ruby-core:10076]
+ * debug.c (set_debug_option): need the declaration.
- * parse.y (dyna_init): ditto.
+ * debug.c (set_debug_option): use the same macro with the implementation
+ at win32/win32.c.
-Fri Jan 26 12:03:39 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Nov 19 04:16:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb (TkConfigMethod#__confinfo_cmd,
- __conv_keyonly_optkeys): make them private [ruby-dev:30074].
+ * parse.y (symbol_list): fix the node type of literal symbol list
+ with no interpolation. [ruby-core:66343]
- * ext/tk/lib/tk/txtwin_abst.rb: fix typo [ruby-dev:30073].
+Wed Nov 19 00:26:15 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/canvas.rb (TkCanvas#scan_dragto): lack of an argument.
+ * tool/update-deps: Sort dependencies.
- * ext/tk/lib/tk/canvas.rb: clarify the including module name
- [ruby-dev:30080].
+Wed Nov 19 00:24:18 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/scrollable.rb: change primary name of modules
- [ruby-dev:30080].
+ * enc/encdb.c: Include internal.h.
-Wed Jan 24 18:05:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 18 23:23:45 2014 Tanaka Akira <akr@fsij.org>
- * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): fix
- regexp font-lock bug. [ruby-talk:235758]
+ * internal.h: Gather declarations in non-header files.
-Tue Jan 23 11:02:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 18 23:45:52 2014 Tanaka Akira <akr@fsij.org>
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest::read_line):
+ * debug.c (SET_WHEN): Don't declare debug variables here.
+ ruby_initial_gc_stress_ptr is changed int* to VALUE* at r41406.
-Tue Jan 23 18:26:12 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (ruby_initial_gc_stress_ptr): Declared.
+ (ruby_enable_coredump): Ditto.
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): use == instead
- of ===. [ruby-dev:30176]
+Tue Nov 18 18:06:43 2014 Tanaka Akira <akr@fsij.org>
-Tue Jan 23 10:48:17 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system call
+ is not required to split. It was useful to avoid whole process
+ blocking in Ruby 1.8 but not useful since write() is invoked without
+ GVL.
+ (FMODE_WSPLIT_INITIALIZED): Ditto.
- * hash.c: added documentation for Hash about how it uses eql? and
- hash methods for the keys. [ruby-core:09995]
+ * io.c (wsplit_p): Removed.
+ (io_writable_length): Removed.
+ (rb_fcntl): Don't update the removed flags.
-Mon Jan 22 14:57:25 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 18 03:23:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c: fix errors in socket sample code.
- [ruby-core:09992]
+ * object.c (check_setter_id): show the original argument instead
+ of nil on TypeError.
-Sat Jan 13 23:54:48 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Tue Nov 18 03:20:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_free, ole_type_free,
- olemethod_free, olevariable_free, oleparam_free,
- ole_event_free): fix memory leak. [ruby-core:09846]
+ * symbol.h (is_{local,global,instance,attrset,const,class,junk}_sym):
+ fix ID type names.
-Fri Jan 12 11:13:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 17 20:17:59 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/etc/etc.c (etc_getpwuid, etc_getgrgid): fix to correctly
- convert uid/gid from VALUE. (backport of r11521)
+ * ext/win32ole/win32ole_event.c: use typed data.
-Wed Jan 10 18:57:57 2007 Minero Aoki <aamine@loveruby.net>
+Mon Nov 17 12:54:56 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/strscan/strscan.c (strscan_do_scan): should set kcode option
- before match. [ruby-dev:29914]
+ * lib/rubygems/*, test/rubygems/*: Update to RubyGems 2.4.4
+ master (2f6e42e).
- * test/strscan/test_stringscanner.rb: test it.
+Mon Nov 17 06:13:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c: export kcode_set_option and kcode_reset_option (with "rb_"
- prefix).
+ * proc.c (proc_binding): use the original iseq on a binding from
+ proc from method object to get the location.
- * intern.h: ditto.
+Sun Nov 16 19:38:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 9 17:45:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_eval.c (rb_current_receiver): new function to return the
+ receiver in the current control frame. [Feature #10195]
- * file.c (rb_find_file): should not call fpath_check() with NULL.
- fixed: [ruby-core:09867]
+Sun Nov 16 19:11:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/timeout.rb (Timeout::ExitException#exception): rescue
+ UncaughtThrowError which is specific for throw, instead of
+ ArgumentError.
- * string.c (rb_str_upto): String#upto from empty string makes
- inifinite loop. [ruby-core:09864]
+Sun Nov 16 18:22:18 2014 Eric Wong <e@80x24.org>
-Sun Jan 7 12:13:26 2007 Eric Hodel <drbrain@segment7.net>
+ * tool/update-deps: warning to disable ccache
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment):
- Look for class and module comments above rb_define_class and
- rb_define_module. Patch by Daniel Berger <djberg96 at gmail.com>
+Sun Nov 16 13:11:35 2014 Tanaka Akira <akr@fsij.org>
-Sun Jan 7 10:32:12 2007 Eric Hodel <drbrain@segment7.net>
+ * common.mk (CCAN_LIST_INCLUDES): Unused variable removed.
+ (ENCODING_H_INCLUDES): Ditto.
+ (PROBES_H_INCLUDES): Ditto.
+ (VM_CORE_H_INCLUDES): Ditto.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constants):
- Properly handle escaping of : in comments.
- * test/rdoc/parsers/test_parse_c.rb:
- Test RDoc::C_Parser#do_classes and Rdoc::C_Parser#find_class_comment.
+Sun Nov 16 11:07:25 2014 Eric Wong <e@80x24.org>
-Sun Jan 7 09:33:02 2007 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/ruby/test_io.rb (test_readpartial_locktmp):
+ remove unnecessary begin/end
- * lib/date/format.rb: updated based on date2 4.0.1.
+Sun Nov 16 00:45:23 2014 Tanaka Akira <akr@fsij.org>
-Wed Jan 3 11:36:51 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk: Specify dependencies for generated C sources.
- * io.c (ruby_dup): start GC on ENOMEM as well.
+Sat Nov 15 23:10:45 2014 Tanaka Akira <akr@fsij.org>
-Mon Jan 1 06:13:11 2007 Eric Hodel <drbrain@segment7.net>
+ * common.mk: No need to declare dependencies which
+ will be detected by inference rules.
- * lib/rdoc/parsers/c_parser.rb: Make Rdoc accessible. Update constant
- value information.
+Sat Nov 15 20:34:23 2014 Tanaka Akira <akr@fsij.org>
-Mon Jan 1 06:13:11 2007 Eric Hodel <drbrain@segment7.net>
+ * internal.h: Include ruby.h and ruby/encoding.h to be
+ includable without prior inclusion.
- * ext/bigdecimal/bigdecimal.c: Update constant comments to provide
- values for RDoc.
+Sat Nov 15 20:46:44 2014 Kouhei Sutou <kou@cozmixng.org>
-Mon Jan 1 06:05:55 2007 Eric Hodel <drbrain@segment7.net>
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest):
+ Group tests by general entity and parameter entity.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constansts):
- Allow RDoc comment to give friendly value for rb_define_const. Patch
- by Daniel Berger <djberg96 at gmail.com>, [ruby-patches-7499].
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#handle_constansts): Fix
- whitespace handling in constant comments.
+Sat Nov 15 20:43:31 2014 Kouhei Sutou <kou@cozmixng.org>
-Sun Dec 31 00:31:16 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Define
+ test XML in each test method because (1) each XML in used only
+ one test and (2) related data and code should be close.
- * lib/date.rb, lib/date/format.rb: updated based on date2 4.0.
+Sat Nov 15 20:39:06 2014 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 14 18:29:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
+ one test method for one test.
- * ext/readline/readline.c: NetBSD editline does not have
- rl_username_completion_function() and rl_completion_matches().
- a patch from Takahiro Kambe <taca at back-street.net>.
- [ruby-dev:30008]
+Sat Nov 15 20:16:59 2014 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 14 18:20:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_document.rb
+ (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
+ setup and teardown instead of ensure in test.
- * lib/irb/locale.rb (IRB::Locale::puts): typo fixed. a patch from
- NAKAMURA Usaku <usa@ruby-lang.org>. [ruby-dev:30012]
+Sat Nov 15 20:11:34 2014 Kouhei Sutou <kou@cozmixng.org>
-Mon Dec 11 11:58:36 2006 Akinori MUSHA <knu@iDaemons.org>
+ * test/rexml/test_document.rb (REXMLTests::TestDocument): Group
+ entity expansion limit related tests.
- * ext/digest/sha2/lib/sha2.rb: Moved one level up from under
- the superfluous subdirectory digest/.
+Sat Nov 15 20:09:00 2014 Kouhei Sutou <kou@cozmixng.org>
-Mon Dec 11 11:46:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_document.rb (REXMLTests::TestDocument::BomTest):
+ Fix wrong parent class. It doesn't need inherit tests in
+ TestDocument class.
- * variable.c (rb_define_const): typo fixed.
+Sat Nov 15 19:48:59 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 11 09:36:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/mkmf.rb (depend_rules): support comments during a line.
- * string.c (rb_str_aset): index double decode problem.
- [ruby-core:09695]
+ * lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
+ file contains path.
-Sat Dec 9 21:39:24 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 15 19:25:46 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (ruby_cleanup): keep the exception till after END blocks.
- [ruby-core:09675]
+ * common.mk: Remove comments in Dependency lines.
+ Notified by usa.
-Sat Dec 9 11:22:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enc/depend: Ditto.
- * lib/irb/locale.rb (IRB::Locale::search_file): ues File.exist?
- instead of File.exists?. a patch from Yutaka Kanemoto
- <kinpoco at gmail.com> in [ruby-dev:30000].
+ * ext/**/depend: Ditto.
-Thu Dec 7 09:29:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Nov 15 16:28:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/weakref.rb (WeakRef::__setobj__): should support
- marshaling. [ruby-talk:228508]
+ * vm_eval.c (rb_throw_obj): throw UncaughtThrowError instead of
+ ArgumentError. [Feature #10480]
- * lib/delegate.rb (Delegator::marshal_load): need to call
- __setobj__.
+Sat Nov 15 14:13:38 2014 Tanaka Akira <akr@fsij.org>
-Wed Dec 6 23:56:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/update-deps: Extend to fix dependencies.
- * Makefile.in, common.mk (NULLCMD): moved for platforms that empty
- command does not run. fixed: [ruby-dev:29994]
+ * common.mk: Dependencies updated by tool/update-deps.
-Wed Dec 6 17:17:26 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * enc/depend: Ditto.
- * configure.in (SITE_DIR): fixed to emtpy RUBY_SITE_LIB in config.h on
- NetBSD. fixed: [ruby-dev:29358]
+ * ext/**/depend: Ditto.
-Tue Dec 5 00:59:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 14 17:36:48 2014 Tanaka Akira <akr@fsij.org>
- * misc/ruby-mode.el (ruby-parse-partial): need to parse "/=" as
- self assignment operator, not regex. [ruby-talk:227324]
+ * tool/update-deps: Support GNU Make 4.0.
-Mon Dec 4 10:48:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 14 16:59:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.h (OFFT2NUM): use LONG2NUM() if sizeof(long) equals to
- sizeof(off_t).
+ * gc.c (default_proc_for_compat_func): check arguments number and
+ type, and get rid of reentering this default proc.
-Mon Dec 4 10:43:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Nov 14 16:33:06 2014 Koichi Sasada <ko1@atdot.net>
- * parse.y (dyna_init_gen): dvar initialization only if dvar is
- assigned inner block. [ruby-talk:227402]
+ * gc.c (gc_stat_internal): support compatible layer for
+ GC.stat(symbol) type access.
-Mon Dec 4 08:32:49 2006 Shugo Maeda <shugo@ruby-lang.org>
+Fri Nov 14 16:19:08 2014 Koichi Sasada <ko1@atdot.net>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
- boundary. JVN#84798830
+ * gc.c (gc_stat_internal): add compatible layer.
+ From Ruby 2.2, keys of GC.stat are changed [Feature #9924].
+ To provide compatible layer, GC.stat add a default_proc
+ (if default_proc of given Hash object is not set).
-Sat Dec 2 07:09:04 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ At first use of this compatible layer of interpreter process,
+ show a warning message like that:
+ program: GC.stat[:total_allocated_object]
+ warning message: "warning: GC.stat keys were changed from Ruby
+ 2.1. In this case, you refer to obsolete `total_allocated_object'
+ (new key is `total_allocated_objects').
+ Please check <https://bugs.ruby-lang.org/issues/9924>
+ for more information."
- * ext/openssl/ossl_ocsp.c: OpenSSL::OCSP::OSCPError should be
- subclass of OpenSSL::OpenSSLError. [ruby-dev:29980]
+ Please correct my English message :)
-Fri Dec 1 17:01:49 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * hash.c (rb_hash_set_default_proc): export (in internal).
- * gc.c (ruby_init_stack): decrease "stack level too deep" in Windows.
- merge from trunk.
+ * internal.h: ditto.
-Fri Dec 1 16:31:53 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Nov 14 10:41:25 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/tcltklib.c: shouldn't run the killed thread at callback.
- [ruby-talk: 227408]
+ * gc.c: guard by #if/#endif with GC_ENABLE_INCREMENTAL_MARK
+ to hide unused codes.
-Mon Nov 27 17:18:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c: similar to GC_ENABLE_LAZY_SWEEP.
- * sprintf.c (rb_f_sprintf): need not to truncate string if no
- width specifier given for %s. [ruby-dev:29952]
+Fri Nov 14 10:23:35 2014 Eric Wong <e@80x24.org>
-Sun Nov 26 16:36:46 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * vm_eval.c (rb_eval_cmd): use pre-defined idCall
- * version.h: addition of RUBY_PATCHLEVEL.
- * version.c: ditto.
+Fri Nov 14 09:25:44 2014 Eric Wong <e@80x24.org>
-Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_eval.c (rb_yield_splat): add missing GC guard
+ [Bug #10509]
- * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
- Ito <ZXB01226@nifty.com>. [ruby-list:43012]
+Fri Nov 14 08:12:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Nov 23 10:38:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c: fix build error caused by implicit conversion with clang.
- * eval.c (rb_mod_define_method): set implicit visibility only when
- it's called for the target class (ruby_cbase).
+Fri Nov 14 06:54:06 2014 Eric Wong <e@80x24.org>
-Wed Nov 22 16:00:49 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * insns.def (opt_succ): remove Time#succ optimization
+ [Feature #10501]
- * ext/tk/extconf.rb: support --with-X11/--without-X11 option.
+Fri Nov 14 05:29:46 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/README.tcltklib: add description about --with-X11-* option
- [ruby-talk:225166] and --with-X11/--without-X11 option.
+ * gc.c: refactoring.
- * ext/tk/tkutil/extconf.rb: able to be called manually
- [ruby-talk:225950].
+ * gc.c: use GC_ENABLE_INCREMENTAL_MARK instead of USE_RINCGC.
-Wed Nov 15 23:22:54 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_start): check FORCE_MAJOR_GC.
- * file.c (test_grpowned, rb_stat_grpowned): should honor
- supplementary group IDs. [ruby-core:09546]
+Fri Nov 14 04:51:18 2014 Koichi Sasada <ko1@atdot.net>
-Thu Nov 9 03:15:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c: Tuning RincGC parameters.
- * eval.c (BEGIN_CALLARGS): ruby_block may be NULL even when
- ITER_PRE.
+ Before this patch, gc_marks_step() marks (white -> grey) fixed
+ number objects. However, this strategy does not fit practical
+ cases, for example too slow to make progress.
-Tue Nov 7 18:34:34 2006 Akinori MUSHA <knu@iDaemons.org>
+ This patch changes this strategy how many objects the
+ gc_marks_step() should handle.
- * ext/digest/lib/digest/hmac.rb: Keep this out of the 1.8 tree
- until we reach a consensus that HMAC should be put under Digest.
+ We can estimate how many times gc_marks_step() is called during
+ this major marking (== C) with the free slot number in pooled
+ pages. We also can estimate the living object number (== L)
+ using last marked_slots value. We can solve this problem (how
+ many objects should be process in gc_marks_step()) by L/C.
-Tue Nov 7 18:05:01 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (rb_objspace_t): add rb_objspace_t::rincgc::pooled_slots and
+ step_slots.
- * ext/tk/lib/tk/itemconfig.rb: minor bug fix.
+Fri Nov 14 01:26:47 2014 Shugo Maeda <shugo@ruby-lang.org>
-Mon Nov 6 20:11:20 2006 Kouhei Sutou <kou@cozmixng.org>
+ * lib/net/imap.rb (search_response): parse MODSEQ in SEARCH
+ responses properly. [ruby-core:64203] [Bug #10112]
- * lib/rss/0.9.rb (RSS::Rss): removed needless include.
+Fri Nov 14 01:03:17 2014 Tanaka Akira <akr@fsij.org>
-Mon Nov 6 15:41:55 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/lib/envutil.rb: Moved from test/ruby/.
- * ext/tk/lib/tk/itemconfig.rb: ext/tk/lib/tk/itemconfig.rb: bug
- fix on 'itemconfiginfo' method, and modify to make it easy to
- override 'itemconfiginfo' method.
+ * test/lib/find_executable.rb: Ditto.
- * ext/tk/lib/tkextlib/tile/treeview.rb : support Tile 0.7.8.
+ * test/lib/memory_status.rb: Ditto.
- * ext/tk/lib/tkextlib/version.rb : [new] add Tk::Tkextlib_RELEASE_DATE
- to get the information from scripts.
+ * test/lib/test/unit.rb: require envutil.
- * ext/tk/lib/tk.rb: load 'tkextlib/version.rb', and update RELEASE_DATE
+ * test/: Don't require envutil in test files.
- * ext/tk/lib/tkextlib/SUPPORT_STATUS: update.
+Thu Nov 13 21:59:58 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/tk/sample/editable_listbox.rb: [new] the listbox with editable
- items. It's one of the example about usage of Place geometry manager.
+ * lib/rexml/document.rb: add REXML::Document#document.
+ reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.
- * ext/tk/sample/tktextio.rb: improve the functions of TkTextIO class.
- Those are required by 'irbtkw.rbw'.
+Thu Nov 13 21:51:56 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/irbtkw.rbw: [new] IRB on Ruby/Tk. It doesn't need any
- real console. IRB works on a text widget without I/O blocking. That
- is, thread switching on IRB will work properly, even if on Windows.
+ * test/monitor/test_monitor.rb: Use assert_join_threads.
-Sun Nov 5 19:53:49 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Nov 13 21:45:13 2014 Tanaka Akira <akr@fsij.org>
- * lib/date.rb: updated based on date2 3.9.7.
+ * test/openssl: Don't specify port number.
-Sat Nov 4 13:13:57 2006 Shugo Maeda <shugo@ruby-lang.org>
+Thu Nov 13 21:22:35 2014 Tanaka Akira <akr@fsij.org>
- * lib/net/imap.rb: accept NOMODSEQ. [ruby-core:9002]
- (backported from HEAD)
+ * test/openssl/ssl_server.rb: Unused file removed.
+ It is not used since r16111, Ruby 1.9.1.
-Fri Nov 3 00:16:37 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 13 18:50:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (ruby_getnameinfo__aix): AF_INET6 workaround
- for AIX. a patch from Yutaka Kanemoto <kinpoco AT gmail.com>.
- [ruby-dev:29744]
+ * eval.c (rb_ensure): remove obsolete prot_tag comment. patch by
+ Jack Danger at [ruby-core:66238]. [misc #10502]
-Thu Nov 2 15:43:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 13 18:10:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (primary): should set NODE even when compstmt is NULL.
- merge from trunk. fixed: [ruby-dev:29732]
+ * vm.c (rb_vm_make_proc_lambda): similar to rb_vm_make_proc() with
+ is_lambda argument.
-Thu Nov 2 14:48:30 2006 Akinori MUSHA <knu@iDaemons.org>
+Thu Nov 13 12:11:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/set.rb (Set#^): Fix XOR operation against a container that
- holds duplicate values. [issue: #6444]
+ * win32/win32.c (rb_w32_fstat{,i64}): speed up. adjusting
+ timestamps in this function is to get rid of the side effect of
+ ENV["TZ"]. then, if ENV["TZ"] is not set, no need to adjust.
+ this change makes File#stat about 60% faster.
-Wed Nov 1 02:41:38 2006 Akinori MUSHA <knu@iDaemons.org>
+Thu Nov 13 11:56:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/digest/lib/digest/hmac.rb (Digest::HMAC::update): Minor
- optimization.
+ * st.c: include "internal.h" for STATIC_ASSERT.
- * ext/digest/digest.c (rb_digest_instance_equal): Allow comparing
- a digest instance with another of a different class.
+Thu Nov 13 03:56:38 2014 Eric Wong <e@80x24.org>
-Wed Nov 1 01:05:13 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (struct heap_page): trivial packing
+ 304 => 296 bytes on x86-64
- * eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.
- fixed: [ruby-list:42928]
+Wed Nov 12 22:50:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/ruby/test_super.rb: add tests to check above bug.
+ * gems/bundled_gems: Update to test-unit 3.0.6 and minitest 5.4.3.
-Tue Oct 31 17:03:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 12 22:30:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * time.c (time_dup): duplicate the class of original time.
- [ruby-core:09357]
+ * lib/rubygems/*: Update to RubyGems 2.4.3 master (7b1f684).
- * lib/time.rb (Time::make_time, Time::rfc2822, Time::httpdate):
- should respect subclasses. [ruby-core:09357]
+Wed Nov 12 00:26:37 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 30 23:40:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_object.rb: Specify an exception class for rescue clause.
- * Makefile.in (miniruby): add XLDFLAGS.
+ * test/dbm/test_dbm.rb: Ditto.
- * configure.in (aix): use -bE option for miniruby. [ruby-dev:29698]
+ * test/gdbm/test_gdbm.rb: Ditto.
- * dir.c (glob_helper): get rid of possible memory leak.
+ * test/sdbm/test_sdbm.rb: Ditto.
- * win32/win32.c (cmdglob, rb_w32_cmdvector, rb_w32_opendir,
- rb_w32_get_environ): not to use GC before initialization.
+Tue Nov 11 23:43:51 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 30 19:29:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/fileutils/test_fileutils.rb: Use assert_join_threads.
- * bignum.c (rb_big2str0): use better approximation.
+Tue Nov 11 22:51:14 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 30 18:35:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/resolv/test_dns.rb: Use assert_join_threads.
- * bignum.c (rb_big2str0): wrong allocation length. a patch from
- U.Nakamura <usa at garbagecollect.jp> [ruby-dev:29710]
+Tue Nov 11 22:33:08 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 30 12:34:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/net/pop/test_pop.rb: Use assert_join_threads.
- * eval.c (rb_eval): fix commit miss. [ruby-dev:29707]
+Tue Nov 11 22:07:20 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 30 12:20:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/net/http/test_https_proxy.rb: Use assert_join_threads.
- * bignum.c (rb_big2str0): a bug in length adjustment.
+Tue Nov 11 18:09:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 30 11:15:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * template/prelude.c.tmpl: move from tool/compile_prelude.rb and
+ expand by generic_erb.rb.
- * sprintf.c (rb_str_format): should preserve leading zero
- information for negative %b and %x. [ruby-talk:221347]
+Tue Nov 11 13:01:31 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Oct 26 21:05:58 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/rubygems/commands/contents_command.rb (files_in_default_gem):
+ remove useless sort. show_files will sort the result and
+ another branch, files_in_gem, doesn't sort.
+ it should be removed for consistency.
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_verify): should clear error.
- (fix http://bugs.debian.org/394336)
+ * test/rubygems/test_gem_commands_contents_command.rb
+ (test_execute_default_gem): adjust the sort algorithm with
+ Gem::Commands::ContentsCommand#show_files, which sort items
+ as array of [prefix, basename] not strings.
- * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): ditto.
+Tue Nov 11 10:37:09 2014 Koichi Sasada <ko1@atdot.net>
-Thu Oct 26 15:21:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * string.c (sym_equal): use rb_obj_equal().
+ rb_obj_equal() is specially optimized in
+ opt_eq_func()@vm_insnhelper.c.
- * ext/digest/digest.c (Init_digest): typo.
+ This fix is made from this discussion:
+ https://www.omniref.com/ruby/2.1.4/symbols/Symbol/%3D%3D#line=8361.
-Wed Oct 25 17:23:28 2006 Akinori MUSHA <knu@iDaemons.org>
+Tue Nov 11 09:38:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/digest, test/digest/test_digest.rb: Merge from trunk:
- - Introduce versioning in Digest::Base API, and prefix C
- constants with RUBY_ and C type names with rb_ to avoid name
- clash in writing extensions.
- - Introduce Digest::Class and Digest::Instance for ease of
- implementing subclasses and add-ons.
- - Digest::Instance module requires and assumes that any instance
- be resettable and clonable. An instance method #new() is
- added so digest instances work just like digest classes.
- - The constructor does no longer take an initial string to feed;
- digest() and hexdigest() now do, instead. This allows digest
- classes to take their own hashing parameters.
- - Make some changes to digest() and hexdigest() class methods,
- which now take extra arguments, which are passed through to
- the constructor in an internal call.
- - Add #digest_length/size/length() and #block_length(),
- - Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256,
- SHA384 and SHA512, hoping this module would make a decent
- example of a digest subclass written in Ruby.
- - Rip BubbleBabble support out of the base class and have a
- separate module named digest/bubblebabble.
- - Remove RD documents in favor of newly written and embedded
- RDoc documentation.
+ * lib/rdoc/known_classes.rb: reverted regression changes of
+ rdoc known class.
-Wed Oct 25 08:03:23 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Nov 11 00:21:50 2014 Tanaka Akira <akr@fsij.org>
- * lib/date/format.rb: updated based on date2 3.9.6.
- [ruby-core:09323]
+ * test/net/imap/test_imap.rb: Don't ignore exceptions on server
+ threads.
-Sun Oct 22 14:48:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 10 23:34:13 2014 Tanaka Akira <akr@fsij.org>
- * signal.c (ruby_signal): don't set SA_RESTART. a backport from
- the HEAD. [ruby-talk:220937] [ruby-talk:147220]
+ * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
+ exceptions on server thread.
+ Delete read_timeout method call to fix NoMethodError.
- * signal.c (Init_signal): avoid duplicated installation of SIGCHLD
- handler.
+Mon Nov 10 20:20:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Oct 22 16:47:56 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_read): retry with reduced length if cannot to
+ write any data but no error occurs.
- * string.c (rb_str_substr): should be infected with only original
- string, but not the shared string. fixed: [ruby-core:09152]
+Mon Nov 10 20:04:16 2014 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_new4): keep shared string untainted when orignal
- string is tainted. fixed: [ruby-dev:29672]
+ * lib/webrick/server.rb: Setup shutdown pipe in listen method.
-Sun Oct 22 05:20:34 2006 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+Mon Nov 10 19:37:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: alloca is broken; use C_ALLOCA instead.
- [ruby-dev:29416]
+ * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): new
+ function to support nonblock-mode of pipes.
-Fri Oct 20 10:47:43 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
+ if there is no data, but also returns it if remote-end is closed.
- * lib/mkmf.rb: fixed the bug of handling COMMON_MACROS.
+ * win32/win32.c (rb_w32_write): if cannot to write any data, it may be
+ blocking.
-Fri Oct 20 08:42:38 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.
- * common.mk (NULLCMD): dummy command.
+ * ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
+ setting nonblock-mode.
- * bcc32/Makefile.sub (post-install-*): Borland make cannot ignore
- command-less double-colon rules. [ruby-dev:29676]
+ * test/ruby/test_io.rb: test nonblock pipes on Windows.
-Fri Oct 20 00:37:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 10 17:24:34 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/Makefile.sub ($(LIBRUBY_SO)): execute pre-link hook.
+ * ext/etc/etc.c (etc_getlogin): set login name encoding properly.
+ [ruby-core:66163] [Bug #10493]
- * ext/extmk.rb: workaround for Borland make.
+Mon Nov 10 16:20:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Oct 18 23:02:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/*.rb: Update to RubyGems master(3e36528).
- * array.c (rb_ary_shift): shorten copy size. fixed: [ruby-list:42907]
+Mon Nov 10 16:09:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c (Init_signal): handle SIGTERM. fixed: [ruby-list:42895]
+ * signal.c (rb_f_kill): [DOC] mention known signal list.
+ [ruby-core:66162] [Bug #10492]
- * win32/win32.c (rb_w32_utime): allow NULL to set the current time.
- [ruby-talk:219248]
+Mon Nov 10 14:17:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Oct 18 00:55:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/*.rb: Update to RDoc 4.2.0.alpha(579a11c)
- * parse.y (parser_yylex): use particular enums. [ruby-core:09221]
+Mon Nov 10 12:44:39 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 16 08:30:43 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/server.rb: Less instance variables.
- * mkconfig.rb: *OBJS are not needed for extension libraries.
+Mon Nov 10 12:19:43 2014 Tanaka Akira <akr@fsij.org>
- * {bcc32,wince,win32}/Makefile.sub (config.status): fixed typo,
- missing comma.
+ * lib/webrick/server.rb (shutdown): Use close() on @shutdown_pipe_w to
+ notify readability on the read side of the pipe.
+ write_nonblock() is not usable for pipe on Windows.
+ (cleanup_shutdown_pipe): Rescue IOError for @shutdown_pipe_w.close.
-Sun Oct 15 01:03:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 10 07:31:59 2014 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/collector/dir.rb (Collector::Dir#collect): append base
- directory but not prepend.
+ * lib/webrick/server.rb (initialize): Initialize shutdown pipe here
+ to avoid race condition.
+ (cleanup_shutdown_pipe): New private method.
+ (cleanup_listener): Extracted from shutdown method.
+ Call this method from start method to avoid race condition.
- * lib/test/unit/collector/dir.rb (Collector::Dir#collect_file): do not
- join with dot. fixed: [ruby-core:09179]
+Mon Nov 10 05:57:53 2014 Tanaka Akira <akr@fsij.org>
-Sat Oct 14 23:39:50 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/webrick/webrick.cgi: Don't use debug mode.
- * parse.y (singleton): no need to re-create NODE_SELF() again.
- [ruby-core:09177]
+ * test/webrick/webrick_long_filename.cgi: Ditto.
-Sat Oct 14 23:25:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 23:25:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_warning, parser_warn): some error message may
- contain format specifiers. a patch from Akinori MUSHA <knu at
- iDaemons.org>. [ruby-dev:29657]
+ * vm_eval.c (vm_call_super): allow bound proc method to call super
+ method.
- * ext/bigdecimal/bigdecimal.c (VpException): ditto.
+ * vm_insnhelper.c (vm_yield_with_cfunc): push defined class and
+ bound proc method entry to the control frame.
- * ext/dl/handle.c (rb_dlhandle_initialize): ditto.
+Sun Nov 9 22:46:13 2014 Tanaka Akira <akr@fsij.org>
- * ext/gdbm/gdbm.c (rb_gdbm_fatal): ditto.
+ * test/open-uri: Test server log in server thread.
-Sat Oct 14 08:24:45 2006 Akinori MUSHA <knu@iDaemons.org>
+ * test/webrick: Ditto.
- * ext/digest/lib/digest/hmac: Back out the addition of digest/hmac
- for now because the API is too premature for a stable branch.
+Sun Nov 9 22:28:34 2014 Tanaka Akira <akr@fsij.org>
-Sat Oct 14 00:55:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/httpstatus.rb: require webrick/accesslog for AccessLog.
- * bcc32/Makefile.sub (post-install-ext): no longer needed.
+Sun Nov 9 21:03:59 2014 Tanaka Akira <akr@fsij.org>
- * bcc32/configure.bat: get rid of a quirk of Borland make, which
- sets empty macro in command line to "1".
+ * test/webrick: Fix the argument order of assert_equal.
-Fri Oct 13 22:50:43 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Nov 9 20:29:01 2014 Tanaka Akira <akr@fsij.org>
- * lib/date.rb: updated based on date2 3.9.5.
+ * test/webrick: Store log in an array.
-Fri Oct 13 22:33:28 2006 Minero Aoki <aamine@loveruby.net>
+ * test/net/http: Ditto.
- * lib/fileutils.rb (FileUtils.cp_r): dereference_root=true is
- default in Ruby 1.8. This line is wrongly removed in last commit.
+ * test/open-uri: Ditto.
-Fri Oct 13 18:19:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 18:35:36 2014 Tanaka Akira <akr@fsij.org>
- * object.c: Class#inherited RDoc added. a patch from Daniel
- Berger <djberg96 at gmail.com> [ruby-core:08942]
+ * test/xmlrpc: Refine log test.
-Fri Oct 13 02:30:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 9 18:33:33 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/test/unit/collector/dir.rb (Collector::Dir#collect): prepend
- base directory to load path.
+ * lib/unicode_normalize/normalize.rb: Replaced if-else by
+ case in self.normalized? in parallel to r48309.
- * lib/test/unit/collector/dir.rb (Collector::Dir#collect_file): should
- use the given File-like interface, but not File directly.
+Sun Nov 9 18:07:00 2014 Tanaka Akira <akr@fsij.org>
- * test/testunit/collector/test_dir.rb (TestDir::FileSystem): implement
- File-like methods correctly.
+ * test/xmlrpc: Use assert_join_threads.
-Fri Oct 13 01:48:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 14:06:13 2014 Tanaka Akira <akr@fsij.org>
- * lib/date.rb (Date::self.complete_hash): need to check if g is
- nil before dereference. [ruby-core:09116]
+ * test/xmlrpc: Test webrick error log is empty.
-Fri Oct 13 00:34:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 13:47:02 2014 Koichi Sasada <ko1@atdot.net>
- * object.c (rb_mod_cvar_defined): wrong id check. a patch from
- Mauricio Fernandez <mfp at acm.org>. [ruby-core:09158]
+ * gc.c (is_incremental_marking): use #if/#else because
+ rb_objspace_t::flags::during_incremental_marking is not defined
+ when GC_ENABLE_INCREMENTAL_MARK is 0.
- * object.c (rb_mod_cvar_get): typo fixed. [ruby-core:09168]
+ * gc.c (will_be_incremental_marking, is_full_marking): similar fix.
- * object.c (rb_mod_cvar_set): ditto.
+Sun Nov 9 12:16:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 11 22:21:41 2006 Akinori MUSHA <knu@iDaemons.org>
+ * lib/securerandom.rb (SecureRandom.gen_random): separate
+ implementation details and select at the load time.
- * ext/digest: Merge from trunk; metadata location changed,
- Digest::Base#reset() added, Digest::Base#equal() changed, and
- digest/hmac added with some modifications made for ruby 1.8.
+Sun Nov 9 12:09:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Oct 10 17:24:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/win32/lib/win32/registry.rb (Win32::Registry::API#Enum{Value,Key):
+ ditto.
- * {bcc32,win32,wince}/Makefile.sub (config.status): shouldn't use
- copy command instead of install. use -run install.
+Sun Nov 9 11:48:40 2014 Tanaka Akira <akr@fsij.org>
-Tue Oct 10 16:49:16 2006 Akinori MUSHA <knu@iDaemons.org>
+ * test/net/http: Examine webrick log.
- * ext/digest/digest.c (hexdigest_str_new, bubblebabble_str_new):
- Perform StringValue() checks properly.
+Sun Nov 9 11:45:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/digest/digest.c: Use RSTRING_{PTR,LEN} macros.
+ * gems/bundled_gems: upgraded to test-unit 3.0.5.
-Tue Oct 10 13:49:53 2006 Akinori MUSHA <knu@iDaemons.org>
+Sun Nov 9 11:40:50 2014 Tanaka Akira <akr@fsij.org>
- * ext/digest: Merge from trunk; apply all changes since the
- initial import, except for the removal of compatibility stub
- libraries (md5.rb and sha1.rb).
+ * defs/known_errors.def: More errors for FreeBSD.
-Mon Oct 9 23:46:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 11:25:11 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/parsedate.rb: documentation patch from Konrad Meyer
- <konrad.meyer@gmail.com>. [ruby-doc:1238]
+ * gems/bundled_gems: upgraded to power_assert 0.2.0.
- * lib/open3.rb, lib/ping.rb: ditto.
+Sun Nov 9 10:31:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 9 22:56:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/securerandom.rb: set the script encoding to make a string
+ literal in SecureRandom::Kernel32.last_error_message single byte
+ encoding so msg[] works in bytes, since FormatMessage() returns
+ the size in TCHARs, not in characters.
- * lib/rexml/encoding.rb (REXML::Encoding::check_encoding): spaces
- are allowed around equal sign. [ruby-core:09032]
+Sun Nov 9 09:50:22 2014 Tanaka Akira <akr@fsij.org>
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser): ditto.
+ * test/webrick: Refine log tests.
-Sat Oct 7 23:53:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 08:58:05 2014 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_scan): small documentation fix.
- [ruby-core:09007]
+ * defs/known_errors.def (EHWPOISON): New errno symbol.
+ It is defined by glibc-2.16.
-Sat Oct 7 23:44:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 05:00:23 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * bignum.c (rb_big_rshift): a bug in right shift of negative
- bignums. [ruby-core:09020]
+ * lib/securerandom.rb (initialize): call the special method for Win32
+ before checking `/dev/urandom` because we know windows doesn't have it.
-Sat Oct 7 00:27:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 04:01:46 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * class.c (rb_include_module): remove unnecessary check.
- [ruby-talk:218402]
+ * lib/securerandom.rb (SecureRandom::AdvApi32): split from `initialize`.
+ thanks @zzak to remember it.
-Fri Oct 6 04:30:30 2006 Akinori MUSHA <knu@iDaemons.org>
+Sun Nov 9 02:05:33 2014 Tanaka Akira <akr@fsij.org>
- * sample/openssl/c_rehash.rb: Use digest/md5 instead of obsolete md5.
+ * test/net/http/utils.rb: Don't connect to spawned server
+ before actual test.
-Wed Oct 4 18:47:25 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Nov 9 01:51:50 2014 Benoit Daloze <eregontp@gmail.com>
- * ext/tk/lib/tkextlib/*: bugfix and update
- (see ext/tk/ChangeLog.tkextlib).
+ * object.c (Module#const_defined?): [DOC] Revise the documentation.
+ Patch by Xavier Noria.
+ [Fixes GH-754] https://github.com/ruby/ruby/pull/754
-Wed Oct 4 17:25:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Nov 9 00:37:44 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_call): check protected visibility based on real self,
- not ruby_frame->self. [ruby-talk:217822]
+ * test/webrick: Examine log and use assert_join_threads.
-Wed Oct 4 08:52:30 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 7 00:00:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/optparse/test_getopts.rb: changed the class name of test case
- to get rid of conflict with test_optparse.rb.
+ * template/unicode_norm_gen.tmpl: expand kompatible_table so that
+ recursive expansion is not needed at runtime.
-Tue Oct 3 23:32:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 6 23:58:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/testcase.rb (Test::Unit::TestCase.suite): test name
- must be string. fixed: [ruby-core:08978]
+ * pack.c (pack_pack): escape unprintable characters and preserve
+ the encoding of warning message.
-Mon Oct 2 23:47:55 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 6 23:55:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::COLLECTORS):
- base directory should be lower precedence. fixed: [ruby-dev:29622]
+ * string.c (sym_printable): QUOTE() should not raise an exception
+ even on invalid byte sequence.
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner#options): typo.
+Thu Nov 6 21:44:36 2014 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
- load expanded path. fixed: [ruby-dev:29621]
+ * test/test_unicode_normalize.rb: Rename TestNormalize to
+ TestUnicodeNormalize.
+ Define constants under TestUnicodeNormalize.
-Mon Oct 2 15:49:19 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 6 21:22:59 2014 Tanaka Akira <akr@fsij.org>
- * instruby.rb: batfile should be CRLF'ed.
+ * test/open-uri/test_open-uri.rb: Check empty webrick log.
-Mon Oct 2 01:24:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 6 19:27:34 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * common.mk (test-all): separate directory where running test cases
- from source tree.
+ * re.c (unescape_nonascii): cast -1 for the case char is unsigned char.
+ If char is signed char, for example gcc for ARM or ppc64, it caused
+ infinite loop.
+ http://kmuto.jp/build-ruby/arm/ruby-trunk/log/20141106T013005Z.fail.html.gz
+ http://rubyci.blob.core.windows.net/f19p8/ruby-trunk/log/20141106T090217Z.fail.html.gz
- * lib/test/unit/autorunner.rb (options): added --basedir, --workdir
- and --load-path options.
+Thu Nov 6 09:53:18 2014 Eric Wong <e@80x24.org>
- * lib/test/unit/collector/dir.rb (recursive_collect, collect_file):
- base directory support.
+ * lib/uri/rfc2396_parser.rb (initialize): reduce bytecode size
+ 2088 => 1332 bytes on 32-bit x86
-Sun Oct 1 23:56:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 6 08:49:49 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * Makefile.in, common.mk, ext/extmk.rb, win{32,ce}/Makefile.in: keep
- LIBRUBY_SO unless need to be removed.
+ * lib/unicode_normalize/normalize.rb: Comment clarification.
-Sun Oct 1 23:12:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 5 23:43:24 2014 Naohisa Goto <ngotogenome@gmail.com>
- * lib/optparse.rb (OptionParser#make_switch): pass arguments directly.
+ * compile.c (compile_data_alloc): add padding when strict alignment
+ is required for memory access. Currently, the padding is enabled
+ only when the CPU is 32-bit SPARC and the compiler is GCC.
+ [Bug #9681] [ruby-core:61715]
-Sat Sep 30 15:12:25 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * compile.c (STRICT_ALIGNMENT): defined if strict alignment is required
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.4.
+ * compile.c (ALIGNMENT_SIZE, ALIGNMENT_SIZE_MASK, PADDING_SIZE_MAX):
+ new macros for alignment word size, bit mask, max size of padding.
-Fri Sep 29 12:11:04 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * compile.c (calc_padding): new function to calculate padding size.
- * jcode.rb (succ!): call original succ! if $KCODE == 'n'.
- fixed: [ruby-talk:216845]
+Wed Nov 5 23:24:45 2014 Tanaka Akira <akr@fsij.org>
-Fri Sep 29 11:43:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/open-uri/test_open-uri.rb: Don't ignore webrick's log.
- * lib/mkmf.rb (try_func): revert fallback checking undeclared function.
- fixed: [ruby-core:08949]
+Wed Nov 5 19:20:08 2014 Tanaka Akira <akr@fsij.org>
-Fri Sep 29 09:56:56 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/server.rb: Stop listener loop properly.
+ [ruby-core:66085] [Bug #10478] Fixed by Charles Nutter.
- * ext/extmk.rb: extout is needed for also clean.
- fixed: [ruby-core:08944]
+Wed Nov 5 17:20:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/optparse.rb (OptionParser::Switch#conv_arg): unsplat by
- Proc#call if no conversion is given.
+ * include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
+ as deprecated at build time, instead of ignoring silently or
+ warning at runtime only.
-Thu Sep 28 23:59:31 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 5 16:55:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * node.h (struct thread): declare win32_exception_list on cygwin and
- win32 regardless if it is implemented. Provisional fix for
- [ruby-core:08917].
+ * proc.c (rb_f_lambda): remove deprecated function, which has been
+ unavailable from extension libraries.
-Thu Sep 28 20:53:16 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 5 16:26:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tmpdir.rb: use return value of getdir.call for length.
+ * include/ruby/intern.h (rb_clear_cache): mark as deprecated, not
+ only warnings at runtime.
-Wed Sep 27 01:04:49 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 5 15:05:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (try_func): check function pointer first and macro next.
+ * string.c (rb_str_{,l,r}strip_bang): rb_str_subseq() will not
+ NUL-terminate the result string, in the future, so it will not
+ be needed in other cases.
- * lib/mkmf.rb (have_type): simplified with typedef and sizeof.
+Wed Nov 5 14:11:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 26 23:57:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (lib/unicode_normalize/tables.rb): do nothing unless
+ BASERUBY is available. MINIRUBY cannot load extension libraries,
+ so cannot update Unicode data.
- * lib/optparse.rb (OptionParser#getopts): use strings as key.
- fixed: [ruby-dev:29614]
+Wed Nov 5 12:13:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 26 15:31:26 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * string.c (rb_str_lstrip, rb_str_strip): reduce memory copy by
+ copying necessary part only.
- * {win32,wince}/Makefile.sub (CPP): check predefined value.
+ * string.c (rb_str_strip_bang, rb_str_strip): ditto.
-Tue Sep 26 07:55:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Nov 5 12:13:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_shift): should not move memory region if array
- body is shared. a patch from Kent Sibilev <ksruby at gmail.com>.
- [ruby-core:08922]
+ * string.c (rb_str_lstrip, rb_str_strip): reduce memory copy by
+ copying necessary part only.
-Mon Sep 25 22:26:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_strip_bang, rb_str_strip): ditto.
- * file.c (rb_path_end): skip root directory. fixed: [ruby-core:08913]
+Wed Nov 5 10:54:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (init_mkmf): set default $LDFLAGS. Patch by Michal
- Suchanek <hramrach at centrum.cz>. [ruby-talk:216256]
+ * string.c (rb_str_lstrip_bang, rb_str_rstrip_bang): terminate
+ wchar strings with wchar 0.
-Mon Sep 25 08:14:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 4 21:23:22 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (rb_ary_shift): should clear shifting top element.
- [ruby-talk:216055]
+ * ext/win32/lib/Win32API.rb: Fiddle::Importer is defined in
+ fiddle/import.rb and it's not loaded implicitly.
- * array.c (rb_ary_shift): avoid creating shared object if array
- size is small.
+ * ext/win32/lib/Win32API.rb (Win32API#initialize): `import` is a string.
-Mon Sep 25 08:11:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32/lib/Win32API.rb (Win32API#initialize):
+ Fiddle::Importer::CALL_TYPE_TO_ABI is private constant.
- * random.c (rb_f_rand): RDoc typo fix. a patch from Frederick
- Cheung <fred at 82ask.com>. [ruby-talk:216047]
+Tue Nov 4 21:20:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Sep 24 22:28:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/securerandom.rb (SecureRandom.random_bytes): use fiddle directly
+ instead of using Win32API.
- * runruby.rb: extension library scripts moved into common directory.
+Tue Nov 4 21:04:30 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Sep 24 14:59:50 2006 Tanaka Akira <akr@fsij.org>
+ * test/rubygems/test_gem_request_set_lockfile.rb
+ (test_relative_path_from): driveletter support.
- * node.h (struct thread): ia64 support is broken by sandbox patch.
+Tue Nov 4 16:23:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 24 12:11:16 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/rubygems/test_gem_remote_fetcher.rb (RemoteFetcherCleanup):
+ close all pooled connections for each tests to fix leaked file
+ descriptors.
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.3.
+Tue Nov 4 12:51:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Sep 23 23:24:57 2006 why the lucky stiff <why@ruby-lang.org>
+ * include/ruby/ruby.h (PRIsVALUE), vsnprintf.c (BSD_vfprintf): add
+ RUBY_PRI_VALUE_MARK to reduce danger of accidental conflict with
+ plain "%i". binary incompatible with extension libraries using
+ PRIsVALUE and built for 2.1 and earlier. [EXPERIMENTAL]
- * eval.c (rb_thread_save_context, rb_thread_restore_context):
- sandbox hook to save and restore sandbox state.
+Tue Nov 4 12:33:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * eval.c (thread_no_ensure): added THREAD_NO_ENSURE thread flag.
+ * object.c: fix document of Kernel#String by @suzukaze
+ [fix GH-743][ci skip]
- * eval.c (rb_thread_kill_bang): Thread#kill! uses the above flag
- to circumvent ensure, in order to prevent endless loops.
- [ruby-core:08768]
+Tue Nov 4 12:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * eval.c (rb_thread_kill): fix Thread#kill docs, which returns
- the thread object in all cases.
+ * lib/csv.rb: added documentation for skip_blanks option by @decasia
+ [fix GH-744][ci skip]
- * node.h: expose the rb_jmpbuf_t and rb_thread_t structs, along
- with the thread flags. used by the sandbox extension.
+Tue Nov 4 12:09:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ruby.h: extern rb_eThreadError, so sandbox can swap it.
+ * lib/open3.rb: fix code formatting in documentation by @JoshCheek
+ [fix GH-747][ci skip]
-Sat Sep 23 21:34:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Nov 4 08:57:37 2014 Eric Wong <e@80x24.org>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): CGI content
- may be empty. a patch from Jamis Buck <jamis at 37signals.com>.
+ * encoding.c (enc_memsize): remove unnecessary function
+ [ruby-core:65304]
-Sat Sep 23 08:35:53 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Nov 3 18:09:39 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/ri/ri_options.rb: prevent NameError. [ruby-dev:29597]
+ * test/openssl/utils.rb: The default of :ignore_listener_error is
+ changed to false.
-Sat Sep 23 01:04:20 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Nov 3 14:42:37 2014 Koichi Sasada <ko1@atdot.net>
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.2.
+ * iseq.c (iseq_free): resolve memory leak.
-Fri Sep 22 02:06:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 3 13:49:18 2014 Koichi Sasada <ko1@atdot.net>
- * .cvsignore: ignore timestamp files and installed list file.
+ * iseq.c (iseq_memsize): catch up recent changes.
-Fri Sep 22 01:36:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 3 13:38:28 2014 Koichi Sasada <ko1@atdot.net>
- * instruby.rb: include FileUtils unconditionally.
+ * vm_core.h: change semantics of opt_num and opt_table.
+ `opt_num' was the number of optional parameters + 1.
+ `opt_table' has "opt_num" entries.
-Thu Sep 21 22:56:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Change them to:
+ `opt_num' is the number of optional parameters.
+ `opt_table' has "opt_num + 1" entries.
- * common.mk (no-install): not install rdoc actually.
+ This change simplify parameter fitting logics.
- * common.mk (install-doc, no-install-doc): use instruby.rb.
+ * compile.c: catch up this change.
- * instruby.rb: rdoc installation.
+ * iseq.c: ditto.
- * ext/extmk.rb: expand ruby executable names.
+ * proc.c: ditto.
-Thu Sep 21 13:55:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_args.c: ditto.
- * ext/etc/etc.c (etc_getpwuid): uid integer should be wraped in
- uid_t value. [ruby-core:08897]
+Mon Nov 3 11:47:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/etc/etc.c (etc_getpwuid): uid_t may be bigger than plain
- 'int' type.
+ * NEWS: added period into Matrix section. [ci skip]
+ [misc #10446][ruby-core:65987]
-Wed Sep 20 23:17:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 3 09:43:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * common.mk (pre-install-doc): create data directory before install.
+ * vm_args.c: fixed build error with clang
- * lib/mkmf.rb (dir_re): fixed typo.
+Mon Nov 3 09:32:46 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (install_dirs): remove extra slash.
+ * lib/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI):
+ allow '[' and ']' for URI input (and escape). [Bug #10402]
-Wed Sep 20 09:53:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/uri/generic.rb (URI#query=): escape '[', '\', and ']'.
- * {bcc32,win32,wince}/Makefile.sub (INSTALLED_LIST): need to define
- this macro to install.
+Mon Nov 3 07:49:34 2014 Koichi Sasada <ko1@atdot.net>
-Wed Sep 20 09:43:10 2006 Shugo Maeda <shugo@ruby-lang.org>
+ * vm_core.h: change iseq parameter data structure.
+ https://bugs.ruby-lang.org/issues/10440#change-49694
- * lib/net/imap.rb: allow extra spaces in responses.
- Thanks, Tom Soderlund. (backported from HEAD)
+ * change terminology `arg' to `param'.
+ * move rb_iseq_t::arg_* to rb_iseq_t::param.
+ * move rb_iseq_t::arg_size to rb_iseq_t::param::size.
+ * move rb_iseq_t::argc to rb_iseq_t::param::lead_num.
+ * move rb_iseq_t::arg_opts to rb_iseq_t::param::opt_num.
+ * move rb_iseq_t::arg_rest to rb_iseq_t::param::rest_start.
+ * move rb_iseq_t::arg_post_num to rb_iseq_t::param::post_num.
+ * move rb_iseq_t::arg_post_start to rb_iseq_t::param::post_start.
+ * move rb_iseq_t::arg_block to rb_iseq_t::param::block_start.
+ * move rb_iseq_t::arg_keyword* to rb_iseq_t::param::keyword.
+ rb_iseq_t::param::keyword is allocated only when keyword
+ parameters are available.
+ * introduce rb_iseq_t::param::flags to represent parameter
+ availability. For example, rb_iseq_t::param::flags::has_kw
+ represents that this iseq has keyword parameters and
+ rb_iseq_t::param::keyword is allocated.
+ We don't need to compare with -1 to check availability.
+ * remove rb_iseq_t::arg_simple.
-Wed Sep 20 09:25:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c: catch up this change.
- * ext/gdbm/gdbm.c: add RDoc documentation. a patch from Peter
- Adolphs <futzilogik at users dot sourceforge dot net>.
- [ruby-doc:1223]
+ * iseq.c: ditto.
-Tue Sep 19 01:28:00 2006 Minero Aoki <aamine@loveruby.net>
+ * proc.c: ditto.
- * lib/fileutils.rb: backport from HEAD (rev 1.71).
+ * vm.c, vm_args.c, vm_dump.c, vm_insnhelper.c: ditto.
- * lib/fileutils.rb (FileUtils.cp_r): new option
- :remove_destination.
+ * iseq.c (iseq_data_to_ary): support keyword argument.
-Tue Sep 19 00:42:15 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 3 03:39:04 2014 Koichi Sasada <ko1@atdot.net>
- * object.c (rb_obj_ivar_defined, rb_mod_cvar_defined): new methods,
- Kernel#instance_variable_defined? and Module#class_variable_defined?.
- [ruby-dev:29587]
+ * test/ruby/test_method.rb: r48239 makes this test green.
- * lib/date/format.rb (Date::Bag#method_missing): use new method,
- instance_variable_defined? to check if an instance variable is
- defined. fixed: [ruby-dev:29554]
- -- This didn't fix anything.
+Mon Nov 03 03:02:38 2014 Koichi Sasada <ko1@atdot.net>
-Sun Sep 17 23:44:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * rewrite method/block parameter fitting logic to optimize
+ keyword arguments/parameters and a splat argument.
+ [Feature #10440] (Details are described in this ticket)
- * lib/rdoc/rdoc.rb (RDoc::RDoc#document): scan only files modified
- after the previous generation.
+ Most of complex part is moved to vm_args.c.
-Sun Sep 17 17:42:13 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Now, ISeq#to_a does not catch up new instruction format.
- * common.mk (install-doc): reverted.
+ * vm_core.h: change iseq data structures.
- * instruby.rb: stores file name list without destdir prefix.
+ * introduce rb_call_info_kw_arg_t to represent keyword arguments.
+ * add rb_call_info_t::kw_arg.
+ * rename rb_iseq_t::arg_post_len to rb_iseq_t::arg_post_num.
+ * rename rb_iseq_t::arg_keywords to arg_keyword_num.
+ * rename rb_iseq_t::arg_keyword to rb_iseq_t::arg_keyword_bits.
+ to represent keyword bitmap parameter index.
+ This bitmap parameter shows that which keyword parameters are given
+ or not given (0 for given).
+ It is referred by `checkkeyword' instruction described bellow.
+ * rename rb_iseq_t::arg_keyword_check to rb_iseq_t::arg_keyword_rest
+ to represent keyword rest parameter index.
+ * add rb_iseq_t::arg_keyword_default_values to represent default
+ keyword values.
+ * rename VM_CALL_ARGS_SKIP_SETUP to VM_CALL_ARGS_SIMPLE
+ to represent
+ (ci->flag & (SPLAT|BLOCKARG)) &&
+ ci->blockiseq == NULL &&
+ ci->kw_arg == NULL.
- * lib/rdoc/generators/ri_generator.rb: do not chdir twice.
+ * vm_insnhelper.c, vm_args.c: rewrite with refactoring.
-Sat Sep 16 23:14:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * rewrite splat argument code.
+ * rewrite keyword arguments/parameters code.
+ * merge method and block parameter fitting code into one code base.
- * ext/pty/pty.c (establishShell): remove remaining unused line.
+ * vm.c, vm_eval.c: catch up these changes.
-Sat Sep 16 16:40:44 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (new_callinfo): callinfo requires kw_arg parameter.
- * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
- use instruby.rb to install extensions instead of ext/extmk.rb.
+ * compile.c (compile_array_): check the last argument Hash object or
+ not. If Hash object and all keys are Symbol literals, they are
+ compiled to keyword arguments.
- * instruby.rb: store installed list into the file.
+ * insns.def (checkkeyword): add new instruction.
+ This instruction check the availability of corresponding keyword.
- * ext/dbm/extconf.rb: allow multiple candidates for dbm-type.
+ For example, a method "def foo k1: 'v1'; end" is compiled to the
+ following instructions.
- * ext/io/wait/extconf.rb: suspicious checking_for.
+ 0000 checkkeyword 2, 0 # check k1 is given.
+ 0003 branchif 9 # if given, jump to address #9
+ 0005 putstring "v1"
+ 0007 setlocal_OP__WC__0 3 # k1 = 'v1'
+ 0009 trace 8
+ 0011 putnil
+ 0012 trace 16
+ 0014 leave
- * ext/pty/pty.c (establishShell): parent pid is not used.
+ * insns.def (opt_send_simple): removed and add new instruction
+ "opt_send_without_block".
- * ext/pty/pty.c (freeDevice): not used.
+ * parse.y (new_args_tail_gen): reorder variables.
+ Before this patch, a method "def foo(k1: 1, kr1:, k2: 2, **krest, &b)"
+ has parameter variables "k1, kr1, k2, &b, internal_id, krest",
+ but this patch reorders to "kr1, k1, k2, internal_id, krest, &b".
+ (locate a block variable at last)
- * ext/pty/pty.c (get_device_once): removed garbage right brace.
+ * parse.y (vtable_pop): added.
+ This function remove latest `n' variables from vtable.
- * lib/mkmf.rb (checking_for): improved the messages.
+ * iseq.c: catch up iseq data changes.
-Thu Sep 14 16:11:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * proc.c: ditto.
- * string.c (rb_str_intern): raise SecurityError only when $SAFE
- level is greater than zero. [ruby-core:08862]
+ * class.c (keyword_error): export as rb_keyword_error().
- * parse.y (rb_interned_p): new function to check if a string is
- already interned.
+ * common.mk: depend vm_args.c for vm.o.
- * object.c (str_to_id): use rb_str_intern().
+ * hash.c (rb_hash_has_key): export.
-Wed Sep 13 18:43:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h: ditto.
- * README.EXT: English adjustment. [ruby-core:08851] and
- [ruby-core:08852]
+Mon Nov 3 02:35:32 2014 Koichi Sasada <ko1@atdot.net>
-Wed Sep 13 18:25:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * sample/simple-bench.rb: added to measure performance of simple
+ lines.
- * misc/ruby-mode.el (ruby-parse-partial): better here-doc support.
- a patch from Marshall T. Vandegrift <llasram at gmail.com>.
- [ruby-core:08804]
+Mon Nov 3 02:33:43 2014 Koichi Sasada <ko1@atdot.net>
-Wed Sep 13 16:43:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (obj_info): show T_STRING more details.
- * string.c (rb_str_intern): prohibit interning tainted string.
+Sun Nov 2 01:30:32 2014 Tanaka Akira <akr@fsij.org>
-Wed Sep 13 01:14:21 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Don't ignore errors on listener threads,
+ as much as possible.
- * lib/optparse.rb (OptionParser#getopts): works with pre-registered
- options. [ruby-core:08826]
+ * test/openssl/test_ssl_session.rb: Ditto.
-Sun Sep 10 20:27:13 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/openssl/test_partial_record_read.rb: Ditto.
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.1.
+Sat Nov 1 23:11:05 2014 Tanaka Akira <akr@fsij.org>
-Tue Jan 10 09:18:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/utils.rb (start_server): Don't close sockets before
+ threads finished.
- * eval.c (stack_extend): fixed prototype.
+Sat Nov 1 22:06:24 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_require_safe): prevent extension from loading twice.
- fixed: [ruby-dev:29523]
+ * test/openssl/test_ssl_session.rb (test_ctx_client_session_cb): Don't
+ ignore errors of SSL accept.
+ (test_ctx_server_session_cb): Ditto.
-Sat Sep 9 23:50:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/utils.rb (server_loop): Add ignore_ssl_accept_error
+ argument.
+ (start_server): Refine threads waits.
- * bignum.c (rb_big_mul0): bignum multiplication without
- normalization.
+ * test/ruby/envutil.rb (assert_join_threads): Show a thread before
+ backtrace.
- * bignum.c (rb_big_pow): use rb_big_mul0(). [ruby-dev:29547]
+Sat Nov 1 20:40:18 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 9 14:08:38 2006 Eric Hodel <drbrain@segment7.net>
+ * test/openssl/utils.rb (start_server, server_loop): Use a
+ pipe to stop server instead of shutdown/close a listening socket.
- * lib/test/unit/testcase.rb (Test::Unit::TestCase#run): Rescue
- Exception in Test::Unit::TestCase#run. [ruby-core:08783]
+Sat Nov 1 19:24:59 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 9 04:55:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/envutil.rb (assert_join_threads): New assertion to
+ join multiple threads without exceptions.
- * lib/pstore.rb: open all in binary mode, and get rid of the quirk of
- msvcrt. fixed: [ruby-dev:29518]
+Sat Nov 1 17:09:32 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 9 04:54:42 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (bary_mul_balance_with_mulfunc): Fix free work area
+ location.
+ [ruby-dev:48723] [Bug #10464]
+ [ruby-core:66044] [Bug #10465]
+ Reported by Kohji Nishihama.
- * Makefile.in, win32/Makefile.sub (MINIRUBY): append MINIRUBYOPT.
+Sat Nov 1 15:45:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * mkconfig.rb, ext/extmk.rb, lib/mkmf.rb, win32/mkexports.rb: suppress
- warnings with $VERBOSE.
+ * parse.y (parse_atmark): mere atmark and two atmarks without
+ succeeding identifiers are invalid as instance/class variable
+ names.
- * ext/extmk.rb: Proc#call does not pass the block in 1.8.
+Sat Nov 1 06:31:41 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * win32/resource.rb: add more info.
+ * ext/win32ole/win32ole_variant.c: use typed data.
-Fri Sep 8 10:03:59 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Oct 31 13:55:28 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookies): new
- method to parse multiple cookies per Set-Cookie header.
- Thanks to Aaron Patterson <aaron_patterson at speakeasy.net>.
- [ruby-core:08802]
+ * ext/dl/*: remove DL as it is replaced by Fiddle.
+ [Feature #5458] Thanks to Jonan Scheffler <jonanscheffler@gmail.com>
+ for this patch
-Fri Sep 8 08:59:30 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/dl/*: ditto.
- * win32/Makefile.sub, win32/configure.bat win32/setup.mak: program
- name transform.
+Fri Oct 31 15:26:02 2014 Charles Oliver Nutter <headius@headius.com>
-Fri Sep 8 01:33:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Add certificate verification chain
+ test from JRuby community.
- * ruby.h (RSTRING_PTR): add migration macro.
+Fri Oct 31 18:58:02 2014 Charles Oliver Nutter <headius@headius.com>
- * ruby.h (RARRAY_PTR): ditto.
+ * test/psych/test_emitter.rb: Fix line_width test...initial value
+ is impl-specific and attr assignment always returns LHS.
-Thu Sep 7 23:27:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 31 22:19:30 2014 Akinori MUSHA <knu@iDaemons.org>
- * file.c (path_check_0, fpath_check): disable path check on cygwin.
- [ruby-talk:213074]
+ * ext/digest/lib/digest.rb (Digest()): This function should now be
+ thread-safe. If you have a problem with regard to on-demand
+ loading under a multi-threaded environment, preload "digest/*"
+ modules on boot or use this method instead of directly
+ referencing Digest::*. [Bug #9494]
+ cf. https://github.com/aws/aws-sdk-ruby/issues/525
-Wed Sep 06 12:05:19 2006 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Oct 31 21:33:17 2014 Akinori MUSHA <knu@iDaemons.org>
- * ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): fix regexp for euc-jp
- [ruby-dev:29344]
+ * test/digest/test_digest.rb: Drop #!. This no longer runs
+ stand-alone because it depends on ruby/envutil.
- * ext/nkf/lib/kconv.rb (Kconv::toeuc): remove -m0 [ruby-dev:29505]
+Fri Oct 31 17:22:19 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Sep 5 06:47:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/setup.mak: $(APPEND) with some arguments insert a space before
+ the arguments, so it causes error if the arguments are expected to be
+ a macro definition. this fix resolve the build error introduced at
+ r48210.
- * time.c (time_to_s): variable declaration after an execution
- statement.
+Fri Oct 31 16:47:35 2014 Akinori MUSHA <knu@iDaemons.org>
-Tue Sep 5 05:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syslog/lib/syslog/logger.rb (Syslog::Logger::VERSION): Bump
+ the VERSION to 2.1.0. [ruby-core:64483] [Bug #10159]
- * numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352]
+Fri Oct 31 16:33:46 2014 Akinori MUSHA <knu@iDaemons.org>
-Tue Sep 5 05:49:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/imap.rb (Net::IMAP#fetch): [DOC] Document that
+ Net::IMAP#fetch will return nil instead of an empty array.
- * file.c (path_check_0): check if sticky bit is set on parent
- directories for executable path. fixed: [ruby-dev:29415]
+Fri Oct 31 12:54:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Sep 5 05:03:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk (.unicode-tables.time): needs Unicode files always,
+ and should update after downloading these files.
+ [ruby-core:66026] [Bug #10461]
- * numeric.c (fix_plus): addition in Fixnum will never overflow
- long. a patch from Ondrej Bilka <neleai at seznam.cz>.
- [ruby-core:08794]
+Fri Oct 31 10:16:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * numeric.c (fix_minus): ditto.
+ * .travis.yml: reverted r48199, it's unrelated configuration.
- * bignum.c (rb_big_pow): eagerly truncate resulting bignum.
- [ruby-core:08794]
+Fri Oct 31 09:58:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Sep 4 23:15:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/test_unicode_normalize.rb: added unicode version number to
+ test data location.
- * time.c (time_to_s): make it conform to RFC2822 date format.
- [ruby-dev:29467]
+Fri Oct 31 09:56:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Sep 4 21:43:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .gitignore: ignored unicode data with version directories.
- * ext/dbm/extconf.rb: create makefile according to the result of check
- for dbm header. fixed: [ruby-dev:29445]
+Fri Oct 31 09:35:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Sep 4 21:42:35 2006 Tadayoshi Funaba <tadf@dotrb.org>
+ * .travis.yml: tweak build scripts for unicode_normalize.rb.
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.9.
+Thu Oct 30 18:47:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Sep 4 21:14:20 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk: fix for the case ALWAYS_UPDATE_UNICODE=no
- * time.c (time_strftime): include nul character. fixed: [ruby-dev:29422]
+Thu Oct 30 13:23:23 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Sep 4 16:29:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/downloader.rb: changed Unicode data download location
+ from latest Unicode version to Unicode 7.0.0.
- * lib/cgi.rb (CGI::out): specify -m0 -x option for nkf.
- [ruby-dev:29284]
+Thu Oct 30 11:16:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 4 16:13:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_callee_setup_arg{_complex,}): try conversion
+ by to_ary for a lambda, as well as a proc.
+ [ruby-core:65887] [Bug #9605]
- * io.c (pipe_open): command name should not contain null bytes.
- [ruby-dev:29421]
+Wed Oct 29 21:13:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_spawn): ditto.
+ * parse.y (gettable_gen): warn circular argument reference, for
+ transition from 2.1 and earlier. [ruby-core:65990] [Bug #10314]
- * process.c (proc_spawn_n): ditto.
+Wed Oct 29 20:41:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (rb_f_system): ditto.
+ * parse.y (parser_params): remove unused member `cur_mid`.
+ this has been taken over by `in_def` since 1.6.
-Sun Sep 3 15:32:44 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 29 14:44:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb: get rid of nil.to_s.
+ * load.c (rb_f_load): path name needs to be transcoded to OS path
+ encoding. [ruby-list:49994]
-Sun Sep 3 06:24:38 2006 Tanaka Akira <akr@fsij.org>
+Wed Oct 29 11:48:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/socket.c (ruby_connect): sockerrlen should be socklen_t.
+ * configure.in (__builtin_setjmp): disable with gcc/clang earlier
+ than 4.3 on Mac OS X. [ruby-core:65174] [Bug #10272]
-Sun Sep 3 04:40:42 2006 Tanaka Akira <akr@fsij.org>
+Wed Oct 29 11:43:43 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/socket/extconf.rb: check arpa/inet.h for ntohs.
+ * lib/matrix.rb: Generalize Vector#cross_product to arbitrary
+ dimensions
+ based on a patch by gogo tanaka [#10074]
- * ext/socket/socket.c: include arpa/inet.h if available.
+Wed Oct 29 11:43:11 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Sun Sep 3 02:34:55 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/matrix.rb: Add Matrix#adjucate
+ patch by gogo tanaka [#10056]
- * lib/drb/unix.rb (DRbUNIXSocket#close): don't get path if client mode.
- [ruby-dev:29417]
+Wed Oct 29 11:42:33 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Sun Sep 3 01:45:17 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/matrix.rb: Add aliases for Vector#cross & dot
+ patch by gogo tanaka [#10352]
- * lib/drb/acl.rb (ACLEntry#initialize): examine whether '*' is
- included before IPAddr.new. [ruby-dev:29406]
+Wed Oct 29 10:00:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Sep 2 13:23:01 2006 Tanaka Akira <akr@fsij.org>
+ * gems/bundled_gems: Update latest version of bundled gems.
- * common.mk (ia64.o): use the compiler driver to assemble ia64.s
- to use appropriate ABI.
+Tue Oct 28 16:52:07 2014 Eric Wong <e@80x24.org>
-Sat Sep 2 03:36:22 2006 Tanaka Akira <akr@fsij.org>
+ * signal.c (install_sighandler): remove rb_disable_interrupt and
+ rb_enable_interrupt calls
+ (init_sigchld): ditto
+ (Init_signal): disable and enable interrupt once around all
+ install_sighandler and init_sigchld to reduce syscalls at start
+ [Feature #9345] [ruby-core:59480]
- * common.mk, configure.in, defines.h, eval.c, gc.c, main.c,
- numeric.c, ruby.h, ia64.s: backport IA64 HP-UX support.
+Tue Oct 28 16:22:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 1 13:52:57 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ruby.c (process_options, load_file_internal2): should not
+ require other files when dump option is given.
+ [ruby-dev:48712] [Bug #10435]
- * ext/tk/lib/tk/font.rb: TkFont#current_configinfo() doesn't work
- on Tcl/Tk8.x.
+Tue Oct 28 14:51:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Aug 31 12:46:55 2006 why the lucky stiff <why@ruby-lang.org>
+ * configure.in: remove apple-gcc4.2 from CC candidates.
- * eval.c (ruby_init): rename top_cref to ruby_top_cref and export,
- along with ruby_cref, for use by the sandbox. [ruby-core:08762]
+Mon Oct 27 20:13:37 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * node.h: ditto.
+ * lib/rexml/entity.rb: keep the entity size within the limitation.
+ reported by Willis Vandevanter <will@silentrobots.com> and
+ patched by nahi.
-Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 27 17:17:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_s_create): fixed memory leak, based on the patch
- by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233]
+ * proc.c (method_proc): the receiver of binding from method should
+ be same as the receiver of the method.
+ [ruby-core:65917] [Bug #10432]
-Mon Aug 28 11:36:02 2006 Eric Hodel <drbrain@segment7.net>
+Mon Oct 27 16:26:37 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_rb.rb: Fix typo. Submitted by
- <calamitas at gmail.com>. [ruby-core:08724]
+ * test/ruby/test_super.rb: add a test to check block passing.
-Mon Aug 28 07:53:44 2006 Eric Hodel <drbrain@segment7.net>
+Mon Oct 27 15:59:26 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/ri/ri_formatter.rb: Don't unescape HTML in HtmlFormatter.
- Submitted by Kent Sibilev <ksruby at gmail.com>. [ruby-core:08392].
+ * gc.c: is_incremental_marking(), will_be_incremental_marking():
+ use `&&' with GC_ENABLE_INCREMENTAL_MARK instead of using
+ #if/#else/#endif.
-Mon Aug 28 07:25:45 2006 Eric Hodel <drbrain@segment7.net>
+Mon Oct 27 13:40:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (File#size?): Fix documentation submitted by Rick Ohnemus.
- ruby-Bugs-5529. [ruby-core:08725]
+ * gc.c (gc_sweep_rest): sweep rest pages regardless of whether
+ lazy sweep is enabled or not. based on the patch by Masahiro
+ Ide at [ruby-dev:48706]. [Bug #10431]
-Sat Aug 26 08:07:13 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Oct 27 11:18:32 2014 Eric Wong <e@80x24.org>
- * lib/date.rb, lib/date/format.rb: updated based on date2 3.8.2.
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ reduce garbage during forks
-Fri Aug 25 22:32:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 25 12:26:26 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to
- be set with the accessor. fixed: [ruby-list:42737]
+ * template/insns.inc.tmpl, insns_info.inc.tmpl, known_errors.inc.tmpl,
+ minsns.inc.tmpl: fixed path of generating script.
-Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 26 12:24:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * stable version 1.8.5 released.
+ * ext/ripper/lib/ripper/sexp.rb (Ripper.sexp, Ripper.sexp_raw):
+ return nil on error. [ruby-dev:48678] [Bug #10405]
-Fri Aug 25 17:02:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 25 11:24:24 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * gc.c (gc_sweep): typo fixed.
+ * string.c: improved comment.
-Tue Aug 22 18:47:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 26 07:40:11 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_method):
- rdoc documents C module methods as instance methods. a patch in
- [ruby-core:08536].
+ * ext/win32ole/win32ole.c (ole_val2variant, ole_invoke): refactoring.
+ use ole_variant2variant to convert WIN32OLE_VARIANT object to
+ VARIANT object.
-Sat Aug 19 14:15:02 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/win32ole/win32ole_variant.c: refactoring. add
+ ole_variant2variant.
+ * ext/win32ole/win32ole_variant.h: ditto.
- * win32/Makefile.sub (config.status): include winsock2.h instead of
- winsock.h when --with-winsock2 is specified.
- fixed: [ruby-dev:29296]
+Sat Oct 25 22:28:17 2014 Tanaka Akira <akr@fsij.org>
-Sat Aug 19 11:28:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_binwrite_string): Test writev() failure.
- * file.c (rb_file_s_rename): use errno if set properly.
- fixed: [ruby-dev:29293]
+Sat Oct 25 20:19:19 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Sat Aug 19 11:09:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/test-unicode_normalize.rb: added test_us_ascii.
- * parse.y (then): remove semicolon warning. [ruby-dev:29299]
+Sat Oct 25 20:09:09 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Aug 17 19:15:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/unicode_normalize/normalize.rb: added US_ASCII
+ as trivially supported encoding (is always normalized,
+ and may appear mixed in with UTF-8 or other Unicode
+ encodings).
- * file.c (rb_stat_[rRwWxX]): check for super user.
- fixed: [ruby-core:08616]
+Sat Oct 25 20:01:01 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Aug 17 14:47:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/test-unicode_normalize.rb: added
+ test_raise_exception_for_non_unicode_encoding.
- * lib/mkmf.rb: added rdoc by Daniel Berger. [ruby-core:08177]
+Sat Oct 25 19:30:30 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Aug 17 00:39:05 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/test-unicode_normalize.rb: removed unused function.
- * lib/rinda/ring.rb (do_reply): Fix for RingServer fails to find a
- TupleSpace when TupleSpace resides in the same ruby process with
- RingServer. a patch from Kent Sibilev. [ruby-core:08453]
+Sat Oct 25 18:41:41 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Aug 16 11:45:36 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * template/unicode_norm_gen.tmpl: Adjusted name of generating file.
- * process.c (proc_setuid, proc_setgid, proc_seteuid, proc_setegid):
- get rid of bogus implementations on Mac OS X.
+Fri Oct 24 22:49:42 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 15 19:10:18 2006 Eric Hodel <drbrain@segment7.net>
+ * parse.y (parser_yylex): dispatch newline and space at fluent
+ interface, so that the following identifier does not include the
+ space. [ruby-dev:48684] [Bug #10411]
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_class_comment): Fix
- broken class-level documentation.
+Fri Oct 24 20:41:36 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Aug 16 11:09:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * signal.c (check_reserved_signal_): fix write count since r47991.
- * ruby.c (set_arg0): fill argv other than the first with an empty
- string instead of NULL.
+Thu Oct 23 21:42:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 16 11:08:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (rb_hash_delete): now does not call the block given to
+ the current method. [ruby-core:65861] [Bug #10413]
- * win32/win32.h: removed an excess macro. fixed: [ruby-dev:29258]
+Thu Oct 23 19:13:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_method.c (rb_method_entry_make): warn redefinition only for
+ already defined methods, but not for undefined methods.
+ [ruby-dev:48691] [Bug #10421]
- * lib/irb/extend-command.rb (IRB::ExtendCommandBundle): pacify
- RDoc. a patch from Eric Hodel <drbrain at segment7.net>.
- [ruby-core:08522]
+Thu Oct 23 17:19:04 2014 Kouhei Sutou <kou@cozmixng.org>
-Tue Aug 8 11:32:54 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rexml/source.rb (REXML::IOSource#encoding_updated): Fix a
+ bug that can't parse XML correctly when
+ Encoding.default_internal is different with XML
+ encoding. REXML::Source converts XML encoding on read. So IO
+ should not convert XML encoding.
+ Based on patch by NAKAMURA Usaku.
+ [ruby-dev:48686] [Bug #10418]
- * Makefile.in, common.mk, configure.in: fix for platforms without
- rm. patches from Yutaka kanemoto <kinpoco at gmail.com>.
- [ruby-dev:29215]
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal):
+ Add the for the above case.
-Mon Aug 7 17:56:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 23 16:29:02 2014 Kouhei Sutou <kou@cozmixng.org>
- * ext/bigdecimal/bigdecimal.c, ext/digest/rmd160/rmd160ossl.c,
- ext/digest/sha1/sha1ossl.c, ext/readline/readline.c: move
- incluion of config.h to pacify AIX. a patch from Yutaka
- Kanemoto <kinpoco at gmail.com>. [ruby-dev:29197]
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_parse_utf16): Use meaningful
+ test name. "ticket" in the old test name means the ticket in
+ REXML's issue tracker. The REXML's issue tracker was gone. So
+ "ticket" is meaningless.
-Mon Aug 7 15:55:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/data/ticket_110_utf16.xml: Rename to ...
+ * test/rexml/data/utf16.xml: ... this.
- * ext/syck/syck.c (syck_move_tokens): should avoid negative
- memmove. [ruby-list:42625]
+Thu Oct 23 16:18:11 2014 Kouhei Sutou <kou@cozmixng.org>
-Mon Aug 7 14:37:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_encoding.rb
+ (REXMLTests::EncodingTester#test_ticket_110): Fix expected and
+ actual order.
+ Patch by NAKAMURA Usaku. Thanks!!!
- * configure.in, common.mk: AIX link issue. a patch from Yutaka
- Kanemoto <kinpoco at gmail.com>. [ruby-dev:29190]
+Thu Oct 23 10:47:16 2014 Eric Wong <e@80x24.org>
- * ext/socket/socket.c: AIX socket support. [ruby-dev:29190]
+ * insns.def (getlocal,setlocal): add comment to def/opt_operand.def
-Mon Aug 7 12:05:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 23 10:22:41 2014 Eric Wong <e@80x24.org>
- * dln.c, eval.c, gc.c, regex.c, ruby.h: shut up AIX alloca
- warning. a patch from Yutaka Kanemoto <kinpoco at gmail.com>.
- [ruby-dev:29191]
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ use IO#wait_readable instead of timeout
-Sun Aug 6 20:40:41 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Oct 23 10:22:24 2014 Eric Wong <e@80x24.org>
- * lib/date/format.rb (str[fp]time): %[EO]U didn't denote %U.
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ ensure exit! during fork failure
-Sat Aug 5 17:07:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 23 10:21:21 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * parse.y (top_local_setup): local_vars[-1] should point
- ruby_scope itself to protect local_tbl from garbage collection.
- [ruby-dev:29049]
+ * NEWS: Added String#unicode_normalize(|!|d?) [ci skip]
-Sat Aug 5 13:54:03 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Oct 23 03:41:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/format.rb (str[fp]time): "%\n" means "\n".
+ * class.c (unknown_keyword_error): delete expected keywords
+ directly from raw table, so that the given block is not called.
+ [ruby-core:65837] [Bug #10413]
-Fri Aug 4 15:21:00 2006 Eric Hodel <drbrain@segment7.net>
+Thu Oct 23 02:33:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib: Merge RDoc and .document from HEAD.
- * lib/drb/ssl.rb: Close socket on SSLError [ruby-core:7197]
+ * common.mk (update-unicode): invert dependency to run every times.
+ [ruby-core:65842] [Bug #10415]
-Fri Aug 4 19:13:41 2006 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * common.mk (after-update): update files under source tree.
+ [ruby-core:65840] [Bug #10414]
- * lib/irb/{init.rb,ruby-lex.rb,slex.rb}: can't input '\c' for
- [ruby-core: 7122].
+Wed Oct 22 22:38:59 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri Aug 4 14:02:14 2006 James Edward Gray II <james@grayproductions.net>
+ * ext/openssl/lib/openssl/ssl.rb (DEFAULT_PARAMS): override
+ options even if OpenSSL::SSL::OP_NO_SSLv3 is not defined.
+ this is pointed out by Stephen Touset. [ruby-core:65711] [Bug #9424]
- * lib/date/format.rb (__strptime, strftime): allow multi-line patterns
- in Date#strftime the same as Time#strftime accepts.
- fixed: [ruby-core:08466]
+Wed Oct 22 21:31:56 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Aug 4 13:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk (prelude.c): add dependency to LIB_SRCS because
+ enc/prelude.rb requires lib/unicode_normalize.rb, and it's also
+ requires lib/unicode_normalize/tables.rb (=LIB_SRCS).
- * pack.c (pack_pack): check argument overrun for 'P'. based on a
- patch by rucila <rucila at yahoo.cojp>. fixed: [ruby-dev:29182]
+Wed Oct 22 21:09:51 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
-Tue Aug 1 17:44:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (nacl_cv_cpu_nick): fix typo in PNaCl.
+ (XCFLAGS) Add -isystem flag to pnacl and nacl-newlib
+ (CXX): added
- * win32/win32.c (init_stdhandle): assign standard file handles.
+ * nacl/GNUmakefile.in (CXX): Added
+ (PPROGRAM): Use clang++ instead of clang because libnacl_io
+ depends on c++ std lib.
-Tue Aug 1 12:24:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 22 21:07:32 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * eval.c (Init_Binding): fix old commit miss.
+ * common.mk (build-ext): avoid trying to build dynamic libraries
+ if configured --with-static-linked-ext.
-Mon Jul 31 17:08:20 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Oct 22 20:33:33 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (exit_handler): new function; release winsock and
- environment work area.
+ * common.mk: Fixed grammar in comment [ci skip]
- * win32/win32.c (NTInitialize): setup exit_handler.
+Wed Oct 22 19:18:18 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (StartSockets): use exit_handler.
+ * tool/unicode_norm_gen.rb: Fixed escaping of backslash and
+ double quote ('\\\&' -> "\\\\\\\&"; double quoted string
+ is needed to make \& mean last match; double double
+ backslashes are needed because of two layers of escaping).
- * win32/win32.c (rb_w32_getenv): use GetEnvironmentStrings() instead
- of GetEnvironmentVariable(), because the latter cannot distinguish
- wheather a null environment variable exists or not.
- fixed: [ruby-talk:205123]
+Wed Oct 22 18:13:29 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jul 31 16:15:13 2006 Tanaka Akira <akr@fsij.org>
+ * test/test-unicode_normalize.rb: as often said, ruby is sometimes built
+ at non-srcdir.
- * test/ruby/test_process.rb (TestProcess#test_rlimit_nofile):
- setrlimit may fail with EINVAL.
- reported by MIYAMUKO Katsuyuki. [ruby-dev:29174]
+Wed Oct 22 18:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 31 13:38:22 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/test-unicode_normalize.rb: Adjusted path for test
+ data file (now ../enc/unicode/data/NormalizationTest.txt).
- * lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improve
- for the value of IPv6 address in the Host: header field.
+Wed Oct 22 18:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 31 09:22:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/test-unicode_normalize.rb: Removed explicit require,
+ changed method names, adjusted copyright.
- * ruby.h: use ifdef (or defined) for macro constants that may or
- may not be defined to shut up gcc's -Wundef warnings.
- [ruby-core:08447]
+Wed Oct 22 18:00:00 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Sun Jul 30 23:26:22 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/test-unicode_normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/test/test_normalize.rb.
+ (removing trailing whitespace, fixing EOLs and adding EOL property)
- * eval.c (rb_call0): trace call/return of method defined from block.
- fixed: [ruby-core:08329]
+Wed Oct 22 08:21:09 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * eval.c (rb_trap_eval): make the current thread runnable to deal with
- exceptions which occurred within the trap. fixed: [ruby-dev:27729]
+ * nacl/pepper_main.c (Instance_DidCreate): mount devfs and rebind fd 0
+ .. 2 so that stderr goes to the console of the browser.
- * lib/cgi/session.rb, lib/cgi/session/pstore.rb: suppress warnings.
- fixed: [ruby-talk:204896]
+Wed Oct 22 03:47:43 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jul 29 06:12:06 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/etc/etc.c (etc_nprocessors_affin): maximum "n" should be 16384.
- * ext/tk/lib/multi-tk.rb: freeze ip_name for security reason.
+Wed Oct 22 03:37:00 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jul 29 01:23:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/etc/etc.c (etc_nprocessors_affin): minor spell fix.
- * lib/logger.rb: improves the amount of documentation that Rdoc
- picks up when processing logger.rb by moving the require
- statement back before the comment block. a patch from Hugh
- Sasse <hgs at dmu.ac.uk>. [ruby-core:08422]
+Wed Oct 22 03:33:58 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Jul 27 22:21:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/etc/etc.c (etc_nprocessors_affin): optimize memory usage a
+ bit. Typical rubyist never use 8k cpus machine.
- * time.c (time_to_s): fixed format mismatch.
+Wed Oct 22 00:01:09 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
-Thu Jul 27 21:19:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (XCFLAGS): Add include path for NaCl libraries.
+ (XLDFLAGS): ditto.
+ (NACL_LIB_PATH): new substitution
- * math.c (domain_check): a new function to check domain error
- explicitly for systems that return NaN like FreeBSD.
- [ruby-core:07019]
+ * nacl/nacl-config.rb: support NACL_LIB_PATH
- * math.c (math_acos, math_asin, math_acosh, math_atanh, math_log,
- math_log10, math_sqrt): use domain_check().
+ * nacl/package.rb: ditto.
- * math.c (math_sqrt): fix documentation flaw.
+ * nacl/pepper_main.c: replace old implementations with nacl_io.
-Thu Jul 27 18:12:12 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * nacl/GNUmakefile.in: link nacl_io to pepper_ruby
- * time.c: need to declare time_utc_offset.
+ * ruby.c (rb_load_file): remove __attribute__((weak)) because the old
+ override hack was replaced with nacl_io.
-Thu Jul 27 17:01:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c (rb_file_load_ok): ditto.
- * io.c (io_close): always calls "close" method of the receiver.
- [ruby-core:6911] [ruby-core:8112]
+Tue Oct 21 17:32:32 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Jul 27 16:49:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk: Adding explicit creation of directory
+ enc/unicode/data because git doesn't handle empty
+ directories. [patch by Masahiro Ide, filed with r48073]
- * time.c (time_to_s): use +0900 style timezone string for local time.
- [ruby-dev:29143]
+Tue Oct 21 17:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Jul 27 16:41:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/unicode_normalize/tables.rb: Committing to make version
+ update easier and more predictable, and reducing compilation
+ time.
- * ext/openssl/ossl.h: move <ruby.h> inclusion point to shut up
- Solaris compiler. [ruby-core:08114]
+Tue Oct 21 15:56:56 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Jul 26 22:20:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/unicode_normalize/normalize.rb: Added comment to point to
+ relevant portion of Unicode standard for Hangul (de)composition
+ identifiers and algorithm.
- * configure.in: add support for as and ASFLAGS. [ruby-dev:29138]
+Tue Oct 21 11:49:16 2014 Andreas Schwab <schwab@suse.de>
-Wed Jul 26 22:13:45 2006 Minero Aoki <aamine@loveruby.net>
+ * gc.c (mark_current_machine_context) [__mc68000__]: Update stack
+ marking.
+ (rb_gc_mark_machine_stack) [__mc68000__]: Also handle it here.
- * lib/net/http.rb: sync with HEAD (rev 1.132).
+Mon Oct 20 23:59:38 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP#post, request_post, request): should
- set Content-Type: x-www-form-urlencoded by default.
+ * enc/prelude.rb: we sometimes run ruby without library path (especially
+ for test), so should permit to run ruby if unicode_normalize.rb is
+ missing.
- * lib/net/http.rb (Net::HTTPHeader#content_type): should return
- nil when there's no Content-Type.
+Mon Oct 20 23:57:58 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/net/http.rb (Net::HTTPHeader#sub_type): should return nil
- when there's no sub Content-Type (e.g. "Content-Type: text").
+ * common.mk (lib/unicode_normalize/tables.rb): enable running (n)make
+ in non-srcdir.
- * lib/net/http.rb (Net::HTTPHeader#type_params): wrongly failed
- when there's no Content-Type.
+Mon Oct 20 23:58:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jul 26 18:35:38 2006 Minero Aoki <aamine@loveruby.net>
+ * tool/downloader.rb: add -a option to always download regardless
+ existing files.
- * ext/strscan/strscan.c: sync with HEAD (rev 1.25).
+Mon Oct 20 23:18:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/strscan/strscan.c (strscan_do_scan):
- StringScanner.new("").scan(//) should return "". [ruby-Bugs:4361]
+ * lib/mkmf.rb: no need to convert path separator for COPY because it's
+ ruby -run cp and it can treat '/' on any platform.
-Wed Jul 26 18:14:19 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 20 19:54:54 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * ext/pty/pty.c (getDevice): retry once after GC on failure.
- [ruby-core:08282]
+ * config.mk: Added missing data files as targets for
+ prerequisite update_unicode.
-Wed Jul 26 17:28:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 20 19:06:06 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * sprintf.c (rb_f_sprintf): prepend ".." to %u for negative bignum,
- but not "-". fixed: [ruby-core:08167]
+ * lib/unicode_normalize.rb: revert r48046. The s in sIndex
+ is not hungarian notation. The variable name sIndex is
+ directly taken from the relevant part of the Unicode
+ Standard, where it is written SIndex and stands for
+ 'syllable index'. See pp. 144/145 of
+ http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf.
-Wed Jul 26 16:39:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 20 12:46:46 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * string.c (rb_str_scan): add string modification check.
- [ruby-core:7216]
+ * lib/unicode_normalize.rb: removing unnecessary 'self'.
-Wed Jul 26 16:06:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Oct 20 12:37:37 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): check
- multipart boundary end. a patch from Fujioka <fuj at rabbix.jp>
- [ruby-dev:28470]
+ * lib/unicode_normalize.rb: change method names
+ in commented-out code. Followup to r48027.
-Wed Jul 26 01:02:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Oct 20 02:23:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: suppress warnings by automake 1.8 or later.
+ * variable.c (rb_ivar_get), vm_insnhelper.c (vm_getivar): improve
+ instance variable retrieval performance by checking ruby_verbose
+ before call of rb_warning and evaluation of its argument.
+ [ruby-core:65786] [Feature #10396]
-Tue Jul 25 00:30:06 2006 Eric Hodel <drbrain@segment7.net>
+Sun Oct 19 23:31:29 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * lib/prettyprint.rb: RD to RDoc conversion by Hugh Sasse.
+ * lib/unicode_normalize.rb: (unicode_normalize!): change method name.
+ catch up the method name change at r48014. [Feature #10084]
-Tue Jul 25 14:49:51 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Oct 19 20:05:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/mkmf.rb (configuration): typo.
+ * ext/tk/lib/tkextlib/tile/treeview.rb: fix syntax error.
-Tue Jul 25 13:14:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 19 18:39:39 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * process.c (rb_proc_times): rename hz to hertz to avoid name
- crash on AIX. [ruby-dev:29126]
+ * enc/prelude.rb: Added automatic loading of
+ lib/unicode_normalize.rb. This makes sure that all
+ the methods that are available on String are
+ available without explicit require.
-Mon Jul 24 22:03:40 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Oct 19 18:35:35 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * eval.c (backtrace): skip frames successive on node and method name.
+ * lib/unicode_normalize/normalize.rb: Added a missing
+ file extension in require statement.
-Mon Jul 24 17:55:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Oct 19 18:13:13 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * process.c (rb_f_system): add security check. [ruby-talk:202947]
+ * common.mk: Added a rule to generate
+ lib/unicode_normalize/tables.rb. This rule still
+ needs to be integrated into the overall make process.
- * process.c (rb_f_system): move signal right before fork to avoid
- signal handler intervention.
+Sun Oct 19 17:53:53 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 24 15:51:52 2006 Tanaka Akira <akr@fsij.org>
+ * lib/unicode_normalize.rb: Changed to dynamic
+ loading of actual normalization code and tables.
- * ext/readline/readline.c (readline_readline): rl_deprep_term_function
- may be NULL with libedit. reported by Ryan Davis. [ruby-dev:29070]
+Sun Oct 19 17:37:37 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 24 15:19:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/unicode_normalize.rb: Small documentation fix.
- * eval.c (rb_call0): revert last change. [ruby-dev:29112]
- [ruby-core:08374]
+Sun Oct 19 17:26:26 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Sun Jul 23 22:59:49 2006 Tanaka Akira <akr@fsij.org>
+ * lib/unicode_normalize.rb: Added documentation.
- * test/socket/test_unix.rb: disabled on cygwin.
- reported by Kouhei Yanagita. [ruby-dev:29080]
+Sun Oct 19 11:09:09 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Fri Jul 21 21:21:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/unicode_norm_gen.rb, lib/unicode_normalize.rb:
+ File name change from lib/unicode_normalize/normalize_tables.rb
+ to lib/unicode_normalize/tables.rb.
- * eval.c (rb_call0): include funcalled methods in caller list.
- fixed: [ruby-core:08290]
+Sun Oct 19 10:12:12 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Fri Jul 21 12:11:00 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/unicode_normalize.rb: Changing method names, see
+ https://bugs.ruby-lang.org/issues/10084#note-7
- * ext/extmk.rb, lib/mkmf.rb (with_destdir): remove drive letter before
- prepending destdir on DOSISH.
+Sun Oct 19 10:10:10 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Jul 20 15:07:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/unicode_normalize.rb: Changing module name.
- * ruby.h: export classes/modules to implement sandbox.
- [ruby-core:08283]
+Sun Oct 19 10:08:08 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Jul 20 00:06:29 2006 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * lib/unicode_normalize.rb: Changing require statement,
+ adjusting copyright.
- * lib/irb/completion.rb: support for completion of numeric
- number. [ruby-dev: 29038]
+Sun Oct 19 10:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Jul 19 23:53:05 2006 Kouhei Sutou <kou@cozmixng.org>
+ * lib/unicode_normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/lib/string_normalize.rb.
+ (removing trailing whitespace, fixing EOLs and adding EOL property)
- * lib/rss/parser.rb, lib/rss/utils.rb: added documents.
+Sun Oct 19 09:56:56 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Tue Jul 18 22:10:13 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/unicode_norm_gen.rb: Changed module name.
- * process.c (rb_f_system): block SIGCHLD during the process
- execution, like glibc system(3) does. [ruby-talk:202361]
+Sun Oct 19 09:48:48 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Tue Jul 18 23:12:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/unicode_normalize/normalize.rb: Changed module name,
+ adjusted copyright.
- * win32/win32.c (open_ifs_socket): should not use plain malloc.
+Sun Oct 19 09:38:38 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (rb_w32_opendir): should not use plain realloc.
+ * lib/unicode_normalize/normalize.rb: Importing from
+ https://github.com/duerst/eprun/blob/master/lib/normalize.rb.
-Tue Jul 18 18:05:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 18 20:40:52 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/ruby/test_float.rb (TestFloat::test_strtod): update test to
- conform strtod change.
+ * vm_core.h, proc.c, vm_backtrace.c, vm_trace.c:
+ remove rb_binding_new_with_cfp, and use rb_vm_make_binding instead.
-Tue Jul 18 15:49:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 18 20:38:48 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * pack.c (pack_unpack): propagate association array to copied
- string. [ruby-core:08223]
+ * vm_core.h, vm.c, proc.c: fix GC mark miss on bindings.
+ [ruby-dev:48616] [Bug #10368]
- * pack.c (pack_unpack): return referenced string itself if it has
- same length as specified. a patch from <nobu at ruby-lang.org>
- in [ruby-core:08225].
+ * test/ruby/test_eval.rb: add a test code.
- * pack.c (pack_pack): taint 'p' packed strings.
+Fri Oct 17 22:47:11 2014 Tanaka Akira <akr@fsij.org>
-Tue Jul 18 14:03:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * pack.c (pack_unpack): Add casts for char references for 'u'.
+ Fix line ending recognition algorithm.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer::unmount): remove
- inpect argument from sprintf. [ruby-dev:29039]
+Fri Oct 17 21:49:52 2014 Tanaka Akira <akr@fsij.org>
-Tue Jul 18 10:53:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * pack.c (pack_unpack): Add casts for char references for 'b' and 'h'.
- * object.c (rb_cstr_to_dbl): limit out-of-range message.
+Fri Oct 17 17:50:10 2014 Tanaka Akira <akr@fsij.org>
- * util.c (ruby_strtod): return end pointer even if ERANGE occurred.
- fixed: [ruby-dev:29041]
+ * Avoid undefined behaviors found by gcc -fsanitize=undefined.
+ gcc (Debian 4.9.1-16) 4.9.1
-Mon Jul 18 00:43:05 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_sum): Avoid undefined behavior.
- * util.c (ruby_strtod): stop at dot not followed by digits.
- fixed: [ruby-dev:29035]
+Fri Oct 17 17:43:50 2014 Tanaka Akira <akr@fsij.org>
-Tue Jul 18 00:01:27 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Avoid undefined behaviors found by gcc -fsanitize=undefined.
+ gcc (Debian 4.9.1-16) 4.9.1
- * ext/extmk.rb: remove LIBRUBY_SO if static linked extensions exist.
+ * include/ruby/ruby.h (INT2FIX): Avoid undefined behavior.
-Mon Jul 17 23:30:46 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * node.h (nd_set_line): Ditto.
- * configure.in (rb_cv_msvcrt): defaulted to msvcrt. Workaround for a
- bug of cygwin 1.5.20.
+ * pack.c (encodes): Ditto.
+ (pack_unpack): Ditto.
-Mon Jul 17 13:43:05 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * regint.h (BIT_STATUS_AT): Ditto.
+ (BS_BIT): Ditto.
- * pack.c (define_swapx): should not use plain malloc.
+ * time.c (time_mdump): Ditto.
+ (time_mload): Ditto.
-Mon Jul 17 12:58:41 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_core.h (VM_FRAME_MAGIC_MASK): Ditto.
- * configure.in: should use ac_cv_lib_dl_dlopen=no on MinGW.
+ * vm_trace.c (recalc_add_ruby_vm_event_flags): Ditto.
-Sat Jul 15 23:50:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 17 15:06:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_require_safe): wait for another thread requiring the same
- feature. fixed: [ruby-core:08229]
+ * re.c (unescape_nonascii): make dynamically compiled US-ASCII
+ regexps ASCII-8BIT encoding if binary (hexadecimal, control,
+ meta) escapes are contained, as well as literal regexps.
+ [ruby-dev:48626] [Bug #10382]
-Sat Jul 15 01:27:13 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 17 03:05:08 2014 Eric Wong <e@80x24.org>
- * dir.c (has_magic): glob names contain alphabets to enable case fold
- search also for directories. fixed: [ruby-talk:201917]
+ * test/-ext-/bug_reporter/test_bug_reporter.rb
+ (test_bug_reporter_add): revert r47972
+ * test/ruby/test_rubyoptions.rb (test_segv_test): revert r47971
+ [ruby-core:65764]
-Sat Jul 15 01:09:22 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 23:17:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * st.c (malloc): use xmalloc/xcalloc instead of plain
- malloc/calloc, to detect memory allocation failure. see
- <http://www.nongnu.org/failmalloc/>.
+ * signal.c (rb_sigaltstack_size): double default size to get rid
+ of heap corruption by alternate stack overflow in SEGV handler.
+ typically happened at fprintf() in control_frame_dump().
- * gc.c (rb_memerror): should not raise empty nomem_error.
+Thu Oct 16 22:43:12 2014 Tanaka Akira <akr@fsij.org>
-Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_backtrace.c (id2str): Fix a variable name.
+ [ruby-dev:48642] [Bug #10389]
- * ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5.
+Thu Oct 16 20:01:26 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/namespace.rb: ditto.
+ * test/ruby/envutil.rb (assert_pattern_list): Show number of matched
+ patterns and characters.
-Fri Jul 14 02:30:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 16:26:09 2014 Eric Wong <e@80x24.org>
- * lib/monitor.rb: document patch from Hugh Sasse <hgs at dmu.ac.uk>.
- [ruby-core:08205]
+ * cont.c (fiber_store): fix WIN32 fibers
+ [ruby-core:65745] [ruby-core:65758]
-Fri Jul 14 01:09:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 15:05:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (then): error in warning action.
+ * parse.y (parser_here_document): do not append already appended
+ and disposed code fragment. [ruby-dev:48647] [Bug #10392]
-Fri Jul 14 00:10:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 10:35:33 2014 Eric Wong <e@80x24.org>
- * array.c (rb_ary_pop): may cause realloc oscillation. a patch
- from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>.
- [ruby-dev:29028]
+ * test/-ext-/bug_reporter/test_bug_reporter.rb
+ (test_bug_reporter_add): fix race
-Thu Jul 13 22:23:56 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Oct 16 10:09:02 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk/composite.rb: improve handling of the classname on the
- option database for the widget class which includes TkComposite.
+ * test/ruby/test_rubyoptions.rb (test_segv_test): fix race
-Thu Jul 13 20:32:19 2006 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 16 09:17:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/parser.rb: updated documents by a patch from
- Hugh Sasse <hgs at dmu.ac.uk>. [ruby-core:8194]
+ * cont.c (rb_fiber_t): fix compile error caused by move to
+ vm_core.h at r47964. [Feature #10341]
-Wed Jul 12 13:54:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 08:58:11 2014 Eric Wong <e@80x24.org>
- * parse.y (then): we'd like to reserve colon here for the future.
- warning added.
+ * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
+ avoid killing wrong parent
-Tue Jul 11 20:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 16 08:40:04 2014 Eric Wong <e@80x24.org>
- * ruby.h: export rb_cMethod. [ruby-talk:201259]
+ * cont.c (fiber_store): restore references to next_fib (fix typo)
-Tue Jul 11 19:13:33 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Oct 16 08:26:08 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/multi-tk.rb: remove restriction on the class of
- pseudo-toplevel.
+ * cont.c (fiber_store): remove references to nextfib
+ fix build when FIBER_USE_NATIVE is 0
-Tue Jul 11 18:00:57 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Oct 16 06:51:35 2014 Knut Franke <Knut.Franke@gmx.de>
- * ext/tk/lib/multi-tk.rb: security fix.
+ * vm_core.h: declare rb_fiber_t typedef
+ (rb_thread_t): fiber and root_fiber become rb_fiber_t * (from VALUE)
+ * vm.c (rb_thread_mark): use rb_fiber_mark_self
+ * cont.c (rb_fiber_t): prev becomes rb_fiber_t * (from VALUE)
+ (cont_mark, cont_free): simplify conditions
+ (rb_fiber_mark_self): new function
+ (fiber_mark): use rb_fiber_mark_self
+ (cont_save_thread, cont_restore_thread): inline
+ (cont_restore_thread): simplify
+ (fiber_setcontext): simplify conditions
+ (rb_cont_call): remove dereference
+ (fiber_t_alloc): update for rb_fiber_t->prev type change
+ (rb_fiber_start): ditto
+ (fiber_current): extract from rb_fiber_current
+ (return_fiber): move, simplify type checks
+ (rb_fiber_current): use fiber_current
+ (fiber_store): simplify type checks
+ (fiber_switch): ditto, simplify call to fiber_setcontext,
+ use fiber_current
+ (rb_fiber_transfer): update for type changes
+ (rb_fiber_terminate): move, use fiber_switch
+ (rb_fiber_resume): update for type changes
+ (rb_fiber_reset_root_local_storage): ditto
+ (rb_fiber_yield): use rb_fiber_switch instead of rb_fiber_transfer
+ (rb_fiber_m_transfer): ditto
+ [ruby-core:65518] [Feature #10341]
-Tue Jul 11 17:33:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 16 06:25:29 2014 Knut Franke <Knut.Franke@gmx.de>
- * string.c (rb_str_dump): need to extend len for \b.
+ * cont.c (rb_context_t): comment on saved_thread
+ (cont_save_thread): sparse copy
+ (cont_init): copy extra fields
+ (fiber_init): use current thread VM stack size
+ [ruby-core:65518] [Feature #10341]
-Mon Jul 10 22:00:00 2006 Shigeo Kobayashi <shigek@ruby-lang.org>
+Thu Oct 16 06:13:09 2014 Knut Franke <Knut.Franke@gmx.de>
- * ext/bigdecimal/bigdecimal.c: Allows '_' to appear within
- digits. [ruby-dev:28872]
+ * cont.c (cont_capture): remove unnecessary variable
+ [ruby-core:65518] [Feature #10341]
- * ext/bigdecimal/lib/bigdecimal/util.rb: Bug in to_r reported by
- [ruby-list:42533] fixed.
+Thu Oct 16 05:02:31 2014 Knut Franke <Knut.Franke@gmx.de>
-Mon Jul 10 19:22:19 2006 Tanaka Akira <akr@fsij.org>
+ * cont.c (fiber_store, fiber_switch): simplify
+ [ruby-core:65518] [Feature #10341]
- * gc.c (gc_sweep): expand heap earlier.
- reported by MORITA Naoyuki. [ruby-dev:28960]
+Thu Oct 16 04:28:41 2014 Knut Franke <Knut.Franke@gmx.de>
-Mon Jul 10 18:59:34 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * cont.c (rb_fiber_t): remove prev_fiber/next_fiber
+ (fiber_link_join, fiber_link_remove): remove functions
+ (fiber_free, fiber_init, root_fiber_alloc):
+ remove references to removed fields and functions
+ [ruby-core:65518] [Feature #10341]
- * ext/tk/lib/tk/font.rb: sorry. mistaken to patch.
+Wed Oct 15 22:08:37 2014 Tanaka Akira <akr@fsij.org>
-Mon Jul 10 18:46:52 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
+ CentOS 5 don't have CPU_ALLOC().
- * ext/tk/tcltklib.c: make SEGV risk lower at exit.
+Wed Oct 15 18:26:19 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/lib/tk.rb: ditto.
+ * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
+ for getting precious number of available cpus.
- * ext/tk/lib/multi-tk.rb: fail to call function-style methods on slave
- interpreters. The strategy (MultiTkIp_PseudoToplevel_Evaluable) to
- fix the problem is a little tricky. You may have to take care of
- conflicting with it.
+ * ext/etc/etc.c (etc_nprocessors): use etc_nprocessors_affinity if
+ possible.
- * ext/tk/lib/tk.rb: a little change for the pseudo-toplevel strategy.
+ [Feature #10267] etc-nprocessors-kosaki2.patch
- * ext/tk/lib/tk/font.rb: ditto.
+Wed Oct 15 17:53:28 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/msgcat.rb: ditto.
+ * test/ruby/envutil.rb (assert_pattern_list) Renamed from
+ assert_regexp_list.
+ Show multiline string in multi lines.
- * ext/tk/lib/tkextlib/itk/incr_tk.rb: ditto.
+ * test/-ext-/bug_reporter/test_bug_reporter.rb: Use
+ assert_pattern_list.
- * ext/tk/sample/demos-en/widget: fail to call function-style methods
- on sample scripts. To fix it, a strategy which similar to the way
- on MultiTiIp is used. Please take care when re-write and re-run a
- demo script on the Widget-Demo code viewer.
+Wed Oct 15 12:26:58 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/demos-jp/widget: ditto.
+ * test/ruby/envutil.rb (assert_regexp_list): New assertion method.
-Mon Jul 10 13:58:40 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/ruby/test_rubyoptions.rb: Use assert_regexp_list.
- * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
- sigsend_to_ruby_thread, install_nativethread_sighandler):
- nativethread-support on signal handler. RE-backport from 1.9.
+Wed Oct 15 07:21:09 2014 Tanaka Akira <akr@fsij.org>
- * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
+ * enum.c: min(n) drops elements bigger than the n-th maximum element.
+ (struct nmin_data): New field to record the n-th maximum element, limit
+ (nmin_filter): Update limit field.
+ (nmin_i): Drop too big elements.
+ (nmin_run): Initialize limit field.
- * eval.c (ruby_native_thread_kill): ditto.
+Wed Oct 15 07:00:14 2014 Eric Wong <e@80x24.org>
-Mon Jul 10 10:54:14 2006 Ryan Davis <ryand@zenspider.com>
+ * test/ruby/test_optimization.rb (test_string_size): new test
- * lib/rdoc/parsers/parse_f95.rb: massive overhaul from Yasuhiro
- Morikawa including new file suffixes, function support, public
- variables and constants, derived-types, defined operators and
- assignments, namelists, and subroutine and function
- arguments. Truly massive.
+Wed Oct 15 06:51:13 2014 Eric Wong <e@80x24.org>
- * lib/rdoc/diagram.rb: diagrams are now cached.
+ * test/ruby/test_optimization.rb (test_string_eq_neq): new test
+ (test_string_ltlt): ditto
- * lib/irb/completion.rb: fixed a crasher when completing against
- an unnamed class/module.
+Wed Oct 15 06:50:29 2014 Eric Wong <e@80x24.org>
- * lib/rdoc/parsers/parse_c.rb: private comment (--/++) support in
- C-file rdoc.
+ * test/ruby/test_optimization.rb (test_hash_aset_with):
+ assert assignment
- * lib/debug.rb: minor clarification in help.
+Wed Oct 15 04:56:27 2014 Zachary Scott <e@zzak.io>
- * lib/pp.rb: minor clarification on exception.
+ * gc.c (rb_obj_id): [DOC] Fix typo, clean up sentence, and wrap cols
-Mon Jul 10 09:29:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Oct 15 04:53:30 2014 Zachary Scott <e@zzak.io>
- * eval.c (rb_clear_cache_for_undef): clear entries for included
- module. fixed: [ruby-core:08180]
+ * error.c: [DOC] Fix case of type in exception message by @tricknotes
+ [Fixes GH-740] https://github.com/ruby/ruby/pull/740
-Mon Jul 10 01:48:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c: ditto
- * st.h (st_data_t): use pointer sized integer for st_data_t.
- [ruby-dev:28988]
+Tue Oct 14 21:39:16 2014 Vit Ondruch <vondruch@redhat.com>
-Sun Jul 9 18:06:47 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/rbinstall.rb (gem): Fix permissions of bundled gems
+ specification files. [ruby-core:65700] [Bug #10383]
- * lib/mkmf.rb (try_constant): fix for value 1 at cross compiling.
+Tue Oct 14 19:15:31 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/mkmf.rb (create_makefile): prevent substitution of macro
- definition. fixed: http://www.yotabanana.com/lab/20060624.html#p02
+ * ext/win32ole/win32ole_record.c: use typed data.
-Sun Jul 9 00:54:34 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 14 16:23:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (next_jump): deal with destination of next.
- fixed: [ruby-core:08169]
+ * symbol.c (global_symbols): make ids two-dimensional array of
+ strings and symbols, for write-barrier.
-Fri Jul 7 00:38:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * symbol.c (global_symbols): make IDs immortal always, instead
+ of treating dynamic symbols as IDs.
- * hash.c (rb_hash_default): should not call default procedure if
- no key is given. [ruby-list:42541]
+ * iseq.c, marshal.c, string.c: use rb_str_intern instead of
+ rb_str_dynamic_intern.
-Fri Jul 7 00:29:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * symbol.c (rb_str_intern): rename rb_str_dynamic_intern.
- * time.c (time_mload): a patch from Daniel Berger
- <Daniel.Berger at qwest.com>. [ruby-core:08128]
+Tue Oct 14 10:19:10 2014 Eric Wong <e@80x24.org>
-Thu Jul 6 22:21:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_optimization.rb (test_string_freeze): new test
+ (test_hash_aref_with): ditto
+ (test_hash_aset_with): ditto
- * process.c (rb_proc_times): use sysconf(_SC_CLK_TCK) value prior to
- HZ and CLK_TCK. fixed: [ruby-talk:200293]
+Tue Oct 14 01:27:54 2014 Tanaka Akira <akr@fsij.org>
-Thu Jul 6 22:17:21 2006 Minero Aoki <aamine@loveruby.net>
+ * enum.c (nmin_run): max(n) and max_by(n) returns an array in
+ descending order.
+ [ruby-core:65452] Suggested by David Grayson.
- * ext/racc/cparse/cparse.c: sync with original code, rev 1.8.
+Mon Oct 13 20:44:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/racc/cparse/cparse.c: should mark CparseParams objects.
+ * common.mk (update-gems): chdir to the target directory and then
+ add the tool directory to load paths, for older BASERUBY.
+ [Bug #10372][ruby-core:65630]
- * lib/racc/parser.rb: sync with original code, rev 1.8.
+Mon Oct 13 17:53:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/racc/parser.rb: update coding style.
+ * lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem.
+ [Feature #9379][ruby-core:59633]
+ * lib/xmlrpc/config.rb: ditto.
-Mon Jul 3 19:04:38 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon Oct 13 16:32:56 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/tcltklib.c (ip_make_menu_embeddable): help to make a menu
- widget embeddable (pack, grid, and so on) like as a general widget.
- However, an embeddable menu may require to be definied some event
- bindings for general use.
+ * lib/find.rb (Find.find): Call to_path for arguments to obtain
+ strings.
+ [ruby-core:63713] [Bug #10035] Reported by Herwin.
- * ext/tk/lib/tk/event.rb: [bug fix] Tk.callback_break and
- Tk.callback_continue don't work on MultiTkIp.
+Mon Oct 13 15:42:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/multi-tk.rb: ditto.
+ * common.mk: use relative load path for bundled_gems directory.
+ [Bug #10372][ruby-core:65630]
- * ext/tk/lib/tk.rb: lack of Tk.callback_return.
+Mon Oct 13 08:44:06 2014 Zachary Scott <e@zzak.io>
- * ext/tk/lib/tk/menu.rb: improve creating clone menus.
+ * README.EXT: [DOC] fix example missing typedef with patch by
+ @steveklabnik [Fixes GH-739] https://github.com/ruby/ruby/pull/739
-Mon Jul 3 14:42:06 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * README.EXT.ja: ditto.
- * ext/etc/extconf.rb (PW_UID2VAL, PW_GID2VAL): defaulted to conversion
- from int, and sys/types.h needs to be included before grp.h.
- fixed: [ruby-dev:28938]
+Mon Oct 13 06:52:09 2014 Eric Wong <e@80x24.org>
-Mon Jul 3 01:14:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (ary_recycle_hash): add RB_GC_GUARD
+ (rb_ary_diff): remove volatile
+ [Bug #10369]
- * string.c (rb_str_inspect): encode \b (\010) for escape.
- [ruby-dev:28927]
+Mon Oct 13 03:20:23 2014 Zachary Scott <e@zzak.io>
- * string.c (rb_str_dump): ditto.
+ * ext/date/date_core.c: [DOC] Clean up whitespace, examples, and typos
+ in date_core based on a patch by @vipulnsward [Fixes GH-724]
+ https://github.com/ruby/ruby/pull/724
-Sun Jul 2 19:17:56 2006 Minero Aoki <aamine@loveruby.net>
+Mon Oct 13 02:39:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/racc/cparse/cparse.c: sync with original code (rev 1.7).
+ * parse.y (remove_duplicate_keys): should not simply eliminate all
+ value nodes, which may have side effects.
+ [ruby-core:65625] [Bug #10315]
- * ext/racc/cparse/cparse.c: use rb_catch instead of rb_iterate.
- Giving a block to a Ruby-level method by rb_iterate is obsolete on
- Ruby 1.9. Note that current cparse.c still includes one
- rb_iterate call on Ruby 1.8, but it is not a problem (at least
- just now).
+Sun Oct 12 10:39:16 2014 Zachary Scott <e@zzak.io>
-Sat Jul 1 15:15:49 2006 Tanaka Akira <akr@m17n.org>
+ * vm.c: [DOC] fix typo by @yui-knk [Fixes GH-738]
+ https://github.com/ruby/ruby/pull/738
- * test/socket/test_nonblock.rb: add timeout to send/receive
- an empty UDP packet.
- [ruby-dev:28820]
+Sun Oct 12 09:24:15 2014 Tanaka Akira <akr@fsij.org>
-Fri Jun 30 23:46:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/lib/test/unit.rb: Hide skips by default.
- * configure.in: should test isinf for Solaris with GCC compiler.
- a patch from <ville.mattila at stonesoft.com>. [ruby-core:07791]
+Sun Oct 12 01:37:11 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * configure.in: -shared patch from Andrew Morrow
- <andrew.c.morrow at gmail.com>. [ruby-core:08100]
+ * file.c: include sys/time.h only if HAVE_SYS_TIME_H
-Thu Jun 29 18:58:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 11 22:29:40 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_version): fix patch
- failure.
+ * file.c (HAVE_UTIMENSAT): disabled for NativeClient.
+ Fixes build error.
-Thu Jun 29 18:00:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 11 22:11:58 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * ext/bigdecimal/bigdecimal.c: add RDoc document. a patch from
- mathew <meta at pobox.com>. [ruby-core:07050]
-
-Wed Jun 28 15:47:14 2006 Eric Hodel <drbrain@segment7.net>
+ * ext/extmk.rb: generates the rule for extinit.$(OBJEXT).
+ extinit.$(OBJEXT) used to be generated by the builtin rule, thus
+ didn't accept custom $(CC) and caused linkage error for cross
+ compiling.
- * lib/optparse.rb: RDoc patch from Robin Stocker <robin@nibor.org>
- [ruby-core:08087]
+Sat Oct 11 18:46:50 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
-Wed Jun 28 19:04:34 2006 Tanaka Akira <akr@m17n.org>
+ * include/ruby/intern.h (rb_fd_select): declare struct timeval, or the
+ struct gets local to the function in C99.
- * test/socket/test_unix.rb: test_seqpacket_pair removed.
- [ruby-dev:28846]
+ * file.c (#include): add nacl/stat.h for PNaCl.
+ (utimes): added a declaration for PNaCl.
+ (stat_atimespec): stat::st_atimensec is long long but
+ timespec::tv_nsec is long in PNaCl.
+ (stat_mtimespec, stat_ctimespec): ditto.
+ (rb_group_member): disable getgroups unless HAVE_GETGROUPS.
+ (eaccess): unify the fallback to generic defined(USE_GETEUID).
-Tue Jun 27 23:03:49 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c: include sys/time.h for struct timeval.
+ (rb_close_before_exec): nothing we can do if F_GETFD is not
+ available.
+ (ioctl): pnacl newlib actually doesn't have ioctl.
- * string.c: RDoc update for =~ method. a patch from Alex Young
- <alex at blackkettle.org>. [ruby-core:08068]
+ * process.c (maxgroups): it is used iff
+ defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) but not
+ defined(HAVE_GETGROUPS) || defined(HAVE_SETGROUPS).
+ (obj2gid): fail unless the object is a Fixnum if getgrnam is not
+ available.
+ (disable_child_handler_fork_child): sigaction is not available in
+ PNaCl newlib.
-Tue Jun 27 22:47:18 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (warnflags, strict_warnflags): avoid -ansi for strlcpy.
+ (rb_cv_gcc_atomic_builtins): also check
+ __atomic_or_etch because it is used in ruby_atomic.h.
+ (rb_cv_gcc_sync_builtins): ditto.
+ (HAVE_GETGRNAM): added.
- * ext/tk/tcltklib.c: forgot to update TCLTKLIB_RELEASE_DATE.
+Sat Oct 11 15:32:08 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk.rb (tk_tcl2ruby): [bug fix] sometimes fail to convert
- a tcl string to a ruby object if the tcl string includes "\n".
+ * compile.c (iseq_build_from_ary_exception): move RB_GC_GUARD
+ (iseq_build_from_ary_body): use PRIsVALUE instead of RB_GC_GUARD
-Tue Jun 27 16:04:05 2006 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Oct 11 14:57:08 2014 Eric Wong <e@80x24.org>
- * win32/win32.h: define isascii on MinGW for msvcrt compatibility.
+ * string.c (rb_str_intern): remove unnecessary RB_GC_GUARD
- * configure.in: set ac_cv_header_sys_time_h=no on MinGW
- for msvcrt compatibility.
+Sat Oct 11 13:47:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 27 11:36:02 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (remove_duplicate_keys): remove duplicate literal keys,
+ i.e., symbols and strings. [ruby-core:65368] [Bug #10315]
- * ext/etc/etc.c (setup_passwd, setup_group): allow bignum uid, gid and
- so on. [ruby-talk:199102]
+ * vm.c (kwmerge_i): override existing keys by new keys.
+ [ruby-core:65368] [Bug #10315]
-Mon Jun 26 13:37:27 2006 Eric Hodel <drbrain@segment7.net>
+ * parse.y (assocs): concatenate splatted literal hashes. the
+ former key has precedence even if duplicated literal keys
+ follow. [ruby-core:65368] [Bug #10315]
- * lib/rdoc: Merge from HEAD.
- Add options to limit the ri search path.
+Sat Oct 11 12:27:03 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
-Tue Jun 27 00:54:08 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_NACL): automatically locate pnacl-clang.
+ (RUBY_PLATFORM): pnacl instead of le32-nacl.
- * util.c (powersOf10): constified.
+Sat Oct 11 11:27:14 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
-Mon Jun 26 18:37:44 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c: fix issues in the last two commits. don't disable cloexec for
+ platforms other than NativeClient.
- * ext/tk/tcltklib.c (ip_delete): fix SEGV when a slave-ip is
- deleted on callback.
+ * ChangeLog: ditto. add entries for the last two commits.
-Mon Jun 26 10:47:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Oct 11 11:12:00 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * io.c (pipe_open): avoid closing uninitialized file descriptors.
- a patch from <tommy at tmtm.org> [ruby-dev:28600]
+ * signal.c (install_signalhandler, init_sigchld): allow failure because it
+ always fails with ENOSYS on NaCl.
-Mon Jun 26 09:56:22 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Oct 11 11:11:53 2014 Yuki Yugui Sonoda <yugui@yugui.jp>
- * win32/win32.[ch] (rb_w32_send, rb_w32_sendto): constified.
+ * configure.in (RUBY_NACL and others): merge patch from naclports. Supports PNaCl.
-Sun Jun 25 23:02:12 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dln.c: ditto. replace the old hacky dynamic loading over HTTP with nacl_io.
- * Makefile.in, mkconfig.rb: catch-up for latest autoconf.
+ * file.c: ditto. tentatively use access(2) instead of eaccess.
+ (rb_file_load_ok): weaken with attribute but not by postprocess.
-Sat Jun 24 06:35:00 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c: ditto.
+ (socket.h): now NaCl has socket.h
+ (flock): disable here instead of nacl/ioctl.h
- * signal.c: revert last change.
+ * nacl/GNUmakefile.in: ditto.
+ (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY):
+ respect path to them if they are absolute.
+ This helps naclports to build ruby in their source tree.
+ (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl.
+ (ruby.o, file.o): move the hack to attributes in ruby.c and file.c
- * ruby.h: ditto.
+ * nacl/ioctl.h: ditto. removed. move the hack to io.c.
- * eval.c: ditto.
+ * nacl/nacl-config.rb: ditto. support arm, pnacl and others.
-Thu Jun 22 11:52:02 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * nacl/pepper_main.c: ditto. support build in a naclports tree.
- * lib/net/http.rb (Net::HTTPResponse): duplicated error 501;
- HTTPInternalServerError should be error 500. [ruby-core:08037]
+ * ruby.c (rb_load_file): ditto. weaken with attribute but not by postprocess.
-Thu Jun 22 05:15:58 2006 Tanaka Akira <akr@m17n.org>
+Sat Oct 11 09:32:00 2014 Zachary Scott <e@zzak.io>
- * ext/socket/socket.c (sock_s_socketpair): try GC only once.
- [ruby-dev:28778]
+ * ext/socket/unixsocket.c: [DOC] Fix example to render in HTML
+ properly, with a patch by @eval [Fixes GH-733]
+ https://github.com/ruby/ruby/pull/733
-Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Oct 11 04:14:41 2014 Kir Shatrov <shatrov@me.com>
- * lib/date.rb (jd_to_commercial): now works fine even if in
- mathn-ized context.
+ * lib/open-uri.rb (OpenURI::Options): add :open_timeout default
+ * (def OpenURI.open_http): check :open_timeout option
+ * (module OpenURI): rdoc for :open_timeout
+ * test/open-uri/test_open-uri.rb (test_open_timeout): new test
+ [Feature #10361]
-Wed Jun 21 17:32:31 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Oct 10 11:27:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
- sigsend_to_ruby_thread, install_nativethread_sighandler):
- nativethread-support on signal handler (backport from 1.9).
+ * include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
+ deprecate old macros for compatibility for ruby 1.8 and older.
- * ruby.h (HAVE_NATIVETHREAD_KILL): ditto.
+Thu Oct 9 23:31:47 2014 Naohisa Goto <ngotogenome@gmail.com>
- * eval.c (ruby_native_thread_kill): ditto.
+ * bignum.c (absint_numwords_generic): set an array element after
+ definition of a variable to fix compile error with older version
+ of fcc (Fujitsu C Compiler) 5.6 on Solaris 10 on Sparc.
+ [Bug #10350] [ruby-dev:48608]
-Wed Jun 21 08:39:54 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Oct 9 16:15:26 2014 Eric Wong <e@80x24.org>
- * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): merge Date
- and Time processing. [ruby-core:08033]
+ * ext/-test-/st/foreach/extconf.rb: new file
+ * ext/-test-/st/foreach/foreach.c: ditto
+ * test/-ext-/st/test_foreach.rb: ditto
+ [Feature #10321]
-Wed Jun 21 01:40:25 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 9 12:40:28 2014 Eric Wong <e@80x24.org>
- * parse.y (yylex, reswords): modifier token is no longer returned in
- fname state. [ruby-dev:28775]
+ * benchmark/bm_hash_aref_sym*.rb: force static symbols
-Wed Jun 21 01:12:46 2006 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 9 12:38:28 2014 Eric Wong <e@80x24.org>
- * lib/rss/rss.rb: RSS::Element.def_corresponded_attr_writer
- supported date type.
+ * hash.c (rb_any_hash): remove unnecessary dsym check
-Tue Jun 20 22:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 9 07:20:30 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * test/rss/test_parser.rb: split parser tests into ...
- * test/rss/test_parser_1.0.rb: ... RSS 1.0 parsing tests and ...
- * test/rss/test_parser_2.0.rb: ... RSS 2.0 parsing tests.
+ * missing/setproctitle.c: Avoid invalidating argv[1], argv[2],
+ etc. until the first call to Process.setproctitle, because
+ the ps command of AIX refers to the argv array.
+ [Bug #10090]
-Tue Jun 20 21:19:06 2006 Kouhei Sutou <kou@cozmixng.org>
+Thu Oct 9 00:53:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/rss.rb: provided default RSS::Element#children.
+ * dir.c (dir_s_aref): fix rdoc. `Dir.glob` allows an array but
+ `Dir[]` not. the former accepts an optional parameter `flags`,
+ while the latter accepts arbitrary number of arguments but no
+ `flags`. [ruby-core:65265] [Bug #10294]
- * lib/rss/0.9.rb: used default RSS::Element#children.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
+Wed Oct 8 21:44:10 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Jun 20 21:04:33 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/win32ole/win32ole_variable.c: use typed data.
- * lib/rss/rss.rb: provided default RSS::Element#_tags.
+Wed Oct 8 16:36:47 2014 gogo tanaka <mail@tanakakazuki.com>
- * lib/rss/0.9.rb: used default RSS::Element#_tags.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
+ * test/ruby/test_syntax.rb: added syntax tests of underscore
+ arguments. [Feature #10340][ruby-core:65496]
-Tue Jun 20 20:47:07 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 8 07:42:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/rss.rb: hide RSS::Element.install_model.
- (RSS::Element.install_have_child_element,
- RSS::Element.install_have_children_element,
- RSS::Element.install_text_element,
- RSS::Element.install_date_element): call
- RSS::Element.install_model internally.
+ * lib/uri/generic.rb (URI#inspect): remove Object id.
+ URI is considered that it doesn't require id.
- * lib/rss/0.9.rb: followed new API.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Wed Oct 8 05:22:42 2014 Eric Wong <e@80x24.org>
-Tue Jun 20 20:18:05 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/etc/etc.c (etc_systmpdir): set default tmplen correctly
+ Fixup r47826
- * ext/openssl/extconf.rb: add check for OBJ_NAME_do_all_sorted.
+Wed Oct 8 05:16:32 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/openssl/ossl_cipher.c (ossl_s_ciphers): new method
- OpenSSL::Cipher.ciphers. it returns all the cipher names.
+ * lib/matrix.rb: Add @- and @+ for Matrix and Vector.
+ patch by gogo tanaka [#10068] [#10069]
- * ext/openssl/lib/openssl/cipher.rb:
- - add constants AES128, AES192, AES256. [ruby-dev:28610]
- - reimplement without eval()
+Wed Oct 8 04:58:48 2014 John Bachir <j@jjb.cc>
- * ext/openssl/lib/openssl/digest.rb: reimplement without eval().
+ * bootstraptest/test_io.rb (assert_finish):
+ normalize rescue for Timeout::Error
+ * lib/net/ftp.rb (Net#read_timeout): ditto for doc
+ * lib/resolv.rb (Resolv::ResolvTimeout): ditto for subclass
+ * lib/webrick/httprequest.rb (_read_data): ditto for rescue
+ * sample/timeout.rb (p timeout): ditto for call
+ * test/drb/drbtest.rb (test_06_timeout): ditto
+ * test/ruby/test_readpartial.rb (test_open_pipe): ditto
+ * test/thread/test_queue.rb (test_queue_thread_raise): ditto
+ * thread.c (rb_thread_s_handle_interrupt): ditto for doc
+ [ruby-core:65481] [misc #10339]
- * test/openssl/test_cipher.rb, test_digest: fix about reimplemented
- features.
+Wed Oct 8 04:38:29 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * sample/openssl/cipher.rb: rewrite all.
+ * test/ruby/test_process.rb (TestProcess#test_setsid): AIX
+ does not allow Process::getsid(pid) when pid is in a
+ different session.
-Sat Jun 19 11:21:46 2006 Eric Hodel <drbrain@segment7.net>
+Wed Oct 8 04:33:04 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * lib/test/unit/assertions.rb: Merge RDoc from HEAD.
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_encoding):
+ On AIX, locale_charmap is ISO-8859-1 with LANG=C. This means
+ the source encoding of stdin is ISO-8859-1, so "invalid
+ multibyte char" error does not occur.
-Tue Jun 20 01:06:57 2006 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 8 04:30:29 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/rss/rss.rb:
- - cleanup validation mechanism. Now, #XXX_validation is
- needless.
- - changed internal variable name RSS::Element::MODEL to
- RSS::Element::MODELS.
- - RSS::Element.install_model requires uri.
+ * lib/matrix.rb: Add Matrix#laplace_expansion.
+ patch by gogo tanaka [#10073]
- * lib/rss/0.9.rb: followed new validation API.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Wed Oct 8 04:29:21 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Jun 19 23:40:59 2006 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/matrix.rb: Add Vector.basis.
+ Based on patch by gogo tanaka [#10072]
- * ext/nkf/lib/kconv.rb: remove default -m0 and fix document.
+Tue Oct 7 23:40:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/nkf/nkf-8/{nkf.c, config.h, utf8tbl.c, utf8tbl.h}:
- imported nkf 2.0.7.
+ * signal.c (rb_f_kill): get rid of deadlock as unhandled and
+ discarded signals do not make interrupt_cond signaled.
+ based on the patch by Kazuki Tsujimoto at [ruby-dev:48606].
+ [Bug #9820]
-Mon Jun 19 22:31:59 2006 Kouhei Sutou <kou@cozmixng.org>
+Tue Oct 7 22:43:44 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rss/rss.rb:
- - provided default #to_s as RSS::Element#to_s.
- - removed RSS::Element#other_element.
- - RSS::Element#tag requires attributes as Hash instead of Array.
+ * ext/win32ole/win32ole_method.c: use typed data.
- * lib/rss/0.9.rb: removed #to_s to use RSS::Element#to_s.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Tue Oct 7 21:47:05 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rss/2.0.rb: removed #other_element.
+ * ext/win32ole/win32ole_param.c: refactoring.
-Mon Jun 19 22:09:16 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Tue Oct 7 21:40:17 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/win32ole/win32ole.c(ole_invoke): support some kind of
- method of word. [ruby-Bugs#3237]
+ * ext/win32ole/win32ole_method.c: refactoring. add
+ olemethod_data_get_struct to wrap Data_Get_Struct.
+ * ext/win32ole/win32ole_method.h: ditto.
- * ext/win32ole/tests/test_word.rb: ditto.
+ * ext/win32ole/win32ole_param.c (oleparam_ole_param):
+ call olemethod_data_get_struct instead of Data_Get_Struct.
- * ext/win32ole/tests/testall.rb: ditto.
+Tue Oct 7 11:17:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 19 00:02:17 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/etc/etc.c (etc_systmpdir): try user temporary directory by
+ confstr() on Mac OS X.
+ c.f. http://www.opensource.apple.com/source/ruby/ruby-104/patches/ext_etc_etc.c.diff
- * lib/rss/rss.rb: automatically detected attributes.
+Tue Oct 7 10:48:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/0.9.rb: removed #_attrs.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * configure.in (struct stat.st_size): prefer off_t over int, long,
+ and so on. inspired by
+ http://www.opensource.apple.com/source/ruby/ruby-104/patches/config.h.ed
- * lib/rss/parser.rb: followed new internal API.
+Tue Oct 7 10:37:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 19 00:00:17 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (RUBY_UNIVERSAL_ARCH): fix missing quoting
+ brackets. incorporated from
+ http://www.opensource.apple.com/source/ruby/ruby-104/patches/configure.diff
- * ext/tk/lib/multi-tk.rb: fix bug: initialize improper tables.
+Mon Oct 6 23:34:42 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sun Jun 18 22:36:13 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/win32ole/win32ole_param.c: use typed data.
- * lib/rss/rss.rb: RSS::Element#initialize accepts initial
- attributes.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Mon Oct 6 22:37:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rss/utils.rb: added Utils.element_initialize_arguments? to
- detect backward compatibility initial arguments.
+ * symbol.h (struct RSymbol): move from internal.h.
- * lib/rss/parser.rb: user initial attributes to initialize
- RSS::Element.
+Mon Oct 6 21:43:03 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jun 18 18:24:42 2006 Kouhei Sutou <kou@cozmixng.org>
+ * error.c: update exception tree. [DOC]
+ reported by @hemge via twitter.
- * lib/rss/converter.rb: use NKF for Uconv fallback.
+Mon Oct 6 18:43:03 2014 Rei Odaira <Rei.Odaira@gmail.com>
-Sun Jun 18 18:22:04 2006 Kouhei Sutou <kou@cozmixng.org>
+ * configure.in: Fix typo. [Bug #9914]
- * test/rss/test_image.rb: shared name space configuration.
+Mon Oct 6 16:23:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jun 18 18:13:25 2006 Kouhei Sutou <kou@cozmixng.org>
+ * signal.c (rb_f_kill): should not ignore signal unless the
+ default handler is registered. [ruby-dev:48592] [Bug #9820]
- * lib/rss/rss.rb: improved ignore_unknown_element
- handling. RSS::NotExpectedTagError provides tag URI.
- * lib/rss/parser.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/content.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+Mon Oct 6 16:07:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rss/rss-assertions.rb: checked URI of not expected tag too.
- * test/rss/test_parser.rb: ditto.
+ * test/ruby/test_string.rb (test_LSHIFT_neary_long_max): enable
+ only on platforms where string size range is smaller than memory
+ space. this test does not make sense but just wastes memory and
+ time on other platforms, as it is hardly possible that a string
+ size becomes neary LONG_MAX if long size equals pointer size.
+ [ruby-core:65410] [Bug #10325]
-Sun Jun 18 18:08:36 2006 Kouhei Sutou <kou@cozmixng.org>
+Mon Oct 6 11:21:21 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/rss/rss.rb: changed empty namespace URI representation to ""
- from nil.
- * lib/rss/parser.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
+ * tool/unicode_norm_gen.rb: Adding/tweaking comments.
-Sun Jun 18 18:03:50 2006 Kouhei Sutou <kou@cozmixng.org>
+Mon Oct 6 10:57:57 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/rss/parser.rb: removed a guard for requiring open-uri.
+ * tool/unicode_norm_gen.rb: Adjusted directory paths.
-Sun Jun 18 18:01:26 2006 Kouhei Sutou <kou@cozmixng.org>
+Mon Oct 6 10:27:27 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/rss/rss.rb: fixed typo: except -> expect
- * lib/rss/parser.rb: ditto.
- * test/rss/rss-assertions.rb: ditto.
- * test/rss/test_parser.rb: ditto.
+ * tool/unicode_norm_gen.rb: Data generation script imported from
+ https://github.com/duerst/eprun/blob/master/lib/generate.rb
-Sun Jun 18 17:52:39 2006 Kouhei Sutou <kou@cozmixng.org>
+Mon Oct 6 10:15:15 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/taxonomy.rb: ditto.
- * lib/rss/trackback.rb: ditto.
+ * tool/downloader.rb: Adjust example in documentation for
+ Downloader.download.
- * test/rss/test_1.0.rb: removed RSS::Element.indent_size tests.
- * test/rss/test_2.0.rb: ditto.
+Mon Oct 6 10:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Sun Jun 18 00:49:11 2006 Tanaka Akira <akr@m17n.org>
+ * lib/unicode_normalize: New folder for Unicode normalization
+ functionality
- * ext/socket/socket.c (bsock_recv_nonblock): new method
- BasicSocket#recv_nonblock.
- (udp_recvfrom_nonblock): renamed from ip_recvfrom_nonblock.
- IPSocket#recvfrom_nonblock is moved to UDPSocket#recvfrom_nonblock.
- (unix_recvfrom_nonblock): removed.
- UNIXSocket#recvfrom_nonblock is removed.
+Sun Oct 5 11:04:13 2014 Luiz Angelo Daros de Luca <luizluca@gmail.com>
-Sat Jun 17 22:17:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/digest/{md5,rmd160,sha1,sha2}/extconf.rb: configure OpenSSL
+ only if bundled libraries is not used, so that OpenSSL is not
+ linked unnecessarily. [ruby-core:65404] [Bug #10324]
- * lib/mathn.rb (Integer::prime_division): raise ZeroDivisionError
- on zeros. [ruby-dev:28739]
+Sun Oct 5 10:39:11 2014 Luiz Angelo Daros de Luca <luizluca@gmail.com>
-Sat Jun 17 14:53:32 2006 Tanaka Akira <akr@m17n.org>
+ * ext/digest/rmd160/extconf.rb: fix transform function name to
+ check. [ruby-core:65091] [Bug #10252]
- * lib/pathname.rb: backport from 1.9.
- (Kernel#Pathname): new method.
+Sun Oct 5 05:46:00 2014 Eric Wong <e@80x24.org>
-Sat Jun 17 10:30:41 2006 Kouhei Sutou <kou@cozmixng.org>
+ * ext/zlib/zlib.c (zstream_mark, zstream_free): update signature
+ (gzfile_mark, gzfile_free): ditto
+ (zstream_memsize): new function for rb_data_type->dsize
+ (gzfile_memsize): ditto
+ (zstream_data_type, gzfile_data_type): new data types
+ (zstream_new): Data_Make_Struct => TypedData_Make_Struct
+ (gzfile_new): ditto
+ (get_zstream, get_gzfile): Data_Get_Struct => TypedData_Get_Struct
+ (rb_zstream_flush_next_in): ditto
+ (rb_zstream_flush_next_out): ditto
+ (rb_zstream_avail_out): ditto
+ (rb_zstream_avail_in): ditto
+ (rb_zstream_closed_p): ditto
+ (rb_deflate_initialize): ditto
+ (rb_deflate_init_copy): ditto
+ (rb_inflate_initialize): ditto
+ (gzfile_ensure_close): ditto
+ (rb_gzfile_closed_p): ditto
+ (rb_gzfile_path): ditto
+ (rb_gzwriter_initialize): ditto
+ (rb_gzreader_initialize): ditto
+ (rb_gzreader_unused): ditto
+ [ruby-core:65377] [Feature #10319]
- * lib/rss/rss.rb (Hash#merge, Enumerable#sort_by): removed.
+Sat Oct 4 16:24:41 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * lib/rss/rss.rb (RSS::RootElementMixin#to_xml): added.
- [ruby-talk:197284]
+ * test/test_syslog.rb (TestSyslog#test_log): In AIX, each output
+ line of LOG_PERROR to stderr has an additional empty line appended,
+ so skip that line.
- We can convert RSS version easily like the following:
- rss10 = RSS::Parser.parse(File.read("1.0.rdf"))
- File.open("2.0.rss", "w") {|f| f.print(rss10.to_xml("2.0"))}
+Sat Oct 4 16:05:49 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * test/rss/test_1.0.rb: added #to_xml test.
- * test/rss/test_2.0.rb: ditto.
+ * test/socket/test_unix.rb (TestSocket_UNIXSocket#test_too_long_path):
+ sockaddr_un.sun_path in AIX is defined as char[1024],
+ so "a" * 300 is not too long. "a" * 3000 would be enough.
- * test/rss/rss-testcase.rb: added some helper methods that
- generates sample RSS 2.0.
+Sat Oct 4 09:12:03 2014 Zachary Scott <e@zzak.io>
- * sample/rss/convert.rb: added a sample script to convert RSS format.
+ * ext/win32ole/sample/example*.rb: Add wait input to quit for examples
+ with patch provided by @windwiny [Fixes GH-705]
+ https://github.com/ruby/ruby/pull/705
-Sat Jun 17 10:23:22 2006 Kouhei Sutou <kou@cozmixng.org>
+Sat Oct 4 09:08:18 2014 Zachary Scott <e@zzak.io>
- * lib/rss/rss.rb (Kernel#funcall): removed.
- * lib/rss/parser.rb (Kernel.URI): removed.
+ * ext/win32ole/win32ole.c: [DOC] Fix typo in :nodoc: reported by
+ @windwiny to [Fix GH-705] https://github.com/ruby/ruby/pull/705
- * lib/rss/maker/: supported
- xxx.new_yyy do |yyy|
- yyy.zzz = zzz
- ...
- end
- style and this style became the style of the recommendation.
+ * ext/pty/pty.c: ditto
- Old style
- yyy = xxx.new_yyy
- yyy.zzz = zzz
- ...
- is supported too but this style isn't recommended.
- [ruby-talk:197284]
+Sat Oct 4 08:59:45 2014 Zachary Scott <e@zzak.io>
- * test/rss/test_*maker*.rb: used new recommended style.
+ * ext/openssl/ossl_rand.c: [DOC] Add call signature for pseudo_bytes
+ and random_bytes, wrap lines at 80 chars, and remove useless
+ comments.
-Sat Jun 17 09:03:47 2006 Kouhei Sutou <kou@cozmixng.org>
+Sat Oct 4 08:49:34 2014 Zachary Scott <e@zzak.io>
- * lib/rss, test/rss: backported from trunk. (2005-11-16 - now)
+ * ext/openssl/ossl_rand.c: [DOC] Add rdoc for method descriptions
+ By @vipulnsward [Fixes GH-657] https://github.com/ruby/ruby/pull/657
- * lib/rss/rss.rb (RSS::VERSION): 0.1.5 -> 0.1.6.
- * test/rss/test_version.rb (RSS::TestVersion#test_version): ditto.
+Sat Oct 4 08:23:48 2014 Zachary Scott <e@zzak.io>
- * lib/rss/trackback.rb: added TrackBack prefix.
- * lib/rss/maker/trackback.rb: ditto.
+ * ext/openssl/ossl_rand.c: Use rb_define_module_function instead of
+ macro. [Fixes GH-686] https://github.com/ruby/ruby/pull/686
- * lib/rss/rss.rb : removed needless argument 'prefix'.
- * lib/rss/parser.rb: ditto.
+Sat Oct 4 06:04:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rss/1.0.rb: added rdf:Bag.
+ * ext/win32ole/win32ole_method.c(olemethod_set_member): remove
+ redundant NULL check.
+ * ext/win32ole/win32ole_type.c(oletype_set_member): ditto.
- * lib/rss/taxonomy.rb: implemented taxonomy module.
- * test/rss/test_taxonomy.rb: added tests for taxonomy support.
+Sat Oct 4 00:25:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/1.0.rb: added convenience method 'resources'.
- * lib/rss/taxonomy.rb: ditto.
- * test/rss/rss-assertions.rb: added test for 'resources'.
- * test/rss/test_taxonomy.rb: ditto.
+ * .travis.yml: removed needless preparation for gcc.
- * lib/rss/rss.rb: fixed a indentation bug.
- * lib/rss/taxonomy.rb: fixed <taxo:topic> #to_s bug.
- * test/rss/test_taxonomy.rb: added a #to_s test.
+Fri Oct 3 23:41:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/maker/taxonomy.rb: implemented taxonomy module for RSS
- Maker.
- * lib/rss/taxonomy.rb: supported RSS Maker.
- * lib/rss/maker.rb: added taxonomy module support.
+ * .travis.yml: enabled gcc build with osx on travis.
- * lib/rss/rss.rb: adjusted to other element API.
- * lib/rss/1.0.rb: adjusted to other element API but backward
- compatibility is reserved.
- * lib/rss/0.9.rb: ditto.
+Fri Oct 3 23:22:23 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/rss/test_maker_taxo.rb: added test case for taxonomy module
- for RSS Maker.
- * test/rss/test_setup_maker_1.0.rb: added tests for taxo:topic.
+ * template/fake.rb.in: fix make install failure due to MSYS path
+ with mingw on MSYS environment.
+ [ruby-core:64965] [Bug #10230]
- * test/rss/test_setup_maker_1.0.rb: added backward compatibility
- test.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
+Fri Oct 3 21:02:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/rss/rss-testcase.rb: added convenience method for setting
- up taxo:topic.
- * test/rss/rss-assertions.rb: added assertion for taxo:topic.
+ * test/ruby/test_io.rb (TestIO#test_advise): avoid to infinite loop.
- * sample/rss/blend.rb: followed new API.
+Fri Oct 3 19:26:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/taxonomy.rb: changed class or module prefix to
- Taxonomy from Taxo.
- * lib/rss/maker/taxonomy.rb: ditto.
+ * .travis.yml: enabled test results of linux.
- * test/rss/test_taxonomy.rb: use #reject directory.
+Fri Oct 3 18:52:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/: use #__send__ instead of #send.
- * test/rss/: ditto.
+ * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2)
+ with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313]
- * lib/rss/parser.rb: added entity handling type predicate.
- * lib/rss/rexmlparser.rb: ditto.
- * lib/rss/xmlparser.rb: ditto.
- * lib/rss/xmlscanner.rb: ditto.
+Fri Oct 3 18:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rss/xmlscanner.rb: more robust entity handling.
+ * .travis.yml: Disabled to generate document on travis.
+ Reduce test running time.
- * test/rss/test_parser.rb: added an entity handling test.
+Fri Oct 3 12:42:15 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * test/rss/test_2.0.rb: added RSS 2.0 tests.
- * test/rss/rss-assertions.rb: extended XML stylesheet assertion.
- * lib/rss/0.9.rb: added initialize method.
- * test/rss/test_1.0.rb: cleanup.
+ * lib/matrix.rb: Add hstack & vstack methods.
+ Based on a patch by creasywuqiong. [Fix GH-344]
- * lib/rss/image.rb: added Image prefix.
- * lib/rss/maker/image.rb: ditto.
+Fri Oct 3 12:37:48 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/rss/rss.rb: improved type conversion.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
+ * lib/matrix.rb: Fix Matrix.rows copy bug.
+ Patch by Arron Mabrey. [Fix GH-707]
- * test/rss/test_2.0.rb: added type conversion tests.
- * test/rss/test_accessor.rb: ditto.
- * test/rss/test_to_s.rb: ditto.
- * test/rss/test_syndication.rb: ditto.
- * test/rss/test_setup_maker_2.0.rb: ditto.
- * test/rss/test_setup_maker_1.0.rb: ditto.
- * test/rss/test_setup_maker_0.9.rb: ditto.
- * test/rss/test_maker_sy.rb: ditto.
- * test/rss/test_maker_image.rb: ditto.
- * test/rss/test_maker_2.0.rb: ditto.
- * test/rss/test_maker_0.9.rb: ditto.
- * test/rss/test_image.rb: ditto.
+Fri Oct 3 06:06:28 2014 Eric Wong <e@80x24.org>
- * test/rss/test_maker_1.0.rb: use assert instead of assert_equal.
+ * st.c (next_pow2): new function (from old bignum.c)
+ (new_size): use next_pow2 function
- * test/rss/rss-assertions.rb: improved type conversion assertions.
+Fri Oct 3 05:58:58 2014 Eric Wong <e@80x24.org>
- * lib/rss/rss.rb: added backward compatibility codes.
- * lib/rss/parser.rb: ditto.
- * test/rss/test_parser.rb: ditto.
- * test/rss/test_2.0.rb: ditto.
+ * vm_trace.c (rb_tp_t): pack 56 => 48 bytes on 64-bit
-Sat Jun 17 02:01:00 2006 Tanaka Akira <akr@m17n.org>
+Thu Oct 2 18:41:45 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
- string.
+ * ext/etc/etc.c (etc_nprocessors): Windows support.
+ see [Feature #10267]
-Sat Jun 17 00:23:58 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 2 12:21:52 2014 Tanaka Akira <akr@fsij.org>
- * parse.y (reswords): kDO_BLOCK was missing. fixed: [ruby-core:7995]
+ * ext/etc/etc.c (etc_nprocessors): New method.
+ Accepted by matz at RubyKaigi 2014.
+ [ruby-core:65142] [Feature #10267]
-Sat Jun 17 00:02:15 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Thu Oct 2 07:56:49 2014 Eric Wong <e@80x24.org>
- * ext/win32ole/win32ole.c (ole_propertyput): support
- PROPERTYPUTREF. [ruby-talk:183042]
+ * iseq.c (rb_iseq_line_trace_each): explicit cast
+ Fix https://travis-ci.org/ruby/ruby/jobs/36814282
- * ext/win32ole/tests/test_propertyputref.rb: ditto.
+Thu Oct 2 05:40:05 2014 Eric Wong <e@80x24.org>
-Thu Jun 15 23:02:47 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ruby.h: set rb_event_flag_t to uint32_t
+ [ruby-core:65315] [misc #10249]
- * ext/win32ole/win32ole.c (fole_methods): The return value
- of WIN32OLE#ole_methods should include PROPERTYPUTREF methods.
+Thu Oct 2 05:32:17 2014 Eric Wong <e@80x24.org>
- * ext/win32ole/win32ole.c (fole_put_methods): The return value
- of WIN32OLE#ole_put_methods should include PROPERTYPUTREF methods.
+ * io.c (fptr_finalize): free memory before GC sweep
+ [ruby-core:65269] [Feature #10295]
- * ext/win32ole/tests/test_ole_methods.rb: ditto.
+Thu Oct 2 05:27:24 2014 Eric Wong <e@80x24.org>
- * ext/win32ole/tests/testall.rb : ditto.
+ * marshal.c (w_class): check dump_arg->compat_tbl before lookup
+ (w_object): lazy init ->compat_tbl before insert
+ (obj_alloc_by_class): ditto
+ (clear_dump_arg): free only non-NULL ->compat_tbl
+ (clear_load_arg): ditto for ->compat_tbl
+ (marshal_dump): ->compat_tbl defaults to zero
+ (marshal_load): ditto for ->compat_tbl
+ (r_entry0): check l->compat_tbl before lookup
+ (r_fixup_compat): ditto
+ [ruby-core:65305] [Feature #10302]
-Wed Jun 14 18:23:28 2006 Eric Hodel <drbrain@segment7.net>
+Wed Oct 1 21:14:34 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * enum.c (enum_any): Documentation typo.
+ * ext/win32ole/win32ole_type.c: use typed data.
-Wed Jun 14 15:01:09 2006 Eric Hodel <drbrain@segment7.net>
+Wed Oct 1 18:15:42 2014 Nolan Evans <nolane@gmail.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser#warn): Don't print
- warnings when -q is set.
+ * compile.c: remove commented out code.
-Wed Jun 14 23:03:53 2006 Tanaka Akira <akr@m17n.org>
+Wed Oct 1 17:38:53 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * configure.in: check sizeof(rlim_t).
- check setrlimit.
+ * test/fileutils/test_fileutils.rb: AIX does not allow
+ a sticky bit on a regular file.
- * process.c (proc_getrlimit): new method Process.getrlimit.
- (proc_setrlimit): new method Process.setrlimit.
+Wed Oct 1 17:31:41 2014 Eric Hodel <drbrain@segment7.net>
- * ruby.h (NUM2ULL): new macro.
+ * NEWS: Add RubyGems update.
-Mon Jun 12 22:25:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Oct 1 17:28:58 2014 Eric Hodel <drbrain@segment7.net>
- * sprintf.c (rb_f_sprintf): adjust precision length to prevent
- splitting multi-byte characters. [ruby-list:42389]
+ * lib/rubygems: Update to RubyGems 2.4.2.
+ * test/rubygems: ditto.
-Sun Jun 11 23:20:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 30 22:25:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/optparse.rb (OptionParser::Arguable#getopts): pass self to the
+ * parse.y (parser_data_type): separate ripper data type for from
parser.
-Sun Jun 11 10:00:57 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.h (write): not need to define on bcc.
-
-Sun Jun 11 08:30:33 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#getopts): new methods.
-
-Sat Jun 10 18:02:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo
- fixed: raize -> raise. [ruby-talk:196608]
-
-Thu Jun 8 14:19:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.[ch] (rb_w32_read, rb_w32_write): new functions.
- use recv() and send() when fd is socket. fixed: [ruby-dev:28694]
-
-Wed Jun 7 16:22:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile::make_tmpname): put dot between
- basename and pid. [ruby-talk:196272]
-
-Wed Jun 7 14:53:04 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (errmap): add some winsock errors.
-
-Wed Jun 7 11:34:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in: add new configure option `--with-winsock2' for mingw.
-
- * win32/Makefile.sub (config.h): define USE_WINSOCK2 in config.h
- instead of in CPPFLAGS.
-
- * ext/socket/extconf.rb: determine whether to use winsock2 or not
- by using with_config.
-
-Wed Jun 7 10:45:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
- new configure option `--with-winsock2'.
-
- * win32/win32.c (StartSockets): ditto.
-
- * ext/socket/extconf.rb: ditto.
-
- * win32/win32.c (open_ifs_socket): new function.
-
- * win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
- instead of socket().
- ifs socket support is backported from trunk.
-
-Wed Jun 7 09:14:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): binding for the return event hook should have
- consistent scope. [ruby-core:07928]
-
- * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
- event_hooks. no guarantee for arbitrary hook deletion.
- [ruby-dev:28632]
-
-Mon Jun 5 18:12:12 2006 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/socket.c (sock_s_unpack_sockaddr_in): reject
- non-AF_INET/AF_INET6 sockaddr.
- (sock_s_unpack_sockaddr_un): reject non-AF_UNIX sockaddr.
- [ruby-dev:28691]
-
-Sun Jun 4 20:40:19 2006 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/socket.c: fix sockaddr_un handling.
- [ruby-dev:28677]
-
-Fri Jun 2 22:08:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/forwardable.rb: RDoc typo fix from Jan Svitok
- <jan.svitok at gmail.com>. [ruby-core:07943]
-
-Fri Jun 2 19:02:09 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/extconf.rb: use create_header.
-
- * ext/openssl/ossl.h, ext/openssl/openssl_missing.h:
- include RUBY_EXTCONF_H.
-
-Fri Jun 2 17:16:52 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (CLEANINGS): remove extconf.h by distclean if created.
-
-Fri Jun 2 00:11:19 2006 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/socket.c (s_recvfrom): alen may be zero with UNIXSocket
- too. (tested on NetBSD 3.0)
- (s_recvfrom_nonblock): extracted from sock_recvfrom_nonblock.
- (sock_recvfrom_nonblock): use s_recvfrom_nonblock.
- (ip_recvfrom_nonblock): new method: IPSocket#recvfrom_nonblock
- (unix_recvfrom_nonblock): new method: UNIXSocket#recvfrom_nonblock
- (s_accept_nonblock): extracted from sock_accept_nonblock.
- (sock_accept_nonblock): use s_accept_nonblock.
- (tcp_accept_nonblock): new method: TCPServer#accept_nonblock
- (unix_accept_nonblock): new method: UNIXServer#accept_nonblock
-
-Thu Jun 1 19:12:37 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_cmdvector): backslashes inside single-quotes
- no longer has special meanings. fixed: [ruby-list:42311]
-
-Thu Jun 1 16:14:41 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_getcwd): runtime's getcwd() will not success
- if the length of the cwd is longer than MAX_PATH.
- fixed [ruby-list:42335]
-
-Thu Jun 1 11:29:14 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_getcwd): set errno if not set.
- fixed [ruby-list:42346]
-
-Sat May 27 11:29:46 2006 nobuyoshi nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): remove extinit files if no statically linked
- extensions.
-
-Fri May 26 09:05:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
-
- * ruby.h, lib/mkmf.rb (create_header): clear command line options for
- macros moved to extconf.h.
-
- * ext/extmk.rb (extract_makefile, extmk): made RUBY_EXTCONF_H and
- EXTSTATIC permanent.
-
- * ext/{dbm,digest/*,socket,zlib}/extconf.rb: used $defs and $INCFLAGS.
-
- * {bcc32,win32,wince}/Makefile.sub (COMPILE_C, COMPILE_CXX): added
- $(INCFLAGS).
-
- * lib/mkmf.rb (configuration): add $defs unless extconf.h was created.
-
-Thu May 25 01:52:07 2006 nobuyoshi nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (pkg_config): particular config commands support.
-
- * ext/extmk.rb: deal with $static set in extconf.rb.
-
- * mkconfig.rb: merge multiple entries to an entry with multiple lines.
-
- * lib/mkmf.rb: allow a series of commands to link.
-
- * win32/Makefile.sub: embed manifests.
-
- * win32/setup.mak: suffix OS name by runtime version.
-
-Wed May 24 23:52:11 2006 nobuyoshi nakada <nobu@ruby-lang.org>
-
- * configure.in (ac_install_sh): ignore dummy install-sh.
- [ruby-talk:193876]
-
-Wed May 24 03:10:48 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SocketForwarder#setsockopt,getsockopt): typo fixed.
-
-Mon May 22 17:54:12 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (sock_recvfrom_nonblock): use rb_read_pending
- instead of rb_io_read_pending.
- [ruby-dev:28663]
-
-Mon May 22 17:30:04 2006 Tanaka Akira <akr@m17n.org>
-
- * rubyio.h (rb_io_set_nonblock): declared.
-
- * io.c (rb_io_set_nonblock): new function.
- (io_getpartial): nonblocking read support.
- (io_read_nonblock): new method: IO#read_nonblock.
- (io_write_nonblock): new method: IO#write_nonblock.
-
- * ext/socket/socket.c
- (sock_connect_nonblock): new method: Socket#connect_nonblock.
- (sock_accept_nonblock): new method: Socket#accept_nonblock.
- (sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock.
-
- [ruby-core:7917]
-
-Mon May 22 15:57:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (umethod_bind): should not update original class.
- [ruby-dev:28636]
-
-Mon May 22 13:38:57 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (ev_const_get): should support constant access from
- within instance_eval(). [ruby-dev:28327]
-
-Thu May 18 17:51:32 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * time.c (time_timeval): should round for usec floating
- number. [ruby-core:07896]
-
- * time.c (time_add): ditto.
-
-Thu May 18 17:11:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::out): support utf-8. a patch from Fujioka
- <fuj at rabbix.jp>. [ruby-dev:28649]
-
-Thu May 18 00:42:12 2006 nobuyoshi nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb, lib/mkmf.rb: use BUILD_FILE_SEPARATOR in Makefiles.
-
-Wed May 17 17:55:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (sys_warning): should not call a vararg function
- rb_sys_warning() indirectly. [ruby-core:07886]
-
-Wed May 17 08:17:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): try to reduce errors using powersOf10
- table. [ruby-dev:28644]
-
-Tue May 16 15:34:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize): should not allow modifying literal
- regexps. frozen check moved from rb_reg_initialize_m as well.
-
-Tue May 16 09:20:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_initialize): should not modify untainted objects in
- safe levels higher than 3.
-
- * re.c (rb_memcmp): type change from char* to const void*.
-
- * dir.c (dir_close): should not close untainted dir stream.
-
- * dir.c (GetDIR): add tainted/frozen check for each dir operation.
-
-Mon May 15 17:42:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
- typo fixed. a patch from Florian Gross <florg at florg.net>.
-
-Sat May 13 16:14:05 2006 Tanaka Akira <akr@m17n.org>
-
- * lib/pp.rb (PP.mcall): new method.
- (Struct#pretty_print): call Kernel#class and Struct#members even if
- overridden.
- (Struct#pretty_print_cycle): ditto.
- [ruby-core:7865]
-
-Thu May 11 19:57:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): differ addition to minimize error.
- [ruby-dev:28619]
-
-Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
-
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
-
-Thu May 11 18:10:43 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): should not raise ERANGE when the input
- string does not have any digits. [ruby-dev:28629]
-
-Sun May 7 03:09:51 2006 Stephan Maka <stephan@spaceboyz.net>
-
- * lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP#initialize):
- Use AF_INET6 for nameservers containing colons.
-
-Sat May 6 00:38:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (trap): sig should be less then NSIG. Coverity found
- this bug. a patch from Kevin Tew <tewk at tewk.com>.
- [ruby-core:07823]
-
-Thu May 4 02:24:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syck/emitter.c (syck_scan_scalar): avoid accessing
- uninitialized array element. a patch from Pat Eyler
- <rubypate at gmail.com>. [ruby-core:07809]
-
- * array.c (rb_ary_fill): initialize local variables first. a
- patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
-
- * ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
- type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
- [ruby-core:07808]
-
-Wed May 3 02:12:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (make_hostent_internal): accept ai_family
- check from Sam Roberts <sroberts at uniserve.com>.
- [ruby-core:07691]
-
-Mon May 1 12:23:19 2006 <sinara@blade.nagaokaut.ac.jp>
-
- * numeric.c (num_div): use floor rather than rb_Integer().
- [ruby-dev:28589]
-
- * numeric.c (flo_divmod): the first element of Float#divmod should
- be an integer. [ruby-dev:28589]
-
- * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
-
-Sat Apr 29 22:42:08 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): should initialize
- flag. [ruby-core:07785]
-
-Fri Apr 28 10:53:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): should not cut off 18 digits for no
- reason. [ruby-core:07796]
-
- * util.c (ruby_strtod): fixed wrong conversion.
-
-Thu Apr 27 01:38:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_fill): internalize local variable "beg" to
- pacify Coverity. [ruby-core:07770]
-
-Wed Apr 26 16:59:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (pack_unpack): now supports CRLF newlines. a patch from
- <tommy at tmtm.org>. [ruby-dev:28601]
-
-Tue Apr 25 18:00:05 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c (delete_slaves): maybe increment the reference
- count of a NULL Tcl_Obj [ruby-core:07759].
-
-Tue Apr 25 07:55:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/jcode.rb (String::tr_s): should have translated non
- squeezing character sequence (i.e. a character) as well. thanks
- to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
-
-Tue Apr 25 00:08:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regex.c (re_compile_pattern): should check if c is not a
- multibyte character. a patch from KIMURA Koichi
- <kimura.koichi at canon.co.jp>. [ruby-dev:28598]
-
-Fri Apr 21 15:19:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c (lib_eventloop_ensure): refer freed pointer
- [ruby-core:07744] and memory leak.
-
-Fri Apr 21 12:14:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c: document update patch from Sam Roberts
- <sroberts at uniserve.com>. [ruby-core:07701]
-
-Wed Apr 19 13:55:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (arg): too much NEW_LIST()
-
- * eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
-
-Wed Apr 19 11:57:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
- [ruby-dev:28585]
-
- * parse.y (list_concat): revert last change.
-
- * parse.y (arg): use NODE_ARGSCAT for placeholder.
-
-Wed Apr 19 11:13:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
- mathew <meta at pobox.com>. [ruby-core:07738]
-
-Wed Apr 19 10:13:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_const_set): raise error when no target klass is
- supplied. [ruby-dev:28582]
-
-Wed Apr 19 09:49:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (list_concat): should not modify nodes other than
- NODE_ARRAY. [ruby-dev:28583]
-
-Tue Apr 18 17:40:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: add a binding to a container for a slave IP.
-
- * ext/tk/lib/tk.rb: update RELEASE_DATE.
-
- * ext/tk/tcltklib.c: forget to reset a Tcl interpreter.
-
- * ext/tk/stubs.c: fix potential bugs about handling rb_argv0.
-
-Tue Apr 18 00:11:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c: block_unique should be 1, not frame_unique.
- [ruby-dev:28577]
-
-Fri Aug 11 15:39:25 2006 Eric Hodel <drbrain@segment7.net>
-
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#find_body): Make RDoc
- ignore C function prototypes. Patch by Tilman Sauerbeck
- <tilman at code-monkey.de>. [ruby-core:8574]
- * lib/yaml/tag.rb: Replace nodoc with stopdoc so Module methods get
- documented.
-
-Mon Apr 10 01:03:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * prec.c (prec_prec_f): documentation patch from
- <gerardo.santana at gmail.com>. [ruby-core:07689]
-
-Sat Apr 8 02:34:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_pow): second operand may be too big even if
- it's a Fixnum. [ruby-talk:187984]
-
-Sat Apr 8 02:12:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * README.EXT: update symbol description. [ruby-talk:188104]
-
-Thu Apr 6 23:28:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * COPYING: explicitly note GPLv2. [ruby-talk:187922]
-
-Thu Apr 6 11:18:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/panedwindow.rb: lack of arguments. [ruby-core:7681]
-
-Thu Apr 6 01:04:47 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tcltklib.c: fix SEGV when embedding to an application.
- [ruby-core:7600]
-
- * ext/tk/tcltklib.c: fix SEGV at exit. [ruby-talk:186489]
-
- * ext/tk/tkutil/tkutil.c: follow to changing specification of
- instance_eval on ruby-1.9.x.
-
- * ext/tk/lib/tk.rb: ditto.
-
- * ext/tk/lib/multi-tk.rb: ditto.
-
- * ext/tk/lib/tk.rb: remove warning about redefinition of methods.
-
- * ext/tk/lib/tk/variable.rb: remove warning about unseting Tcl
- variables.
-
-Wed Mar 29 20:54:44 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (fole_getproperty): WIN32OLE#[] should accept
- multi arguments.
-
- * ext/win32ole/tests/testWIN32OLE.rb (test_setproperty_bracket): ditto.
-
-Wed Mar 29 10:07:44 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_each_char_to_hex, encode_fallback_subchar,
- e2w_conv): support C90 compiler.
-
-Wed Mar 29 06:48:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (backtrace): reports aliased method names in a generated
- backtrace. a patch from "U.Nakamura" <usa at garbagecollect.jp>.
- [ruby-dev:28471]
-
-Mon Mar 27 22:19:09 2006 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c, config.h}: imported nkf 2.0.6.
- * Add --ic / --oc option and mapping tables.
- * Add fallback option.
- * Add --no-best-fit-chars option.
- * Fix some bugs.
-
- * ext/nkf/nkf.c (nkf_split_options): added for parse option string.
-
- * ext/nkf/lib/kconv.rb (Kconv.to*): add -m0.
- Note that Kconv.to* still imply -X.
-
-Mon Mar 27 03:17:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): insecure calling should be checked for non
- NODE_SCOPE method invocations too.
-
- * eval.c (rb_alias): should preserve the current safe level as
- well as method definition.
-
-Fri Mar 24 23:14:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (yield_under_i): pass self again for instance_eval().
- [ruby-dev:28466]
-
-Fri Mar 24 17:20:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (rb_f_sleep): remove description about SIGALRM which
- is not valid on the current implementation. [ruby-dev:28464]
-
-Thu Mar 23 10:47:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (method_missing): should support argument splat in
- super. [ruby-talk:185438]
-
-Mon Mar 20 12:05:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in: Solaris SunPro compiler -rapth patch from
- <kuwa at labs.fujitsu.com>. [ruby-dev:28443]
-
-Mon Mar 20 09:40:23 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in: remove enable_rpath=no for Solaris.
- [ruby-dev:28440]
-
-Fri Mar 17 19:08:49 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: fix typo.
- [ruby-core:07571]
-
-Wed Mar 15 16:54:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): support libraries without *.so.
-
-Wed Mar 15 16:35:43 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c, ext/openssl/ossl_nsspki.c: should use
- "rb_str_new(0, 0)" to make empty string.
-
-Sat Mar 11 14:24:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::wrap): removed
- space before argument parenthesis. [ruby-talk:183630]
-
- * ruby.1: a clarification patch from David Lutterkort
- <dlutter at redhat.com>. [ruby-core:7508]
-
-Sat Mar 4 15:26:40 2006 Tanaka Akira <akr@m17n.org>
-
- * gc.c (id2ref): fix symbol test.
-
-Sat Mar 4 01:08:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
- directories. a patch from Eric Hodel <drbrain at segment7.net>.
- [ruby-core:07423]
-
-Thu Mar 2 19:44:18 2006 Tanaka Akira <akr@m17n.org>
-
- * gc.c: align VALUE with sizeof(RVALUE) globally.
- (is_pointer_to_heap): check alignment out of loop.
- (id2ref): avoid collision between symbols and objects.
- (rb_obj_id): ditto. moved from object.c.
- [ruby-talk:178364] [ruby-core:7305]
-
-Thu Mar 2 18:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_fd_writable): should not re-schedule output
- from KILLED thread (must be error printing).
-
-Thu Mar 2 17:57:49 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * gc.c: commited magic for reducing RVALUE size on windows. (24->20byte)
- [ruby-core:7474]
-
-Thu Mar 2 12:59:14 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (filetime_to_unixtime): should set tm_isdst to -1.
- stat() didn't treat daylight saving time property on WinNT.
- [ruby-talk:182100]
-
-Thu Mar 2 08:02:42 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (add_heap): heap_slots may overflow. a patch from Stefan
- Weil <weil at mail.berlios.de>.
-
-Wed Mar 1 00:24:31 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/rdoc/parsers/parse_rb.rb (read_escape): could not handle /\^/.
- merged Mr. Ishizuka's lib/irb/ruby-lex.rb 's patch rev 1.29.
- [ruby-talk:181631] [ruby-dev:28404]
-
-Tue Feb 28 09:32:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/drb/extservm.rb (invoke_service_command): cannot invoke command
- if command name is quoted on mswin32. [ruby-dev:28400]
-
-Mon Feb 27 00:19:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.h (SYM2ID): should not cast to signed long.
- [ruby-core:07414]
-
-Fri Feb 24 20:07:23 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/drbtest.rb (add_service_command): quote pathnames in the
- server's command line for space contained directory names.
- Thanks, arton. [ruby-dev:28386]
-
-Fri Feb 24 12:11:08 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * instruby.rb: install *.exe.manifest and *.dll.manifest if exist.
- It's for VC++8.
-
-Fri Feb 24 11:33:52 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/Makefile.sub (HAVE_HYPOT): bcc32 has hypot().
-
-Fri Feb 24 11:19:58 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (time_new_internal): add prototype to tell the compiler
- arugments types.
-
- * win32/win32.c (NtInitialize): need to set a handler for VC++8.
-
-Fri Feb 24 08:19:16 2006 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test.rb: Removed. Obsolete by test/nkf.
-
- * ext/.document: enabled documents in nkf and kconv
-
- * ext/nkf/nkf.c ext/nkf/lib/kconv.rb: Add rdoc.
-
-Thu Feb 23 22:39:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/Makefile.sub: use borlndmm.dll if possible. bcc32's RTL internal
- memory manager cannot handle large memory block properly.
- ex: 10000.times { "" << "." * 529671; GC.start } # crash
- [ruby-dev:28230]
-
-Thu Feb 23 13:20:28 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * eval.c (SETUP_ARGS0): fixed memory corruption. [ruby-dev:28360]
-
-Tue Feb 21 02:18:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in (mingw): have link. [ruby-list:41838]
-
- * win32/Makefile.sub (config.h): ditto.
-
-Tue Feb 21 02:07:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (f_arglist): should set command_start = Qtrue for
- command body. [ruby-talk:180648]
-
-Mon Feb 20 17:37:26 2006 Tanaka Akira <akr@m17n.org>
-
- * mkconfig.rb: alias RbConfig for Config.
-
-Mon Feb 20 12:27:53 2006 Kent Sibilev <ksruby@gmail.com>
-
- * lib/rational.rb (Integer::gcd): small typo fix.
- [ruby-core:07395]
-
-Mon Feb 20 01:05:27 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rational.rb (Integer::gcd): replaced by gcd4 in
- [ruby-core:07390]. [ruby-core:07377]
-
-Mon Feb 20 00:57:02 2006 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.h (OSSL_Debug): should not use __func__.
- [ruby-dev:28339]
-
-Sun Feb 19 04:46:29 2006 Guy Decoux <ts@moulon.inra.fr>
-
- * eval.c: initial value for block_unique must be 1.
- [ruby-talk:180420]
-
-Sat Feb 18 23:58:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tracer.rb (Tracer::Tracer.add_filter): turn on tracer mode
- only when caller() level size is one. [ruby-core:07389]
-
- * lib/rdoc/parsers/parse_rb.rb: need not to require "tracer".
- [ruby-core:07389]
-
- * sample/rtags.rb: ditto.
-
-Sat Feb 18 12:18:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils::fu_world_writable): make it
- private. [ruby-core:07383]
-
-Sat Feb 18 00:22:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tracer.rb: merged a minor clarification patch from Daniel
- Berger <Daniel.Berger at qwest.com>. [ruby-core:07376]
-
-Fri Feb 17 11:18:42 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330]
-
- * pack.c (EXTEND32): unpack("l") did not work where sizeof(long) != 4.
- [ruby-talk:180024]
-
- * pack.c (pack_unpack): fixed integer overflow on template "w".
- [ruby-talk:180126]
-
-Fri Feb 17 09:39:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_wait_for): sleep should always sleep for
- specified amount of time. [ruby-talk:180067]
-
-Thu Feb 16 01:10:48 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (backtrace): frame->orig_func may not be initialized.
- [ruby-core:07367]
-
-Wed Feb 15 16:52:52 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): NODE_OP_ASGN1 should allow splat in its
- argument list. [ruby-core:07366]
-
- * parse.y (arg): avoid unnecessary extra argument.
- [ruby-core:07366]
-
- * eval.c (rb_eval): honor visibility on OP_ASGN1 and
- OP_ASGN2. [ruby-core:07366]
-
-Wed Feb 15 10:09:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (yield_under_i): should not pass self as an argument to
- the block for instance_eval. [ruby-core:07364]
-
-Wed Feb 15 09:20:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_obj_instance_eval): should be no singleton classes for
- true, false, and nil. [ruby-dev:28186]
-
-Tue Feb 14 18:48:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (DMETHOD_P): accessing wrong frame. [ruby-dev:28181]
-
- * eval.c (proc_invoke): preserve FRAME_DMETH flag.
-
-Tue Feb 14 15:13:51 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/zlib/zlib.c: supress warning on test/zlib. [ruby-dev:28323]
-
-Tue Feb 14 14:01:17 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (search_time_t): support non 32bit time_t environments.
-
- * win32/Makefile.sub (config.h): VC++8 has ``long long'' type.
-
- * win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.
-
- * win32/win32.c (rb_w32_utime): drop read-only attribute before
- changing file time.
-
- all changes are backported from CVS HEAD.
-
-Tue Feb 14 11:21:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (argf_forward): should not use frame->argv.
- [ruby-core:07358]
-
-Mon Feb 13 18:08:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): argument update propagation. [ruby-dev:28044]
-
- * env.h: remove argv member from struct FRAME.
-
-Mon Feb 13 13:27:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): should push class from binding if supplied.
- [ruby-core:07347]
-
-Mon Feb 13 00:04:00 2006 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb (ERB::Compiler): add instance variable @insert_cmd to
- change <%='s behavior. (backported 1.15 - 1.16)
-
-Sat Feb 11 02:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): no need to push ruby_class. [ruby-dev:28176]
-
-Sat Feb 11 01:57:44 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_autoload): check if ruby_cbase is nil (during
- instance_eval for objects cannot have singleton classes,
- e.g. fixnums and symbols). [ruby-dev:28178]
-
-Tue Feb 7 23:03:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/zlib/zlib.c: should not access ruby objects in finalizer.
- [ruby-dev:28286]
-
-Mon Feb 6 16:02:51 2006 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.
- In such situation, flock() should return 0.
-
-Mon Feb 6 00:41:08 2006 Tanaka Akira <akr@m17n.org>
-
- * ruby.h (RSTRUCT_LEN, RSTRUCT_PTR): defined for source level
- compatibility with ruby 1.9.
-
-Sun Feb 5 21:05:34 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * numeric.c (fix_to_s): removed workaround for radix 2. Historically,
- rb_fix2str could only handle radix 8, 10, 16. (Rev1.37) But for now,
- it can handle radix 2..36. [ruby-Bugs#3438] [ruby-core:7300]
-
-Sun Feb 5 18:55:08 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: imported from trunk, rev 1.129
-
- * lib/net/http.rb (add_field, get_fields): keep 1.8.2 backward
- compatibility.
-
- * lib/net/https.rb: imported from trunk, rev 1.3.
-
- * lib/net/https.rb: #use_ssl? definition moved from net/http.rb.
-
-Sun Feb 5 14:22:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/pstore.rb: should return default value if name is not found.
- [ruby-core:7304]
-
- * lib/pstore.rb: should raise PStore::Error if not in transaction.
-
-Sat Feb 4 22:51:43 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c: apply the FreeBSD getcontext/setcontext workaround
- only before FreeBSD 7-CURRENT.
-
-Sat Feb 4 21:19:23 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (LK_ERR): ERROR_NOT_LOCKED is not an error.
- In such situation, flock() should return 0.
-
-Sat Feb 4 15:56:37 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
- sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
-
-Fri Feb 3 15:06:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/syck.c (syck_move_tokens): should reset p->cursor or etc
- even if skip == 0. This causes buffer overrun.
- (ex: YAML.load('--- "..' + '\x82\xA0' * 511 + '"'))
-
-Thu Feb 2 23:51:18 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/emitter.c (syck_emitter_write): should not set '\0' on
- emitter's marker. if marker points to the end of buffer, this causes
- buffer overrun. (ex: YAML.dump("." * 12288))
-
-Thu Feb 2 16:01:24 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): need not to protect $SAFE value.
- [ruby-core:07177]
-
-Thu Feb 2 14:45:53 2006 Ville Mattila <ville.mattila@stonesoft.com>
-
- * configure.in: The isinf is not regognized by autoconf
- library guesser on solaris 10. [ruby-core:7138]
-
-Wed Feb 1 22:01:47 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3)
- where they are supported. modifing environ variable seems to
- segfault solaris 10. [ruby-core:7276] [ruby-dev:28270]
-
- * ruby.c (set_arg0): if use setenv(3), environ space cannot be used
- for altering argv[0].
-
-Tue Jan 31 14:46:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * struct.c (rb_struct_select): update RDoc description.
- [ruby-core:7254]
-
-Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#eval and bg_eval.
-
- * ext/tk/lib/tk/namespace.rb: TkNamespace#eval was enbugged at the
- last commit. Now it will return a proper object.
-
-Tue Jan 31 00:10:26 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c (syck_resolver_transfer): workaround for SEGV.
- ex: ruby -ryaml -e 'YAML.load("!map:B {}")' [ruby-core:7217]
-
-Sat Jan 28 07:56:57 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/rdoc/usage.rb: support "a:0:33" style caller[-1]. In this case
- file name is "a:0". I don't know this really happens though...
- [ruby-Bugs:3344]
-
-Wed Jan 25 22:29:04 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, dln.c, file.c, intern.h, missing.h (eaccess): use
- system routine if provided. fixed: [ruby-core:07195]
-
-Sun Jan 22 23:27:13 2006 Go Noguchi <gonoguti@yahoo.co.jp>
-
- * lib/test/unit/autorunner.rb (process_args): ignore arguments after
- '--' so that test scripts can handle them. fixed: [ruby-dev:28258]
-
-Sun Jan 22 22:09:52 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (POST_GETCONTEXT): define separately from PRE_GETCONTEXT on
- IA64 to avoid reusing variable address.
-
-Sun Jan 22 20:03:35 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (ruby_setjmp): define PRE_GETCONTEXT and POST_GETCONTEXT
- instead of FUNCTION_CALL_MAY_RETURN_TWICE.
- define PRE_GETCONTEXT to clear carry flag for workaround of
- FreeBSD/i386 getcontext/setcontext bug.
- [ruby-dev:28263]
-
-Sat Jan 21 00:36:47 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): use only on SPARC and IA64
- before gcc 4.0.3.
- [ruby-dev:28247]
-
-Thu Jan 19 22:21:23 2006 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (mv): should remove file after copying.
- [ruby-dev:28223]
-
-Wed Jan 18 23:37:06 2006 Tanaka Akira <akr@m17n.org>
-
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): don't clobber %l7 of SPARC
- if enable-shared.
- (ruby_setjmp): call FUNCTION_CALL_MAY_RETURN_TWICE after getcontext
- too.
- reported by Pav Lucistnik and Marius Strobl.
- http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
-
-Tue Jan 17 11:32:46 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/setup.mak (MAKE): workaround for nmake 8.
-
-Tue Jan 17 11:10:21 2006 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/{Makefile.sub,setup.mak}: invoke .bat via shell. workaround
- for nmake 8.
-
-Mon Jan 16 10:26:23 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/emitter.c (syck_emit_seq, syck_emit_map, syck_emit_item):
- should output complex key mark even if map's key is empty seq/map.
- [ruby-core:7129]
-
-Sat Jan 14 05:37:06 2006 Tanaka Akira <akr@m17n.org>
-
- * io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): defined
- for DragonFly BSD 1.4.0.
-
-Sat Jan 14 03:43:24 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
- sizeof(void*).
-
-Fri Jan 13 19:14:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/rdoc/diagram.rb:
- - properly quote bare element attributes
- - terminates dangling elements (e.g. <img>, <br>, <link>, etc)
- - converts "CVS" to the more HTML-friendly acronym element
- - adds missing type attributes to style elements
-
- based on Paul Duncan's patch <pabs@pablotron.org> [ruby-core:7028]
-
- * lib/rdoc/generators/html_generator.rb: ditto.
- * lib/rdoc/generators/template/html/hefss.rb: ditto.
- * lib/rdoc/generators/template/html/html.rb: ditto.
- * lib/rdoc/generators/template/html/kilmer.rb: ditto.
-
-Thu Jan 12 11:53:08 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/sample/tkballoonhelp.rb: [bug fix] couldn't add to a widget
- which is constructed with TkComposite module.
- [new feature] support 'command' option which is called just before
- popping up the balloon help.
-
-Wed Jan 11 15:00:00 2006 Ville Mattila <mulperi@iki.fi>
-
- * io.c (READ_PENDING*): Support solaris 64-bit environments.
- Solaris defines a opaque FILE struct when compiling 64 bit
- binaries. This means that we dont have access to _ptr etc.
- members anymore. The solution by Steven Lumos is to define
- FILE64 that has needed members available. I've modified
- the origanal patch a bit so that it compiles both with gcc
- and now free sun studio 11 compiler and both amd64 and sparc.
- NOTE! We have to 64 bit solaris FILE structure time to time
- otherwise we'll get breakage.
- [ruby-core:7106]
-
-Tue Jan 10 19:42:33 2006 Tanaka Akira <akr@m17n.org>
-
- * gc.c (garbage_collect): mark ruby_current_node.
- if an exception is raised in a finalizer called written in C by
- rb_gc_call_finalizer_at_exit, ruby_set_current_source may use
- collected ruby_current_node and mark_source_filename may corrupt
- memory.
-
-Tue Jan 10 13:30:34 2006 akira yamada <akira@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_resolver_transfer): should be able to load
- !ruby/object:Bignum syntax 1.8.3 dumped. [ruby-core:6159]
-
-Tue Jan 10 12:47:41 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/yaml/rubytypes.rb (Fixnum): Bignum could not be loaded in
- ruby 1.8.3/1.8.4. [ruby-core:6115]
-
- * lib/yaml/rubytypes.rb (Numeric): Subclass of Numeric could not
- be dumped properly. [ruby-core:7047]
-
-Tue Jan 10 12:00:48 2006 Aaron Schrab <aaron @nospam@ schrab.com>
-
- * lib/yaml/rubytypes.rb (Symbol#yaml_new): YAML loading of quoted
- Symbols broken. [ruby-Bugs:2535]
-
-Mon Jan 9 19:54:35 2006 arton <artonx@yahoo.co.jp>
-
- * ext/zlib/extconf.rb: zlib compiled DLL version 1.2.3 distributed by
- http://www.zlib.net/ has zdll.lib. [ruby-dev:28209]
-
-Mon Jan 9 14:17:12 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/Makefile.sub (OPTFLAGS): I have experienced trouble on y- flag,
- (VisualC++6) so use -O2b2xg- if $(MSC_VER) < 1400. [ruby-core:7040]
-
-Mon Jan 9 14:17:12 2006 Kero van Gelder <rubyforge @nospam@ kero.tmfweb.nl>
-
- * lib/webrick/httpservlet/filehandler.rb: fixed typo. [ruby-core:7075]
-
-Sat Jan 7 15:40:07 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (singleton): get rid of segfault on syntax error.
- fixed: [ruby-core:07070]
-
-Fri Jan 6 10:16:20 2006 Steven Lumos <steven@lumos.us>
-
- * io.c (READ_DATA_PENDING): defined for 64bit Solaris on SPARC.
- [ruby-core:7057]
- (READ_DATA_PENDING_COUNT): ditto.
- (READ_DATA_PENDING_PTR): ditto.
-
-Sun Jan 1 17:07:59 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
- the location which rb_w32_telldir didn't return. [ruby-core:7035]
- (I think HEAD implementation is better. but binary compatibility)
-
- * test/ruby/test_dir.rb: added.
-
-Sat Dec 31 22:57:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_save_context): should not recycle scope object used
- in a thread. fixed: [ruby-dev:28177]
-
-Fri Dec 30 18:22:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (garbage_collect): mark objects refered from aborting threads.
- [ruby-dev:28190]
-
- * win32/Makefile.sub: VC++8 support.
-
-Fri Dec 30 14:24:53 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * dir.c (glob_helper): do not use TRUE for djgpp.
-
-Fri Dec 30 04:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (eaccess): workaround for VC++8 runtime.
-
- * win32/win32.c (ioinfo): VC++8 support.
-
-Thu Dec 29 23:59:37 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_gc_mark_threads): leave unmarked threads which won't wake
- up alone, and mark threads in the loading table. [ruby-dev:28154]
-
- * eval.c (rb_gc_abort_threads), gc.c (gc_sweep): kill unmarked
- threads. [ruby-dev:28172]
-
-Thu Dec 29 17:02:07 2005 Tanaka Akira <akr@m17n.org>
-
- * test/ruby/envutil.rb (EnvUtil.rubybin): search "ruby" instead of
- "miniruby". [ruby-dev:28140]
-
-Tue Dec 27 16:59:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/drb/drbtest.rb (DRbService::self.ext_service): increase
- timeout limit. a patch from Kazuhiro NISHIYAMA
- <zn at mbf.nifty.com>. [ruby-dev:28132]
-
-Tue Dec 27 08:29:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_chech):
- treat wildcard character in commonName. [ruby-dev:28121]
-
-Mon Dec 26 22:32:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
- NEW_VALIAS), parse.y (fitem): allow dynamic symbols to
- NODE_UNDEF and NODE_ALIAS.
- backported from trunk. fixed: [ruby-dev:28105]
-
-Mon Dec 26 08:50:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (ev_const_get): fixed a bug in constant reference during
- instance_eval. [yarv-dev:707]
-
- * eval.c (ev_const_defined): ditto.
-
- * lib/yaml.rb (YAML::add_domain_type): typo fixed. a patch from
- Joel VanderWerf <vjoel at path.berkeley.edu>.
- [ruby-talk:165285] [ruby-core:6995]
-
-Sat Dec 24 18:58:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * stable version 1.8.4 released.
-
-Fri Dec 23 10:30:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/digest/sha2/sha2.c (ULL): support AIX C. a patch from
- Kailden <kailden at gmail.com>. [ruby-core:06984]
-
-Wed Dec 21 16:53:06 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * file.c (w32_io_info): should return handle because FileIndex is
- valid only while file is open. [ruby-dev:28088]
-
-Wed Dec 21 14:53:26 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (test_kernel_open): use File.identical?.
- [ruby-talk:171804]
-
-Tue Dec 20 22:41:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (eval_under_i): evaluate source in caller's frame.
- [ruby-dev:28076]
-
- * eval.c (rb_call_super): use original method name on exception.
- [ruby-dev:28078]
-
-Tue Dec 20 13:11:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/rubyext.c: fixed GC problem (backported HEAD 1.55 - 1.62)
- [ruby-dev:27839]
-
- * ext/syck/syck.h (S_FREE): small hack. no need to check if pointer is
- NULL or not before S_FREE.
-
- * st.c: uses malloc instead of xmalloc to avoid GC. syck uses st_insert
- in gram.c to insert node from rb_syck_bad_anchor_handler into
- SyckParser's hash table. if GC occurs in st_insert, it's not under
- SyckParser's mark system yet. so RString can be released wrongly.
- [ruby-dev:28057]
-
-Tue Dec 20 12:53:23 2005 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_emitter_reset): to ensure compatibility
- with previous Ruby versions, documents are no longer headless.
-
-Tue Dec 20 01:46:48 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_f_backquote): fix a GC problem on
- IA64 with gcc 4.0.3 20051216 (prerelease) -O3.
-
-Mon Dec 19 23:32:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047]
-
-Sat Dec 17 03:57:01 2005 Tanaka Akira <akr@m17n.org>
-
- * bignum.c (rb_big_rshift): fix a GC problem on
- IA64 with gcc 4.0.3 20051216 (prerelease).
-
-Sat Dec 17 03:30:23 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (bmcall): fix a GC problem by tail call on
- IA64 with gcc 4.0.3 20051216 (prerelease).
-
-Fri Dec 16 00:54:06 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (Init_signal): revert C++ style comment.
- [ruby-dev:28041]
-
-Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/tmpdir.rb: merged RDoc patch from Eric Hodel <drbrain at
- segment7.net>. [ruby-core:06894]
-
-Thu Dec 15 01:33:31 2005 Tanaka Akira <akr@m17n.org>
-
- * ext/zlib/zlib.c (zstream_run): fix a GC problem by tail call on
- x86_64 with gcc 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)
-
-Wed Dec 14 12:11:46 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * test/gdbm/test_gdbm.rb: specify pid for the argument of
- Process.wait. workaround for Cygwin.
-
-Wed Dec 14 12:01:26 2005 Tanaka Akira <akr@m17n.org>
-
- * marshal.c (r_object0): fix a GC problem for reading a bignum on
- IA64 with gcc 3.3.5 (Debian 1:3.3.5-13).
-
-Tue Dec 13 12:23:47 2005 Tanaka Akira <akr@m17n.org>
-
- * re.c (rb_reg_regcomp): fix a GC problem on x86_64 with
- gcc 3.3.5 (Debian 1:3.3.5-13).
-
-Tue Dec 13 01:44:16 2005 Tanaka Akira <akr@m17n.org>
-
- * array.c (rb_ary_diff): fix a GC problem on IA64 with
- gcc 3.3.5 (Debian 1:3.3.5-13).
- When rb_ary_push is called, there was no register which contains
- `hash' but `&RHASH(hash)->tbl' instead.
-
-Tue Dec 13 00:08:09 2005 Tanaka Akira <akr@m17n.org>
-
- * sprintf.c (rb_str_format): fix a GC problem.
- [ruby-dev:28001]
-
-Mon Dec 12 15:54:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/openssl/test_ssl.rb (test_parallel): call GC.start to close
- unused files. [ruby-dev:27981]
-
-Mon Dec 12 00:33:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/digest/digest.c (rb_digest_base_s_digest): add volatile to
- protect temporary context object. [ruby-dev:27979]
-
- * ext/iconv/iconv.c (Init_iconv): rb_gc_register_address() should
- be called before actual variable initialization.
- [ruby-dev:27986]
-
-Fri Dec 9 23:31:02 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rexml/encoding.rb (encoding=): give priority to particular
- conversion to iconv. [ruby-core:06520]
-
-Thu Dec 8 02:07:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (umethod_bind): adjust invoking class for module method.
- [ruby-dev:27964]
-
-Thu Dec 8 00:40:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (call_trace_func): klass parameter should be a
- class/module that defines calling method. [ruby-talk:169307]
-
-Wed Dec 7 17:10:27 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * sprintf.c (rb_f_sprintf): [ruby-dev:27967]
-
-Wed Dec 7 15:31:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_str_format): integer overflow check added.
-
- * sprintf.c (GETASTER): ditto.
-
-Wed Dec 7 01:02:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/README.macosx-aqua: [new document] tips to avoid the known
- bug on platform specific dialogs of Tcl/Tk Aqua on MacOS X.
-
- * ext/tk/tcltklib.c: fix bug on switching threads and waiting on the
- deleted interpreter on vwait and tkwait command.
-
- * ext/tk/lib/multi-tk.rb: kill the meaningless loop for the deleted Tk
- interpreter.
-
- * ext/tk/sample/demos-jp/image3.rb: [bug fix] wrong argument.
-
- * ext/tk/sample/demos-en/image3.rb: ditto.
-
- * ext/tk/sample/demos-jp/menu.rb: fix message for MacOS X.
-
- * ext/tk/sample/demos-jp/menu8x.rb: ditto.
-
- * ext/tk/sample/demos-en/menu.rb: ditto.
-
-Tue Dec 6 16:37:57 2005 Yuya Nishida <yuya@j96.org>
-
- * eval.c (exec_under): avoid accessing ruby_frame->prev.
- [ruby-dev:27948]
-
-Thu Dec 1 00:50:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_funcall2): allow to call protected methods.
- fixed: [ruby-dev:27890]
-
-Wed Nov 30 23:52:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (NEWHEAP, ADD2HEAP): set count after pointer was set.
- fixed: [ruby-dev:27896]
-
-Wed Nov 30 13:43:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-expr-beg): support $! at the end of
- expression. [ruby-dev:27868]
-
-Mon Nov 28 18:55:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (init_inetsock_internal): remove setting
- SO_REUSEADDR option on server socket on Cygwin.
- fixed: [ruby-core:6765] ([ ruby-Bugs-2872 ])
-
-Mon Nov 28 13:08:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
- error message on bccwin32 + winsock)
-
-Mon Nov 28 09:21:49 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/mkmf.rb (create_makefile): should not change sodir with
- dir.gsub!. (bccwin32 failed to install third party exntesions)
- [ruby-dev:27834]
-
-Sun Nov 27 00:56:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/wsdl/xmlSchema/complexContent.rb: missing
- ComplexContent#elementformdefault method.
-
-Sat Nov 26 19:57:45 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * dln.c (conv_to_posix_path): should initialize posix.
-
-Thu Nov 24 21:05:58 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in (AC_CHECK_FUNCS): need to check link().
- fixed: [ruby-dev:27814]
-
-Thu Nov 24 01:22:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * file.c (w32_io_info): CreateFile failed on Win9x if file was already
- opened. (FILE_SHARE_READ was needed, but actually I don't understand
- the flags of CreateFile well...)
-
-Wed Nov 23 20:59:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: add Tk.pkgconfig_list and Tk.pkgconfig_get
- [Tk8.5 feature].
-
- * ext/tk/lib/tk/text.rb: supports new indices modifires on a Text
- widget [Tk8.5 feature].
-
- * ext/tk/lib/tk/virtevent.rb: add TkNamedVirtualEvent.
-
- * ext/tk/lib/tk/autoload.rb: ditto.
-
- * ext/tk/lib/tk/event.rb: add :data key for virtual events [Tk8.5
- feature].
-
-Wed Nov 23 18:55:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * file.c (w32_io_info): should not call GetFileInformationByHandle
- for pipe.
-
- * file.c (w32_io_info): checks return value from rb_w32_get_osfhandle.
-
- * file.c (w32_io_info): now can identify directory on WinNT.
-
-Wed Nov 23 03:40:49 2005 Guy Decoux <ts@moulon.inra.fr>
-
- * re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
- [ruby-core:06721]
-
-Wed Nov 23 11:01:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * intern.h, file.c: failed to compile on windows.
-
-Wed Nov 23 07:26:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/extconf.rb: check for X509V3_EXT_nconf_nid.
-
- * ext/openssl/ossl_x509ext.c (MakeX509ExtFactory): should use
- OPENSSL_malloc to allocate X509V3_CTX.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): use
- X509V3_EXT_nconf_nid to avoid SEGV (and to build extensions which
- values are placed in separate section).
-
- * test/openssl/test_x509ext.rb: new file.
-
-Wed Nov 23 01:22:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (test_identical): test if two files are identical.
-
- * file.c (rb_f_test): support DOSISH systems where st_ino is not
- reliable. fixed: [ruby-core:06672]
-
- * win32.h, win32.c (rb_w32_osid): check the running platform.
-
-Tue Nov 22 23:52:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb: match incomplete (in current enconding) multibyte
- string. http://inamode6.tokuhirom.dnsalias.org/show/1551
-
-Tue Nov 22 18:36:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
-
-Tue Nov 22 14:46:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
-
- * test/ruby/test_path.rb (test_dirname, test_basename): follow new
- spec. and add new tests.
-
-Tue Nov 22 13:18:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.c (rb_w32_stat): Dir.chdir('//server/shared');
- p Dir.glob('*') should work on WinNT. (implemented our own
- stat(2) on WinNT) [ruby-list:41552] [ruby-dev:27711]
-
-Tue Nov 22 02:31:53 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tkextlib/tile.rb: bug fix (Tk::Tile::USE_TTK_NAMESPACE
- is not defined).
-
-Tue Nov 22 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin but
- DOSISH is not. fixed: [ruby-dev:27797]
-
-Mon Nov 21 22:50:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path
- should not be splitted. fixed: [ruby-dev:27776] [ruby-dev:27786]
-
- * parse.y (dsym): prohibit empty symbol literal by interpolation.
- fixed: [ruby-talk:166529]
-
-Mon Nov 21 16:03:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/setup.mk: findstr doesn't exist on win9x.
- fixed: [ruby-dev:27756]
-
-Sun Nov 20 22:34:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_symname_p): [ not followed by ] is not valid symbol.
- fixed: [ruby-talk:166520]
-
-Sat Nov 19 19:57:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils::ln): ln documentation fix.
- [ruby-core:06661]
-
-Sat Nov 19 07:34:32 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/font.rb: remove dependency on Ruby's version (1.8
- or 1.9).
-
- * ext/tk/lib/tkextlib/ICONS/icons.rb: ditto.
-
- * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.
-
-Fri Nov 18 17:57:08 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_file_s_dirname): should use skipprefix for UNC path.
- pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076]
-
-Fri Nov 18 17:35:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: add restriction to access the entried
- command table and manipulate other IPs (for reason of security).
- Now, a IP object can be controlled by only its master IP or the
- default IP.
-
- * ext/tk/lib/remote-tk.rb: add restriction to manipulate.
-
- * ext/tk/tcltklib.c (ip_is_slave_of_p): add TclTkIp#slave_of?(ip)
- to check manipulability.
-
- * ext/tk/lib/tk.rb: bug fix on handling of Tcl's namespaces.
-
- * ext/tk/lib/tk/namespace.rb: ditto.
-
-Fri Nov 18 17:26:06 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_file_s_dirname): added checks for some patterns with drive
- letter. fixed: [ruby-dev:27738]
-
- * test/ruby/test_path.rb (test_dirname): added tests for above
- patterns.
-
-Fri Nov 18 12:18:02 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.h (S_IFIFO): r,w = IO.pipe; r.stat.pipe? now
- returns true on VisualC++6.
-
-Wed Nov 16 23:24:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (static-ruby): overridable.
-
- * ext/extmk.rb (parse_args): force to link extensions statically only
- if static is given for extstatic.
-
- * ext/extmk.rb (RUBY, RUBYW): overridable.
-
-Tue Nov 15 23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/find.rb (Find::find): should not ignore symbolic links to
- non-existing files. [ruby-talk:165866]
-
-Tue Nov 15 16:23:26 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * array.c (rb_ary_fill): previous commit disabled this usage:
-
- a = [0,1,2,3,4,5,6,7,8,9]
- a.fill {|i| a[i] * 10} #=> [nil, nil, ...., nil]
-
- previous commit has the advantage of early garbage collection, but
- potensially this would break some script. so I reverted behavior.
-
-Tue Nov 15 16:04:10 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * array.c (rb_ary_fill): tail elements were vanished when the middle
- part of array was filled. (ie: [0,1,2,3,4].fill(-1,2,1) => [0,1,-1])
-
- * test/ruby/test_array.rb (test_fill): added.
-
-Tue Nov 15 14:39:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_fill): should adjust array length correctly when
- an array is expanded in the fill process. [ruby-core:06625]
-
-Mon Nov 14 23:49:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.
- [ruby-dev:27699]
-
-Mon Nov 14 17:36:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_first): RDoc update from Daniel Berger
- <djberg96@yahoo.com>. [ruby-core:06577].
-
-Fri Nov 11 10:31:44 2005 Zach Dennis <zdennis@mktec.com>
-
- * ext/socket/socket.c: Socket Documentation. [ruby-core:6552]
-
-Fri Nov 11 08:20:56 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (OUTFLAG): keep trailing spaces. [ruby-dev:27666]
-
- * mkconfig.rb: substitution refereces added.
-
-Fri Nov 11 07:44:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * configure.in: undef HAVE_LINK on BeOS. (link(2) always returns
- EINVAL, and this causes error in test/fileutils.)
-
- * file.c: overwride chown(2) and fchown(2) on BeOS. (these functions
- should not change user/group id if -1 is passed as corresponding
- argument, and this causes error in test/fileutils too)
- [ruby-dev:27672]
-
- * file.c (rb_file_s_link): checks HAVE_LINK.
-
-Tue Nov 8 15:32:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/drb/ssl.rb (DRb::SSLConfig#accept): fixed typo.
- [ruby-dev:27560] [ruby-core:4627]
-
-Mon Nov 7 13:43:51 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/stubs.c (_nativethread_consistency_check): use simpler
- (low cost) way to check whether the Tcl interpreter was compiled
- with threads enabled of not.
-
- * ext/tk/tcltklib.c: reduce warnings.
-
- * ext/tk/tkutil/tkutil.c: ditto.
-
-Mon Nov 7 00:06:58 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/yaml.rb: removed :nodoc: to generate Kernel doc. [ruby-core:6324]
-
-Sun Nov 6 23:39:13 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (Iconv::BrokenLibrary): exception when detected a
- bug of underlying library.
-
-Sun Nov 6 21:46:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tk/stubs.c (ruby_tcl_create_ip_and_stubs_init): should touch
- interpreter after initialization is done. [ruby-dev:27638]
-
-Sun Nov 6 20:13:27 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE if
- buffer size is less than required. fixed: [ruby-dev:27634]
-
-Wed Nov 2 20:25:28 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/extconf.rb: ext/tk/extconf.rb: change the check parameter
- for Win32.
-
-Wed Nov 2 20:14:53 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib: merge into ext/tk and remove.
-
-Wed Nov 2 19:03:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (ip_rbUpdateObjCmd,
- ip_rb_threadUpdateObjCmd): passed improper flags to DoOneEvent().
-
- * ext/tk/tkutil.c: use rb_obj_respond_to() instead of rb_respond_to().
-
-Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call_super): should call method_missing if super is
- called from Kernel method.
-
- * eval.c (exec_under): frame during eval should preserve external
- information.
-
-Tue Nov 1 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/extconf.rb: should check ERR_peek_last_error().
- [ruby-dev:27597]
-
- * ext/openssl/ossl.c (ossl_raise): ditto.
-
-Mon Oct 31 17:34:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * configure.in: use proper option for Sun linker. A patch from
- Shinya Kuwamura <kuwa at labs.fujitsu.com>. [ruby-dev:27603]
-
-Mon Oct 31 11:27:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb (test_s_open_error):
- skip on Win32/DOS platforms.
-
-Mon Oct 31 05:49:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must
- not be empty. [ruby-talk:161220]
-
- * test/openssl/test_cipher.rb: add test for Cipher#update("").
-
-Mon Oct 31 05:37:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIHandler#do_GET): the value of Set-Cookie:
- header field should be splited into each cookie. [ruby-Bugs:2199]
-
- * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookie): new method
- to parse the value of Set-Cookie: header field.
-
- * test/webrick/test_cookie.rb, test/webrick/test_cgi.rb,
- test/webrick/webrick.cgi: add some test for cookie.
-
-Mon Oct 31 03:19:36 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/readline/readline.c (readline_readline): type check.
- [ruby-core:6089]
-
- * numeric.c (fix_rshift): RDoc fix. [ruby-core:6351]
-
- * util.h (strtod): add #undef for platforms defines strtod()
- macro. [ruby-dev:27563]
-
-Mon Oct 31 02:35:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/test_float.rb (test_precision): test by assert_in_delta.
- [ruby-dev:27575]
-
-Sat Oct 29 01:58:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/etc/etc.c: document update from mathew <meta@pobox.com>.
- [ruby-core:06473]
-
- * ext/fcntl/fcntl.c: ditto.
-
-Thu Oct 27 16:45:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (scan_once): wrong condition to use mbclen2().
- [ruby-dev:27535]
-
-Wed Oct 26 09:27:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/syck/implicit.c (syck_type_id_to_uri): should return
- newly allocated memory. otherwise, type_id will be freed
- twice. [ruby-dev:27384] [ruby-core:6385]
-
-Wed Oct 26 09:04:51 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
- values have VALUE type. there is an environment where sizeof(VALUE)
- != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
- and received by 64bit integer (VALUE), upper bits may have garbage value.
- [ruby-dev:27513]
-
-Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_EXTERN): macro to export symbols in shared
- library. [ruby-core:05528]
-
- * defines.h, {bcc32,win32,wince}/Makefile.sub (RUBY_EXTERN): moved to
- configuration pass.
-
- * ext/extmk.rb (extmake): RUBY_EXTERN for static linked extensions.
-
-Tue Oct 25 15:32:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/rational.rb: applied documentation patch from Gavin Sinclair
- <gsinclair@gmail.com>. [ruby-core:06364]
-
- * lib/irb.rb (IRB::Irb::eval_input): handle prompts with newlines
- in irb auto-indentation mode. [ruby-core:06358]
-
-Tue Oct 25 02:12:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::LABEL_LIST_RE):
- reduce redundant backtrack. [ruby-talk:161771]
-
-Tue Oct 25 00:27:35 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/*: RDoc documentation from Eric Hodel
- <drbrain@segment7.net> added.
-
-Mon Oct 24 21:14:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, io.c: use sys/syscall.h if syscall.h is not available.
- [ruby-core:06247]
-
-Mon Oct 24 20:49:45 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/Win32API/lib/win32/resolv.rb (get_info): support multiple DNS.
- fixed: [ruby-list:40058], [ruby-dev:27479]
-
-Mon Oct 24 07:57:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys):
- typo fixed. [ruby-talk:162187]
-
- * ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
- ditto. [ruby-core:06359]
-
-Sun Oct 23 21:50:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/enumerator/enumerator.c: applied documentation patch from
- James Edward Gray II <james@grayproductions.net>.
- [ruby-core:06348]
-
-Sun Oct 23 07:11:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/extconf.rb: improve messages [ruby-core:06325].
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb,
- ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb,
- ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/labelframe.rb,
- ext/tk/lib/tk/listbox.rb, ext/tk/lib/tk/menu.rb,
- ext/tk/lib/tk/radiobutton.rb, ext/tk/lib/tk/scale.rb,
- ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tk/text.rb,
- ext/tk/lib/tk/toplevel.rb: improve conversion of option values.
-
- * ext/tk/lib/tkextlib/*: ditto.
-
- * ext/tk/lib/tkextlib/*: update to support ActiveTcl8.4.11.2.
-
- * ext/tk/lib/tkextlib/trofs/*: support Trofs 0.4.3.
-
- * ext/tk/lib/tkextlib/tile/*: support Tile 0.7.2.
-
- * ext/tk/lib/tkextlib/vu/*: support vu 2.3.0.
-
- * ext/tk/lib/tkextlib/tcllib/*: support Tcllib 1.8 (Tklib 0.3).
-
-Sat Oct 22 23:54:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb, lib/mkmf.rb (with_config): support --with-extension
- options. [ruby-dev:27449]
-
-Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
- if valid as a symbol name more strictly. [ruby-dev:27478]
-
- * test/ruby/test_symbol.rb: tests for [ruby-core:03573].
-
- * time.c (rb_strftime): removed meaningless volatile modifiers, and
- concatenate successive nul characters at once. [ruby-dev:27472]
-
-Fri Oct 21 19:21:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * rubysig.h (CHECK_INTS): fixed typo. (I believe bit-or is improper)
-
-Fri Oct 21 17:49:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bin/erb (ERB::Main::run): typo fixed. [ruby-core:06337]
-
-Fri Oct 21 15:27:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bignum.c (bignew_1): convertion from `int' to `char' discards
- upper bits, (ie. (char)0xff00 -> 0) so it's better to test if
- nonzero and set 0 or 1 instead of simply casting ... as a flag usage.
- (but I believe this won't cause actual bug in current implementation)
- [ruby-dev:27055]
-
- * time.c: should use LONG_LONG instead of `long long'.
-
-Thu Oct 20 09:37:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/mkmf.rb (create_makefile): Borland make seems not to allow
- empty dependency list. If this change is not good, please correct
- it.
-
-Thu Oct 20 07:55:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): get rid of a restriction
- of Borland make. fixed: [ruby-dev:27460]
-
-Thu Oct 20 00:13:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * rubysig.h (CHECK_INTS): fix typo.
-
-Wed Oct 19 23:58:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): do not create unnecessary empty
- directories. fixed: [ruby-dev:27451]
-
-Wed Oct 19 19:26:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (rb_gc_mark_parser): get rid of segfault with old yacc.
- fixed: [ruby-dev:27439]
-
-Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_join): elements may contain null pointer strings.
- report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326]
-
-Wed Oct 19 02:34:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c, gc.c, time.c: made internal symbols static. [ruby-dev:27435]
-
-Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regex.c (re_compile_pattern): numeric literal inside character class
- disabled succeeding backtrack. fixed: [ruby-list:41328]
-
-Mon Oct 17 21:18:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_heap): byacc never free parser stack.
- fixed: [ruby-dev:27428]
-
-Mon Oct 17 16:04:47 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (chmod_internal, lchmod_internal): fixed type of 2nd argument.
-
-Sun Oct 16 22:16:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: omit non-existing directories.
-
-Sun Oct 16 14:30:05 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/rinda.rb (Rinda::Tuple#initialize): check remote hash
- tuple. fixed: [ruby-list:41227]
-
- * test/rinda/test_rinda.rb: test it.
-
-Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * rubysig.h (CHECK_INTS): prevent signal handler to run during
- critical section. [ruby-core:04039]
-
- * eval.c (load_wait): need not to call rb_thread_schedule()
- explicitly. [ruby-core:04039]
-
- * eval.c (rb_thread_schedule): clear rb_thread_critical.
- [ruby-core:04039]
-
-Sat Oct 15 19:56:38 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * bin/erb: typo fixed, again. thanks, Doug Kearns.
-
-Fri Oct 14 22:08:26 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (ioctl): should set errno.
-
-Fri Oct 14 16:57:32 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/config.rb (Config::FileHandler): :UserDir should be nil.
- It is harmful to permit the access to ~/public_html by default.
- suggested by Hiroyuki Iwatsuki.
-
-Thu Oct 13 23:29:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (HEAPCNT): bison allocates indivisible size.
- fixed: [ruby-core:06261]
-
- * io.c, pack.c, ext/syck/rubyext.c, ext/syck/syck.h, missing/isinf.c:
- get rid of warnings. fixed: [ruby-core:06247]
-
-Wed Oct 12 12:52:57 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.c (Init_openssl): should call
- OpenSSL_add_ssl_algorithms().
-
-Wed Oct 12 11:08:54 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * file.c (rb_f_test): typo in RDoc comments.
-
-Tue Oct 11 21:41:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_obj_respond_to): check if obj responds to the given
- method with the given visibility. [ruby-dev:27408]
-
- * eval.c (rb_respond_to): conform to Object#respond_to?. [ruby-dev:27411]
-
-Tue Oct 11 00:01:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * st.c (st_free_table): do not call free() but xfree().
- [ruby-core:06205]
-
-Sat Oct 8 20:04:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (Init_Binding): add Binding#dup method. [yarv-dev:666]
-
- * parse.y (rb_parser_malloc, rb_parser_free): manage parser stack on
- heap. [ruby-list:41199]
-
- * ext/iconv/charset_alias.rb: parse config.charset_alias file directly.
-
-Fri Oct 7 09:54:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::Cookie::parse): Cookies from Nokia devices may
- not be parsed correctly. A patch from August Z. Flatby
- (augustzf) in [ruby-Patches-2595]. [ruby-core:06183]
-
-Thu Oct 6 20:12:16 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/strscan/strscan.c (strscan_free): remove useless code.
- [ruby-dev:26368] [ruby-dev:27389]
- (backported from trunk, rev 1.22)
-
-Wed Oct 5 04:42:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/xmlrpc/server.rb (XMLRPC::Server#initialize): should mount the
- servlet on "/".
-
-Wed Oct 5 03:59:09 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/xmlrpc/server.rb (XMLRPC::Server#serve): delete wrong call
- of "join".
-
-Mon Oct 3 00:04:00 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * pack.c (EXTEND16): [ruby-dev:27383]
-
-Thu Sep 29 10:26:18 2005 Tanaka Akira <akr@m17n.org>
-
- * ext/dl/dl.c (rb_io_to_ptr): abolish sizeof(FILE).
- [ruby-dev:27317]
-
-Thu Sep 29 07:22:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * evalc. (rb_f_send): underscores need to be escaped.
- fixed by Doug Kearns. [ruby-core:06053]
-
-Thu Sep 29 00:57:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
- autoload succeeded.
-
- * variable.c (rb_autoload_load): now return true if autoload
- succeeded. fixed: [ruby-dev:27331]
-
-Wed Sep 28 23:42:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (apply2files): add prototype.
-
- * file.c (rb_stat_inspect): constified.
-
- * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
- numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
- re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
- undocumented.
-
-Wed Sep 28 23:09:23 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb: document update from James Edward Gray II
- <james@grayproductions.net>. [ruby-core:06027]
-
-Wed Sep 28 15:14:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/cgi.rb (WEBrick::CGI#start): req.query_string should
- refer the value of QUERY_STRING. [ruby-list:41186]
-
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#query_string=):
- add new method.
-
-Wed Sep 28 10:45:44 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: cannot compile with Tcl/Tk8.0.x
- [ruby-dev:27335].
-
-Wed Sep 28 08:12:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]
-
-Wed Sep 28 07:56:52 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/yaml/basenode.rb (YAML::BaseNode::match_segment): fix typo.
- [ruby-dev:27237], [ruby-core:05854]
-
- * lib/yaml/tag.rb (Module#yaml_as): suppress warnings.
-
- * lib/yaml/types.rb (YAML::PrivateType, YAML::DomainType): ditto.
-
-Wed Sep 28 03:23:35 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * rubysig.h: fixed build problem with --enable-pthread on platforms
- which don't have setitimer().
-
-Mon Sep 26 22:32:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (set_trace_func): add rb_secure(4) to prevent adding
- tracing function.
-
-Sun Sep 25 12:05:10 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * bin/erb: typo fixed.
-
-Sun Sep 25 01:46:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-calculate-indent): arrange deep-indent
- closing parenthesis at same column as the opening.
-
-Sun Sep 25 00:42:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-expr-beg): deal with heredoc separately.
- fixed: [ruby-list:41168]
-
- * misc/ruby-mode.el (ruby-calculate-indent): not to deepen indent
- level for continuous line inside parentheses.
- http://nabeken.tdiary.net/20050915.html#p02
-
-Sun Sep 25 00:18:11 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (unknown_node): show more information. [ruby-dev:26196]
-
-Sat Sep 24 08:56:01 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (cd): no longer accept :noop option, related
- code is useless (backported from trunk, rev 1.67).
- [ruby-core:05858] [ruby-Bugs:2494]
-
-Sat Sep 24 08:38:07 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose,
- DryRun (backported from trunk, rev 1.66). [ruby-core:05954]
-
- * test/fileutils/test_nowrite.rb: test it.
-
- * test/fileutils/test_dryrun.rb: new file.
-
- * test/fileutils/test_verbose.rb: new file.
-
-Sat Sep 24 02:40:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb: document update from James Edward Gray II
- <james@grayproductions.net>. [ruby-core:05942]
-
-Thu Sep 22 23:36:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (find_executable0): default path if environment is not
- set. [ruby-dev:27281]
-
-Thu Sep 22 16:33:12 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/readline/test_readline.rb (TestReadline::replace_stdio):
- merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
-
-Wed Sep 21 23:30:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (configuration): generalized nmake dependent code.
-
-Wed Sep 21 09:07:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * stable version 1.8.3 released.
-
-Wed Sep 21 08:52:25 2005 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/token.c: correctly compute identation of a block
- scalar's parent node. [ruby-talk:150620]
-
-Wed Sep 21 08:20:24 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT, README.EXT.ja: add new features.
-
-Wed Sep 21 07:43:58 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (default_argv, Arguable#options): defaults strings
- to be parsed to Arguable instance.
-
-Wed Sep 21 02:44:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (path_check_0): disallow sticky world writable directory
- in PATH (and $LOAD_PATH). [ruby-dev:27226]
-
- * file.c (fpath_check): typo fixed.
-
-Tue Sep 20 22:29:49 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/wsdl/simpletype/rpc/test_rpc.rb, test/wsdl/ref/test_ref.rb,
- test/wsdl/any/test_any.rb test/soap/wsdlDriver/test_calc.rb:
- suppress deliberate warnings with $VERBOSE = nil.
-
-Tue Sep 20 21:26:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/wait/lib/nonblock.rb: disable on platforms non-blocking flag
- is not available. fixed: [ruby-dev:27187]
-
-Tue Sep 20 18:23:04 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (thread_mark): mark th->last_status. [ruby-dev:27179]
-
-Tue Sep 20 18:20:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/yaml.rb: require 'yaml/constants'. [ruby-core:5776]
-
-Tue Sep 20 17:48:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): add charset
- information to content-type header.[ruby-core:5127]
-
- * lib/xmlrpc/server.rb (CGIServer::serve): ditto.
-
- * lib/xmlrpc/server.rb (ModRubyServer::serve): ditto.
-
- * lib/xmlrpc/server.rb (WEBrickServlet::service): ditto.
-
-Tue Sep 20 17:34:46 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/webrick/test_cgi.rb: set ENV["PATH"] to CGIEnvPath on
- windows. bcc32's runtime is not installed into system directory,
- so it cannot be found without this setting. [ruby-dev:27166]
-
-Tue Sep 20 17:10:38 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/dbm/test_dbm.rb (TestDBM::test_s_open_error): remove
- test_s_open_error test to detect duplicate open.
- [ruby-dev:27202]
-
-Tue Sep 20 17:08:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * io.c: PIPE_BUF is not defined on BeOS. use _POSIX_PIPE_BUF instead.
- [ruby-dev:27185]
-
-Tue Sep 20 16:53:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/readline/test_readline.rb (TestReadline::replace_stdio):
- BSD seek support from [ruby-dev:25223]. fixed: [ruby-dev:27150]
-
-Tue Sep 20 15:39:40 2005 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/emitter.c (syck_scan_scalar): prevent indicators from
- appearing alone or at the end of plain scalars. [ruby-core:5826]
-
- * ext/syck/emitter.c (syck_emit_scalar): treat typed scalar nodes
- as complex keys.
-
- * lib/syck.h: version 0.60.
-
- * lib/yaml/basenode.rb (YAML::BaseNode#at): transform keys during
- key searches.
-
- * ext/syck/rubyext.c: loading of binary-typed nodes. prevent
- emission of plain strings that look like symbols, but which aren't.
-
-Tue Sep 20 05:50:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/xmlrpc/test_webrick_server.rb (setup_http_server):
- should not include 'webrick/https' unless 'use_ssl' because
- it fails where openssl is not installed.
-
-Tue Sep 20 00:34:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_close): call rb_io_close() directly if io is a T_FILE
- object. [ruby-dev:27156]
-
-Mon Sep 19 19:09:08 2005 Minero Aoki <aamine@loveruby.net>
-
- * file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
- (backport from trunk, rev 1.208)
-
-Mon Sep 19 18:35:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dl/dl.c (rb_io_to_ptr): fix DragonFlyBSD support.
- [ruby-dev:27151]
-
-Mon Sep 19 14:17:04 2005 Minero Aoki <aamine@loveruby.net>
-
- * ext/syck/emitter.c (syck_emit): passing an int* value to the
- long* parameter causes unaligned access on LP64 systems.
- [ruby-dev:27161]
-
-Mon Sep 19 13:44:03 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c: avoid core dump with WIN32OLE_EVENT.
- [ruby-dev:27133]
-
-Mon Sep 19 10:36:06 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (cp_r): default is :dereference_root=>true for
- backward compatibility. [ruby-dev:27145]
-
- * test/fileutils/test_fileutils.rb (test_cp_r): test it.
-
-Mon Sep 19 09:57:39 2005 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
- (again) [ruby-dev:27145]
-
-Mon Sep 19 07:45:37 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:
- an instance variable "private" is added to OpenSSL::PKey class.
- this ivar is a flag that shows whether there is a private key
- in the instance.
-
- * ext/openssl/ossl_engine.c: (ossl_engine_load_privkey): set private
- key flag.
-
-Mon Sep 19 06:41:32 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb: backported from trunk (rev 1.65):
-
- * lib/fileutils.rb (rm_r): new option :secure.
-
- * lib/fileutils.rb (rm_rf): new option :secure.
-
- * lib/fileutils.rb: new method #remove_entry_secure.
-
- * lib/fileutils.rb (cd): remove option :noop.
-
- * lib/fileutils.rb (cp_r): new option :dereference_root.
-
- * lib/fileutils.rb (cp_r): new option :dereference_root.
-
- * lib/fileutils.rb: new method #remove_entry.
-
- * lib/fileutils.rb: new method #chmod_R.
-
- * lib/fileutils.rb: new method #chown.
-
- * lib/fileutils.rb: new method #chown_R.
-
- * lib/fileutils.rb: new method .commands.
-
- * lib/fileutils.rb: new method .options.
-
- * lib/fileutils.rb: new method .have_option?.
-
- * lib/fileutils.rb: new method .options_of.
-
- * lib/fileutils.rb: new method .collect_method.
-
- * lib/fileutils.rb: use module_function instead of single extend.
-
- * test/fileutils/test_fileutils.rb: backported from trunk (1.36).
-
-Mon Sep 19 03:17:48 2005 Tanaka Akira <akr@m17n.org>
-
- * file.c (rb_thread_flock): wrap the flock system call by
- TRAP_BEG/TRAP_END to enable signals. [ruby-dev:27122]
-
- * ext/socket/socket.c (bsock_send): wrap the sendto and send system
- call by TRAP_BEG/TRAP_END to enable signals when writing to a socket
- which is full. [ruby-dev:27132]
-
- * io.c (rb_io_syswrite): wrap the write system call by
- TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is
- full. [ruby-dev:27134]
-
-Mon Sep 19 03:02:08 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (io_fwrite): wrap the write system call by TRAP_BEG/TRAP_END to
- enable signals when writing to a pipe which is full.
-
-Sun Sep 18 02:10:47 2005 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml/rubytypes.rb: remove comments that are bungling up
- the rdoc and ri output. output symbols as plain scalars.
-
- * ext/syck/rubyext.c (syck_emitter_reset): emit headless
- documents always.
-
- * ext/syck/emitter.c (syck_scan_scalar): quote scalars with any
- kind of surrounding line space, tabs or spaces alike.
-
- * ext/syck/token.c: accept tabs as whitespace, not for indentation,
- but strip from plain scalars.
-
- * test/yaml/test_yaml.rb: remove outdated tests.
-
-Sat Sep 17 23:25:04 2005 sheepman <sheepman@sheepman.sakura.ne.jp>
-
- * lib/mathn.rb (Rational::inspect): should preserve original
- operand. [ruby-core:05806]
-
-Sat Sep 17 23:20:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::Cookie): should handle multiple values for a
- cookie name. [ruby-talk:156140]
-
-Sat Sep 17 10:42:13 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
- should call Kernel.eval on caller's safe-level instead of slave's
- safe-level (Of course, the given script should be evaluated on
- slave's safe-level).
-
-Sat Sep 17 09:45:26 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_substr): should propagate taintness even for
- empty strings. [ruby-dev:27121]
-
- * string.c (rb_str_aref): should infect result if range argument
- is tainted. [ruby-dev:27121]
-
-Sat Sep 17 08:35:39 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/maker/base.rb (RSS::Maker::ItemsBase#normalize): fixed
- strange RSS::Maker::Item#max_size behavior.
- Thanks to Kazuhiko <kazuhiko@fdiary.net>.
-
- * test/rss/test_maker_1.0.rb (RSS::TestMaker10#test_items): ditto.
-
-Fri Sep 16 23:09:20 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_search_event_at): bug fix
- in ext/win32ole/sample/ienavi.rb.
-
- * ext/win32ole/win32ole/tests/testOLEEVENT.rb: ditto.
-
-Fri Sep 16 22:41:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_extname): empty string for path name ending with a
- period. fixed: [ruby-core:05651]
-
- * file.c (rb_file_join): smarter behavior at edge cases.
- fixed: [ruby-core:05706]
-
-Fri Sep 16 18:34:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syck/node.c (syck_replace_str): was using return from the
- void function. a patch from MIYAMUKO Katsuyuki
- <miyamuko at mtb.biglobe.ne.jp>. [ruby-dev:27111]
-
-Fri Sep 16 14:48:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: fix typo on MultiTkIp#bg_eval_string
-
-Fri Sep 16 12:02:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_resolver_transfer): remove C++ style
- comment (//). [ruby-core:05793]
-
-Fri Sep 16 00:14:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/logger/test_logger.rb: unintentionally overwritten changes by
- Usa. reverted.
-
-Fri Sep 16 00:06:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#initialize): should set
- $stdout.binmode.
-
-Thu Sep 15 23:25:21 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.5.
-
- #nnn is a ticket number at http://dev.ctor.org/soap4r
-
- * SOAP
-
- * allow to configure an envelope namespace of SOAP request. (#124)
- TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
- @client.options["soap.envelope.requestnamespace"] =
- TemporaryNamespace
- @client.options["soap.envelope.responsenamespace"] =
- TemporaryNamespace
- @client.do_proc(...)
-
- * let SOAP request XML indent space configuable. see
- "soap.envelope.no_indent" option. (#130)
-
- * let external CES configuable.
- ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used
- by default. (#133)
- external CES ::= CES used in Ruby object of client and server
- internal CES ::= CES used in SOAP/OM
-
- * add iso-8859-1 external CES support. (#106)
-
- * fixed illegal 'qualified' handling of elements. it caused
- ASP.NET inteoperability problem. (#144)
-
- * added 'soap.envelope.use_numeric_character_reference' (boolean)
- option to let query XML use numeric character reference in XML,
- not plain UTF-8 character. !GoogleSearch server seems to not
- allow plain UTF-8 character since 2005-08-15 update. (#147)
-
- * SOAP::Header::SimpleHeader (de)serialization throws an exception
- on !SimpleHeader.on_(in|out)bound when header is a String. so we
- could not use a simple single element headerItem. fixed. thanks
- to emil. (#129)
-
- * out parameter of rpc operation did not work. (#132)
-
- * follow HTTP redirect only if using http-access2. (#125) (#145)
-
- * add a workaround for importing an WSDL whose path begins with
- drive letter. (#115)
-
- * WSDL
-
- * SOAP Data which is defined as a simpletype was not mapped
- correctly to Ruby obj when using wsdl2ruby.rb generated classdef
- file. (#123)
-
- * rpc/literal support. (#118)
-
- * re-implemented local element qualify/unqualify control. handles
- elementFormDefault and form in WSDL. (#119)
-
- * Array of an element which has simpleType causes a crash. (#128)
-
- * prarmeterOrder may not contain return part so it can be shorter
- than parts size. Thanks to Hugh. (#139)
-
- * Samples
-
- * added !BasicAuth client sample. (#117)
-
- * added Base64 client/server sample.
-
- * added Flickr SOAP interface client sample. (#122)
-
- * added !SalesForce client sample. (#135)
-
- * updated Thawte CA certificate for !GoogleAdWords sample.
-
- * updated a client script with the newer version made by Johan.
- thanks!
-
- * shortened long file names. (#120)
-
- * fixed typo in authheader sample. (#129)
-
- * updated deprecated method usage. (#138)
-
-Thu Sep 15 23:02:57 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.h (rb_w32_stat): added prototype.
-
-Thu Sep 15 22:35:55 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_signal.rb (test_exit_action): skip the test using
- fork on fork-less platforms.
-
-Thu Sep 15 11:39:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/dialog.rb: If a dialog does not show up yet,
- TkDialogObj#name raises an exception. [ruby-talk:156109]
-
-Thu Sep 15 01:39:19 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/rinda/tuplespace.rb (Rinda::TemplateEntry::initialize): pull
- up method. Tabs converted to spaces.
-
-Thu Sep 15 00:18:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/net/telnet.rb (Net::Telnet::waitfor): replace sysread with
- readpartial. [ruby-talk:127641]
-
-Wed Sep 14 22:40:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (ruby_glob): glob function not using ruby exception system.
-
-Wed Sep 14 01:26:03 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/https.rb: backported from trunk, rev 1.3.
- [ruby-dev:25673] (again), [ruby-dev:26617] (again),
- [ruby-dev:27062]
-
- * ext/openssl/lib/net/https.rb: removed.
-
- * ext/openssl/lib/net/protocols.rb: removed.
-
- * lib/net/http.rb: #use_ssl?, #use_ssl are moved from net/https.
-
-Tue Sep 13 22:09:40 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb (Logger): added formatter accessor to logger for
- dictating the way in which the logger should format the messages it
- displays. Thanks to Nicholas Seckar (cf. [ruby-talk:153391]) and
- Daniel Berger.
-
- * lib/logger.rb (Logger): added VERSION constant.
-
- * lib/logger.rb: removed document for LogDevice. It is an
- implementation detail and is not a public interface.
-
- * test/logger/test_logger.rb: added tests.
-
-Tue Sep 13 21:47:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (BEGIN_CALLARGS): pop halfly pushed status.
- fixed: [ruby-dev:26881]
-
-Tue Sep 13 16:26:45 2005 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb: backported from trunk, rev 1.128.
- [ruby-dev:25673] [ruby-dev:26617]
-
- * lib/net/protocol.rb: backported from trunk, rev 1.78.
-
- * lib/net/protocol.rb: new method #old_open to support net/smtp
- and net/pop.
-
- * lib/net/smtp.rb: use #old_open.
-
- * lib/net/pop.rb: ditto.
-
-Tue Sep 13 12:33:05 2005 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb: reworking YAML::Stream to use the new
- emitter.
-
- * lib/yaml/stream.rb: ditto.
-
- * lib/yaml/rubytypes.rb: added Object#yaml_new.
-
- * lib/yaml/tag.rb: the tag_subclasses? method now
- shows up in the class. allow taguri to be set using an accessor.
- continue support of Object#to_yaml_type.
-
- * ext/syck/rubyext.c: new emitter code. yaml_new and yaml_initialize
- get called, should they be present. consolidated all the diaspora of internal
- node types into the family below YAML::Syck::Node -- Map,
- Seq, Scalar -- all of whom are SyckNode structs pointing to
- Ruby data. moved Object#yaml_new into the node_import and made it the
- default behavior. the target_class is always called wih yaml_new, prepended
- a parameter, which is the klass. loaded nodes through GenericResolver show their style.
- new Resolver#tagurize converts type ids to taguris.
-
- * ext/syck/implicit.re: were 'y' and 'n' seriously omitted??
-
- * ext/syck/emitter.c: renovated emitter, walks the tree in advance.
- consolidated redundant block_styles struct into
- the scalar_style struct. (this means loaded nodes can now
- be sent back to emitter and preserve at least its very basic
- formatting.)
-
- * ext/syck/gram.c: headless documents of any kind allowed.
-
- * ext/syck/node.c: new syck_replace_str methods and syck_empty_*
- methods for rewriting node contents, while keeping the ID
- and other setup info. added syck_seq_assign.
-
- * ext/syck/syck.h: reflect block_styles and new node functions.
-
-Mon Sep 12 20:53:06 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/openssl/test_pkcs7.rb (test_enveloped): skip this test
- to avoid a bug of PKCS7_enctypt() (only if ext/openssl is
- compiled with OpenSSL-0.9.7d or earlier versions).
- http://www.mail-archive.com/openssl-dev@openssl.org/msg17376.html
-
-Mon Sep 12 14:03:33 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * test/dbm/test_dbm.rb: remove locking test, which may not be
- supported on some platforms. [ruby-dev:27030]
-
-Mon Sep 12 10:45:58 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dl/dl.c (rb_io_to_ptr): merged a patch for DragonFly BSD
- from Takahiro Kambe <taca at back-street.net>. [ruby-dev:27023]
-
-Sun Sep 11 22:05:51 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * bin/erb (ERB::Main#run): set ERB#filename so that it is used
- when reporting syntax/runtime errors. Tabs converted to spaces.
-
-Sat Sep 10 10:17:03 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_by_id):
- OpenSSL::Engine.by_id calls given block before calling
- ENGINE_init (block parameter is the return value of this method
- itself). this functionality is useful to load dynamic shared
- engines. the following code is a sample of loading a key using
- OpenSC PKCS #11 module.
-
- require "openssl"
- pkcs11 = OpenSSL::Engine.by_id("dynamic"){|e|
- e.ctrl_cmd("SO_PATH", "/usr/lib/opensc/engine_pkcs11.so")
- e.ctrl_cmd("LIST_ADD", "1")
- e.ctrl_cmd("LOAD")
- }
- pkcs11.ctrl_cmd("PIN", "secret")
- key = pkcs11.load_private_key
-
- * ext/openssl/ossl_engine.c (ossl_engine_ctrl_cmd): new method
- OpenSSL::Engine#ctrl_cmd. it wraps ENGINE_ctrl_cmd_string.
-
- * ext/openssl/ossl_engine.c (ossl_engine_get_cmds): new method
- OpenSSL::Engine#cmds. it returms engine command definitions.
-
-Sat Sep 10 10:09:47 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (asn1str_to_str): new function.
-
- * ext/openssl/ossl_pkcs7.c: new class OpenSSL::PKCS7::RecipientInfo.
- this class wraps PKCS7_RECIP_INFO struct.
-
- * ext/openssl/ossl_pkcs7.c: OpenSSL::PKCS7::Signer is renamed to
- OpenSSL::PKCS7::SignerInfo. ("Signer" remains as an alias of
- SignerInfo.)
-
- * test/openssl/test_pkcs7.rb: new file.
-
-Sat Sep 10 10:05:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): assume that
- the argument is a DER string if Base64 decoding failed.
-
- * ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method.
-
- * test/openssl/test_ns_spki.rb: add new file.
-
-Sat Sep 10 09:56:24 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
- these features are enabled if this library is compiled with
- OpenSSL 0.9.8 or later.
-
- * test/openssl/test_digest.rb: add test for new digests.
-
-Sat Sep 10 09:51:30 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error
- to get last error on the current thread. And should report
- errors on the stack while OpenSSL.debug is true.
-
- * ext/openssl/ossl.c (ossl_get_errors): new method for debugging
- this library.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message.
-
- * ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid
- of unused variable.
-
- * ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should
- set @time to avoid warning.
-
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths,
- X509_STORE_add_cert, X509_STORE_add_crl): should raise error if
- wrapped functions failed.
-
- * test/openssl/test_x509store.rb: add test for errors.
-
-Fri Sep 9 22:13:19 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): prohibit calling tainted method (>2) when
- $SAFE == 0.
-
-Fri Sep 9 16:45:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_times): make empty strings to keep taintness,
- and a little improvement. [ruby-dev:26900]
-
- * ext/iconv/iconv.c (iconv_try), ext/iconv/extconf.rb: get rid of meta
- characters in command line option. fixed: [ruby-talk:155369]
-
-Thu Sep 8 14:58:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * merged a patch from Takahiro Kambe <taca at back-street.net> to
- support DragonFly BSD. [ruby-dev:26984]
-
-Wed Sep 7 12:55:08 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb: abolish mod === tempfile to avoid a problem
- [ruby-dev:26967].
-
-Wed Sep 7 10:45:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_switch): convert all exceptions to
- SystemExit. fixed: [ruby-core:05724]
-
- * eval.c (rb_thread_terminated): show backtrace before propagate
- exceptions to main thread.
-
-Wed Sep 7 08:35:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in, configure.in (MINIOBJS): miniruby on HP-UX can not load
- extension libraries.
-
- * bignum.c (bignew_1, bigadd): K&R style argument actually can't be
- defined as char.
-
- * missing/vsnprintf.c: ANSI compiler supports const keyword.
-
- * ext/digest/sha2/extconf.rb: reject platforms which has inttypes.h
- but no 64bit integer.
-
- * lib/mkmf.rb (what_type?): guesstimate type.
-
- * ext/etc/etc.c (setup_passwd), ext/etc/extconf.rb: pw_age might be
- char*. fixed: [ruby-core:05470]
-
-Wed Sep 7 08:32:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_cvar_get, rb_mod_cvar_set): document fix from
- sheepman <sheepman@sheepman.sakura.ne.jp>; a bug in visibility
- description. [ruby-dev:26965]
-
- * sprintf.c (rb_f_sprintf): warn "too many argument" on verbose
- mode (-v/-w); backported from 1.9. [ruby-dev:26963]
-
-Mon Sep 5 17:03:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/ostruct.rb: a patch from Florian Gross <florgro at gmail.com>
- merged to allow recursive inspect (and to_s) for OpenStruct.
- [ruby-core:05532]
-
-Mon Sep 5 07:01:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/openssl/lib/openssl/buffering.rb (Buffering#do_write):
- should clear data from the buffer which already been output.
-
-Fri Sep 2 23:51:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib: do not use __send__ to access private methods. [ruby-dev:26935]
-
-Fri Sep 2 03:29:00 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/init.rb: make IRB -I option that is same befavior for ruby.
- [ruby-dev:26872], [ruby-dev: 26920]
-
- * lib/irb/locale.rb: support to print help message when OS locale is
- ja_JP.utf-8. [ruby-dev:26872]
-
-Thu Sep 1 17:11:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_call0): wrong condition for $SAFE restoration.
-
-Thu Sep 1 14:12:45 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: On Tcl8.5, MultiTkIp#invoke_hidden doesn't
- work (gives wrong order of arguments).
-
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#invoke_hidden_on_namespace
- to support '-namespace' option of 'interp invokehidden' command
- on Tcl8.5.
-
-Wed Aug 31 14:43:15 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (OPTFLAGS): default global optimization to
- disabled for all VC++ versions. fixed: [ruby-dev:26897]
-
-Wed Aug 31 11:35:43 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/gdbm/test_gdbm.rb (teardown): should remove GDBM temporary
- file.
-
-Wed Aug 31 10:30:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * process.c (proc_detach, proc_setmaxgroups): missing argument type
- declaration. (I recommend ANSI-style function)
-
-Tue Aug 30 23:20:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_rescue2): initialization miss. fixed: [ruby-dev:26917]
-
- * lib/mkmf.rb (xsystem, xpopen): no longer expand by Config.
-
- * lib/mkmf.rb (link_command, cc_command, cpp_command): expand
- variables at once, and quote hdrdir. fixed: [ruby-core:05680]
-
- * lib/mkmf.rb (libpathflag): quote paths.
-
-Tue Aug 30 19:34:27 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/digest/md5/md5ossl.h, ext/digest/rmd160/rmd160ossl.h,
- ext/digest/sha1/sha1ossl.h: include <stddef.h> to avoid
- error in compilation with OpenSSL-0.9.8. [ruby-list:41068]
-
-Mon Aug 29 19:54:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/rdoc/usage.rb: improper exceptions. [ruby-dev:26870]
-
- * lib/rdoc/usage.rb: support the case when non-ruby code exists before
- shebang. (this is needed when ri.bat is executed on windows)
-
-Mon Aug 29 17:48:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (method_arity): should return proper arity value.
- [ruby-dev:26390]
-
-Mon Aug 29 01:19:57 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/time.rb (Time.parse): extract fractional seconds using
- Date._parse. [ruby-talk:153859]
-
-Sat Aug 27 20:20:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/curses/curses.c ({curses,window}_clrtoeol): added. suggested
- by Reyn Vlietstra.
-
- * ext/curses/curses.c: chtype in curses is not `char', rahter `long'.
- [ruby-Bugs:2298]
-
- * ext/curses/view.rb: String =~ String is deprecated.
-
-Wed Aug 24 10:53:28 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/logger/test_logger.rb (test_shifting_size): should close log
- device before unlink, since some platform cannot unlink opened
- file.
-
-Sun Aug 21 00:13:27 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/wsdl/xmlSchema/importer.rb (WSDL::XMLSchema::Importer#fetch): add
- a workaround for importing an WSDL whose path begins with drive
- letter. [ruby-dev:26242]
-
-Sat Aug 20 22:37:13 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb (write, shift_log?, shift_log): file shifting race
- condition bug fixed. [ruby-dev:26764]
-
- * test/logger/test_logger.rb: tests.
-
-Fri Aug 19 18:13:39 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/time.rb (Time.apply_offset): fix a problem with last day of
- month. reported by Lucas Nussbaum. [ruby-talk:152866]
-
-Thu Aug 18 12:46:28 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/Makefile.sub (COMMON_HEADERS): reverted 1.42.2.24.
- I misunderstood, bccwin32 on ruby_1_8 uses winsock2 originally.
- [ruby-dev:26806]
-
- * win32/win32.h: include winsock2.h instead of winsock.h. (bcc32)
-
-Wed Aug 17 23:58:05 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_to_integer): argument constified.
-
- * eval.c (terminate_process): take String message.
-
- * eval.c (rb_thread_switch): propagate the exception caused thread
- termination directly. fixed: [ruby-core:05552]
-
-Wed Aug 17 00:05:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_add_method): preserve safe level in the environment
- where a method is defined .
-
- * eval.c (rb_call0): restore preserved safe level in the method
- execution.
-
-Mon Aug 15 00:38:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_rescue2): reduce PUSH_TAG() as well as NODE_RESCUE.
- [ruby-dev:26800]
-
- * range.c (range_check, range_init): reduce useless exceptions.
-
-Sat Aug 13 18:51:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_block_pass): distinguish current block from others.
- fixed: [ruby-dev:26274]
-
- * ext/stringio/stringio.c (strio_set_string): disallow nil.
- http://www.rubyist.net/~nobu/t/20050811.html#c05
-
-Thu Aug 11 23:29:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c: keep holding string after closed.
-
-Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss: fixed sort bug. [ruby-list:41018]
-
- * lib/rss/1.0.rb (RSS::RDF::Channel#setup_maker_attributes):
- removed self.
-
- * lib/rss/maker/base.rb (RSS::Maker::ItemsBase#<=>): use #date
- instead of @date.
- (RSS::Maker::Base::self.def_array_element): added #size.
-
- * lib/rss/maker/1.0.rb
- (RSS::Maker::RSS10::Channel#to_rss,
- RSS::Maker::RSS10::Items::Item#to_rss): cleared dc_dates set
- upped by using #date.
-
- * lib/rss/maker/dublincore.rb
- (RSS::Maker::ChannelBase, RSS::Maker::ItemsBase::ItemBase):
- fixed opposite alias.
-
- * test/rss/test_setup_maker_1.0.rb
- (RSS::TestSetupMaker10::test_setup_maker_items_sort): added some
- tests for RSS::Maker::ItemsBase#do_sort.
-
-Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fix bug on handling __ruby2val_optkeys().
-
- * ext/tk/lib/tk/itemconfig.rb: fix bug on handling
- __item_ruby2val_optkeys().
-
- * ext/tk/lib/tk/canvas.rb: didn't check __item_ruby2val_optkeys().
-
- * ext/tk/lib/tkextlib/blt/component.rb: ditto.
-
-Tue Aug 9 15:12:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: remove dangerous 'rb_jump_tag's.
-
- * ext/tk/lib/tk.rb: add __val2ruby_optkeys and __ruby2val_optkeys to
- help to convert option values between ruby and tcl.
-
- * ext/tk/lib/tk/itemconfig.rb: add __item_val2ruby_optkeys and
- __item_ruby2val_optkeys to help to convert option values between
- ruby and tcl.
-
- * ext/tk/lib/tk/radiobutton.rb: use __ruby2val_optkeys for 'variable'
- option (for the reason of backward compatibility).
-
- * ext/tk/lib/tk/composite.rb: clarify the arguments of super().
-
- * ext/tk/lib/tk/spinbox.rb: ditto.
-
- * ext/tk/lib/tk/text.rb: ditto.
-
- * ext/tk/lib/tk/validation.rb: ditto.
-
- * ext/tk/lib/tkextlib/*: support to treat tkvariable-type
- configure options.
-
-Tue Aug 9 20:30:19 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * bignum.c (rb_big_coerce): allow bignum x bignum coercing.
- [ruby-dev:26778]
-
-Mon Aug 8 20:43:02 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_method.rb: added. [ruby-dev:26761]
-
-Sun Aug 7 23:50:14 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_super.rb: added from HEAD. [ruby-dev:26743]
-
-Sun Aug 7 01:31:15 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (WIN32OLE_EVENT#on_event): should set
- only one event handler.
-
- * ext/win32ole/tests/testOLEEVENT.rb: ditto.
-
- * ext/win32ole/tests/testOLEPARAM.rb: remove re-defined
- test_ole_type_detail method.
-
-Sat Aug 6 12:35:24 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/{tk.rb,tk/itemconfig.rb}: configure creates
- TkVariable if key name is 'variable' or 'textvariable'
- by default. [ruby-dev:26749]
-
- * ext/tk/lib/tk/{label,radiobutton}.rb: removed its own
- {variable,textvariable} function.
-
- * ext/tk/lib/tk/variable.rb: retains backward conpatibility.
-
-Fri Aug 5 12:50:32 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c: fixed memory leak when tk_funcall raised
- exception. (copies argv into heap in tk_funcall instead of
- caller)
-
-Fri Aug 5 12:42:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): need to convert path separetor
- before invoking install command.
-
-Fri Aug 5 00:27:04 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c: refactoring - extract ruby string <->
- tcl object conversion as get_str_from_obj and get_obj_from_str.
-
-Fri Aug 5 00:19:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * extmk.rb (extmake): needs to be wrapped in an Array.
-
-Thu Aug 4 18:38:36 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: cannot compile for Tcl7.6/Tk4.2.
-
- * ext/tcltklib/tcltklib.c: add nativethread consistency check.
-
- * ext/tcltklib/stubs.c: ditto.
-
- * ext/tk/lib/tk.rb: forgot to define TclTkIp.encoding and encoding=
- when Tcl is 7.6 or 8.0.
-
- * ext/tk/lib/tk/wm.rb: support to make some methods as options of
- root or toplevel widget. [ruby-talk:150336]
-
- * ext/tk/lib/tk/root.rb: ditto.
-
- * ext/tk/lib/tk/toplevel.rb: ditto.
-
- * ext/tk/lib/tkextlib/SUPPRT_STATUS: update RELEASE_DATE
-
-Thu Aug 4 08:03:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): should not modify $mflags for each
- extentions.
-
-Thu Aug 4 00:25:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, Makefile.in, {bcc32,win32,wince}/Makefile.sub: integrated
- macro definitions.
-
- * bcc32/Makefile.sub: LIBRUBY_SO should use DLDOBJS, not EXTOBJS.
-
- * {win32,wince}/Makefile.sub: separate config.h for compiler versions.
-
-Wed Aug 3 21:59:16 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/variable.rb: TkVariable#trace didn't work on
- TkVariable retrived from TkVariable.new_hash.ref. [ruby-dev:26721]
-
-Wed Aug 3 08:22:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_connect): revert [ruby-talk:111654]
- changes at 2004-09-07. [ruby-dev:26656]
-
-Tue Aug 2 10:20:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c: use Tcl_[GS]etVar2Ex instead of
- Tcl_Obj[GS]etVar2. (avoid Tcl_NewStringObj on supported platforms)
-
- * ext/tcltklib/tcltklib.c: use ip_{get,set,unset}_variable2_core from
- ip_{get,set,unset}_variable.
-
- * ext/tcltklib/tcltklib.c: replaced Tcl_Panic with rb_bug.
-
-Tue Aug 2 01:41:28 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/ping.rb (Ping.pingecho): should rescue StandardError.
- [ruby-dev:26677]
-
-Mon Aug 1 19:09:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c: refactoring - replaced rb_ivar_defined &
- rb_ivar_get with single rb_attr_get call.
-
-Mon Aug 1 18:45:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c (Tcl_GetStringResult): refactoring - define
- alternative macro on Tcl7.x or earlier.
-
-Mon Aug 1 13:57:35 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c (deleted_ip): refactoring - interpreter
- deletion check. [ruby-dev:26664]
-
-Mon Aug 1 01:17:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb (check_insecure_method): use private_methods and
- protected_methods instead of respond_to? to check method visibility.
- [ruby-dev:26616]
-
- * test/drb/drbtest.rb: ditto.
-
- * test/drb/ut_drb.rb: ditto.
-
-Mon Aug 1 00:07:32 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/context.rb: fix `irb --readline` option. [ruby-list:40955]
-
-Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_yield_0): push yielded node instead of yielding.
- fixed: [yarv-dev:549]
-
-Thu Jul 28 18:09:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/stubs.c: When --enable-tcltk-stubs, the initialize
- routine creates a Tcl/Tk interpreter and deletes it. However,
- init cost of Tk's MainWindow is not so small. And that makes it
- impossible to use libraries written with Tcl functions only on
- an environment without a graphical display. This changes support
- delaying initalization of Tk_Stubs until the script needs Tk.
-
- * ext/tcltklib/stubs.h: New file. Define prototypes and return
- codes of functions on stubs.c.
-
- * ext/tcltklib/tcltklib.c: Support delaying initalization of
- Tk_Stubs until the script needs Tk.
-
- * ext/tcltklib/tcltklib.c: Show friendly error messages for errors
- on initialization.
-
- * ext/tcltklib/tcltklib.c: Avoid SEGV on ip_finalize() when ruby is
- exiting and $DEBUG is true. (Not fix. If you know the reason of
- why, please fix it.)
-
- * ext/tk/tkutil.c (ary2list, ary2list2): bug fix on handling of
- encoding.
-
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string
- don't work propery.
-
- * ext/tk/lib/tk.rb: Forget extending Tk::Encoding module to Tk.
- * ext/tk/lib/tk/variable.rb: TkVarAccess fails to initialize the
- object for an element of a Tcl's array variable.
-
-Wed Jul 27 23:23:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (obj_free): make message format consistent with one from
- gc_mark(). [ruby-talk:149668]
-
-Wed Jul 27 22:11:37 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * sample/rss/tdiary_plugin: removed. because the plugin
- is imported in the tDiary plugin packages.
-
-Wed Jul 27 10:59:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (dir_each): rewinddir(3) before iteration.
- [ruby-talk:149628]
-
-Tue Jul 26 12:57:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/openssl_missin.c: include <openssl/engine.h> before
- <openssl/x509_vfy.h> to avoid compilation error of mswin32.
- suggested by NAKAMURA Usaku.
-
-Mon Jul 25 21:30:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * {bcc32,win32,wince}/Makefile.sub: moved CPPFLAGS only for ruby
- source to XCFLAGS.
-
-Mon Jul 25 13:45:18 2005 NAJIMA Hiroki <najima@mickey.ai.kyutech.ac.jp>
-
- * io.c: check HAVE_SYS_IOCTL_H before including the header.
- [ruby-dev:26610]
-
-Mon Jul 25 14:10:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
-
-Sat Jul 23 16:49:04 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
- OPENSSL_NO_STATIC_ENGINE.
-
-Fri Jul 22 21:06:08 2005 Tadashi Saito <shiba@mail2.accsnet.ne.jp>
-
- * bignum.c (rb_big_eq): reduce isnan(). [ruby-dev:26600]
-
- * numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le): ditto.
-
-Fri Jul 22 15:02:39 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: moved copyright description to lib/rss.rb.
-
- * lib/rss.rb: added for convenience.
-
- * sample/rss/re_read.rb: added #to_s sample.
-
- * sample/rss/blend.rb: use 'require "rss"' instead of
- 'require "rss/*"'.
- * sample/rss/list_description.rb: ditto.
- * sample/rss/rss_recent.rb: ditto.
- * sample/rss/tdiary-plugin/rss-recent.rb: ditto.
-
- * sample/rss/tdiary-plugin/rss-recent.rb: 0.0.6 -> 0.0.7.
-
-Fri Jul 22 14:37:43 2005 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/parser.rb (RSS::Parser#initialize): accept HTTP/FTP
- URI and local file path too.
-
- * test/rss/test_parser.rb (RSS::TestParser#test_parse): test
- for the above.
-
-Fri Jul 22 07:01:42 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil.c (tk_conv_args): forget to revert thread_critical
- and gc_disable when raise ArgumentError.
-
- * ext/tk/lib/remote-tk.rb: RemoteTkIp doesn't need to include TkUtil.
-
- * ext/tcltklib/tcltklib.c: add TclTkIp#has_mainwindow? method.
-
- * ext/tk/lib/tk.rb: add Tk.has_mainwindow? method.
-
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#has_mainwindow? method.
-
- * ext/tk/lib/remote-tk.rb: add RemoteTkIp#has_mainwindow? method.
-
- * ext/tk/lib/multi-tk.rb: slave IP fail to exit itself when $SAFE==4.
-
- * ext/tk/lib/multi-tk.rb: remove constants from MultiTkIp module to
- avoid access from external.
-
- * ext/tk/lib/multi-tk.rb: check_root flag is ignored on slave IPs'
- mainloop.
-
- * ext/tk/lib/multi-tk.rb: hang-up Tk.mainloop called on a slave IP
- with $SAFE==4.
-
- * ext/tk/lib/multi-tk.rb: MultiTkIp#bg_eval_proc doesn't work
- properly.
-
- * ext/tk/lib/multi-tk.rb: add MultiTkIp#set_cb_error(proc) and
- cb_error(exc) to log errors at callbacks on safe slave IPs.
-
- * ext/tk/lib/multi-tk.rb: fail to get an available slave IP object
- when call Tk.mainloop in the block which is given to new_* method,
- because cannot finish initialize while the root widget is alive.
-
- * ext/tk/lib/multi-tk.rb: fail to control a slave IP when Tk.mainloop
- runs on the IP.
-
-Wed Jul 20 19:20:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * io.c (S_ISREG): need to define S_ISREG before it is used first.
-
-Wed Jul 20 18:40:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * io.c (wsplit_p): patch for the environment where
- fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case,
- set FMODE_WSPLIT without fcntl check. [ruby-dev:26566]
-
-Wed Jul 20 18:07:11 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_ctl): update FMODE_WSPLIT_INITIALIZED and FMODE_WSPLIT
- by F_SETFL.
-
-Wed Jul 20 10:04:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_class_path): need to adjust snprintf() len for
- teminating NUL. [ruby-dev:26581]
-
-Wed Jul 20 04:01:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/socket/socket.c: sorry, BeOS also uses HAVE_CLOSESOCKET,
- so reverted.
-
- * ext/socket/extconf.rb: should not define HAVE_CLOSESOCKET
- on windows.
-
-Wed Jul 20 03:16:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/socket/socket.c: should not undef close() on win32.
- it's defined to rb_w32_close(), otherwise handle leaks.
- [ruby-Bugs-2131]
-
-Wed Jul 20 00:48:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (syserr_initialize): don't use str before StringValue()
- check. [ruby-dev:26579]
-
-Tue Jul 19 22:47:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (syserr_initialize): add 1 byte for snprintf() size for
- NUL at the end. [ruby-dev:26574]
-
-Tue Jul 19 16:39:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_inspect): replace sprintf() with "%s" format all
- over the place by snprintf() to avoid integer overflow.
+Tue Sep 30 18:46:31 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Jul 19 14:08:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/win32ole/win32ole_typelib.c: use typed data.
- * ext/tcltklib/tcltklib.c: rbtk_eventloop_depth is used as int.
+Tue Sep 30 09:51:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tcltklib/tcltklib.c: rbtk_pending_exception is tested with
- NIL_P, so should assign Qnil instead of 0 (Qfalse).
+ * common.mk: fixed broken reference of update-config_files task
- * ext/tcltklib/tcltklib.c (ip_invoke_real): fixed memory leak when
- ip is deleted.
+Mon Sep 29 22:54:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 19 13:19:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * win32/file.c (append_wstr): set expanded length, not length of
+ appended string. fix "probable buffer overflow" bug.
+ [ruby-core:65317] [Bug #10304]
- * ext/tk/lib/tk/variable.rb: For symmetry, add TkVariable#string. It
- returns a string even if the default value type of the TkVariable
- object is not "string".
+ * string.c (str_make_independent_expand): drop NOFREE flag after
+ reallocation, static buffer is not pointed anymore.
+ [ruby-core:65317] [Bug #10304]
-Mon Jul 18 21:40:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Sep 28 23:59:17 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * eval.c (rb_call0): make the pointer to NODE volatile
- instead of NODE itself.
+ * gc.c (rb_gcdebug_print_obj_condition): use RVALUE_REMEMBERED
+ because GET_HEAP_REMEMBERSET_BITS is obsoleted.
-Mon Jul 18 14:32:21 2005 Tanaka Akira <akr@m17n.org>
+Sun Sep 28 11:14:14 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * eval.c (rb_call0): make body volatile to avoid optimization problem.
- [ruby-dev:26195]
+ * common.mk: Created new target update-unicode to download
+ some Unicode data files.
-Mon Jul 18 12:23:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Fri Sep 26 15:03:19 2014 Masaki Matsushita <glass.saga@gmail.com>
- * ext/io/wait/wait.c: wrong backport from trunk. fixed: [ruby-dev:26562]
+ * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError when
+ uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]
-Mon Jul 18 09:36:25 2005 Tanaka Akira <akr@m17n.org>
+ * test/uri/test_parser.rb: test for above.
- * rubyio.h (FMODE_WSPLIT, FMODE_WSPLIT_INITIALIZED): new constant.
+Sat Sep 27 10:31:48 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * io.c (wsplit_p): new function.
- (io_fwrite): split writing data by PIPE_BUF if wsplit_p is true in
- multi-threaded mode.
- [ruby-dev:26540]
+ * gems/bundled_gems: upgraded to power_assert 0.1.4.
-Sun Jul 17 13:46:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 26 12:52:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/io/wait/extconf.rb, ext/io/wait/wait.c: Win32 platforms support.
+ * ext/stringio/stringio.c (strio_write): ASCII-8BIT StringIO
+ should be writable any encoding strings, without conversion.
+ [ruby-core:65240] [Bug #10285]
-Fri Jul 15 23:59:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 26 05:21:01 2014 Eric Wong <e@80x24.org>
- * lib/rdoc/parsers/parse_c.rb (handle_class_module): handle a
- module enclosed in a built-in module. fixed: [ruby-talk:148239]
+ * object.c (rb_class_real): do not dereference 0 VALUE
- * lib/rdoc/parsers/parse_c.rb (find_body): allow macros as methods.
+ * test/ruby/test_module.rb (test_inspect_segfault):
+ Test case and bug report by Thomas Stratmann.
+ [ruby-core:65214] [Bug #10282]
- * lib/rdoc/parsers/parse_c.rb (find_call_seq): allow :nodoc: modifier
- in C. [ruby-core:04572]
+Fri Sep 26 05:12:10 2014 Eric Wong <e@80x24.org>
-Fri Jul 15 18:00:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * man/ruby.1: document stack size env variables
+ [Feature #10197]
- * bcc32/Makefile.sub (COMMON_HEADERS): ruby_1_8 is using winsock.h.
- failed to compile ext/socket on bcc5.6.4. [ruby-dev:26193]
+Thu Sep 25 19:37:34 2014 Eric Wong <e@80x24.org>
-Fri Jul 15 07:58:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * io.c (free_io_buffer): new function for a common pattern
+ (clear_readconv): use free_io_buffer
+ (rb_io_fptr_finalize): ditto
- * lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
- sockets should be non-blocking mode. [ruby-dev:26405]
+Thu Sep 25 07:51:07 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/webrick/utils.rb (WEBrick::Utils.set_non_blocking): new method.
+ * lib/matrix.rb: Fix docs. Patched by Ben Woodall. [GH-726]
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_chunked):
- should call sock.read repeatedly until the preferred size data
- is obtained.
+Wed Sep 24 19:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Thu Jul 14 18:27:16 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * enc/unicode/data: New directory for downloaded Unicode
+ data files.
- * win32/win32.c (rb_w32_strerror): should return correct message
- for ENAMETOOLONG and ENOTEMPTY. (bcc32) [ruby-dev:26533]
+Wed Sep 24 18:59:59 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (rb_w32_strerror): stripped CR LF on the tail.
- (bcc32) [ruby-dev:26533]
+ * tool/downloader.rb: Adjusting example for
+ Downloader.download to implementation changes in r47693.
-Thu Jul 14 00:45:42 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 24 18:06:06 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * LEGAL (ext/nkf/nkf-utf8): updated from nkf1.7 to nkf-utf8.
+ * tool/downloader.rb: Removing unused method
+ Downloader.download_if_modified_since.
+ (if ever used, just replace with Downloader.download)
-Wed Jul 13 19:37:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Sep 24 17:59:59 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (rb_w32_mkdir): should set EEXIST (not EACCES)
- if file or directory already exists. (bcc32) [ruby-dev:26508]
+ * tool/downloader.rb: Fixing raise after return.
- * win32/win32.c (rb_w32_rmdir): should set ENOTDIR (not EINVAL)
- if it is not directory. (bcc32, win32)
+Wed Sep 24 17:55:55 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (rb_w32_rmdir, rb_w32_unlink): restore
- FILE_ATTRIBUTE_READONLY flag on function failure.
+ * tool/downloader.rb: Made Unicode data file location available
+ via :unicode Symbol.
-Wed Jul 13 12:40:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Sep 24 10:45:45 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
- * ext/tcltklib/tcltklib.c: TclTkLib.do_one_event doesn't work.
+ * tool/downloader.rb: Small fix to documentation comment.
- * ext/tk/lib/tk.rb: Tk.thread_update is available.
+Tue Sep 23 22:00:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jul 12 23:32:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (parse_ident): just after a label, new expression should
+ start, cannot be a modifier. [ruby-core:65211] [Bug #10279]
- * lib/mkmf.rb: keep curdir unexpanded.
+Tue Sep 23 16:07:07 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
-Mon Jul 11 08:31:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/downloader.rb: added Downloader.download_if_modified_since
+ to reduce downloads of large files that change only rarely.
+ [ruby-core:65164] [CommonRuby - Feature #10084]
- * regex.c (read_special): fix parsing backslashes following \c in
- regexp. fixed: [ruby-dev:26500]
+Tue Sep 23 11:55:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Jul 11 02:53:00 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * .travis.yml: added rubyspec into travis tasks and eliminate to stdout.
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line):
- mistook in merging the patch of [ruby-dev:26235] at
- revision 1.4.2.6.
+Mon Sep 22 20:00:29 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sun Jul 10 23:58:04 2005 Tanaka Akira <akr@m17n.org>
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_time2date_with_msec): test by using only
+ assert_in_delta to avoid to fail when converting Time object with
+ 999999999 nanoseconds into VT_DATE Variant.
- * lib/pathname.rb (Pathname#unlink): try Dir.unlink first to
- avoid unlink a directory by root.
- cf. [ruby-dev:26237]
+Mon Sep 22 19:49:12 2014 Zachary Scott <e@zzak.io>
-Sun Jul 11 05:18:17 2005 Michael Neumann <mneumann@ruby-lang.org>
+ * doc/syntax/methods.rdoc: [DOC] [] and []= methods by @process
+ [Fixes GH-662] https://github.com/ruby/ruby/pull/662
- * lib/xmlrpc/server.rb (XMLRPC::Server): Switch from GServer over to
- WEBrick. This makes file lib/xmlrpc/httpserver.rb obsolete (at least it is
- no further used by the XML-RPC library).
+Mon Sep 22 18:21:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Jul 10 12:47:01 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .travis.yml: Only osx build is enabled. linux builds is random failure
+ and test results of major linux is covered by rubyci.
- * lib/debug.rb (debug_command): added a deficient format specifier.
- fixed: [ruby-core:05419]
+Mon Sep 22 12:10:29 2014 Tanaka Akira <akr@fsij.org>
-Sat Jul 9 21:28:46 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * test/ruby/test_time_tz.rb: Fix test error with tzdata-2014g.
+ [ruby-core:65058] [Bug #10245] Reported by Vit Ondruch.
- * ext/win32ole/win32ole.c (ole_method_dispid): convert dispid
- in Ruby and C by INT2NUM and NUM2INT.
+Mon Sep 22 09:28:43 2014 Eric Wong <e@80x24.org>
- * ext/win32ole/win32ole.c (ole_invoke2): ditto.
+ * ext/socket/ancdata.c ({send,recv}msg_args_struct): 24 => 16 bytes
+ * ext/socket/init.c (connect_arg): ditto
+ * ext/socket/raddrinfo.c (getnameinfo_arg): 56 => 48 bytes
+ (reductions only for 64-bit systems)
- * ext/win32ole/test/testWIN32OLE.rb: ditto.
+Mon Sep 22 02:04:25 2014 Tanaka Akira <akr@fsij.org>
- * ext/win32ole/test/testOLEMETHOD.rb: ditto.
+ * lib/drb/drb.rb: Support graceful shutdown.
+ (DRbTCPSocket#initialize): Create a pipe for shutdown notification.
+ (DRbTCPSocket#close): Invoke close_shutdown_pipe.
+ (DRbTCPSocket#close_shutdown_pipe): New private method.
+ (DRbTCPSocket#accept): Use accept_or_shutdown.
+ (DRbTCPSocket#accept_or_shutdown): New private method which returns
+ nil on shutdown.
+ (DRbServer#stop_service): Use shutdown instead of Thread#kill.
+ (DRbServer#run): Break infinite loop when main_loop returns nil.
+ (DRbServer#main_loop): @protocol.accept may return nil.
-Fri Jul 8 15:45:04 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/drb/ssl.rb: Follow above change.
- * lib/rss/rss.rb (RSS::VERSION): 0.1.4 -> 0.1.5.
+ * lib/drb/unix.rb: Ditto.
- * test/rss/test_version.rb (RSS::TestVersion#test_version):
- ditto.
-
- * lib/rss/0.9.rb (RSS::Rss::Channel::Item::Category):
- domain attribute of <category> is optional. Thanks to
- Chris Lee <clee@kde.org>.
-
- * test/rss/test_parser.rb (RSS::TestParser#test_category20):
- adjusted test case.
-
-Tue Jul 5 23:44:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * instruby.rb: expand source library path.
-
-Tue Jul 5 23:27:14 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (sort_2): get rid of yet another bcc's bug.
- fixed: [ruby-core:05152]
-
- * eval.c (rb_thread_save_context): must not switch contexts during
- re-allocating stack. fixed: [ruby-core:05219]
-
-Tue Jul 5 15:15:10 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil.c: fix typo.
-
-Tue Jul 5 14:51:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: bug fix on treating Unicode strings.
-
- * ext/tcltklib/tcltklib.c: add methods to treat encoding mode.
-
- * ext/tcltklib/MANUAL.eng: add description of TclTkLib#encoding,
- encoding_system, and so on.
-
- * ext/tcltklib/MANUAL.euc: ditto.
-
- * ext/tk/tkutil.c: fail to create a Tcl's list string from an
- array including multiple kind of encoded strings.
-
- * ext/tk/lib/tk.rb: ditto.
-
- * ext/tk/lib/multi-tk.rb: 2nd arg of _{to|from}UTF8 is omissible.
-
- * ext/tk/lib/remote-tk.rb: ditto.
-
- * ext/tk/lib/tk.rb: override TclTkLib#encoding and encoding= to
- use TkCore::INTERP.encoding and encoding=.
-
- * ext/tk/lib/tk.rb: when "require 'tk'" and $KCODE=='NONE', check
- DEFAULT_TK_ENCODING to decide Ruby/Tk's system encoding mode.
-
- * ext/tk/lib/tk/encodedstr.rb: check both of Tk.encoding and
- Tk.encoding_system. Tk.encoding has higher priority.
-
- * ext/tk/lib/tk/optiondb.rb: ditto.
-
- * ext/tk/lib/tk/spinbox.rb: ditto.
-
- * ext/tk/lib/tk/validation.rb: ditto.
-
- * ext/tk/lib/tk/namespace.rb: arguemnts for TclTkIp#_merge_tklist
- should be UTF-8 strings.
-
-Mon Jul 4 14:35:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sample/svr.rb: service can be stopped by ill-behaved client; use
- tsvr.rb instead.
-
-Mon Jul 4 13:25:21 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/erf.c: original erf.c by prof. Okumura is confirmed to
- be public domain. reverted BSD implementation.
-
-Mon Jul 4 11:15:37 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
- which using fork on fork-less platforms.
-
-Sun Jul 3 23:26:30 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/wsdl/document/test_rpc.rb: compare formatted time string of
- Time objects instead of comparing Time objects itself to avoid
- unintended conflict of usec part. [ruby-dev:26220]
-
-Sat Jul 2 22:41:04 2005 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/socket.c (unix_send_io, unix_recv_io): support x86-64 and
- IA64.
-
-Sat Jul 2 17:06:23 2005 Tanaka Akira <akr@m17n.org>
-
- * defines.h (FLUSH_REGISTER_WINDOWS): defined for IA64.
- (flush_register_windows): declare flush_register_windows.
-
- * eval.c (flush_register_windows): new function.
-
-Fri Jul 1 17:48:52 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (get2comp): revert all prior changes, and calculate
- proper 2's complement for negative numbers. backported from
- HEAD.
-
-Fri Jul 1 15:50:12 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * missing/erf.c: need to include some headers for some platforms.
-
- * win32/win32.h (copysign, scalb): define for compatibility with
- other platforms. [ruby-dev:26430]
-
-Fri Jul 1 15:37:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/crypt.c: modified to make it compilable on platforms
- other than BSD. [ruby-dev:26430]
-
- * missing/erf.c: ditto. code from <exp.c> merged.
-
-Fri Jul 1 12:44:56 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI.open_http): refine post_connection_check
- call.
-
-Fri Jul 1 11:34:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/crypt.c: replaced with 4.4BSD version.
-
- * missing/erf.c: ditto.
-
- * missing/vsnprintf.c: removed the third provision from the old
- BSD license. [ruby-core:05177]
-
-Fri Jul 1 01:45:21 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_min, enum_max): must not return Qundef.
- fixed: [ruby-core:05299]
-
-Fri Jul 1 00:18:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator::respond_to): respond_to? must check
- destination object. [ruby-talk:146894]
-
-Thu Jun 30 19:00:21 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb (RubyLex::identify_number): alternative implements
- for [ruby-dev:26410]. And support a numeric form of 0d99999.
-
-Thu Jun 30 17:28:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb (RubyLex::identify_number): should not treat
- plain zero as an octal number. [ruby-dev:26410]
-
-Thu Jun 30 15:13:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): pre-evaluate argument for unambiguous
- evaluation order. [ruby-dev:26383]
-
-Thu Jun 30 09:53:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (Delegator::method_missing): forward unknown
- method to the destination. suggested by
- <christophe.poucet@gmail.com>. [ruby-talk:146776]
-
-Tue Jun 28 21:59:29 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unused
- variable" [ruby-dev:26387]
-
-Sat Jun 25 17:15:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should
- discard if key=val pair is empty. patch from Gary Wright.
-
-Sat Jun 25 23:30:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (detach_process_watcher): terminate process watcher
- thread right after rb_waitpid() succeed. [ruby-talk:146430]
-
-Sat Jun 25 15:49:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_min, enum_max): do not ignore nil as the first element.
-
-Sat Jun 25 14:40:17 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/sdbm/init.c (fsdbm_select): SDBM#select had returned the array
- which contained each elements twice. [ruby-dev:26358]
-
-Fri Jun 25 05:06:47 2005 Michael Neumann <mneumann@ruby-lang.org>
-
- * lib/xmlrpc/*, test/xmlrpc/*: backported changes from HEAD into 1.8
-
-Fri Jun 24 17:00:00 2005 Shigeo Kobayashi <shigeo@tinyforest.jp>
-
- * ext/bigdecimal/bigdecimal.c: patch from "NATORI Shin"
- (u-tokyo.ac.jp) applied to fix rounding bug.
-
-Fri Jun 24 13:06:45 2005 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/common.rb, lib/uri/generic.rb: fixed typo in documents and
- replaced some existent domain name with "example.com".
-
-Fri Jun 24 12:23:19 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fix typo on Tk.grid_propagate.
-
- * ext/tk/lib/tk.rb: Tk.event_generate and TkWindow#event_generate
- accept TkEvent::Event object as context argument.
-
- * ext/tk/lib/tk/event.rb: add TkEvent::Event#valid_fields and
- valid_for_generate to get field parameters of event_generate.
-
-Thu Jun 23 23:55:59 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * runruby.rb: should load built rbconfig.rb.
-
-Thu Jun 23 16:53:15 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/canvastag.rb: TkcGroup.new cannot include given items.
- TkcGroup#exclude calls wrong method.
- Add alias TkcGroup#add [ruby-talk:146049].
-
- * ext/tk/lib/tk/canvas.rb: TkCanvas#dtag and some subcommands of
- TkCanvas#addtag fail to treat a TkcTag argument.
-
- * ext/tk/lib/tk/event.rb: add TkEvent::Event#generate to help to send
- current event to other widgets.
-
-Mon Jun 20 18:44:04 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): DUMMY_SETJMP is replaced
- because setjmp is not enough to fix getcontext and SPARC register
- window problem.
-
-Mon Jun 20 16:48:36 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
-
- * ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed?
-
- * ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed?
-
- * test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb
- (teardown): close all db objects before deleting data files.
-
- * win32/win32.{ch} (unlink): hook runtime function to change
- file attribute before unlinking.
- fixed: [ruby-dev:26360]
-
-Mon Jun 20 02:15:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (define_final): document fix: finalizers never get called
- before target object is destroyed.
-
-Mon Jun 20 01:26:49 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/openssl_missing.c, ext/openssl/ossl.h,
- ext/openssl/ossl_asn1.c, ext/openssl/ossl_bio.c,
- ext/openssl/ossl_pkcs12.h, ext/openssl/ossl_x509req.c: avoid
- compiler warnings. suggested by Michal Rokos.
-
-Sun Jun 19 14:09:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (run_final): reduce unnecessary object allocation during
- finalization.
-
- * gc.c (rb_gc_call_finalizer_at_exit): deferred finalizers list should
- be cleared before calling them. fixed: [ruby-talk:145790]
-
-Fri Jun 17 13:01:40 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/time.rb (Time.parse): fix previous leap seconds support.
- (Time.rfc2822): ditto.
- (Time.xmlschema): ditto.
-
-Thu Jun 16 15:06:55 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/tcltklib/tcltklib.c (ip_rb_threadVwaitCommand): Tcl_Release
- was missing.
-
-Thu Jun 16 13:34:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: add Tk.getMultiple{Open|Save}File() which return
- an Array of selected files.
-
-Thu Jun 16 12:53:24 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/time.rb (Time.parse): "Fri Jan 1 08:59:60 +0900 1999" was
- parsed as "Fri Jan 01 09:00:00 JST 1999" even on an environment
- which supports leap seconds.
- (Time.rfc2822): ditto.
- (Time.xmlschema): ditto.
-
-Thu Jun 16 08:29:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/dl/sym.c (rb_dlsym_call): needs FREE_ARGS before return.
- fixed memory leak. [ruby-Bugs-2034]
-
-Wed Jun 15 18:26:39 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: support "tk inactive" sub-command [for Tcl/Tk8.5a3]
-
- * ext/tk/lib/tk/namespace.rb: support "namespace path" sub-command and
- 'namespace ensemble' sub-command [for Tcl/Tk8.5a3]
-
-Tue Jun 14 02:02:43 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil.c: add TkUtil::CallbackSubst.subst_arg(m, ...) &
- _define_attribute_aliases(hash) to get substitution-argument from
- attributes (e.g. subst_arg(:x,:y,:num,:button) --> "%x %y %b %b ").
-
- * ext/tk/lib/tk/event.rb: use _define_attribute_aliases().
-
-Mon Jun 13 13:01:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]
-
-Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * signal.c (sigexit): call rb_thread_signal_exit() instead of
- rb_exit(). [ruby-dev:26347]
-
- * eval.c (rb_thread_signal_exit): a new function to exit on main
- thread.
-
- * eval.c (rb_thread_switch): exit status should be retrieved from
- ruby_errinfo.
-
- * eval.c (rb_f_exit): ensure exit(0) should call
- exit(EXIT_SUCCESS).
-
-Mon Jun 13 01:20:02 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (rb_gc_mark_threads): curr_thread may not be part of the
- thread list. [ruby-dev:26312]
-
-Fri Jun 10 23:35:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * missing/mkdir.c: remove. [ruby-core:05177]
-
-Fri Jun 10 22:54:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing.h: fd_set stuffs need sys/types.h. fixed: [ruby-core:05179]
-
-Thu Jun 9 23:58:12 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/Win32API/Win32API.c (Win32API_Call): disable global
- optimization. fixed: [ruby-core:05143]
-
-Thu Jun 9 23:35:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_inject): default the result value to Qundef to use
- first element as initial value if not given.
-
-Thu Jun 9 19:55:41 2005 Tanaka Akira <akr@m17n.org>
-
- * eval.c (ruby_longjmp): new macro to call longjmp, setcontext, etc.
- (ruby_setjmp): new macro to call setjmp, getcontext, etc.
- (ruby_setjmp): call setjmp before getcontext to avoid IA64 register
- stack problem.
- [ruby-talk:144939]
-
- * gc.c (Init_stack): remove IA64_MAGIC_STACK_LIMIT.
-
-Thu Jun 9 11:55:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (SimpleDelegator::__setobj__): need check for
- recursive delegation. [ruby-core:04940]
-
-Wed Jun 8 18:47:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-expr-beg): fix looking point drift.
-
-Wed Jun 8 11:11:34 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (get2comp): calculate proper 2's complement for
- negative numbers. a bug in normalizing negative numbers
- reported from Honda Hiroki <hhonda@ipflex.com>.
-
-Wed Jun 8 08:33:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enum.c (enum_min_by, enum_max_by): return nil if no iteration.
- fixed: [ruby-dev:26245]
-
- * eval.c (rb_need_block): ensure a block is given.
-
- * eval.c (backtrace): skip successive frames sharing same node.
-
-Wed Jun 8 00:15:08 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_getaddrinfo__aix): merged a patch from
- KUBO Takehiro <kubo at jiubao.org> to support AIX. [ruby-list:40832]
-
-Wed Jun 8 00:09:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/yaml/rubytypes.rb (Array::to_yaml): merged a patch from
- Tilman Sauerbeck <tilman at code-monkey.de>. [ruby-core:05055]
-
- * lib/yaml/rubytypes.rb (Hash::to_yaml): ditto.
-
-Wed Jun 8 00:00:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/curses/curses.c (curses_insertln): merged a patch from
- TAKAHASHI Tamotsu <ttakah at lapis.plala.or.jp>. [ruby-ext:02305]
-
-Tue Jun 7 19:34:15 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/init.rb (IRB::IRB.rc_file_generators): more flexible
- IRB.rc_file_generators. [ruby-core:05163]
-
-Tue Jun 7 18:39:31 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/thread.rb: RDoc documentation from Eric Hodel
- <drbrain at segment7.net> added. [ruby-core:05148]
-
-Tue Jun 7 18:30:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
- fixed: [ruby-dev:26294]
-
-Tue Jun 7 17:39:54 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_cvar_get): Module#class_variable_get(): back
- ported from CVS HEAD. [ruby-talk:144741]
-
- * object.c (rb_mod_cvar_set): Module#class_variable_set().
- [ruby-talk:144741]
-
-Tue Jun 7 16:32:53 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): raise exception on debug mode (-d),
- not verbose mode (-v/-w). [ruby-core:05123]
-
-Tue Jun 7 10:30:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: slave-ip fails to call procedures
- delegated by master-ip.
-
-Sun Jun 5 23:00:35 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/console.rb: create console when required
-
- * ext/tk/sample/tkextlib/tile/demo.rb: fix TypeError & create Console
-
-Sat Jun 4 14:55:18 2005 Tanaka Akira <akr@m17n.org>
-
- * test/dbm/test_dbm.rb: merged from ext/dbm/testdbm.rb.
-
- * test/gdbm/test_gdbm.rb: merged from ext/gdbm/testgdbm.rb.
-
- * test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with
- modification to use test/unit.
-
-Fri Jun 3 14:06:12 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: fix typo.
-
-Wed Jun 1 11:32:42 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * bcc32/Makefile.sub: can use single quote character in DESTDIR.
- [ruby-dev:26205]
-
-Mon May 30 23:48:29 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/macpkg.rb: add PACKAGE_NAME information of Tcl/Tk
- Extension.
-
- * ext/tk/lib/tk/msgcat.rb: ditto.
-
- * ext/tk/lib/tk/winpkg.rb: ditto.
-
- * ext/tk/lib/tkextlib/*: ditto.
-
-Sat May 28 16:40:15 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * test/openssl/test_x509store.rb: add test for expired CRL
- and refine some assertions.
-
-Sat May 28 05:15:51 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): should
- not set internal flag directry.
-
-Sat May 28 02:00:11 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line):
- ENV["REQUEST_URI"] is better to get correct Request-URI
- than ENV["SCRIPT_NAME"] + ENV["PATH_INFO"]. [ruby-dev:26235]
-
-Fri May 27 16:32:04 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/mkmf.rb: use the semicolon as the path separator
- in the environment of MSYS. fixed: [ruby-dev:26232]
-
-Thu May 26 06:08:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: add shortcut-methods of tk_call + tk_split_list
-
-Wed May 25 22:52:42 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/irb/input-method.rb: do not use Readline::HISTORY.pop.
- (backported from HEAD)
-
-Wed May 25 21:55:40 2005 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/readline.c: supported libedit. (backported from HEAD)
-
- * ext/readline/extconf.rb: ditto.
-
- * test/readline/test_readline.rb: ditto.
-
-Wed May 25 20:06:27 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: TkComm#tk_split_*list fail to split a kind of SJIS
- strings. To avoid the trouble, add arguments to control converting
- encoding, and do split on a UTF8 string.
-
- * ext/tk/lib/multi-tk.rb: modify to attend encoding.
-
- * ext/tk/lib/remote-tk.rb: ditto.
-
- * ext/tk/lib/tk/itemconfig.rb: ditto.
-
- * ext/tk/lib/tk/listbox.rb: ditto.
-
- * ext/tk/lib/tk/namespace.rb: ditto.
-
- * ext/tk/lib/tk/panedwindow.rb: ditto.
-
- * ext/tk/lib/tk/text.rb: ditto.
-
- * ext/tk/lib/tk/textmark.rb: ditto.
-
- * ext/tk/lib/tk/texttag.rb: ditto.
-
- * ext/tk/lib/tk/variable.rb: ditto.
-
- * ext/tk/lib/tk/winfo.rb: ditto.
-
- * ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb: ditto.
-
- * ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: ditto.
-
- * ext/tk/lib/tk.rb: add TkWindow#lower_window/raise_window and
- Tk#lower_window/raise_window by reason of method-name conflict
-
- * ext/tk/lib/tk/canvas.rb: bug fix on TkCanvas#delete when given
- non-TkcItem arguments.
-
- * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto.
-
-Wed May 25 12:59:48 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI::Meta::RE_QUOTED_STRING): a content of
- quoted-string should be zero or more characters.
-
-Tue May 24 23:42:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (fix_pow): support Fixnum ** Float case directly
- without coercing. [ruby-talk:142697] [ruby-talk:143054]
-
-Tue May 24 16:57:24 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ruby.c (require_libraries): caused SEGV when continuation jumped
- in to the required library code.
-
-Tue May 24 11:56:25 2005 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/getopts.rb: should warn only if verbose mode.
- fixed: [ruby-dev:26201]
-
-Tue May 24 06:45:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): string
- literals to be matched non-greedy.
-
-Tue May 24 00:34:32 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/soap/calc: method name 'set' was able to crash with a class Set.
- [ruby-dev:26210]
-
- * test/wsdl/document/test_rpc.rb: dateTime comparison failed under
- TZ=right/Asia/Tokyo (with leap second.) [ruby-dev:26208]
-
-Mon May 23 16:24:05 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/extconf.rb: Framework support on MacOS X Tiger.
-
- * ext/tcltklib/README.1st: add description of Framework support options.
-
-Mon May 23 12:21:37 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (make_regexp): should not return junk address during
- compile time. [ruby-dev:26206]
-
-Sun May 22 21:54:06 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.4.
-
- == SOAP client and server ==
-
- === for both client side and server side ===
-
- * improved document/literal service support.
- style(rpc,document)/use(encoding, literal) combination are all
- supported. for the detail about combination, see
- test/soap/test_style.rb.
-
- * let WSDLEncodedRegistry#soap2obj map SOAP/OM to Ruby according to
- WSDL as well as obj2soap. closes #70.
-
- * let SOAP::Mapping::Object handle XML attribute for doc/lit service.
- you can set/get XML attribute via accessor methods which as a name
- 'xmlattr_' prefixed (<foo name="bar"/> -> Foo#xmlattr_name).
-
- === client side ===
-
- * WSDLDriver capitalized name operation bug fixed. from
- 1.5.3-ruby1.8.2, operation which has capitalized name (such as
- KeywordSearchRequest in AWS) is defined as a method having
- uncapitalized name. (converted with GenSupport.safemethodname
- to handle operation name 'foo-bar'). it introduced serious
- incompatibility; in the past, it was defined as a capitalized.
- define capitalized method as well under that circumstance.
-
- * added new factory interface 'WSDLDriverFactory#create_rpc_driver'
- to create RPC::Driver, not WSDLDriver (RPC::Driver and WSDLDriver
- are merged). 'WSDLDriverFactory#create_driver' still creates
- WSDLDriver for compatibility but it warns that the method is
- deprecated. please use create_rpc_driver instead of create_driver.
-
- * allow to use an URI object as an endpoint_url even with net/http,
- not http-access2.
-
- === server side ===
-
- * added mod_ruby support to SOAP::CGIStub. rename a CGI script
- server.cgi to server.rb and let mod_ruby's RubyHandler handles the
- script. CGIStub detects if it's running under mod_ruby environment
- or not.
-
- * added fcgi support to SOAP::CGIStub. see the sample at
- sample/soap/calc/server.fcgi. (almost same as server.cgi but has
- fcgi handler at the bottom.)
-
- * allow to return a SOAPFault object to respond customized SOAP fault.
-
- * added the interface 'generate_explicit_type' for server side
- (CGIStub, HTTPServer). call 'self.generate_explicit_type = true'
- if you want to return simplified XML even if it's rpc/encoded
- service.
-
- == WSDL ==
-
- === WSDL definition ===
-
- * improved XML Schema support such as extension, restriction,
- simpleType, complexType + simpleContent, ref, length, import,
- include.
+Sun Sep 21 13:54:36 2014 Masaki Matsushita <glass.saga@gmail.com>
- * reduced "unknown element/attribute" warnings (warn only 1 time for
- each QName).
+ * time.c: raise exception when minutes of utc_offset is out of 00-59.
+ patch is from Kenichi Kamiya.
+ [ruby-dev:47539] [Bug #8679]
- * importing XSD file at schemaLocation with xsd:import.
+ * test/ruby/test_time.rb: test for above.
+ patch is from Kenichi Kamiya.
- === code generation from WSDL ===
+Sun Sep 21 19:04:08 2014 Narihiro Nakamura <authornari@gmail.com>
- * generator crashed when there's '-' in defined element/attribute
- name.
+ * st.c (do_hash_bin): unused macro.
- * added ApacheMap WSDL definition.
+Sun Sep 21 18:45:01 2014 Narihiro Nakamura <authornari@gmail.com>
- * sample/{soap,wsdl}: removed.
+ * parse.y (parser_class_nest): unused variable after YARV
+ merged (r11439).
-Sun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Sep 21 18:14:03 2014 Narihiro Nakamura <authornari@gmail.com>
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#intialize):
- should initialize session id context. [ruby-core:4663]
+ * st.c (numberof): unused. internal.h has same macro.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): add session id support.
+ * node.c (F_CUSTOM2): unused.
-Sat May 21 10:24:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Sep 21 14:11:23 2014 Tanaka Akira <akr@fsij.org>
- * bcc32/Makefile.sub: tds files were not deleted when DESTDIR
- included '\' path delimiter. [ruby-dev:26193]
+ * thread_pthread.c (native_set_thread_name): New function to
+ set thread name visible with ps command on GNU/Linux.
+ Ex. ps -o %c -L
-Thu May 19 19:04:29 2005 speakillof <speakillof@yahoo.co.jp>
+ * thread.c (thread_start_func_2): Call native_set_thread_name at
+ beginning.
+ (rb_thread_inspect_msg): Extract from rb_thread_inspect.
- * lib/rexml/encodings/SHIFT-JIS.rb: encoding and decoding were
- swapped. [ruby-core:4772]
+Sun Sep 21 12:49:11 2014 Eric Wong <e@80x24.org>
-Wed May 18 23:42:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (rb_iseq_defined_string): trim redundant semi-colon
- * error.c (exc_exception): reverted to call Exception#initialize
- directly. fixed: [ruby-dev:26177]
+Sun Sep 21 12:19:29 2014 Eric Wong <e@80x24.org>
-Wed May 18 23:39:09 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (rb_find_file_ext_safe): clear tmp buffer on failure
+ (rb_find_file_safe): ditto
- * dir.c (glob_helper): get rid of using String. [ruby-dev:26180]
+Sat Sep 20 04:42:18 2014 Masaki Matsushita <glass.saga@gmail.com>
- * dir.c (push_braces): should skip balanced braces.
+ * lib/csv.rb: avoid unnecessary object allocations.
+ patch is from Andrew Vit. [ruby-core:63215] [Feature #9952]
- * eval.c (ruby_options), win32/win32.c (NtInitialize): move argument
- intialization back. [ruby-dev:26180]
+Sun Sep 21 12:10:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue May 17 15:31:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/rexml/**/*.rb: removed commented-out code.
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should
- break the loop if the socket reached to EOF. [ruby-talk:142285]
+Sat Sep 20 03:46:58 2014 Masaki Matsushita <glass.saga@gmail.com>
-Tue May 17 11:52:18 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * array.c: use rb_equal_opt() for performance improvement.
+ [ruby-core:64954] [Feature #10227]
- * win32/win32.c (unixtime_to_filetime): use localtime() instead of
- gmtime() when using FileLocalTimeToFileTime().
+Sun Sep 21 11:16:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon May 16 22:28:43 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32ole/win32ole.c (rbtime2vtdate, vtdate2rbtime): fix
+ the bug in conversion of milliseconds. [Bug #10258]
- * win32/win32.h, {bcc32,win32,wince}/Makefile.sub: moved rb_[ugp]id_t
- to get rid of redefinition warnings on mingw.
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_dbl2date_with_msec,
+ test_conversion_time2date_with_msec): use assert_in_delta instead
+ of assert_equal to treat an acceptable error range.
- * class.c (rb_class_init_copy): singleton class is disallowed to copy,
- from its definition. fixed: [ruby-talk:142749]
+Sun Sep 21 11:03:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 16 08:52:29 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * signal.c (ruby_signal): although "EINVAL from sigaction(2) is
+ not a bug", but even it is a failure. pointed at toRuby/guRuby
+ in RubyHiroba.
- * win32/win32.{h,c}: define rb_[pgu]id_t.
+Sat Sep 20 03:00:26 2014 Masaki Matsushita <glass.saga@gmail.com>
-Mon May 16 00:21:02 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#unlink): use SystemCallError instead of
- Errno::EISDIR because EISDIR is not portable.
- [ruby-core:5001]
-
-Sun May 15 22:11:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb (DRbObject#method_missing): use raise(exception).
- [ruby-dev:26164]
-
-Sun May 15 18:56:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, ruby.h: define rb_[pgu]id_t macros instead of typedefs
- to get rid of types which might not be defined yet. [ruby-dev:26165]
-
-Sun May 15 14:35:46 2005 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#unlink): unlink a symlink to a directory
- was failed. [ruby-core:4992]
-
-Sun May 15 09:57:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (unixtime_to_filetime): deal with DST.
- [ruby-talk:141817]
-
-Sat May 14 23:59:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (exc_exception, {exit,name_err,syserr}_initialize): call
- Execption#initialize. fixed: [ruby-talk:142593]
-
-Sat May 14 23:57:26 2005 Erik Huelsmann <ehuels@gmail.com>
-
- * configure.in: Check for the availability of pid_t, gid_t and uid_t and
- remove AC_TYPE_UID_T. fixed: [ruby-core:04745]
-
- * defines.h: Remove pid_t typedef.
-
- * ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with
- the available system types.
-
- * process.c: Change instances of pid_t and gid_t to their rb_*
- counterparts.
-
- * ext/pty/pty.c: Change pid_t to rb_pid_t.
-
- * vms/config.h: Define HAVE_{P,G,U}ID_T to 1.
-
- * win32/Makefile.sub: Remove #define for {g,u}id_t.
-
- * win32/win32.c: Change pid_t to rb_pid_t.
-
- * wince/Makefile.sub: Remove #define for {g,u}id_t.
-
- * wince/sys/types.h: Remove definitions of {p,g,u}id_t.
-
-Fri May 13 23:44:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: keep srcdir unexpanded.
-
- * lib/mkmf.rb (create_makefile): quote topdir and hdrdir if necessary.
- fixed: [ruby-core:04932]
-
- * lib/mkmf.rb (configuration), {bcc32,win32,wince}/Makefile.sub: make
- also INSTALL_PROG and INSTALL_DATA system dependent.
- fixed: [ruby-core:04931]
-
-Fri May 13 17:54:39 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * variable.c (generic_ivar_get): rb_attr_get should not warn.
- [ruby-dev:26010]
-
-Fri May 13 12:28:43 2005 Daniel Berger <djberge@qwest.com>
-
- * array.c (rb_ary_select): can remove argc check. [ruby-core:4911]
-
- * test/ruby/test_array.rb: add test for find_all.
-
-Fri May 13 11:29:00 2005 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * eval.c (unknown_node): add volatile directive to prototype.
-
-Thu May 12 17:08:48 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
- (swallow, rb_io_each_byte, rb_io_getc): revert previous change.
-
- * io.c (rb_io_eof, io_fread, appendline, swallow, rb_io_each_byte)
- (rb_io_getc, rb_getc): call clearerr before getc to avoid
- stdio incompatibility.
-
-Thu May 12 16:52:20 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/rdoc/parsers/parse_c.rb: more readability for mixing
- progress "c..." and warning message.
-
-Thu May 12 16:31:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 2.0.5
-
-Thu May 12 16:15:01 2005 Tanaka Akira <akr@m17n.org>
-
- * io.c (rb_io_eof, remain_size, read_all, io_read, appendline)
- (swallow, rb_io_each_byte, rb_io_getc): don't rely EOF flag.
- [ruby-talk:141527]
-
-Thu May 12 15:56:20 2005 Tilman Sauerbeck <tilman@code-monkey.de>
-
- * lib/rdoc/parsers/parse_c.rb: show parsing progress for C files.
- [ruby-core:4341]
-
-Thu May 12 13:47:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/drb/test_drb{ssl,unix}.rb: can test drb
- before install. (backported from HEAD) [ruby-dev:26146]
-
-Thu May 12 09:53:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * version.c (ruby_show_version): flush for non-tty stdout.
-
-Thu May 12 09:07:07 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/ruby/envutil.rb, test/drb/drbtest.rb: can test drb
- before install. (backported from HEAD) [ruby-Bugs-1672]
-
-Thu May 12 01:23:55 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
- parser. fixed: [ruby-dev:26113]
+ * lib/tempfile.rb: define parameters appropriately and some
+ refactoring.
- * eval.c (unknown_node): ignore broken NODE to get rid of accessing
- possibly inaccessible address. fixed: [ruby-dev:26122]
- should emit more useful information like [ruby-dev:26126], though.
+ * lib/tmpdir.rb: ditto.
-Wed May 11 16:20:01 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Sep 20 23:58:21 2014 Tanaka Akira <akr@fsij.org>
- * lib/webrick/cgi.rb: new methods WEBrick::CGI#[], WEBrick::CGI#logger
- and WEBrick::CGI#config. (backported from HEAD)
+ * enum.c (enum_chunk): Deprecate the state management.
+ (enum_slice_before): Ditto.
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape_path): should
- not use String#split("/"). (backported from HEAD)
+Sat Sep 20 15:39:11 2014 Tanaka Akira <akr@fsij.org>
-Wed May 11 15:58:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enum.c (enum_slice_when): New method: Enumerable#slice_when.
+ (slicewhen_i): New function.
+ (slicewhen_ii): New function.
- * eval.c (break_jump): break should not cross functions.
- [ruby-list:40818]
+ * enumerator.c (InitVM_Enumerator): New method:
+ Enumerator::Lazy#slice_when.
-Wed May 11 10:39:37 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ [ruby-core:62499] [Feature #9826]
- * lib/tempfile.rb (Tempfile#unlink): fixed typo.
+Sat Sep 20 11:55:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed May 11 01:03:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * .travis.yml: added new configurations for osx on travis ci.
+ [fix GH-723]
+ * test/ruby/test_object.rb: tweaked to memory leak limit for osx build.
- * eval.c (TMP_ALLOC): use macro NEW_NODE() to get rid of warnings on
- platforms which have no alloca(). fixed: [ruby-talk:141301]
+Sat Sep 20 10:48:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 8 23:17:47 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * parse.y (assoc): allow quoted ID as a key of a hash literal.
+ [ruby-core:34453] [Feature #4276]
- * ext/tk/lib/tk/timer.rb: fix typo.
+Sat Sep 20 10:23:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 8 16:52:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c (iseq_set_arguments): store local variable IDs in
+ temporary list as Symbols. previously these are stored as
+ Fixnums to prevent from GC, but IDs of dynamic symbols can
+ exceed Fixnum range and cause RangeError at inverting from
+ Fixnum. [ruby-dev:48564] [Bug #10266]
- * lib/profiler.rb: fixed "undefined method `[]' for nil:NilClass"
- [ruby-core:4775] [ruby-talk:140401] [ruby-dev:26118]
+Sat Sep 20 10:02:51 2014 Tanaka Akira <akr@fsij.org>
-Sat May 7 22:58:00 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#pretty_print):
+ New method.
+ (OpenSSL::X509::Certificate#pretty_print): Ditto.
- * lib/mkmf.rb (have_var): no libs argument is given.
+ * ext/openssl/lib/openssl/bn.rb (OpenSSL::BN#pretty_print): Ditto.
-Sun May 1 09:58:11 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Sep 20 07:55:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (process_sflag): replace '-' in variable names with '_'.
- [ruby-dev:26107]
+ * vm_eval.c (eval_string_with_cref): fix super from eval with
+ scope. set klass in the current control frame to the class of
+ the receiver in the context to be evaluated, this class/module
+ must match the actual receiver to call super.
+ [ruby-core:65122] [Bug #10263]
- * ruby.c (set_arg0): use also environment variable space for setting
- $0. [ruby-core:04774]
+Fri Sep 19 20:06:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 27 23:42:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * symbol.c (rb_str_dynamic_intern): check if the stem ID of
+ attrset ID is already registered as a static ID.
+ [ruby-dev:48559] [Bug #10259]
- * win32/Makefile.sub (OPTFLAGS): default global optimization to
- disabled only for VC++6.
+Fri Sep 19 15:48:09 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Apr 26 22:58:00 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * win32/Makefile.sub (VCSUP): nothing to do if this worktree is not
+ under any VCS (it means that the worktree may be from the release
+ package).
- * ext/tcltklib/tcltklib.c (ip_invoke_core): call Tcl's "::unknown"
- command when can't get information of target command.
+Fri Sep 19 10:47:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 25 01:18:43 2005 Tanaka Akira <akr@m17n.org>
+ * test/ruby/test_math.rb (TestMath#assert_infinity): Float#finite?
+ returns true also for NaN, so use Float#infinite? instead.
+ [ruby-core:65117] [Feature #10261]
- * regex.c: declare rb_warn to have variadic argument. [ruby-core:4751]
+Fri Sep 19 05:36:16 2014 Eric Wong <e@80x24.org>
-Sat Apr 23 19:45:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * NEWS: note --with-jemalloc option [ci skip]
- * ext/tcltklib/tcltklib.c (ip_RubyExitCommand): exit with status code
- via TclTkIp#_eval didn't work. [ruby-talk:139390]
+Thu Sep 18 16:26:27 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 22 16:41:50 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/rubygems/test_gem_commands_setup_command.rb: @ui uses StringIO
+ as its streams, and Encoding.default_external does not effect to
+ StringIOs already exist. so, we need to set external_encoding of
+ @ui.outs directly. this problem (test failure) does not appear in
+ the environments default_external is us-ascii or utf-8.
- * ext/tcltklib/tcltklib.c (ip_set_exc_message): fixed memory leak.
+Thu Sep 18 15:02:15 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tcltklib/tcltklib.c: eTkCallbackReturn was not initialized.
+ * test/rubygems/test_gem_specification.rb: '/' is not always the root.
-Thu Apr 21 00:07:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 18 09:36:37 2014 Scott Francis <scott.francis@shopify.com>
- * lib/mkmf.rb (create_makefile): support platforms have file separator
- other than /.
+ * vm_method.c (Init_Method): make global method cache size
+ configurable by environment variable
+ "RUBY_GLOBAL_METHOD_CACHE_SIZE" [Fix GH-719]
- * {bcc32,win32,wince}/Makefile.sub (BUILD_FILE_SEPARATOR): separator
- of building platform.
+Thu Sep 18 07:03:36 2014 Eric Wong <e@80x24.org>
- * {bcc32,win32,wince}/Makefile.sub (CP, INSTALL): use COPY command.
+ * test/-ext-/string/test_modify_expand.rb: increase limit
+ for {je,tc}malloc [Bug #10236]
-Wed Apr 20 23:22:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 18 06:41:18 2014 Eric Wong <e@80x24.org>
- * Makefile.in, common.mk: miniruby depens on MINIOBJS.
+ * ext/zlib/zlib.c (struct gzfile): pack (288 => 272 bytes) on 64-bit
- * dmydln.c (dln_load): dummy function to raise LoadError.
+Thu Sep 18 05:44:05 2014 Eric Wong <e@80x24.org>
- * cygwin/GNUmakefile.in, {bcc32,win32,wince}/Makefile.sub: miniruby
- can't load extensions on Windows.
+ * ext/socket/init.c (rsock_connect): refactor for blocking
+ (wait_connectable): clear error before wait
+ [Bug #9356]
-Wed Apr 20 23:01:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 17 23:12:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/ifchange.bat: delete testing files.
+ * lib/uri/rfc3986_parser.rb: specify a regexp for :OPAQUE; generic.rb
+ assumes it is present, and will refuse all values otherwise.
+ by Matthew Draper <matthew@trebex.net>
+ https://github.com/ruby/ruby/pull/718 fix GH-718
-Wed Apr 20 07:27:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 17 16:22:58 2014 Eric Wong <e@80x24.org>
- * {bcc32,win32,wince}/configure.bat, {bcc32,win32,wince}/setup.mak:
- add extout option.
+ * ext/zlib/zlib.c (zlib_mem_alloc): check overflow
- * bcc32/setup.mak: make configuration variables overridable.
+Wed Sep 17 11:33:35 2014 Laurent Arnoud <laurent@spkdev.net>
-Wed Apr 20 04:15:27 2005 Keiju Ishitsuka <keiju@ruby-lang.org>
+ * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
+ added test for long long [fix GH-716]
- * lib/irb.rb lib/irb/* doc/irb: IRB 0.9.5
+Wed Sep 17 11:09:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Apr 19 23:37:09 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * tool/rbinstall.rb: fixed invalid options with latest rubygems.
+ https://github.com/rubygems/rubygems/issues/1013
- * lib/ftools.rb (File.safe_unlink): do not modify a symlinked file.
+Tue Sep 16 19:19:00 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 19 00:06:20 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_app_aobench.rb: update outdated links to the
+ original program. [ruby-dev:48550] [Feature #10247]
- * ext/extmk.rb: expand path for ext/**/extconf.rb.
+Tue Sep 16 01:06:40 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Apr 18 11:25:14 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544
- * ext/zlib/zlib.c (zstream_run): fixed SEGV. [ruby-core:4712]
+Mon Sep 15 16:21:10 2014 Eric Wong <e@80x24.org>
-Sun Apr 17 23:57:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (struct io_advise_struct): 32 => 24 bytes on 64-bit
+ * io.c (struct io_internal_writev_struct): 24 => 16 bytes on 64-bit
+ * process.c (struct waitpid_arg): ditto
- * ext/extmk.rb (extmake, parse_args): do not expand destdir.
+Mon Sep 15 10:29:25 2014 Natalie Weizenbaum <nweiz@google.com>
- * ext/extmk.rb (relative_from): treat mere drive letter as an absolute
- path.
+ * ext/pathname/lib/pathname.rb (SAME_PATHS):
+ Pathname#relative_path_from uses String#casecmp to compare strings
+ on case-insensitive filesystem platforms (e.g., Windows). This can
+ return nil for strings with different encodings, and the code
+ previously assumed that it always returned a Fixnum. [Fix GH-713]
-Sat Apr 16 17:01:16 2005 Kouhei Sutou <kou@cozmixng.org>
+Mon Sep 15 09:43:18 2014 Sho Hashimoto <sho.hsmt@gmail.com>
- * sample/rss/tdiary_plugin/rss-recent.rb (rss_recent_cache_rss):
- use the first date information of items as site date information
- if channel doesn't have date information.
+ * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): fix typo,
+ SIZEOF_LONG_LON. [Fix GH-714]
-Sat Apr 16 15:27:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Sep 15 08:13:40 2014 Matthew Draper <matthew@trebex.net>
- * configure.in (RUBY_PROG_INSTALL): not add -p option to INSTALL.
- files need timestamps to be kept are only ar-archive on a few
- platforms, and be installed by instruby.rb but not INSTALL.
- fixed: [ruby-core:04721]
+ * sprintf.c (rb_str_format): rational 'f' format works for more
+ values. [fix GH-717]
- * mkconfig.rb: purge autoconf value variables.
+Sun Sep 14 16:57:27 2014 Eric Wong <e@80x24.org>
-Sat Apr 16 10:36:01 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * template/vm.inc.tmpl: "insns.c" => "insns.def"
+ * tool/instruction.rb: typo fix
- * bcc32/Makefile.sub: quick hack... prepend DESTDIR.
- still have restriction on DESTDIR ("", "/", "e:")
+Sun Sep 14 12:29:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 16 03:59:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/test_tracer.rb: fixed testcase for rubygems update.
- * ext/openssl/extconf.rb: check for OPENSSL_cleanse.
+Sun Sep 14 12:29:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/openssl/openssl_missing.h: ditto.
+ * lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
+ Complete history at:
+ https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216
-Thu Apr 14 19:18:30 2005 Minero Aoki <aamine@loveruby.net>
+ * test/rubygems: ditto.
- * lib/fileutils.rb (remove_file): ignore exceptions caused by
- chmod.
+Sun Sep 14 11:03:24 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/fileutils.rb (remove_dir): try to get rights to rmdir.
- [ruby-Bugs:1502] (2 items backportted from HEAD, rev 1.53-54)
+ * ext/psych/lib/psych.rb: update version
+ * ext/psych/psych.gemspec: ditto
-Thu Apr 14 16:57:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 14 08:43:37 2014 Eric Wong <e@80x24.org>
- * bcc32/Makefile.sub: failed to remove debug information files.
- fixed: [ruby-dev:26034]
+ * ccan/container_of/container_of.h (container_of_or_null): added
+ [ccan 7ec5b8e06b2fd5fa98b1fcde1158c286d2d429d8] (David Gibson)
-Wed Apr 13 23:40:21 2005 Kouhei Sutou <kou@cozmixng.org>
+Sun Sep 14 08:41:44 2014 Eric Wong <e@80x24.org>
- * lib/rss/rss.rb (RSS::VERSION): 0.1.3 -> 0.1.4.
+ * ccan/list/list.h (list_del_init, list_node_init): new functions
+ for multiple list_del() calls
+ [ccan ec8654d94d3c5c47aa5f82698f7e8048c79765b1] (Rusty Russell)
- * lib/rss/rss.rb (RSS::Element#converter): fixed converter
- transmission bug.
+Sat Sep 13 22:19:26 2014 Bernard Potocki <bernard.potocki@imanel.org>
-Wed Apr 13 21:20:35 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * hash.c (rb_hash_aset): fix misleading example which may suggest
+ that Hash.store will return self instead of value - Hash#store
+ is returning value and update itself, as well as Hash#[]=.
+ [Fix GH-715]
- * configure.in (mingw32): extract msvcr*.dll from objdump result.
+Sat Sep 13 15:16:31 2014 Eric Wong <e@80x24.org>
-Wed Apr 13 20:24:30 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c: use ALLOC(rb_subclass_entry_t)
- * configure.in (mingw32): use actual runtime DLL name as ruby DLL
- name and default load path.
+Sat Sep 13 14:14:00 2014 Eric Wong <e@80x24.org>
- * win32/Makefile.sub, win32/setup.mak: ditto.
+ * process.c (free_exec_arg): remove
+ (memsize_exec_arg): ptr is never NULL
+ (exec_arg_data_type): use RUBY_TYPED_DEFAULT_FREE
-Tue Apr 12 15:33:09 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * variable.c (autoload_i_free): remove
+ (autoload_data_i_type): use RUBY_TYPED_DEFAULT_FREE
+ (autoload_memsize): ptr is never NULL
- * ext/tcltklib/tcltklib.c (ip_finalize): better modification than the
- previous commit [ruby-dev:26029].
+ * vm_backtrace.c (location_free): remove
+ (location_mark): ptr is never NULL
+ (location_data_type): use RUBY_TYPED_DEFAULT_FREE
+ (backtrace_mark): ditto
+ (backtrace_free): ditto
-Tue Apr 12 12:38:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Sep 13 13:43:07 2014 Eric Wong <e@80x24.org>
- * ext/tcltklib/tcltklib.c (ip_finalize): fix SEGV when Tcl_GlobalEval()
- modifies the argument string to eval.
+ * doc/NEWS-2.0.0: fix typo for default RUBY_FIBER_MACHINE_STACK_SIZE
+ [ci skip]
-Tue Apr 12 02:21:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Sep 13 11:16:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
- Tcl commands before calling Tcl_GlobalEval().
+ * ext/win32ole/win32ole_event.c(ev_advise, ole_event_free,
+ fev_s_allocate, fev_unadvise): avoid segmentation fault when COM
+ server freed before calling Unadvise from WIN32OLE_EVENT object.
+ * ext/win32ole/win32ole.c: ditto.
-Mon Apr 11 23:47:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Sep 13 09:47:44 2014 Eric Wong <e@80x24.org>
- * lib/drb/drb.rb: [druby-ja:123] fix: When reference of my object is
- loaded, the object is tainted.
+ * man/ruby.1: use https for *.ruby-lang.org links
- * test/drb/test_drb.rb: ditto.
+Sat Sep 13 06:31:23 2014 Eric Wong <e@80x24.org>
-Mon Apr 11 22:18:23 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm.c (thread_alloc): remove needless volatile
- * dir.c, file.c (lstat): avoid warnings for mingw.
+Sat Sep 13 06:13:55 2014 Eric Wong <e@80x24.org>
-Mon Apr 11 20:11:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * proc.c (proc_free): remove, use RUBY_TYPED_DEFAULT_FREE
+ (proc_mark, proc_memsize): remove needless branching
- * ext/tcltklib/tcltklib.c (ip_finalize): adhoc patch to avoid SEGV
- when exit on Tcl/Tk8.3.x.
+ * vm.c (env_free): remove, use RUBY_TYPED_DEFAULT_FREE
+ (env_mark, env_memsize): remove needless branching
-Mon Apr 11 15:26:25 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Sep 13 05:52:15 2014 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (configuration): shouldn't output hdrdir twice.
+ * proc.c (rb_proc_alloc): inline and move to vm.c
+ (rb_proc_wrap): new wrapper function used by rb_proc_alloc
+ (proc_dup): simplify alloc + copy + wrap operation
+ [ruby-core:64994]
-Mon Apr 11 12:09:05 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c (rb_proc_alloc): new inline function
+ (rb_vm_make_proc): call rb_proc_alloc
- * {bcc32,win32,wince}/Makefile.sub: ri data was not installed
- into correct path. [ruby-dev:26011]
+ * vm_core.h: remove rb_proc_alloc, add rb_proc_wrap
- * bcc32/Makefile.sub: defaulted install-nodoc. [ruby-dev:26011]
+ * benchmark/bm_vm2_newlambda.rb: short test to show difference
-Sun Apr 10 10:12:42 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Sat Sep 13 04:40:04 2014 Eric Wong <e@80x24.org>
- * ext/win32ole/win32ole.c(ole_invoke): retry after converting Qnil
- to VT_EMPTY.
+ * process.c (Init_process): subclass Thread as Process::Waiter
+ (rb_detach_process): use Process::Waiter instead of singleton class
+ Thanks to headius and nobu. [Bug #10231]
- * ext/win32ole/win32ole/tests/testWIN32OLE.rb: correct error
- message string "Unknown" => "unknown".
+ * test/ruby/test_process.rb (test_process_detach): new test
-Sat Apr 9 18:20:31 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * inits.c (rb_call_inits): call Init_Thread before Init_process to
+ ensure Process::Waiter may be a subclass of Thread
- * ext/tk/lib/tk/image.rb: support to create TkImage object without
- creating a new image object on Tk.
+Fri Sep 12 18:14:28 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk/menu.rb: use TkCommandNames on create_self()
+ * vm.c (env_alloc): inline to avoid extra zeroing
+ tiny speedup [ruby-core:64980]
- * ext/tk/lib/tk/root.rb: TkRoot.to_eval() returns '.'.
+Fri Sep 12 17:13:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/text.rb: add methods to create a TkText::IndexString
- from (x, y) coords.
+ * vm_method.c (rb_method_entry_make, remove_method): ditto.
- * ext/tk/lib/tkextlib/tile/: add demo and update support status.
+Fri Sep 12 14:39:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Apr 9 14:42:29 2005 Kouhei Sutou <kou@cozmixng.org>
+ * gems/bundled_gems: Upgraded to test-unit-3.0.1 and minitest-5.4.1
- * sample/rss/tdiary_plugin/rss-recent.rb: supported configuration
- via Web browser.
+Fri Sep 12 06:55:40 2014 Eric Wong <e@80x24.org>
-Sat Apr 9 11:59:57 2005 Kouhei Sutou <kou@cozmixng.org>
+ * string.c (Init_frozen_strings): use st_init_table_with_size
- * lib/rss: backoported from HEAD.
+Fri Sep 12 06:15:37 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss: refactored.
- - gave a name to 'x'.
- - undef_method -> remove_method for avoiding a warning in ruby 1.6.
+ * string.c (sym_find): remove Symbol.find because we have Symbol GC now.
+ https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20140904Japan
+ If you still want this, request again on Redmine. [Feature #7854]
+ https://bugs.ruby-lang.org/issues/7854
- * lib/rss/parser.rb: @@setter -> @@setters.
+ * ext/-test-/symbol/init.c (sym_find): moved from string.c for tests.
- * lib/rss/parser.rb
- (RSS::BaseListener.register_uri)
- (RSS::BaseListener.uri_registered?)
- (RSS::BaseListener.install_get_text_element):
- swapped the first argument and the second argument.
+Fri Sep 12 04:24:03 2014 Eric Wong <e@80x24.org>
- * lib/rss/taxonomy.rb: swapped the first argument and the second
- argument for RSS::BaseListener.install_get_text_element.
- * lib/rss/image.rb: ditto.
- * lib/rss/syndication.rb: ditto.
- * lib/rss/dublincore.rb: ditto.
- * lib/rss/parser.rb: ditto.
- * lib/rss/1.0.rb: ditto.
- * lib/rss/2.0.rb: ditto.
- * lib/rss/0.9.rb: ditto.
- * lib/rss/content.rb: ditto.
+ * insns.def (once): define and use fake RUNNING_THREAD_ONCE_DONE
+ pointer to indicate is->once.running_thread is done.
- * lib/rss/parser.rb
- (RSS::BaseListener.install_setter)
- (RSS::BaseListener.register_uri): changed fallback way.
+ * vm_core.h (iseq_inline_storage_entry): remove done field,
+ allowing the union to be reduced from 24=>16 bytes on 64-bit
+ [Feature #10187]
- * lib/rss/parser.rb: added class name registry for complex model
- elements. (ex. have childlen elements, have some attributes and
- a child element and so on.)
+Thu Sep 11 20:10:00 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rss/dublincore.rb: supported multiple Dublin Core items.
- * lib/rss/maker/dublincore.rb: ditto.
+ * vm.c (rb_thread_mark): use rb_gc_mark_values() to mark VM stack.
- * lib/rss/maker/image.rb: supproted new Dublin Core API.
+Thu Sep 11 19:50:57 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rss/maker/base.rb: added default current_element implementation.
+ * vm.c (rb_vm_register_special_exception): make new function to
+ make and register special exceptions.
- * lib/rss/trackback.rb (RSS::TrackBackUtils.new_with_value_if_need):
- moved to RSS::Utils.
+ * vm.c (rb_vm_mark): do not need to mark special exceptions
+ because they are registered by rb_gc_register_mark_object().
- * lib/rss/utils.rb (RSS::Utils.new_with_value_if_need):
- moved from RSS::TrackBackUtils.
+ * eval.c (Init_eval): use rb_vm_register_special_exception().
- * lib/rss/maker/image.rb: fixed invalid argument of
- add_need_initialize_variable bug.
- * lib/rss/maker/trackback.rb: ditto.
+ * gc.c (Init_GC): ditto.
- * lib/rss/rss.rb (Hash#merge): added for ruby 1.6.
+ * proc.c (Init_Proc): ditto.
- * lib/rss/rss.rb (RSS::BaseModel.date_writer): changed to accept nil
- for date value.
+ * thread.c (Init_Thread): ditto.
- * test/test_dublincore.rb: added tests for plural accessor and
- multiple Dublin Core items.
+Thu Sep 11 19:32:30 2014 Koichi Sasada <ko1@atdot.net>
- * test/test_setup_maker_1.0.rb: fixed swapped actual and expected
- values.
+ * gc.c (rb_gc_mark_values): added.
+ This function is similar to rb_gc_mark_locations(), but not
+ conservative.
- * test/rss/rss-assertions.rb (assert_multiple_dublin_core): added
- an assertion for testing multiple Dublin Core items.
+ * internal.h: ditto.
- * test/rss/test_maker_dc.rb (test_rss10_multiple): added a test
- for making multiple Dublin Core items.
+ * vm.c (env_mark): use rb_gc_mark_values() because env values should
+ be Ruby VALUEs.
- * test/rss/test_maker_dc.rb (test_date): added a test for #date=
- and #dc_date=.
+Thu Sep 11 19:16:39 2014 Koichi Sasada <ko1@atdot.net>
- * sample/rss/tdiary_plugin/rss-recent.rb:
- new option: @options['rss-recent.use-image-link']:
- use image as link instread of text if available.
+ * gc.c (gc_mark_ptr): rename to gc_mark_set.
- * sample/rss/tdiary_plugin/rss-recent.rb (RSS_RECENT_VERSION):
- 0.0.5 -> 0.0.6.
+ * gc.c (gc_mark): add gc_mark_ptr() to skip is_markable_object()
+ check. gc_mark_maybe() can use gc_mark_ptr() directly because
+ passed pointer is checked by is_pointer_to_heap().
-Fri Apr 8 20:17:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 11 18:40:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/extmk.rb (extmake): hdrdir needs to be defined also in
- Config::CONFIG.
+ * .gitignore: ignored temporary files and coverage results.
- * lib/mkmf.rb (configuration, create_makefile): get rid of recursive
- macro reference.
+Thu Sep 11 18:15:30 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Apr 8 18:26:56 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * .gitignore: ignored only simplecov.
+ * coverage/README: Added coverage docs.
- * ext/openssl/ossl_ssl.c: add callbacks to OpenSSL::SSL::SSLContexts.
- - SSLContext#client_cert_cb=(aProc). it is called when a client
- certificate is requested by a server and no certificate was not
- set for the SSLContext. it must return an Array which includes
- OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects.
- - SSLContext#tmp_dh_callback=(aProc). it is called in key
- exchange with DH algorithm. it must return an OpenSSL::PKey::DH
- object.
+Thu Sep 11 17:25:31 2014 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): ignore the
- argument if it's nil.
+ * include/ruby/ruby.h, gc.c: add new internal events
+ RUBY_INTERNAL_EVENT_GC_ENTER and
+ RUBY_INTERNAL_EVENT_GC_EXIT.
- * ext/openssl/ossl_pkey.c
- (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first.
- (DupPrivPKeyPtr): new function.
+ When invoking GC process, GC_ENTER event is called.
+ When exiting from GC process, GC_EXIT event is called.
- * ext/openssl/ossl_pkey_dh.c: add default DH parameters.
+ Incremental GC (incremental marking and lazy sweep) can call
+ these events many times.
- * ext/openssl/ossl_pkey.h: ditto.
+ For example (minor marking):
+ (1) GC_ENTER
+ - (2) GC_START (minor GC)
+ (minor marking)
+ - (3) GC_END_MARK
+ (start lazy sweep)
+ (4) GC_EXIT
+ (ruby process)
+ (5) GC_ENTER
+ (lazy sweep)
+ (6) GC_EXIT
+ (ruby process)
+ (... repeat (5), (6))
+ (7) GC_ENTER
+ (finish lazy sweep)
+ - (8) GC_END_SWEEP
+ (9) GC_EXIT
-Fri Apr 8 01:55:20 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ 2nd example (incremental major marking):
+ (1) GC_ENTER
+ - (2) GC_START (minor GC)
+ (start incremental marking)
+ (3) GC_EXIT
+ (ruby process)
+ (4) GC_ENTER
+ (incremental marking)
+ (5) GC_EXIT
+ (ruby process)
+ (... repeat (4), (5))
+ (6) GC_ENTER
+ (finish incremental marking)
+ - (7) GC_END_MARK
+ (start lazy sweep)
+ (8) GC_EXIT
+ (ruby process)
+ (9) GC_ENTER
+ (lazy sweep)
+ (10) GC_EXIT
+ (ruby process)
+ (... repeat (9), (10))
+ (11) GC_ENTER
+ (finish lazy marking)
+ - (12) GC_STOP_SWEEP
+ (13) GC_EXIT
- * ext/tk/sample/demos-{en,jp}/goldberg.rb: reduced window size.
- [ruby-dev:25992]
+ These internal events enable to measure GC pause time completely.
-Thu Apr 7 23:58:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 11 17:04:54 2014 Eric Wong <e@80x24.org>
- * ext/extmk.rb (extmake): keep directory names in Makefile as macros.
+ * lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW support
+ Thanks to Vit Ondruch for reporting the issue on ARM.
+ [Bug #10202]
- * lib/mkmf.rb (configuration, create_makefile): ditto.
+Thu Sep 11 14:31:57 2014 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (CXX_EXT): separate C++ extensions.
+ * include/ruby/ruby.h: freeze nil/true/false.
+ [Feature #8923]
-Thu Apr 7 17:43:25 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * gc.c (should_be_finalizable): check frozen after checkin FL_ABLE.
- * eval.c (rb_call0): "return" event hook should be always executed
- if event_hooks is set. fixed: [ruby-core:04662]
- (backported from HEAD)
+ * object.c (rb_obj_taint): check
+ OBJ_TAINTABLE(obj).
-Mon Apr 4 23:17:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * object.c (rb_obj_freeze): remove immediate_frozen_tbl
+ because all of immediate values are frozen. YAY!
- * ext/tk/lib/tk.rb (TkComm#array2tk_list): accept enc-mode argument to
- decide whether convert encoding of each element or not.
+ * object.c (rb_obj_frozen_p): ditto.
- * ext/tk/lib/tk/variable.rb (TkVariable#value=): fail to convert the
- encoding of array elements when assign an array to an TkVariable
- object.
+ * test/ruby/test_eval.rb: skip instance_variable_set for
+ frozen objects.
-Mon Apr 4 10:26:48 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_weakmap.rb: check ArgumentError instead of
+ RuntimeError.
- * ext/tk/lib/tk/dialog.rb: fixed typo.
+Thu Sep 11 10:03:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Apr 3 17:16:33 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(21b241a)
- * win32/win32.{h,c} (rb_w32_fdopen): avoid warning on bcc32.
- (backported from HEAD)
+Wed Sep 10 17:52:25 2014 Koichi Sasada <ko1@atdot.net>
-Sat Apr 2 23:38:54 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (rb_vm_addr2insn): rename to rb_vm_insn_addr2insn
+ to clear what address.
- * configure.in (CP, INSTALL): get rid of less portable options.
+Wed Sep 10 16:22:26 2014 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (configuration, create_makefile): correct configuration
- variable.
+ * test/ruby/test_gc.rb: fix condition.
- * {bcc32,win32,wince}/{Makefile.sub,setup.mak}: leave prefix empty in
- config.status for backward compatibility. fixed: [ruby-core:04649]
+Wed Sep 10 15:29:46 2014 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (create_makefile): ensure library directories get made
- before copying libraries there.
+ * vm_core.h (rb_call_info_t): ci->flag becomes 32-bit unsigned int
+ ci->index becomes a 32-bit signed int (from signed long).
+ Reorder for better packing on 64-bit, giving an 8 byte reduction
+ from 104 to 96 bytes for each ci.
+ [Feature #10187]
-Sat Apr 2 16:59:46 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * compile.c (new_callinfo, setup_args, iseq_compile_each,
+ iseq_build_from_ary_body): adjust for type changes
- * ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
+ * vm_insnhelper.c (vm_getivar): ditto
- * ext/tk/lib/tk/variable.rb: fix namespace trouble when autoloading
+Wed Sep 10 15:07:35 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk/palette.rb: define Tcl variable 'tkPalette' as global
+ * compile.c (rb_iseq_translate_threaded_code):
+ modify in-place w/o copy
+ (rb_vm_addr2insn): new function for debug
+ (rb_iseq_original_iseq): ditto
+ (iseq_set_sequence): assign iseq_encoded directly
+ [Feature #10185]
- * ext/tk/lib/tk/dialog.rb: use array2tk_list method when calling
- Tk.ip_eval.
+ * vm_core (rb_iseq_t): move original ->iseq to bottom
- * ext/tk/lib/tk/autoload.rb: add autoload entry 'TkDialogObj' and
- 'TkWarningObj'
+ * iseq.c (iseq_free, iseq_free): adjust for new layout
+ (rb_iseq_disasm): use original iseq for dump
+ (iseq_data_to_ary): ditto
+ (rb_iseq_line_trace_each): ditto
+ (rb_iseq_build_for_ruby2cext): use iseq_encoded directly
-Sat Apr 2 02:19:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_dump.c (rb_vmdebug_debug_print_pre): use original iseq
- * ext/tk/lib/tk.rb (TkWindow.initialize): accept 'without_creating'
- option without 'widgetname' option to allow creating a widget object
- which is used as an argument of Tcl/Tk's widget allocation commands.
+Wed Sep 10 15:00:11 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk/image.rb (TkImage.initialize): accept 'imagename'
- option to create a image object by the given name.
+ * time.c (time_mark): remove NULL check
+ (time_memsize): ditto
+ (time_free): remove, use RUBY_TYPED_DEFAULT_FREE instead
+ [Feature #10219]
-Thu Mar 31 22:23:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Sep 10 14:14:57 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (SRC_EXT): exclude just case different suffixes on case
- insensitive file system platforms.
+ * common.mk (encs enc trans libencs libenc libtrans): force to run
+ enk.mk because common.mk does not know the dependency, but enk.mk
+ knows. [ruby-dev:48530] [Bug #10220]
- * README.EXT, README.EXT.ja (Appendix C): utility functions.
+Wed Sep 10 11:59:10 2014 Koichi Sasada <ko1@atdot.net>
-Thu Mar 31 14:15:44 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * gc.c (gc_stat): update rdoc.
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should return
- value. [ruby-dev:25971]
+Wed Sep 10 11:52:08 2014 Koichi Sasada <ko1@atdot.net>
-Thu Mar 31 08:25:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_stat_internal): rename:
+ * malloc_increase -> malloc_increase_bytes
+ * malloc_limit -> malloc_increase_bytes_limit
+ * oldmalloc_increase -> oldmalloc_increase_bytes
+ * oldmalloc_limit -> oldmalloc_increase_bytes_limit
+ ref: [Feature #9924]
- * common.mk (RUBYOPT): clear for the environment RubyGems installed.
+Wed Sep 10 11:45:40 2014 Koichi Sasada <ko1@atdot.net>
- * common.mk (clean-local): keep $(PREP) files till distclean.
+ * gc.c (gc_stat_internal): rename `heap_used' to `heap_allocated_pages'.
+ ref: [Feature #9924]
- * common.mk (check): do all tests.
+ * test/ruby/test_gc.rb: add constraints test for gc stat information.
-Thu Mar 31 06:00:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Wed Sep 10 11:31:16 2014 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_engine.c (ossl_engine_s_load): should not raise
- error even if the specified engine could not be loaded. (Dynamic
- engines don't have fixed name to load.)
+ * gc.c (gc_stat_internal): rename:
+ * remembered_shady_object -> remembered_wb_unprotected_objects
+ * remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
+ * old_object -> old_objects
+ * old_object_limit -> old_objects_limit
+ ref: [Feature #9924]
-Thu Mar 31 00:18:27 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Sep 10 11:12:25 2014 Koichi Sasada <ko1@atdot.net>
- * win32/ifchange.bat, win32/rm.bat: backported from HEAD.
+ * gc.c (gc_stat_internal): support:
+ * total_allocated_pages
+ * total_freed_pages
+ ref: [Feature #9924]
-Wed Mar 30 23:44:50 2005 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+Wed Sep 10 10:48:04 2014 Koichi Sasada <ko1@atdot.net>
- * Makefile.in, */Makefile.sub, */configure.bat,
- cygwin/GNUmakefile.in, common.mk, configure.in, ext/extmk.rb,
- lib/mkmf.rb, instruby.rb, runruby.rb: backport extout.
- [ruby-dev:25963]
+ * test/ruby/test_gc.rb: catch up last fix.
-Wed Mar 30 17:41:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Sep 10 10:36:08 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tcltklib/tcltklib.c: add TclTkIp#_create_console() method to
- create a Tcl/Tk's console window.
+ * gc.c (objspace_total_slot): rename objspace_available_slots.
- * ext/tk/lib/multi-tk.rb: support TclTkIp#_create_console() method.
+ * gc.c (objspace_live_slot, objspace_free_slot): rename
+ ..._slot() to ..._slots().
- * ext/tk/lib/remote-tk.rb: ditto.
+ * gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
- * ext/tk/lib/tk/console.rb: ditto.
+ * gc.c (gc_stat_internal):
+ * add `heap_available_slots' field
+ * rename heap_live_slot to heap_live_slots
+ * rename heap_free_slot to heap_free_slots
+ ref: [Feature #9924]
- * ext/tk/lib/tk.rb: update RELEASE_DATE
+Wed Sep 10 07:22:53 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/sample/demo-*/check2.rb: use 'return' in the Proc object.
+ * gc.c: refactoring for RGENGC_PROFILE > 0.
- * ext/tk/sample/tkextlib/**: ditto.
+ * rename rb_objspace_t::profile::..._count
+ to rb_objspace_t::profile::total_..._count
+ * rename promote_infant_types to promote_types
-Tue Mar 29 22:11:56 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c (gc_remember_unprotected): count remembered shady objects here.
- * test/rinda/test_rinda.rb: use DRbObject.new_with instead of reinit.
- [ruby-dev:25961]
+Wed Sep 10 03:12:12 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Mon Mar 28 23:40:40 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c (init_mark_stack): MEMZERO() receive type as 2nd argument instead
+ of size.
+ Coverity Scan found this bug.
- * lib/drb/drb.rb: move method DRbObject#reinit to DRbObject.new_with.
- extract method DRbObject.prepare_backtrace. add DRb.regist_server,
- remove_server, fetch_server. change server in thread variable if
- in-proc server. [druby-ja:113]
+Tue Sep 9 21:55:39 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/drb/gw.rb: ditto.
+ * ext/win32ole/sample/excel2.rb: remove some commented-out code.
+ rotate graph more slowly to see graph clearly.
-Mon Mar 28 20:43:34 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 9 19:52:33 2014 Koichi Sasada <ko1@atdot.net>
- * ext/syck/rubyext.c: get rid of warnings caused by a bug of VC.
+ * gc.c: rename rb_objspace_t::marked_objects to marked_slots.
-Mon Mar 28 08:39:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_marks_start): should be clear first.
- * ext/iconv/iconv.c (iconv_create): Iconv::Failure requires 3
- arguments. (pointed out by NaHi)
+ * gc.c (gc_marks_start): remembered shady objects are also marked.
-Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (gc_stat_internal): add heap_marked_slots.
- * ext/tk/lib/tk.rb (_callback_entry_class?): add for checking whether
- a class is available for a callback entry.
+Tue Sep 9 18:58:48 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb (after_cancel): add Tk.after_cancel(afterID) method.
+ * gc.c: rename
+ * total_allocated_object_num -> total_allocated_objects
+ * total_allocated_object_num_at_gc_start -> total_allocated_objects_at_gc_start
+ * total_freed_object_num -> total_freed_objects
- * ext/tk/lib/tk.rb (array2tk_list): change from private module method
- of TkComm to public module method.
+ * gc.c (gc_stat_internal):
+ * rename total_allocated_object -> total_allocated_objects
+ * rename total_freed_object -> total_freed_objects
- * ext/tk/lib/tk.rb (cget): add check that slot argument is not
- empty string.
+Tue Sep 9 18:51:36 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb (configinfo): ditto.
+ * gc.c (gc_stat_internal): fix symbol names
+ * heap_final_slot -> heap_final_slots
+ * heap_swept_slot -> heap_swept_slots
- * ext/tk/lib/tk/itemconfig.rb (itemcget): add check that slot argument
- is not empty string.
+Tue Sep 9 18:18:07 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/itemconfig.rb (itemconfiginfo): ditto.
+ * gc.c (rb_objspace_t::heap_pages): rename field names:
+ * used -> allocated_pages
+ * increment -> allocatable_pages
+ * length -> sorted_length
+ And remove unused `limit' field.
- * ext/tk/lib/tk/entry.rb: add TkEntry#icursor and icursor= (alias of
- cursor and cursor= method).
+ * gc.c: rename macros:
+ * heap_pages_used -> heap_allocated_pages
+ * heap_pages_length -> heap_pages_sorted_length
+ * heap_pages_increment -> heap_allocatable_pages
- * ext/tk/lib/tk/font.rb: improve font treatment when the font name is
- empty string.
+ * gc.c (gc_stat_internal): fix symbol names
+ * heap_used -> heap_allocated_pages
+ * heap_eden_page_length -> heap_eden_pages
+ * heap_tomb_page_length -> heap_tomb_pages
+ * heap_increment -> heap_allocatable_pages
+ * heap_length -> heap_sorted_length
- * ext/tk/lib/tk/variable.rb: add :variable, :window and :procedure
- type.
+ ref: [Feature #9924]
+ https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+ Yellow color fields in this table are changed.
- * ext/tk/lib/tk/variable.rb: improve treatment of array-type
- tkvariable.
+ * test/ruby/test_gc.rb: catch up this change.
- * ext/tk/lib/tkextlib/blt.rb: add commands for zooming.
+Tue Sep 9 14:56:03 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tkextlib/blt/*: bug fix.
+ * gc.c: continue layout changing.
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix and add methods
- to call TreeCtrl commands for bindings.
+ newobj_of() also touch:
+ (4) increment total_allocated_object_num
+ (5) check hook_events
- * ext/tk/sample/tkextlib/blt/*: new sample scripts.
+ And gather fields related to marking phase.
- * ext/tk/sample/tkextlib/treectrl/*: ditto.
+Tue Sep 9 14:21:50 2014 Koichi Sasada <ko1@atdot.net>
-Fri Mar 25 10:53:16 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * gc.c: fix layout of rb_objspace_t to improve cache locality.
- * configure.in (WIN32_LEAN_AND_MEAN): removed because a lot of
- troubles. [ruby-list:40721]
+ newobj_of() accesses:
+ (1) rb_objspace_t::flags
+ (2) rb_objspace_t::eden_heap::freelist
+ (3) and rb_objspace_t::eden_heap::free_pages if freelist is NULL.
-Thu Mar 24 23:10:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 9 14:09:36 2014 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (macro_defined?): try to compile for an old compiler
- which doesn't bail out at #error directive. [ruby-dev:25818]
+ * gc.c: move rb_objspace_t::flags::gc_stressful after during_gc
+ to make accessing both parameters easy.
- * lib/mkmf.rb (check_sizeof): refine logging messages.
+ * gc.c (heap_get_freeobj): add LIKELY() hint.
-Thu Mar 24 03:57:48 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * gc.c (heap_get_freeobj_from_next_freepage): ditto.
- * lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
- - should raise ArgumentError if no port is specified.
- - even if the specified port is 0, all TCPServers should be
- initialized with the port given to the first one.
+ * gc.c (newobj_of): check both parameters at once for exceptional
+ case.
- * lib/webrick/server.rb (WEBrick::GenericServer#initialize): if :Port
- parameter is 0, it should be updated with the port number which
- actually listened.
+Tue Sep 9 13:51:32 2014 Koichi Sasada <ko1@atdot.net>
-Wed Mar 23 00:35:10 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * gc.c: add rb_objspace_t::flags::gc_stressful and
+ ruby_gc_stressful macro.
+ Rename objspace->gc_stress to objspace->gc_stress_mode.
- * test/ruby/test_settracefunc.rb (test_event): added tests for
- "class" and "end" and "raise".
+ If objspace->gc_stress_mode is true (!nil and !false) then
+ ruby_gc_stressful becomes TRUE.
-Tue Mar 22 22:40:18 2005 Shugo Maeda <shugo@ruby-lang.org>
+ ruby_gc_stressful will speedup newobj_of() slightly.
- * eval.c (rb_call0): check event_hooks instead of trace_func.
+ * gc.c: initialize ruby_gc_stress(full|_mode) by gc_params.gc_stress
+ even if ENABLE_VM_OBJSPACE is false.
-Tue Mar 22 17:30:44 2005 Shugo Maeda <shugo@ruby-lang.org>
+Tue Sep 9 13:05:50 2014 Koichi Sasada <ko1@atdot.net>
- * eval.c (rb_add_event_hook): new function to add a hook function for
- interpreter events. (backported form HEAD)
+ * gc.c: remove ruby_disable_gc_stress and add ruby_disable_gc
+ to speed-up newobj_of().
-Sun Mar 20 22:51:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (ready_to_gc): check ruby_disable_gc.
- * lib/mkmf.rb (mkmf_failed): check if Makefile is created without
- create_makefile.
+ * signal.c: use ruby_disable_gc.
-Sat Mar 19 23:48:10 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Sep 9 12:11:41 2014 Koichi Sasada <ko1@atdot.net>
- * misc/ruby-mode.el (ruby-expr-beg): returned true always.
- fixed: [ruby-list:40683]
+ * gc.c: rename gc_stat entries and check stat transition.
-Sat Mar 19 00:41:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Sep 9 12:06:03 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/font.rb: add some TkFont class methods to get font
- information without creating a TkFont object.
+ * gc.c (gc_sweep_rest): remove wrong modification of during_gc flag.
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: bug fix and define some
- classes for components of Tk::TreeCtrl
+Tue Sep 9 11:39:41 2014 Koichi Sasada <ko1@atdot.net>
-Thu Mar 17 17:42:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c: pack boolean values into rb_objspace_t::flags with bit fields
+ to improve cache locality.
- * struct.c (make_struct): allow non local-id field
- names. [ruby-core:04575]
+Tue Sep 9 11:11:05 2014 Koichi Sasada <ko1@atdot.net>
- * struct.c (inspect_struct): ditto.
+ * test/ruby/test_object.rb: extend timeout.
-Wed Mar 16 23:36:02 2005 Shugo Maeda <shugo@ruby-lang.org>
+Tue Sep 9 09:02:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_call0): call_cfunc() should be protected.
+ * lib/mkmf.rb (MakeMakefile#pkg_config): append --cflags to also
+ $CXXFLAGS, as they are often used by C++ compiler.
+ [ruby-core:54532] [Bug #8315]
- * test/ruby/test_settracefunc.rb: added test for c-return.
+Tue Sep 9 07:03:22 2014 Eric Wong <e@80x24.org>
-Wed Mar 16 22:20:25 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * compile.c: remove needless SYM2ID <-> ID2SYM conversions
+ [misc #10207]
- * object.c (str_to_id): fixed typo.
+Tue Sep 9 05:48:42 2014 Eric Wong <e@80x24.org>
-Wed Mar 16 18:08:32 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * symbol.c (rb_intern_cstr_without_pindown): check dsymbol on return
+ This is not a complete fix for bug 10206, but seems to reduce
+ that crash and also looks correct.
- * eval.c (rb_call0): reorganize "return" event post.
+Tue Sep 9 04:36:24 2014 Eric Wong <e@80x24.org>
-Tue Mar 15 23:49:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_env_t): use flexible array
+ This reduces allocations and speeds up the lambda calculus
+ fizzbuzz (bm_app_lc_fizzbuzz.rb) benchmark [ruby-core:64858]
+ * proc.c (get_local_variable_ptr): deconst to adjust for flex array
+ * vm.c (env_mark, env_free, env_memsize): remove check for env->env
+ * vm.c (env_alloc): single allocation for flex array
+ * vm.c (vm_make_env_each): adjust env_alloc call
- * ext/iconv/iconv.c (Init_iconv): InvalidEncoding also should include
- Iconv::Failure.
+Mon Sep 8 16:08:22 2014 Koichi Sasada <ko1@atdot.net>
-Tue Mar 15 16:38:11 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * benchmark/bm_app_lc_fizzbuzz.rb: should skip output on benchmark.
- * ext/tk/tkutil.c (ary2list): give wrong arguments to hash2kv()
+Mon Sep 8 16:04:02 2014 Koichi Sasada <ko1@atdot.net>
-Mon Mar 14 19:39:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * benchmark/bm_app_lc_fizzbuzz.rb: `answer.to_a' does not return
+ a string, but an array.
- * ext/tk/lib/tk/timer.rb (TkTimer): forgot to clear @return_value
- when restarting
+Mon Sep 8 13:18:37 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/sample/cd_timer.rb: new sample of TkRTTimer
+ * benchmark/bm_app_lc_fizzbuzz.rb: added.
-Mon Mar 14 12:21:03 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ This program is described closely in "Understanding Computation"
+ chapter 6 by Tom Stuart. <http://computationbook.com/>
- * ext/tk/lib/tk/timer.rb (TkRTTimer): forgot to reset the callback
- time. So, 'continue' do all callbacks between 'stop' and 'continue'.
+ Japanese translation will be published soon.
+ <http://www.oreilly.co.jp/books/9784873116976/>
-Mon Mar 14 08:14:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Sep 8 12:01:39 2014 Koichi Sasada <ko1@atdot.net>
- * object.c (str_to_id): warn for NUL containing strings.
+ * gc.c: add incremental GC algorithm. [Feature #10137]
-Mon Mar 14 00:13:49 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ Please refer this ticket for details.
- * ext/tk/lib/tk/timer.rb (TkRTTimer): correct calculation of offset
- value. get a little better accuracy.
+ This change also introduces the following changes.
- * ext/tk/sample/demos-en/widget: use a binding with no local variables
- when eval a sample script.
+ * Remove RGENGC_AGE2_PROMOTION and introduce object age (0 to 3).
+ Age can be count with FL_PROMOTE0 and FL_PROMOTE1 flags in
+ RBasic::flags (2 bit). Age == 3 objects become old objects.
+ * WB_PROTECTED flag in RBasic to WB_UNPROTECTED bitmap.
+ * LONG_LIVED bitmap to represent living objects while minor GCs
+ It specifies (1) Old objects and (2) remembered shady objects.
+ * Introduce rb_objspace_t::marked_objects which counts marked
+ objects in current marking phase. marking count is needed to
+ introduce incremental marking.
+ * rename mark related function and sweep related function to
+ gc_(marks|sweep)_(start|finish|step|rest|continue).
+ * rename rgengc_report() to gc_report().
+ * Add obj_info() function to get cstr of object details.
+ * Add MEASURE_LINE() macro to measure execution time of specific line.
+ * and many small fixes.
- * ext/tk/sample/demos-en/bind.rb: ditto.
+ * include/ruby/ruby.h: add flag USE_RINCGC.
+ Now USE_RINCGC can be set only with USE_RGENGC.
- * ext/tk/sample/demos-en/tcolor: ditto.
+ * include/ruby/ruby.h: introduce FL_PROMOTED0 and add FL_PROMOTED1
+ to count object age.
- * ext/tk/sample/demos-jp/widget: ditto.
+ * include/ruby/ruby.h: rewrite write barriers for incremental marking.
- * ext/tk/sample/demos-jp/bind.rb: ditto.
+ * debug.c: catch up flag name changes.
- * ext/tk/sample/demos-jp/tcolor: ditto.
+ * internal.h: add rb_gc_writebarrier_remember() instead of
+ rb_gc_writebarrier_remember_promoted().
-Sun Mar 13 10:04:17 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * array.c (ary_memcpy0): use rb_gc_writebarrier_remember().
- * test/rinda/test_rinda.rb: remove test_gc. [ruby-dev:25871]
+ * array.c (rb_ary_modify): ditto.
-Thu Mar 10 19:12:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * hash.c (rb_hash_keys): ditto.
- * ext/tcltklib/tcltklib.c (lib_eventloop_ensure): mis-delete a timer
- handler when exit from a recursive called eventloop
+ * hash.c (rb_hash_values): ditto.
- * ext/tk/lib/tk/timer.rb: new TkRTTimer class, which can works for a
- realtime operation
+ * object.c (init_copy): use rb_copy_wb_protected_attribute() because
+ FL_WB_PROTECTED is moved from RBasic::flags.
- * ext/tk/sample/tkrttimer.rb: sample of TkRTTimer class
+ * test/objspace/test_objspace.rb: catch up ObjectSpace.dump() changes.
- * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to
- TkText::IndexModMethods
+Sun Sep 7 12:47:06 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and
- add them to TkText::IndexModMethods module
+ * process.c: PTHREAD_CANCEL_DISABLE is not defined on Android.
- * ext/tk/sample/tktextio.rb: add test part of "seek by text index
- modifiers"
+Sat Sep 6 20:59:06 2014 Tanaka Akira <akr@fsij.org>
-Thu Mar 10 08:10:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * process.c (has_privilege): The gid zero is not a privilege.
- * re.c (make_regexp): need to free internal regexp structure when
- compilation fails. [ruby-talk:133228]
+Sat Sep 6 20:19:16 2014 Tanaka Akira <akr@fsij.org>
-Wed Mar 9 20:25:58 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * process.c (struct child_handler_disabler_state): cancelstate field
+ added.
+ (disable_child_handler_before_fork): Record cancelstate.
+ (disable_child_handler_fork_parent): Restore cancelstate.
- * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_write): call
- rb_sys_fail if errno isn't 0. [ruby-dev:25831]
+Sat Sep 6 19:27:10 2014 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/cipher.rb: fix typo. [ruby-dev:24285]
+ * process.c (struct child_handler_disabler_state): Defined.
-Wed Mar 9 15:46:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Sep 6 18:31:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/webrick/server.rb (WEBrick::GenericServer#start): should
- restore @token if accept failure. suggested by Dominique Brezinski.
- [ruby-core:04518]
+ * lib/rake.rb, lib/rake/*, test/rake/*: Update latest rake master(e47d023)
-Wed Mar 9 13:37:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Sep 6 16:38:08 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tk/sample/tktextio.rb: fix bug of handling 'end' position.
- support initial text, overwrite setting and pos_gravity control.
+ * ext/win32ole/win32ole_variant.c (ole_val2variant_err,
+ ole_val2variantdata, Init_win32ole_variant): support VT_ERROR
+ variant with error code. add WIN32OLE_VARIANT::NoParam.
+ * test/win32ole/test_win32ole_variant.rb(test_c_noparam,
+ test_vt_error_noparam): ditto.
+ * ext/win32ole/win32ole.c: ditto.
-Tue Mar 8 18:16:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Sep 6 11:08:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/sample/tktextio.rb: New sample script. TkTextIO class in this
- sample supports to use a text widget as if it is a I/O stream (such
- like as StringIO class).
+ * parse.y (arg_ambiguous_gen): fix warning message, "even" does
+ not mean the number of spaces here. state the place to put a
+ space and the operator. [ruby-core:64790] [Bug #10204]
-Tue Mar 8 13:54:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Sep 6 08:44:40 2014 Zachary Scott <e@zzak.io>
- * ext/socket/socket.c: workaround for some of 4.4BSD-Lite derived OSs.
+ * lib/rdoc/generator/template/darkfish/js/jquery.js: Backport
+ rdoc/rdoc@74f60fcb04fee1778fe2694d1a0ea6513f8e67b7
-Tue Mar 8 12:36:17 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Sep 6 08:10:44 2014 Eric Wong <e@80x24.org>
- * ext/socket/socket.c: document from Sam Roberts
- <sroberts@uniserve.com> for getsockopt and setsockopt is merged.
- [ruby-doc:824]
+ * test/ruby/test_io.rb (test_readpartial_locktmp): use IO#nonblock=
+ Old fcntl invocation may drop necessary flags on some platforms.
-Tue Mar 8 01:27:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Sep 6 07:46:51 2014 Eric Wong <e@80x24.org>
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.66
- fixed: [ruby-dev:25828]
+ * test/ruby/test_io.rb (test_readpartial_locktmp): avoid EBADF
+ [ruby-core:64773] [ruby-core:64775]
-Mon Mar 7 21:35:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Sep 6 01:34:31 2014 Tanaka Akira <akr@fsij.org>
- * sample/webrick/httpsd.rb: fix typo in comment. suggested by
- Kazuhiko Shiozaki.
+ * process.c (rb_f_exec): Call before_exec_async_signal_safe and
+ after_exec_async_signal_safe around rb_exec_async_signal_safe.
+ (rb_exec_async_signal_safe): Don't call
+ before_exec_async_signal_safe and after_exec_async_signal_safe.
+ (rb_exec_without_timer_thread): Call before_exec and
+ after_exec.
+ (disable_child_handler_fork_child): Make SIGPIPE handler SIG_DFL.
-Mon Mar 7 14:55:43 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Sep 6 00:49:41 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (block_pass): should not push unique number if a block is
- not an orphan. [ruby-dev:25808]
+ * signal.c (ruby_signal): Don't set SA_SIGINFO for SIG_IGN and
+ SIG_DFL.
-Wed Feb 16 02:55:21 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Sep 5 21:45:33 2014 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_read,
- ossl_ssl_write):
- - need to set errno on Win32 platform.
- - should call rb_sys_fail instead of rasing SSLError if
- SSL_ERROR_SYSCALL occured.
- - should wait for that the underlying IO become readable or
- writable if the error was SSL_ERROR_WANT_READ or
- SSL_ERROR_WANT_WRITE. [ruby-dev:25795]
+ * process.c (disable_child_handler_before_fork): New function.
+ (disable_child_handler_fork_parent): Ditto.
+ (disable_child_handler_fork_child): Ditto.
+ (retry_fork_async_signal_safe): Call above functions to disable
+ signal handlers in child process.
- * ext/openssl/lib/openssl/buffering.rb
- (Buffering#initialize): should set @eof and @rbuffer.
- (Buffering#fill_rbuff): should rescue Errno::EAGAIN.
- (Buffering#consume_rbuf): pointless eof flag resetting is deleted.
- (Buffering#read): should return an empty string if the specified
- size is zero.
- (Buffering#readpartial): new method.
- (Buffering#readline): fix typo.
- (Buffering#getc): return the first character of string correctly.
- (Buffering#each): fix typo. suggested by Brian Ollenberger.
- (Buffering#readchar): fix typo.
- (Buffering#eof?): should read again it the input buffer is empty.
- (Buffering#do_write): should rescue Errno::EAGAIN.
- (Buffering#puts): use "\n" as the output field separator.
+Fri Sep 5 21:02:54 2014 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the
- underlying IO.
+ * process.c (handle_fork_error): Make try_gc_p argument volatile to
+ suppress "clobbered" warning.
- * ext/openssl/extconf.rb: get rid of GNUmakefile generation.
+Fri Sep 5 20:48:06 2014 Tanaka Akira <akr@fsij.org>
- * text/openssl/test_pair.rb: test for IO like methods.
+ * process.c (handle_fork_error): Don't need state_p argument.
- * test/ruby/ut_eof.rb: test about empty file.
+Fri Sep 5 20:35:52 2014 Tanaka Akira <akr@fsij.org>
-Mon Mar 7 10:22:06 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+ * process.c (has_privilege): Fix a return value.
- * lib/un.rb: should use OptionParser. (backported form HEAD)
+Fri Sep 5 19:00:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Mar 7 09:18:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/shellwords.rb: proofreading documentation.
+ [Bug #10155][ruby-core:64471]
- * string.c (rb_str_cmp_m): should not return false but nil.
- fixed: [ruby-dev:25811]
+Fri Sep 5 18:34:33 2014 Laurent Arnoud <laurent@spkdev.net>
-Mon Mar 7 01:22:14 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/csv/test_row.rb: Added some missing tests in CSV.
+ [fix GH-710]
+ * test/csv/test_table.rb: ditto.
- * ext/tk/tkutil.c: remove the some codes which depend on the
- difference between Ruby1.8 and 1.9, because st.c on Ruby1.9
- was changed.
+Fri Sep 5 12:57:52 2014 Tanaka Akira <akr@fsij.org>
-Mon Mar 7 00:01:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (has_privilege): Refine uid/gid check.
- * ext/tcltklib/tcltklib.c: fail to call TclTkLib.mainloop when $SAFE==4
+Fri Sep 5 12:40:55 2014 Tanaka Akira <akr@fsij.org>
-Sun Mar 6 16:41:33 2005 Minero Aoki <aamine@loveruby.net>
+ * configure.in: Check sys/id.h, getuidx and getgidx for AIX.
- * lib/net/http.rb: HTTPHeader holds its header fields as an array
- (backport from CVS HEAD rev 1.112-1.123). [ruby-list:40629]
+ * process.c (getresuid): Defined for AIX.
+ (getresgid): Ditto
+ AIX don't have getresuid/getresgid but getuidx/getgidx.
- * test/net/http/test_httpheader.rb: new file.
+Fri Sep 5 12:28:21 2014 Tanaka Akira <akr@fsij.org>
-Sun Mar 6 11:47:10 2005 Sam Roberts <sroberts@uniserve.com>
+ * process.c (has_privilege): Fix assignments.
- * lib/pp.rb: rdoced. [ruby-core:4490]
+Fri Sep 5 11:10:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Mar 6 11:36:37 2005 Tanaka Akira <akr@m17n.org>
+ * lib/rdoc/generator/pot/po.rb: fixed broken tests for trailing whitespace.
+ * test/rdoc/test_rdoc_generator_pot.rb: ditto.
+ * test/rdoc/test_rdoc_generator_pot_po.rb: ditto.
- * lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
- may return nil. [ruby-talk:129826]
- reported by Daniel Berger.
+Fri Sep 5 10:41:07 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Mar 5 18:06:21 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_parse_file_encoding):
+ typofix.
- * dir.c (fnmatch): removed unnecessary code. (ruby_1_8 didn't have
- String#clear, so [ruby-dev:24749] didn't affect it)
+Fri Sep 5 10:39:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * win32/win32.c (NtInitialize): ditto. (by numeric.c 1.101.2.14)
+ * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
-Sat Mar 5 16:29:26 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Sep 5 06:04:22 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/multi-tk.rb: freeze callback-entry objects
+ * vm.c: remove unused USE_THREAD_RECYCLE [misc #10198]
- * ext/tk/lib/tkextlib/tile.rb: support tile-0.6
+Fri Sep 5 00:29:08 2014 Tanaka Akira <akr@fsij.org>
-Fri Mar 4 19:39:28 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (dirfd): Check function.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser#do_includes): replace
- also locally defined modules.
+ * dir.c (dir_fileno): New method.
+ [ruby-dev:48265] [Feature #9880]
- * ext/iconv/iconv.c: backport Iconv::InvalidEncoding from CVS HEAD.
+Thu Sep 4 23:39:52 2014 Tanaka Akira <akr@fsij.org>
- * ext/strscan/strscan.c: moved misplaced rdoc.
+ * process.c (has_privilege): New function.
+ (retry_fork_async_signal_safe): Don't use vfork() for privileged
+ process.
-Fri Mar 4 15:58:12 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (getresuid): Check function.
+ (getresgid): Ditto.
- * lib/cgi-lib.rb: add deprecation warning. [ruby-dev:25499]
- getopts.rb, parsearg.rb, importenv.rb as well.
+Thu Sep 4 20:22:14 2014 Laurent Arnoud <laurent@spkdev.net>
-Fri Mar 4 11:17:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/pathname/test_pathname.rb: added testcase for Pathname#mountpoint?.
+ [fix GH-709]
- * ext/tcltklib/tcltklib.c (ip_rbUpdateCommand): get rid of
- warnings with Tcl/Tk 8.3 or former (backport from CVS_HEAD).
+Thu Sep 4 20:09:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tcltklib/tcltklib.c (ip_rb_threadUpdateCommand): ditto.
+ * symbian/*: removed Symbian support.
+ [Feature #10199][ruby-core:64725]
+ * dln.c: ditto.
+ * include/ruby/defines.h: ditto.
+ * thread_pthread.c: ditto.
+ * vm.c: ditto.
-Fri Mar 4 10:15:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Sep 4 17:44:40 2014 Koichi Sasada <ko1@atdot.net>
- * lib/set.rb (SortedSet::setup): a hack to shut up warning.
- [ruby-talk:132866]
+ * dir.c (glob_helper): use #ifdef instead of #if.
+ gcc's -Wundef option shows warning for undefined macro.
-Fri Mar 4 07:07:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+ * numeric.c (flo_is_finite_p): ditto.
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.63
+ * vm_dump.c (rb_vmdebug_thread_dump_state): ditto.
-Thu Mar 3 23:49:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h: define VM_DEBUG_VERIFY_METHOD_CACHE to 0.
- * ext/nkf/nkf-utf8/nkf.c: follow nkf 1.62
+Thu Sep 4 03:57:46 2014 Eric Wong <e@80x24.org>
-Thu Mar 3 11:49:51 2005 Kouhei Sutou <kou@cozmixng.org>
+ * man/ruby.1: spelling fix ("bellow" => "below") [ci-skip]
- * sample/rss/tdiary_plugin/rss-recent.rb: added site information.
+Thu Sep 4 03:52:16 2014 Eric Wong <e@80x24.org>
-Wed Mar 2 19:53:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * man/ruby.1: add trailing slash to URLs [ci-skip]
- * ext/extmk.rb (parse_args): add DESTDIR only when not directed
- already. fixed: [ruby-dev:25781]
+Wed Sep 3 19:10:28 2014 Tanaka Akira <akr@fsij.org>
-Wed Mar 2 17:14:18 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (before_fork_ruby): Renamed from before_fork.
+ (after_fork_ruby): Renamed from after_fork.
- * ext/tcltklib/tcltklib.c (lib_eventloop_core): fix typo
+Wed Sep 3 18:56:05 2014 Tanaka Akira <akr@fsij.org>
-Wed Mar 2 16:00:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * process.c (forked_child): Removed.
- * ext/tcltklib/tcltklib.c: enforce thread-check and exception-handling
- to avoid SEGV trouble.
- [KNOWN BUG] When supports pthread and running multiple Tk
- interpreters, an interrupt signal causes SEGV frequently. That
- may be a trouble of Ruby's signal handler.
+Wed Sep 3 16:56:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tkutil/tkutil.c; fix a bug on converting a SJIS string array
- to a Tcl's list string.
+ * object.c (rb_obj_copy_ivar): allocate no memory for empty
+ instance variables. [ruby-core:64700] [Bug #10191]
- * ext/tk/tcltklib.c: wrap Tcl's original "namespace" command to
- protect from namespace crash.
+Wed Sep 3 12:05:17 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/multi-tk.rb: enforce exception-handling.
+ * process.c (retry_fork_async_signal_safe): Use vfork() if available.
+ vfork() is still faster than fork() especially when the parent
+ process uses big memory.
- * ext/tk/lib/multi-tk.rb: catch IRB_EXIT to work on irb.
+ ruby -rbenchmark -e 'a = "a" * 1_000_000_000; puts Benchmark.measure { system("true") }'
+ fork: 0.000000 0.010000 0.010000 ( 0.014968)
+ vfork: 0.000000 0.000000 0.000000 ( 0.000912)
+ on Debian sid.
- * ext/tk/lib/tk.rb: ditto.
+Wed Sep 3 11:33:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/tcltklib.c: add TclTkLib.mainloop_thread?
+ * test/openssl/test_pkey_rsa.rb (OpenSSL#test_sign_verify_memory_leak):
+ added timeout into testcase for low performance environment.
+ [Bug #9984][ruby-core:63367]
- * ext/tk/lib/multi-tk.rb: (bug fix) callback returns a value.
+Wed Sep 3 07:50:15 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/canvas.rb (delete): bug fix when multiple arguments.
+ * configure.in: Use AC_FUNC_FORK.
- * ext/tk/lib/clock.rb: fix 'no method error'.
+ * io.c: Use HAVE_WORKING_FORK instead of HAVE_FORK.
- * ext/tk/lib/clock.rb (self.clicks): accept a Symbol argument.
+ * process.c: Ditto.
- * ext/tk/lib/variable.rb: be able to set default_value_type; :numeric,
- :bool, :string, :symbol, :list, :numlist or nil (default; same to
- :string). If set a type, TkVariable#value returns a value of the
- type.
+Wed Sep 3 00:12:44 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tkextlib/tclx/tclx.rb: add Tk::TclX.signal to warn the
- risk of using TclX extension's 'signal' command.
+ * process.c (retry_fork_async_signal_safe): Don't return on in child
+ process.
- * ext/tk/sample/irbtk.rb: irb with Ruby/Tk.
+Tue Sep 2 23:47:35 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/demos-*/anilabel.rb: bug fix on 'show code'
+ * process.c (retry_fork_async_signal_safe): Specialized version of
+ retry_fork respect to rb_fork_async_signal_safe.
+ (retry_fork_ruby): Specialized version of retry_fork respect to
+ rb_fork_ruby.
+ (rb_fork_ruby): Removed.
- * ext/tk/sample/demos-*/aniwave.rb: new Ruby/Tk animation demo.
+Tue Sep 2 23:26:26 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/demos-*/pendulum.rb: ditto.
+ * process.c (send_child_error): Simplified.
+ (recv_child_error): Ditto.
- * ext/tk/sample/demos-*/goldberg.rb: ditto.
+Tue Sep 2 22:56:25 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/demos-*/widget: add entries of animation demos.
+ * process.c (rb_fork_async_signal_safe): Inline rb_fork_internal.
+ (rb_fork_ruby): Ditto.
+ (rb_fork_internal): Removed.
+ (chfunc_protect): Removed.
-Tue Mar 1 00:47:43 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Sep 2 22:43:52 2014 Tanaka Akira <akr@fsij.org>
- * test/rinda/test_rinda.rb: backport from CVS_HEAD. use
- MockClock.sleep instead of Kernel.sleep [ruby-dev:25387]
+ * test/ruby/test_io.rb (test_new_with_block): Set autoclose to avoid
+ EBADF.
-Tue Mar 1 00:34:24 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Sep 2 22:01:51 2014 Kouhei Sutou <kou@cozmixng.org>
- * lib/rinda/tuplespace.rb (Rinda::TupleSpace): improved keeper thread.
+ * Makefile.in (update-coverage): Remove a never executed line.
- * test/rinda/test_rinda.rb: ditto.
+Tue Sep 2 19:48:26 2014 Tanaka Akira <akr@fsij.org>
-Mon Feb 28 11:42:23 2005 Ian Macdonald <ian@caliban.org>
+ * process.c (handle_fork_error): Extracted from retry_fork.
- * exception error messages updated. [ruby-core:04497]
+Tue Sep 2 17:02:53 2014 Vit Ondruch <v.ondruch@tiscali.cz>
-Mon Feb 28 09:03:09 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/rbinstall.rb: fixed error of local installation.
+ [Bug #10192][ruby-core:64702]
- * ext/socket/socket.c (Init_socket): add bunch of Socket
- constants. Patch from Sam Roberts <sroberts@uniserve.com>.
- [ruby-core:04409]
+Tue Sep 2 16:58:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Feb 23 15:04:32 2005 akira yamada <akira@ruby-lang.org>
+ * test/runner.rb: reporting test coverage for test-all with COVERAGE env.
+ [Feature #10189][ruby-core:64681][fix GH-708]
+ * Makefile.in: added task for coverage report.
+ * common.mk: added definition of forked simplecov url.
+ * .gitignore: ignored coverage directory.
- * lib/uri/generic.rb (split_userinfo): should split ":pass" into ""
- and "pass". [ruby-dev:25667]
+Mon Sep 1 20:11:02 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Wed Feb 23 08:00:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c (rbtime2vtdate): try to convert millisecond
+ of Time object to millisecond of VT_DATE VARIANT.
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_time2date_with_msec): ditto.
- * array.c (rb_ary_s_create): no need for negative argc check.
- [ruby-core:04463]
+Sun Aug 31 16:58:49 2014 Tanaka Akira <akr@fsij.org>
- * array.c (rb_ary_unshift_m): ditto.
+ * lib/benchmark.rb: Fix a syntax error.
-Wed Feb 23 01:57:46 2005 Shugo Maeda <shugo@ruby-lang.org>
+Sun Aug 31 08:46:44 2014 Eric Wong <e@80x24.org>
- * lib/net/imap.rb (initialize): handle certs correctly. Thanks,
- NABEYA Kenichi. (backported from CVS HEAD)
+ * ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
+ [Bug #10101]
-Tue Feb 22 07:25:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/zlib/test_zlib.rb (test_rewind): test each_byte
- * parse.y (parser_yylex): identfier after dot must not be a variable.
+Sat Aug 30 19:22:47 2014 Eric Wong <e@80x24.org>
-Mon Feb 21 10:04:49 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * symbol.c (rb_sym2id): do not return garbage object
- * {bcc32,win32,wince}/Makefile.sub (config.h): add fcntl.
+Sat Aug 30 06:39:48 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/win32.[ch] (fcntl): ditto.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping and
+ loading. Fixes GH #85. Thanks @brentdax for the patch!
+ * test/psych/test_exception.rb: test for fix
- * win32/win32.c (rb_w32_connect): support nonblocking mode.
+Sat Aug 30 06:23:40 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/socket/socket.c (wait_connectable, ruby_connect): support
- nonblocking connect on various platforms.
- all changes are backported from CVS HEAD. [ruby-core:3154],
- [ruby-core:4364].
+ * ext/psych/lib/psych/scalar_scanner.rb: fix loading strings that
+ look like integers but have a newline. Fixes GH #189
+ * test/psych/test_string.rb: test for fix
-Sun Feb 20 00:48:48 2005 Tanaka Akira <akr@m17n.org>
+Sat Aug 30 06:10:39 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/open-uri.rb (URI::FTP#buffer_open): access mechanism
- re-implemented according to RFC 1738.
- reported by Guillaume Marcais. [ruby-talk:131650]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys with a hash
+ should merge the hash in to the parent.
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #202
-Sat Feb 19 18:11:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat Aug 30 06:00:26 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/drb/drb.rb (DRbObject#respond_to?): take two arguments.
- [ruby-dev:25722]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings
+ should not be treated as merge keys.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys
+ containing "<<" should roundtrip.
+ * test/psych/test_merge_keys.rb: test for change. Fixes GH #203
- * test/drb/drbtest.rb: ditto.
+Fri Aug 29 17:56:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Feb 19 13:52:02 2005 Tanaka Akira <akr@m17n.org>
+ * test/net/imap/test_imap_response_parser.rb: removed needless code.
- * lib/open-uri.rb: call OpenSSL::SSL::SSLSocket#post_connection_check
- after connection is made.
+Fri Aug 29 17:36:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Feb 19 01:32:03 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/rinda/test_rinda.rb: removed useless assignment variables.
+ * test/rss/rss-assertions.rb: ditto.
+ * test/rss/test_maker_itunes.rb: ditto.
- * ext/bigdecimal/lib/bigdecimal/newton.rb: resolved LoadError.
- [ruby-dev:25685]
+Fri Aug 29 16:18:26 2014 Eric Wong <e@80x24.org>
- * ext/bigdecimal/sample/linear.rb: ditto.
+ * string.c: revert part of r47311, add rb_vm_fstring_table(),
+ remove vm_core.h dependency. [ruby-core:64627]
- * ext/bigdecimal/sample/nlsolve.rb: ditto.
+Fri Aug 29 15:17:13 2014 Eric Wong <e@80x24.org>
- * ext/bigdecimal/lib/bigdecimal/nlsolve.rb: removed because this file
- is sample script and same file exists in ext/bigdecimal/sample.
+ * string.c: remove static frozen_strings
+ * string.c (Init_frozen_strings): new function
+ * string.c (rb_fstring): remove check for frozen strings,
+ use per-VM table
+ * string.c (rb_str_free): use per-VM table
+ * string.c (Init_String): use per-VM table
+ * vm_core.h (rb_vm_t): add frozen_strings table
+ * internal.h (Init_frozen_strings): new function prototype
+ * eval.c (ruby_setup): call Init_frozen_strings
+ [Feature #10182]
-Fri Feb 18 17:14:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Aug 27 23:10:24 2014 Masaki Matsushita <glass.saga@gmail.com>
- * lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
- of StandardError class, not Exception class. [ruby-core:04429]
+ * lib/tempfile.rb: remove "require 'thread'". its features are no
+ longer used.
-Thu Feb 17 20:11:18 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Aug 27 21:19:40 2014 gogo tanaka <mail@tanakakazuki.com>
- * lib/drb/drb.rb (DRbServer.default_safe_level): fix typo.
+ * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.
+ [Feature #10174][ruby-core:64584]
+ * lib/erb.rb: ditto.
+ * lib/observer.rb: ditto.
+ * lib/rake/invocation_chain.rb: ditto.
+ * lib/rubygems/command_manager.rb: ditto.
+ * lib/rubygems/config_file.rb: ditto.
+ * lib/uri/common.rb: ditto.
-Thu Feb 17 20:11:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 27 21:08:20 2014 gogo tanaka <mail@tanakakazuki.com>
- * test/digest/test_digest.rb: separate test case for each algorithms.
- [ruby-dev:25412]
+ * lib/drb/drb.rb: use attr_reader instead of Module#attr.
+ [Feature #10172][ruby-core:64582]
+ * lib/irb/ruby-token.rb: ditto.
+ * lib/net/telnet.rb: ditto.
+ * lib/rdoc/ruby_token.rb: ditto.
+ * lib/thwait.rb: ditto.
-Thu Feb 17 11:54:00 2005 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Wed Aug 27 19:52:33 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/test/unit/collector.rb (collect_file): now deletes paths added
- to $LOAD_PATH instead of restoring it verbatim.
+ * ext/win32ole/win32ole.c (vtdate2rbtime): try to convert millisecond
+ of VT_DATE VARIANT to nsec of Time object.
+ * test/win32ole/test_win32ole_variant.rb
+ (test_conversion_dbl2date_with_msec): ditto.
- * lib/test/unit/autorunner.rb (AutoRunner.run): fixed so that
- 'ruby -rtest/unit -rtest1 -rtest2 -e0' will use the objectspace
- collector again. Also tried to simplify the calling convention.
+Wed Aug 27 09:57:29 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/runner.rb: adjusted for new AutoRunner semantics.
+ * test/ruby/test_complex.rb: removed unreachable code.
+ * test/ruby/test_rational.rb: ditto.
- * lib/test/unit.rb: ditto.
+Wed Aug 27 07:59:17 2014 Eric Wong <e@80x24.org>
-Thu Feb 17 04:21:47 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * compile.c (iseq_set_sequence): check for multiplication overflow
- * lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
- fixed: [ruby-core:04444]
+Tue Aug 26 22:07:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Feb 17 00:09:45 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/ruby/test_complex.rb: cherry-picked working assertions from r47251.
+ * test/ruby/test_rational.rb: cherry-picked working assertions from r47263.
- * test/drb/ignore_test_drb.rb: move TestDRbReusePort to new file
- [ruby-dev:25238]
+Tue Aug 26 21:07:56 2014 gogo tanaka <mail@tanakakazuki.com>
- * test/drb/test_drb.rb: add method DRbService.ext_service, move
- TestDRbReusePort to new file [ruby-dev:25238]
+ * lib/mathn.rb (Fixnum#**, Bignum#**, Float#**, Rational#**):
+ remove as these are now built-in. [ruby-core:63973] [Bug #10086]
- * test/drb/test_drb.rb: ditto.
+Tue Aug 26 20:46:55 2014 Tanaka Akira <akr@fsij.org>
- * test/drb/test_drbssl.rb: ditto.
+ * time.c (rb_time_unmagnify_to_float): Avoid double rounding.
+ Reported by Tsuyoshi Sawada.
+ https://bugs.ruby-lang.org/issues/10135#note-1
- * test/drb/test_drbunix.rb: ditto.
+Tue Aug 26 17:12:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/drb/ut_drb.rb: reduce sleep.
+ * io.c (io_close): ignore only "closed stream" IOError and
+ NoMethodError, do not swallow other exceptions at the end of
+ block. [ruby-core:64463] [Bug #10153]
-Thu Feb 17 00:02:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 26 13:46:33 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * eval.c (is_defined): NODE_IASGN is an assignment.
+ * template/fake.rb.in: fix failed to make install when @srcdir@ is
+ absolute path.
-Wed Feb 16 23:34:30 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue Aug 26 13:43:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/drb/drb.rb: add lazy stop_service. ([druby-ja:109])
+ * test/ruby/test_range.rb: added workaround for VERBOSE message.
- * lib/drb/extserv.rb: ditto.
+Tue Aug 26 12:38:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Feb 16 17:07:57 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/test_mathn.rb: added workaround for VERBOSE messages.
- * ext/tk/tkutil.c: Follow the change of st.c (st_foreach)
- [ruby-list:40623].
- Sometimes mis-convert from a Ruby's Array of SJIS Strings, which
- includes some kind of SJIS characters, to a Tcl's UTF8 list string.
+Tue Aug 26 11:44:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 14 23:58:17 2005 Kouhei Sutou <kou@cozmixng.org>
+ * lib/shell/process-controller.rb: removed commented-out code.
- * lib/rss/parser.rb (RSS::ListenerMixin::tag_end):
- fixed invalid namespace handling bug.
+Tue Aug 26 11:39:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 14 13:12:38 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/thwait.rb (ThreadsWait): removed needless constant.
- * ext/openssl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SSLSocket#post_connection_check): new method.
+Tue Aug 26 09:27:10 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 14 00:40:49 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/mathn.rb: mathn library is deprecated on ruby 2.2.
+ [Feature #10169][ruby-core:64553]
- * lib/drb/drb.rb (InvokeMethod.perform): pass DRb info to sub thread.
+Tue Aug 26 09:25:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/drb/test_drb.rb (test_01_safe1_safe4_eval): fix test case.
+ * lib/mathn.rb: removed commented-out code.
-Sun Feb 13 23:13:46 2005 Kouhei Sutou <kou@cozmixng.org>
+Mon Aug 25 20:15:50 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rss/dublincore.rb (RSS::DublicCoreModel#date{,=}): added
- convenient methods.
+ * ext/win32ole/win32ole.c(fole_s_connect, fole_initialize): raise a
+ security error with the tainted string object.
+ * ext/win32ole/win32ole_event.c(ev_advise): ditto.
+ * test/win32ole/test_win32ole.rb(test_s_new_exc_svr_tainted,
+ test_s_new_exc_host_tainted): ditto.
+ * test/win32ole/test_win32ole_event.rb(test_s_new_exc_tainted): ditto.
- * lib/rss/0.9.rb (RSS::Rss::Channel#date{,=}): ditto.
+Mon Aug 25 12:56:54 2014 Ivan Korunkov <ivankorunkov@ya.ru>
- * lib/rss/2.0.rb (RSS::Rss::Channel::Item#date{,=}): ditto.
+ * lib/logger.rb (format_datetime): use "%6N" to show microsecond.
+ [Fix GH-704]
- * test/rss/: added tests for the convenient methods.
+Mon Aug 25 11:02:07 2014 Eric Wong <e@80x24.org>
-Sun Feb 13 22:43:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * vm_core.h (rb_iseq_location_t): change first_lineno type to VALUE
+ * iseq.c (rb_iseq_build_for_ruby2cext): update based on argument
- * lib/drb/drb.rb (DRbServer): add default_safe_level, safe_level,
- config[:safe_level] ([druby-ja:120])
+Sun Aug 24 16:14:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/drb/test_drb.rb, ut_eval.rb, ut_safe1.rb: ditto.
+ * lib/e2mmap.rb: remove needless instance variables.
+ * lib/irb.rb: ditto.
+ * lib/irb/**/*.rb: ditto.
+ * lib/shell.rb: ditto.
-Sun Feb 13 16:56:52 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Aug 24 12:44:26 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/webrick/cgi.rb (WEBrick::CGI.start): should set reason-phrase
- to the value of status header field. ([ruby-dev:40617])
+ * test/ruby/test_complex.rb: removed needless conditions.
+ * test/ruby/test_rational.rb: ditto.
-Sun Feb 13 00:52:33 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Aug 24 11:47:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/erb.rb (ERB::Util.h, u): make it module_function.
+ * test/ruby/test_rational.rb: fixed indent.
-Sat Feb 12 17:29:19 2005 Tanaka Akira <akr@m17n.org>
+Sun Aug 24 11:44:11 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/open-uri.rb (OpenURI.open_loop): send authentication only for
- the URI directly specified.
+ * test/ruby/test_rational.rb: remove commented-out code.
-Sat Feb 12 15:07:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Aug 24 11:09:29 2014 Eric Wong <e@80x24.org>
- * random.c (rand_init): suppress warning.
+ * lib/benchmark.rb (measure): reduce allocations as in r47260
-Sat Feb 12 13:54:03 2005 Tanaka Akira <akr@m17n.org>
+Sun Aug 24 10:35:54 2014 Pete Higgins <pete@peterhiggins.org>
- * lib/open-uri.rb: support https if the platform provides CA
- certificates.
+ * lib/benchmark.rb (module Benchmark): define BENCHMARK_CLOCK
+ (realtime): use Process.clock_gettime(BENCHMARK_CLOCK)
+ Reduces allocations to improve performance [Feature #10165]
-Sat Feb 12 06:18:28 2005 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+ * test/benchmark/test_benchmark.rb (test_realtime_output): new test
- * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.
- [ruby-dev:25675]
+Fri Aug 22 20:23:54 2014 Koichi Sasada <ko1@atdot.net>
-Fri Feb 11 17:40:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * string.c (rb_fstring): fix condition (easy to cause infinite loop!).
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
- new method OpenSSL::X509::Store#set_default_paths.
+Fri Aug 22 20:07:43 2014 Koichi Sasada <ko1@atdot.net>
-Fri Feb 11 11:33:53 2005 Tanaka Akira <akr@m17n.org>
+ * string.c (rb_fstring, fstr_update_callback): simply delete garbage
+ key first.
- * lib/open-uri.rb (URI::HTTP#proxy_open): new option supported:
- :http_basic_authentication.
- suggested by Kent Sibilev. [ruby-core:4392]
+ Garbage keys can be swept by lazy sweeping invoked by creating new
+ fstring. So that simply do:
+ (1) delete garbage key and return `fstr_update_callback' immediately
+ (2) try again `fstr_update_callback()' to create a new fstr.
-Fri Feb 11 06:30:07 2005 George Ogata <g_ogata@optushome.com.au>
+ This bug can be cause memory corruption, reported by
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20140821T220302Z.fail.html.gz
- * misc/ruby-mode.el: ignore parenthesis inside heredoc.
- [ruby-core:04415]
+Fri Aug 22 19:30:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Feb 11 04:54:13 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+ * test/ruby/test_complex.rb: removed commented-out code.
- * lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
+Fri Aug 22 19:25:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc/generators/ri_generator.rb: ditto.
+ * test/ruby/test_complex.rb: fixed broken tests. Math is not
+ compatible CMath now.
-Thu Feb 10 11:14:17 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Aug 22 15:36:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (COMMON_HEADERS): shouldn't include winsock2.h.
+ * common.mk (Doxyfile): revert r43888, not to require preinstalled
+ ruby. [ruby-core:64488] [Bug #10161]
- * ext/socket/extconf.rb (sockaddr_storage): remove workaround for
- mswin32.
+Fri Aug 22 12:32:15 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Feb 10 10:29:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/shell.rb: removed commented-out code.
+ * lib/shell/builtin-command.rb: ditto.
+ * lib/shell/command-processor.rb: ditto.
- * ext/curses/curses.c: don't need to check HAVE_WCOLOR_SET excluding
- window_color_set().
+Fri Aug 22 12:21:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Feb 10 00:47:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/complex.rb: removed deprecated library.
+ * lib/rational.rb: ditto.
- * struct.c (make_struct): fixed: [ruby-core:04402]
+Fri Aug 22 11:38:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Feb 9 08:07:08 2005 Paul Duncan <pabs@pablotron.org>
+ * lib/prettyprint.rb: removed PrettyPrint#first?
+ because it is obsoleted method since Ruby 1.8.2
- * ext/curses/curses.c (window_color_set): [ruby-core:04393]
+Thu Aug 21 17:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 8 23:51:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * win32/win32.c (constat_attr): manage reverse video internally
+ since Windows console window does not manage it. based on the
+ patch by white leaf in [ruby-dev:48483]. [Bug #10158]
- * lib/drb/drb.rb: reject :instance_eval, :class_eval, :module_eval
- [druby-ja:117]
+Thu Aug 21 14:45:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Feb 8 13:06:12 2005 Sam Roberts <sroberts@uniserve.com>
+ * lib/e2mmap.rb: removed commented-out code.
- * ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
- [ruby-talk:130092]
+Thu Aug 21 13:23:34 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Feb 8 09:30:01 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rinda/ring.rb: split executable code into sample directory.
+ * sample/rinda-ring.rb: ditto.
- * lib/cgi.rb (CGI::Cookie): [ruby-talk:130040]
+Thu Aug 21 13:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Feb 8 00:19:02 2005 Tanaka Akira <akr@m17n.org>
+ * lib/drb/acl.rb: split executable code into sample directory.
+ * sample/drb/acl.rb: ditto.
- * lib/resolv.rb (Resolv::DNS::Name#subdomain_of?): new method.
- (Resolv::DNS::Name#inspect): ditto.
- Suggested by Sam Roberts. [ruby-talk:129086]
+Thu Aug 21 12:55:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 7 10:06:30 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * .gitignore: ignored temporary file for Changelog.
+ http://mkosaki.blog46.fc2.com/blog-entry-1284.html
- * object.c: [ruby-doc:818]
+Thu Aug 21 12:40:22 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Feb 7 01:56:20 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/net/imap.rb: split executable code into sample directory.
+ * sample/net-imap.rb: ditto.
- * instruby.rb, rubytest.rb (srcdir): no longer embed srcdir into
- rbconfig.rb. (backported from CVS HEAD)
+Thu Aug 21 12:23:56 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/extconf.rb (sockaddr_storage): winsock2.h have the
- definition of struct sockaddr_storage, but socket.c doesn't
- include it because this version of ruby still has binary level
- compatibility with winsock1.
+ * lib/net/imap.rb: removed commented-out code.
- * lib/mkmf.rb (create_makefile): should support header files in
- depend file.
+Wed Aug 20 17:27:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 7 01:21:50 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_TRY_CFLAGS, RUBY_TRY_LDFLAGS),
+ (RUBY_CHECK_BUILTIN_SETJMP, RUBY_SETJMP_TYPE),
+ (RUBY_STACK_GROW_DIRECTION): quote defun names, for some
+ versions of autoconf possibly. [ruby-core:64473] [Bug #10156]
- * ext/socket/extconf.rb: check if getaddrinfo() works fine only when
- wide-getaddrinfo option is not given. fixed: [ruby-dev:25422]
+Tue Aug 19 22:28:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb ($extmk): check if under ext directory.
+ * sprintf.c (rb_str_format): fix condition to round.
+ [ruby-core:64454] [Bug #10151]
- * lib/mkmf.rb (Logging.postpone): allow recursive operation.
+Tue Aug 19 22:22:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (try_constant): make sure if really a constant, reduce
- the number of times of compile.
+ * enc/trans/euckr-tbl.rb (EUCKR_TO_UCS_TBL): add missing euro and
+ registered signs. [ruby-core:64452] [Bug #10149]
- * lib/mkmf.rb (have_macro, have_var, byte_order): new functions.
+Tue Aug 19 13:59:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (find_library): allow directory list with separators.
+ * compar.c (rb_cmperr): preserve encodings of arguments in the
+ message.
- * lib/mkmf.rb (arg_config): manage provided configuration options.
+Tue Aug 19 10:13:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (dir_config): accept arrays of directory names as
- default values.
+ * ext/thread/thread.c (get_array): check instance variables are
+ initialized properly. [ruby-core:63826][Bug #10062]
- * mkconfig.rb: no longer embed srcdir and compile_dir into
- rbconfig.rb.
+Mon Aug 18 17:06:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (create_makefile): fix unbalanced parens.
+ * sprintf.c (rb_str_format): support rational 'f' format.
+ [ruby-core:64382] [Bug #10136]
-Sun Feb 6 19:23:01 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Aug 18 08:03:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * eval.c (stack_extend): add prototype because VC++8 doesn't
- accept __declspec(noinline) with K&R style function definitions.
- (backported from CVS HEAD)
+ * spec/default.mspec: use 2.2 definition.
-Sun Feb 6 14:14:26 2005 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Aug 17 19:41:40 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/date.rb (new_with_hash): changed messages of exception.
+ * gc.c (obj_memsize_of): don't calculate memsize of T_NODE
+ when called from check_gen_consistency. It fixes segmentation
+ fault on RGENGC_CHECK_MODE >= 1 introduced by r47188.
- * lib/date/format.rb (str[fp]time): undocumented conversion
- specifications %[1-3] are now deprecated.
+Sun Aug 17 17:08:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sun Feb 6 12:20:11 2005 Akinori MUSHA <knu@iDaemons.org>
+ * ext/win32ole/win32ole.c (ole_invoke): use RHASH_SIZE instead of
+ calling Hash#length method.
- * bignum.c (rb_big2ulong_pack): One too many arguments are passed
- to big2ulong().
+Sat Aug 16 19:32:06 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * re.c (rb_reg_init_copy, rb_reg_initialize_m): One too many
- arguments are passed to rb_reg_initialize().
+ * ext/win32ole/win32ole_event.c (evs_length): use RARRAY_LEN instead
+ of calling Array#length method.
-Sun Feb 6 03:24:20 2005 Tanaka Akira <akr@m17n.org>
+Sat Aug 16 10:20:17 2014 Eric Wong <e@80x24.org>
- * lib/resolv.rb (Resolv::DNS::Resource::TXT): multiple strings was not
- handled.
- (Resolv::DNS::Resource::TXT#strings): new method to return all
- strings.
- (Resolv::DNS::Message::MessageEncoder#put_string_list): new method.
- (Resolv::DNS::Message::MessageDecoder#get_string_list): ditto.
- based on [ruby-talk:129732] by Sam Roberts.
+ * time.c (time_timespec): fix tv_nsec overflow
+ [Bug #10144]
-Fri Feb 4 00:30:45 2005 Kouhei Sutou <kou@cozmixng.org>
+Fri Aug 15 20:34:17 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rss: supported Image module.
- http://web.resource.org/rss/1.0/modules/image/
+ * ext/win32ole/win32ole.c: separate WIN32OLE_EVENT src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_event.c: ditto.
+ * ext/win32ole/win32ole_event.h: ditto.
+ * ext/win32ole/depend: ditto.
-Thu Feb 3 23:42:36 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 15 19:38:00 2014 Koichi Sasada <ko1@atdot.net>
- * ext/stringio/stringio.c (strio_close, strio_close_read, strio_close_write):
- should return nil instead of self as well as IO. [ruby-dev:25623]
+ * iseq.c (rb_iseq_clone): Should not insert write barrier from
+ non-RVALUE data (to non-RVALUE data, of course).
- * ext/stringio/stringio.c (strio_extend, strio_putc): fill with zero
- extended portion. [ruby-dev:25626]
+ Ruby 2.1 also has a same problem.
-Wed Feb 2 23:52:53 2005 sheepman <sheepman@tcn.zaq.ne.jp>
+Fri Aug 15 19:34:33 2014 Koichi Sasada <ko1@atdot.net>
- * ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended
- part. [ruby-dev:25618]
+ * string.c (setup_fake_str): fake strings should not set class by
+ RBASIC_SET_CLASS() because it insert write barriers to fake
+ (non-RVALUE) structure.
-Wed Feb 2 21:56:01 2005 Kouhei Sutou <kou@cozmixng.org>
+ It can cause unexpected behaviour.
- * lib/rss/rss.rb (RSS::Element#convert): added.
+ Ruby 2.1 also have a same problem (setup_fake_str() in parse.y).
- * lib/rss/rss.rb: convert -> need_convert.
+ * symbol.c (setup_fake_str): ditto.
- * lib/rss/1.0.rb: ditto.
+Fri Aug 15 19:27:25 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rss/0.9.rb: ditto.
+ * array.c (rb_ary_tmp_new_fill): added.
+ This function creates internal use only array (which is completely
+ hided by ObjectSpace.each_object) with filling nil.
- * lib/rss/2.0.rb: ditto.
+ Otherwise, it can be includes strange VALUEs.
- * lib/rss/trackback.rb: ditto.
+ * internal.h: added.
-Tue Feb 1 22:48:48 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * node.h: use rb_ary_tmp_new_fill() for MEMO.
- * lib/drb/drb.rb (DRb::DRbObject#respond_to?): check marshal_dump and
- _dump.
+Fri Aug 15 10:13:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Feb 1 00:20:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/gserver.rb: removed unmaintained code.
+ [ruby-core:40313][Feature #5480]
+ * lib/xmlrpc/httpserver.rb: ditto.
- * configure.in (aix): fix linker flags on AIX. [ruby-talk:125460]
+Fri Aug 15 09:22:12 2014 Eric Wong <e@80x24.org>
-Mon Jan 31 13:33:21 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_core.h (rb_thread_struct): reorder to pack
+ * cont.c (rb_context_struct, rb_fiber_struct): ditto
+ On x86-64, these changes reduces:
+ rb_thread_struct to 1000 bytes (from 1016)
+ rb_context_struct to 1288 bytes (from 1312)
+ rb_fiber_struct to 2272 bytes (from 2304)
- * ext/tcltklib/tcltklib.c: add invalid namespace check
+Fri Aug 15 09:06:31 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/multi-tk.rb: add invalid_namespace? method
+ * thread_pthread.h: define RB_NATIVETHREAD_LOCK_INIT and
+ RB_NATIVETHREAD_COND_INIT macros
- * ext/tk/lib/remote-tk.rb: ditto
+ * thread_pthread.c (native_mutex_lock, native_mutex_unlock,
+ native_mutex_trylock, native_mutex_initialize,
+ native_mutex_destroy, native_cond_wait):
+ use rb_nativethread_lock_t instead of pthread_mutex_t
+ [Feature #10134]
-Mon Jan 31 10:29:18 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.c (native_mutex_debug): make argument type-agnostic
+ to avoid later cast.
- * lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
+ * thread_pthread.c (register_cached_thread_and_wait):
+ replace PTHREAD_COND_INITIALIZER with RB_NATIVETHREAD_COND_INIT,
+ use native_mutex_{lock,unlock}
-Sat Jan 29 09:42:12 2005 Sam Roberts <sroberts@uniserve.com>
+ * thread_pthread.c (use_cached_thread):
+ use native_mutex_{lock,unlock}
- * lib/resolv.rb (Resolv::DNS::Resource::IN::SRV): Added RFC2782 SRV
- resource record for specifying location of services.
+ * thread_pthread.c (native_sleep):
+ use rb_nativethread_lock_t to match th->interrupt_lock,
+ use native_mutex_{lock,unlock}
-Fri Jan 28 17:16:55 2005 Tanaka Akira <akr@m17n.org>
+ * thread_pthread.c (timer_thread_lock): use rb_nativethread_lock_t type
- * lib/resolv.rb (Resolv::DNS::Config.parse_resolv_conf):
- parse options line for ndots option.
- (Resolv::Hosts#lazy_initialize): return self.
- (Resolv::DNS#lazy_initialize): ditto.
- (Resolv::DNS::Config#lazy_initialize): ditto.
- Suggested by Sam Roberts.
+Fri Aug 15 08:10:29 2014 Eric Wong <e@80x24.org>
-Thu Jan 27 13:18:03 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * cont.c (cont_mark): fix typo in unused path [ci skip]
- * st.c (st_foreach): report success/failure by return value.
- [ruby-Bugs-1396]
+Fri Aug 15 06:00:56 2014 Eric Wong <e@80x24.org>
-Thu Jan 27 00:15:29 2005 Minero Aoki <aamine@loveruby.net>
+ * vm.c (rb_thread_mark): update comment about marking `me'
+ [ruby-core:64340] [ruby-core:64341]
- * test/fileutils/test_fileutils.rb (setup): support BSD-style
- directory group inheritance. (backport from HEAD, rev 1.32)
+Fri Aug 15 05:53:59 2014 Eric Wong <e@80x24.org>
- * test/fileutils/fileasserts.rb (assert_same_entry): show entry
- difference. (backport from HEAD, rev 1.4)
+ * README.EXT: preliminary documentation for RB_GC_GUARD
+ [Bug #10100] [ruby-core:60741]
-Wed Jan 26 23:09:11 2005 Minero Aoki <aamine@loveruby.net>
+Thu Aug 14 00:26:19 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/net/protocol.rb (WriteAdapter#puts): should append \n, not
- prepend. [ruby-talk:128302] (backport from HEAD, rev 1.75)
+ * ext/win32ole/win32ole.c: separate WIN32OLE_RECORD src from
+ win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_record.c: ditto.
+ * ext/win32ole/win32ole_record.h: ditto.
+ * ext/win32ole/depend: ditto.
-Wed Jan 26 10:51:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 13 21:41:04 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * win32/win32.c (flock_winnt, flock_win95): unlock file even if
- LOCK_NB is specified. (backported from CVS HEAD)
+ * ext/win32ole/win32ole.c: separate WIN32OLE_VARIANT src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variant.c: ditto.
+ * ext/win32ole/win32ole_variant.c: ditto.
+ * ext/win32ole/depend: ditto.
-Tue Jan 25 17:11:51 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Aug 13 20:09:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ruby.c (proc_options): correct -T option in RUBYOPT. (backported
- from CVS HEAD)
+ * ext/win32ole/win32ole.c: remove unused variable.
-Tue Jan 25 14:05:52 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Aug 13 19:31:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tcltklib/tcltklib.c: fix SEGV bug; trouble on canceling remained
- after scripts [ruby-dev:25479]: NULL current namespace when deleting
- Tk interpreter [ruby-talk:126225]
+ * ext/win32ole/win32ole.c (ole_search_handler_method, rescue_callback,
+ folerecord_inspect): use PRIsVALUE in rb_sprintf.
- * ext/tcltklib/extconf.rb: bug fix; TCL_ENABLE_THREAD flag is inverted
- [ruby-talk:126360]
+ * ext/win32ole/win32ole_param.c (foleparam_inspect): ditto.
- * ext/tcltklib/extconf.rb: add yet another native-thread check
+ * ext/win32ole/win32ole_variable.c (folevariable_inspect): use
+ PRIsVALUE in rb_sprintf, use rb_inspect.
- * ext/tk/tkutil.c: fix SEGV bug; NULL string pointer when finalize
- Ruby interpreter
+Wed Aug 13 11:54:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/multi-tk.rb: avoid warning for deleted safeTk ip frame
+ * lib/irb/completion.rb: reverted r47163.
+ because another case can't be show completion target.
- * ext/tk/lib/tk/bindtag.rb: bug fix; new method of named bindtag
- doesn't return the created object [ruby-dev:25479]
+Wed Aug 13 11:17:00 2014 Shimpei Makimoto <github@makimoto.org>
- * ext/tk/lib/tk/menu.rb: bug on treating arguments [ruby-dev:25479]
+ * lib/irb.rb: Prevent irb from crashing when exception with
+ nil backtrace is raised.
+ [fix GH-434][ruby-core:58078][Bug #9063]
+ * test/irb/test_raise_no_backtrace_exception.rb: ditto.
- * ext/tk/lib/tk.rb: bug fix; cannot accept a callback ID string for
- a command argument [ruby-dev:25479]
+Wed Aug 13 11:08:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/multi-tk.rb: ditto
+ * lib/irb/completion.rb: fixed broken completion list with
+ String including spaces. Contributed from @dunric. [fix GH-465]
- * ext/tk/lib/tk/*.rb: ditto
+Wed Aug 13 00:07:01 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tk/lib/tkextlib/*.rb: ditto
+ * ext/win32ole/win32ole.c: separate WIN32OLE_PARAM src from win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_param.c: ditto.
+ * ext/win32ole/win32ole_param.h: ditto.
+ * ext/win32ole/depend: ditto.
- * ext/tk/sample/demos-jp/anilabel.rb: new demo script
+Tue Aug 12 23:17:47 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tk/sample/demos-en/anilabel.rb: ditto
+ * ext/win32ole/win32ole.c: refactoring. move some methods
+ into win32ole_type.c / win32ole_method.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_method.c: ditto.
+ * ext/win32ole/win32ole_method.h: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
- * ext/tk/sample/tkHTML/ss.rb: local variable scope bug fix
- [ruby-dev:25479]
+Tue Aug 12 22:59:48 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Jan 24 15:44:25 2005 Tilman Sauerbeck <tilman@code-monkey.de>
+ * ext/win32ole/win32ole.c: refactoring. move
+ ole_typelib_from_itypeinfo into win32ole_typelib.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
- * lib/rdoc/parsers/parse_c.rb: allow whitespace after function names.
- [ruby-core:4296]
+Tue Aug 12 21:49:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/rdoc/parsers/parse_simple.rb: adds support for private comments
- in the "simple" parser. [ruby-core:4301]
+ * ext/win32ole/win32ole.c (ole_create_dcom): use the converted
+ result if the argument can be converted to a string, to get rid
+ of invalid access. Thanks to nobu. [ruby-dev:48467] [Bug #10127]
-Mon Jan 24 15:44:25 2005 Charles Mills <cmills@freeshell.org>
+Tue Aug 12 14:22:58 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc/parsers/parse_c.rb: adds support for constants
- (rb_define_const), accessors (rb_define_attr), and makes a
- couple fixes. [ruby-core:4307]
+ * configure.in: ignored working directory same as prefix value.
+ [ruby-core:54999] [Bug #8409]
-Mon Jan 24 15:44:25 2005 Florian Gro <florgro@gmail.com>
+Tue Aug 12 13:34:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc/parsers/parse_rb.rb: Logic for def Builtin.method() end
- [ruby-core:4302]
+ * lib/fileutils.rb: enable to remove with non-owner directory.
+ [ruby-dev:45976] [Bug #6756]
+ * test/fileutils/test_fileutils.rb: add testcase for #6756.
-Mon Jan 24 15:44:25 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Aug 12 12:57:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * document updates - [ruby-core:04296], [ruby-core:04301],
- [ruby-core:04302], [ruby-core:04307]
+ * vm_exec.c: improve performance in ppc64 arch.
+ [ruby-core:63437] [Feature #9997]
-Sun Jan 23 12:41:16 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue Aug 12 12:14:52 2014 Akira Matsuda <ronnie@dio.jp>
- * lib/soap/wsdlDriver.rb: from 1.5.3-ruby1.8.2, operation which has
- capitalized name (such as KeywordSearchRequest in AWS) is defined as
- a method having uncapitalized name. (converted with
- GenSupport.safemethodname to handle operation name 'foo-bar'). it
- introduced serious incompatibility; in the past, it was defined as a
- capitalized.
+ * lib/fileutils.rb: fix typo.
+ [ruby-dev:47831] [Bug #9180]
- define capitalized method as well under that circumstance.
+Tue Aug 12 10:10:42 2014 Eric Wong <e@80x24.org>
-Sun Jan 23 05:24:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_method.c (release_method_definition): use rb_free_method_entry
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_to_der): should call
- GetOCSPReq at first.
+Tue Aug 12 06:16:09 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Jan 22 23:09:47 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/win32ole/win32ole.c: separate WIN32OLE_METHOD src from
+ win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_method.c: ditto.
+ * ext/win32ole/win32ole_method.h: ditto.
+ * ext/win32ole/depend: ditto.
- * lib/drb/ssl.rb (accept): rescue SSLError. [druby-ja:110]
+Mon Aug 11 22:19:15 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Jan 22 22:35:03 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/win32ole/win32ole_variable.c (folevariable_inspect): refactoring.
- * lib/drb/unix.rb: fail if UNIXFileOwner is set. [druby-ja:111]
+Mon Aug 11 20:47:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Fri Jan 21 23:58:42 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c: separate WIN32OLE_VARIABLE src from
+ win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variable.c: ditto.
+ * ext/win32ole/win32ole_variable.h: ditto.
+ * ext/win32ole/depend: ditto.
- * ext/stringio/stringio.c (strio_set_pos): clear EOF flag.
- [ruby-talk:127511]
+Mon Aug 11 16:17:21 2014 Tony Miller <mcfiredrill@gmail.com>
-Fri Jan 21 20:07:02 2005 Tanaka Akira <akr@m17n.org>
+ * dir.c (rb_dir_exists_p): [DOC] Document that Dir.exists? is
+ deprecated. [ruby-core:64135] [Bug #10102]
- * lib/resolv.rb (Resolv::DNS::Config.resolv): don't raise ResolvError.
- reported by Sam Roberts. [ruby-talk:127133]
+Mon Aug 11 11:26:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 21 16:58:10 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/tempfile.rb: start rdoc parsing inside singleton class
+ definition to include the document there.
+ [ruby-core:64157] [Bug #10105]
- * dir.c (rb_push_glob): should work for NUL delimited patterns.
+Sun Aug 10 12:22:43 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Fri Jan 21 13:58:37 2005 Shugo Maeda <shugo@ruby-lang.org>
+ * ext/win32ole/win32ole_type.c: refactoring.
- * lib/net/imap.rb (u8tou16): fixed typo. fixed: [ruby-list:40546]
- (backported from CVS HEAD)
+Sun Aug 10 10:34:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Jan 21 09:30:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/cgi/session/pstore.rb: separated sample code.
+ * lib/open3.rb: ditto.
- * rubyio.h (rb_eof_error): should mark as NORETURN. (backported
- from CVS HEAD)
+Sun Aug 10 10:03:24 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Jan 21 00:31:36 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/irb/ext/multi-irb.rb: removed commented-out code.
- * ext/syck/rubyext.c (syck_parser_bufsize_set): avoid VC++ warning
- "local variable 'size' used without having been initialized".
+Sat Aug 9 11:02:07 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Jan 20 19:03:24 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/irb.rb: removed commented-out code.
+ * lib/irb/**/*.rb: ditto.
- * ext/extmk.rb (extmake): shouldn't set $extflags on mswin32.
+Sat Aug 9 10:35:30 2014 Laurent Arnoud <laurent@spkdev.net>
- * win32/Makefile.sub (LIBRUBY_SO): should use $DLDOBJS instead of
- $EXTOBJS.
- fixed: [ruby-core:04290] (backported from CVS HEAD)
+ * lib/cmath.rb: fixed indent. [fix GH-696]
+ * lib/drb/ssl.rb: ditto.
+ * lib/irb/**/*.rb: ditto.
-Thu Jan 20 11:42:02 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Aug 9 10:28:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * string.c (rb_str_new4): should propagate taintedness.
+ * test/minitest/test_minitest_unit.rb: removed obsoleted condition
+ for Ruby 1.8.
+ * test/ruby/test_time_tz.rb: ditto.
- * struct.c (rb_struct_set): use original method name, not callee
- name, to retrieve member slot. [ruby-core:04268]
+Sat Aug 9 10:18:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * time.c (time_strftime): protect from format modification from GC
- finalizers.
+ * test/cgi/test_cgi_core.rb: removed obsoleted condition for Ruby 1.8.
+ * test/cgi/test_cgi_header.rb: ditto.
+ * test/cgi/test_cgi_multipart.rb: ditto.
+ * test/cgi/test_cgi_tag_helper.rb: ditto.
-Wed Jan 19 18:06:40 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Aug 9 00:34:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/ipaddr.rb (to_s, test_to_s): too many colons with some cases.
- (backported from CVS HEAD)
+ * ext/win32ole/win32ole.c: separate WIN32OLE_TYPE src from win32ole.c.
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_type.c: ditto.
+ * ext/win32ole/win32ole_type.h: ditto.
+ * ext/win32ole/depend: ditto.
-Wed Jan 19 01:16:30 2005 Tanaka Akira <akr@m17n.org>
+Fri Aug 8 01:53:37 2014 Masaki Matsushita <glass.saga@gmail.com>
- * lib/resolv.rb (Resolv::DNS::Config.parse_resolv_conf): ignore
- domain and search directive without an argument.
- reported by Sam Roberts. [ruby-talk:126781]
+ * lib/securerandom.rb: use OpenSSL::BN for performance improvement.
-Tue Jan 18 15:03:05 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * benchmark/bm_securerandom.rb: benchmark script.
- * lib/webrick/ssl.rb (WEBrick::Config::SSL): the default value
- of :SSLEnable is false.
+Fri Aug 8 17:19:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/webrick/server.rb (WEBrick::Daemon.start): prepared stdio
- don't allow changing its mode.
+ * lib/open-uri.rb: remove needless condition for old ruby version.
+ * test/open-uri/test_open-uri.rb: ditto.
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
- should delete trailing LF from the result of pack("m*").
+Fri Aug 8 16:40:59 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
- - should delete trailing LF from the result of pack("m*").
- - clear Request-Line not to send the response by HTTPServer#run.
+ * lib/irb/init.rb: removed unreachable code.
- * lib/webrick/httputils (WEBrick::HTTPUtils.parse_qvalues):
- refine regexp (and change the name of a local variable).
+Fri Aug 8 16:34:22 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils#escape_path): add
- new method to escape URI path component.
+ * lib/drb/drb.rb: removed unreachable code.
- * lib/webrick/cgi.rb (WEBrick::CGI::Socket#request_line): should
- escape SCRIPT_NAME and PATH_INFO before being parsed as a URI.
+Fri Aug 8 14:33:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/webrick/*, sample/webrick/httpproxy.rb: add new file.
+ * lib/webrick/httpproxy.rb: remove needless condition
+ for old ruby version.
-Mon Jan 17 23:33:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 8 01:07:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (aix): fix typo. [ruby-talk:126401]
+ * parse.y (parser_yylex): fix invalid char in eval, should raise
+ an syntax error too, as well as directly coded.
+ [ruby-core:64243] [Bug #10117]
-Mon Jan 17 07:08:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Aug 7 23:25:29 2014 Masaki Matsushita <glass.saga@gmail.com>
- * ext/readline/readline.c: suppress warnings.
+ * lib/open3.rb: avoid unnecessary write if stdin_data is empty.
- * lib/irb/extend-command.rb (IRB::ContextExtender.def_extend_command):
- ditto.
+Thu Aug 7 21:42:49 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/irb/ext/history.rb (IRB::Context::set_last_value): ditto.
+ * ext/win32ole/win32ole_typelib.c (foletypelib_version): return
+ version string.
- * lib/irb/ext/history.rb (IRB::Context::eval_history): ditto.
+ * test/win32ole/test_win32ole_typelib.rb (test_version): ditto.
- * lib/irb/locale.rb (IRB::Locale::real_load): ditto.
+Thu Aug 7 15:13:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/irb/slex.rb (SLex::Node::create_subnode): remove garbage.
+ * lib/cgi.rb: remove needless condition for old ruby version.
-Mon Jan 17 00:09:42 2005 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Aug 7 06:04:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/uri/common.rb (PORT): typo fix. fixed: [ruby-core:04256]
+ * parse.y (parser_yyerror): preserve source code encoding in
+ syntax error messages. [ruby-core:64228] [Bug #10114]
-Sat Jan 15 14:57:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 6 20:56:02 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ruby.c (proc_options): ignore trailing CRs at the end of short
- options as well as long options. fixed: [ruby-core:04232]
+ * ext/win32ole/win32ole.c: separate src of WIN32OLE_TYPELIB from
+ win32ole.c
-Sat Jan 15 13:35:16 2005 Kouhei Sutou <kou@cozmixng.org>
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_typelib.c: ditto.
+ * ext/win32ole/win32ole_typelib.h: ditto.
+ * ext/win32ole/depend: ditto.
- * lib/rss/rss.rb (RSS::VERSION): 0.1.2 -> 0.1.3.
+Wed Aug 6 20:44:07 2014 Akinori MUSHA <knu@iDaemons.org>
- * lib/rss/rss.rb: accept inheritance. [ruby-talk:126104]
+ * enum.c (enum_one): [DOC] Move enum.one? documentation before the
+ relevant method. Submitted by @vipulnsward. [Fixes GH-687]
+ https://github.com/ruby/ruby/pull/687
-Thu Jan 13 04:48:53 2005 Tanaka Akira <akr@m17n.org>
+Wed Aug 6 20:25:47 2014 Akinori MUSHA <knu@iDaemons.org>
- * io.c (io_fread): don't warn nonblocking behavior by default.
+ * lib/set.rb (Set#replace): Check if an object given is enumerable
+ before clearing self. Reported by yui-knk. [GH-675]
+ https://github.com/ruby/ruby/pull/675
-Wed Jan 12 00:36:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 6 20:07:26 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * object.c (rb_class_superclass): superclass of singleton class also
- should be a singleton class. fixed: [ruby-list:40519]
+ * ext/win32ole/win32ole.c (olerecord_ivar_set): remove rb_str_subseq.
-Tue Jan 11 09:44:40 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Wed Aug 6 19:09:27 2014 Akinori MUSHA <knu@iDaemons.org>
- * numeric.c (Init_Numeric): turn off floating point exceptions
- on bcc32. "1e300".to_f had crashed by overflow.
+ * lib/set.rb (Set): Implement Set#clone by splitting
+ initialize_copy into initialize_dup and initialize_clone.
+ Submitted by yui-knk. [Fixes GH-661]
+ https://github.com/ruby/ruby/pull/661
-Tue Jan 11 03:10:10 2005 Minero Aoki <aamine@loveruby.net>
+Wed Aug 6 18:42:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/fileutils.rb (copy_entry): could not copy symbolic link.
- [ruby-talk:125733]
+ * ext/win32ole/win32ole.c: separate src of WIN32OLERuntimeError
+ from win32ole.c.
- * lib/fileutils.rb (copy_stream): use read/write instead of
- sysread/syswrite.
+ * ext/win32ole/win32ole.h: ditto
+ * ext/win32ole/depend: ditto.
+ * ext/win32ole/win32ole_error.c: ditto.
+ * ext/win32ole/win32ole_error.h: ditto.
-Mon Jan 10 23:08:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Aug 6 04:33:58 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * variable.c (rb_autoload): hide internal data from ruby level.
- fixed: [ruby-dev:25435], [ruby-list:40498]
+ * lib/net/http.rb (Net::HTTP.proxy_uri): use initializer instead
+ of parser to handle IPv6 address. [Bug #9129]
-Mon Jan 10 01:22:55 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Aug 6 04:16:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (rb_data_object_alloc): klass may be NULL.
- [ruby-list:40498]
+ * lib/net/http/requests.rb (Net::HTTP::Options::RESPONSE_HAS_BODY):
+ OPTIONS requests may have response bodies. [Feature #8429]
+ http://tools.ietf.org/html/rfc7231#section-4.3.7
-Sun Jan 9 03:12:58 2005 Tanaka Akira <akr@m17n.org>
+Wed Aug 6 03:18:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (io_fread): warn nonblocking behavior.
- (io_readpartial): new method IO#readpartial.
+ * lib/net/http/generic_request.rb (Net::HTTP::GenericRequest#exec):
+ handle req['host'] in update_uri.
-Sat Jan 8 04:38:47 2005 why the lucky stiff <why@ruby-lang.org>
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#update_uri):
+ use req['host'] if it is explicitly set. Even if URI is given,
+ it is already used for the initial value of req['host'].
+ Therefore overwritten value should be respected. [Bug #10054]
- * lib/yaml.rb: Kernel#y requires an argument.
+Wed Aug 6 03:17:34 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jan 7 21:12:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#update_uri):
+ handle scheme, host, and port to reflect connection to @uri.
- * random.c (rand_init): use ALLOC_N instead of ALLOCA_N
- [ruby-dev:25426]
+ * lib/net/http.rb (Net::HTTP#begin_transport): move trivial handling
+ to Net::HTTP::GenericRequest#update_uri.
-Fri Jan 7 18:03:35 2005 Tanaka Akira <akr@m17n.org>
- * gc.c (mark_locations_array): avoid core dump with -O3.
- [ruby-dev:25424]
+Wed Aug 6 02:16:43 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 6 20:31:07 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/net/http/generic_request.rb
+ (Net::HTTP::GenericRequest#initialize):
+ optimize object allocation.
- * ext/zlib/zlib.c (zstream_end): should return value. (backported
- from CVS HEAD)
+Wed Aug 6 01:16:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 6 19:55:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/uri/generic.rb (URI::Generic#path_query): remove a private method.
- * win32/win32.c (rb_w32_close): didn't close socket handle.
- [ruby-dev:25414]
+Wed Aug 6 01:15:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (rb_w32_open_osfhandle): bcc32's _open_osfhandle
- never set EMFILE.
+ * lib/uri/generic.rb (URI::Generic#normalize!): use String#empty?
-Thu Jan 6 17:14:31 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/uri/generic.rb (URI::Generic#path_query): optimized.
- * random.c (random_seed): O_NONBLOCK isn't defined on some
- platforms. [ruby-dev:25417]
+ * lib/uri/generic.rb (URI::Generic#to_s): optimized.
-Thu Jan 6 13:45:35 2005 Tanaka Akira <akr@m17n.org>
+Wed Aug 6 00:15:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/time.rb: recognize +00:00 and GMT as a localtime.
+ * lib/uri/http.rb (URI::HTTP#request_uri): optimized.
+ decrease object allocation, and ensure always create at least one new
+ object for return value.
-Thu Jan 6 07:58:28 2005 Dave Thomas <dave@pragprog.com>
+Wed Aug 6 03:41:21 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/rdoc/usage.rb (RDoc::RDoc.usage_no_exit): Allow for colons
- in path names on DOS machines. (thanks to Johan Nilsson)
+ * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for
+ hashes emitted by Syck. Github #198
+ * test/psych/test_hash.rb: test for change.
-Wed Jan 5 20:16:32 2005 Tanaka Akira <akr@m17n.org>
+Tue Aug 5 19:27:59 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * random.c (limited_big_rand): didn't work if SIZEOF_BDIGITS == 2.
- [ruby-dev:25408]
+ * ext/win32ole/win32ole.c (ole_invoke): skip VariantClear when
+ argument is VT_RECORD variant.
- * random.c (random_seed): refined.
+Tue Aug 5 15:52:51 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Jan 5 12:49:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gems/bundled_gems: Upgrade to test-unit-3.0.0 and minitest-5.4.0.
- * eval.c (rb_thread_initialize): Thread objects cannot be initialized
- again. fixed: [ruby-core:04067]
+Mon Aug 4 21:50:09 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Wed Jan 5 10:48:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/win32ole/test_win32ole_record.rb: add for WIN32OLE_RECORD
+ test(need .NET Framework 3.5 to run test).
- * dir.c (dir_s_mkdir): win32 special processing doesn't need any
- longer. (backported from CVS HEAD)
+Mon Aug 4 19:49:34 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * win32/win32.[ch] (rb_w32_mkdir): new function. POSIX.1 compatible
- interface. (backported from CVS HEAD)
+ * ext/win32ole/win32ole.c (ole_invoke): call rb_hash_foreach instead
+ of rb_block_call.
- * win32/win32.[ch] (rb_w32_rmdir): new function. (backported from CVS
- HEAD)
+ * ext/win32ole/win32ole.c: add comment for rdoc of WIN32OLE_VARIANT
+ class.
-Wed Jan 5 02:30:11 2005 Tanaka Akira <akr@m17n.org>
+Mon Aug 4 09:12:47 2014 Eric Wong <e@80x24.org>
- * random.c (init_by_array): imported from mt19937ar-cok.tgz.
- (genrand_int32): ditto.
- (genrand_real): replaced with genrand_res53 in mt19937ar-cok.
- (rand_init): support bignum for longer seed.
- (random_seed): generate longer seed.
- (make_mask): new function.
- (limited_rand): ditto.
- (limited_big_rand): ditto.
- (rb_f_rand): call limited_rand and limited_big_rand.
- [ruby-dev:25403]
+ * variable.c: cleanup to use rb_const_lookup
+ [Feature #10107]
-Tue Jan 4 23:25:29 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c: ditto
- * bignum.c (rb_big_rand): should return positive random number.
- [ruby-dev:25401]
+Sun Aug 3 10:55:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 4 11:15:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
+ * include/ruby/encoding.h (rb_check_symbol_cstr): ditto.
- * bignum.c (rb_big_rand): do not use rb_big_modulo to generate
- random bignums. [ruby-dev:25396]
+Sun Aug 3 10:43:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 3 14:01:54 2005 Tanaka Akira <akr@m17n.org>
+ * vm_insnhelper.c (vm_call_method): unusable super class should cause
+ method missing when BasicObject is refined but not been using.
+ [ruby-core:64166] [Bug #10106]
- * random.c (random_seed): don't use /dev/urandom if it is not
- character device.
+Sat Aug 2 23:47:45 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Jan 3 11:37:42 2005 Tanaka Akira <akr@m17n.org>
+ * ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file
+ from win32ole.c
+ * ext/win32ole/win32ole.h: ditto.
+ * ext/win32ole/win32ole_variant_m.c: ditto.
+ * ext/win32ole/win32ole_variant_m.h: ditto.
+ * ext/win32ole/depend: ditto.
+ * ext/.document: ditto.
- * random.c (random_seed): use /dev/urandom if available.
- [ruby-dev:25392]
+Sat Aug 2 14:34:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Jan 3 07:46:42 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/win32ole/win32ole.c: add comments for rdoc.
- * lib/webrick/httpauth/htpasswd.rb (WEBrick::Htpasswd#reload):
- raise NotImplementedError if password is encrypted by digest
- algorithms. This patch is contributed by sheepman. [ruby-list:40467]
+Sat Aug 2 10:26:57 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpauth/digestauth.rb
- (WEBrick::HTTPAuth::DigestAuth#_authenticate): fix digest calculation.
- This patch is contributed by sheepman. [ruby-list:40482]
+ * object.c (rb_obj_itself): new method Object#itself. based on the
+ patch by Rafael Franca in [ruby-core:64156].
+ [EXPERIMENTAL] this method may be renamed due to compatibilities.
+ [ruby-core:44704] [Feature #6373]
- * lib/webrick/{httpauth.rb,httpauth/basicauth.rb,httpproxy.rb}: use
- pack/unpack-template char "m" instead of lib/base64.rb to do base64
- encoding/decoding. fixed: [ruby-dev:25336]
+Fri Aug 1 22:30:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/webrick/test_httpauth.rb: new file.
+ * ext/win32ole/win32ole.c (folerecord_initialize): accept
+ only 2 arguments. The 2nd argument should be WIN32OLE object or
+ WIN32OLE_RECORD object.
-Sat Jan 1 04:20:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Aug 1 20:17:33 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/openssl/ossl_ns_spki.c (ossl_spki_set_challenge): should call
- StringValue before GetSPKI. fixed: [ruby-dev:25359].
+ * ext/win32ole/win32ole.c (ole_variant2val): call
+ folerecord_s_allocate instead of WIN32OLE_RECORD.new.
-Sat Jan 1 01:13:28 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Aug 1 18:39:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * variable.c (rb_autoload): [ruby-dev:25373]
+ * test/date/test_date.rb: remove commented-out code.
+ * test/date/test_date_arith.rb: ditto.
+ * test/date/test_date_attr.rb: ditto.
+ * test/date/test_date_parse.rb: ditto.
-Fri Dec 31 14:10:43 2004 Dave Thomas <dave@pragprog.com>
+Fri Aug 1 16:35:32 2014 Evan Miller <evan@squareup.com>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item): Fix problem
- if heading contains formatting.
+ * numeric.c (flodivmod): all results are NaN if divisor is NaN.
+ [fix GH-692]
-Thu Dec 30 00:41:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Aug 01 07:28:12 2014 Kenta Murata <mrkn@mrkn.jp>
- * eval.c (svalue_to_avalue): [ruby-dev:25366]
+ * ext/bigdecimal/bigdecimal.c: [DOC] Add description of
+ `BigDecimal.new` exceptions. Patched by @joker1007 and
+ @prathamesh-sonpatki [Fixes GH-690]
+ https://github.com/ruby/ruby/pull/690
- * string.c (rb_str_justify): [ruby-dev:25367]
+Thu Jul 31 22:20:12 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Wed Dec 29 11:07:07 2004 Dave Thomas <dave@pragprog.com>
+ * ext/win32ole/win32ole.c: add WIN32OLE_RECORD#inspect.
- * lib/rdoc/generators/template/html/kilmer.rb: Update to use new
- sections.
+Thu Jul 31 20:35:32 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Dec 28 22:31:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32ole/win32ole.c: add
+ WIN32OLE_RECORD#ole_instance_variable_set and
+ WIN32OLE_RECORD#ole_instance_variable_get
- * string.c (rb_str_justify): create buffer string after argument type
- conversion. fixed: [ruby-dev:25341]
+Wed Jul 30 23:28:10 2014 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Dec 28 15:41:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * sprintf.c (rb_str_format): like r47006, get rid of
+ function calls in RSTRING_PTR().
- * ext/nkf/nkf-utf8/nkf.c (reinit): should initialize all static
- variables. fixed: [ruby-list:40445]
+Wed Jul 30 22:10:29 2014 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Dec 28 15:25:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rlimit_resource_type, rlimit_resource_value):
+ get rid of inadvertent dynamic symbol pin-down.
- * ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): second byte is up to
- 0xfe.
+ * re.c (match_backref_number): ditto.
- * ext/nkf/lib/kconv.rb (Kconv#kconv): should handle UTF8 and UTF16
- properly.
+ * signal.c (esignal_init, rb_f_kill, trap_signm): ditto.
-Tue Dec 28 13:35:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c (econv_opts): ditto.
- * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate): ensure
- freeing internal zstreams. fixed: [ruby-dev:25309]
+ * vm_trace.c (symbol2event_flag): ditto.
- * ext/zlib/zlib.c (rb_deflate_init_copy): replace rb_deflate_clone.
+Wed Jul 30 21:29:39 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Dec 28 12:26:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/win32ole/win32ole.c (ole_invoke): pass WIN32OLE_RECORD variant
+ by reference when invoke OLE methods at first.
- * win32/Makefile.sub, win32/setup.mak (RDOCTARGET, install,
- install-nodoc, install-doc): rdoc support for mswin32.
+ * ext/win32ole/win32ole.c (olerecord_set_ivar): release
+ IRecordInfo interface before setting another IRecordInfo interface.
- * win32/configure.bat (--enable-install-doc, --disable-install-doc):
- ditto.
+Wed Jul 30 13:17:35 2014 Koichi Sasada <ko1@atdot.net>
-Mon Dec 27 20:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c: remove unused macros.
- * ext/tcltklib/tcltklib.c: fix SEGV bug when deleting Tk interp
+Tue Jul 29 22:21:37 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tk/lib/multi-tk.rb: ditto
+ * ext/win32ole/win32ole.c (hash2olerec): ignore WIN32OLE_RECORD
+ instance variable if the variable is nil.
-Mon Dec 27 16:55:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jul 29 19:43:27 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
- rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].
+ * ext/win32ole/win32ole.c (folerecord_method_missing): refactoring.
+ divide functionality of folerecord_method_missing into
+ olerecord_ivar_set and olerecord_ivar_get.
-Mon Dec 27 16:29:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jul 28 20:20:08 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * string.c (rb_str_justify): [ruby-dev:25341]
+ * ext/win32ole/win23ole.c (folerecord_method_missing): support
+ setter of member of WIN32OLE_RECORD object.
-Mon Dec 27 15:47:48 2004 Minero Aoki <aamine@loveruby.net>
+Mon Jul 28 06:37:19 2014 Zachary Scott <e@zzak.io>
- * test/fileutils/fileasserts.rb: sync with HEAD.
+ * vm_eval.c: [DOC] Fix rdoc formatting of patch from [Bug #9551]
- * test/fileutils/test_fileutils.rb: ditto.
+Mon Jul 28 06:34:43 2014 Zachary Scott <e@zzak.io>
- * test/fileutils/test_nowrite.rb: ditto.
+ * vm_eval.c: [DOC] [Bug #9551] Improve clarity of Kernel::catch
+ documentation, patch by Jesse Sielaff.
-Mon Dec 27 15:21:07 2004 Minero Aoki <aamine@loveruby.net>
+Mon Jul 28 06:24:54 2014 Zachary Scott <e@zzak.io>
- * lib/fileutils.rb (mv): should raise error when moving a
- directory to the (empty) directory. [ruby-talk:124368]
- (backport from HEAD 1.48)
+ * lib/uri/common.rb: [DOC] [Bug #9563] Recommend using URI.escape
+ before parsing a uri to avoid invalid characters. Reported by
+ Evgeniy Serykh.
- * lib/fileutils.rb (mv): wrongly did not overwrite file on Win32
- platforms. (backport from HEAD 1.48)
+Mon Jul 28 05:55:56 2014 Zachary Scott <e@zzak.io>
-Sat Dec 25 11:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * time.c: [DOC] Clarify %Y in strftime, which can accept any digits
+ and will output at least 4 digits as the year. Reported by Yury
+ Trofimenko [Bug #10049]
- * stable version 1.8.2 released.
+ * lib/time.rb: ditto
-Sat Dec 25 04:23:49 2004 Minero Aoki <aamine@loveruby.net>
+Mon Jul 28 05:32:06 2014 Zachary Scott <e@zzak.io>
- * lib/fileutils.rb (mkdir, mkdir_p): should ensure directory
- permission. (backportted from HEAD, 1.47)
+ * lib/uri/common.rb: [DOC] [Bug #10075] Clarify how URI.join arguments
+ are handled by RFC3986, originally reported by John Feminella.
- * lib/fileutils.rb (traverse, remove_dir): untaint trasted
- objects. (backportted from HEAD, 1.46)
+Mon Jul 28 05:21:41 2014 Zachary Scott <e@zzak.io>
-Sat Dec 25 01:28:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * file.c: [DOC] Clarify how File.file? handles symbolic links. Also
+ cleaned up the rdoc style for this method, more to follow.
+ Originally reported by Michael Renner [Bug #10067]
- * io.c: cancel io_reopen() change on Dec. 24th.
+Mon Jul 28 05:12:22 2014 Zachary Scott <e@zzak.io>
- * dln.c: use <dlfcn.h> for NetBSD. [ruby-dev:25313]
+ * time.c: [DOC] Remove dead link and old bug report, which hasn't been
+ reproduced in a few years. Reported by Federico Builes [Bug #10071]
- * io.c (rb_f_select): IO list could be altered. [ruby-dev:25312]
+Mon Jul 28 04:39:58 2014 Zachary Scott <e@zzak.io>
-Fri Dec 24 23:51:48 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/zlib/zlib.c: [DOC] Remove default value of Zlib constants, as
+ they may change in the implementation without notice. Patched by
+ @robin850 [Fixes GH-682] https://github.com/ruby/ruby/pull/682
- * bcc32/Makefile.sub: bcc32 should use RTL dll (backport from HEAD)
- [ruby-dev:25306]
+Mon Jul 28 04:35:35 2014 Zachary Scott <e@zzak.io>
- * win32/win32.[ch]: ditto.
+ * ext/openssl/ossl_hmac.c: Fix NO_HMAC warning [Fixes GH-665]
+ Patched by @vipulnsward https://github.com/ruby/ruby/pull/665
-Fri Dec 24 23:27:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Jul 27 19:49:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/tk/image.rb: TkPhotoImage#cget bug fix
+ * lib/cgi/core.rb: remove unused variables.
+ * lib/erb.rb: ditto.
+ * lib/mkmf.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/optparse/version.rb: ditto.
+ * lib/prime.rb: ditto.
+ * lib/racc/parser.rb: ditto.
+ * lib/rexml/document.rb: ditto.
+ * lib/rexml/dtd/dtd.rb: ditto.
+ * lib/rexml/element.rb: ditto.
+ * lib/rexml/functions.rb: ditto.
+ * lib/rexml/parsers/xpathparser.rb: ditto.
-Fri Dec 24 18:39:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun Jul 27 05:11:21 2014 Zachary Scott <e@zzak.io>
- * win32/win32.[ch]: failed to compile on bcc32 (and probably wince)
- [ruby-dev:25306]
+ * lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane
+ Fixes documenting-ruby/ruby#37
+ https://github.com/documenting-ruby/ruby/pull/37
-Fri Dec 24 02:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 27 02:41:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * io.c (io_reopen, rb_io_reopen): prohibit to change access mode for
- special IO ports. [ruby-dev:25225]
+ * lib/shell/command-processor.rb: remove unused variable.
+ * lib/shell/system-command.rb: ditto.
+ * lib/tmpdir.rb: ditto.
+ * lib/uri/generic.rb: ditto.
-Fri Dec 24 02:22:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 27 02:08:31 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/syck/rubyext.c (rb_syck_io_str_read): [ruby-core:03973]
+ * lib/weakref.rb: split executable code into sample directory.
+ * sample/weakref.rb: ditto.
- * ext/syck/rubyext.c (syck_loader_transfer): check type conversion.
+Sun Jul 27 02:06:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/syck/rubyext.c (syck_parser_assign_io, rb_new_syck_node): duck
- typing.
+ * lib/delegate.rb: split executable code into sample directory.
+ * sample/delegate.rb: ditto.
- * ext/syck/rubyext.c (syck_parser_s_alloc, syck_parser_initialize):
- allocation framework.
+Sun Jul 27 01:46:34 2014 Zachary Scott <e@zzak.io>
- * ext/syck/rubyext.c (syck_emitter_s_alloc, syck_emitter_initialize):
- ditto.
+ * proc.c (method_super_method): [DOC] Method#super_method
-Fri Dec 24 01:21:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Jul 27 01:22:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkextlib/blt.rb: add BLT extension support
+ * proc.c (method_super_method): new method Method#super_method,
+ which returns a method object of the method to be called by
+ `super` in the receiver method object.
+ [ruby-core:62202] [Feature #9781]
- * ext/tk/lib/tkextlib/blt/*.rb: ditto
+Sat Jul 26 17:22:14 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/tk/lib/tkextlib/blt/tile/*.rb: ditto
+ * ext/objspace/objspace_dump.c (dump_append): avoid fflush.
-Thu Dec 23 23:36:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ because dump_append_string_value() iterates over each chars,
+ fflush()-ing here effectively issues system calls on every single
+ bytes exist in a ruby process.
- * process.c (proc_setgroups): check if the argument lenght is
- modified. fixed: [ruby-dev:25285]
+Sat Jul 26 16:55:18 2014 Eric Wong <e@80x24.org>
-Thu Dec 23 13:13:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * iseq.h (struct iseq_compile_data_storage): reduce overhead
+ to 16 bytes (from 32) on 64-bit
- * ext/tcltklib/tcltklib.c: define TclTkLib::COMPILE_INFO and
- RELEASE_DATE
+Sat Jul 26 16:28:06 2014 Eric Wong <e@80x24.org>
- * ext/tcltklib/extconf.rb: ditto
+ * vm_core.h (struct rb_iseq_struct): reduce to 280 bytes
+ (from 288 bytes) on 64-bit
- * ext/tk/tkutil.c: define TkUtil::RELEASE_DATE
+Sat Jul 26 06:44:43 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tk.rb: define Tk::RELEASE_DATE
+ * parse.y (struct parse_params): shrink to 320 to 304 bytes on 64-bit
-Thu Dec 23 09:38:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jul 26 05:58:35 2014 Eric Wong <e@80x24.org>
- * io.c (io_reopen): restore exact mode. fixed: [ruby-core:04003]
+ * include/ruby/ruby.h (ZALLOC, ZALLOC_N): implement
+ (Data_Make_Struct, TypedData_Make_Struct):
+ ZALLOC replaces ALLOC+memset
+ [ruby-core:63951][Feature #10082]
+ * compile.c (iseq_seq_sequence): ZALLOC_N replaces ALLOC_N+MEMZERO
+ * cont.c (fiber_t_alloc): ZALLOC replaces ALLOC+MEMZERO
+ * io.c (rb_io_reopen): ditto
+ * iseq.c (prepare_iseq_build): ditto
+ * parse.y (new_args_tail_gen, parser_new, ripper_s_allocate): ditto
+ * re.c (match_alloc): ditto
+ * variable.c (rb_const_set): ditto
+ * ext/socket/raddrinfo.c (get_addrinfo): ditto
+ * ext/strscan/strscan.c (strscan_s_allocate): ditto
+ * gc.c (rb_objspace_alloc): calloc replaces malloc+MEMZERO
-Thu Dec 23 00:16:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jul 26 05:54:54 2014 Eric Wong <e@80x24.org>
- * configure.in (bsdi): use $(CC) for LDSHARED. fixed [ruby-dev:25270]
+ * symbol.c (dsymbol_check): remove unneeded semi-colon
-Wed Dec 22 11:14:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 25 14:07:27 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_io_mode_modenum): replace O_ACCMODE with O_RDWR.
- fixed: [ruby-dev:25273]
+ * gc.c: change objspace::rgengc::parent_object_is_old (boolean)
+ to objspace::rgengc::parent_object (VALUE).
+ Use Qfalse or RVALUE pointer instead of FALSE and TRUE.
-Wed Dec 22 08:34:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_marks_body): should clear parent_object just before
+ gc_mark_roots() because there are no parents objects
+ for root objects.
- * ext/dl/sym.c (rb_dlsym_initialize): extract internal pointers after
- all argument conversion. fixed: [ruby-dev:25271]
+Fri Jul 25 13:45:39 2014 Koichi Sasada <ko1@atdot.net>
-Wed Dec 22 00:08:01 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * gc.c (rb_gc_writebarrier_remember_promoted): should remember only
+ OLD objects on RGENGC_AGE2_PROMOTION.
- * lib/soap/*, test/soap/*, sample/soap/authheader/*: eval cleanup.
+Fri Jul 25 13:42:02 2014 Koichi Sasada <ko1@atdot.net>
-Tue Dec 21 22:07:33 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * gc.c (gc_mark_stacked_objects): fix error message.
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
- ossl_asn1_decode_all): temporary value should be marked volatile.
+Fri Jul 25 13:18:00 2014 Will Farrington <wfarrington@digitalocean.com>
-Tue Dec 21 14:40:02 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/socket/socket.c (sock_gethostname): Use NI_MAXHOST to support
+ hostnames longer than 64 characters if the system supports it.
+ [fixes GH-683]
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
- ossl_asn1_decode_all): use rb_str_new4 to avoid SEGV.
- fix [ruby-dev:25261]
+Fri Jul 25 12:21:11 2014 Santiago Pastorino <santiago@wyeworks.com>
- * test/openssl/test_asn1.rb: add tests for OpenSSL::ASN1.
+ * compile.c (defined_expr): make the condition if the receiver
+ is explicit or implicit cleaner. [fix GH-681]
-Tue Dec 21 12:22:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 25 03:53:52 2014 Eric Hodel <drbrain@segment7.net>
- * io.c (io_reopen): keep duplex pipe in correct mode for exception
- safeness. fixed: [ruby-dev:25152]
+ * doc/keywords.rdoc: [DOC] Describe each keyword.
-Tue Dec 21 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Jul 24 22:40:24 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/tk/lib/tk/grid.rb: rescue bug of 'grid configure' on Tcl/Tk8.3-
+ * ext/win32ole/win32ole.c (Init_win32ole): add WIN32OLE_RECORD#initialize
+ method.
-Tue Dec 21 00:53:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c (ole_val2variant): convert WIN32OLE_RECORD
+ object to VT_RECORD variant.
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse): [ruby-dev:25261]
+Thu Jul 24 20:10:59 2014 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
+ * gc.c: fix major GC flags.
+ * add GPR_FLAG_MAJOR_BY_FORCE, which indicates
+ major GC by METHOD, CAPI and so on (see GC_BY).
+ * remove GPR_FLAG_MAJOR_BY_RESCAN because not used.
+ * remove GPR_FLAG_MAJOR_BY_STRESS, use FORCE instead.
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode_all): ditto.
+ * test/ruby/test_gc.rb: catch up.
-Mon Dec 20 23:22:26 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Jul 24 15:55:02 2014 Naohisa Goto <ngotogenome@gmail.com>
- * added files:
- * lib/soap/mapping/wsdl*.rb
- * lib/wsdl/soap/element.rb
- * lib/wsdl/xmlSchema/simpleContent.rb
+ * include/ruby/io.h (struct rb_io_buffer_t): PACKED_STRUCT should not
+ be used for platform-specific optimization. PACKED_STRUCT_UNALIGNED
+ should be used. [ruby-core:63988] [Bug #10088]
- * modified files:
- * lib/soap/*
- * lib/wsdl/*
- * lib/xsd/*
- * test/soap/*
- * test/wsdl/*
- * test/xsd/*
- * sample/soap/*
- * sample/sdl/*
+Thu Jul 24 04:42:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * summary
- * imported from the soap4r repository. Version: 1.5.3-ruby1.8.2
+ * lib/benchmark.rb: split executable code into sample directory.
+ * sample/benchmark.rb: ditto.
- * added several XSD basetype support: nonPositiveInteger,
- negativeInteger, nonNegativeInteger, unsignedLong, unsignedInt,
- unsignedShort, unsignedByte, positiveInteger
+Thu Jul 24 04:36:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * HTTP client connection/send/receive timeout support.
+ * lib/tempfile.rb: split executable code into sample directory.
+ * sample/tempfile.rb: ditto.
- * HTTP client/server gzipped content encoding support.
+Thu Jul 24 04:29:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * improved WSDL schema definition support; still is far from
- complete, but is making step by step improovement.
+ * lib/pstore.rb: split executable code into sample directory.
+ * sample/pstore.rb: ditto.
-Mon Dec 20 22:56:39 2004 Tanaka Akira <akr@m17n.org>
+Wed Jul 23 23:50:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (stack_end_address): gcc noinline attribute is available since
- gcc-3.1.
+ * include/ruby/defines.h, siphash.c, st.c (UNALIGNED_WORD_ACCESS):
+ add PowerPC64 too, which is capable to access unaligned words.
+ patched by Gustavo Frederico Temple Pedrosa in [ruby-core:63937].
+ [Feature #10081]
-Mon Dec 20 14:07:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): ditto.
- * ext/tk/lib/multi-tk.rb: supports new features of Tcl/Tk8.5a2
+Wed Jul 23 04:04:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/tk/clock.rb: ditto
+ * lib/drb/extserv.rb: remove duplicate code with sample directory.
+ contributed from @vipulnsward. [fix GH-679]
- * ext/tk/lib/tk/text.rb: ditto
+Tue Jul 22 12:56:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/panedwindow.rb: ditto
+ * string.c (rb_str_count): fix wrong single-byte optimization.
+ 7bit ascii can be a trailing byte in Shift_JIS.
+ [ruby-dev:48442] [Bug #10078]
-Mon Dec 20 12:47:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Jul 22 01:48:38 2014 Eric Wong <e@80x24.org>
- * ext/openssl/lib/net/https.rb,protocols.rb,telnets.rb: delete
- doc and code about SSLContext#{key_file,cert_file}.
- fixed: [ruby-dev:25243]
+ * include/ruby/io.h (rb_io_buffer_t): fix packing on gcc
+ r46892 caused packing to be a no-op on gcc (4.7.2-5, Debian)
+ [Bug #10079][ruby-core:63912]
-Mon Dec 20 12:42:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 21 15:55:42 2014 fuji70 <fujifuji70@gmail.com>
- * io.c (io_fwrite): workaround for MSVCRT's bug.
- fixed: [ruby-core:03982]
+ * lib/optparse.rb (getopts): print default values and descriptions
+ in the help message. [fix GH-676]
-Mon Dec 20 11:21:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 20 14:26:27 2014 Eric Wong <e@80x24.org>
- * io.c (rb_io_eof): check if closed before clearerr().
- fixed: [ruby-dev:25251]
+ * vm_core.h (rb_proc_t): reduce to 64 bytes from 72 on 64-bit
-Mon Dec 20 03:30:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 20 13:50:34 2014 Eric Wong <e@80x24.org>
- * lib/cgi/session.rb (CGI::Session#initialize): empty session id was
- used if request had no session key. fixed: [ruby-core:03981]
+ * transcode.c (rb_econv_t): reduce to 184 bytes from 200 on 64-bit
-Mon Dec 20 01:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun Jul 20 12:44:23 2014 Eric Wong <e@80x24.org>
- * struct.c (make_struct): [ruby-dev:25249]
+ * include/ruby/io.h (rb_io_buffer_t): pack structure
+ Reduces rb_io_t from 200 to 192 bytes, allowing rb_io_t to
+ occupy one less cache line.
+ [Feature #10050]
-Mon Dec 20 00:28:20 2004 Kouhei Sutou <kou@cozmixng.org>
+Sun Jul 20 12:41:53 2014 Eric Wong <e@80x24.org>
- * lib/rexml/encodings/SHIFT-JIS.rb: backported from CVS HEAD.
+ * include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit
+ This puts us within 8 bytes of being three cache lines instead of
+ four lines on x86-64. This breaks the ABI.
+ [Feature #10050]
- * lib/rexml/encodings/SHIFT_JIS.rb: ditto.
+Sun Jul 20 12:36:46 2014 Eric Wong <e@80x24.org>
-Sun Dec 19 17:19:48 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * include/ruby/oniguruma.h (struct re_pattern_buffer): shrink to 448
+ bytes from 464 bytes on 64-bit. This breaks the ABI.
+ [Feature #10034]
- * ext/openssl/ossl_x509store.c
- (ossl_x509store_set_time): add OpenSSL::X509::Store#time=.
- (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=.
+Sun Jul 20 01:06:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/openssl/ossl_x509store.rb: test certificate validity times.
+ * ext/openssl/ossl.c: use encryptor instead of encrypter in doc.
+ contributed from @vipulnsward. [fix GH-663]
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): add optional
- second argument to specify the output format (see also
- X509_NAME_print_ex).
+Sun Jul 20 00:32:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509name.c (ossl_x509name_init): new constants:
- OpenSSL::X509::Name::COMPAT, OpenSSL::X509::Name::RFC2253,
- OpenSSL::X509::ONELINE, OpenSSL::X509::MULTILINE.
+ * io.c (rb_io_initialize): [DOC] fix rdoc of append mode. it does
+ not move the pointer at open. [ruby-core:63747] [Bug #10039]
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name::RFC2253DN):
- new module to provide the parse for RFC2253 DN format.
+Sat Jul 19 12:40:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name.parse_rfc2253):
- new method to parse RFC2253 DN format.
+ * compile.c (iseq_compile_each): allow to access private attribute
+ reader in op_assign. [ruby-core:63817] [Bug #10060]
- * test/openssl/ossl_x509name.rb: add tests about RFC2253 DN.
+Sat Jul 19 11:56:36 2014 Grey Baker <greysteil@gmail.com>
- * text/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
- while EADDRINUSE is raised.
+ * lib/time.rb (Time#apply_offset): Guards against a `nil` return
+ value from `Time.month_days` when offsetting date. Out of range
+ values are then caught when `Time.utc` is called (as usual).
- * all changes in this entry are backport from 1.9.
+ Previously a `nil` return value from `Time.month_days` would
+ have the `<` operator called on it, and raise `NoMethodError`.
+ [fix GH-667]
-Sun Dec 19 17:24:59 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/parser/changelog.rb (RDoc#parse_entries): fix dirty hack.
- * configure.in (enable_rpath): use rpath flag to embed the library
- path into extensions on ELF environment. [ruby-dev:25035]
+Sat Jul 19 06:19:01 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sun Dec 19 11:01:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/win32ole/win32ole.c: refactoring.
- * lib/test/unit.rb: use standalone runner for -e.
+Fri Jul 18 22:34:41 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner#options): accept
- multiple -p and -x options.
+ * ext/win32ole/win32ole.c (folevariant_initialize): WIN32OLE_VARIANT
+ does not support VT_RECORD. VT_RECORD should be supported in
+ WIN32OLE_RECORD.
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#recursive_collect):
+ * test/win32ole/test_win32ole_variant.rb (test_s_new_vt_record_exc):
ditto.
-Sat Dec 18 16:36:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate):
- disallow interrupt by type conversion. fixed: [ruby-dev:25226]
-
-Sat Dec 18 15:16:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/webrick/httpauth.rb,
- lib/webrick/httpauth/{basicauth.rb,digestauth.rb}: use
- pack/unpack-template char "m" instead of lib/base64.rb to do base64
- encoding/decoding.
-
-Sat Dec 18 10:51:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (dir_open_dir): new function. [ruby-dev:25242]
-
-Fri Dec 17 18:07:01 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/readline/test_readline.rb: fix for BSD. Thanks, GOTOU Yuuzou.
- fixed: [ruby-dev:25218]
-
-Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fix bug on setting up system encoding
-
- * ext/tk/lib/tk/event.rb: fix error on require process
-
- * ext/tk/lib/tk/font.rb: fix abnormal termination error on Windows
-
- * ext/tk/lib/tk/virtevent.rb: TkVirtualEvent::PreDefVirtEvent.new()
- accepts event-sequence arguments
-
- * ext/tk/lib/tk/text.rb: fail to dump embedded images
-
- * ext/tk/lib/tk/text.rb: tag_nextrange and tag_prevrange returns wrong
- types of values
-
- * ext/tk/lib/tk/texttag.rb: nextrange and prevrange returns wrong
- types of values
-
- * ext/tk/lib/tk/text.rb: add TkText::IndexModMethods module and
- TkText::IndexString class to treat text index modifiers
-
- * ext/tk/lib/tk/texttag.rb: use TkText::IndexModMethods module
-
- * ext/tk/lib/tk/textmark.rb: ditto
-
- * ext/tk/lib/tk/textimage.rb: ditto
-
- * ext/tk/lib/tk/textwindow.rb: ditto
-
- * ext/tk/lib/tk/textimage.rb: wrong gravity of text mark for embedded
- image
-
- * ext/tk/lib/tk/textwindow.rb: wrong gravity of text mark for
- embedded window
-
-Fri Dec 17 13:50:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
-
- * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines
- for VMS port are added.
-
- * eval.c (ruby_init): change to call VMS private intialization routine.
-
-Fri Dec 17 13:33:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/cgi/session.rb (CGI::Session#initialize): control adding
- session_id hidden fields. fixed: [ruby-talk:123850]
-
-Thu Dec 16 23:25:25 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb, lib/drb/ssl.rb: backported from CVS HEAD.
- [druby-ja:101]
-
- * test/drb/test_drb.rb: adjust and reduce sleep (backported from
- CVS HEAD.)
-
-Thu Dec 16 18:44:58 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): should wait
- for reading request till data arrive. [ruby-talk:121068]
-
- * lib/webrick/server.rb (WEBrick::GenericServer#start_thread):
- should log about all accepted socket. [ruby-core:03962]
-
- * lib/webrick/accesslog.rb (WEBrick::AccessLog#setup_params):
- "%%" and "%u" are supported. [webricken:135]
-
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#check_filename):
- :NondisclosureName is acceptable if it is Enumerable.
-
- * lib/webrick/config.rb (WEBrick::Config::FileHandler):
- default value of :NondisclosureName is [".ht*", "*~"].
-
-Thu Dec 16 18:36:52 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.c (ossl_raise): refine message format.
-
-Thu Dec 16 16:29:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/sample/demos-en/widget: modify version check for
- supporting features
-
-Thu Dec 16 16:03:50 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/bindtag.rb: bug fix [ruby-talk: 123667]
-
- * ext/tk/lib/tk/timer.rb: accept :idle for the interval argument
-
- * ext/tk/lib/tk.rb: add TkComm._callback_entry?()
-
- * ext/tk/lib/multi-tk.rb: add MultiTkIp.cb_entry_class
-
- * ext/tk/lib/tk/canvas.rb: use TkComm._callback_entry?()
-
- * ext/tk/lib/tk/canvastag.rb: ditto
-
- * ext/tk/lib/tk/dialog.rb: ditto
-
- * ext/tk/lib/tk/optiondb.rb: ditto
-
- * ext/tk/lib/tk/text.rb: ditto
-
- * ext/tk/lib/tk/texttag.rb: ditto
-
- * ext/tk/lib/tk/textwindow.rb: ditto
-
- * ext/tk/lib/tk/timer.rb: ditto
-
- * ext/tk/lib/tk/validation.rb: ditto
-
- * ext/tk/lib/tkextlib/*: ditto
-
-Thu Dec 16 03:14:28 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (basic_encode): return value of pack('m') may
- include multiple CR/LFs. Backported from main trunk (rev 1.112).
- [ruby-dev:25212]
-
-Thu Dec 16 00:33:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (Init_Hash): remove custom "hash" and "eql?".
-
-Wed Dec 15 18:57:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207]
-
-Wed Dec 15 18:48:42 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/curses/curses.c (window_subwin): call NUM2INT() before
- GetWINDOW(). (backported from CVS HEAD)
-
-Wed Dec 15 17:03:50 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Jul 18 19:54:03 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
- isatty because it never sets errno. (backported from CVS HEAD)
+ * ext/win32ole/win32ole.c (folevariant_initialize): remove unnecessary
+ code.
-Wed Dec 15 15:39:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jul 18 19:11:03 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): avoid SEGV
- (rollback the previous commit).
+ * lib/matrix/eigenvalue_decomposition: Style fix
+ Patch by Gogo Tanaka [#10058]
-Wed Dec 15 16:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jul 18 19:03:53 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * object.c (rb_obj_id_obsolete): warn always.
+ * lib/matrix.rb: Avoid using `and`.
+ Patch by gogo tanaka [#10058]
- * eval.c (rb_enable_super): ditto.
+Fri Jul 18 17:41:54 2014 GoGo tanaka <qlli.illb@gmail.com>
-Wed Dec 15 15:31:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/matrix/test_matrix.rb: Add tests for Matrix class.
+ [Feature #10057][ruby-core:63809]
- * lib/set.rb (Set#==): [ruby-dev:25206]
+Fri Jul 18 10:14:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Dec 15 14:22:10 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/fileutils.rb: added missing options of FileUtils.touch by @Domon.
+ [fix GH-669]
- * win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
- fixed: [ruby-core:03959]
+Thu Jul 17 19:57:27 2014 Herwin <herwin@quarantainenet.nl>
-Wed Dec 15 10:30:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/thread/thread.c (rb_szqueue_push): add optional parameter,
+ non_block defaulted to false. [ruby-core:63794] [Feature #10052]
- * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198]
+Wed Jul 16 23:01:43 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Tue Dec 14 17:10:09 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/win32ole/win32ole.c (ole_variant2val): support array of
+ VT_RECORD variant.
- * win32/win32.c (rb_w32_close): need to reset osfhnd().
+Wed Jul 16 20:21:49 2014 Naohisa Goto <ngotogenome@gmail.com>
-Tue Dec 14 14:03:57 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm_core.h (struct rb_iseq_struct): stack_max is changed to int
+ because all calculations related to stack_max in compile.c
+ (iseq_set_sequence) and vm_insnhelper.c (vm_push_frame) are
+ conducted by using int. This partly reverts r23945.
+ * vm_insnhelper.c (vm_push_frame): ditto. This reverts r42401.
- * ext/openssl/ossl.c (ossl_raise): avoid buffer overrun.
- [ruby-dev:25187]
+Wed Jul 16 19:55:32 2014 Naohisa Goto <ngotogenome@gmail.com>
-Tue Dec 14 12:36:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_core.h (struct rb_iseq_struct): temporal workaround of [Bug 10037].
+ Add padding on big-endian 64-bit architecture (e.g. sparc64).
- * lib/cgi/session.rb (CGI::Session::initialize): generate new
- session if given session_id does not exist. [ruby-list:40368]
+Wed Jul 16 19:32:23 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Mon Dec 13 18:13:52 2004 Tanaka Akira <akr@m17n.org>
+ * ext/win32ole/win32ole.c (fole_record_method_missing): call
+ rb_hash_fetch instead of rb_hash_aref.
- * gc.c (stack_end_address): new function to obtain stack end address.
- stack_end_address calls __builtin_frame_address(0) to obtain the
- frame pointer of a stack frame of stack_end_address. The address
- is the stack pointer of the caller's stack frame.
- (SET_STACK_END): use stack_end_address.
- This makes the conservative garbage collector to scan a stack frame
- of the garbage_collect function itself. This is required because
- callee-save registers may be stored in the frame.
- [ruby-dev:25158]
+Wed Jul 16 18:08:47 2014 Koichi Sasada <ko1@atdot.net>
-Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>
+ * iseq.c (rb_iseq_defined_string): use rb_gc_mark_object() instead of
+ marking from vm_mark().
- * lib/pathname.rb (cleanpath_aggressive): make it private.
- (cleanpath_conservative): ditto.
- Suggested by Daniel Berger. [ruby-core:3914]
+ * vm.c (rb_vm_mark): ditto.
-Sun Dec 12 20:06:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed Jul 16 18:03:50 2014 Koichi Sasada <ko1@atdot.net>
- * lib/drb/drb.rb: backported from CVS HEAD.
+ * gc.c (gc_mark_roots): call rb_vm_mark directly.
-Sun Dec 12 10:35:10 2004 Dave Thomas <dave@pragprog.com>
+ * vm.c: remove mark function for RubyVM object because
+ RubyVM object marked manually.
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Don't
- show an accessor's r/w flag if none was specified
+Wed Jul 16 12:25:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 12 10:14:03 2004 Dave Thomas <dave@pragprog.com>
+ * regcomp.c: Merge Onigmo 5.14.1 25a8a69fc05ae3b56a09.
+ this includes Support for Unicode 7.0 [Bug #9092].
- * lib/rdoc/rdoc.rb (RDoc::RDoc::parse_files): Never exclude files
- explicitly given on the command line.
+Tue Jul 15 23:59:27 2014 Jared Jennings <jared.jennings.ctr@us.af.mil>
-Sun Dec 11 23:54:07 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/digest: make built-in digest function implementations
+ indicate success or failure of init and final functions.
+ [ruby-core:61614] [Bug #9659]
- * ext/tk/*: update to support libraries in ActiveTcl8.4.12.0
- (see ext/tk/ChangeLog.tkextlib).
+ * ext/digest/digest.c: expect digest init and finish functions to
+ indicate success or failure; raise exception on failure.
+ [ruby-core:61614] [Bug #9659]
- * ext/tk/sample/scrollframe.rb: add a new sample.
+Tue Jul 15 20:31:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Dec 11 20:12:21 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/win32ole/win32ole.c: modify document for WIN32OLE_RECORD.
- * lib/drb/drb.rb: add DRbRemoteError. [ruby-list:40348],
- [ruby-list:40390]
+Tue Jul 15 12:42:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * test/drb/drbtest.rb: ditto.
+ * defs/default_gems: change version definition file of rake.
- * test/drb/ut_drb.rb: ditto.
+Tue Jul 15 12:00:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Dec 11 15:38:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rake.rb, lib/rake/*.rb: Upgrade to rake-10.3.2
+ [fix GH-668]
+ * test/rake/*.rb: ditto.
- * lib/jcode.rb (String::succ): [ruby-dev:25156]
+Mon Jul 14 19:14:51 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Dec 11 12:41:55 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/win32ole/win32ole.c: modify WIN32OLE class document and
+ add comment for constants of WIN32OLE.
- * eval.c (run_trap_eval): prototype; avoid VC++ warnings.
+Mon Jul 14 16:38:45 2014 Eric Wong <e@80x24.org>
- * ext/socket/getaddrinfo.c: fix typo. fixed: [ruby-core:03947]
+ * vm_core.h (struct rb_iseq_struct): reduce to 288 bytes
+ on x86-64 (from 296 bytes)
- * win32/win32.c: need to include dln.h.
+Mon Jul 14 16:07:25 2014 Eric Wong <e@80x24.org>
-Sat Dec 11 00:10:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * iseq.h (struct iseq_catch_table_entry): shrink to 32 bytes
+ on x86-64 (from 48 bytes)
- * io.c (io_reopen): [ruby-dev:25150]
+Mon Jul 14 16:04:41 2014 Eric Wong <e@80x24.org>
-Fri Dec 10 08:39:27 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.h (struct iseq_catch_table): new flexible array struct
+ (iseq_catch_table_bytes): allocated size function
+ * vm_core.h (struct rb_iseq_struct): update catch_table member
+ This reduces the struct from 304 to 296 bytes on x86-64.
+ * compile.c (iseq_set_exception_table): update for struct changes
+ * iseq.c (iseq_free): ditto
+ * iseq.c (iseq_memsize): ditto
+ * iseq.c (rb_iseq_disasm): ditto
+ * iseq.c (iseq_data_to_ary): ditto
+ * iseq.c (rb_iseq_build_for_ruby2cext): ditto (untested)
+ * vm.c (vm_exec): ditto
+ * vm_core.h (struct rb_iseq_struct): ditto
+ * vm_insnhelper.c (vm_throw): ditto
- * ext/socket/socket.c (sock_listen): get OpenFile just before calling
- listen(2). fixed: [ruby-dev:25149]
+Sun Jul 13 17:49:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Dec 9 17:00:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
+ * ext/openssl/ossl_cipher.c: Fix call to ciphers class method and
+ spell out `encryption` by @vipulnsward [fix GH-664]
- * ext/socket/socket.c, ext/socket/getaddrinfo.c: port to VMS
-
-Thu Dec 9 16:31:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/sdbm/init.c (GetDBM): typo.
-
-Thu Dec 9 16:05:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
-
- * defines.h: change path of vms.h
- * vms/vms.h: delete reference for snprintf()
- * vms/config.h: new file
- * vms/config.h_in: deleted
-
-Thu Dec 9 14:38:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_inspect): escape # which starts an expression
- substitution. fixed: [ruby-core:03922]
-
- * string.c (rb_str_dump): not escape # which isn't a substitution.
-
-Thu Dec 9 10:54:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/dbm/dbm.c (fdbm_select): [ruby-dev:25132]
+Sun Jul 13 17:31:51 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+ * ext/gdbm/gdbm.c: fix wrong arguments in GetDBM2 macro.
* ext/sdbm/init.c: ditto.
- * ext/gdbm/gdbm.c: ditto.
-
-Thu Dec 9 03:08:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (ip_init): set root-win title to "ruby" when
- the running script is '-e one-liner' or '-' (stdin).
-
- * ext/tcltklib/extconf.rb: add find_library("#{lib}#{ver}",..) for
- stub libs
-
- * ext/tk/lib/tk/textmark.rb: TkTextMarkCurrent and TkTextMarkAnchor
- have a wrong parent class.
-
- * ext/tk/lib/tk/dialog.rb: rename TkDialog2 --> TkDialogObj and
- TkWarning2 --> TkWarningObj (old names are changed to alias names)
-
- * ext/tk/lib/tk/dialog.rb: bug fix of treatment of 'prev_command'
- option and hashes for configuration
-
- * ext/tk/lib/tk/dialog.rb: add TkDialogObj#name to return the
- button name
-
- * ext/tk/lib/tk/radiobutton.rb: rename enbugged method value() ==>
- get_value() and value=(val) ==> set_value(val).
-
- * ext/tk/lib/tk/menu.rb: add TkMenu.new_menuspec
-
- * ext/tk/lib/tk/menu.rb: add alias (TkMenuButton = TkMenubutton,
- TkOptionMenuButton = TkOptionMenubutton)
-
- * ext/tk/lib/tk/event.rb: new method aliases (same as option keys of
- event_generate) for Event object
-
- * ext/tk/lib/tk/font.rb: configinfo returns proper types of values
-
- * ext/tk/lib/tk.rb: bind methods accept subst_args + block
-
- * ext/tk/lib/tk/canvas.rb: ditto
-
- * ext/tk/lib/tk/canvastag.rb: ditto
-
- * ext/tk/lib/tk/frame.rb: ditto
-
- * ext/tk/lib/tk/text.rb: ditto
-
- * ext/tk/lib/tk/texttag.rb: ditto
-
- * ext/tk/lib/tk/toplevel.rb: ditto
-
- * ext/tk/lib/tkextlib/*: ditto and bug fix
-
-Wed Dec 8 23:54:29 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Typo
- meant that h2 tag was invisible.
-
-Wed Dec 8 21:56:31 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss, test/rss, sample/rss: backported from CVS HEAD.
-
-Wed Dec 8 14:31:36 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_fwrite): change dereference for cosmetic reason.
-
- * sprintf.c (rb_f_sprintf): [ruby-dev:25104]
-
-Tue Dec 7 19:08:00 2004 Akiyoshi, Masamichi <akiyoshi@hp.com>
-
- * io.c (io_fwrite): fix offset incrementation (for VMS and Human68k)
-
-Tue Dec 7 00:27:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (proc_setgroups): [ruby-dev:25081]
-
-Mon Dec 6 18:08:10 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * re.c (rb_reg_eqq): document fix. [ruby-talk:122541]
-
-Mon Dec 6 17:19:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rubysig.h (TRAP_BEG, TRAP_END): safe errno around CHECK_INTS.
- (backported from CVS HEAD) [ruby-dev:24993]
-
-Mon Dec 6 10:18:17 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::look_for_directives_in):
- Oops - 1.8 doesn't have String#clear
-
-Mon Dec 6 09:59:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (sock_connect): use rb_str_new4().
- [ruby-dev:25052]
-
-Mon Dec 6 01:42:08 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
- ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
- ossl_rsa_private_decrypt): should take an optional argument
- to specify padding mode. [ruby-talk:122539]
-
- * ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): add new constants
- PKCS1_PADDING, SSLV23_PADDING, NO_PADDING and PKCS1_OAEP_PADDING
- under OpenSSL::PKey::RSA.
-
- * test/openssl/test_pkey_rsa.rb: new file.
-
-Sun Dec 5 19:39:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::Completion#complete): new parameter
- to direct case insensitiveness.
-
- * lib/optparse.rb (OptionParser#order!): ignore case only for long
- option. [ruby-dev:25048]
-
-Sat Dec 4 22:54:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050]
-
- * io.c (io_fwrite): takes VALUE string as an argument.
- [ruby-dev:25050]
-
- * ext/socket/socket.c (sock_connect): remove rb_str_locktmp().
- [ruby-dev:25050]
-
- * ext/socket/socket.c (udp_connect): [ruby-dev:25045]
-
- * ext/socket/socket.c (udp_bind): ditto.
-
- * ext/socket/socket.c (udp_send): ditto.
-
- * ext/socket/socket.c (bsock_send): ditto.
+Sun Jul 13 17:25:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/socket.c (s_recvfrom): ditto.
+ * ext/dbm/dbm.c: fix wrong arguments in GetDBM2 macro by @v2e4lisp.
+ [fix GH-655]
- * hash.c (rb_hash_hash): should provide "hash" method where "eql?"
- is redefined. [ruby-talk:122482]
+Sun Jul 13 16:44:56 2014 Eric Wong <e@80x24.org>
-Sat Dec 4 14:54:52 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm_core.h (struct rb_call_info_struct): improve packing
+ This reduces the struct from 112 to 104 bytes on x86-64.
- * eval.c (proc_invoke): use volatile `tmp' rather than `args'.
- [ruby-core:03882]
+Sun Jul 13 15:53:25 2014 Eric Wong <e@80x24.org>
-Sat Dec 4 14:28:56 2004 Dave Thomas <dave@pragprog.com>
+ * vm_core.h (struct rb_iseq_struct): stack_max is uint32_t
+ This reduces the struct from 312 to 304 bytes on x86-64.
- * lib/rdoc/code_objects.rb (RDoc::Context::Section::set_comment):
- Section comments may now be bracketed by lines which are
- ignored. You can now write
- # -----------
- # :section: Dave's Section
- # comment material
- # -----------
- The lines before :section: are removed, and identical lines at the end are
- also removed if present.
+Sun Jul 13 10:56:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 4 03:33:45 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * configure.in (rb_cv_broken_backtrace): exit with failure
+ normally, no needs to abort. [ruby-core:63678] [Bug #10008]
- * ext/readline/readline.c: check $SAFE. (backported from CVS HEAD)
+Sat Jul 12 15:10:22 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/readline/test_readline.rb: added tests for readline.
- (backported from CVS HEAD)
+ * ext/win32ole/win32ole.c (fole_record_method_missing): correct
+ fields Hash key.
-Sat Dec 4 02:24:00 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jul 12 04:17:40 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/nkf/nkf.c: add constant NKF::VERSION
+ * lib/net/smtp.rb (Net::SMTP#data): enable buffering while
+ 'data' send for optimizing Net::SMTP#send_message.
+ [ruby-dev:48329] [misc #9981]
+ patch by Masahiro Tomita.
- * ext/nkf/nkf.c(guess): this becomes an alias of guess2
+Sat Jul 12 01:13:45 2014 Naohisa Goto <ngotogenome@gmail.com>
- * ext/nkf/test.rb(mime_out2): add --no-cp932
+ * test/ruby/envutil.rb (assert_no_memory_leak): On Solaris 9 or later,
+ if possible, execute child ruby with environment variables
+ LD_PRELOAD=libumem.so UMEM_OPTIONS="backend=mmap". With these
+ variables, freed memory is immediately returned to the OS.
+ [Bug #10020] [ruby-dev:48391]
- * ext/nkf/nkf-utf8/nkf.c: original nkf2 revision 1.47
+Fri Jul 11 20:49:10 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Dec 4 00:35:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/win32ole/win32ole.c: add WIN32OLE_RECORD class to support
+ VT_RECORD OLE variables.
- * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039]
+Fri Jul 11 17:15:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Dec 3 18:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/abbrev.rb: remove executable.
- * lib/ostruct.rb: 1.9 marshaling support back-ported.
- [ruby-core:03871]
+Fri Jul 11 16:45:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Dec 3 13:45:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/fileutils.rb: handle ENOENT error with symlink targeted to
+ non-exists file. [ruby-dev:45933] [Bug #6716]
- * eval.c (proc_invoke): copy arguments to frame.argv.
- [ruby-core:03861]
+Fri Jul 11 15:59:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Dec 3 12:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c: Clarify documentation for Array#insert.
+ [ruby-core:62934] [Bug #9901]
- * st.h: fix prototypes.
+Fri Jul 11 15:39:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Dec 3 00:21:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c: Improve Documentation by @dapplebeforedawn.
+ [fix GH-658] [ruby-core:63579] [Bug #10012]
- * object.c (convert_type): use rb_respond_to() again.
- [ruby-dev:25021]
+Fri Jul 11 14:19:14 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * eval.c (rb_respond_to): funcall respond_to? if it's redefined.
- [ruby-dev:25021]
+ * lib/matrix.rb: Fix sign for cross_product [#9499]
-Fri Dec 3 01:55:24 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Jul 11 11:11:50 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: widget configuration by TkWindow#method_missing
- returns proper object. "widget.option = val" returns val, and
- "widget.option(val)" returns self.
+ * benchmark/prepare_so_k_nucleotide.rb: use require_relative.
- * ext/tk/lib/tk/font.rb: TkFont#replace accepts only one font argument.
+ * benchmark/prepare_so_reverse_complement.rb: ditto.
- * ext/tk/lib/tk/radiobutton.rb: add TkRadiobutton#value and
- TkRadiobutton#value=(val).
+Fri Jul 11 10:09:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/spinbox.rb: callback substitution support on
- command option.
+ * pack.c (encodes): fix buffer overrun by tail_lf. Thanks to
+ Mamoru Tasaka and Tomas Hoger. [ruby-core:63604] [Bug #10019]
- * ext/tk/sample/demos-en/widget: bug fix (wrong image height)
+Thu Jul 10 23:51:36 2014 Naohisa Goto <ngotogenome@gmail.com>
- * ext/tk/sample/demos-jp/widget: ditto.
+ * hash.c (ruby_setenv): Fix TestEnv#test_aset failure on Solaris 9.
+ When name contains '=', ruby_setenv raises Errno::EINVAL.
+ That is the same behavior as Solaris 10.
+ NULL check for malloc return value is also added.
-Fri Dec 3 00:11:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jul 10 15:02:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_file_initialize): [ruby-dev:25032]
+ * vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack
+ pointer to get rid of overwriting splat arguments by arguments
+ for `to_hash` conversion. [ruby-core:63593] [Bug #10016]
-Thu Dec 2 16:41:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 10 01:09:57 2014 Koichi Sasada <ko1@atdot.net>
- * eval.c (rb_protect): prevent continuations created inside from being
- called from the outside. [ruby-dev:25003]
+ * symbol.c: remove rb_gc_mark_symbols().
- * eval.c (rb_callcc, rb_cont_call): prohibit calling from different
- signal contexts. [ruby-dev:25022]
+ fstrings referred by static symbols and pinned dynamic symbols
+ are registered by rb_gc_register_mark_object().
-Thu Dec 2 09:57:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ fstrings referred by dynamic symbols (not pinned symbols)
+ are referred from global_symbols.dsymbol_fstr_hash (Hash object).
- * lib/ostruct.rb (OpenStruct::Marshaler): OpenStruct can be
- marshaled again. [ruby-core:03862]
+ Note that fstrings referred from dynamic symbols must live logger
+ than symbol objects themselves because rb_gc_free_dsymbol() uses
+ fstrings to remove from symbol tables.
+ This is why we can not mark fstrings from dynamic symbols.
-Thu Dec 2 09:30:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ This technique reduces root objects for GC marking.
- * eval.c (thread_mark): mark thread group. [ruby-dev:25020]
+ * gc.c (gc_mark_roots): ditto.
- * eval.c (thgroup_add): check whether the argument is really a Thread.
+ * internal.h: ditto.
-Thu Dec 2 07:57:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jul 10 00:24:18 2014 Naohisa Goto <ngotogenome@gmail.com>
- * io.c (rb_io_ctl): [ruby-dev:25019]
+ * common.mk (DTRACE_DEPENDENT_OBJS): fix build failure on Solaris
+ introduced in r46768. Object files containing dtrace probes should
+ be listed in DTRACE_DEPENDENT_OBJS.
-Wed Dec 1 02:21:02 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 9 17:07:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * signal.c (sighandler): call handler immediately only for default
- handlers. [ruby-dev:25003]
+ * symbol.c, symbol.h: Symbol class implementation and internals,
+ split from parse.y.
-Tue Nov 30 23:38:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 9 14:45:39 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
+ * parse.y: change Symbol <-> ID relationship to avoid
+ exposing IDs from collectable symbols.
+ [Bug #10014]
- * io.c (read_all): remove unnecessary rb_str_resize().
- [ruby-dev:24996] (backported from CVS HEAD)
+ Now, rb_check_id() returns 0 if corresponding symbol is
+ pinned dynamic symbol.
- * io.c (io_readpartial): ditto.
+ There is remaining intern_cstr_without_pindown(), it can return
+ IDs from collectable symbols. We must be careful to use it
+ (only used in parse.y). I think it should be removed if
+ it does not have impact for performance.
- * io.c (io_read): ditto.
+ * parse.y:
+ add:
+ * STATIC_SYM2ID()
+ * STATIC_ID2SYM()
+ rename:
+ * rb_pin_dynamic_symbol() -> dsymbol_pindown()
-Tue Nov 30 16:18:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h:
+ remove:
+ * rb_check_id_without_pindown()
+ * rb_sym2id_without_pindown()
+ add:
+ * rb_check_symbol()
+ * rb_check_symbol_cstr()
- * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
+ * load.c: use rb_check_id() or rb_check_id_cstr().
- * io.c (read_all): remove unnecessary rb_str_resize().
- [ruby-dev:24996]
+ * object.c: ditto.
- * io.c (io_read): ditto.
+ * struct.c: ditto.
-Tue Nov 30 00:49:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread.c: ditto.
- * io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992]
+ * vm_method.c: ditto.
-Mon Nov 29 16:06:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (sym_find): use only rb_check_symbol().
- * ext/stringio/stringio.c (strio_write): insufficiently filled string
- being extended when overwriting. [ruby-core:03836]
+ * sprintf.c (rb_str_format): use rb_check_symbol_cstr().
-Mon Nov 29 15:59:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 9 12:21:55 2014 Koichi Sasada <ko1@atdot.net>
- * lib/ostruct.rb (OpenStruct::method_missing): check method
- duplication for -d.
+ * parse.y (symbols_i): delete garbage symbols for Symbol.all_symbols.
- * lib/ostruct.rb (OpenStruct::initialize): ditto.
+Wed Jul 9 05:49:08 2014 Eric Wong <e@80x24.org>
-Mon Nov 29 15:22:28 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.h (struct rb_global_vm_lock_struct):
+ do not expose pthread type for lock
- * test/io/nonblock/test_flush.rb: abandon tests when io/nonblock is
- not supported.
+Wed Jul 9 05:41:40 2014 Eric Wong <e@80x24.org>
-Mon Nov 29 03:08:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * thread_pthread.h: remove unneeded semaphore.h include
- * object.c (convert_type): direct call conversion methods for the
- performance. [ruby-core:03845]
+Wed Jul 9 00:12:28 2014 Keiju Ishitsuka <keiju@ishitsuka.com>
- * eval.c (rb_funcall_rescue): new function.
+ * lib/irb/ruby-lex.rb: fix counting indent in identify_string_dvar.
- * object.c (rb_Array): avoid using rb_respond_to().
+Tue Jul 8 16:58:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_Integer): ditto.
+ * test/ruby/memory_status.rb (Memory::PSCMD): use ps command which
+ outputs expected result. [ruby-dev:48370] [Bug #10010]
- * parse.y (reduce_nodes): empty body should return nil.
+Tue Jul 8 14:45:17 2014 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_aset): the original string should not be
- affected by modifying duplicated string. [ruby-dev:24981]
+ * parse.y (dsymbol_alloc): set global_symbols.minor_marked to 0.
-Mon Nov 29 13:57:38 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (dsymbol_check): set RSYMBOL(sym)->fstr to 0
+ because we should not touch fstr after that.
- * win32/win32.c (CreateChild): search executable file if no program
- name given. (backported from CVS HEAD)
+ * parse.y (rb_gc_free_dsymbol): skip deleting str and sym
+ from tables if fstr == 0.
-Mon Nov 29 13:37:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 7 14:31:52 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (fptr_finalize): must not use FILE after fclose().
- [ruby-dev:24985]
+ * parse.y: remove global_symbols::pinned_dsym
+ (and ::pinned_dsym_minor_marked).
-Mon Nov 29 13:16:31 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ Mark pinned dsymbols by rb_gc_register_mark_object() because
+ they are immortal.
- * win32/win32.c (CreateChild): push back the last space before next
- loop because CharNext() eats it.
+ * parse.y (rb_gc_free_dsymbol): rename parameter name `ptr' to `sym'.
-Mon Nov 29 01:18:18 2004 Tanaka Akira <akr@m17n.org>
+Mon Jul 7 12:45:51 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_io_check_writable): call io_seek regardless of
- NEED_IO_SEEK_BETWEEN_RW. [ruby-dev:24986]
+ * gc.c: revert miss-commit.
-Sat Nov 27 21:43:39 2004 Tanaka Akira <akr@m17n.org>
+Mon Jul 7 12:40:59 2014 Koichi Sasada <ko1@atdot.net>
- * io.c: avoid data lost with nonblocking fd and
- stdio buffering in sync mode. [ruby-dev:24966]
- based on matz's patch [ruby-dev:24967]
- (io_fwrite): new primitive writing function which writes
- directly if sync mode.
- (rb_io_fwrite): wrapper for io_fwrite now.
- (io_write): call io_fwrite instead of rb_io_fwrite.
+ * parse.y: need to use updated (re-created) symbols.
-Sat Nov 27 14:44:15 2004 Kent Sibilev <ksibilev@bellsouth.net>
+Mon Jul 7 11:02:55 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/cgi/session.rb (CGI::Session::initialize): create_new_id is
- now a instance method. [ruby-core:03832]
+ * tool/mkconfig.rb: remove not to require rbconfig/obsolete.rb.
-Sat Nov 27 09:41:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rbconfig/obsolete.rb: removed.
- * io.c (io_fread): old rb_io_fread with file closing checking.
- (rb_io_fread): wrapper for io_fread now.
- [ruby-dev:24964]
+Mon Jul 7 10:52:03 2014 Koichi Sasada <ko1@atdot.net>
-Fri Nov 26 18:02:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * parse.y: do not use rb_gc_resurrect(), but create a new dynamic
+ symbol for garbage dynamic symbol.
- * ext/tk/lib/tk.rb: Tk.destroy uses TkWindow#epath
+ * common.mk: use gc.h by parse.y.
- * ext/tk/lib/tk/image.rb: bug fix
+Mon Jul 7 02:18:42 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/wm.rb: add 'iconphoto' method(Windows only)
+ * string.c (fstr_update_callback): do not use rb_gc_resurrect()
+ any more.
- * ext/tk/lib/tkextlib/*: some methods uses TkWindow#epath
+ Make new frozen string and replace with garbage frozen string.
-Fri Nov 26 13:49:06 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * common.mk: use gc.h from string.c.
- * eval.c (method_missing): raise TypeError for classes do not
- have allocators. [ruby-core:03752]
+Mon Jul 7 00:36:13 2014 Koichi Sasada <ko1@atdot.net>
- * lib/erb.rb: add RDoc by James Edward Gray II. [ruby-core:03786]
+ * gc.c: rename is_dying_object() to is_garbage_object().
-Fri Nov 26 13:29:02 2004 Dave Thomas <dave@pragprog.com>
+ * gc.h: rb_objspace_garbage_object_p() as an exported function.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::look_for_directives_in): Break
- out of preprocessing when we find a :section: directive (previously cleared out the
- comment, but this apparently now generates an error in gsub!)
+Sun Jul 6 21:30:35 2014 Koichi Sasada <ko1@atdot.net>
-Fri Nov 26 00:17:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (is_dying_object): fix missed condition.
- * io.c (io_read): move StringValue() check before GetOpenFile().
- [ruby-dev:24959]
+ * gc.c (is_live_object): move frequent path first.
-Thu Nov 25 20:14:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 6 21:00:11 2014 Koichi Sasada <ko1@atdot.net>
- * lib/thwait.rb (ThreadsWait#join_nowait): abnormally terminated
- threads should be also processed. [ruby-talk:121320]
+ * gc.c: rename is_dead_object() to is_dying_object().
+ This function is not opposite against is_live_object()
+ because is_dying_object() does *not* check object type.
-Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (is_dying_object): change condition.
- * dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
+ * gc.c (is_live_object): use T_NONE instead of 0.
-Thu Nov 25 07:59:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (rb_objspace_dying_object_p): added.
- * io.c (read_all): stringify non-nil buffer argument, and always
- taint the result. [ruby-dev:24955]
+Sun Jul 6 13:37:27 2014 Koichi Sasada <ko1@atdot.net>
-Wed Nov 24 01:01:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (rb_gc_register_mark_object): change data structure.
+ From single array, to array of arrays. Each array only has 1024
+ entries.
- * io.c (io_read): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24952]
+ * vm.c (Init_vm_objects): change default capa from 1 to 128.
- * configure.in, io.c: cancel [ ruby-Patches-1074 ].
+Sat Jul 5 05:05:53 2014 Vipul A M <vipulnsward@gmail.com>
-Tue Nov 23 08:09:50 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/irb/locale.rb (IRB::Locale#modifier): fix wrong attr_reader
+ `modifieer` => `modifier` from irb locale. [fix GH-656]
- * ext/tk/lib/tk/menu.rb: improve usability of TkOptionMenubutton
+Fri Jul 4 20:45:26 2014 Koichi Sasada <ko1@atdot.net>
-Tue Nov 23 02:00:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y: rename symbols::sym_id to symbols::str_id.
+ This table is not {Symbol => ID} table, but
+ {String => ID} table.
- * file.c (rb_file_chown): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24949]
+ * parse.y (lookup_sym_id): also rename lookup_sym_id() to
+ lookup_str_id() because key is not Symbol, but String.
-Tue Nov 23 00:10:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jul 4 18:42:04 2014 Koichi Sasada <ko1@atdot.net>
- * file.c (rb_file_chown): integer conversion should be prior to
- GetOpenFile(). [ruby-dev:24947]
+ * parse.y (must_be_dynamic_symbol): fix missed-condition.
- * file.c (rb_file_truncate): ditto.
+Fri Jul 4 18:38:11 2014 Koichi Sasada <ko1@atdot.net>
- * file.c (rb_file_s_truncate): ditto.
+ * parse.y (rb_pin_dynamic_symbol): should be `static' function.
- * dir.c (dir_seek): use NUM2OFFT().
+Fri Jul 4 18:03:35 2014 Koichi Sasada <ko1@atdot.net>
- * misc/ruby-mode.el (ruby-non-block-do-re): should not match words
- start with block keyword and underscore. [ruby-core:03719]
+ * parse.y (must_be_dynamic_symbol): refactoring.
+ * add `inline'.
+ * use UNLIKELY().
+ * check only DYNAMIC_SYM_P(), otherwise it is a bug.
+ * lookup_id_str() is not needed in second condition.
-Mon Nov 22 22:33:02 2004 Dave Thomas <dave@pragprog.com>
+Fri Jul 4 11:53:56 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Don't use names
- of variables or constants when oarsing 'require'
+ * parse.y: remove unused code
+ surrounded by `#if ENABLE_SELECTOR_NAMESPACE'
-Mon Nov 22 00:13:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jul 4 10:08:24 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * dir.c (dir_seek): should retrieve dir_data after NUM2INT().
- [ruby-dev:24941]
+ * test/rubygems/test_gem_package.rb: avoid tempfile leaks using Tempfile#close!
+ * test/rubygems/test_gem_request_set.rb: ditto.
+ * test/rubygems/test_gem_request_set_gem_dependency_api.rb: ditto.
-Sat Nov 20 23:57:33 2004 Dave Thomas <dave@pragprog.com>
+Fri Jul 4 04:42:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/README (et al): Add a new directive, :section:, and
- change the output format to accomodate. :section: allows to to
- group together methods, attributes, constants, etc under
- headings in the output. If used, a table of contents is
- generated.
+ * lib/net/http/response.rb (Net::Inflater#inflate_adapter):
+ prevent automatic encoding conversion.
-Sat Nov 20 23:56:54 2004 Dave Thomas <dave@pragprog.com>
+Fri Jul 4 04:39:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/options.rb (Options::parse): Force --inline-source if
- --one-file option given
+ * lib/net/http/response.rb (Net::HTTPResponse.each_response_header):
+ raise first exception even if inflate_body_io.finish raises error.
+ when begin block raises error, finish usually raises error too.
-Sat Nov 20 23:55:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Jul 4 02:56:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_splice): should place index wrapping after
- possible modification. [ruby-dev:24940]
+ * lib/uri/generic.rb (URI::Generic#query=): remove validation, just
+ escape. [Feature #2542]
-Sat Nov 20 13:26:03 2004 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic#fragment=): ditto.
- * ext/nkf/nkf-utf8/utf8tbl.c: original revision 1.7
+ * lib/uri/generic.rb (URI::Generic#check_query): removed.
-Sat Nov 20 05:34:24 2004 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic#set_query): ditto.
- * ext/nkf/nkf-utf8/nkf.c: original nkf.c rev:1.40
+ * lib/uri/generic.rb (URI::Generic#check_fragment): ditto.
- * ext/nkf/test.rb: add test for mime encode/decode
+ * lib/uri/generic.rb (URI::Generic#set_fragment): ditto.
-Sat Nov 20 01:37:34 2004 Johan Holmberg <holmberg@iar.se>
+Thu Jul 3 12:40:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (error_print): nicer traceback at interrupt.
- [ruby-core:03774]
+ * configure.in (--with-static-linked-ext): fix for extensions to
+ be linked statically.
-Sat Nov 20 00:07:16 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * Makefile.in, common.mk: use ENCSTATIC for enc directory.
- * string.c (str_gsub): internal buffer should not be listed by
- ObjectSpace.each_object() by String#gsub. [ruby-dev:24931]
+ * ext/extmk.rb: supply dependencies of statically linked extension
+ libraries.
-Fri Nov 19 01:20:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 2 15:45:49 2014 Koichi Sasada <ko1@atdot.net>
- * lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise
- exception if data corresponding to session specified from the
- client does not exist.
+ * gc.c (gc_heap_lazy_sweep): simplify logic.
-Fri Nov 19 00:59:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (gc_page_sweep): return TRUE if empty slots are available.
- * string.c (str_gsub): internal buffer should not be listed by
- ObjectSpace.each_object(). [ruby-dev:24919]
+Wed Jul 2 09:48:42 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Nov 18 18:41:08 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * logger.rb: removed unmaintained code.
+ [Feature #9860][ruby-core:62724]
+ * test/logger/test_application.rb: ditto.
- * test/ruby/test_stringchar.rb (test_bang): added.
+Wed Jul 2 03:20:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
- * string.c (rb_str_upcase_bang, rb_str_capitalize_bang)
- (rb_str_swapcase_bang): missing rb_str_modify(). [ruby-dev:24915]
+ * node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
+ keyword argument is required
-Thu Nov 18 00:21:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jul 2 02:57:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_getpgrp): prohibit for $SAFE=2.
- [ruby-dev:24899]
+ * vm.c (rb_vm_env_local_variables): returns array of local
+ variable name symbols in the environment by envval.
- * process.c (get_pid): ditto. [ruby-dev:24904]
+ * proc.c (bind_local_variables): use rb_vm_env_local_variables.
- * process.c (get_ppid): ditto.
+Wed Jul 2 02:23:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_delete): defer rb_ary_modify() until actual
- modification. [ruby-dev:24901]
+ * proc.c (bind_receiver): new method to return the bound receiver
+ of the binding object. [ruby-dev:47613] [Feature #8779]
-Thu Nov 18 10:10:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 2 02:14:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c, rubyio.h (rb_io_modenum_flags): exported.
+ * proc.c (bind_local_variables): update env from envval for each
+ iterations. [ruby-dev:48351] [Bug #10001]
- * ext/stringio/stringio.c (strio_initialize): allow Fixnum as mode as
- well as IO.new does. [ruby-dev:24896]
+Tue Jul 1 23:46:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Nov 17 23:42:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * NEWS: [DOC] mention about Binding#local_variables, introduced at
+ r44392 (see [Feature #8773]).
- * test/ruby/test_settracefunc.rb: added. [ruby-dev:24884]
+Tue Jul 1 23:30:51 2014 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Wed Nov 17 13:56:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is
+ array of IDs, not Symbols. [ruby-dev:48353] [Bug #9811]
- * parse.y (newline_node): should not use FL_SET. [ruby-dev:24874]
+Tue Jul 1 16:18:22 2014 Akinori MUSHA <knu@iDaemons.org>
- * parse.y (string_content): should not use FL_UNSET.
+ * ext/digest/lib/digest/hmac.rb, test/digest/test_digest_hmac.rb:
+ Digest::HMAC is finally removed as previously noticed.
+ [fix GH-648]
- * node.h (NODE_NEWLINE): remove unused bit to utilize flag field
- in nodes.
+Tue Jul 1 11:13:43 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Nov 17 13:09:40 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/date/lib/date/format.rb: removed empty file by @vipulnsward.
+ * ext/date/lib/date.rb: removed needless require.
+ [fix GH-647]
- * {bcc32,win32,wince}/Makefile.sub (test): should build ruby.exe
- before running test. [ruby-core:03756]
+Mon Jun 30 16:42:52 2014 Koichi Sasada <ko1@atdot.net>
-Wed Nov 17 04:33:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * gc.c (gc_stat_internal): return size_t value instead of VALUE
+ and remove `out' parameter.
- * pack.c: all features are backport from 1.9. [ruby-dev:24826]
+ * gc.c: add braces for `if' statements.
- * bignum.c (rb_big2ulong_pack): new function to pack Bignums.
+ * gc.c (gc_stat_internal): fix comment.
-Wed Nov 17 03:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 30 15:07:34 2014 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_splice): move rb_str_modify() after
- StringValue(), which may alter the receiver. [ruby-dev:24878]
+ * gc.c: support `USE_RGENGC == 0'.
-Tue Nov 16 23:45:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_divmod): protect float values from GC by
- assignment to local variables. [ruby-dev:24873]
-
-Tue Nov 16 16:30:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32,wince}/setup.mak (-epilogue-): remove config.h and
- config.status to force updating them.
-
-Tue Nov 16 16:20:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_read): position was ignored when a
- buffer was passed. http://www.yo.rim.or.jp/~nov/d/?date=20041116#p03
-
-Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use
- Regexp conversion.
-
-Tue Nov 16 01:41:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_mod_check): frozen check should be separated.
- [ruby-core:3742]
-
- * array.c (rb_ary_update): pedantic check to detect
- rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
-
-Mon Nov 15 13:50:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_justify): typo fixed. [ruby-dev:24851]
-
-Mon Nov 15 11:50:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-special-char-p, ruby-parse-partial): handle
- operator symbols. [ruby-talk:120177]
-
-Sun Nov 14 13:27:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pp.rb (PP#object_address_group): remove odd number of 'f'
- prefixed to negative address.
-
-Sun Nov 14 08:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/logger/test_logger.rb: Logger just expects
- Logger#datetime_format to be used for Time#strftime independently of
- locale. [ruby-dev:24828]
-
-Fri Nov 12 15:03:26 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * eval.c (ruby_options): now we cannot call rb_glob() before
- ruby_init(), so call rb_w32_cmdvector() at ruby_options().
-
- * win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
- export it.
-
-Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/event.rb: remove $LOADED_FEATURES trick
-
- * ext/tk/lib/tk.rb: ditto
-
-Fri Nov 12 00:31:05 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string
- pointer. [ruby-dev:24783]
-
-Thu Nov 11 17:36:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (rb_globi): also should call back via rb_glob_caller().
- [ruby-dev:24775]
-
-Thu Nov 11 16:47:21 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_file.rb (test_truncate_wbuf): we want to test
- only File#truncate, not behaviour of seek(2).
-
-Thu Nov 11 09:41:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (push_braces): was confusing VALUE and char*.
-
- * dir.c (rb_push_glob): Dir.glob should have called its block.
-
-Thu Nov 11 01:52:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (syserr_initialize): use stringified object.
- [ruby-dev:24768]
-
-Wed Nov 10 22:49:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/delegate.rb (SimpleDelegator::dup): wrong number of
- arguments.
-
- * lib/delegate.rb (DelegateClass::dup): ditto.
-
-Wed Nov 10 12:31:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * README.EXT (Example): extconf.rb is indispensable now.
-
-Wed Nov 10 03:33:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: fix SEGV when compiled with Tcl/Tk8.3.x
- or older
-
- * ext/tk/lib/tkextlib/tile/style.rb: bug fix
-
-Tue Nov 9 14:27:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::Officious): moved from DefaultList.
-
-Tue Nov 9 01:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (rb_glob2): do not allocate buffer from heap to avoid
- memory leaks. use string object for buffering instead.
- [ruby-dev:24738]
-
- * dir.c (join_path): ditto.
-
- * io.c (io_read): external input buffer may be modified even after
- rb_str_locktmp(). [ruby-dev:24735]
-
- * dir.c (fnmatch): p or s may be NULL. [ruby-dev:24749]
-
-Tue Nov 9 00:53:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * regex.c (slow_match): avoid GCC 3.4.x warnings.
-
-Tue Nov 9 00:50:06 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/rdoc.rb: Change version numbering of RDoc and ri
-
-Mon Nov 8 23:38:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/extservm.rb: add DRb::ExtServManager#uri=.
- [ruby-dev:24743]
-
-Mon Nov 8 22:20:19 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Fix bug where parent class wasn't being detected if the
- child class was defined using the A::B notation.
-
-Mon Nov 8 00:14:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in: add setup for mignw32 cross compiling.
- [ruby-talk:119413]
-
-Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: bind-event methods accept multi substitution
- arguments.
+ * test/ruby/test_gc.rb: ditto.
- * ext/tk/lib/tk/canvas.rb: ditto.
+Mon Jun 30 11:36:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/tk/canvastag.rb: ditto.
+ * file.c: [DOC] document File.join returns a string.
+ Contributed by @dapplebeforedawn. [fix GH-646]
- * ext/tk/lib/tk/text.rb: ditto.
+Sat Jun 28 22:57:01 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tk/lib/tk/texttag.rb: ditto.
+ * ext/pathname/pathname.c (path_birthtime): Windows support.
+ see [Feature #9857] [ruby-dev:48339]
- * ext/tk/lib/tkextlib: ditto.
+Sat Jun 28 22:44:16 2014 Tanaka Akira <akr@fsij.org>
-Sat Nov 6 14:58:44 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/pathname/pathname.c (path_birthtime): New method,
+ Pathname#birthtime.
+ Proposed by Kazuhiro NISHIYAMA. [ruby-dev:48232] [Feature #9857]
- * lib/webrick/server.rb (WEBrick::HTTPServer#start): remove
- :DoNotReverseLookup option. (Socket#do_not_reverse_lookup is a
- ruby 1.9 feature)
+Sat Jun 28 20:29:03 2014 Simon Baird <simon.baird@gmail.com>
-Sat Nov 6 11:31:04 2004 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error
+ message about zero or negative precision for clarity and
+ consistency with other methods. [GH-644]
- * lib/date.rb (_parse): checks whether zone was given.
+Sat Jun 28 15:32:57 2014 Tanaka Akira <akr@fsij.org>
-Sat Nov 6 00:46:27 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/webrick/utils.rb (create_listeners): Close socket objects.
- * string.c (rb_str_locktmp): check STR_TMPLOCK flag before
- locking. [ruby-dev:24727]
+Sat Jun 28 13:58:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 5 18:12:42 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * eval.c (setup_exception): should not overwrite SystemStackError
+ backtrace if set already. [ruby-core:63377] [Feature #6216]
- * ext/tk/lib/tk/scrollable.rb: divide Scrollable module into
- X_Scrollable and Y_Scrollable
+ * eval.c (setup_exception): get rid of method calls before raising
+ stack overflow, not to cause stack overflow again.
- * ext/tk/lib/tk/entry.rb: include X_Scrollable instead of Scrollable
+ * defs/id.def: add IDs for backtraces.
- * ext/tk/lib/tk/autoload.rb: define autoload for X_Scrollable and
- Y_Scrollable
+Sat Jun 28 04:08:22 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Nov 5 16:05:32 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/uri/mailto.rb: update to latest specs, RFC 6068 and HTML5.
- * ext/tk/lib/tk.rb: TkComm._at() supprts both of "@x,y" and "@x"
+ * lib/uri/mailto.rb (HEADER_PATTERN): removed.
-Fri Nov 5 13:22:58 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields.
- * ext/tk/lib/tk/text.rb: sorry. bug fix again.
+ * lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp.
-Fri Nov 5 13:17:54 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses.
- * ext/tk/lib/tk/text.rb: bug fix
+ * lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to
+ addresses. Don't check with regexp, only split.
-Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching
+ URI path-rootless and HTML5 email regexp with unescaped one.
- * gc.c (gc_mark): stricter GC stack check.
+ * lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by
+ HEADER_REGEXP.
-Fri Nov 5 08:52:48 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by
+ HEADER_REGEXP, only split it.
- * gc.c (gc_mark): stricter GC stack check.
+Sat Jun 28 00:35:10 2014 Lauri Tirkkonen <lotheac@iki.fi>
-Fri Nov 5 08:34:43 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when
+ configured --with-rubyarchprefix, remove prefix from rubyarchdir
+ after expansion for the case it does not start with '$(prefix)'.
+ [fix GH-643]
- * string.c (str_gsub): should have removed rb_str_unlocktmp(str).
- [ruby-dev:24708]
+Fri Jun 27 15:20:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Nov 4 21:25:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/rubygems/test_case.rb: rescue Gem::LoadError in Gem::TestCase.
+ because it's effected by removing minitest from stdlib.
- * string.c (str_gsub): string modify check no longer based on
- tmplock. [ruby-dev:24706]
+Fri Jun 27 12:29:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Nov 4 19:27:46 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rubygems/specification.rb: fixed broken condition caused
+ by removing YAML::ENGINE.
+ * lib/rubygems/package/old.rb: ditto.
- * io.c (rb_f_open): fix typo.
+Fri Jun 27 05:33:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 4 15:02:14 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * hash.c (env_shift): fix memory leak on Windows, free environment
+ strings block always. [ruby-dev:48332] [Bug #9983]
- * ext/tk/lib/tk/variable.rb: forget to initialize instance_variables
- of TkVarAccess objects
+Fri Jun 27 03:41:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 4 09:11:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * sprintf.c (GETASTER): should not use the numbered argument to be
+ formatted, raise ArgumentError instead.
+ [ruby-dev:48330] [Bug #9982]
- * gc.c (gc_mark): enable GC stack checking.
+Thu Jun 26 18:18:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Nov 4 03:11:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/with_different_ofs.rb: move into test library directory.
+ * test/csv/base.rb: fix require path for with_different_ofs.rb.
+ * test/digest/test_digest_extend.rb: ditto.
- * string.c (str_gsub): lock strings temporarily. [ruby-dev:24687]
+Thu Jun 26 18:06:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/socket/socket.c (s_recvfrom): tmplock input buffer.
- [ruby-dev:24705]
+ * test/profile_test_all.rb: move into test library directory.
+ * test/runner.rb: fix require path for profile_test_all.rb.
-Wed Nov 3 22:32:12 2004 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jun 26 17:57:57 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * process.c: On NetBSD don't use setruid() and setrgid().
+ * lib/webrick/httpproxy.rb: remove useless assigned variables.
+ * lib/webrick/httpservlet/cgihandler.rb: ditto.
+ * lib/webrick/httpservlet/erbhandler.rb: ditto.
+ * lib/webrick/server.rb: ditto.
-Wed Nov 3 22:24:17 2004 Daigo Moriwaki <techml@sgtpepper.net>
+Thu Jun 26 08:28:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpauth/digestauth.rb: use Base64.encode64 to
- avoid warnings.
+ * hash.c (env_select): fix memory leak and crash on Windows, make
+ keys array first instead of iterating on environ directly.
+ [ruby-dev:48325] [Bug #9978]
-Wed Nov 3 17:19:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jun 26 02:45:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_uniq_bang): do not push frozen string from hash
- table. [ruby-dev:24695]
+ * eval_error.c (error_print): put a newline after an anonymous
+ exception class name.
- * array.c (rb_ary_and): ditto.
+Wed Jun 25 22:31:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_or): ditto.
+ * hash.c (ruby_setenv): fix memory leak on Windows, free
+ environment strings block after check for the size.
+ [ruby-dev:48323] [Bug #9977]
-Wed Nov 3 17:13:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 25 15:44:12 2014 Eric Wong <e@80x24.org>
- * io.c (pipe_open): fix compile error
+ * ccan/container_of/container_of.h (container_off_var):
+ avoid warning with -Wcast-qual
+ [ccan ba5ad771af4aa9e085498de6c3c665c52694460f (Rusty Russell)]
-Wed Nov 3 16:58:07 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Jun 25 10:19:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: support to use different Tcl commands between
- configure and configinfo
+ * hash.c (env_aset, env_has_key, env_assoc, env_has_value),
+ (env_rassoc, env_key): prohibit tainted strings if $SAFE is
+ non-zero. [Bug #9976]
- * ext/tk/lib/font.rb: ditto.
+Tue Jun 24 14:46:17 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/tk/lib/itemconfig.rb: support to use different Tcl commands
- between item_configure and item_configinfo
+ * lib/gserver.rb: remove redundant use of to_s in interpolation.
+ * lib/logger.rb: ditto.
+ * lib/optparse.rb: ditto.
+ * lib/rbconfig/obsolete.rb: ditto.
+ * lib/resolv.rb: ditto.
+ * lib/webrick/httpresponse.rb: ditto.
- * ext/tk/lib/itemfont.rb: ditto.
+Tue Jun 24 10:50:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/extconf.rb: install SUPPORT_STATUS
+ * hash.c (env_path_str_new): make PATH environment variable
+ string, to be frozen.
- * ext/tk/lib/tkextlib: some bug fixes (see ext/tk/ChangeLog.tkextlib)
+Tue Jun 24 10:40:52 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Nov 3 16:30:41 2004 NARUSE, Yui <naruse@ruby-lang.org>
+ * tool/make-snapshot: download bundle gems when package making.
+ [Feature #9852][ruby-core:62676]
+ * gems/bundled_gems: listed bundled gems for Ruby 2.2.
- * ext/nkf: follow nkf 2.0.4
+Tue Jun 24 10:20:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Nov 3 15:53:34 2004 Kouhei Sutou <kou@cozmixng.org>
+ * tool/downloader.rb: make Downloader class to general download utility.
+ It can be used without config.guess and config.sub.
+ * tool/get-config_files: ditto.
+ * tool/make-snapshot: ditto.
- * test/rss/test_maker_*.rb: added tests for RSS Maker.
+Tue Jun 24 06:17:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rss/maker.rb: added RSS Maker.
+ * eval.c (setup_exception): "mesg == sysstack_error" and
+ sysstack_error_p(mesg) are duplicated.
+ r46502 seems to want to use latter.
- * lib/rss/maker/*.rb: ditto.
+Tue Jun 24 06:15:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 2 16:35:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/tk/tcltklib.c: fix format specifiers for VALUE and
+ Tcl_Interp*. [ruby-core:63283] [Bug #9972]
- * ext/enumerator/enumerator.c (each_cons_i): pass copy of an
- internal consequent array. [ruby-talk:118691]
+Tue Jun 24 05:40:41 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Nov 2 16:05:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * nacl/nacl-config.rb: Use File.exist? instead of executable?
+ for irt_core. Recent nacl_sdk has non-executable irt_core.
+ Patch by Shinichiro Hamaji.
+ [Fixes GH-529] https://github.com/ruby/ruby/pull/529
- * process.c (rb_f_fork): need to flush stdout and stderr before
- fork(2). [ruby-talk:117715]
+Mon Jun 23 18:44:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Nov 2 01:20:09 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * tool/config_files.rb: rename class ConfigFiles to Downloader.
+ * tool/get-config_files: ditto.
+ * tool/make-snapshot: ditto.
- * eval.c (proc_invoke): nail down dyna_var node when Proc object
- or continuation is created. [ruby-dev:24671]
+Mon Jun 23 18:03:13 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Mon Nov 1 13:59:28 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * tool/rbinstall.rb: support to install bundle gems.
- * ext/extmk.rb (MANIFEST): do not use anymore, use extconf.rb instead.
+Mon Jun 23 17:33:11 2014 Akinori MUSHA <knu@iDaemons.org>
- * ext/enumerator/extconf.rb, ext/fcntl/extconf.rb,
- ext/stringio/extconf.rb: added.
+ * lib/net/imap.rb (Net::IMAP#fetch): [DOC] Describe how a range in
+ +set+ is interpreted, and mention -1 which can be used for '*'.
- * MANIFEST, ext/**/MANIFEST: removed.
+Mon Jun 23 16:22:50 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
- * README.EXT, README.EXT.ja: remove MANIFEST stuff.
+ * include/ruby/ruby.h (struct RHash): no longer. [Feature #9889]
-Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (RHASH): ditto.
- * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
+ * include/ruby/ruby.h (RHASH_ITER_LEV): deprecated. Will be deleted later.
-Mon Nov 1 00:36:48 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * include/ruby/ruby.h (RHASH_IFNONE): ditto.
- * main.c (_stklen): move to gc.c.
+ * internal.h (struct RHash): moved here.
-Sun Oct 31 00:22:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (RHASH): ditto.
- * string.c (rb_str_locktmp): lock string temporarily.
+ * hash.c (rb_hash_iter_lev): do not use this.
- * string.c (str_independent): add tmplock check.
+ * hash.c (rb_hash_ifnone): ditto.
- * io.c (io_write): lock output string temporarily.
- [ruby-dev:24649]
+Mon Jun 23 13:30:11 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
- * io.c (io_write): use rb_str_locktmp().
+ * include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
- * io.c (read_all): ditto.
+ * include/ruby/ruby.h (RCOMPLEX): ditto.
-Sat Oct 30 06:53:24 2004 Peter Vanbroekhoven <peter.vanbroekhoven@cs.kuleuven.ac.be>
+ * include/ruby/ruby.h (RCOMPLEX_SET_REAL): deprecated. Will be deleted later.
- * eval.c (rb_eval): NODE_XSTR should pass copy of literal string.
+ * include/ruby/ruby.h (RCOMPLEX_SET_IMAG): ditto.
-Sat Oct 30 00:19:40 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h (struct RFloat): moved here.
- * enum.c (enum_sort_by): protect continuation jump in.
- [ruby-dev:24642]
+ * internal.h (RCOMPLEX): ditto.
-Fri Oct 29 21:27:51 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * complex.c (rb_complex_set_real): do not use this.
- * io.c (rb_io_check_initialized): new function to check uninitialized
- object. [ruby-talk:118234]
+ * complex.c (rb_complex_set_imag): ditto.
- * file.c (rb_file_path), io.c (rb_io_closed): check if initialized.
+Mon Jun 23 13:10:15 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
-Fri Oct 29 10:00:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/ruby.h (struct RFloat): no longer. [Feature #9863]
- * eval.c (rb_thread_start_0): forget to free some memory chunks.
- [ruby-core:03611]
+ * include/ruby/ruby.h (RFLOAT): ditto.
- * eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,
- should be wrapped by PUSH_TAG/POP_TAG(). [ruby-dev:24627]
+ * internal.h (struct RFloat): moved here.
-Thu Oct 28 08:42:02 2004 Tanaka Akira <akr@m17n.org>
+ * internal.h (RFLOAT): ditto.
- * io.c (argf_forward): use ANSI style.
- (argf_read): call argf_forward with argv argument.
- [ruby-dev:24624]
+Mon Jun 23 12:01:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Oct 28 23:32:54 2004 akira yamada <akira@ruby-lang.org>
+ * lib/uri/generic.rb (check_port): allow strings for port= as
+ described in rdoc.
- * ext/zlib/zlib.c (zstream_detach_input): resets klass of z->input if
- z->input isn't nil.
+ * lib/uri/rfc3986_parser.rb (regexp): implementation detail of above.
-Thu Oct 28 23:19:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 23 11:35:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb: prefer relative path. [ruby-talk:93037]
+ * eval.c (setup_exception): set backtrace in system stack error
+ other than the pre-allocated sysstack_error. [Feature #6216]
-Wed Oct 27 18:49:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * proc.c (Init_Proc): freeze the pre-allocated sysstack_error.
- * gc.c: prototype; rb_io_fptr_finalize() doesn't return any value
- at this version.
+ * vm_insnhelper.c (vm_stackoverflow): raise new instance for each
+ times without calling any methods to keep the backtrace with no
+ further stack overflow.
-Wed Oct 27 17:27:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (rb_obj_copy_ivar): extract function to copy instance
+ variables only for T_OBJECT from init_copy.
- * gc.c (gc_sweep): recover ruby_in_compile variable.
+Mon Jun 23 11:11:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 27 09:17:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * signal.c (check_stack_overflow): drop the last tag too close to
+ the fault page, to get rid of stack overflow deadlock.
+ [Bug #9971]
- * string.c (str_gsub): use a string object for exception safeness.
- [ruby-dev:24601]
+Sun Jun 22 09:11:15 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 26 23:52:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb: remove registry.
+ 'registry' is not used and RFC3986 doesn't use it.
- * io.c (rb_io_getline): rs modification check should not interfere in the loop.
+Sun Jun 22 09:10:09 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 26 23:30:39 2004 Dave Thomas <dave@pragprog.com>
+ * lib/uri/rfc3986_parser.rb: raise exception when given a URI string
+ has non ASCII in order to keep the regexp compiled for US-ASCII.
- * lib/rdoc/code_objects.rb (RDoc::Context::add_class_or_module):
- Restore correct :nopdoc: behavior with nested classes and modules.
+Sun Jun 22 09:05:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 26 18:21:29 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/common.rb (URI::REGEXP): move to lib/uri/rfc2396_parser.rb.
- * string.c (RESIZE_CAPA): check string attribute before modifying
- capacity member of string structure. [ruby-dev:24594]
+ * lib/uri/common.rb (URI::Parser): ditto.
-Tue Oct 26 11:33:26 2004 David G. Andersen <dga@lcs.mit.edu>
+ * lib/uri/common.rb (URI.split): use RFC3986_Parser. [Feature #2542]
- * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
- performance. [ruby-talk:117701]
+ * lib/uri/common.rb (URI.parse): ditto.
-Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/common.rb (URI.join): ditto.
- * sprintf.c (rb_f_sprintf): raise ArgumentError for extra
- arguments, unless (digit)$ style used.
+ * lib/uri/common.rb (URI.extract): deprecated.
-Tue Oct 26 11:33:26 2004 David G. Andersen <dga@lcs.mit.edu>
+ * lib/uri/common.rb (URI.regexp): ditto.
- * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
- performance. [ruby-talk:117701]
+ * lib/uri/rfc2396_parser.rb: added.
-Tue Oct 26 10:56:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/uri/rfc3986_parser.rb: added.
- * sprintf.c (rb_f_sprintf): raise ArgumentError for extra
- arguments, unless (digit)$ style used.
+Sun Jun 22 09:04:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Oct 25 18:35:39 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/uri/mailto.rb (initialize): as previous commit, fix arg_check
- * win32/win32.c (isUNCRoot): should check NUL after '.'.
- [ruby-dev:24590]
+Sun Jun 22 09:01:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (isUNCRoot): fixed buffer overrun.
+ * lib/uri/ftp.rb (initialize): argument checking flag is arg_check,
+ but arg[-1] is fragment.
-Mon Oct 25 08:03:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/ftp.rb (initialize): explicitly specify arguments.
- * eval.c (get_backtrace): ignore illegal backtrace. [ruby-dev:24587]
+Sat Jun 21 12:50:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 24 00:41:09 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
+ with 3-digit. libffi 3.1 returns just 2-digit.
+ [ruby-core:62920] [Bug #9897]
- * eval.c (rb_load, search_required, rb_require_safe, rb_require): use
- frozen shared string to avoid outside modification. [ruby-dev:24580]
+Sat Jun 21 07:06:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 23 22:18:32 2004 Guy Decoux <ts@moulon.inra.fr>
+ * encoding.c (enc_find): [DOC] never accepted a symbol.
+ [ruby-dev:48308] [Bug #9966]
- * eval.c (frame_free): Guy Decoux solved the leak problem.
- Thanks. [ruby-core:03549]
+Fri Jun 20 17:15:43 2014 Koichi Sasada <ko1@atdot.net>
-Sat Oct 23 00:20:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/lib/tracepointchecker.rb: add to check TracePoint healthiness.
- * ext/zlib/zlib.c (zstream_append_input): clear klass for z->input
- to avoid potential vulnerability.
+ * test/runner.rb: use it.
- * ext/zlib/zlib.c (zstream_run): always use zstream_append_input()
- to avoid SEGV. [ruby-dev:24568]
+Fri Jun 20 07:26:44 2014 Koichi Sasada <ko1@atdot.net>
-Fri Oct 22 12:02:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: rewrite tests with
+ assert_consistent_call_return().
- * eval.c (rb_alias): was warning for wrong condition.
- [ruby-dev:24565]
+ assert_consistent_call_return() is also modified to check
+ consistency.
-Fri Oct 22 10:36:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jun 20 07:07:28 2014 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#meta_vars):
- should check if path_info is not nil.
+ * compile.c (rb_iseq_compile_node): put start label of block after
+ trace (b_call).
+ [Bug #9964]
-Fri Oct 22 00:22:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add a test.
- * ext/zlib/zlib.c (zstream_shift_buffer): should restore class
- field of a buffer. [ruby-dev:24562]
+ added assert_consistent_call_return() method check call/return
+ consistency.
-Fri Oct 22 00:20:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 20 05:26:27 2014 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_include): should not treat char as negative value.
- [ruby-dev:24558]
+ * vm_eval.c (rb_catch_protect): fix same problem of [Bug #9961].
-Thu Oct 21 21:32:30 2004 IWATSUKI Hiroyuki <don@na.rim.or.jp>
+ * vm_eval.c (rb_iterate): ditto.
- * lib/pstore.rb (PStore#transaction): Use the empty content when a
- file is not found. [ruby-dev:24561]
+Thu Jun 19 21:41:30 2014 Koichi Sasada <ko1@atdot.net>
-Thu Oct 21 19:06:15 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * vm.c (rb_vm_rewind_cfp): add new function to rewind specified cfp
+ with invoking RUBY_EVENT_C_RETURN.
+ [Bug #9961]
- * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
- ensure to close @body. (http://bugs.debian.org/277520)
+ * vm_core.h: ditto.
-Thu Oct 21 00:36:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_protect): use it.
- * eval.c (rb_alias): should warn on method discarding.
- [ruby-dev:24546]
+ * eval.c (rb_rescue2): ditto.
- * ext/zlib/zlib.c (zstream_expand_buffer_into): hide internal
- string buffer by clearing klass. [ruby-dev:24548]
+ * vm_eval.c (rb_iterate): ditto.
-Wed Oct 20 19:45:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add a test.
- * string.c (str_gsub): reentrant check. [ruby-dev:24432]
+ * vm_core.h (rb_vm_rewind_cfp): add the prototype declaration.
- * backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536]
+Thu Jun 19 19:47:21 2014 Koichi Sasada <ko1@atdot.net>
-Wed Oct 20 04:17:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm.c (invoke_block_from_c): move call/return event timing for
+ bmethod. It can invoke inconsistent call event if this call raises
+ argument error.
+ [Bug #9959]
- * ext/dbm/dbm.c (fdbm_delete_if): should check if deleting element
- is a string. [ruby-dev:24490]
+ * vm_insnhelper.c (vm_call_bmethod_body): ditto.
- * ext/sdbm/init.c (fsdbm_delete_if): ditto.
+ * test/ruby/test_settracefunc.rb: add a test.
-Wed Oct 20 01:37:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Jun 19 18:14:47 2014 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_times): Array#* should return an instance of
- the class of right operand. [ruby-dev:24526]
+ * vm_core.h: add VM_FRAME_MAGIC_RESCUE to recognize normal block or
+ rescue clause.
- * ext/zlib/zlib.c (zstream_detach_buffer): should not expose
- class-less object to Ruby world. [ruby-dev:24530]
+ * vm.c (vm_exec): use VM_FRAME_MAGIC_RESCUE on at rescue/ensure.
- * eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915]
+ * test/ruby/test_settracefunc.rb: should not invoke b_return at rescue
+ clause.
+ [Bug #9957]
- * eval.c (ruby_exec): stack marking position may be higher than
- expected. thanks to Guy Decoux. [ruby-core:03527]
+ * vm_dump.c (control_frame_dump): check VM_FRAME_MAGIC_RESCUE.
-Tue Oct 19 22:43:12 2004 Dave Thomas <dave@pragprog.com>
+ * vm_dump.c (vm_stack_dump_each): ditto.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_attr): If
- we come across 'attr' in a context where it isn't
- followed by a symbol, just issue a warning.
+Thu Jun 19 13:39:11 2014 Arne Brasseur <arne@arnebrasseur.net>
-Tue Oct 19 20:41:37 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * proc.c (rb_method_curry): Implement Method#curry, which delegates
+ to to_proc.curry. [ruby-core:62212] [Feature #9783]
- * ext/win32ole.c(ole_invoke): retrieve the result value when
- retrying the IDispatch::invoke.
+Tue Jun 17 16:41:49 2014 Shugo Maeda <shugo@ruby-lang.org>
-Tue Oct 19 17:24:11 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/net/ftp.rb (gets, readline): read lines without LF properly.
+ [ruby-core:63205] [Bug #9949]
- * io.c (read_all): block string buffer modification during
- rb_io_fread() by freezing it temporarily. [ruby-dev:24479]
+ * test/net/ftp/test_buffered_socket.rb: related test.
- * dir.c (rb_push_glob): block call at once the end of method.
- [ruby-dev:24487]
+Tue Jun 17 12:35:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/enumerator/enumerator.c (enum_each_slice): remove
- rb_gc_force_recycle() to prevent potential SEGV.
- [ruby-dev:24499]
+ * eval.c (extract_raise_opts): pass unknown options to the
+ exception, so that exception class can receive a hash argument.
+ [ruby-core:63203] [Feature #8257]
- * ext/zlib/zlib.c (zstream_expand_buffer): hide internal string
- buffer by clearing klass. [ruby-dev:24510]
+Tue Jun 17 12:24:57 2014 Koichi Sasada <ko1@atdot.net>
-Tue Oct 19 16:12:18 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (obj_memsize_of): memsize_of(T_ZOMBIE) returns 0, not a rb_bug.
+ ObjectSpace.count_objects_size() uses memsize_of(T_ZOMBIE).
- * ext/tk/tkutil.c: backport from CVS HEAD
+ This bug introduced at r46348.
-Tue Oct 19 08:54:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 16 19:00:11 2014 Koichi Sasada <ko1@atdot.net>
- * intern.h, object.c (rb_class_inherited_p): export.
+ * test/runner.rb: failure message should be passed as an argument.
-Tue Oct 19 08:46:57 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 16 18:42:57 2014 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_upto): method result must be checked. [ruby-dev:24504]
+ * test/runner.rb: capture TracePoint stat before setup and compare
+ it after teardown.
- * eval.c (error_print): ditto. [ruby-dev:24519]
+Mon Jun 16 14:33:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 18 23:37:05 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (open): use UTF-8 version function to support
+ non-ascii path properly. [ruby-core:63185] [Bug #9946]
- * marshal.c (r_object0): check inheritance by the internal function.
- [ruby-dev:24515]
+Sat Jun 14 10:54:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 18 15:58:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * array.c (rcombinate0): remove recursion, by looping with indexes
+ stored in `p`.
- * range.c (range_step, range_each): need cast.
+ * array.c (rpermute0): remove recursion, by looping with indexes
+ stored in `p`.
-Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
+ * array.c (permute0): remove recursion, by looping with indexes
+ stored in `p`. [ruby-core:63103] [Bug #9932]
- * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
- line after opening heredoc identifier. [ruby-dev:24635]
+Sat Jun 14 10:52:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_resize): update capa only when buffer get
+ reallocated.
+ http://d.hatena.ne.jp/nagachika/20140613/ruby_trunk_changes_46413_46420#r46413
- * file.c (rb_file_truncate): discard read buffer before truncation.
- [ruby-dev:24197]
+Sat Jun 14 08:28:59 2014 Zachary Scott <e@zzak.io>
-Mon Oct 18 02:11:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * man/rake.1: [DOC] Update links for Rake, patch by @hsbt [Bug #9904]
+ [Fixes GH-628] https://github.com/ruby/ruby/pull/628
- * lib/webrick/config.rb (WEBrick::Config::General): add default values:
- - WEBrick::Config[:DoNotReverseLookup]
- - WEBrick::Config[:RequestCallback] (it used as an alias of
- :RequestHandler in WEBrick::HTTPServer#run)
- - WEBrick::Config::FileHandler[:AcceptableLanguages]
+Fri Jun 13 17:58:58 2014 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#set_filename): search files
- having suffix of language-name which Accept-Language header field
- includes if :AcceptableLanguages options is present.
+ * vm_trace.c: add new method TracePoint.stat to debug
+ TracePoint mechanism.
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#get_servlet): new method to
- search servlet correspond to the suffix of filename.
+ Ruby users should not use this method. So I don't note this method
+ in the NEWS file.
- * lib/webrick/httprequest.rb: add attributes access methods: accept,
- accept_charset, accept_encoding, accept_language, content_length
- and content_type.
+ * test/runner.rb: detect zombie active TracePoints with
+ TracePoint.stat.
- * lib/webrick/httpresponse.rb: add attribute access methods:
- content_length, content_length=, content_type and content_type=.
+Fri Jun 13 17:46:31 2014 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.mime_types):
- use the second suffix to detect media type. (the first suffix
- may be a language name.)
+ * vm_trace.c: clear and restore recursive checking thread local data
+ to avoid unexpected throw from TracePoint.
+ [Bug #9940]
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_qvalues):
- add method to parse Accept header field. it returns an Array of
- values sorted by the qvalues.
+ * test/ruby/test_settracefunc.rb: add a test.
-Mon Oct 18 02:04:11 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * thread.c: added
+ * rb_threadptr_reset_recursive_data(rb_thread_t *th);
+ * rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old);
- * lib/webrick/httpserver.rb (WEBrick::HTTPServer#virtual_host): new
- method to register virtual hosting servers.
+ * vm_core.h: ditto.
- * lib/webrick/server.rb (WEBrick::GenericServer#accept): call
- do_not_reverse_lookup for each socket if :DoNotReverseLookup
- is set. [ruby-core:02357]
+Fri Jun 13 17:33:14 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 18 00:42:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_combination): iterate on a shared copy, and use
+ array of indexes instead of array of chosen objects.
+ [ruby-core:63149] [Bug #9939]
- * ext/socket/socket.c (sock_s_getservbyaname): protocol string
- might be altered. [ruby-dev:24503]
+ * array.c (yield_indexed_values): extract from permute0(),
+ rpermute0(), and rcombinate0().
- * string.c (rb_str_upto): check if return value from succ is a
- string. [ruby-dev:24504]
+Fri Jun 13 13:42:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 17 23:03:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * array.c (rb_ary_permutation): `p` is the array of size `r`, as
+ commented at permute0(). since `n >= r` here, buffer overflow
+ never happened, just reduce unnecessary allocation though.
- * ext/tk/lib/tk/timer.rb: TkTimer#start and restart accept a block
+Thu Jun 12 20:32:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 17 13:05:04 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * string.c (rb_str_resize): should consider the capacity instead
+ of the old length, as pointed out by nagachika.
- * ext/win32ole/win32ole.c (fole_func_methods): correct argument mismatch.
- * ext/win32ole/win32ole.c (fole_get_methods): ditto.
- * ext/win32ole/win32ole.c (fole_put_methods): ditto.
- * ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE#ole_func_methods
- WIN32OLE#ole_get_methods, WIN32OLE#ole_put_methods
+Thu Jun 12 18:31:01 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sat Oct 16 14:45:28 2004 Kouhei Sutou <kou@cozmixng.org>
+ * lib/net/http/responses.rb: added Net::HTTPPermanentRedirect(308)
+ Contributed by @yorkie [fix GH-638]
- * lib/rss/0.9.rb (RSS::Rss#to_s): removed garbage.
+Thu Jun 12 13:27:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 16 13:42:49 2004 Kouhei Sutou <kou@cozmixng.org>
+ * string.c (rb_str_freeze): shrink the buffer before freezing, as
+ pointed out by Eric Wong at [ruby-core:63119].
- * lib/rss/: untabified.
- * test/rss/: untabified.
- * lib/rss/0.9.rb (RSS::Rss#to_s): inent -> indent.
+Thu Jun 12 13:09:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 16 13:34:56 2004 Kouhei Sutou <kou@cozmixng.org>
+ * file.c (expand_path): shrink expanded path which no longer needs
+ rooms to append. [ruby-core:63114] [Bug #9934]
- * lib/rss: supported prety print.
- * test/rss/test_1.0.rb: added test for calculating default indent size.
+Wed Jun 11 17:37:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 15 18:04:35 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * configure.in (rb_cv_scalar_pthread_t): pthread_t is not required
+ to be a scalar type.
- * ext/tk/lib/tk/timer.rb: TkTimer.new(interval, loop){ ... } is
- acceptable. Add TkTimer.start ( == new + start ).
+ * thread.c (fill_thread_id_string, thread_id_str): dump pthread_t
+ in hexadecimal form if it is not a scalar type, assume it can be
+ represented in a pointer form otherwise. based on the patch by
+ Rei Odaira at [ruby-core:62867]. [ruby-core:62857] [Bug #9884]
-Fri Oct 15 12:43:09 2004 Tanaka Akira <akr@m17n.org>
+ * thread_pthread.c (Init_native_thread, thread_start_func_1),
+ (native_thread_create): set thread_id_str if needed.
- * eval.c (Init_stack): make prototype declaration consistent with
- the definition in gc.c.
+ * vm_core.h (rb_thread_t): add thread_id_string if needed.
-Thu Oct 14 14:34:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Jun 11 01:53:22 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (MODE_BINMODE, MODE_BINARY): fixed reversed condition.
+ * gc.c: invoke GC before memory allocation (xmalloc/xrealloc)
+ when GC.stress = true.
+ [Bug #9859]
-Thu Oct 14 13:33:59 2004 Kouhei Sutou <kou@cozmixng.org>
+ * test/ruby/test_gc.rb: add a test.
- * lib/rss/rss.rb: added link to Tutorial.
+Tue Jun 10 13:20:14 2014 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-Mon Oct 11 13:48:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/cgi/core.rb: Provide a mechanism to specify the
+ max_multipart_length of multipart data.
+ [Feature #8370] patch by Leif Eriksen <leif.eriksen.au@gmail.com>
- * ext/tk/lib/tk/*: untabify
+Tue Jun 10 10:57:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 10 12:32:08 2004 Dave Thomas <dave@pragprog.com>
+ * lib/csv.rb (CSV#<<): honor explicitly given encoding. based on
+ the patch by DAISUKE TANIWAKI <daisuketaniwaki AT gmail.com> at
+ [ruby-core:62113]. [Bug #9766]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_require): Allow 'require'
- to be used as a variable name
+Mon Jun 9 20:40:48 2014 Koichi Sasada <ko1@atdot.net>
-Sat Oct 9 21:23:37 2004 Kouhei Sutou <kou@cozmixng.org>
+ * gc.c: change full GC timing to keep lower memory usage.
- * lib/rss/converter.rb: changed to try to use Iconv for default
- conversion.
+ Extend heap only at
+ (1) after major GC
+ or
+ (2) after several (two times, at current) minor GC
- * lib/rss/rss.rb: 0.0.9 -> 0.1.0.
+ Details in https://bugs.ruby-lang.org/issues/9607#note-9
+ [Bug #9607]
-Sat Oct 9 19:50:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 9 16:01:41 2014 Masahiro Ide <imasahiro9@gmail.com>
- * io.c (rb_io_getline): should not treat char as negative value.
- [ruby-dev:24460]
+ * gc.c (gcdebug_sentinel): fix typo, "sentinel" not "sential".
+ [fix GH-634]
-Fri Oct 8 09:49:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 9 00:04:25 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (pack_pack): pointer modification check before each
- iteration. [ruby-dev:24445]
+ * configure.in (posix_fadvise): disable use of posix_fadvise
+ itself on 32-bit AIX. [ruby-core:62968] [Bug #9914]
-Fri Oct 8 01:13:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Jun 8 23:28:00 2014 <kanemoto@ruby-lang.org>
- * ext/tk/lib/tk/optiondb.rb: make it more secure
+ * io.c (rb_io_advise): AIX currently does not support a 32-bit call to
+ posix_fadvise() if _LARGE_FILES is defined. Patch by Rei Odaira.
+ [ruby-core:62968] [Bug #9914]
-Thu Oct 7 23:47:57 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Jun 8 04:52:40 2014 Jun Hiroe <Jun.Hiroe@gmail.com>
- * ext/tk/lib/tk/scrollbar.rb: When 'set' operation, a scrollbar
- cannot propagate view port information from the source widget
- (that calls 'set') to other assigned widgets.
+ * string.c (rb_str_slice_bang): [DOC] update return value against
+ a fixnum, which has changed because of M17N. [fix GH-631]
-Thu Oct 7 17:36:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Jun 7 22:13:42 2014 Benoit Daloze <eregontp@gmail.com>
- * ext/tk/lib/tk.rb: When CHILDKILLED and so on, Tk.errorCode returns
- a Fixnum for 2nd element (it's pid) of the return value.
+ * numeric.c (do_coerce): Add a warning when an exception is raised
+ or an invalid value is returned in #coerce called by
+ numeric comparison operators and the exception
+ thrown by the caller has no information on the failure.
+ In the next release such exception should not be rescued or
+ should be the cause of the caller exception. nil is accepted
+ as the "no possible coercion" return value. See #7688.
-Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_numeric.rb: Add corresponding test.
- * io.c (io_read): should freeze buffer before thread context
- switch. [ruby-dev:24442]
+Sat Jun 7 18:15:33 2014 Benoit Daloze <eregontp@gmail.com>
- * pack.c (pack_unpack): string conversion should at the top of the
- method. [ruby-dev:24439]
+ * numeric.c (bit_coerce): remove constant parameter `err'
+ (always TRUE) of bit_coerce().
- * io.c (io_read): buffer should be frozen only after the length
- check. [ruby-dev:24440]
+Sat Jun 7 16:01:57 2014 Yutaka Kanemoto <kanemoto@ruby-lang.org>
-Thu Oct 7 02:56:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_fiber_struct): keep context.uc_stack.ss_sp and context.uc_stack.ss_size
+ for later use. Patch by Rei Odaira. [ruby-core:62945] [Bug #9905]
- * ext/stringio/stringio.c: use FMODE_APPEND.
+Sat Jun 7 12:51:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 7 01:05:33 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c (read_all): truncate the buffer before appending read data,
+ instead of truncating before reading.
+ [ruby-core:55951] [Bug #8625]
- * ext/tk/lib/tk.rb: add Tk.errorInfo and Tk.errorCode
+Sat Jun 7 12:28:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 7 00:08:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/digest/digest.c (rb_digest_instance_equal): no need to call
+ `to_s` twice. [Bug #9913]
- * io.c (rb_io_s_sysopen): preserve path in the buffer allocated by
- ALLOCA_N() to prevent modification. [ruby-dev:24438]
+Sat Jun 7 11:35:01 2014 Tanaka Akira <akr@fsij.org>
-Wed Oct 6 09:21:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * object.c (rb_mod_initialize_clone): Override Kernel#initialize_clone
+ to avoid an exception on Class.new.freeze.clone.to_s.
+ Reported by Andrew Grimm. [ruby-core:41858] [Bug #5828]
- * io.c (rb_io_mode_flags): preserve append mode flag.
- [ruby-dev:24436]
+Sat Jun 7 06:03:11 2014 Benoit Daloze <eregontp@gmail.com>
- * io.c (rb_io_modenum_mode): do not use external output buffer.
+ * ext/digest/digest.c (rb_digest_instance_equal):
+ fix #== for non-string arguments. [ruby-core:62967] [Bug #9913]
- * string.c (rb_str_justify): differ pointer retrieval to prevent
- padding string modification. [ruby-dev:24434]
+ * test/digest/test_digest.rb: add test for above.
- * range.c (range_each_func): allow func to terminate loop by
- returning RANGE_EACH_BREAK.
+Fri Jun 6 22:19:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]
+ * compile.c (private_recv_p): check by node type, instead of a
+ magic number.
-Mon Oct 4 14:04:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * node.h (NODE_PRIVATE_RECV), parse.y (attrset_gen): remove
- * io.c (rb_file_open_internal, rb_io_reopen): fname might be altered
- while GC. [ruby-dev:24408]
+Fri Jun 6 17:07:08 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 4 12:53:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * compile.c (iseq_compile_each), parse.y (new_attr_op_assign_gen):
+ allow op assign to a private attribute.
+ [ruby-core:62949] [Bug #9907]
- * ext/tk/lib/tk/optiondb.rb: support definition of command
- resources on widgets
+Fri Jun 6 13:39:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/image.rb: bug fix
+ * io.c (io_setstrbuf, io_read): should not shorten the given buffer until
+ read succeeds. [ruby-core:55951] [Bug #8625]
-Sun Oct 3 21:20:03 2004 Shugo Maeda <shugo@ruby-lang.org>
+Fri Jun 6 07:41:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/net/imap.rb (TEXT_REGEXP): allow 8-bit characters for the german
- version of Microsoft Exchange Server. (backported from HEAD)
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a
+ tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
+ * test/psych/test_symbol.rb: test for change
- * lib/net/imap.rb (RTEXT_REGEXP): ditto.
+Thu Jun 5 16:08:39 2014 Koichi Sasada <ko1@atdot.net>
- * lib/net/imap.rb (CTEXT_REGEXP): ditto.
+ * gc.c (gc_page_sweep): refactoring.
-Sat Oct 2 20:34:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_page_sweep): should not set, but add final_slots into
+ sweep_page->final_slots.
- * node.h (NEW_DVAR): extra semicolon.
+Thu Jun 5 14:36:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in (jemalloc): check for the header regardless drop-in
+ libjemalloc is found, for `malloc_conf` declaration.
- * marshal.c (r_byte): retrieve pointer from string value for each
- time. [ruby-dev:24404]
+ * version.c (ruby_show_version): show `malloc_conf` if set.
+ [Feature #9113]
- * marshal.c (r_bytes0): ditto.
+ * configure.in (with-jemalloc): also check for header, for ABIs
+ which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF
+ platforms. [ruby-core:62939] [Feature #9113]
- * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
+ * include/ruby/missing.h: include alternative malloc header to
+ replace memory management functions.
- * io.c (io_read): should freeze all reading buffer.
- [ruby-dev:24400]
+ * dln.c, io.c, parse.y, st.c: undef malloc family before
+ re-definition to suppress warnings.
- * string.c (rb_str_sum): should use bignums when bits is greater
- than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395]
+Thu Jun 5 12:52:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+ * man/ruby.1: remove rubyforge entry.
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+Thu Jun 5 12:45:32 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * string.c (rb_str_sum): wrong cast caused wrong result.
- [ruby-dev:24385]
+ * misc/README: use github link instead of rubyforge.
- * enum.c (enum_sort_by): hide temporary array from
- ObjectSpace.each_object. [ruby-dev:24386]
+Thu Jun 5 10:03:29 2014 Koichi Sasada <ko1@atdot.net>
- * string.c (rb_str_sum): check was done with false pointer.
- [ruby-dev:24383]
+ * gc.c (obj_free): check also FL_PROMOTED bit by RVALUE_OLD_P().
- * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+Thu Jun 5 03:45:28 2014 Eric Wong <e@80x24.org>
-Mon Oct 11 17:51:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: add --with-jemalloc option
+ [ruby-core:62912]
- * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to
- avoid mode string modification. [ruby-dev:24454]
+Wed Jun 4 22:28:14 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_io_getline_fast): should take delim as unsigned char to
- distinguish EOF and '\377'. [ruby-dev:24460]
+ * gc.c: introduce RZombie to manage zombie objects.
+ Rewrite finalizing logics with this type.
- * io.c (rb_io_getline): add check for RS modification.
- [ruby-dev:24461]
+ * gc.c (gc_verify_internal_consistency): verify zombie (finalizing)
+ objects count.
- * enum.c (enum_sort_by): use qsort() directly instead using
- rb_iterate(). [ruby-dev:24462]
+Wed Jun 4 22:09:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to
- prevent access to recycled object (via continuation for
- example). [ruby-dev:24463]
+ * re.c (match_aref, rb_reg_regsub): consider encoding of captured
+ names, encoding-incompatible should not match.
+ [ruby-dev:48278] [Bug #9903]
-Fri Oct 1 11:40:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 4 21:23:52 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe
- sourcefile string modification. [ruby-dev:24373]
+ * re.c (match_aref): should not ignore name after NUL byte.
+ [ruby-dev:48275] [Bug #9902]
- * io.c (io_read): block string buffer modification during
- rb_io_fread() by freezing it temporarily. [ruby-dev:24366]
+Wed Jun 4 04:08:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_s_popen): mode argument may be altered.
- [ruby-dev:24375]
+ * vm.c (core_hash_merge_kwd): should return the result hash, which
+ may be converted from and differ from the given argument.
+ [ruby-core:62921] [Bug #9898]
- * file.c (rb_file_s_basename): ext argument may be altered.
- [ruby-dev:24377]
+Tue Jun 3 23:32:34 2014 Tanaka Akira <akr@fsij.org>
- * enum.c (enum_sort_by): use NODE instead of 2 element arrays.
- [ruby-dev:24378]
+ * ruby.c (load_file_internal2): Extracted from load_file_internal.
+ (load_file_internal): Invoke load_file_internal2 using rb_protect.
+ Close an opened FD if load_file_internal2 raises an exception.
- * string.c (rb_str_chomp_bang): StringValue() may change the
- receiver. [ruby-dev:24371]
+Tue Jun 3 19:11:45 2014 Koichi Sasada <ko1@atdot.net>
-Fri Oct 1 11:25:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (rb_objspace_free): should not rest_sweep() here.
+ Some data structures are already freed.
- * ext/tk/lib/tk/grid.rb: revive TkGrid.grid
+Tue Jun 3 18:43:51 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk/pack.rb: revive TkPack.pack
+ * test/ruby/test_gc.rb: allocate more objects to invoke GC by newobj.
+ GC allows extending pages depends on heap_increment.
- * ext/tk/lib/tk/place.rb: revive TkPlace.place
+Tue Jun 3 18:01:27 2014 Koichi Sasada <ko1@atdot.net>
-Thu Sep 30 00:50:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * gc.c (rb_gc_call_finalizer_at_exit): add
+ gc_verify_internal_consistency() when RGENGC_CHECK_MODE >= 2.
- * ext/tcltklib/tcltklib.c (ip_init): bug fix
+Tue Jun 3 17:54:21 2014 Koichi Sasada <ko1@atdot.net>
- * ext/tk/tkutil.c (get_eval_string_core): accept a Regexp object
+ * gc.c: change the counting method for young objects.
+ clear counter at the beginning of every GC and
+ count promoted (infant->young) objects.
- * ext/tk/lib/multi-tk.rb: fix bug on 'exit' operation
+ Some promotions (infant->young) are transition of promoting to old
+ objects. We should not count such promotions.
- * ext/tk/lib/tk/text.rb: 'tksearch' accepts a Regexp object as a
- matting pattern argument
+ With this technique, we don't need to check young objects
+ at obj_free().
-Wed Sep 29 10:58:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 3 16:38:19 2014 Koichi Sasada <ko1@atdot.net>
- * enum.c (sort_by_i): internally used object must not be changed
- outside. [ruby-dev:24368]
+ * gc.c: add verifying counters code in gc_verify_internal_consistency().
+ gc_verify_internal_consistency() counts all
+ - live objects
+ - young objects (if age2 promotion)
+ - old objects
+ in all pages and compares with objspace managing counters.
-Mon Sep 27 13:46:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_after_sweep): do gc_verify_internal_consistency()
+ when RGENGC_CHECK_MODE >= 2.
- * intern.h, struct.c (rb_struct_s_members, rb_struct_members): public
- accessors. [ruby-dev:24342]
+Tue Jun 3 13:14:04 2014 Shugo Maeda <shugo@ruby-lang.org>
- * marshal.c (w_object, r_object0): use accessors.
+ * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body
+ type as "MIXED" followed immediately by params
+ [ruby-core:62864] [Bug #9885]
+ Patch by @rayners (David Raynes). [Fixes GH-622]
+ https://github.com/ruby/ruby/pull/622
-Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 3 13:18:24 2014 Koichi Sasada <ko1@atdot.net>
- * ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
- [ruby-talk:113807]
+ * gc.c (objspace_live_slot): live slot count should not include final
+ slot (contains T_ZOMBIE) count.
-Fri Sep 24 16:09:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 3 13:03:21 2014 Koichi Sasada <ko1@atdot.net>
- * eval.c (proc_invoke): propagate DVAR_DONT_RECYCLE on termination
- to avoid double call to rb_gc_force_recycle(). [ruby-dev:24311]
+ * gc.c (obj_free): fix spacing.
-Fri Sep 24 08:29:45 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jun 3 12:59:32 2014 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_subseq): original object might be modified after
- sharing data creation. [ruby-dev:24327]
+ * gc.c (check_gen_consistency): fix error message.
- * array.c (rb_ary_replace): ditto.
+Tue Jun 3 12:40:23 2014 Koichi Sasada <ko1@atdot.net>
- * array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]
+ * gc.c: count old/young objects more correctly.
- * struct.c (struct_members): always check struct size and size of
- members list in the class. [ruby-dev:24320]
+ * gc.c (RVALUE_DEMOTE_FROM_OLD): decrement old object count.
-Thu Sep 23 09:29:14 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (RVALUE_DEMOTE_FROM_YOUNG): decrement young object count.
- * string.c (rb_str_sub_bang): check if string is not modified
- during iteration. [ruby-dev:24315]
+ * gc.c (rb_gc_resurrect): increment old object count.
- * hash.c (rb_hash_rehash): replace st_foreach() by its deep
- checking counterpart. [ruby-dev:24310]
+ * gc.c (gc_marks_body): should not add old object count.
+ This code is completely my misunderstanding.
-Wed Sep 22 13:38:12 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (rb_gc_force_recycle): decrement young or old object count
+ correctly.
- * hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]
+Tue Jun 3 12:26:47 2014 Koichi Sasada <ko1@atdot.net>
- * st.c (st_foreach): add deep check.
+ * test/ruby/memory_status.rb: add $LOAD_PATH to load test/unit
+ correctly for fiddle/import unavailable environments.
-Wed Sep 22 13:06:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jun 3 09:45:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c (rb_w32_call_handler): workaround for Ctrl-C.
- merge from HEAD.
+ * test/openssl/test_ssl.rb (OpenSSL::TestSSL#test_verify_result):
+ shouldn't use same server for respective tests, because the 1st
+ test sometimes kills the server main loop silently.
+ [Bug #9881] [ruby-dev:48266]
-Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
+Tue Jun 3 01:34:59 2014 Zachary Scott <e@zzak.io>
- * process.c: Add documentation for fork()
+ * README.EXT: [DOC] Add rb_call_super when subclassing from @robin850
+ [Fixes GH-623] https://github.com/ruby/ruby/pull/623
-Wed Sep 22 09:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 2 17:14:49 2014 Koichi Sasada <ko1@atdot.net>
- * array.c (rb_ary_collect_bang): element size might change during
- comparison. [ruby-dev:24300]
+ * vm.c (ruby_vm_destruct): remove useless call of
+ rb_gc_force_recycle().
- * array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300]
+ At this line, a VM object is already freed
+ (is changed to T_NONE) by rb_gc_call_finalizer_at_exit().
- * array.c (rb_ary_eql): ditto. [ruby-dev:24300]
+Mon Jun 2 15:50:24 2014 Koichi Sasada <ko1@atdot.net>
-Tue Sep 21 18:29:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_using_refinement): add write-barriers for
+ cref->nd_refinements.
- * array.c (rb_ary_equal): merge miss.
+Mon Jun 2 12:26:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * array.c (rb_ary_uniq_bang): element size might change during
- comparison. [ruby-dev:24298]
+ * CONTRIBUTING.md: added contributing guide for github. [fix GH-625]
-Mon Sep 20 00:24:19 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Jun 2 07:30:33 2014 Tanaka Akira <akr@fsij.org>
- * enum.c (enum_sort_by): do not use qsort directly. use
- rb_ary_sort_bang() instead. [ruby-dev:24291]
+ * test/ruby/envutil.rb (default_warning): New method.
- * enum.c (enum_sort_by): pedantic type check added.
- [ruby-dev:24291]
+ * test/ruby/test_autoload.rb: Use EnvUtil.default_warning.
- * hash.c (rb_hash_foreach_iter): check iter_lev after each
- iteration. [ruby-dev:24289]
+Mon Jun 2 07:05:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_and): element size might change during
- comparison. [ruby-dev:24290]
+ * include/ruby/encoding.h: constify `rb_encoding` arguments.
- * array.c (rb_ary_or): ditto. [ruby-dev:24292]
+ * include/ruby/oniguruma.h: constify `OnigEncoding` arguments.
- * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]
+Sun Jun 1 12:05:10 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 18 15:02:22 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/drb: Wrap tests definitions by DRbTests module. This makes
+ several tests (ACLEntryTest, TestBug4409, etc.) easier to understand
+ that they are tests for DRb.
- * array.c (rb_ary_equal): element size might change during
- comparison. [ruby-dev:24254]
+Sun Jun 1 11:36:25 2014 Tanaka Akira <akr@fsij.org>
- * array.c (rb_ary_diff): ditto. [ruby-dev:24274]
+ * lib/rinda/ring.rb (RingFinger#make_socket): Close the socket on
+ exception.
- * array.c (rb_ary_select): ditto. [ruby-dev:24278]
+Sun Jun 1 06:55:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_delete): ditto. [ruby-dev:24283]
+ * parse.y (intern_str): dynamic attrset ID is registered by
+ `rb_id_attrset()` already, so no further registration is needed.
+ [ruby-core:62861]
- * array.c (rb_ary_rindex): ditto. [ruby-dev:24275]
+Sun Jun 1 04:52:47 2014 Zachary Scott <e@zzak.io>
- * array.c (rb_ary_initialize): element size might change during
- initializing block. [ruby-dev:24284]
+ * lib/English.rb: [DOC] $LOADED_FEATURES moved to load.c [Fixes GH-620]
+ Patch submitted by @leafac in https://github.com/ruby/ruby/pull/620
+ * doc/globals.rdoc: Added $LOADED_FEATURES to list
-Sat Sep 18 14:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat May 31 22:30:14 2014 Tanaka Akira <akr@fsij.org>
- * dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to
- the original directory when exception has caused in changing
- direcotry or within block. thanks to Johan Holmberg
- <holmberg@iar.se> [ruby-core:03446]
+ * test/lib/leakchecker.rb: Leak checker extracted from
+ test/lib/minitest/unit.rb.
-Fri Sep 17 20:20:27 2004 Minero Aoki <aamine@loveruby.net>
+Sat May 31 21:15:43 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/fileutils.rb (mkdir_p): backport from CVS HEAD 1.45. [ruby-core:03420]
+ * thread.c (rb_thread_atfork_internal): My compiler complains
+ about this variable being used before initialized. I looked at
+ the code and expanded the macro and turned out it was actually
+ USED for pointer arithmetic, not dereferenced. So this was
+ never a serious bug. But is annoying indeed to see warnings
+ every time. I added `=0` and all went healthy.
-Fri Sep 17 17:11:08 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: Also, I found that the problematic macro expansion
+ only happens when we lack __typeof__ C extension, which shall
+ not be the case of my compiler. I added AC_C_TYPEOF to kick ass.
- * array.c (rb_ary_delete): element comparison might change array
- size. [ruby-dev:24273]
+Sat May 31 16:32:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * file.c (rb_file_truncate): clear stdio buffer before truncating
- the file. [ruby-dev:24191]
+ * lib/ipaddr.rb: extracted inline tests into test dir.
+ * test/test_ipaddr.rb: ditto.
- * ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
- which might return singleton class. [ruby-dev:24202]
+Sat May 31 16:29:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Sep 17 16:07:09 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/digest/lib/digest/hmac.rb: extracted inline tests into test dir.
+ * test/digest/test_digest_hmac.rb: ditto.
- * ext/tk/lib/multi-tk.rb: improve exit operation
+Sat May 31 16:02:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Fri Sep 17 15:01:57 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/test_syslog.rb: remove executable.
- * ext/tcltklib/tcltklib.c: fix SEGV when (thread_)vwait or
- (thread_)tkwait
+Sat May 31 08:58:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk.rb: add alias wait_window to wait_destroy
+ * enc/unicode.c (init_case_fold_table): no longer need to
+ initialize tables at runtime.
- * ext/tk/lib/multi-tk.rb: support calling 'mainloop' on slave
- interpreters (however, the 'real' eventloop must be run on the
- Default Master IP)
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 3.
- * ext/tk/lib/remote-tk.rb: follow the changes of ext/tk/lib/multi-tk.rb
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 2.
- * ext/tk/sample/remote-ip_sample2.rb: ditto
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case unfolding table 1.
- * ext/tk/sample/tkoptdb-safeTk.rb: ditto
+ * enc/unicode/case-folding.rb (lookup_hash): make perfect hash to
+ lookup case folding table.
-Thu Sep 16 18:12:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * enc/unicode/case-folding.rb (print_table): merge non-locale and
+ locale tables, and reduce initializing loops.
- * lib/webrick/cgi.rb (WEBrick::CGI#start): should set REMOTE_USER
- to request.user attribute.
+ * enc/unicode/case-folding.rb (CaseFolding): modularize, and add
+ --output-file option.
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::FileHandler#initialize): should expand
- the pathname of document root directory.
+ * enc/unicode/case-folding.rb: script to convert CaseFolding.txt,
+ translated from CaseFolding.py.
-Thu Sep 16 15:49:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat May 31 08:31:41 2014 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_intern): protect string argument from GC.
- [ruby-core:03411]
+ * test/lib/minitest/unit.rb: Check Tempfile leaks for each test method
+ again.
-Wed Sep 15 20:22:23 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat May 31 03:50:50 2014 Zachary Scott <e@zzak.io>
- * ext/tk/sample/tkoptdb-safeTk.rb: fix a bug depend on the changes
- of MultiTkIp
+ * lib/delegate.rb: [DOC] Document raise in Delegator class
+ Patch by @lucasmazza. [Fixes GH-621]
+ https://github.com/ruby/ruby/pull/621
-Tue Sep 14 23:54:11 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 30 21:23:26 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string was en-bugged by
- the previous changes.
+ * lib/webrick/server.rb: Use a pipe to detect server shutdown.
+ shutdown() or close() for listening socket is not a reliable.
+ Actually, both doesn't work (doesn't wake up select()) on
+ DragonFly BSD 3.6.2.
-Tue Sep 14 23:45:44 2004 Dave Thomas <dave@pragprog.com>
+ * test/webrick/utils.rb: :ShutdownSocketWithoutClose is not required
+ now to immediate server shutdown detection.
+ This fixes fd leaks.
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::TextFormatter.for):
- Add Eric Hodel's simpleformatter.
+ * test/net/http/utils.rb: Ditto.
-Tue Sep 14 16:59:37 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 30 20:58:37 2014 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c: fix SEGV
+ * test/lib/minitest/unit.rb (check_fd_leak): Sort the inspected
+ objects list for a FD.
- * ext/tk/lib/multi-tk.rb: improve safe-level handling of argument proc
+Fri May 30 18:06:55 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/multi-ip_sample.rb: rename of old 'safe-tk.rb'
+ * test/lib/minitest/unit.rb (check_fd_leak): Try GC to delete leaked
+ FDs.
- * ext/tk/sample/safe-tk.rb: new sample script
+Fri May 30 12:05:59 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Sep 14 00:15:15 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/lib/test/unit/parallel.rb (_run_suite): orig_stdout may be nil
+ though I don't know the reason.
- * ext/zlib/zlib.c: backported from HEAD.
+Fri May 30 11:33:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 13 19:16:33 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * string.c (rb_str_substr): need to reset code range for shared
+ string too, not only copied string.
+ [ruby-core:62842] [Bug #9882]
- * eval.c (blk_copy_prev): need frame_dup(). [ruby-dev:24103]
+Fri May 30 10:22:21 2014 Mark Lorenz <mlorenz@covermymeds.com>
-Mon Sep 13 16:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/erb.rb (result): [DOC] no longer accepts a Proc, as
+ Kernel.eval does not. [fix GH-619]
- * ext/tk/lib/multi-tk.rb: MultiTkIp.new_master and new_slave accept
- safe-level value argument
+Fri May 30 07:25:46 2014 Tanaka Akira <akr@fsij.org>
-Mon Sep 13 10:20:45 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/-test-/dir: Dir#fileno implemented.
- * object.c (nil_inspect): fix typo.
+ * test/lib/minitest/unit.rb (find_fds): Don't return the fd used to
+ scan /proc/$$/fd.
-Mon Sep 13 01:03:02 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri May 30 04:48:00 2014 Eric Wong <e@80x24.org>
- * ext/tcltklib/tcltklib.c: improve control of preserv/release tcltkip
+ * parse.y (rb_gc_mark_parser): remove, empty since r8758
+ * internal.h: ditto, not usable from extensions since 2.0.0
+ * gc.c (gc_mark_roots): remove checkpoint for parser
- * ext/tcltklib/tcltklib.c: store original 'exit' command
+Thu May 29 23:27:50 2014 Rei Odaira <Rei.Odaira@gmail.com>
- * ext/tk/tkutil.c: fix(?) SEGV
+ * signal.c (ruby_signal): should return either `old.sa_sigaction`
+ or `old.sa_handler`, depending on whether `SA_SIGINFO` is set in
+ `old.sa_flags`, because they may not be a union.
+ [ruby-core:62836] [Bug #9878]
-Sun Sep 12 23:46:23 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Thu May 29 23:11:20 2014 Tanaka Akira <akr@fsij.org>
- * util.c (ruby_strdup): remove unnecessary code. (xmalloc never
- returns NULL.)
+ * io.c (pipe_open): Close pipes when rb_execarg_fixup() raises
+ an exception.
+ (rb_execarg_fixup_v): New function.
- * util.c (ruby_getcwd): fix memory leak on failure.
+Thu May 29 22:18:57 2014 Tanaka Akira <akr@fsij.org>
-Sun Sep 12 02:41:58 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/lib/minitest/unit.rb (capture_subprocess_io): Close fds.
- * ext/tcltklib/tcltklib.c: add TclTkIp#allow_ruby_exit? and
- allow_ruby_exit=
+Thu May 29 19:47:08 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/multi-tk.rb: ditto.
+ * io.c (rb_io_s_pipe): Close pipes if io_encoding_set() raises an
+ exception.
+ (io_encoding_set_v): New function.
- * ext/tk/lib/remote-tk.rb: ditto.
+Thu May 29 19:42:49 2014 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/MANUAL.euc: ditto.
+ * lib/csv.rb (CSV.open): Close the opened file when an exception
+ occur.
- * ext/tcltklib/MANUAL.eng: ditto.
+Thu May 29 19:31:10 2014 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c: fix some reasons of SEGV
+ * ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): Close a socket
+ if any exception occur.
- * ext/tk/tkutil.c: ditto.
+Thu May 29 05:05:29 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/multi-tk.rb: ditto.
+ * include/ruby/ruby.h: Hide Symbol internals.
+ (struct RSymbol): moved to internal.h
+ (RSYMBOL): ditto
- * ext/tk/lib/tk/timer.rb: ditto.
+Thu May 29 00:28:56 2014 Tanaka Akira <akr@fsij.org>
-Sat Sep 11 16:09:46 2004 Dave Thomas <dave@pragprog.com>
+ * ext/socket/unixsocket.c (rsock_init_unixsock): Open a socket
+ after path length check.
+ This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path.
- * lib/rdoc/parsers/parse_rb.rb: Fix up cross-file class merging.
+Wed May 28 23:04:35 2014 Tanaka Akira <akr@fsij.org>
-Fri Sep 10 20:20:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): Use
+ ObjectSpace.each_object to close files.
+ GC.start is not reliable.
- * ext/tcltklib/tcltklib.c (lib_merge_tklist): fix suspicious
- pointer conversion.
+Wed May 28 19:00:31 2014 Tanaka Akira <akr@fsij.org>
-Fri Sep 10 02:43:54 2004 Dave Thomas <dave@pragprog.com>
+ * lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket when
+ any exception occur.
+ This fixes a fd leak by IMAPTest#test_imaps_post_connection_check
+ which start_tls_session() raises an exception.
- * lib/rdoc/generators/template/kilmer.rb: James Buck's
- patch for call-seq.
+Wed May 28 18:06:13 2014 Tanaka Akira <akr@fsij.org>
-Thu Sep 9 13:58:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_close): Fix sync_close to work
+ when SSL is not started.
+ This fix the fd leak by test_https_proxy_authentication in
+ test/net/http/test_https_proxy.rb.
- * ext/tcltklib/tcltklib.c (ip_init): change flag value for setting
- 'argv' and 'argv0' variable
+Wed May 28 10:29:28 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/remote-tk.rb: follow changes of multi-tk.rb
+ * vm.c (rb_vm_living_threads_foreach): remove function
+ [ruby-core:62745]
+ * thread.c (terminate_i): remove
+ * thread.c (terminate_all): implement (inlines old terminate_i)
+ * thread.c (rb_thread_terminate_all): use terminate_all
+ * thread.c (rb_thread_fd_close_i): remove
+ * thread.c (rb_thread_fd_close): iterate inline
+ * thread.c (thread_list_i): remove
+ * thread.c (rb_thread_list): iterate inline
+ * thread.c (rb_thread_atfork_internal): iterate inline
+ * thread.c (terminate_atfork_i): update types to remove casts
+ * thread.c (terminate_atfork_before_exec_i): ditto
+ * thread.c (struct thgroup_list_params): remove definition
+ * thread.c (thgroup_list_i): remove
+ * thread.c (thgroup_list): iterate inline
+ * thread.c (check_deadlock_i): remove
+ * thread.c (debug_deadlock_check): implement (inlines check_deadlock_i)
+ * thread.c (debug_i): remove
+ * thread.c (rb_check_deadlock): iterate inline
+ * vm.c (vm_mark_each_thread_func): remove
+ * vm.c (rb_vm_mark): iterate inline
+ * vm_core.h (rb_vm_living_threads_remove): remove
+ * vm_trace.c (clear_trace_func_i): remove
+ * vm_trace.c (rb_clear_trace_func): iterate inline
-Thu Sep 9 11:46:18 2004 Dave Thomas <dave@pragprog.com>
+Wed May 28 09:30:51 2014 Eric Wong <e@80x24.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_classes): Allow
- spaces aroun parameter to define_method_under (James Buck)
+ * signal.c (signal_exec): ignore immediate cmd for SIG_IGN
+ * signal.c (trap_handler): set cmd to true for SIG_IGN
+ * signal.c (trap): handle nil and true values for oldcmd
+ [Bug #9835]
-Wed Sep 8 18:44:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 28 01:02:54 2014 Tanaka Akira <akr@fsij.org>
- * ext/stringio/stringio.c (strio_write): zero fill a gap if exsts.
- [ruby-dev:24190]
+ * lib/tempfile.rb (Tempfile#inspect): Show "(closed)" if the tempfile
+ is closed.
-Wed Sep 8 15:19:49 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed May 28 00:38:09 2014 Tanaka Akira <akr@fsij.org>
- * ext/tcltklib/tcltklib.c (ip_init): cannot create a IP at level 4
+ * test/lib/minitest/unit.rb: Use Tempfile#close! instead of
+ Tempfile#unlink to close file descriptors.
- * ext/tk/lib/multi-tk.rb: improve 'exit' operation, security check,
- and error treatment
+ * test/openssl/test_config.rb: Ditto.
- * ext/tk/lib/multi-tk.rb: allow a trusted slave IP to create slave IPs
+ * test/ruby/test_io.rb: Ditto.
- * ext/tk/lib/tk/listbox.rb: add TkListbox#value, value=, clear, and
- erase
+Wed May 28 00:06:18 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk/text.rb: add TkText#clear and erase
+ * lib/net/ftp.rb (transfercmd): Close TCP server socket even if an
+ exception occur.
-Tue Sep 7 15:17:49 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 27 23:50:07 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (ruby_connect): break immediately if a
- socket is non-blocking. [ruby-talk:111654]
+ * lib/cgi/core.rb: Use Tempfile#close! instead of Tempfile#unlink
+ to close file descriptors.
-Mon Sep 6 11:08:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Tue May 27 23:06:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tk/menu.rb(TkOptionMenubutton#insert): call correct method
+ * parse.y (parser_number_literal_suffix): refine error message for
+ extra dot and digits.
-Mon Sep 6 11:00:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue May 27 22:44:20 2014 Tanaka Akira <akr@fsij.org>
- * dir.c (dir_s_chdir): the patch to shut up false warning when
- exception occurred within a block. a patch was given from Johan
- Holmberg <holmberg at iar.se>. [ruby-core:03292]
+ * test/rexml: Avoid fd leaks.
-Mon Sep 6 07:51:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue May 27 22:24:25 2014 Kouhei Sutou <kou@cozmixng.org>
- * eval.c (cvar_cbase): singletons should refer outer cvar scope.
- [ruby-dev:24223]
+ * test/rexml/test_document.rb: Indent.
- * eval.c (rb_load): should preserve previous ruby_wrapper value.
- [ruby-dev:24226]
+Tue May 27 22:15:29 2014 Kouhei Sutou <kou@cozmixng.org>
-Sat Sep 4 01:14:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_document.rb: Wrap by REXMLTests module.
- * eval.c (cvar_cbase): class variables cause SEGV in
- instance_eval() for fixnums and symbols. [ruby-dev:24213]
+Tue May 27 22:11:10 2014 Kouhei Sutou <kou@cozmixng.org>
-Fri Sep 3 17:47:58 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rexml/test_encoding_2.rb: Remove a needless file.
- * struct.c (make_struct): remove redefining constant when
- conflict. [ruby-dev:24210]
+Tue May 27 22:10:30 2014 Kouhei Sutou <kou@cozmixng.org>
-Fri Sep 3 11:31:44 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/rexml/test_contrib.rb: Indent.
- * ext/tk/lib/tk.rb: Tk.after makes TkCore::INTERP.tk_cmd_tbl grow
- [ruby-dev:24207]
+Tue May 27 21:28:16 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Sep 3 02:12:48 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.
- * ext/tcltklib/tcltklib.c: fix typo [ruby-talk:111266]
+Tue May 27 21:03:03 2014 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/lib/tk/text.rb: fix typo
+ * test/rexml/: Use REXMLTests as wrapping module for REXML tests.
+ I avoid using the same module for library in test because
+ it provides "include REXML" environment in test. Normally,
+ users don't use REXML on "include REXML" environment. So I
+ don't want to write tests on "include REXML" environment.
- * ext/tk/lib/multi-tk.rb: improve safe-level treatment on slave IPs
+Tue May 27 20:59:37 2014 Kouhei Sutou <kou@cozmixng.org>
-Fri Sep 3 01:54:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/rexml/test_comment.rb: Remove needless REXML module wrapping.
- * ext/extmk.rb: already built-in libraries satisfy dependencies.
- [ruby-dev:24028]
+Tue May 27 20:56:49 2014 Kouhei Sutou <kou@cozmixng.org>
-Thu Sep 2 11:36:20 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/openssl/test_pkcs7.rb: Fix inverted expected and actual values.
- * eval.c (rb_obj_instance_eval): backported from HEAD.
+Tue May 27 20:26:06 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Sep 1 21:18:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): some opened fds are
+ remain before GC, so unlink the tempfile is failed.
- * ext/tk/lib/tk/spinbox.rb: fix typo
+Tue May 27 19:07:26 2014 Tanaka Akira <akr@fsij.org>
-Tue Aug 31 18:24:04 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * io.c (rb_io_autoclose_p): Don't raise on frozen IO.
- * ext/tk/tkutil.c (cbsubst_init): fix memory leak
+ * test/lib/minitest/unit.rb: IO#autoclose? may raise IOError.
- * ext/tk/tkutil.c (cbsubst_get_all_subst_keys): fix SEGV
+Tue May 27 19:01:49 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Aug 31 16:04:22 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (ip_delete): when a tcltkip is deleted,
- destroy its root widget
-
-Tue Aug 31 12:30:36 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (del_root): fix SEGV
-
-Mon Aug 30 23:11:06 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/ri/ri_driver.rb (and others): ri now merges documentation
- if it finds the same class in multiple places.
-
-Mon Aug 30 22:40:30 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
-
-Mon Aug 30 21:50:14 2004 Dave Thomas <dave@pragprog.com>
-
- * object.c: Add RDoc for Module.included.
-
-Mon Aug 30 15:10:46 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (GNU/k*BSD): fixed FTBFS on GNU/k*BSD. [ruby-dev:24051]
-
-Mon Aug 30 11:29:35 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (CreateChild): strip trailing spaces. [ruby-dev:24143]
- merge from HEAD.
-
-Sun Aug 29 14:08:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: compile error on bcc32 [ruby-dev:24081]
-
- * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string does not work
-
-Sat Aug 28 23:04:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_and): protect parameters from GC.
- [ruby-talk:110664]
-
-Thu Aug 26 04:38:29 2004 Dave Thomas <dave@pragprog.com>
-
- * eval.c (return_jump): Minor typo in error message. Now reads
- "return can't jump across threads".
-
-Tue Aug 24 17:30:00 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/cgi/session.rb (CGI::Session::FileStore#initialize): do not
- use a session id as a filename. (backported from HEAD)
-
- * lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): ditto.
-
- * lib/cgi/session/pstore.rb (CGI::Session::PStore#initialize): use
- Dir::tmpdir. (backported from HEAD)
-
-Tue Aug 24 14:40:16 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/cgi/session.rb (CGI::Session::FileStore#initialize): untaint
- session id after check. (backported from HEAD)
-
-Tue Aug 24 09:09:01 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
- functions may replace the pointer indicated by the first argument.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
-
-Mon Aug 23 14:04:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read):
- - should return an empty string if specified length to read is 0.
- - should check for pending data and wait for fd before reading.
- - call underlying IO's sysread if SSL session is not started.
- [ruby-dev:24072], [ruby-dev:24075]
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_write):
- - call underlying IO's syswrite if SSL session is not started.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_pending): new method
- OpenSSL::SSL#pending.
-
- * ext/openssl/lib/openssl/buffering.rb: should not use select.
-
-Mon Aug 23 12:40:56 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/resolv.rb (Config.default_config_hash): when multiple domains
- are set, Win32::Resolv.get_resolv_info returns Array.
-
-Sun Aug 22 01:15:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_connect):
- should call :ProxyContentHandler before finishing CONNECT.
-
-Sat Aug 21 06:41:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tcltklib/extconf.rb (find_tcl, find_tk): find stub library.
-
- * lib/mkmf.rb (arg_config, with_config): deal with '-' and '_'
- uniformly. [ruby-dev:24118]
-
-Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
-
- * ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
-
- * ext/tk/lib/menu.rb: typo bug.
-
-Thu Aug 19 15:15:24 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * dir.c (free_dir): fix memory leak. reported by yamamoto
- madoka.
-
-Thu Aug 19 11:00:00 2004 Akiyoshi, Masamichi <masamichi.akiyoshi@hp.com>
-
- * dln.c (dln_load): Modify to call lib$find_image_symbol for VMS.
- * io.c (rb_io_fwrite): Use fputc() for VMS non-stream file.
-
-Thu Aug 19 06:07:45 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/token.c: re2c no longer compiled with bit vectors. caused
- problems for non-ascii characters. [ruby-core:03280]
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
-
- * lib/yaml/baseemitter.rb: folding now handles double-quoted strings,
- fixed problem with extra line feeds at end of folding, whitespace
- opening scalar blocks.
-
- * lib/yaml/rubytypes.rb: subtelties in handling strings with
- non-printable characters and odd whitespace patterns.
-
-Wed Aug 18 23:41:33 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/protocol.rb (rbuf_fill): OpenSSL::SSL::SSLSocket has its own
- buffer, select(2) might not work. [ruby-dev:24072]
-
-Wed Aug 18 17:10:12 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/tcltklib/stubs.c (ruby_tcltk_stubs): need to call
- Tcl_FindExecutable() for Tcl/Tk 8.4.
-
-Wed Aug 18 12:52:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_obj_instance_eval): evaluates under special singleton
- classes as for special constants.
-
-Tue Aug 17 17:20:59 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_reopen): should clear allocated OpenFile. pointed
- out by Guy Decoux. [ruby-core:03288]
-
-Tue Aug 17 01:36:32 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/usage.rb: Remove extra indent. Tidy 'ri' option
- parsing so RDoc::usage plays better with OptionParser.
-
-Sat Aug 14 13:09:10 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb: backport from CVS HEAD (rev1.44).
-
- * lib/fileutils.rb: cp_r should copy symlink itself, except cp_r
- root.
-
- * lib/fileutils.rb: new option mv :force.
-
- * lib/fileutils.rb: new module FileUtils::DryRun.
-
-Sat Aug 14 02:48:16 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/usage.rb: Added. Allows command line programs
- to report usage using their initial RDoc comment.
-
-Fri Aug 13 13:23:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_range_header):
- fix regex for range-spec.
-
- * lib/webrick/httpservlet/filehandler.rb
- (WEBrick::HTTPServlet::DefaultFileHandler#make_partial_content):
- multipart/byteranges response was broken.
-
- * lib/webrick/httpservlet/erbhandler.rb
- (WEBrick::HTTPServlet::ERBHandler#do_GET): should select media type
- by suffix of script filename.
-
- * lib/xmlrpc/server.rb: refine example code.
-
-Wed Aug 11 17:17:50 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (RPATHFLAG): stop setting RPATHFLAG on Interix.
-
-Sun Aug 8 00:43:31 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/implicit.c: added sexagecimal float#base60.
-
- * ext/syck/rubyext.c (yaml_org_handler): ditto.
-
- * lib/token.c: indentation absolutely ignored when processing flow
- collections. plain scalars are trimmed if indentation follows in
- an ambiguous flow collection.
-
-Sat Aug 7 00:50:01 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.
-
-Tue Aug 3 13:49:20 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/namespace.rb: bug fix
-
- * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: add Tk::TreeCtrl.loupe
-
-Mon Aug 2 18:04:21 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/msgcat.rb (set_translation): bug fix (fail to set
- trans_str to the same as src_str when trans_str is not given.)
-
-Mon Aug 2 11:53:06 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): Fix infinite recursion
- looking up some top level symbols (batsman)
-
-Mon Aug 2 11:48:29 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Allow '.'s in
- variable names to support SWIG generated files (Hans Fugal)
-
-Sat Jul 31 17:40:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial,
- ruby-calculate-indent, ruby-move-to-block, ruby-forward-sexp,
- ruby-backward-sexp): keywords must match word-wise.
-
-Sat Jul 31 05:47:37 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb (YAML::load_file, YAML::parse_file): added.
-
- * lib/yaml/rubytypes.rb: exceptions were using an older
- YAML.object_maker. [ruby-core:03080]
-
- * ext/syck/token.c (sycklex_yaml_utf8): using newline_len to
- handline CR-LFs. "\000" was showing up on folded blocks which
- stopped at EOF.
-
- * ext/syck/token.c: re2c compiled with bit vectors now.
- * ext/syck/implicit.c: ditto.
- * ext/syck/bytecode.c: ditto.
-
-Fri Jul 30 16:10:54 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (lib_fromUTF8_core): raise ArgumentError when
- the unknown encoding name is given.
-
- * ext/tcltklib/tcltklib.c (lib_toUTF8_core): ditto.
-
- * ext/tk/lib/tk.rb (Tk::Encoding.encoding_convertfrom): bug fix.
-
- * ext/tk/lib/tk.rb (Tk::Encoding.encoding_convertto): ditto.
-
-Wed Jul 28 18:59:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi.rb (CGI::initialize): remove at_exit code for CGI_PARAMS
- and CGI_COOKIES. they will no longer be used.
-
-Wed Jul 28 01:04:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (run_final): wrong order of data. [ruby-dev:23984]
-
-Tue Jul 27 07:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): copy on write for argument local variable
- assignment.
-
- * eval.c (assign): ditto.
-
- * eval.c (rb_call0): update ruby_frame->argv with the default
- value used for the optional arguments.
-
- * object.c (Init_Object): "===" calls rb_obj_equal() directly.
- [ruby-list:39937]
-
-Mon Jul 26 11:22:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape): should
- escape space.
-
-Sun Jul 25 11:05:21 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * win32/win32.{h,c} (rb_w32_{f,fd,fs}open): workaround for bcc32's
- {f,fd,fs}open bug. set errno EMFILE and EBADF. [ruby-dev:23963]
-
-Sat Jul 24 13:32:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (rb_range_beg_len): returns Qnil only when "beg" points
- outside of a range. No boundary check for "end".
-
-Fri Jul 23 16:40:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (define_final): should not disclose NODE* to Ruby world.
- [ruby-dev:23957]
-
-Fri Jul 23 09:03:16 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (disconnected?): new method. (backported from HEAD)
-
-Thu Jul 22 16:41:54 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/cgi/session.rb (CGI::Session::FileStore#update): sets the
- permission of the session data file to 0600.
-
- * lib/cgi/session/pstore.rb (CGI::Session::Pstore#initialize):
- ditto.
-
-Thu Jul 22 00:02:21 2004 Masahiro Kitajima <katonbo@katontech.com>
-
- * process.c (rb_f_system): not need to call last_status_set() any
- longer on _WIN32.
-
-Tue Jul 20 09:15:17 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * test/fileutils/test_fileutils.rb: File.link raises EINVAL on BeOS.
-
-Mon Jul 19 01:15:07 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIhandler#do_GET): set SystemRoot environment
- variable to CGI process on Windows native platforms. [ruby-dev:23936]
-
- * lib/webrick/httpservlet/cgihandler.rb
- (WEBrick::HTTPServlet::CGIhandler#do_GET): use $?.exitstatus and
- refine log message.
-
-Sun Jul 18 16:14:29 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/msgcat.rb (TkMsgCatalog.callback): bug fix
- ( wrong number of argument )
-
-Sun Jul 18 08:13:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): remove extra sign digit.
-
-Sun Jul 18 03:21:42 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * dir.c (range): use NULL instead of 0.
-
- * dir.c (range): get rid of a gcc 3.4 warning.
-
-Sun Jul 18 03:12:11 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (receive_responses): return if a LOGOUT response
- received. (backported from HEAD)
- * lib/net/imap.rb (send_string_data): wait command continuation
- requests before sending octet data of literals. (backported from HEAD)
-
-Sat Jul 17 23:54:59 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/variable.rb: TkVariable#ref returns a TkVariable object
-
-Sat Jul 17 22:04:44 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/ldap.rb: method hierarchical? should be in URI::LDAP.
-
-Sat Jul 17 18:29:07 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt): not to show same error messages twice.
-
-Sat Jul 17 13:13:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb (RubyLex::identify_string): %s string do not
- process expression interpolation. [ruby-talk:106691]
-
-Sat Jul 17 05:26:27 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/diagram.rb: Incorporate Micheal Neuman's
- client-side imagemao patch
-
-Sat Jul 17 01:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.
- [ruby-talk:106657] The solution was found by Guy Decoux.
-
-Fri Jul 16 22:30:28 2004 Michael Neumann <mneumann@ntecs.de>
-
- * file.c (rb_stat_dev_major): new methods File::Stat#dev_major and
- #dev_minor. [ruby-core:03195]
-
-Fri Jul 16 15:23:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (return_jump, break_jump): raise unexpceted local jump
- exception directly. [ruby-dev:23740]
-
- * lib/base64.rb (Deprecated): super in bound method calls original
- name method in stable version. [ruby-dev:23916]
-
-Fri Jul 16 11:31:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/test/unit/ui/{fox,gtk,gtk2}/testrunner.rb: remove
- garbage (patch from akira yamada) [ruby-dev:23911]
-
-Fri Jul 16 11:20:00 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * sprintf.c (rb_f_sprintf): fix output of NaN, Inf and -Inf with
- "%f" or etc on MSVCRT platforms. (backported from HEAD)
-
-Fri Jul 16 11:17:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (exit_initialize): use EXIT_SUCCESS instead of 0.
- [ruby-dev:23913]
-
- * error.c (exit_success_p): new method SystemExit#success?.
- [ruby-dev:23912]
-
- * error.c (syserr_initialize): initialization for subclasses.
- [ruby-dev:23912]
-
-Thu Jul 15 23:53:38 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#warn, OptionParser#abort): Exception
- no longer has to_str method.
-
-Thu Jul 15 22:59:48 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * ext/readline/extconf.rb: added dir_config for curses, ncurses,
- termcap. (backported from HEAD)
-
-Thu Jul 15 20:29:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * class.c, error.c, eval.c, intern.h, object.c, variable.c:
- do not set path if it is a singleton class. [ruby-dev:22588]
- (backport from 1.9)
-
-Thu Jul 15 10:15:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/, ext/tcltklib/: bug fix
-
- * ext/tk/lib/tk.rb: better operation for SIGINT when processing
- callbacks.
- * ext/tk/lib/tk/msgcat.rb: ditto.
- * ext/tk/lib/tk/variable.rb: ditto.
- * ext/tk/lib/tk/timer.rb: ditto.
-
- * ext/tk/lib/tk/validation.rb: add Tk::ValidateConfigure.__def_validcmd
- to define validatecommand methods easier
-
- * ext/tk/lib/tk.rb (_genobj_for_tkwidget): support autoload Tk ext
- classes
-
- * ext/tk/lib/tk/canvas.rb and so on: remove the parent widget type
- check for items (e.g. canvas items; depends on the class) to
- avoid some troubles on Tk extension widget class definition.
-
- * ext/tk/lib/tkextlib/: add Iwidget and TkTable extension support
-
- * ext/tk/sample/tkextlib/: add samples of Iwidget and TkTable
-
-Wed Jul 14 18:08:37 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_asn1cons_to_der): fix type of
- argument. [ruby-dev:23891]
-
- * test/openssl/test_x509store.rb: prune tests for CRL checking
- unless X509::V_FLAG_CRL_CHECK is defined.
-
-Wed Jul 14 12:29:07 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * util.c (ruby_strtod): should not convert string in the form of
- "-I.FE-X" which both "I" and "F" are ommitted. [ruby-dev:23883]
-
- * test/ruby/test_float.rb (test_strtod): add test for bug fix.
-
-Wed Jul 14 00:31:15 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * array.c: rdoc patch. merged patch from Johan Holmberg
- <holmberg@iar.se> [ruby-core:3170]
-
-Tue Jul 13 19:39:12 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/generic.rb (URI::Generic#merge_path):
- "URI('http://www.example.com/foo/..') + './'" should return
- "URI('http://www.example.com/')". [ruby-list:39838]
- "URI('http://www.example.com/') + './foo/bar/..'" should return
- "URI('http://www.example.com/foo/')". [ruby-list:39844]
-
- * test/uri/test_generic.rb (TestGeneric#test_merge): added tests.
-
-Tue Jul 13 15:51:45 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/mkmf.rb (init_mkmf): Do not add $(libdir) to $LIBPATH in
- extmk mode.
-
- * lib/mkmf.rb (dir_config): Prepend a new library path instead of
- appending so it is tried first.
-
-Tue Jul 13 00:50:48 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb: Support call-seq: for Ruby files.
-
-Mon Jul 12 21:20:36 2004 Dave Thomas <dave@pragprog.com>
-
- * html_generator.rb: Support hyperlinks of the form {any text}[xxx]
- as well as stuff[xxx]
-
-Sat Jul 10 09:30:24 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/soap/marshal/test_struct.rb: use qualified build-tin class name
- (::Struct) to avoid name crash.
-
-Sat Jul 10 04:21:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: better operation for SIGINT when processing
- callbacks.
- * ext/tk/lib/tk/msgcat.rb: ditto.
- * ext/tk/lib/tk/variable.rb: ditto.
- * ext/tk/lib/tk/timer.rb: ditto.
-
- * ext/tk/lib/tk/validation.rb (__def_validcmd): add a module
- function of Tk::ValidateConfigure to define validatecommand
- methods easier
-
-Fri Jul 9 22:36:36 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * array.c, enum.c, pack.c: rdoc patch from Johan Holmberg
- <holmberg@iar.se> [ruby-core:3132] [ruby-core:3136]
-
- * numeric.c: rdoc patch.
-
-Fri Jul 9 19:26:39 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (URI::HTTPS#proxy_open): raise ArgumentError to
- notice https is not supported.
-
-Fri Jul 9 14:28:54 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_raise): accept third argument as well as
- Kernel#raise, and evaluate the arguments to create an exception in
- the caller's context. [ruby-talk:105507]
-
-Fri Jul 9 01:47:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib : bug fix
- * ext/tk/lib/tkextlib/itcl : add [incr Tcl] support
- * ext/tk/lib/tkextlib/itk : add [incr Tk] support
- * ext/tk/lib/tkextlib/iwidgets : midway point of [incr Widgets] support
- * ext/tk/sample/tkextlib/iwidgets : very simple examples of
- [incr Widgets]
-
-Thu Jul 8 22:52:19 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/{rss,parser,0.9,1.0,2.0}.rb: supported RSS 0.9x/2.0
- validation and validation which disregard order of elements.
- * test/rss/test_parser.rb: added tests for RSS 0.9x/2.0
- validation.
- * test/rss/{test_trackback,rss-testcase}.rb: fixed no good method
- name.
-
-Thu Jul 8 00:05:23 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/tempfile.rb (Tempfile::initialize): got out code of
- generating tmpname. [ruby-dev:23832][ruby-dev:23837]
-
-Wed Jul 7 15:53:14 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_match): raise TypeError when both arguments are
- strings. [ruby-dev:22869] (backported from HEAD)
-
- * string.c (rb_str_match2): removed.
-
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
- wince/Makefile.sub (string.c): now not depend on version.h.
-
-Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/tktrans.rb,
- ext/tk/lib/tkextlib/treectrl.rb: fix syntax errors.
-
-Tue Jul 6 18:38:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib : improve framework of developping Tcl/Tk extension
- wrappers
-
-Mon Jul 5 23:56:42 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/{trackback,syndication,dublincore,content}.rb: worked
- with ruby 1.6 again.
-
- * test/rss/rss-assertions.rb: ditto.
-
-Mon Jul 5 22:54:39 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/uri/common.rb (Kernel#URI): new global method for parsing URIs.
-
-Mon Jul 5 09:02:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_yield, rb_f_catch): 4th argument to rb_yield_0()
- is a set of bit flags. [ruby-dev:23859]
-
-Mon Jul 5 01:27:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
- the socket whose last-access-time is oldest. (and add new one)
- [ruby-dev:23860]
-
-Sun Jul 4 12:24:50 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb: added copyright header.
-
-Sun Jul 4 00:24:40 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * added files
- * lib/soap/attachment.rb
- * lib/soap/header
- * lib/soap/mimemessage.rb
- * lib/soap/rpc/httpserver.rb
- * lib/wsdl/soap/cgiStubCreator.rb
- * lib/wsdl/soap/classDefCreator.rb
- * lib/wsdl/soap/classDefCreatorSupport.rb
- * lib/wsdl/soap/clientSkeltonCreator.rb
- * lib/wsdl/soap/driverCreator.rb
- * lib/wsdl/soap/mappingRegistryCreator.rb
- * lib/wsdl/soap/methodDefCreator.rb
- * lib/wsdl/soap/servantSkeltonCreator.rb
- * lib/wsdl/soap/standaloneServerStubCreator.rb
- * lib/wsdl/xmlSchema/enumeration.rb
- * lib/wsdl/xmlSchema/simpleRestriction.rb
- * lib/wsdl/xmlSchema/simpleType.rb
- * lib/xsd/codegen
- * lib/xsd/codegen.rb
- * sample/soap/authheader
- * sample/soap/raa2.4
- * sample/soap/ssl
- * sample/soap/swa
- * sample/soap/whois.rb
- * sample/soap/calc/samplehttpd.conf
- * sample/soap/exchange/samplehttpd.conf
- * sample/soap/sampleStruct/samplehttpd.conf
- * sample/wsdl/raa2.4
- * sample/wsdl/googleSearch/samplehttpd.conf
- * test/openssl/_test_ssl.rb
- * test/soap/header
- * test/soap/ssl
- * test/soap/struct
- * test/soap/swa
- * test/soap/wsdlDriver
- * test/wsdl/multiplefault.wsdl
- * test/wsdl/simpletype
- * test/wsdl/test_multiplefault.rb
-
- * modified files
- * lib/soap/baseData.rb
- * lib/soap/element.rb
- * lib/soap/generator.rb
- * lib/soap/marshal.rb
- * lib/soap/netHttpClient.rb
- * lib/soap/parser.rb
- * lib/soap/processor.rb
- * lib/soap/property.rb
- * lib/soap/soap.rb
- * lib/soap/streamHandler.rb
- * lib/soap/wsdlDriver.rb
- * lib/soap/encodingstyle/handler.rb
- * lib/soap/encodingstyle/literalHandler.rb
- * lib/soap/encodingstyle/soapHandler.rb
- * lib/soap/mapping/factory.rb
- * lib/soap/mapping/mapping.rb
- * lib/soap/mapping/registry.rb
- * lib/soap/mapping/rubytypeFactory.rb
- * lib/soap/mapping/wsdlRegistry.rb
- * lib/soap/rpc/cgistub.rb
- * lib/soap/rpc/driver.rb
- * lib/soap/rpc/element.rb
- * lib/soap/rpc/proxy.rb
- * lib/soap/rpc/router.rb
- * lib/soap/rpc/soaplet.rb
- * lib/soap/rpc/standaloneServer.rb
- * lib/wsdl/data.rb
- * lib/wsdl/definitions.rb
- * lib/wsdl/operation.rb
- * lib/wsdl/parser.rb
- * lib/wsdl/soap/definitions.rb
- * lib/wsdl/xmlSchema/complexContent.rb
- * lib/wsdl/xmlSchema/complexType.rb
- * lib/wsdl/xmlSchema/data.rb
- * lib/wsdl/xmlSchema/parser.rb
- * lib/wsdl/xmlSchema/schema.rb
- * lib/xsd/datatypes.rb
- * lib/xsd/qname.rb
- * sample/soap/calc/httpd.rb
- * sample/soap/exchange/httpd.rb
- * sample/soap/sampleStruct/httpd.rb
- * sample/soap/sampleStruct/server.rb
- * sample/wsdl/amazon/AmazonSearch.rb
- * sample/wsdl/amazon/AmazonSearchDriver.rb
- * sample/wsdl/googleSearch/httpd.rb
- * test/soap/test_basetype.rb
- * test/soap/test_property.rb
- * test/soap/test_streamhandler.rb
- * test/soap/calc/test_calc.rb
- * test/soap/calc/test_calc2.rb
- * test/soap/calc/test_calc_cgi.rb
- * test/soap/helloworld/test_helloworld.rb
- * test/wsdl/test_emptycomplextype.rb
- * test/wsdl/axisArray/test_axisarray.rb
- * test/wsdl/datetime/test_datetime.rb
- * test/wsdl/raa/test_raa.rb
- * test/xsd/test_xmlschemaparser.rb
- * test/xsd/test_xsd.rb
-
- * summary
- * add SOAP Header mustUnderstand support.
-
- * add HTTP client SSL configuration and Cookies support (works
- completely with http-access2).
-
- * add header handler for handling sending/receiving SOAP Header.
-
- * map Ruby's anonymous Struct to common SOAP Struct in SOAP Object
- Model. it caused error.
-
- * add WSDL simpleType support to restrict lexical value space.
-
- * add SOAP with Attachment support.
-
-Sat Jul 3 17:19:44 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/tkDND.rb: fix syntax error.
-
-Thu Jul 1 23:15:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pstore.rb (transaction): safer backup scheme. [ruby-list:39102]
-
- * lib/pstore.rb (commit_new): use FileUtils.copy_stream for Cygwin.
- [ruby-dev:23157]
-
- * lib/pstore.rb (transaction): allow overriding dump and load.
- [ruby-dev:23567]
-
- * lib/pstore.rb (PStore#transaction): get rid of opening in write mode
- when read only transaction. [ruby-dev:23842]
-
- * lib/yaml/store.rb: follow lib/pstore.rb's change.
-
-Thu Jul 1 18:36:08 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tcltklib : bug fix
-
- * ext/tk/lib/tk : bug fix and add Tcl/Tk extension support libraries
-
-Thu Jul 1 11:59:45 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/extconf.rb: check for EVP_CIPHER_CTX_copy, ENGINE_add,
- EVP_CIPHER_CTX_set_padding, EVP_CipherFinal_ex, EVP_CipherInit_ex,
- EVP_DigestFinal_ex and EVP_DigestInit_ex.
-
- * ext/openssl/openssl_missing.c (EVP_CIPHER_CTX_copy): new function.
-
- * ext/openssl/openssl_missing.h (EVP_DigestInit_ex, EVP_DigestFinal_ex,
- EVP_CipherInit_ex, EVP_CipherFinal_ex, HMAC_Init_ex): new macro for
- OpenSSL 0.9.6.
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_encrypt, ossl_cipher_decrypt):
- re-implemnt (the arguments for this method is ).
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_pkcs5_keyivgen): new method
- OpenSSL::Cipher::Cipher#pkcs5_keyivgen. it calls EVP_BytesToKey().
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_alloc, ossl_cipher_initialize,
- ossl_cipher_copy, ossl_cipher_reset ossl_cipher_final,
- ossl_cipher_set_key, ossl_cipher_set_iv): replace all EVP_CipherInit
- and EVP_CipherFinal into EVP_CipherInit_ex and EVP_CipherFinal_ex.
- and EVP_CIPHER_CTX_init should only be called once.
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_set_key_length): new method
- OpenSSL::Cipher::Cipher#key_len=.
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_init_deprecated): new
- finction; print warning for Cipher#<<.
-
- * ext/openssl/ossl_digest.c: replace all EVP_DigestInit and
- EVP_DigestFinal into EVP_DigestInit_ex and EVP_DigestFinal_ex.
- and EVP_MD_CTX_init should only be called once.
-
- * ext/openssl/ossl_digest.c (digest_final): should call
- EVP_MD_CTX_cleanup to avoid memory leak.
-
- * ext/openssl/ossl_hmac.c (ossl_hmac_initialize): repalce HMAC_init
- into HMAC_init_ex. and HMAC_CTX_init is moved to ossl_hmac_alloc.
-
- * ext/openssl/ossl_hmac.c (hmac_final): should call
- HMAC_CTX_cleanup to avoid memory leak.
-
- * test/openssl/test_cipher.rb, test/openssl/test_digest.rb,
- test/openssl/test_hmac.rb: new file.
-
-Thu Jul 1 04:08:30 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_i2d_ASN1_TYPE, ossl_ASN1_TYPE_free):
- workaround for the versions earlier than OpenSSL-0.9.7.
-
-Thu Jul 1 03:33:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize): should create
- empty pkey object if no argument is passed. [ruby-talk:103328]
-
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
-
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): ditto.
-
- * ext/openssl/ossl_pkey_dh.c: add new methods: OpenSSL::PKey::DH#p,
- OpenSSL::PKey::DH#p=, OpenSSL::PKey::DH#g, OpenSSL::PKey::DH#g=,
- OpenSSL::PKey::DH#pub_key, OpenSSL::PKey::DH#pub_key=,
- OpenSSL::PKey::DH#priv_key and OpenSSL::PKey::DH#priv_key=.
-
- * ext/openssl/ossl_pkey_dsa.c: add new methods: OpenSSL::PKey::DSA#p,
- OpenSSL::PKey::DSA#p=, OpenSSL::PKey::DSA#q, OpenSSL::PKey::DSA#q=,
- OpenSSL::PKey::DSA#g, OpenSSL::PKey::DSA#g=,
- OpenSSL::PKey::DSA#pub_key, OpenSSL::PKey::DSA#pub_key=,
- OpenSSL::PKey::DSA#priv_key and OpenSSL::PKey::DSA#priv_key=.
-
-Thu Jul 1 03:16:09 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argument
- to specify a string to be written.
-
- * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read):
- take optional second argument to specify a string to be written.
-
- * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets):
- refine regexp for end-of-line.
-
- * ext/opnessl/lib/openssl/ssl.rb
- (OpenSSL::SSL::SocketForwarder#listen): fix typo.
-
-Wed Jun 30 11:38:51 2004 Mikael Brockman <phubuh@phubuh.org>
-
- * parse.y (primary): should not be NULL. [ruby-core:03098]
-
-Wed Jun 30 02:53:24 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c (syck_emitter_new): set buffer after
- Data_Wrap_Struct to avoid possible GC. [ruby-talk:104835]
-
-Tue Jun 29 10:31:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level.
-
- * gc.c (define_final, run_final): preserve and restore safe level for
- finalizers. [ruby-core:03058]
-
- * signal.c (signal_exec, rb_trap_exit, trap): preserve and restore
- safe level for signal handlers. [ruby-dev:23829]
-
-Mon Jun 28 14:57:56 2004 Jeff Mitchell <quixoticsycophant@yahoo.com>
-
- * configure.in, lib/mkmf.rb (LIBPATHFLAG): use double quotes due to
- DOSISH compilers. [ruby-core:03107]
-
-Mon Jun 28 00:30:19 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * sample/drb/*.rb: using 'DRb.thread.join' instead of 'gets'
-
-Sun Jun 27 22:39:51 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * sample/rss/tdiary_plugin/rss-recent.rb: supported Hiki.
-
-Sun Jun 27 12:19:46 2004 Kouhei Sutou <kou@cozmixng.org>
-
- * {lib,sample,test}/rss: added RSS Parser. [ruby-dev:23780]
-
-Sat Jun 26 11:07:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (aix): -b must come at the start of the command line,
- and -e must not appear while testing libraries. [ruby-talk:104501]
-
- * lib/mkmf.rb (dir_config): quote directory names if necessary.
- [ruby-talk:104505]
-
-Fri Jun 25 15:33:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/extconf.rb: check stricter. [ruby-talk:104501]
-
- * ext/iconv/extconf.rb: include iconv.h for libiconv. [ruby-dev:22715]
-
-Fri Jun 25 08:31:29 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_atfork): remove "fork terminates thread"
- warning. [ruby-dev:23768]
-
- * object.c (rb_obj_clone): backport FL_FINALIZE patch from 1.9.
- [ruby-core:02786][ruby-core:03067]
-
- * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()
- should give us packed address, not struct sockaddr.
- [ruby-core:03053]
-
-Fri Jun 25 02:04:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * {bcc32,win32,wince}/setup.mak: remove RUBY_EXTERN lines when
- including version.h. [ruby-talk:104456] (backported from HEAD)
-
-Thu Jun 24 14:23:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_fread): return already read data when system call is
- interrupted. [ruby-talk:97206]
-
-Thu Jun 24 01:32:43 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * version.h: added declarations of ruby_version,
- ruby_release_date, ruby_platform.
- (backported from HEAD)
-
-Wed Jun 23 22:23:37 2004 Dave Thomas <dave@pragprog.com>
-
- * ext/socket/socket.c (sock_s_gethostbyaddr): Work around problem
- with OS X not returning 'from' parameter to recvfrom for
- connection-oriented sockets.
-
-Wed Jun 23 01:45:27 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_quotation):
- Fix problem with the 'r' being dropped from %r{xxx}
-
-Wed Jun 23 00:20:20 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_hresult2msg): remove trailing
- CRs and LFs. (doesn't depend on CR+LF) [ruby-dev:23749]
-
-Wed Jun 23 00:00:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_initialize): should check fcntl result. [ruby-dev:23742]
-
-Tue Jun 22 21:11:36 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (OLE_FREE): should not call CoFreeUnuse-
- dLibraries().
-
- * ext/win32ole/win32ole.c (ole_event_free): ditto.
-
- * ext/win32ole/win32ole.c (ole_hresult2msg): truncate error message
- before CR.
-
-Tue Jun 22 16:47:42 2004 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (MDTM_REGEXP): fix for demon's ftp server.
- Thanks, Rutger Nijlunsing.
-
-Mon Jun 21 10:19:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_opendir): use FindFirstFile()/FindNextFile()/
- FindClose() instead of _findfirst()/_findnext()/_findclose().
- merge from HEAD.
-
-Sat Jun 19 13:24:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (method_call): allow changing $SAFE. [ruby-dev:23713]
-
-Fri Jun 18 23:12:22 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (proc_save_safe_level, rb_set_safe_level, safe_setter): limit
- safe level.
-
-Wed Jun 16 23:05:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * object.c (rb_mod_freeze): prepare string representation before
- freezing. [ruby-talk:103646]
-
-Wed Jun 16 16:04:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_mod_le): singleton class inherits Class rather than its
- object's class. [ruby-dev:23690]
-
-Wed Jun 16 16:01:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (stack_grow_direction): memoize the direction.
-
- * gc.c (Init_stack): should always move to end of VALUE.
-
-Tue Jun 15 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: bug fix (TkWindow#grab)
-
-Mon Jun 14 18:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/remote-tk.rb: bug fix
-
-Sun Jun 13 00:23:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/extconf.rb: [EXPERIMENTAL] MacOS X (darwin) support
-
- * ext/tcltklib/tcltklib.c: fix thread trouble on callback proc, and
- eliminate warning about instance variable access
-
- * ext/tk/lib/tk/menubar.rb: improve supported menu_spec
-
- * ext/tk/lib/tk/menuspec.rb: [add] menu_spec support library
-
- * ext/tk/lib/tk/root.rb: add menu_spec support
-
- * ext/tk/lib/tk/text.rb: bug fix
-
- * ext/tk/lib/tk/toplevel.rb: add menu_spec support
-
- * ext/tk/sample/menubar?.rb: [add] sample of menu_spec usage
-
-Sat Jun 12 11:15:53 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in (target_os): strip -gnu suffix on Linux.
-
-Fri Jun 11 17:08:21 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * config.guess: Restore a wrongly removed hyphen.
-
-Fri Jun 11 14:30:08 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * config.guess: Attempt to avoid system name change on
- Darwin platforms also.
-
-Fri Jun 11 14:22:45 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * config.guess, config.sub: Attempt to avoid system name change on
- Linux platforms. We have been using "linux" instead of
- "linux-gnu" on this branch.
-
-Thu Jun 10 19:19:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/sdbm/init.c (fsdbm_store): sdbm should use StringValue().
- [ruby-talk:103062]
-
-Wed Jun 9 18:04:14 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/generic.rb (URI::Generic::merge,
- URI::Generic::route_from): accepts non-hierarchical URI.
- [ruby-dev:23631]
-
- * test/uri/test_generic.rb (TestGeneric::test_route,
- TestGeneric::test_merge): added tests for above changes.
-
-Wed Jun 9 17:39:37 2004 Akinori MUSHA <knu@iDaemons.org>
-
- * config.guess, config.sub: Update to a more recent version as of
- 2004-01-20.
-
- * configure.in: Add support for DragonFly BSD.
-
-Wed Jun 2 20:16:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_new4): should share shared instance if it already
- exists. [ruby-dev:23665]
-
-Wed Jun 2 12:41:53 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_io_gets_m): set lastline ($_) even when read line is
- nil. [ruby-dev:23663]
-
-Fri May 28 11:20:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): bad influence on frame node.
-
- * eval.c (eval): reverted wrongly removed condition. [ruby-dev:23638]
-
-Thu May 27 23:15:18 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: leading 0 padding of timestamp usec part.
-
- * lib/csv.rb (CSV.parse): [CAUTION] behavior changed. in the past,
- CSV.parse accepts a filename to be read-opened (it was just a
- shortcut of CSV.open(filename, 'r')). now CSV.parse accepts a
- string or a stream to be parsed e.g.
- CSV.parse("1,2\n3,r") #=> [['1', '2'], ['3', '4']]
-
- * lib/csv.rb: CSV::Row and CSV::Cell are deprecated. these classes
- are removed in the future. in the new csv.rb, row is represented
- as just an Array. since CSV::Row was a subclass of Array, it won't
- hurt almost all programs except one which depended CSV::Row#match.
- and a cell is represented as just a String or nil(NULL). this
- change will cause widespread destruction.
-
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.is_null # using Cell#is_null
- p "(NULL)"
- else
- p cell.data # using Cell#data
- end
- end
- end
-
- must be just;
-
- CSV.open("foo.csv", "r") do |row|
- row.each do |cell|
- if cell.nil?
- p "(NULL)"
- else
- p cell
- end
- end
- end
-
- * lib/csv.rb: [CAUTION] record separator(CR, LF, CR+LF) behavior
- change. CSV.open, CSV.parse, and CSV,generate now do not force
- opened file binmode. formerly it set binmode explicitly.
-
- with CSV.open, binmode of opened file depends the given mode
- parameter "r", "w", "rb", and "wb". CSV.parse and CSV.generate open
- file with "r" and "w".
-
- setting mode properly is user's responsibility now.
-
- * lib/csv.rb: accepts String as a fs (field separator/column separator)
- and rs (record separator/row separator)
-
- * lib/csv.rb (CSV.read, CSV.readlines): added. works as IO.read and
- IO.readlines in CSV format.
-
- * lib/csv.rb: added CSV.foreach(path, rs = nil, &block). CSV.foreach
- now does not handle "| cmd" as a path different from IO.foreach.
- needed?
-
- * test/csv/test_csv.rb: updated.
-
- * test/ruby/test_float.rb: added test_strtod to test Float("0").
-
-Thu May 27 21:37:50 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#initialize): refine pathname initialization
- by pathname.
-
-Thu May 27 20:22:05 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * io.c (rb_io_fwrite): check all case errno != 0 [ruby-dev:23648]
-
-Thu May 27 14:53:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * io.c (rb_io_fwrite): workaround for bcc32's fwrite bug.
- add errno checking. [ruby-dev:23627]
-
-Wed May 26 14:19:42 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval, eval): make line number consistent on eval with
- Proc. [ruby-talk:101253]
-
-Wed May 26 13:59:17 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::skip_for_variable): Allow for
- 'do' after for statement
-
-Wed May 26 13:56:03 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/generators/html_generator.rb (Generators::MarkUp::style_url): Fix
- relative path to code CSS file
-
-Wed May 26 13:14:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]
-
-Wed May 26 00:00:00 2004 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/syck.c (syck_new_parser): clear parser on init.
- thanks, ts. [ruby-core:02931]
-
- * ext/syck/token.c (sycklex_yaml_utf8): buffer underflow.
- thanks, ts. [ruby-core:02929]
-
- * lib/yaml/baseemitter.rb (indent_text): simpler flow block code.
-
- * lib/yaml.rb: added rdoc to beginning of lib.
-
-Mon May 24 10:46:26 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/rdoc/generators/template/html/html.rb: SYSTEM identifiers
- must be absolute URIs
-
-Sat May 22 12:00:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * MANIFEST: add new encodings in rexml.
-
- * ext/tk/MANIFEST: add recent files.
-
-Sat May 22 05:37:11 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/remote-tk.rb: (NEW library) controll Tk interpreters
- on the other processes by Tcl/Tk's 'send' command
-
-Fri May 21 09:22:05 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_parameters):
- Add ()'s around parameters that don't have them
-
-Thu May 20 17:02:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (check_sizeof): define result size. [ruby-core:02911]
-
- * lib/mkmf.rb (create_header): macro name should not include equal
- sign.
-
-Thu May 20 15:59:50 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * ext/socket/socket.c: fix SEGV. [ruby-dev:23550]
-
-Thu May 20 14:35:52 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/socket.c: check SCM_RIGHTS macro addition to
- the msg_control field to test existence of file descriptor passing
- by msg_control.
-
-Thu May 20 12:38:06 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * numeric.c (flo_eq): always check if operands are NaN.
- [ruby-list:39685]
-
-Thu May 20 12:34:39 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_visibility):
- At Ryan Davis' suggestion, honor visibility modifers if guarded by a
- statement modifier
-
-Thu May 20 12:22:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (have_type): do not check pointer to incomplete type,
- which always get compiled. [ruby-list:39683]
-
-Wed May 19 11:09:00 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: change permition of TkObject#tk_send from
- private to public
-
-Tue May 18 14:00:46 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.h (NEW_DSTR): adjust list length.
-
- * parse.y (literal_concat): ditto.
-
-Mon May 17 16:14:25 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * numeric.c (flo_to_s): it's preferable that "p 0.0" outputs "0.0"
- instead of "0.0e+00". [ruby-dev:23480]
-
- * numeric.c (flo_to_s): it's preferable that "p 0.00000000000000000001"
- outputs "1.0e-20" instead of "9.999999999999999e-21". (the precision
- is considered, but there is assumption DBL_DIG == 15 in current
- implementation)
-
-Mon May 17 10:13:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/socket.c (setup_domain_and_type): honor duck typing.
- [ruby-dev:23522]
-
- * ext/socket/socket.c (sock_s_getnameinfo): ditto.
-
-Mon May 17 01:15:23 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml.rb: removed fallback to pure Ruby parser.
-
- * lib/yaml/baseemitter.rb (indent_text): was forcing a mod value
- of zero at times, which kept some blocks from getting indentation.
-
- * lib/yaml/baseemitter.rb (node_text): rewriting folded scalars.
-
- * ext/syck/syck.h: reports style of scalars now, be they plain, block
- single-, or double-quoted.
-
- * ext/syck/syck.c: ditto.
-
- * ext/syck/gram.c: ditto.
-
- * ext/syck/node.c: ditto.
-
- * ext/syck/token.c: ditto.
-
- * ext/syck/rubyext.c (yaml_org_handler): symbols loaded only
- if scalar style is plain.
-
- * ext/syck/rubyext.c (yaml_org_handler): some empty strings were
- loaded as symbols.
-
- * test/yaml/test_yaml.rb (test_perl_regexp): updated test to
- match new regexp serialization.
-
-Mon May 17 00:03:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/drb/drb.rb: Cosmetic documentation changes.
-
-Sun May 16 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/test/unit.rb: Removed :nodoc: directive (it prevented effective
- RDoc operation), and added file-level comment.
-
-Sun May 16 20:55:49 2004 Tanaka Akira <akr@m17n.org>
-
- * ext/dbm/dbm.c (fdbm_initialize): accept optional 3rd argument to
- specify an open flag.
- (Init_dbm): define open flags: DBM::READER, DBM::WRITER, DBM::WRCREAT
- and DBM::NEWDB.
-
-Sun May 16 13:10:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/test/unit/**/*.rb: Removed :nodoc: directives (many were
- generating warnings, many were on private methods).
-
-Sat May 15 01:41:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): forgot to restore $SAFE value before evaluating
- compiled node. [ruby-core:02872]
-
-Sat May 15 01:33:12 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * range.c (range_each_func): terminates loop if generating value
- is same to @end. [ruby-talk:100269]
-
-Fri May 14 22:08:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_new4): should not reuse frozen shared string if
- the original is not an instance of String. [ruby-talk:100193]
-
-Fri May 14 18:39:25 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/canvas.rb: improve coords support for canvas items.
- Now, supports all of the followings.
- TkcLine.new(c, 0, 0, 100, 100, :fill=>'red')
- TkcLine.new(c, [0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, [0, 0], [100, 100], :fill=>'red')
- TkcLine.new(c, [[0, 0], [100, 100]], :fill=>'red')
- TkcLine.new(c, :coords=>[0, 0, 100, 100], :fill=>'red')
- TkcLine.new(c, :coords=>[[0, 0], [100, 100]], :fill=>'red')
-
-Fri May 14 12:11:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * util.c (ruby_strtod): strtod("0", &end); => end should point '\0'.
- [ruby-dev:23498]
-
-Thu May 13 15:47:30 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/net/telnet.rb (Net::Telnet::login): "options" can specify
- regexps for login prompt and/or password prompt.
-
-Thu May 13 14:23:45 2004 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * hash.c (delete_if_i): use st_delete_safe() (via
- rb_hash_delete()) instead of returning ST_DELETE.
- backport from HEAD. [ruby-dev:23487]
-
-Thu May 13 13:01:30 2004 akira yamada <akira@ruby-lang.org>
-
- * lib/uri/mailto.rb (URI::MailTo::to_s): should include fragment.
-
-Thu May 13 11:04:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * pack.c (pack_pack): always add with null for 'Z'.
-
- * pack.c (pack_unpack): terminated by null for 'Z'. [ruby-talk:98281]
-
-Wed May 12 19:59:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (have_type, check_sizeof): replace unusable characters.
- [ruby-talk:99788]
-
-Wed May 12 17:41:42 2004 Tanaka Akira <akr@m17n.org>
-
- * lib/resolv.rb (Resolv::DNS::Config): make it configurable without
- external file such as /etc/resolv.conf.
-
-Wed May 12 14:37:27 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509name.c: attribute value of DC (short name of
- domainComponent) should be IA5String.
-
-Wed May 12 13:20:19 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk/composite.rb: improve configure methods (based on
- the proposal of [ruby-talk:99671]).
-
-Wed May 12 11:51:08 2004 Dave Thomas <dave@pragprog.com>
-
- * class.c (rb_obj_singleton_methods): fix rdoc
-
-Mon May 10 21:44:42 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/generators/html_generator.rb: Change scheme for
- looking up symbols in HTML generator.
-
-Mon May 10 16:45:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): warning during eval should not cause deadlock.
- [ruby-talk:98651]
-
- * eval.c (rb_eval): raise TypeError exception for superclass
- mismatch. [ruby-list:39567]
-
-Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/generators/html_generator.rb: Hack to search parents
- for unqualified constant names.
-
-Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/generators/html_generator.rb: Hack to search parents
- for unqualified constant names.
-
-Sun May 9 22:37:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/net/ftp.rb: improved documentation
- * lib/net/imap.rb: ditto
- * lib/net/pop.rb: ditto
- * lib/net/smtp.rb: ditto
- * lib/net/telnet.rb: ditto
-
-Fri May 7 21:50:21 2004 Dave Thomas <dave@pragprog.com>
-
- * lib/rdoc/parsers/parse_rb.rb (RDoc::parse_include): Allow
- multiple arguments to 'include'
-
-Fri May 7 21:31:56 2004 Minero Aoki <aamine@loveruby.net>
-
- * lib/fileutils.rb (fu_list): Array() breaks pathes including "\n".
- [ruby-core:02843]
-
-Fri May 7 11:25:53 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
-
- * util.c (ruby_strtod): "0.0000000000000000001" should be converted
- to 1.0e-19 instead of 0.0. (leading zeros aren't significant digits)
- [ruby-talk:99318] [ruby-dev:23465]
-
-Fri May 7 10:00:05 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/tkutil.c (get_eval_string_core): bug fix. [ruby-dev:23466]
-
-Thu May 6 22:13:17 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * ext/socket/socket.c (ippaddr): use NUMERICHOST if can not resolve
- hostname.
-
-Thu May 6 14:22:29 2004 why the lucky stiff <why@ruby-lang.org>
-
- * lib/yaml/rubytypes.rb (to_yaml): added instance variable handling
- for Ranges, Strings, Structs, Regexps.
-
- * lib/yaml/rubytypes.rb (to_yaml_fold): new method for setting a
- String's flow style.
-
- * lib/yaml.rb (YAML::object_maker): now uses Object.allocate.
+ * test/openssl/test_pair.rb: Modify TestSSL#test_read_and_write
+ to handle partial sysreads. [Bug #7398][ruby-core:49563]
+ * test/openssl/test_ssl.rb: ditto.
- * ext/syck/gram.c: fixed transfer methods on structs, broke it
- last commit.
+Tue May 27 18:46:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu May 6 11:40:28 2004 Shugo Maeda <shugo@ruby-lang.org>
+ * test/openssl/test_pkcs7.rb: Add tests for PKCS7#type= and add_data.
+ [Feature #7399][ruby-core:49565]
- * lib/net/imap.rb (string): accept NIL.
+Tue May 27 17:45:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/net/imap.rb (body_type_basic): allow body-fields omissions.
+ * test/openssl/test_hmac.rb (test_binary_update): Added Test for
+ HMAC signing with UTF-8 String. [Bug #7512][ruby-core:50559]
-Thu May 6 01:59:04 2004 Dave Thomas <dave@pragprog.com>
+Tue May 27 17:10:14 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlMethod::params):
- Don't include the &block parameter if we have explicit
- yield parameters.
+ * test/runner.rb: fixed randomly test failure.
+ [Bug #6573][ruby-core:45563]
-Wed May 5 03:40:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Tue May 27 16:58:12 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rinda/ring.rb: use recv instead of recvfrom.
+ * test/test_timeout.rb (test_timeout): inverted test condition.
+ [Bug #8523]
-Tue May 4 23:52:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Tue May 27 12:24:22 2014 Tanaka Akira <akr@fsij.org>
- * lib/gserver.rb: documented
+ * test/lib/minitest/unit.rb: Show leaked file descriptors.
-Tue May 4 23:46:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Tue May 27 11:12:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/xmlrpc/README.txt: introduced for documentation purposes
+ * io.c (rb_io_fileno, rb_io_inspect): non-modification does not
+ error on frozen IO. [ruby-dev:48241] [Bug #9865]
-Mon May 3 09:47:24 2004 Dave Thomas <dave@pragprog.com>
+Tue May 27 00:00:21 2014 yui-knk <spiketeika@gmail.com>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
- Fix parsing bug if yield called within 1 line block
+ * insns.def (defineclass): fix typo in the instruction comment.
+ [fix GH-618]
-Sun May 2 01:04:38 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Mon May 26 16:33:15 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/tcltklib, ext/tk: renewal Ruby/Tk
+ * test/ruby/test_file.rb: skip the test of atime on Windows, because
+ Windows delays updating atime about 1 hour.
+ see more details:
+ http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx
-Fri Apr 30 20:08:41 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon May 26 12:25:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (SIZEOF_TIME_T): support SIZEOF_TIME_T == SIZEOF_INT.
+ * lib/optionparser.rb, lib/optparse.rb (OptParse): aliases.
+ [ruby-core:62751] [Feature #9864]
-Tue Apr 27 13:12:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon May 26 07:59:34 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)
+ * test/lib/minitest/unit.rb: Show Finished threads line-by-line.
-Tue Apr 27 08:41:28 2004 why the lucky stiff <why@ruby-lang.org>
+Mon May 26 01:39:02 2014 Zachary Scott <e@zzak.io>
- * lib/yaml/rubytypes.rb: passing Range tests.
+ * lib/csv.rb: Reject nil as data source for CSV.new, patch by @Peeja.
+ [Fixes GH-580] https://github.com/ruby/ruby/pull/580
- * ext/syck/syck.h: version 0.44.
+Mon May 26 01:07:51 2014 Tanaka Akira <akr@fsij.org>
- * ext/syck/gram.c: transfers no longer open an indentation.
- fixed transfers which precede blocks.
+ * test/lib/minitest/unit.rb: Show leaked threads and tempfiles
+ line-by-line.
- * ext/syck/token.c: ditto.
+Sun May 25 23:02:06 2014 Tanaka Akira <akr@fsij.org>
- * ext/syck/syck.c: fixed segfault if an anchor has been released already.
+ * test/lib/minitest/unit.rb (MiniTest::Assertions#diff): Remove
+ tempfiles.
- * ext/syck/node.c (syck_free_members): organized order of free'd nodes.
+Sun May 25 22:42:27 2014 Tanaka Akira <akr@fsij.org>
- * ext/syck/rubyext.c (syck_emitter_write_m): test for proper string with
- StringValue.
+ * test/lib/minitest/unit.rb: Check tempfile leak for each test class.
-Mon Apr 26 23:56:54 2004 Daniel Kelley <news-1082945587@dkelley.gmp.san-jose.ca.us>
+Sun May 25 20:31:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * README.EXT, README.EXT.ja: fixed wrong function signature.
- [ruby-talk:98349]
+ * configure.in (ac_cv_func_{getcontext,setcontext}): do not
+ disable ucontext.h entirely, but disable use of functions only.
+ `ucontext_t` is necessary in the signal handler now.
-Mon Apr 26 21:40:09 2004 Dave Thomas <dave@pragprog.com>
+Sun May 25 20:00:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/code_objects.rb (RDoc::Context::add_alias): Only alias
- to instance methods.
+ * signal.c (check_stack_overflow): revert part of r46100, the
+ previous condition was correct, and fix compilation error on
+ other architecture linux. [ruby-core:62746] [Bug #9862]
-Sat Apr 24 10:38:31 2004 Dave Thomas <dave@pragprog.com>
+Sun May 25 17:09:13 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::group_lines):
- Fix bug where consecutive headings are merged.
+ * test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)
+ invocation.
-Fri Apr 23 23:26:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 25 16:54:06 2014 Tanaka Akira <akr@fsij.org>
- * lib/mkmf.rb: $hdrdir should not contain macros for backward
- compatibility. [bruby-dev:28]
+ * test/lib/minitest/unit.rb: Use Thread.list instead of
+ ObjectSpace.each_object(Thread).
- * version.c (ruby_show_copyright): obtain copyright year from
- RUBY_RELEASE_YEAR.
+Sun May 25 15:53:54 2014 Tanaka Akira <akr@fsij.org>
- * win32/resource.rb: ditto.
+ * lib/rinda/ring.rb (Rinda::RingServer#shutdown): Join the killed
+ threads.
- * win32/resource.rb: default rubyw icon to ruby.ico, and let DLL also
- include them.
+Sun May 25 15:26:17 2014 Tanaka Akira <akr@fsij.org>
- * win32/resource.rb: include winver.h for older WindowsCE.
+ * lib/webrick/utils.rb: Override the inspect method of the thread
+ used in WEBrick::Utils::TimeoutHandler.
-Fri Apr 23 16:38:46 2004 Tanaka Akira <akr@m17n.org>
+Sun May 25 14:22:30 2014 Tanaka Akira <akr@fsij.org>
- * lib/pathname.rb: sync taint/freeze flag between
- a pathname object and its internal string object.
+ * test/openssl: Join threads.
-Fri Apr 23 14:52:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 25 12:46:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (stmt, arg, aref_args): should not make sole splat into
- array, in aref_args other than aref with op_asgn.
+ * error.c (rb_bug_context): new function to report bug with
+ context.
-Fri Apr 23 14:14:38 2004 Tanaka Akira <akr@m17n.org>
+ * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to
+ dump machine registers. based on [GH-584].
- * lib/resolv.rb: don't use Regexp#source to embed regexps.
- [ruby-dev:23432]
+ * signal.c (sigbus, sigsegv): dump machine registers if available.
-Thu Apr 22 04:15:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 25 12:32:42 2014 Tanaka Akira <akr@fsij.org>
- * parse.y (aref_args): should pass expanded list. [ruby-core:02793]
+ * test/lib/minitest/unit.rb: Sort leaked threads and tempfiles.
-Thu Apr 22 01:12:57 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun May 25 12:15:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (flo_to_s): tweak output string based to preserve
- decimal point and to remove trailing zeros. [ruby-talk:97891]
+ * signal.c (check_stack_overflow): fix condition to use ucontext
+ register, mcontext_t dereference, and its member names, on Mac
+ OS X.
- * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
- search. [ruby-talk:97342]
+Sun May 25 11:58:26 2014 Zachary Scott <e@zzak.io>
-Wed Apr 21 22:57:27 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * enumerator.c: [DOC] Fix example to show Enumerator#peek behavior
+ Patch by Erik Hollembeak [Bug #9814]
- * lib/rinda/rinda.rb, test/rinda/test_rinda.rb: check Hash tuple size.
+Sun May 25 11:56:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 21 20:05:00 2004 Tanaka Akira <akr@m17n.org>
+ * vsnprintf.c (BSD_vfprintf): fix string width when precision is
+ given. as the result of `memchr` is NULL or its offset from the
+ start cannot exceed the size, the comparison was always false.
+ [ruby-core:62737] [Bug #9861]
- * lib/open-uri.rb (URI::HTTP#proxy_open): set Host: field explicitly.
- [ruby-list:39542]
+Sun May 25 11:32:42 2014 Zachary Scott <e@zzak.io>
-Mon Apr 19 18:11:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/yaml.rb: Remove Psych::EngineManager [Bug #8344]
+ * test/psych/*: ditto.
- * hash.c (rb_hash_equal): returns true if two hashes have same set
- of key-value set. [ruby-talk:97559]
+Sun May 25 10:34:15 2014 Zachary Scott <e@zzak.io>
- * hash.c (rb_hash_eql): returns true if two hashes are equal and
- have same default values.
+ * doc/regexp.rdoc: [DOC] Clarify whitespace matching by @allolex
+ [Fixes GH-606] https://github.com/ruby/ruby/pull/606
-Mon Apr 19 08:19:58 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+Sun May 25 10:19:34 2014 Zachary Scott <e@zzak.io>
- * dln.c, io.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb, lib/date.rb,
- lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb,
- lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb,
- lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb,
- lib/net/http.rb, lib/net/imap.rb, lib/net/telnet.rb,
- lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb,
- lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb,
- lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix.
+ * enum.c: [DOC] Use #find in example to clarify alias by @rachellogie
+ Patch submitted via documenting-ruby/ruby#34
-Mon Apr 19 08:14:18 2004 Dave Thomas <dave@pragprog.com>
+Sun May 25 10:16:43 2014 Zachary Scott <e@zzak.io>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Allow for
- #ifdef HAVE_PROTOTYPES
+ * cont.c: [DOC] Fix rdoc in example for Fiber#transfer by @majjoha
+ Patch submitted via documenting-ruby/ruby#33
-Fri Apr 16 22:33:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sun May 25 10:01:11 2014 Zachary Scott <e@zzak.io>
- * ext/iconv/iconv.c: nearly finished RDoc comments.
+ * lib/irb.rb: [DOC] Fixed syntax error in example by @jasdeepsingh.
+ Patch submitted via documenting-ruby/ruby#32
-Fri Apr 16 17:04:07 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sun May 25 09:58:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * string.c (rb_str_equal): always returns true or false, never
- returns nil. [ruby-dev:23404]
+ * test/fileutils/test_fileutils.rb (test_chown_R): Add tests for
+ chown_R. [Feature #9383][ruby-core:59641]
-Fri Apr 16 08:27:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 25 09:57:09 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/extmk.rb: skip linking when libraries to be preloaded not
- compiled. [ruby-list:39561]
+ * test/fileutils/test_fileutils.rb: Added recursively chown tests.
+ [Feature #9303][ruby-core:59325]
-Thu Apr 15 23:21:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 25 09:41:56 2014 Zachary Scott <e@zzak.io>
- * process.c (pst_success_p): new method Process::Status#success?.
- [ruby-dev:23385]
+ * class.c: [DOC] Fixed grammar and examples of instance_methods.
+ By @alex-frost via documenting-ruby/ruby#31
-Thu Apr 15 17:12:13 2004 Tanaka Akira <akr@m17n.org>
+Sun May 25 09:40:44 2014 Tanaka Akira <akr@fsij.org>
- * ext/gdbm/gdbm.c (Init_gdbm): define GDBM::READER, GDBM::WRITER,
- GDBM::WRCREAT and GDBM::NEWDB.
- (fgdbm_initialize): use specified read/write flag.
+ * test/lib/minitest/unit.rb: Show leaked threads and tempfiles.
-Wed Apr 14 11:29:56 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun May 25 08:54:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * numeric.c (flo_eq): workaround for bcc32's bug.
- (ruby-bugs-ja:PR#594)
+ * test/openssl/test_partial_record_read.rb: Testing read_nonblock on
+ a partial TLS record results in IO::WaitReadable by @mohamedhafez.
+ [fix GH-547]
-Wed Apr 14 13:06:35 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
+Sun May 25 08:43:16 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,
- process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783]
+ * lib/logger.rb: refactored to include Logger::Period.
-Wed Apr 14 11:06:38 2004 Dave Thomas <dave@pragprog.com>
+Sun May 25 06:50:19 2014 Zachary Scott <e@zzak.io>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::scan): Changed
- behavior of :enddoc: -- it now unconditionally terminates
- processing of the current file.
+ * vm_eval.c: [DOC] Improve instance_eval description when given a
+ block or String arguments. By @nathanl via documenting-ruby/ruby#28
-Wed Apr 14 11:03:22 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun May 25 06:29:39 2014 Zachary Scott <e@zzak.io>
- * defines.h: include <net/socket.h> to get fd_set definition in BeOS.
+ * array.c: [DOC] Clarify default argument for Array.new.
+ By @Elffers [Fixes GH-610]
-Tue Apr 13 23:06:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat May 24 22:37:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rinda/rinda.rb: change pattern matching.
- a === b -> a == b || a === b. [druby-ja:98]
+ * array.c: [DOC] Add more documents to shuffle! and shuffle.
+ Contributed by @JuanitoFatas [ci skip][fix GH-612]
- * test/rinda/test_rinda.rb: ditto.
+Sat May 24 22:28:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Apr 13 19:54:29 2004 Minero Aoki <aamine@loveruby.net>
+ * test/lib/minitest/.document: removed unused configuration.
- * lib/net/http.rb: should not overwrite HTTP request header.
- [ruby-list:39543]
+Sat May 24 19:08:47 2014 Tanaka Akira <akr@fsij.org>
-Tue Apr 13 01:30:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * test/lib/minitest/spec.rb: Unused file removed.
- * ext/iconv/iconv.c: RDoc documentation (from RD; nearly finished).
- * ext/iconv/charset_alias.rb: Prevent from RDoc'ing.
+ * test/lib/minitest/autorun.rb: Don't require minitest/spec.
-Mon Apr 12 19:11:29 2004 Eric Hodel <drbrain@segment7.net>
+ * test/lib/minitest/benchmark.rb: Ditto.
- * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
+Sat May 24 18:45:30 2014 Tanaka Akira <akr@fsij.org>
-Mon Apr 12 18:52:32 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/benchmark/test_benchmark.rb: Use test/unit.
- * ext/openssl/ossl_x509name.c (ossl_x509name_init_i): should return
- a value.
+Sat May 24 16:20:59 2014 Eric Wong <e@80x24.org>
-Mon Apr 12 10:43:47 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * process.c (proc_getgroups, proc_setgroups): use ALLOCV_N
+ [Bug #9856]
- * dir.c (rb_glob2, rb_glob, rb_globi, push_globs, push_braces,
- rb_push_glob): fix memory leak. (leaked when block was interrupted)
+Sat May 24 15:49:39 2014 Tanaka Akira <akr@fsij.org>
-Mon Apr 12 10:27:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * test/lib/minitest/unit.rb (parallelize_me!): Removed.
+ This fixes the line-by-line structure of the test result in verbose
+ mode. [ruby-core:54905]
- * bcc32/Makefile.sub: backport SIZEOF_TIME_T definition from 1.9.
+ * test/lib/minitest/parallel_each.rb: Removed.
- * win32/Makefile.sub: ditto.
+ * test/minitest/test_minitest_mock.rb: Don't call parallelize_me!.
- * wince/Makefile.sub: ditto.
+ * test/minitest/test_minitest_spec.rb: Ditto.
-Sun Apr 11 19:12:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/minitest/test_minitest_unit.rb: Ditto.
+ Tests for parallel feature removed.
- * ruby.c (require_libraries): restore source file/line after
- statically linked extensions initialized. [ruby-dev:23357]
+Sat May 24 15:29:10 2014 Tanaka Akira <akr@fsij.org>
-Sun Apr 11 10:47:04 2004 Dave Thomas <dave@pragprog.com>
+ * test/lib/minitest/hell.rb: Unused file removed.
- * lib/rdoc/code_objects.rb (RDoc::TopLevel::add_class_or_module): Toplevel
- classes and modules are a special case too... (handle extending existing
- classes with or without :enddoc:)
+ * test/lib/minitest/pride.rb: Ditto.
-Sat Apr 10 23:51:13 2004 Dave Thomas <dave@pragprog.com>
+Sat May 24 15:05:32 2014 yui-knk <spiketeika@gmail.com>
- * lib/rdoc/code_objects.rb (RDoc::Context::add_to): Implementation of :enddoc:
- made one too many assumptions...
+ * enumerator.c (yielder_yield_push): Insert a break after the
+ method return value. [fix GH-617]
-Sat Apr 10 00:00:19 2004 Dave Thomas <dave@pragprog.com>
+Sat May 24 14:59:12 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/markup/simple_markup/inline.rb: Fix problem
- with \_cat_<b>dog</b>
+ * test/lib/minitest: Remove comments not appropriate now.
-Wed Apr 7 00:19:50 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * test/minitest: Ditto.
- * lib/rinda/rinda.rb: fix hash tuple bug.
+Sat May 24 14:02:04 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rinda/tuplespace.rb: ditto.
+ * NEWS: added minitest changes.
- * test/rinda/test_rinda.rb
+Sat May 24 13:42:46 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Apr 6 18:24:18 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/lib/test/unit/test-unit.gemspec: removed needless gemspec file.
- * io.c (rb_io_reopen): should use rb_io_check_io().
+Sat May 24 09:39:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Apr 6 16:46:09 2004 Tanaka Akira <akr@m17n.org>
+ * defs/default_gems: removed minitest entry.
- * configure.in: check the size of time_t.
+Sat May 24 06:17:33 2014 Ryan Davis <ryand-ruby@zenspider.com>
- * time.c (time_add): new function.
- (time_plus): use time_add.
- (time_minus): use time_add.
+ * lib/minitest: minitest 4.7.5 removed. Need to support proper
+ gem packaging / installation before minitest 5 can be added.
-Tue Apr 6 13:21:30 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat May 24 05:54:06 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (make_hostent): must return value.
+ * ext/socket/mkconstants.rb: More constants
-Tue Apr 6 00:05:30 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat May 24 00:25:34 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/rinda/rinda.rb: add require 'drb/drb'
+ * NEWS: add information of incompatibility about Prime.prime?
+ * lib/prime.rb: fix docs.
-Mon Apr 5 08:18:23 2004 Dave Thomas <dave@pragprog.com>
+Fri May 23 21:36:28 2014 Josh Goebel <dreamer3@gmail.com>
- * lib/rdoc/rdoc.rb: Remove leading ./ from file names so that cross
- references work properly.
+ * net/protocol.rb (using_each_crlf_line): fix SMTP dot-stuffing
+ for messages not ending with a new-line.
+ [ruby-core:61441] [Bug #9627] [fix GH-616]
-Sun Apr 4 20:33:42 2004 Minero Aoki <aamine@loveruby.net>
+Fri May 23 03:48:08 2014 Eric Wong <e@80x24.org>
- * eval.c (Init_load): make $LOADED_FEATURES built-in.
- [ruby-dev:23299]
+ * gc.c (rb_free_m_tbl): mark function as static
- * ruby.c (ruby_prog_init): make $PROGRAM_NAME built-in.
+ * method.h (rb_free_m_tbl): remove prototype
- * lib/English.rb: remove $LOADED_FEATURES and $PROGRAM_NAME.
+Thu May 22 22:58:27 2014 Tanaka Akira <akr@fsij.org>
-Sun Apr 4 14:01:20 2004 Dave Thomas <dave@pragprog.com>
+ * ext/socket/mkconstants.rb: More TCP option constants.
+ Describe Linux and glibc versions.
- * lib/rdoc/options.rb (Options::parse): Allow multiple -x options to RDoc.
- Fix bug where files weren't being excluded properly
+Thu May 22 20:38:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Apr 3 17:11:05 2004 why the lucky stiff <why@ruby-lang.org>
+ * file.c (stat_birthtime): add birthtime support [Feature #9647]
- * ext/syck/syck.h: version 0.43.
+ * file.c (rb_stat_birthtime): add File::Stat.birthtime
- * ext/syck/lib/gram.c: allow root-level inline collections.
- [ruby-talk:94922]
+ * file.c (rb_file_s_birthtime): add File.birthtime
- * lib/yaml/rubytypes.rb (Symbol#to_yaml): emit symbols as implicits.
- [ruby-talk:94930]
+ * file.c (rb_file_birthtime): add File#birthtime
- * ext/syck/bytecode.c: turn off default implicit typing.
+ * configure.in: check struct stat.st_birthtimespec.
- * ext/syck/implicit.c: detect base60 integers.
+Thu May 22 19:38:14 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/rubyext.c: handle base60, as well as hex and octal
- with commas. implicit typing of ruby symbols.
+ * file.c: remove IO::Statfs because of reject. [Feature #9772]
-Fri Apr 2 17:27:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu May 22 14:02:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (top_include): include in the wrapped load is done for
- the wrapper, not for a singleton class for wrapped main.
- [ruby-dev:23305]
+ * enc/jis/props.kwd: constify character property tables of JIS
+ based encodings by perfect hash.
-Fri Apr 2 15:13:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * enc/euc_jp.c, enc/shift_jis.c: use character property functions.
- * bignum.c (rb_big_eq): use temporary double variable to save the
- result (internal float register may be bigger than 64 bits, for
- example, 80 bits on x86). [ruby-dev:23311]
+Wed May 21 12:21:10 2014 Tanaka Akira <akr@fsij.org>
-Fri Apr 2 14:35:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/option.c: Fix compilation error on Android.
+ Bionic doesn't define TCP state constants.
- * eval.c (block_pass): should generate unique identifier of the
- pushing block. [ruby-talk:96363]
+Wed May 21 11:42:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Apr 2 07:31:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: workaround for Info.plist to get rid of `dsymutil`
+ crash by wrong files in parent directories.
+ [ruby-core:62594] [Bug #9840]
- * ext/socket/socket.c (make_hostent): fix memory leak, based on
- the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.
+Tue May 20 20:57:34 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Apr 1 22:55:33 2004 Dave Thomas <dave@pragprog.com>
+ * test/ruby/test_dir.rb (test_glob): added testcase of double
+ slash path.
- * lib/rdoc/parsers/parse_rb.rb: Allow rdoc comments in
- =begin rdoc/=end
+Tue May 20 04:58:54 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_rb.rb: Fix problem with comment in
- top-level method being taken as file comment.
+ * ext/socket/extconf.rb: Don't check fields of struct tcp_info if the
+ structure is not available.
-Thu Apr 1 22:55:04 2004 Dave Thomas <dave@pragprog.com>
+Mon May 19 23:13:33 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/ri/ri_options.rb: Fix undefined variable warning.
+ * ext/socket/option.c (inspect_tcp_info): Permit longer data. (glibc
+ 2.7 adds tcpi_rcv_rtt, tcpi_rcv_space and tcpi_total_retrans to
+ struct tcp_info.)
-Thu Apr 1 19:58:37 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon May 19 20:49:07 2014 Tanaka Akira <akr@fsij.org>
- * lib/soap/mapping/{factory.rb,registry.rb}: fixed illegal mapped URI
- object with soap/marshal.
- added URIFactory class for URI mapping. BasetypeFactory checks
- instance_variables when original mapping is not allowed (ivar must
- be empty). Instance of URI have instance_variables but it must be
- llowed whenever original mapping is allowed or not.
+ * ext/socket/option.c (inspect_tcp_info): New function to inspect
+ struct tcp_info.
+ (sockopt_inspect): Use inspect_tcp_info.
- * lib/xsd/datatypes.rb: check the smallest positive non-zero
- single-precision float exactly instead of packing with "f".
- [ruby-talk:88822]
+ * ext/socket/extconf.rb: Check tcp_info related things.
- * lib/soap/mapping/rubytypeFactory.rb: should not dump singleton class.
- [ruby-dev:22588]
- c = class << Object.new; class C; self; end; end; SOAPMarshal.dump(c)
+ * ext/socket/rubysocket.h: Include netinet/tcp_fsm.h if available.
-Wed Mar 31 19:06:23 2004 Tanaka Akira <akr@m17n.org>
+Mon May 19 19:36:39 2014 Tanaka Akira <akr@fsij.org>
- * time.c (year_leap_p): new function.
- (timegm_noleapsecond): ditto.
- (search_time_t): use timegm_noleapsecond instead of
- mktime for first guess.
+ * test/dbm/test_dbm.rb: Use Etc.uname.
-Wed Mar 31 12:04:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/gdbm/test_gdbm.rb: Ditto.
- * lib/delegate.rb (DelegateClass): define internal methods of the
- result class, but not metaclass of the caller. [ruby-talk:96156]
+Mon May 19 16:54:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * intern.h: provide proper prototypes. [ruby-core:02724]
+ * ext/etc/etc.c (etc_uname): add support for Windows using
+ GetVersionExW(), GetSystemInfo(), and GetComputerNameExW() with
+ `ComputerNameDnsHostname`. [Feature #9842]
- * ruby.h: missing.h is now prerequisite to intern.h.
+Mon May 19 16:29:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Mar 30 20:25:34 2004 Tanaka Akira <akr@m17n.org>
+ * string.c (rb_pat_search): advance by byte offset but not by char
+ offset. [ruby-core:62669] [Bug #9849]
- * time.c (search_time_t): limit guess range by mktime if it is
- available. [ruby-dev:23274]
+Mon May 19 14:06:18 2014 Shota Fukumori <her@sorah.jp>
-Sun Mar 28 14:16:59 2004 Minero Aoki <aamine@loveruby.net>
+ * bin/testrb: Removed. Forgot to remove in r45971.
+ [Feature #9711] [ruby-core:62620]
- * lib/net/pop.rb (auth): failed when account/password include "%".
- [ruby-talk:95933]
+Sun May 18 16:42:08 2014 Tanaka Akira <akr@fsij.org>
-Sat Mar 27 21:40:41 2004 Tanaka Akira <akr@m17n.org>
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
+ detect the glibc version.
+ libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy).
- * lib/open-uri.rb: permit extra semicolon in content-type field.
+Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
-Sat Mar 27 10:40:48 2004 Tanaka Akira <akr@m17n.org>
+ * io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
+ documentation examples. `ARGF.lines` has been deprecated in
+ favor of `ARGF.each_line`. [Fixes GH-615]
- * (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
- instead of PrettyPrint.
+Sun May 18 11:59:25 2014 Tanaka Akira <akr@fsij.org>
-Thu Mar 25 23:28:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * missing/nextafter.c: Include ruby/missing.h.
- * time.c (time_overflow_p): backport 1.9 usec overflow function.
- (ruby-bugs PR#1307)
+Sun May 18 11:09:28 2014 Tanaka Akira <akr@fsij.org>
-Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com>
+ * win32/Makefile.sub: Add nextafter.obj to MISSING.
- * lib/rdoc/ri/ri_options.rb (RI::Options::show_version):
- Add --version option
+Sun May 18 10:46:04 2014 Tanaka Akira <akr@fsij.org>
-Thu Mar 25 04:16:18 2004 Dave Thomas <dave@pragprog.com>
+ * ext/etc/etc.c: Etc.sysconf, Etc.confstr and IO#pathconf implemented.
- * lib/rdoc/ri/ri_options.rb (RI::Options): Add the --list-names option,
- which dumps our all known names
+ * ext/etc/extconf.rb: Check sysconf(), confstr() and fpathconf().
-Thu Mar 25 03:57:47 2004 Dave Thomas <dave@pragprog.com>
+ * ext/etc/mkconstants.rb: New file.
- * lib/rdoc/ri/ri_util.rb (NameDescriptor::initialize): No longer
- allow nested classes to be designated using "."--you must
- now use "::"
+ [ruby-core:62600] [Feature #9842]
-Thu Mar 25 02:00:18 2004 Dave Thomas <dave@pragprog.com>
+Sun May 18 09:58:17 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/generators/template/html/one_page_html.rb (Page):
- Fix to work with C modules.
+ * ext/etc/etc.c: Etc.uname method implemented.
-Wed Mar 24 21:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * ext/etc/extconf.rb: Check uname() function.
- * lib/uri.rb: Documented (thanks Dmitry V. Sabanin).
- * lib/uri/common.rb: Ditto.
- * lib/uri/ftp.rb: Ditto.
- * lib/uri/generic.rb: Ditto.
- * lib/uri/http.rb: Ditto.
- * lib/uri/https.rb: Ditto.
- * lib/uri/ldap.rb: Ditto.
- * lib/uri/mailto.rb: Ditto.
- (All backported from 1.9)
+ [ruby-core:62139] [Feature #9770]
-Wed Mar 24 18:48:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 18 09:16:33 2014 Tanaka Akira <akr@fsij.org>
- * lib/mkmf.rb ($ruby, $topdir, $hdrdir): should not be affected by
- DESTDIR after installed.
+ * configure.in: Check nextafter() availability.
- * lib/mkmf.rb (RUBY): / is not recognized as path separator on
- nmake/bmake. [ruby-list:39388]
+ * include/ruby/missing.h (nextafter): New optional declaration.
- * lib/mkmf.rb (init_mkmf): $INCFLAGS also should be lazy-evaluated.
+ * missing/nextafter.c: New file.
-Wed Mar 24 12:32:56 2004 Dave Thomas <dave@pragprog.com>
+ * numeric.c: Float#next_float and Float#prev_float implemented.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_class_module):
- Don't document methods if we don't know for sure the
- class or module.
+ [ruby-core:62562] [Feature #9834]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Don't store documentation for singleton classes if we
- don't know the real class.
+Sun May 18 09:02:17 2014 Tanaka Akira <akr@fsij.org>
-Wed Mar 24 11:11:26 2004 Dave Thomas <dave@pragprog.com>
+ * enum.c: Enumerable#slice_after implemented.
- * lib/rdoc/generators/html_generator.rb (Generators::HTMLGenerator::load_html_template):
- Allow non-RDoc templates by putting a slash in the template name
+ * enumerator.c: Enumerator::Lazy#slice_after implemented.
-Mon Mar 22 16:19:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ Requested by Tsuyoshi Sawada. [ruby-core:58123] [Feature #9071]
- * ruby.1: add -width option to .Bl for old groff.
+Sun May 18 08:22:25 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 21 21:11:16 2004 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * io.c (io_setstrbuf): always check if the buffer is modifiable.
+ [ruby-core:62643] [Bug #9847]
- * lib/shell/*: bug fix for Shell#system(command_line_string).
+Sun May 18 01:21:23 2014 Tanaka Akira <akr@fsij.org>
-Sat Mar 20 20:57:10 2004 David Black <dblack@wobblini.net>
+ * include/ruby/ruby.h: Hide Rational internal.
+ (RRational): Moved to internal.h
+ (RRATIONAL): Ditto.
+ (RRATIONAL_SET_NUM): Moved to rational.c.
+ (RRATIONAL_SET_DEN): Ditto.
- * lib/scanf.rb: Backported 1.9 branch
- modifications/corrections to 1.8 branch
+ * rational.c (rb_rational_num): New function.
+ (rb_rational_den): Ditto.
-Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * include/ruby/intern.h (rb_rational_num): Declared.
+ (rb_rational_den): Ditto.
- * eval.c (rb_require_safe): preserve old ruby_errinfo.
- [ruby-talk:95409]
+ * ext/bigdecimal/bigdecimal.c: Follow the above change.
- * eval.c (rb_f_raise): should not clear backtrace information if
- exception object already have one.
+ * ext/date/date_core.c: Ditto.
-Sat Mar 20 15:25:36 2004 Dave Thomas <dave@pragprog.com>
+ [ruby-core:60665] [Feature #9513]
- * lib/rdoc/generators/template/html/html.rb (RDoc::Page): Force
- page background to white.
+Sat May 17 17:04:32 2014 Shota Fukumori <her@sorah.jp>
-Sat Mar 20 09:52:33 2004 Tadayoshi Funaba <tadf@dotrb.org>
+ * NEWS: Add news about removal of lib/test/**/*.rb.
- * lib/date.rb, lib/date/format.rb: _parse() now accepts fractional
- part of second minute that follows a comma or a full stop.
+Sat May 17 16:57:33 2014 Shota Fukumori <her@sorah.jp>
-Fri Mar 19 01:55:57 2004 Mauricio Fernandez <batsman.geo@yahoo.com>
+ * lib/test: Removed because ruby's test cases now independent to
+ lib/test by r45970. [Feature #9711] [ruby-core:62620]
- * io.c (rb_io_sync): need not to check writable. [ruby-core:02674]
+ I'm still considering about the future of lib/minitest, lib/test.
+ (bundling gems?)
-Thu Mar 18 21:44:38 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sat May 17 15:06:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/drb/drb.rb: backport drb.rb 1.16.
+ * test/runner.rb: remove dependency test-unit and minitest
+ from stdlib when running with test-all.
+ [Feature #9711][ruby-core:61890]
+ * test/testunit/*.rb: ditto.
+ * test/lib: ditto.
-Fri Mar 18 17:49:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat May 17 11:02:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (make_struct): allow const_id for accessor names.
- [ruby-core:04585]
+ * dir.c (glob_helper): try match PLAIN as well as ALPHA, which are
+ separated by previous commits. [ruby-core:61552] [Bug #9648]
- * eval.c (rb_attr): check if attribute name is local_id or
- const_id.
+ * dir.c (glob_make_pattern): set PLAIN for non-magical path to
+ skip parts which not need to glob.
+ [ruby-core:61552] [Bug #9648]
-Thu Mar 18 16:22:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * dir.c (has_magic): return ALPHA at alphabetical name regardless
+ FNM_CASEFOLD flag.
- * eval.c (proc_eq): avoid false positive by using scope and
- dyna_vars. no longer use frame.uniq.
+ * dir.c (glob_helper): fix conditions for ALPHA.
+ [ruby-core:61552] [Bug #9648]
-Wed Mar 17 14:44:43 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sat May 17 01:49:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * dir.c (range): fix possible "\0" overrun. (in case of "\0-")
+ * dir.c (glob_helper): reduce matching at non-magical path on
+ Windows.
-Mon Mar 15 07:39:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat May 17 01:49:23 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_yield_0): should not re-submit TAG_BREAK if this
- yield is not break destination. [ruby-dev:23197]
+ * dir.c (glob_pattern_type): separate names with alphabet but no
+ magical from plain.
-Sat Mar 13 14:28:16 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * dir.c (glob_helper): match plain names as-is to treat super-root
+ same as the root. [ruby-core:61552] [Bug #9648]
- * test/drb/test_drbssl.rb: rescue LoadError. (Barkport from main
- trunk)
+Fri May 16 17:38:22 2014 Koichi Sasada <ko1@atdot.net>
- * test/drb/test_drbunix.rb: ditto.
+ * gc.c (gc_marks, gc_marks_body): increase the counter of young objects
+ at the major GC because AGE2Promotion changes all old objects into
+ young objects at major GC.
-Wed Mar 10 22:28:09 2004 Minero Aoki <aamine@loveruby.net>
+Fri May 16 17:26:24 2014 Koichi Sasada <ko1@atdot.net>
- * lib/fileutils.rb (remove_dir): should handle symlink correctly.
- This patch is contributed by Christian Loew. [ruby-talk:94635]
- (Backport from main trunk)
+ * gc.c (gc_before_sweep): heap_pages_swept_slots should contains
+ heap_pages_increment.
-Wed Mar 10 16:28:42 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ For example, GC by exceeding malloc_limit can remain
+ heap_pages_increment.
- * eval.c (return_jump): set return value to the return
- destination. separated from localjump_destination().
+Thu May 15 21:18:43 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * eval.c (break_jump): break innermost loop (or thread or proc).
+ * configure.in: enable SSE2 on mingw. target='i386-pc-mingw32'.
+ [ruby-core:62095] [Bug #8358]
- * eval.c (rb_yield_0): set exit_value for block break.
+Thu May 15 21:04:06 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Wed Mar 10 15:58:43 2004 Ryan Davis <ryand@zenspider.com>
+ * lib/test/unit/parallel.rb: fix test-all parallel failure if a test
+ is skipped after raise.
+ DL::TestFunc#test_sinf is skipped after raise on mingw ruby.
+ But it causes Marshal.load failure due to undefined class/module
+ DL::DLError when doing test-all parallel and test-all doesn't
+ complete. We create new MiniTest::Skip object to avoid Marshal.load
+ failure.
+ [ruby-core:62133] [Bug #9767]
- * eval.c (eval): Only print backtrace if generating the backtrace
- doesn't generate an exception. [ruby-core:02621]
+ * test/testunit/test_parallel.rb (TestParallel): add a test.
-Tue Mar 9 13:04:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/testunit/tests_for_parallel/ptest_forth.rb: ditto.
- * io.c (rb_io_ungetc): raise IOError instead of calling
- rb_sys_fail(). [ruby-talk:23181]
+Thu May 15 18:57:23 2014 Koichi Sasada <ko1@atdot.net>
-Mon Mar 8 19:32:28 2004 akira yamada <akira@ruby-lang.org>
+ * gc.c (garbage_collect_body): move gc_heap_prepare_minimum_pages()
+ from gc_sweep().
- * lib/uri/common.rb (URI::REGEXP::PATTERN::HOSTPORT): (?:#{PORT})
- -> (?::#{PORT}). [ruby-dev:23170]
+Thu May 15 18:51:25 2014 Koichi Sasada <ko1@atdot.net>
-Mon Mar 8 15:31:41 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * gc.c (heap_extend_pages): calculate next growing heap size.
- * dir.c (range): treat incomplete '[' as ordinary character (like
- has_magic does).
+ * gc.c (heap_set_increment): accept addition pages instead of
+ minimum pages.
- * dir.c (range): Cancel above change. More discussion is needed.
+ * gc.c (gc_after_sweep): use heap_etend_pages().
-Sun Mar 7 22:37:46 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c (gc_heap_prepare_minimum_pages): add only 1 page.
- * test/drb/ut_drb.rb: use 'druby://localhost:0'. [ruby-dev:23078]
+ * gc.c (heap_ready_to_gc): add only 1 page.
- * test/drb/ut_eval.rb: ditto.
+Thu May 15 18:42:49 2014 Koichi Sasada <ko1@atdot.net>
- * test/drb/ut_large.rb: ditto.
+ * gc.c: introduce macros to remove magic number.
- * test/drb/ut_safe1.rb: ditto.
+ GC_HEAP_FREE_SLOTS_MIN_RATIO = 0.3: guarantee minimum empty slots
+ ratio after sweep.
+ GC_HEAP_FREE_SLOTS_MAX_RATIO = 0.8: allow to free pages 0.2 (= 1-0.8)
+ of current existing slots.
- * test/drb/ut_drb_drbssl.rb: use 'drbssl://localhost:0'.
+Thu May 15 17:32:51 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun Mar 7 16:22:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * thread_win32.c (rb_w32_stack_overflow_handler): use Structured
+ Exception Handling by AddVectoredExceptionHandler() for machine
+ stack overflow on mingw.
+ This would be equivalent to the handling using __try and __except
+ on mswin introduced by r43748.
- * Makefile.in (lex.c): use $? instead of $<.
+Wed May 14 19:31:03 2014 Koichi Sasada <ko1@atdot.net>
-Fri Mar 5 00:54:14 2004 Dave Thomas <dave@pragprog.com>
+ * ext/openssl/depend: remove dependency from internal headers.
+ [Feature #9612]
- * lib/test/unit.rb: MOve RDoc documentation so that you can
- now say 'ri Test::Unit'
+ * ext/openssl/ossl.c (ossl_fips_mode_set): ditto.
-Tue Mar 2 12:32:59 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/coverage/depend: ditto.
- * win32/Makefile.sub, wince/Makefile.sub (config.h): shouldn't check
- defined? NORETURN. [ruby-dev:23100]
+ * include/ruby/thread_native.h: added.
-Mon Mar 1 12:24:10 2004 Dave Thomas <dave@pragprog.com>
+ This header file only provides wrapper functions to control
+ native threads. These wrapper functions are used by MRI
+ implementation.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_alias):
- Allow aliases to have parentheses
+ * vm_core.h: use include/ruby/thread_native.h.
-Sun Feb 29 23:14:53 2004 Dave Thomas <dave@pragprog.com>
+ * thread.c: ditto.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class):
- Handle :nodoc: on singleton classes.
+ * thread_pthread.h: ditto.
-Sat Feb 28 10:58:49 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * thread_win32.h: ditto.
- * MANIFEST: add test_erb.rb
+ * thread_native.h: removed.
- * lib/erb.rb, test/erb/test_erb.rb: don't forget filename,
- if both filename and safe_level given. [ruby-dev:23050]
+Wed May 14 18:03:28 2014 Koichi Sasada <ko1@atdot.net>
-Fri Feb 27 01:00:09 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * gc.c: enable RGENGC_AGE2_PROMOTION.
- * lib/drb/drb.rb, test/drb/drbtest.rb: require drb/eq.rb by default
+Wed May 14 18:02:30 2014 Koichi Sasada <ko1@atdot.net>
-Wed Feb 25 21:16:25 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (rgengc_rememberset_mark): promote remembered object earlier.
- * instruby.rb (with_destdir): should return the given argument if no
- DESTDIR is given.
+Mon May 12 23:57:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * instruby.rb: use path name expansion of cmd.exe.
+ * configure.in (rb_cv_atan2_inf_c99): check whether runtime atan2
+ handles Inf as C99. [ruby-core:62536] [Bug #9831]
-Wed Feb 25 09:35:22 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon May 12 20:33:01 2014 Tanaka Akira <akr@fsij.org>
- * error.c (NameError::Message): new class for lazy evaluation of
- message to ensure replaced before marshalling. merge from HEAD.
- (ruby-bugs-ja:PR#588)
+ * configure.in: Invoke AC_REPLACE_FUNCS for each function.
- * eval.c (rb_method_missing): use NameError::Message. merge from
- HEAD. (ruby-bugs-ja:PR#588)
+Mon May 12 19:52:11 2014 Koichi Sasada <ko1@atdot.net>
-Tue Feb 24 18:59:37 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * gc.c: count young object correctly and show it in GC.stat
+ on RGENGC_AGE2_PROMOTION.
- * dir.c (glob_helper): '**/' should not match leading period
- unless File::FNM_DOTMATCH is set. (like '*/') [ruby-dev:23014]
+ * gc.c (RVALUE_PROMOTE_YOUNG): decrement young object count on
+ YOUNG->OLD.
-Tue Feb 24 13:22:21 2004 Dave Thomas <dave@pragprog.com>
+ * gc.c (obj_free): decrement young object count when young object
+ freed.
- * lib/rdoc/rdoc.rb (RDoc::RDoc::normalized_file_list): Attempt to get better
- heuristics on which files to include and exclude. Now only include
- non-standard files if they are explicitly named in ARGV.
+ * gc.c (gc_marks): should not clear young object count.
-Tue Feb 24 07:23:30 2004 Dave Thomas <dave@pragprog.com>
+ * gc.c (gc_stat_internal): GC.stat :young_object information.
- * lib/rdoc/generators/html_generator.rb: Deal with :stopdoc: when
- choosing a default main page to display (ie. don't select a page
- if we don't have documentation for it).
+Mon May 12 01:30:59 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
+ * ext/socket/ifaddr.c (IS_IFADDRS): Unused macro removed.
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
- class variables in code listings
+ * ext/strscan/strscan.c (BUFSIZE): Ditto.
-Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
+ * ext/zlib/zlib.c (OBJ_IS_FREED): Ditto.
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
- class variables in code listings
+Sun May 11 22:27:18 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 24 06:32:27 2004 Dave Thomas <dave@pragprog.com>
+ * compile.c (BUFSIZE): Unused macro removed.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_aliases): Handle
- aliases in C files.
+ * vm.c (BUFSIZE): Ditto.
-Tue Feb 24 06:16:22 2004 Dave Thomas <dave@pragprog.com>
+ * pack.c (INT64toNUM): Ditto.
+ (UINT64toNUM): Ditto.
+ (BYTEWIDTH): Ditto.
- * lib/rdoc/rdoc.rb (RDoc::RDoc::document): Now create op dir _before_
- parsing files.
+ * time.c (lshift): Ditto.
+ (UINT64toNUM): Ditto.
+ (id_lshift): Unused variable removed.
-Tue Feb 24 06:08:47 2004 Dave Thomas <dave@pragprog.com>
+Sun May 11 21:23:27 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_constant):
- Start collecting text of constant values earlier: was missing
- values in output if there was no space after '='
+ * pack.c (swaps): Unused macro removed.
+ (swapi): Ditto.
+ (swapl): Ditto.
+ (swapll): Ditto.
-Tue Feb 24 06:08:25 2004 Dave Thomas <dave@pragprog.com>
+Sun May 11 08:02:49 2014 Eric Wong <e@80x24.org>
- * lib/rdoc/generators/html_generator.rb: Escape contant values.
+ * vm_core.h (rb_vm_t): list_head and counter for living_threads
+ (rb_thread_t): vmlt_node for living_threads linkage
+ (rb_vm_living_threads_init): new function wrapper
+ (rb_vm_living_threads_insert): ditto
+ (rb_vm_living_threads_remove): ditto
+ * vm.c (rb_vm_living_threads_foreach): new function wrapper
+ * thread.c (terminate_i, thread_start_func_2, thread_create_core,
+ thread_fd_close_i, thread_fd_close): update to use new APIs
+ * vm.c (vm_mark_each_thread_func, rb_vm_mark, ruby_vm_destruct,
+ vm_memsize, vm_init2, Init_VM): ditto
+ * vm_trace.c (clear_trace_func_i, rb_clear_trace_func): ditto
+ * benchmark/bm_vm_thread_close.rb: added to show improvement
+ * ccan/build_assert/build_assert.h: added as a dependency of list.h
+ * ccan/check_type/check_type.h: ditto
+ * ccan/container_of/container_of.h: ditto
+ * ccan/licenses/BSD-MIT: ditto
+ * ccan/licenses/CC0: ditto
+ * ccan/str/str.h: ditto (stripped of unused macros)
+ * ccan/list/list.h: ditto
+ * common.mk: add CCAN_LIST_INCLUDES
+ [ruby-core:61871][Feature #9632 (part 1)]
-Tue Feb 24 03:45:06 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun May 11 01:10:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_config.c (ossl_config_each): add new method
- OpenSSL::Config#each. it iterates with section name, field name
- and value.
+ * signal.c (rb_f_kill): directly enqueue an ignored signal to self,
+ except for SIGSEGV and SIGBUS. [ruby-dev:48203] [Bug #9820]
- * ext/openssl/ossl_config.c (Init_ossl_config): include Enumerable.
+Sat May 10 22:37:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 23 09:16:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c (push_glob): match in UTF-8 on Mac OS X.
+ [ruby-dev:48213] [Bug #9825]
- * instruby.rb (DOSISH): embedded path in batch files should not be
- prefixed by DESTDIR. [ruby-core:02186]
+Sat May 10 13:32:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 22 09:54:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * thread.c (thread_start_func_2): stop if forked in a sub-thread,
+ the thread has become the main thread.
+ [ruby-core:62070] [Bug #9751]
- * re.c: corrected documentation format (again)
+Sat May 10 09:32:19 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Sun Feb 22 09:43:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * man/ruby.1: remove deadlink. [ruby-core:62145][Bug #9773]
- * re.c: corrected documentation format (rb_reg_initialize_m)
+Sat May 10 08:47:36 2014 Tanaka Akira <akr@fsij.org>
-Sat Feb 21 22:36:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.
- * ext/zlib/zlib.c: documented, but needs more effort.
+Fri May 9 14:27:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Feb 21 11:12:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_SETJMP_TYPE): check for setjmp type after
+ CCDLFLAGS is appended to CFLAGS, since __builtin_setjmp can be
+ affected. [ruby-core:62469] [Bug #9818]
- * missing/os2.c, missing/x68.c: typo fix. pointed out by greentea.
+Fri May 9 03:59:06 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/delegate.rb: Fix example of using delegator.
+ patched from Andrey Koleshko. [Fixes GH-505]
- * lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to
- irb. [ruby-dev:39243]
+Fri May 9 03:42:43 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
+ * lib/shell.rb: add documentation in lib/shell.rb
+ patched from reprah. [Fixes GH-516]
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
- Support visibility modifiers for attributes
+Fri May 9 03:28:04 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Feb 19 23:24:16 2004 Dave Thomas <dave@pragprog.com>
+ * lib/fileutils.rb: show fileutils require at top.
+ patched from Richard Schneeman. [Fixes GH-604]
- * lib/rdoc/generators/html_generator.rb (Generators::HtmlClass::build_attribute_list):
- Support visibility modifiers for attributes
+Fri May 9 03:07:09 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Feb 19 22:39:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/prime.rb (Prime#prime?): negative numbers can't be primes
+ by definition. reported by Ivan Kataitsev. [Bug #7395]
+ * test/test_prime.rb: add test.
- * test/rinda/test_rinda.rb: DRb.start_service only once in testsuites.
- DRb.start_service could handle this.
+Thu May 8 14:34:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 19 22:19:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * class.c (rb_mod_init_copy): always clear instance variable,
+ constant and method tables first, regardless the source tables.
+ [ruby-dev:48182] [Bug #9813]
- * lib/ostruct.rb: documented
+Thu May 8 10:53:14 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 19 21:28:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * configure.in: OpenBSD needs to include sys/param.h before include
+ sys/mount.h. [ruby-dev:48167]
- * ext/strscan/strscan.c: improved documentation
+Thu May 8 10:17:04 2014 Karsten Sperling <karsten@sperling.co.nz>
-Thu Feb 19 03:10:52 2004 Minero Aoki <aamine@loveruby.net>
+ * lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): stop
+ handling requests on shutdown, even if the socket is readable
+ and IO.select() returns true. [Fixes GH-607]
- * ext/strscan/strscan.c: synchronized with main trunk (rev 1.11).
+ * lib/webrick/server.rb (WEBrick::GenericServer#start): IO.select()
+ raises ENOTSOCK on shutdown on Windows.
-Thu Feb 19 02:30:34 2004 Minero Aoki <aamine@loveruby.net>
+Wed May 7 21:45:00 2014 Tanaka Akira <akr@fsij.org>
- * ext/strscan/strscan.c: documentation checked.
+ * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#accept):
+ Consider Socket#accept as well as TCPServer#accept.
+ Reported by Sam Stelfox. [ruby-core:62064] [Bug #9750]
-Thu Feb 19 00:11:05 2004 Dave Thomas <dave@pragprog.com>
+Wed May 7 17:24:07 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::handle):
- Strip extraneous space from filenames in :include:
+ * numeric.c (num_step_scan_args): check keyword arguments and fail
+ if they conflict with positional arguments.
+ [ruby-dev:48177] [Bug #9811]
-Wed Feb 18 22:52:00 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Wed May 7 12:06:14 2014 Koichi Sasada <ko1@atdot.net>
- * lib/drb/unix.rb: remove O_NONBLOCK, thanks \ay
+ * benchmark/driver.rb: remove debug output and output results into
+ specified file.
-Wed Feb 18 22:47:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Wed May 7 11:55:40 2014 Koichi Sasada <ko1@atdot.net>
- * ext/strscan/strscan.c: documented
+ * benchmark/driver.rb: add '--rawdata-output=[FILE] option to output
+ raw results into FILE.
-Wed Feb 18 22:03:11 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed May 7 11:25:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/*: should not depend on $KCODE.
+ * vm_eval.c (rb_f_local_variables): exclude variables hidden by
+ shadowing. [ruby-core:60501] [Bug #9486]
-Wed Feb 18 17:18:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * vm.c (collect_local_variables_in_iseq): ditto.
- * ext/win32ole/win32ole.c: need to include <olectl.h> on Cygwin.
+Tue May 6 23:29:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Feb 18 10:40:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (new_bv_gen): no duplicated names, if already added in
+ shadowing_lvar().
- * sprintf.c (rb_f_sprintf): do not prepend dots for negative
- numbers if FZERO is specified. [ruby-list:39218]
+ * parse.y (local_tbl_gen): remove local variables duplicated with
+ arguments.
+ [ruby-core:60501] [Bug #9486]
-Tue Feb 17 23:40:34 2004 Guy Decoux <ts@moulon.inra.fr>
+Tue May 6 18:48:50 2014 Tanaka Akira <akr@fsij.org>
- * sprintf.c (rb_f_sprintf): preserve original val for
- format_integer. [ruby-talk:92975]
+ * lib/time.rb (Time.make_time): Adjust the time zone of "now".
-Tue Feb 17 23:28:45 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Tue May 6 18:33:12 2014 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/marshaltestlib.rb: common marshal testcase added.
+ * io.c (io_{read,write}_nonblock): use rb_get_kwargs instead of
+ rb_hash_aref.
- * test/ruby/test_marshal.rb: use above testsuite.
+Tue May 6 18:03:05 2014 Tanaka Akira <akr@fsij.org>
- * test/soap/marshal/test_marshal.rb: ditto.
+ * lib/time.rb (Time.make_time): Argument validation code moved from
+ Time.parse and Time.strptime.
- * test/soap/marshal/cmarshal.rb: removed (not used).
+Tue May 6 17:27:06 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 17 10:51:23 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/time.rb (Time.parse): [DOC] Fix an example in the documentation
+ to use EST.
+ Reported by Marcus Stollsteimer.
+ [ruby-core:60778] [Bug #9521] and [ruby-core:61718] [Bug #9682]
- * ext/syck/rubyext.c (syck_emitter_end_object): takes only one arg.
+Tue May 6 04:31:48 2014 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Feb 17 01:35:28 2004 Tanaka Akira <akr@m17n.org>
+ * file.c (rb_f_test): removed meaningless "case 'a'".
- * eval.c (rb_eval): care that another thread replace NODE_DREGX_ONCE
- to NODE_LIT. [ruby-dev:22920]
+Tue May 6 01:28:14 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 17 01:24:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/open-uri.rb (OpenURI.open_uri): Call StringIO#close only if
+ the StringIO object is not closed yet.
+ Reported by Jordi Massaguer Pla. [ruby-core:42538] [Bug #6010]
- * bcc32/Makefile.sub, win32/Makefile.sub (config.h): define
- STACK_GROW_DIRECTION. [ruby-dev:22910]
+Tue May 6 01:08:01 2014 Koichi Sasada <ko1@atdot.net>
- * bcc32/Makefile.sub (config.h): add newer checks.
+ * benchmark/driver.rb: define File::NULL if not defined and /dev/null
+ is available to run benchmark driver on ruby 1.9.2.
- * wince/Makefile.sub (config.h): define NEED_IO_SEEK_BETWEEN_RW.
+Mon May 5 23:53:24 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 17 00:38:10 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * ext/socket/mkconstants.rb: Add IP_TRANSPARENT.
+ IP_TRANSPARENT is provieded since glibc-2.12.
+ Reported by Eliezer Croitoru. [ruby-core:50372] [Bug #7476]
- * lib/rinda/tuplespace.rb: TupleSpace#initialize, stop doubling timeout
+Mon May 5 22:29:47 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 17 00:18:03 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * process.c (check_exec_redirect): Open the file in write mode for
+ redirect from [:out, :err].
+ Proposed and implemented by Yusuke Endoh.
+ [ruby-dev:41430] [Feature #3348]
- * test/rinda/test_rinda.rb: import test_rinda.rb
+Mon May 5 21:52:35 2014 Tanaka Akira <akr@fsij.org>
-Tue Feb 17 00:14:30 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * ext/pathname/lib/pathname.rb (cleanpath_aggressive): make all
+ separators File::SEPARATOR from File::ALT_SEPARATOR.
+ Reported by Daniel Rikowski.
+ Fixed by Nobuyoshi Nakada. [Bug #9618]
- * bcc32/Makefile.sub: avoid warning "Redefinition of macro
- 'HAVE_GETLOGIN'".
+ * ext/pathname/lib/pathname.rb (cleanpath_conservative): ditto.
- * vms/config.h_in: ditto.
+Mon May 5 21:48:04 2014 Tanaka Akira <akr@fsij.org>
-Mon Feb 16 23:28:14 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb (Pathname#/): Aliased to Pathname#+.
+ Suggested by Alexey Muranov. [ruby-core:61432] [Feature #9625]
- * lib/csv.rb: document reduction. [ruby-core:02429]
+Mon May 5 17:26:09 2014 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Feb 16 22:08:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * math.c (rb_math_sqrt): omitted exporting an unused function,
+ anyway.
+ * internal.h: follows the above change.
- * lib/generator.rb: corrected doc format
- * lib/rinda/rinda.rb: added documentation (from Hugh Sasse)
- * lib/rinda/tuplespace.rb: ditto
+Mon May 5 11:44:03 2014 Tanaka Akira <akr@fsij.org>
-Mon Feb 16 20:41:32 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/time.rb (Time.strptime): Raise ArgumentError if Date._strptime
+ doesn't extract date information.
+ Reported by tadayoshi funaba. [ruby-core:62349]
- * bcc32/Makefile.sub: show more warnings. (refering to mingw)
+Mon May 5 01:12:27 2014 Tadayoshi Funaba <tadf@dotrb.org>
- * bcc32/setup.mak: ditto.
+ * ext/date/date_core.c (rt_rewrite_frags): a new feature (not a
+ bug fix) of strptime. applies offset even if the given date is
+ not local time (%s and %Q). This is an exceptional feature and
+ I do NOT recommend to use this at all. Thank you git community.
-Mon Feb 16 13:39:44 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+Sun May 4 20:51:32 2014 Tanaka Akira <akr@fsij.org>
- * dir.c (rb_glob, rb_globi): add const.
+ * lib/time.rb (Time.force_zone!): Use usual local time if it has
+ expected offset from UTC.
- * ruby.h: ditto.
+Sun May 4 17:58:12 2014 Tanaka Akira <akr@fsij.org>
-Mon Feb 16 02:16:33 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * lib/time.rb (Time.force_zone!): New private method.
+ (Time.make_time): Use Time.force_zone!.
+ (Time.strptime): Ditto.
+ (Time.rfc2822): Ditto.
+ (Time.xmlschema): Ditto.
- * bcc32/Makefile.sub: should warn suspicious pointer conversion.
+ * lib/rss/rss.rb (Time.w3cdtf): Use Time.force_zone!.
- * bcc32/setup.mak: ditto.
+Sun May 4 10:22:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Feb 15 19:06:42 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * math.c (math_atan2): return values like as expected by C99 if
+ both two arguments are infinity. based on the patch by cremno
+ phobia <cremno AT mail.ru> in [ruby-core:62310]. [Feature #9799]
- * lib/rinda/tuplespace.rb: TupleSpace#read(tpl, 0), raise
- RequestExpiredError if not found.
+Sun May 4 03:46:42 2014 Tanaka Akira <akr@fsij.org>
-Sun Feb 15 15:56:46 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * lib/time.rb (Time.httpdate): Always return a UTC Time object.
- * ext/win32ole/win32ole.c: add IDispatch wrapper in val2variant.
- Thanks, arton.
+Sun May 4 03:26:39 2014 Tanaka Akira <akr@fsij.org>
-Sun Feb 15 01:46:05 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/time.rb (Time.make_time): Refactored.
- * lib/mkmf.rb: absolute path of ruby is assigned to $(RUBY).
- [ruby-dev:22870]
+Sun May 4 02:53:17 2014 Tanaka Akira <akr@fsij.org>
-Sat Feb 14 11:29:41 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/time.rb (Time.rfc2822): Fix year completion.
+ Produce fixed-offset time object if appropriate.
+ (Time.xmlschema): Produce fixed-offset time object if appropriate.
- * sample/drb/*: import lib/drb/sample
+Sat May 3 23:52:20 2014 Tanaka Akira <akr@fsij.org>
-Sat Feb 14 11:08:23 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/time.rb (make_time): Produce fixed-offset time object if
+ appropriate.
+ (Time.strptime): Use d[:zone] instead of d[:offset].
- * lib/drb/drb.rb: add pretty_print, thanks gotoken.
+ * lib/rss/rss.rb (Time.w3cdtf): Produce fixed-offset time object if
+ appropriate.
-Fri Feb 13 12:35:08 2004 Minero Aoki <aamine@loveruby.net>
+Sat May 3 20:21:38 2014 Tanaka Akira <akr@fsij.org>
- * test/fileutils/test_fileutils.rb: File.link may raise EINVAL and
- EACCES on Windows.
+ * lib/time.rb (Time.strptime): Use d[:offset] if d[:seconds] is not
+ given.
+ Reported by tadayoshi funaba. [ruby-core:62322]
-Thu Feb 12 21:45:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sat May 3 04:04:16 2014 Eric Wong <e@80x24.org>
- * lib/ftools.rb: documented
+ * complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
+ [Bug #9608]
+ * rational.c (read_digits): ditto
-Thu Feb 12 21:25:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sat May 3 00:06:30 2014 Naohisa Goto <ngotogenome@gmail.com>
- * lib/base64.rb: backported from HEAD (modularised and documented)
+ * file.c (HAVE_STRUCT_STATVFS_F_BASETYPE): File::Statfs#fstypename
+ is supported on AIX, HP-UX, and Solaris, by using the value of
+ struct statvfs.f_basetype.
-Thu Feb 12 20:31:48 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (HAVE_STRUCT_STATVFS_F_BASETYPE): check struct
+ statvfs.f_basetype which is available on AIX, HP-UX, and Solaris.
- * lib/mkmf.rb (create_tmpsrc): cpp32 of Borland C++ ignores #error
- directives in DOS line-ending files at all.
+Fri May 2 21:04:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 12 02:23:56 2004 Tanaka Akira <akr@m17n.org>
+ * parse.y (next_id): no reason to set ID_STATIC_SYM here, as ID
+ returned by rb_intern3 can be a dynamic symbol and the static
+ symbol flag is set otherwise. [Bug #9787]
- * lib/pathname.rb: use assert_raise instead of assert_raises.
+Fri May 2 11:32:51 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/pp.rb: ditto.
+ * test/ruby/test_io.rb (test_seek, test_seek_symwhence): defer
+ File::Statfs#type call which may not be implemented, to mitigate
+ errors on platforms where SEEK_DATA is available but f_type in
+ struct statfs is not. [ruby-dev:48154] [Bug #9789]
- * lib/time.rb: ditto.
+Fri May 2 10:37:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tsort.rb: ditto.
- use TSortHash and TSortArray instead of Hash and Array in test.
+ * parse.y (rb_id_attrset): turn dynamically interned Symbol into
+ an ID, since rb_str_dynamic_intern returns a Symbol but not an
+ ID. [ruby-core:62226] [Bug #9787]
-Wed Feb 11 20:01:12 2004 akira yamada <akira@ruby-lang.org>
+Thu May 1 22:19:34 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_file.rb (TestFile::test_fnmatch): added tests for
- File.fnmatch. [ruby-dev:22815][ruby-dev:22819]
+ * file.c: Change AND condition to nested condition.
- * test/ruby/test_proc.rb (TestProc::test_eq): added a
- test. [ruby-dev:22599]
+Thu May 1 00:36:26 2014 Naohisa Goto <ngotogenome@gmail.com>
- * test/ruby/test_proc.rb (TestProc::test_eq): added tests for
- Proc#==. [ruby-dev:22592], [ruby-dev:22601]
+ * file.c (FSTATFS): check availability of struct statfs and
+ struct statvfs in addition to fstatfs(2) and fstatvfs(2).
+ This fixes error in Solaris. [Bug #9788] [ruby-dev:48145]
-Tue Feb 10 16:43:56 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Apr 30 19:46:23 2014 Narihiro Nakamura <authornari@gmail.com>
- * eval.c (umethod_bind): purge unused check. [ruby-dev:22850]
+ * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
+ Tomb heap pages are freed pages here, so expanding heap is
+ not required.
-Mon Feb 9 17:16:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Apr 30 17:58:40 2014 Koichi Sasada <ko1@atdot.net>
- * lib/rdoc/parsers/parse_c.rb: escape '{' and '}' to avoid warnings.
+ * vm.c (invoke_block_from_c): add VM_FRAME_FLAG_BMETHOD to record
+ it is bmethod frame.
-Mon Feb 9 13:00:55 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+ * vm.c (vm_exec): invoke RUBY_EVENT_RETURN event if rollbacked frame
+ is VM_FRAME_FLAG_BMETHOD.
+ [Bug #9759]
- * dir.c (fnmatch): File.fnmatch('*?', 'a') should return true.
- [ruby-dev:22815]
+ * test/ruby/test_settracefunc.rb: add a test for TracePoint/set_trace_func.
- * dir.c (fnmatch): File.fnmatch('\[1\]' , '[1]') should return true.
- [ruby-dev:22819]
+ * vm_core.h: rename rb_thread_t::passed_me to
+ rb_thread_t::passed_bmethod_me to clarify the usage.
-Sun Feb 8 16:46:13 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_bmethod_body): use renamed member.
- * lib/pp.rb (PP::PPMethods::object_address_group): suppress negative
- sign for higher heap areas.
+Wed Apr 30 17:06:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 6 22:48:16 2004 Dave Thomas <dave@pragprog.com>
+ * parse.y (rb_id_attrset): pin down dynamic symbol only. it is
+ possible that attrset ID can be registered as a static symbol
+ after the corresponding attrget ID has been registered as a
+ dynamic, and then the latter may be collected.
+ [ruby-core:62226] [Bug #9787]
- * lib/rdoc/generators/html_generator.rb (gen_url): Support
- https in RDoc hyperlinks
+Tue Apr 29 14:17:57 2014 Tanaka Akira <akr@fsij.org>
-Fri Feb 6 22:41:22 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/tmpdir.rb: Rescue LoadError on etc.so for miniruby.
+ Revert r45707, r45711, r45717.
- * lib/pp.rb (PPInspectTest#test_to_s_with_iv): rollback the previous
- commit. [ruby-dev:22813]
+Tue Apr 29 12:50:02 2014 Tanaka Akira <akr@fsij.org>
-Fri Feb 6 22:22:50 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/fileutils.rb: Don't need to define fu_get_gid and fu_get_gid in
+ rescue LoadError on 'etc'.
- * lib/pp.rb (PPInspectTest#test_to_s_with_iv): remove instance
- variable which is defined in the test.
+Tue Apr 29 10:21:38 2014 Kazuki Tsujimoto <kazuki@callcc.net>
-Fri Feb 6 00:48:37 2004 Tanaka Akira <akr@m17n.org>
+ * parse.y (symbols_i): like r45492, call rb_gc_resurrect().
- * lib/prettyprint.rb (PrettyPrint#first?): obsoleted.
+Tue Apr 29 04:29:05 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Feb 5 23:56:55 2004 Tanaka Akira <akr@m17n.org>
+ * file.c (HAVE_STRUCT_STATFS_T_F_FSTYPENAME): Add new macro for
+ statfs_t.
+ * file.c (HAVE_STRUCT_STATFS_T_F_TYPE): ditto.
- * lib/prettyprint.rb (PrettyPrint#seplist): added.
+ * file.c (rb_io_statfs): check FSTATFS macro only instead of
+ HAVE_FSTATFS and HAVE_FSTATVFS.
- * lib/pp.rb (PPMethods#pp_object): use seplist.
- (PPMethods#pp_hash): ditto.
- (Array#pretty_print): ditto.
- (Struct#pretty_print): ditto.
- (MatchData#pretty_print): ditto.
+ * file.c (statfs_type): use new macro.
+ * file.c (statfs_fstypename): ditto.
+ * file.c (statfs_inspect): ditto.
- * lib/set.rb (Set#pretty_print): use seplist.
+Tue Apr 29 00:20:26 2014 Rajarshi Das <rajarshid@cybage.com>
-Wed Feb 4 02:12:06 2004 Tanaka Akira <akr@m17n.org>
+ * bootstraptest/test_literal.rb: fix typo of "dynamic". [ci skip]
- * file.c (test_l): fix wrong method name in document.
- (test_S): ditto.
- (test_b): ditto.
- (test_c): ditto.
- (test_suid): ditto.
- (test_sgid): ditto.
- (test_sticky): ditto.
+ * regexp.rdoc: fix typo of "organized". [ci skip]
-Tue Feb 3 08:04:57 2004 Tanaka Akira <akr@m17n.org>
+ * lib/session.rb: fix typo of "recognized". [ci skip]
- * lib/pp.rb (Struct#pretty_print_cycle): follow 1.8 style.
+Mon Apr 28 21:40:27 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Feb 2 19:33:49 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * configure.in (HAVE_STRUCT_STATFS_F_TYPE): check struct statfs.f_type
+ to support OpenBSD.
- * configure.in: backport from 1.9 for Interix.
+ * file.c (statfs_type): use above macro to switch.
- * dln.c (dln_load): ditto.
+ * file.c (statfs_inspect): ditto.
-Mon Feb 2 13:31:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Apr 28 18:06:08 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/http.rb (canonical_each): fix merge miss.
+ * configure.in: check struct statvfs and struct statvfs.f_fstypename.
-Mon Feb 2 01:54:00 2004 Tanaka Akira <akr@m17n.org>
+ * configure.in: on NetBSD fstatfs is obsoleted.
- * lib/pp.rb (Struct#pretty_print): make it 1.8 style.
- (Numeric#pretty_print, FalseClass#pretty_print)
- (TrueClass#pretty_print, Module#pretty_print): fix pp for objects
- with instance variables. [ruby-talk:91157]
+ * file.c: support NetBSD for File::Statfs.
- * lib/open-uri.rb (URI::Generic#find_proxy): return nil on loopback
- address.
+Mon Apr 28 17:42:42 2014 Narihiro Nakamura <authornari@gmail.com>
- * lib/resolv-replace.rb (BasicSocket#send): don't replace because
- it has no hostname argument.
- (IPSocket.getaddress): raise SocketError instead of
- Resolv::ResolvError for errors.
- (TCPSocket#initialize, UDPSocket#bind, UDPSocket#connect)
- (SOCKSSocket#initialize): use IPSocket.getaddress instead of
- Resolv.getaddress.
- (UDPSocket#send): recognize 3 arguments form. try all addresses on
- 4 arguments form.
+ * gc.c: This argument must be a pointer.
-Sun Feb 1 18:17:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Mon Apr 28 17:40:15 2014 Narihiro Nakamura <authornari@gmail.com>
- * lib/net/http.rb: merged coding style changes from HEAD.
+ * gc.c: Fix typos. These are undefined variables.
-Sun Feb 1 16:15:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
+Sun Apr 27 19:39:42 2014 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/test/unit.rb: rearranged documentation for RDoc's sake.
- * lib/matrix.rb: improved documentation.
- * lib/net/http.rb: slight documentation formatting improvement.
+ * ext/date/date_strptime.c (date__strptime_internal): do not
+ overwrite century.
-Sun Feb 1 05:30:06 2004 Tanaka Akira <akr@m17n.org>
+Sat Apr 26 11:50:08 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/open-uri.rb (URI::Generic#find_proxy): warn HTTP_PROXY.
- raise an errror on non-http proxy URI.
- (OpenURI::Buffer#<<): make a tempfile binmode. [ruby-talk:90793]
+ * test/ruby/test_enum.rb (test_flat_map): Added test for flat_map.
+ Contribute from @igaiga. [fix GH-598]
-Sat Jan 31 09:20:32 2004 NAKAMURA, Hiroshi <nakahiro@sairon.co.jp>
+Sat Apr 26 10:55:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sample/openssl/gen_csr.rb: wrong usage string.
+ * compile.c (compile_array_): make copy a first hash not to modify
+ the argument itself. keyword splat should be non-destructive.
+ [ruby-core:62161] [Bug #9776]
-Sat Jan 31 01:00:32 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Apr 26 08:05:36 2014 Tanaka Akira <akr@fsij.org>
- * lib/soap/wsdlDriver.rb, lib/wsdl/soap/operation.rb: add support of
- "parts" attribute of soap:body element in WSDL.
+ * test/ruby/test_process.rb (test_rlimit_nofile): Don't limit
+ RLIMIT_NOFILE too small.
+ This fix sporadic "[ASYNC BUG] thread_timer: select" on GNU/Linux.
- * lib/wsdl/xmlSchema/schema.rb: friendly warning message for
- simpleType element which is not supported for now.
+Fri Apr 25 22:54:34 2014 Naohisa Goto <ngotogenome@gmail.com>
- * lib/soap/mapping/factory.rb: deleted unused methods.
+ * lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
+ ENOTEMPTY (and ENOENT), because SUSv3 describes that "If the
+ directory is not an empty directory, rmdir() shall fail and set
+ errno to [EEXIST] or [ENOTEMPTY]" and Solaris uses EEXIST.
+ [Bug #9571] [ruby-dev:48017]
- * lib/soap/mapping/rubytypeFactory.rb: do no ignore case while xsi:type
- string <-> Ruby class name matching.
+Fri Apr 25 19:16:30 2014 Tanaka Akira <akr@fsij.org>
- * test/wsdl/soap/{soapbodyparts.wsdl,test_soapbodyparts.wsdl}: new
- files.
+ * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.
-Thu Jan 29 23:56:00 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+Fri Apr 25 14:55:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * util.c (mblen): fix overrun. [ruby-dev:22672]
+ * configure.in (rb_cv_func___builtin_unreachable): try with an
+ external variable not only by a warning, which might not be
+ shown due to the optimization. [ruby-core:61647] [Bug #9665]
-Thu Jan 29 22:41:53 2004 Dave Thomas <dave@pragprog.com>
+Fri Apr 25 13:11:49 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/generators/html_generator.rb: Allow 'link:' in Tidylinks.
- THis means you can write "see f1[link:files/f1_rb.html]".
+ * configure.in: NetBSD's ksh, used by configure, needs escapes.
-Thu Jan 29 15:33:23 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Apr 25 12:51:08 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
- second argument. it expected to be a Hash not an Integer.
+ * configure.in: correct pthread_setname_np's prototype on NetBSD.
+ [Bug #9586]
- * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new
- function for OpenSSL::X509::Name#add_entry.
+Thu Apr 24 23:17:25 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): append ASN.1
- tag number to each element of return value.
+ * lib/fileutils.rb (fu_get_uid, fu_get_gid): Etc.getpwnam/getgrnam may
+ returns nil.
- * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants
- OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE.
+ * lib/webrick/utils.rb (su): ditto.
- * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize):
- second argument takes OBJECT_TYPE_TEMPLATE by default.
+Thu Apr 24 22:55:22 2014 Tanaka Akira <akr@fsij.org>
- * sample/openssl/gen_csr.rb: use OpenSSL::X509::Name.parse.
+ * bootstraptest/test_io.rb: Add etc.so to $" before require 'tmpdir'.
-Wed Jan 28 04:29:41 2004 Eric Schwartz <emschwar@fc.hp.com>
+Thu Apr 24 21:09:55 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/cgi/session.rb: use LOCK_SH to read, and a few other
- improvements. [ruby-core:02328]
+ * man/ruby.1: fix broken link.
-Tue Jan 27 11:09:29 2004 FUKUMOTO Atsushi <fukumoto@nospam.imasy.or.jp>
+Thu Apr 24 20:53:02 2014 Tanaka Akira <akr@fsij.org>
- * ext/socket/socket.c (s_recvfrom): sending length should be an
- invariant while retrying on EAGAIN. [ruby-talk:89962]
+ * lib/tmpdir.rb: Don't need to rescue LoadError for etc.so.
-Tue Jan 27 10:35:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Apr 24 17:39:53 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/win32ole/win32ole.c (set_argv): fix condition.
+ * file.c (statfs_inspect): suppress warnings.
+ assume those values won't be larger than LONG_LONG_MAX.
-Tue Jan 27 02:26:31 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Apr 24 11:53:28 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httputils.rb (WEBrick:HTTPUtils::parse_header):
- refine regex for header-name.
+ * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): SYMID on a value
+ other than Symbol is an undefined behavior. fix up r31699.
+ [ruby-core:62142] [Bug #9771]
-Tue Jan 27 00:30:11 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Apr 24 11:21:37 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub: rollback.
+ * parse.y (rb_sym2id, rb_sym2id_without_pindown): return 0 for
+ non-symbol values, for the time being.
-Mon Jan 26 22:53:04 2004 Dave Thomas <dave@pragprog.com>
+Thu Apr 24 05:50:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c: Remove documentation references to $defout.
+ * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().
-Mon Jan 26 15:11:47 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Apr 23 20:36:22 2014 Tanaka Akira <akr@fsij.org>
- * sample/exyacc.rb: escape '}' to avoid warning.
+ * ext/etc/extconf.rb: Build ext/etc unconditionally.
-Mon Jan 26 14:41:46 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 23 14:10:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/delegate.rb (Delegator::initialize): preserve
- singleton_method_added method [ruby-dev:22685]
+ * file.c (statfs_fsid): remove statfs.f_fsid because it doesn't return
+ meaningful value portably. http://togetter.com/li/658517
- * lib/delegate.rb (Delegator::initialize): use Kernel::raise
- instead of mere raise. [ruby-dev:22681]
+Wed Apr 23 11:03:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 26 12:47:17 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/stringio/stringio.c (strio_write): use rb_str_append to
+ reuse coderange bits other than ASCII-8BIT, and keep
+ taintedness. [ruby-dev:48118] [Bug #9769]
- * ext/tcltklib/tcltklib.c: define CONST84 when TCL_MAJOR_VERSION == 7
+Wed Apr 23 00:43:00 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jan 26 11:35:23 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c, include/ruby/win32.h (ustatfs): implementation of
+ statfs(2) clone. [EXPERIMENTAL]
- * ext/extmk.rb: Makefiles should depend on also rbconfig.rb.
- (ruby-bugs:PR#1256)
+ * file.c (rb_io_statfs): use above function.
- * ext/win32ole/win32ole.c (set_argv): set real arguments to
- WIN32OLE::ARGV. [ruby-list:39073]
+ * configure.in, win32/Makefile.sub (struct statfs): available.
-Thu Jan 22 22:54:53 2004 Shugo Maeda <shugo@ruby-lang.org>
+Tue Apr 22 23:56:24 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/net/imap.rb (BEG_REGEXP): allow 8-bit characters in quoted
- strings for Novell GroupWise Internet Agent.
- * lib/net/imap.rb (DATA_REGEXP): ditto.
+ * file.c (rb_io_stafs): use statfs(2) if fstatfs(2) is unavailable.
-Thu Jan 22 16:21:33 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (fstatfs): check it.
- * parse.y (string_content): reset lexical states at the beginning of
- string contents. [ruby-list:39061]
+Tue Apr 22 22:15:51 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jan 21 21:55:51 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * file.c (rb_io_statfs): need to define even if the system doesn't have
+ fstatfs(2).
- * lib/drb/drb.rb: remove O_NONBLOCK, thanks \ay
- * lib/drb/extserv.rb: typo
+ * test/ruby/test_file.rb (TestFile#test_statfs): skip if IO#stafs is not
+ implemented.
-Wed Jan 21 17:57:56 2004 Shugo Maeda <shugo@ruby-lang.org>
+Tue Apr 22 19:32:48 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/imap.rb (envelope): allow NIL.
- * lib/net/imap.rb (body): ditto.
- * lib/net/imap.rb (number): ditto.
- * lib/net/imap.rb (ensure_nz_number): show a detailed error
- message.
+ * file.c: newly added a class File::Statfs. (experimental)
-Wed Jan 21 16:44:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 22 08:22:33 2014 Koichi Sasada <ko1@atdot.net>
- * lib/mkmf.rb (merge_libs): squeeze successive same libraries.
- [ruby-dev:22652]
+ * gc.c (objspace_malloc_increase): don't cause GC by malloc_increase
+ when memop type is MEMOP_TYPE_REALLOC.
-Wed Jan 21 16:01:37 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ GC at realloc is not well maintained.
+ We need a time to make it safe.
+ [ruby-dev:48117]
- * ext/digest/rmd160/extconf.rb: have_library appends found library.
+Tue Apr 22 06:54:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 21 11:36:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * gc.c (objspace_malloc_increase): run full mark if 0x04 bit is
+ set in ruby_gc_stress. [ruby-core:62103] [Feature #9761]
- * parse.y (block_append): update nd_end for "real" head node.
- [ruby-list:39058]
+ * gc.c (objspace_malloc_increase): run GC after realloc not only
+ malloc and calloc by GC.stress. [ruby-core:62103] [Feature #9761]
-Tue Jan 20 14:48:13 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Apr 21 19:12:20 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/extconf.rb: should check <openssl/conf_api.h> instead
- of OPENSSL_VERSION_NUMBER. [ruby-list:39056]
+ * string.c (rb_str_coderange_scan_restartable): coderange is always
+ ENC_CODERANGE_VALID if the string is ASCII-8BIT and already has a non
+ ASCII character.
-Tue Jan 20 14:43:17 2004 Dave Thomas <dave@pragprog.com>
+Mon Apr 21 19:02:44 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/base64.rb: Add RDoc
+ * string.c (coderange_scan): remove useless condition `p < e` after
+ search_nonascii.
-Tue Jan 20 14:25:51 2004 Dave Thomas <dave@pragprog.com>
+ * string.c (rb_str_coderange_scan_restartable): ditto.
- * lib/abbrev.rb: Add RDoc
+Mon Apr 21 18:55:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jan 20 13:22:39 2004 Dave Thomas <dave@pragprog.com>
+ * ext/-test-/string/coderange.c: add Bug::String.new#coderange_scan
+ to explicitly scan coderange.
- * lib/rdoc/generators/html_generator.rb: Document aliases at
- top-most level.
+Mon Apr 21 18:19:35 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/English.rb: Document English.rb.
+ * string.c (coderange_scan): remove unused logic.
-Tue Jan 20 02:49:22 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * string.c (rb_str_coderange_scan_restartable): ditto.
- * ext/openssl/extconf.rb: add check for OpenSSL version.
- [ruby-list:39054]
+Mon Apr 21 14:11:48 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 20 02:38:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_putc): fix for non-ascii
+ encoding, like as IO#putc. [ruby-dev:48114] [Bug #9765]
- * marshal.c (w_class): should not dump singleton class.
- [ruby-dev:22631]
+Sun Apr 20 12:57:15 2014 Masaya Tarui <tarui@ruby-lang.org>
-Tue Jan 20 01:31:36 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * st.c (st_foreach_check): change start point of search at check
+ from top to current. [ruby-dev:48047] [Bug #9646]
- * io.c (lineno): typo fix(FIX2INT -> INT2FIX).
+Sun Apr 20 08:41:33 2014 Andrew DeMaria <ademariad@gmail.com>
-Mon Jan 19 21:53:38 2004 akira yamada <akira@ruby-lang.org>
+ * lib/mkmf.rb (link_command, libpathflag, create_makefile): prefer
+ user specified `$LIBPATH` than `$DEFLIBPATH`. [ruby-core:62100]
+ [ruby-trunk - Bug #9760]
- * io.c, re.c, string.c, time.c: fixed up positions of RDocs.
+Sun Apr 20 06:01:18 2014 Eric Wong <e@80x24.org>
-Mon Jan 19 07:09:20 2004 Tadayoshi Funaba <tadf@dotrb.org>
+ * gc.c (rb_gc_writebarrier): drop special case for big hash/array
+ [Bug #9518]
- * lib/date.rb: zone was wrong when it was behind UTC.
- Thanks Mark J. Reed.
+Sat Apr 19 15:38:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/format.rb: %z is now always replaced by four digits
- with a leading plus or minus sign.
+ * parse.y (primary): flush cmdarg flags inside left-paren in a
+ command argument, to allow parenthesed do-block as an argument
+ without arguments parentheses. [ruby-core:61950] [Bug #9726]
- * sample/cal.rb: added a class, anyway.
+Sat Apr 19 10:07:24 2014 Tanaka Akira <akr@fsij.org>
-Sun Jan 18 20:47:35 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * internal.h (struct RBignum): Use size_t for len.
- * ruby.c: use translate_char() on Cygwin.
+ * include/ruby/intern.h (rb_big_new): Use size_t instead of long to
+ specify the size of bignum.
+ (rb_big_resize): Ditto.
-Sun Jan 18 02:33:26 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * bignum.c: Follow above changes.
- * defines.h (_WIN32): undef _WIN32 on Cygwin before defining DOSISH.
+ * rational.c: Follow above changes.
-Sun Jan 18 00:23:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * marshal.c: Follow above changes.
- * marshal.c (class2path): check anonymous class/module before
- checking referable, and allow singleton classes.
+Sat Apr 19 00:32:07 2014 Tanaka Akira <akr@fsij.org>
-Fri Jan 16 14:33:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (rb_num2long): Returns a long.
+ (rb_num2ulong): Returns a unsigned long.
- * marshal.c (class2path): get class path and check referable.
- [ruby-dev:22588]
+ * bignum.c (rb_big2long): Returns a long.
+ (rb_big2ulong): Returns a unsigned long.
-Fri Jan 16 09:52:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * include/ruby/intern.h: Follow above changes.
- * eval.c (proc_eq): Proc with empty body may not be equal.
- [ruby-dev:22590]
+ * include/ruby/ruby.h: Follow above changes.
+ (rb_num2long_inline): No need to cast.
+ (rb_num2ulong_inline): Ditto.
-Thu Jan 15 13:03:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Apr 19 00:17:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)
+ * string.c (SHARABLE_SUBSTRING_P): predicate if substring can be
+ shared with the original string. true if just at the end of the
+ original string, for the time being. all substring will be able to
+ be shared in the future.
- * io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio
- weird behavior. [ruby-dev:22424]
+Fri Apr 18 21:48:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 14 13:31:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_new_frozen): consider the shared string at
+ middle.
- * ext/iconv/extconf.rb: wrapper iconv.rb is dependent on platform.
+ * string.c (rb_str_subseq, rb_str_substr, str_byte_substr): share
+ middle of a string.
-Tue Jan 13 18:54:28 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Fri Apr 18 15:40:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/logger.rb(Logger#msg2str): no special treatment for the object
- which responds to :to_str. commited at 2004-01-11T21:46:27 by
- gsinclair.
+ * string.c: use uintptr_t instead of VALUE because they are not ruby
+ object.
- * lib/logger.rb(LogDevice#initialize): remove type checking if the
- given object is a String. Kernel.open handles it correctly.
- commited at 2004-01-11T21:46:27 by gsinclair.
+Fri Apr 18 14:51:42 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/logger/test_logger.rb: follow above change (ArgumentError ->
- TypeError.) follow above commit.
+ * string.c: check str_strlen's argument, and add comment or
+ use NULL if simply it uses str's enc.
-Tue Jan 13 14:27:13 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Fri Apr 18 14:32:40 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/test/unit/ui/testrunnerutilities.rb (TestRunnerUtilities):
- moved run method which allows output level. [ruby-dev:22554]
+ * string.c (str_strlen): use enc_strlen if the coderange is known.
-Tue Jan 13 04:29:52 2004 Dave Thomas <dave@pragprog.com>
+Fri Apr 18 14:21:21 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/ri/ri_driver.rb (RiDriver::report_method_stuff):
- Show fully-qualified class names in class list.
+ * string.c (enc_strlen): move UTF-8 optimization from str_strlen to
+ enc_strlen.
-Tue Jan 13 01:04:37 2004 Dave Thomas <dave@pragprog.com>
+Fri Apr 18 08:50:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/ri/ri_paths.rb (RI::Paths): First attempt at
- incorporating DESTDIR in the rdoc installation.
+ * configure.in (rb_cv_getcwd_malloc): check if getcwd allocates
+ buffer if NULL is given [ruby-core:62072] [Bug #9752]
-Mon Jan 12 23:27:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Apr 17 16:28:10 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * parse.y (primary): fix position after FCALL. [ruby-dev:22574]
+ * prelude.rb: [DOC] Update Thread::exclusive docs by @stevenharman.
-Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com>
+Thu Apr 17 10:03:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods):
- Someone changed the "// in eval.c" comments to "/*...*/" style,
- so the parsing of the source file name broke.
+ * lib/fileutils.rb (FileUtils#copy_entry): update rdoc about
+ preserve option and permissions, following r31123.
+ [ruby-core:62065] [Bug #9748]
- * object.c: Remove spurious space in TrueClass documentation.
+Wed Apr 16 23:47:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Fix
- bad regexp: if the code before a documented method contained
- a comment that wasn't terminated by whitespace, that comment
- and all intervening code was included in the following
- method's documentation.
+ * enum.c (dont_recycle_block_arg): fix condition to recycle block
+ argument. lambda with rest can get internal array directly.
+ [ruby-core:62060] [Bug #9749]
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline):
- HTML formats need explicit line breaks.
+Wed Apr 16 09:51:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/ossl_pkey.c (ossl_pkey_verify): as EVP_VerifyFinal()
+ finalizes only a copy of the digest context, the context must be
+ cleaned up after initialization by EVP_MD_CTX_cleanup() or a
+ memory leak will occur. [ruby-core:62038] [Bug #9743]
- * configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
- quotes. [ruby-dev:22564]
+Tue Apr 15 19:36:42 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (libpathflag): do not enclose with quotes always.
+ * include/ruby/win32.h (rb_w32_cmdvector): removed.
- * {bcc32,win32,wince}/Makefile.sub (LIBPATHFLAG): quoted.
+ * win32/win32.c (rb_w32_sysinit): use WCHAR version of GetCommandLine()
+ internally.
-Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
+ * win32/win32.c (w32_cmdvector): renamed from rb_w32_cmdvector. use
+ WCHAR* instead of char* internally.
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
- generation support to ri (Elliot Hughes)
+ these changes are expected to not changing the behavior yet.
-Mon Jan 12 02:24:07 2004 Dave Thomas <dave@pragprog.com>
+Tue Apr 15 19:26:05 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter): Add HTML
- generation support to ri (Elliot Hughes)
+ * ext/extmk.rb: Re-generate extmk.mk and dummy makefiles only if
+ really required.
+ This fixes a problem to run multiple test-all concurrently as:
+ make test-all & make test-all & make test-all & ...
-Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
+Tue Apr 15 12:49:53 2014 Sam Rawlins <sam.rawlins@gmail.com>
- * lib/rdoc/ri/ri_options.rb (RI::Options::OptionList::OptionList):
- Also accept command line options via the 'RI' environment variable.
+ * enum.c (enum_each_slice, enum_each_cons): make more efficient by
+ allocating less and recycling block argument arrays if possible.
+ [Fixes GH-596]
-Sun Jan 11 02:07:47 2004 Dave Thomas <dave@pragprog.com>
+Mon Apr 14 18:44:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rdoc/ri/ri_options.rb (RI::Options::OptionList::OptionList):
- Also accept command line options via the 'RI' environment variable.
+ * addr2line.c (fill_lines): get base addrs in fill_lines to use it
+ with dladdr_fbases introduced at r45563.
+ it didn't get before if the executable is not pie.
-Sat Jan 10 21:27:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Apr 14 18:05:48 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (eval): need to add message delimiter. [ruby-dev:22561]
+ * addr2line.c (main_exe_path): support FreeBSD.
+ At least sh, csh, tcsh, bash, and zsh sets realpath of the main
+ executable for dladdr, but gdb doesn't.
-Sat Jan 10 01:54:50 2004 Eric Sunshine <sunshine@sunshineco.com>
+Mon Apr 14 17:20:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * defines.h (__NeXT__): Ensure that all standard S_IRUSR, S_IWGRP,
- S_IRWXO, etc. macros are defined since future code might require
- them (even though present code only requires a subset).
+ * proc.c (umethod_bind): use the ancestor iclass instead of new
+ iclass to get rid of infinite recursion, if the defined module
+ is already included. [ruby-core:62014] [Bug #9721]
- * defines.h (__NeXT__): Bug fix: WORDS_BIGENDIAN was not being set
- correctly on Rhapsody when -arch compiler flag was used (via
- configure's --enable-fat-binary option).
+Sun Apr 13 12:46:58 2014 Tanaka Akira <akr@fsij.org>
-Fri Jan 9 10:05:14 2004 Siena. <siena@faculty.chiba-u.jp>
+ * bignum.c (SIZEOF_BDIGIT): Renamed from SIZEOF_BDIGITS.
- * lib/mkmf.rb (libpathflag): use single quotes. [ruby-dev:22440]
+ * internal.h: Ditto.
-Thu Jan 8 23:49:21 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * marshal.c: Ditto.
- * configure.in (RDOCTARGET): new macro. if you want to install
- rdoc documentation, you need to run configure with
- --enable-install-doc.
+ * rational.c: Ditto.
-Thu Jan 8 21:29:43 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Apr 13 10:18:09 2014 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey.c (ossl_pkey_to_der): removed; it returns
- public key only.
+ * common.mk: Unused target, $(MKMAIN_CMD), removed.
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_to_der): new function for
- OpenSSL::PKey::DH#to_der.
+ * Makefile.in (MKMAIN_CMD): Unused macro removed.
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_to_der): new function for
- OpenSSL::PKey::DSA#to_der.
+ * win32/Makefile.sub (MKMAIN_CMD): Ditto.
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_to_der): new function for
- OpenSSL::PKey::RSA#to_der.
+Sat Apr 12 22:11:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 8 16:51:04 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * string.c (sym_to_proc), proc.c (rb_block_clear_env_self): clear
+ caller's self which is useless, so that it can get collected.
+ [Fixes GH-592]
- * test/wsdl/datetime/test_datetime.rb: fixed a stupid testcase which
- dumps "E" at month-end.
+Sat Apr 12 09:26:48 2014 Eric Hodel <drbrain@segment7.net>
-Thu Jan 8 11:20:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/openssl/ossl_ocsp.c: [DOC] Document OpenSSL::OCSP.
- * eval.c, object.c, process.c, re.c: don't use C++ style comments.
+Fri Apr 11 18:52:38 2014 Koichi Sasada <ko1@atdot.net>
-Thu Jan 8 04:36:21 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * array.c (ARY_SET): added.
- * lib/webrick/cgi.rb (WEBrick::CGI#initialize): should create
- @config[:Logger] if it was not given.
+ ARY_SET() is same functionality of RARRAY_ASET(), but
+ it has an assertion (`ary' doesn't have shared array).
- * sample/webrick/*: new files.
+Fri Apr 11 16:54:26 2014 Koichi Sasada <ko1@atdot.net>
- * MANIFEST: add sample/webrick/*
+ * array.c: make shared arrays WB-protected objects.
-Wed Jan 7 13:00:18 2004 Dave Thomas <dave@pragprog.com>
+ Shared arrays were WB-unprotected object because
+ sharing array can modify shared array's buffer
+ if it occupied shared array.
- * lib/rdoc/ri/ri_driver.rb: Fix problem where ri was
- being too eager to find matches of ambiguous method
- names (such as "ri Thread.join" would return both
- Thread.join and ThreadsWait.join)
+ [sharing array (ary)] -> [shared array (shared)] -> <buff>
+ | A
+ +---------------------------------------+
+ write `buff' with WB(ary, &buff[i], obj)
+ -> if `ary' and `shared' are old, then only `ary'
+ will be remembered.
+ -> traverse from `ary'. But `shared' is old, so
+ that written `obj' is not marked.
-Wed Jan 7 12:35:41 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ It cause WB miss so that shared arrays were WB-unprotected.
+ (WB-unprotected objects are marked everytime if it is living)
- * lib/debug.rb: revert command parse regexps. [ruby-list:39014] by
- Shirai,Kaoru.
+ This patch insert WB() for `shared' if it is needed.
-Wed Jan 7 08:21:04 2004 Dave Thomas <dave@pragprog.com>
+Fri Apr 11 15:05:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/parsers/parserfactory.rb: Check for shebang
- line in files that would otherwise be treated as
- plain text.
+ * proc.c (rb_method_call_with_block, umethod_bind): call with
+ IClass including the module for a module instance method.
+ [ruby-core:61936] [Bug #9721]
-Tue Jan 6 22:13:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_super_method): allow bound
+ UnboundMethod case.
- * eval.c (rb_mod_modfunc): should break if m has no super class.
- [ruby-dev:22498]
+Fri Apr 11 12:02:30 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jan 6 21:55:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * addr2line.c (rb_dump_backtrace_with_lines): set base address
+ which is retrieved from dladdr to dladdr_fbases, to skip already
+ parsed objects.
- * io.c (fptr_finalize): should save errno just after failure.
- [ruby-dev:22492]
+Fri Apr 11 12:44:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 6 14:53:14 2004 Dave Thomas <dave@pragprog.com>
+ * array.c (ary_reject): may be turned into a shared array during
+ the given block. [ruby-dev:48101] [Bug #9727]
- * bin/ri: split out the display side, making it pluggable. Added
- new ri_driver and ri_display files in lib/rdoc/ri.
+Thu Apr 10 23:41:21 2014 Akinori MUSHA <knu@iDaemons.org>
-Tue Jan 6 06:37:53 2004 Dave Thomas <dave@pragprog.com>
+ * lib/net/ftp.rb (Net::FTP#login): [DOC] The default password for
+ anonymous login was changed to "anonymous@" in r25313.
- * bin/rdoc: Add --ri-system switch
+Thu Apr 10 19:22:58 2014 Koichi Sasada <ko1@atdot.net>
- * lib/.document: Update with list of files that seem to have
- documentation
+ * test/ruby/test_array.rb: remove useless `assert'.
- * lib/test/unit.rb: Reorder comment to make it RDoc friendly.
+Thu Apr 10 19:11:11 2014 Koichi Sasada <ko1@atdot.net>
- * Makefile.in: add install-nodoc target, and make it
- generate RDoc on default install.
+ * array.c (rb_ary_modify): remember shared array owner if a shared
+ array owner is promoted and a shared array is not promoted.
- * lib/rdoc/ri/ri_options.rb (RI::Options::parse): Add
- --doc-dir option to ri.
+ Now, shared array is WB-unprotected so that shared arrays are not
+ promoted. All objects referred from shared array should be marked
+ correctly.
-Tue Jan 6 00:04:40 2004 Dave Thomas <dave@pragprog.com>
+ [ruby-core:61919] [ruby-trunk - Bug #9718]
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
- fix parsing if there are braces in a method parameter list
+ * test/ruby/test_array.rb: add a test for above.
-Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
+Thu Apr 10 18:57:12 2014 Koichi Sasada <ko1@atdot.net>
- * bin/ri: Add new --classes option, and arrange for
- help messages to be paged too.
+ * gc.c (gc_verify_internal_consistency): move lines and enable
+ allrefs_dump() on RGENGC_CHECK_MODE >= 4.
- * bin/rdoc: Add statistics.
+Thu Apr 10 15:01:06 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c: (MG) Added Process documentation
+ * addr2line.c (append_obj): clear allocated memory.
- * lib/rdoc/ri/ri_formatter.rb (RI::AttributeFormatter::wrap):
- Fix problem with labels not displaying in RI labeled
- lists using BS and ANSI modes.
+ * addr2line.c (rb_dump_backtrace_with_lines): free `base_addrs'.
-Fri Jan 2 01:50:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Apr 10 14:40:18 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (argf_eof): ARGF.eof? should not have any side effect.
- [ruby-dev:22469]
+ * gc.c (rb_gc_writebarrier_unprotect_promoted): disable to dump debug
+ message when RGENGC_CHECK_MODE == 0.
-Wed Dec 31 17:25:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Apr 10 08:13:47 2014 Tanaka Akira <akr@fsij.org>
- * io.c (argf_each_byte): should return self. [ruby-dev:22465]
+ * signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h
+ is not available.
+ Fixes build on Android (x86).
-Wed Dec 31 11:20:34 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 9 23:22:44 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Make
- file referenced in "// in sss.c" relative to current file.
+ * gc.c (mark_current_machine_context): Call SET_STACK_END.
+ This reverts a hunk of r40703 by ko1.
+ This fixes [ruby-dev:48098] [Bug #9717].
-Wed Dec 31 11:17:37 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 9 21:02:04 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/generators/html_generator.rb: Fix problem when
- a public method was aliased, but the alias is then
- made private, and hence doesn't appear in RDoc output.
+ * process.c (OBJ2UID1): Defined even if getpwnam_r is not usable.
+ (OBJ2GID1): Defined even if getgrnam_r is not usable.
+ This fixes compilation error on Android.
-Wed Dec 31 01:33:05 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 9 15:16:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c, error.c, eval.c, io.c, prec.c, range.c, re.c,
- string.c, time.c: Add RDoc for Kernel functions, and tidy.
+ * encoding.c (rb_enc_default_internal): fix rdoc. `__FILE__` is
+ in filesystem encoding but not `default_internal`.
+ [ruby-core:61894] [Bug #9713]
-Tue Dec 30 19:39:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Apr 9 14:43:00 2014 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_f_readline): should raise EOFError at the end of
- files. [ruby-dev:22458]
+ * test/ruby/test_gc.rb: more long timeout.
+ This test failed under RGENGC_CHECK_MODE >= 2.
- * io.c (argf_read): should concatenate input files when length
- argument is nil. [ruby-dev:22450]
+Wed Apr 9 13:07:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (argf_read): should update supplied string buffer (2nd
- argument) even when IO#read is called multiple times.
+ * configure.in: get rid of __builtin_setjmp/__builtin_longjmp on
+ x64-mingw, which causes SEGV with callcc.
+ [ruby-core:61887] [Bug #9710]
- * io.c: should initialize lineno by zero. [ruby-dev:22460]
+Wed Apr 9 12:44:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
+ * string.c (str_buf_cat): should round up the capacity by 4KiB,
+ but not number of rooms. [ruby-core:61886] [Bug #9709]
- * lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): If a
- class and a method have the same name, finding Xxx.abc was trying
- to find 'abc' in method 'Xxx', not class 'Xxx'.
+Tue Apr 8 22:55:32 2014 Akinori MUSHA <knu@iDaemons.org>
-Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
+ * lib/mkmf.rb (MakeMakefile#dir_config): [DOC] Improve
+ documentation.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nesting of yield parameters correctly for:
+Tue Apr 8 22:31:44 2014 Koichi Sasada <ko1@atdot.net>
- def each_entry(&b) Dir.foreach(@path) {|f| yield P.new(f) } end
+ * gc.c: rename `RGENGC_THREEGEN' to `RGENGC_AGE2_PROMOTION'.
-Tue Dec 30 08:32:32 2003 Dave Thomas <dave@pragprog.com>
+ * gc.c (rgengc_rememberset_mark): don't promote, but remain in
+ remember set for infant objects.
- * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method):
- Handle undoing nesting of yield parameters correctly for:
+ * gc.c (RVALUE_PROMOTE_INFANT, RVALUE_PROMOTE_YOUNG): count numbers
+ in these functions.
- def each_entry(&block) Dir.foreach(@path) {|f| yield Pathname.new(f) } end
+Mon Apr 7 21:11:49 2014 Tanaka Akira <akr@fsij.org>
-Mon Dec 29 12:51:02 2003 Dave Thomas <dave@pragprog.com>
+ * ext/socket/socket.c (sock_s_getnameinfo): Save errno for EAI_SYSTEM.
+ Reported by Saravana kumar. [ruby-core:61820] [Bug #9697]
+ Fixed by Heesob Park. [ruby-core:61868]
- * eval.c: Add RDoc for Kernel global functions.
+Mon Apr 7 07:20:23 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Dec 29 11:00:16 2003 Dave Thomas <dave@pragprog.com>
+ * lib/xmlrpc/client.rb (do_rpc): don't check body length.
+ If HTTP content-encoding is used, the length may be different.
+ [Bug #8182] [ruby-core:53811]
- * array.c: Tidy up RDoc loose ends.
+Mon Apr 7 02:39:48 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Dec 29 05:05:51 2003 Dave Thomas <dave@pragprog.com>
+ * lib/matrix.rb: Add Matrix#cofactor [fix GH-568]
+ Add first_minor [fix GH-568]
+ Handle empty diagonal matrix case [fix GH-576]
+ Patches by gogotanaka
- * struct.c, random: Add RDoc comments
+Sun Apr 6 08:52:50 2014 Bugra Barin <bugrabarin@hotmail.com>
-Mon Dec 29 02:20:54 2003 Dave Thomas <dave@pragprog.com>
+ * dln.c (dln_load): use wchar version to load a library in
+ non-ascii path on Windows. based on the patch by Bugra Barin
+ <bugrabarin AT hotmail.com> in [ruby-core:61845]. [Bug #9699]
- * eval.c: Add RDoc for class Proc, Method, UnboundMethod
+Sat Apr 5 19:36:33 2014 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Dec 29 00:41:44 2003 Dave Thomas <dave@pragprog.com>
+ * ext/date/date_core.c (d_lite_cmp): should compare with #<.
- * math.c: Add RDoc comments
+Sat Apr 5 00:31:21 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 28 20:19:11 2003 Tanaka Akira <akr@m17n.org>
+ * ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
+ [ruby-dev:48089] [Bug #9702]
- * ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't
- raise EOFError.
+Fri Apr 4 07:13:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/zlib/zlib.c (gzreader_gets): don't increment lineno when
- gzfile_read_all returns "".
+ * configure.in (ac_cv_func___builtin_setjmp): should not skip
+ flags restoration in RUBY_WERROR_FLAG by `break`.
+ [ruby-dev:48086] [Bug #9698]
-Sun Dec 28 15:25:08 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 2 21:50:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c,object.c,parse.y,sprintf.c,variable.c: Document classes
- Object, Module, etc...
+ * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp()
+ in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`.
+ [Bug #9692]
-Sun Dec 28 11:55:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Apr 2 20:57:15 2014 Koichi Sasada <ko1@atdot.net>
- * test/csv/test_csv.rb: generate bom.csv and mac.csv files on the fly.
- [ruby-talk:88852]
+ * gc.c, gc.h (rb_objspace_each_objects_without_setup):
+ Add a new (hidden) C-API to iterate objspace snapshot.
- * test/csv/{bom.csv,mac.csv}: removed.
+ This API is not safe to call any C-APIs in a given callback
+ function. Be careful to use this C-API.
-Sun Dec 28 08:56:51 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 2 17:43:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c: Thead[Group] RDoc (thanks to MG)
+ * configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a
+ variable as the second argument of __builtin_longjmp().
+ [ruby-core:61800] [Bug #9692]
-Sun Dec 28 03:50:05 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 2 15:12:18 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment):
- Escape method names used in regexp
+ * common.mk: Use redmine-2.x url for DeveloperHowto wiki.
+ [ruby-core:60657] [Bug #9511]
-Sun Dec 28 01:46:02 2003 Dave Thomas <dave@pragprog.com>
+Wed Apr 2 11:46:29 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item):
- Add support for rules in 'ri' output.
+ * ext/pathname/lib/pathname.rb (Pathname#join): Fix error with
+ empty args. Reported by ko1 via IRC.
-Sun Dec 28 01:35:35 2003 Dave Thomas <dave@pragprog.com>
+ * test/pathname/test_pathname.rb (TestPathname#test_join): Add the
+ test for above case.
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body):
- Sometimes the Ruby source aliases two otherwise
- unrelated methods (for example Kernel#object_id and
- Kernel#hash are both the same C function). Provide a
- facility to allow the methods to be documented
- separately.
+Tue Apr 1 11:39:57 2014 James Edward Gray II <james@graysoftinc.com>
-Sun Dec 28 01:05:31 2003 Dave Thomas <dave@pragprog.com>
+ * lib/csv.rb: Symbol HeaderConverter: strip leading/trailing space.
+ Reported by Skye Shaw
+ [Fixes GH-575]
- * marshal.c, signal.c: RDoc collemts added by Elliott Hughes
+Tue Apr 1 11:34:04 2014 James Edward Gray II <james@graysoftinc.com>
-Sun Dec 28 00:48:47 2003 Dave Thomas <dave@pragprog.com>
+ * lib/csv.rb: Don't attempt to convert nil headers.
+ Reported by Skye Shaw
- * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_class_comment):
- Some source files use lower case class or module names
- when naming the Init_XXX function in C.
+Tue Apr 1 17:29:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 27 23:41:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * tool/config_files.rb (ConfigFiles.download): show failed URI.
+ [ruby-core:61792] [Bug #9690]
- * configure.in: fix "test: too many arguments" error.
+Tue Apr 1 12:06:49 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Dec 27 15:32:19 2003 Dave Thomas <dave@wireless_3.local.thomases.com>
+ * addr2line.c (rb_dump_backtrace_with_lines): don't depend hard coded
+ symbol '_start'.
- * time.c: RDoc comments added
+ * addr2line.c (fill_lines): instead of above, get a dynamic symbol
+ in the main executable and use it to know the base address.
-Sat Dec 27 15:07:57 2003 Dave Thomas <dave@pragprog.com>
+ * addr2line.c (follow_debuglink0): use obj_info_t instead of
+ line_info_t to handle object related data.
- * object.c: Add RDoc comments for Symbol class.
+ * addr2line.c (main_exe_path): defined for Linux.
-Sat Dec 27 14:42:30 2003 Dave Thomas <dave@pragprog.com>
+Tue Apr 1 08:58:39 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * numeric.c: Add RDoc comments.
+ * parse.y (rb_str_dynamic_intern): set mark bit if dynamic symbol
+ is before sweeping.
-Sat Dec 27 00:44:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Apr 1 07:37:00 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (next_argv): warn always for stdin on inplace edit mode.
+ * addr2line.c (fill_lines): use dynsym, which is used for dynamic
+ linking and always exists, if there's no symtab.
- * io.c (read_all): need to check string value.
+Tue Apr 1 07:27:15 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (argf_read): allow ARGF.read(nil). [ruby-dev:22433]
+ * vm_dump.c (rb_print_backtrace): current implementation
+ uses dladdr to get the path of objects.
-Fri Dec 26 23:02:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Mar 31 23:57:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_f_backquote): need not to check nil result.
- [ruby-core:02078]
+ * ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`.
+ [ruby-core:61756] [Bug #9578]
- * io.c (rb_io_getline): should return nil when read_all gives
- empty string, even when nil rs is specified. [ruby-core:02077]
+Mon Mar 31 17:23:50 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Dec 26 18:50:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/memory_status.rb: require envutil before accessing EnvUtil
+ module. reported by ko1 via twitter.
- * configure.in: check if getcontext and setcontext are available.
+Mon Mar 31 10:28:01 2014 Eric Wong <e@80x24.org>
- * eval.c: use presence of getcontext/setcontext.
+ * st.c (st_init_table_with_size): update comment
+ [Feature #9425]
-Fri Dec 26 16:40:53 2003 Tanaka Akira <akr@m17n.org>
+Sun Mar 30 23:39:26 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/pathname.rb (PathnameTest#test_plus): add 2 assertions.
+ * win32/win32.c (rb_w32_accept, open_ifs_socket, socketpair_internal):
+ reset inherit flag of socket to avoid unintentional inheritance of
+ socket. note that the return value of SetHandleInformation() is not
+ verified intentionally because old Windows may return an error.
+ [Bug #9688] [ruby-core:61754]
-Fri Dec 26 09:26:58 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Mar 29 13:04:22 2014 Koichi Sasada <ko1@atdot.net>
- * pack.c (pack_pack): add sign check for 'i', and 'l'.
- [ruby-dev:22427]
+ * gc.c (gc_before_sweep): cap `malloc_limit' to
+ gc_params.malloc_limit_max. It can grow and grow with such case:
+ `loop{"a" * (1024 ** 2)}'
+ [Bug #9687]
- * bignum.c (rb_quad_pack): add range check for 'quad int'.
+ This issue is pointed by Tim Robertson.
+ http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/
-Thu Dec 25 22:39:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Mar 28 19:32:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_update): don't return any value.
+ * struct.c (not_a_member): extract name error and use same error
+ messages. based on the patch by Marcus Stollsteimer <sto.mar AT
+ web.de> at [ruby-core:61721]. [Bug #9684]
-Thu Dec 25 15:30:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Mar 28 09:21:54 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * string.c (rb_str_update): call rb_str_modify().
+ * ext/psych/psych.gemspec: update gemspec for psych-2.0.5
-Thu Dec 25 05:08:09 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 28 09:11:06 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * eval.c (search_required): search actual file name once when no
- extension specified.
+ * ext/psych/lib/psych.rb: Merge psych-2.0.5. bump version to
+ libyaml-0.1.6 for CVE-2014-2525.
+ * ext/psych/yaml/config.h: ditto.
+ * ext/psych/yaml/scanner.c: ditto.
+ * ext/psych/yaml/yaml_private.h: ditto.
-Thu Dec 25 04:00:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Mar 27 18:58:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * stable version 1.8.1 released.
+ * re.c (match_regexp): set regexp for MatchData from string.
-Thu Dec 25 00:17:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * re.c (rb_backref_set_string): create MatchData from string and
+ set backref.
- * configure.in: check for nanosleep, -lrt if required.
- [ruby-core:02059]
+ * string.c (rb_pat_search, rb_str_sub, rb_str_sub_bang, str_gsub),
+ (scan_once, rb_str_scan, rb_str_partition): use rb_str_index
+ instead of rb_reg_search() when pattern is a String. based on
+ the patch by Sam Rawlins <sam.rawlins@gmail.com> [Fixes GH-579]
- * eval.c (thread_timer): use select(2) if nanosleep(2) is not
- available.
+Thu Mar 27 11:58:55 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c: check __stub_getcontext for glibc on some platforms.
- [ruby-list:38984]
+ * addr2line.c (fill_lines): check shdr[i].sh_type because even if
+ .symtab section exists, the section's type can be SHT_NOBITS and
+ actual data doesn't exist in the file.
+ revert r45441.
-Wed Dec 24 23:48:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Wed Mar 26 14:57:35 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/soap/test_basetype.rb, test/soap/marshal/test_marshal.rb
- test/xsd/test_xsd.rb: use "(-1.0 / (1.0 / 0.0))" instead of "-0.0"
- to express -0.0. [ruby-talk:88786]
+ * parse.y: inline must be static (for mswin).
+ fixed build error introduced at r45426.
-Wed Dec 24 23:29:30 2003 Tanaka Akira <akr@m17n.org>
+Wed Mar 26 14:33:00 2014 Narihiro Nakamura <authornari@gmail.com>
- * lib/tsort.rb (test_orphaned_break): removed.
+ * internal.h (USE_SYMBOL_GC): enable Symbol GC by default (USE_SYMBOL_GC == 1).
-Wed Dec 24 20:53:06 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Mar 25 22:57:11 2014 Narihiro Nakamura <authornari@gmail.com>
- * ext/tk/sample/tkmulticolumnlist.rb: new sample
+ * parse.y: support Symbol GC. [ruby-trunk Feature #9634]
+ See this ticket about Symbol GC.
- * ext/tk/sample/tkmultilistframe.rb: bug fix
+ * include/ruby/ruby.h:
+ Declare few functions.
+ * rb_sym2id: almost same as old SYM2ID but support dynamic symbols.
+ * rb_id2sym: almost same as old ID2SYM but support dynamic symbols.
+ * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not
+ pin down a dynamic symbol.
+ Declare a new struct.
+ * struct RSymbol: represents a dynamic symbol as object in
+ Ruby's heaps.
+ Add few macros.
+ * STATIC_SYM_P: check a static symbol.
+ * DYNAMIC_SYM_P: check a dynamic symbol.
+ * RSYMBOL: cast to RSymbol
-Wed Dec 24 20:37:37 2003 Eric Sunshine <sunshine@sunshineco.com>
+ * gc.c: declare RSymbol. support T_SYMBOL.
- * configure.in (LDSHARED): Fixed typographical error in assignment of
- LDSHARED for Rhapsody which caused linking of extension modules to
- fail.
+ * internal.h: Declare few functions.
+ * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this
+ function at a sweep phase.
+ * rb_str_dynamic_intern: convert a string to a dynamic symbol.
+ * rb_check_id_without_pindown: not pinning function.
+ * rb_sym2id_without_pindown: ditto.
+ * rb_check_id_cstr_without_pindown: ditto.
-Wed Dec 24 17:51:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c (Init_String): String#intern and String#to_sym use
+ rb_str_dynamic_intern.
- * file.c (rb_thread_flock): enable thread support again.
+ * template/id.h.tmpl: use LSB of ID as a flag for determining a
+ static symbol, so we shift left other ruby_id_types.
-Wed Dec 24 16:46:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to
+ avoid pinning.
- * eval.c (catch_timer): do not call rb_thread_schedule() inside to
- avoid pthread_mutex_lock() deadlock. interrupts to system calls
- are detected by TRAP_END via EINTR error.
+ * load.c: use xx_without_pindown function at creating temporary ID
+ to avoid pinning.
- * eval.c (thread_timer): do not post signal unless it is
- absolutely necessary.
+ * object.c: ditto.
- * rubysig.h (TRAP_END): add CHECK_INTS to switch thread.
+ * sprintf.c: ditto.
- * regex.c (re_compile_pattern): check if nextp is smaller than
- pend. [ruby-dev:22372]
+ * struct.c: ditto.
- * eval.c (umethod_bind): remove method overridden check.
- [ruby-dev:22366]
+ * thread.c: ditto.
-Wed Dec 24 16:13:05 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * variable.c: ditto.
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): should check for error
- status by SSL_get_error().
+ * vm_method.c: ditto.
- * ext/openssl/ossl_ssl.c (ossl_ssl_write): ditto.
+Wed Mar 26 13:25:54 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Dec 24 14:23:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * addr2line.c (fill_lines): loop reverse order not to overwrite
+ the basis of base addresses comparison.
- * ext/stringio/stringio.c (strio_read): clear the buffer argument
- when returning nil. [ruby-dev:22363]
+ * addr2line.c: use uintptr_t instead of intptr_t for pointers.
- * test/ruby/ut_eof.rb (TestEOF::test_eof_0, TestEOF::test_eof_1):
- add buffer argument tests.
+ * addr2line.c (rb_dump_backtrace_with_lines): don't use syms.
-Wed Dec 24 14:07:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c (rb_print_backtrace): ditto.
- * lib/test/unit/assertions.rb: Modules are allowed to rescue.
+ * addr2line.h: ditto.
- * lib/test/unit/autorunner.rb: show output_level in order.
+Wed Mar 26 11:20:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector/dir.rb: get rid of successive same
- directories in load path.
+ * marshal.c (w_object): internal objects are not dumpable.
+ [ruby-core:61677] [Bug #9674]
- * test/testunit/test_assertions.rb (test_assert_nothing_raised,
- test_assert_raise): test for modules.
+ * ext/thread/thread.c (undumpable): ConditionVariable and Queue
+ are not dumpable. [ruby-core:61677] [Bug #9674]
-Wed Dec 24 13:43:34 2003 Shugo Maeda <shugo@ruby-lang.org>
+Wed Mar 26 10:36:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/imap.rb (authenticate): remove "\n" from base64 encoded
- strings.
+ * addr2line.c (follow_debuglink): show message if it closes opened
+ (and maybe used) elf binary.
-Wed Dec 24 11:26:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 26 10:34:25 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_fileutils.rb: should not create any
- files or directories in current directory. [ruby-talk:88724]
+ * addr2line.c (fill_line): pass and use offset instead of
+ curobj_baseaddr.
-Wed Dec 24 10:29:53 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 26 09:07:48 2014 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * ext/stringio/stringio.c (strio_read): never return nil at
- unlimited read. [ruby-dev:22334]
+ * configure.in: add --disable-pie. [Feature #9673]
- * ext/stringio/stringio.c (strio_read): support second
- argument. [ruby-dev:22350]
+Wed Mar 26 08:47:04 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Dec 24 09:38:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * addr2line.c (fill_lines): don't run fill_lines multiple times.
- * parse.y (arg): should return 0 after error. [ruby-dev:22360]
+Wed Mar 26 08:45:00 2014 Sam Rawlins <sam.rawlins@gmail.com>
-Wed Dec 24 00:56:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * internal.h: add prototype for rb_reg_search0
- * io.c (read_all): do not return nil at the end of file.
- [ruby-dev:22334]
+ * re.c: rename rb_reg_search to rb_reg_search0, add set_backref_str
+ argument to allow callers to indicate that they don't require the
+ backref string to be allocated.
- * io.c (argf_read): do not depend on nil at eof behavior of
- IO#read().
+ * string.c: don't allocate backref str if replacement string is provided
- * eval.c (rb_thread_join): dup exception before re-raising it.
+ [GH-578] [Bug #9676] [ruby-core:61682]
- * io.c (rb_io_eof): call clearerr() to prevent side effect. this
- patch is supplied by Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>.
- [ruby-dev:22234]
+Wed Mar 26 08:29:43 2014 mo khan <mo@mokhan.ca>
- * pack.c (OFF16): get offset for big endian machines.
+ * lib/rubygems.rb: fix spelling of Jim Weirich. [Fixes GH-577]
- * pack.c (pack_pack): use OFF16 instead of OFF16B.
- [ruby-dev:22344]
+Wed Mar 26 01:55:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * pack.c (pack_unpack): ditto.
+ * addr2line.c (rb_dump_backtrace_with_lines): a function to get must
+ be a function in the main executable, whose absolute path is not
+ available by dladdr, and ruby get it by /proc/self/exe on Linux.
-Tue Dec 23 22:47:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Mar 26 01:34:50 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_check_readable): set FMODE_RBUF always, even if
- NEED_IO_SEEK_BETWEEN_RW is not defined. [ruby-dev:22340]
+ * addr2line.c (fill_lines): skip if path is NULL.
- * io.c (rb_io_check_writable): clear FMODE_RBUF before writing
- something.
+Tue Mar 25 23:57:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 23 22:25:00 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
+ * parse.y (parser_yylex): only a newline after label should be
+ significant. [ruby-core:61658] [Bug #9669]
- * lib/optparse.rb: incomplete RDoc documentation added in place of
- existing RD comments. Tabs converted to spaces.
+Tue Mar 25 23:32:25 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Dec 23 19:44:47 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/pathname/lib/pathname.rb (Pathname#join): remove unnecessary
+ unshift.
- * test/soap/test_streamhandler.rb (test_basic_auth): removed.
- soap4r + basic_auth is not officially supported in ruby/1.8.1 even
- though soap4r + basic_auth + http-access2 should run fine.
+ * test/pathname/test_pathname.rb (TestPathname#test_join): add tests.
-Tue Dec 23 19:42:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 25 16:47:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (rb_io_ungetc): raise an exception at unread stream to
- avoid unspecified behavior. [ruby-dev:22330]
+ * parse.y (lex_state_e, parser_params, f_arglist, parser_yylex):
+ separate EXPR_LABELARG from EXPR_BEG and let newline significant,
+ so that required keyword argument can place at the end of
+ argument list without parentheses. [ruby-core:61658] [Bug #9669]
- * test/ruby/test_system.rb (test_syntax): glob relatively from
- __FILE__.
+Mon Mar 24 22:19:56 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 23 18:09:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (ripper_initialize): filename can not be modified.
- * pack.c (pack_pack): remove unnecessary negative value check.
- [ruby-dev:22329]
+Mon Mar 24 15:19:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Dec 23 17:26:55 2003 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp>
+ * addr2line.c (rb_dump_backtrace_with_lines): fetch path of the
+ executable from /proc/self/exe on Linux.
- * bcc32/Makefile.sub (config.h): bcc has finite(). [ruby-list:38940]
+Mon Mar 24 14:14:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Dec 23 16:08:16 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * gc.c: Fix up default GC params by @csfrancis [fix GH-556]
- * lib/rexml/encodings/US-ASCII.rb: typo. [ruby-talk:88650]
+Mon Mar 24 13:13:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_system.rb: num of asserts depended on running dir.
+ * addr2line.c (parse_debug_line_cu): explicitly specify signed char
+ because DWARF's line_Base is signed char and char maybe unsigned.
+ patched by Rei Odaira. [ruby-dev:48068] [Bug #9654]
- * test/xsd/test_noencoding.rb: rexml + without iconv/uconv cannot
- handle euc-jp. install iconv, uconv or xmlscan.
+Sun Mar 23 11:03:50 2014 Kohei Suzuki <eagletmt@gmail.com>
-Tue Dec 23 14:13:51 2003 akira yamada <akira@ruby-lang.org>
+ * vm_method.c (rb_method_entry_get_without_cache): me->klass is 0
+ for a method aliased in a module. [ruby-core:61636] [Bug #9663]
- * lib/uri/generic.rb (URI::Generic::check_userinfo,
- URI::Generic::check_user, URI::Generic::check_password): tests
- conflicts/depends with other components closely.
+Sun Mar 23 08:12:27 2014 Eric Wong <e@80x24.org>
- * test/uri/test_generic.rb (TestGeneric::test_set_component):
- added tets.
+ * st.c (hash_pos): use bitwise AND to avoid slow modulo op
+ (new_size): power-of-two sizes for hash_pos change
+ (st_numhash): adjust for common keys due to lack of prime modulo
+ [Feature #9425]
+ * hash.c (rb_any_hash): right shift for symbols
+ * benchmark/bm_hash_aref_miss.rb: added to show improvement
+ * benchmark/bm_hash_aref_sym_long.rb: ditto
+ * benchmark/bm_hash_aref_str.rb: ditto
+ * benchmark/bm_hash_aref_sym.rb: ditto
+ * benchmark/bm_hash_ident_num.rb: added to prevent regression
+ * benchmark/bm_hash_ident_obj.rb: ditto
+ * benchmark/bm_hash_ident_str.rb: ditto
+ * benchmark/bm_hash_ident_sym.rb: ditto
-Tue Dec 23 11:08:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Mar 22 22:56:45 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/xsd/test_noencoding.rb: rescue Errno::EINVAL and do not test.
- "euc-jp" might not be in supported encoding name list.
- [ruby-talk:88650]
+ * addr2line.c (fill_lines): compare the file names of object in which
+ symbols exist. [Bug #9654] [ruby-dev:48058]
-Tue Dec 23 06:10:31 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Mar 22 06:46:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/cgi.rb (CGI): add support for mod_ruby.
+ * lib/cgi/util.rb (escape_html, unescape_html): make synonyms
+ aliases instead of wrapper methods.
- * lib/webrick/cgi.rb (CGI::Socket): add check for existence of
- OpenSSL module in all HTTPS related methods.
+ * lib/cgi/util.rb (escape_element, unescape_element): ditto.
+ [Fixes GH-573]
- * lib/webrick/cgi.rb (CGI::Socket#cipher): should create similar
- value to OpenSSL::SSLSocket#cipher.
+Fri Mar 21 21:57:34 2014 Akinori MUSHA <knu@iDaemons.org>
- * lib/webrick/httpresponse.rb (HTTPResponse#setup_header): should
- set "connection: close" if @keep_alive is false.
+ * configure.in: Fix a build problem with clang and --with-opt-dir.
+ If ruby is configured with --with-opt-dir=dir when using clang
+ as compiler, a warning `clang: warning: argument unused during
+ compilation: '-I dir'` is emitted almost every time clang
+ compiles a file. Unfortunately, RUBY_CHECK_PRINTF_PREFIX takes
+ any output from the compiler as fatal error, and the check thus
+ fails due to the warning. This is an attempt to fix the problem
+ by adding a flag -Qunused-arguments to CFLAGS locally in the
+ function to suppress the warning. [ruby-dev:48062] [Bug #9658]
+ [Fixes GH-571] https://github.com/ruby/ruby/pull/571
- * lib/webrick/https.rb (HTTPrequest#meta_vars): add supprt for
- SSL_PROTOCOL, SSL_CIPHER_USEKEYSIZE and SSL_CIPHER_ALGKEYSIZE.
+Fri Mar 21 16:31:56 2014 Zachary Scott <e@zzak.io>
-Mon Dec 22 23:00:05 2003 akira yamada <akira@ruby-lang.org>
+ * gc.c: [DOC] Fix call-seq for GC.start by @jasonrclark [Fixes GH-572]
+ https://github.com/ruby/ruby/pull/572
- * lib/uri/generic.rb (URI::Generic::check_opaque): fixed typo.
+Thu Mar 20 11:37:28 2014 James Edward Gray II <james@graysoftinc.com>
-Mon Dec 22 21:59:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/csv.rb: Fixed a broken regular expression that was causing
+ CSV to miss escaping some special meaning characters when used
+ in parsing.
+ Reported by David Unric
+ [ruby-core:54986] [Bug #8405]
- * ext/iconv/iconv.c (map_charset): always ensure code is a String.
+Thu Mar 20 16:53:07 2014 Koichi Sasada <ko1@atdot.net>
-Mon Dec 22 21:15:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (objspace_malloc_increase): should not invoke
+ garbage_collect_with_gvl() here on non-ruby threads.
- * class.c (rb_mod_init_copy): always copy singleton class.
- [ruby-dev:22325]
+ Should just ignore the malloc_increase.
-Mon Dec 22 20:44:36 2003 akira yamada <akira@ruby-lang.org>
+ This issue is pointed by Eric Wong [ruby-core:61519].
- * lib/uri/generic.rb (URI::Generic#route_from): accepts urls which
- has no host-part.
+Thu Mar 20 13:05:16 2014 Koichi Sasada <ko1@atdot.net>
- * test/uri/test_generic.rb (TestGeneric::test_route): added a test.
+ * struct.c (rb_struct_alloc): use RARRAY_CONST_PTR() instead of
+ RARRAY_PTR().
-Mon Dec 22 20:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 20 12:59:39 2014 Koichi Sasada <ko1@atdot.net>
- * lib/cgi.rb: reduce eval.
+ * include/ruby/intern.h (rb_obj_call_init, rb_class_new_instance):
+ constify a parameter (VALUE *).
+ I believe this incompatibility doesn't break any code.
+ However, if you have trouble, please tell us.
- * lib/cgi.rb (CGI::QueryExtension::read_multipart): alias path to
- local_path. [ruby-list:38883]
+ * eval.c, object.c: ditto.
-Mon Dec 22 20:09:31 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Mar 20 12:31:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/soap/test_property.rb: remove duplicated test method.
+ * vm_method.c (rb_method_entry_get_without_cache): get rid of
+ infinite recursion at aliases in a subclass and a superclass.
+ return actually defined class for other than singleton class.
+ [ruby-core:60431] [Bug #9475]
-Mon Dec 22 18:22:04 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Mar 19 17:13:06 2014 Eric Wong <e@80x24.org>
- * bcc32/Makefile.sub, win32/Makefile.sub (config.h): remove
- HAVE_ISINF definition to follow previous commits of missing.h
- and win32/win32.h.
+ * time.c (time_mload): freeze and preserve marshal-loaded time zone
+ * test/ruby/test_time.rb: add test for GC on loaded object
+ [Bug #9652]
-Mon Dec 22 17:23:42 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 18 23:20:12 2014 Shota Fukumori <her@sorah.jp>
- * configure.in (ac_cv_func_setitimer): moved from defines.h
+ * vm_eval.c (eval_string_with_cref): Unify to use NIL_P.
- * defines.h, rubysig.h, signal.c: removed macro handling which
- should be done in configure.
+Tue Mar 18 22:03:41 2014 Shota Fukumori <her@sorah.jp>
- * configure.in (intrinsics.h): check if present.
+ * vm_eval.c (eval_string_with_cref): Use file path even if scope is
+ given. Related to [ruby-core:56099] [Bug #8662] and r42103.
- * ruby.h: include intrinsics.h if available.
+Mon Mar 17 13:17:47 2014 Koichi Sasada <ko1@atdot.net>
- * bignum.c, marshal.c: include ieeefp.h if available.
+ * enumerator.c (enumerator_block_call): use RARRAY_CONST_PTR()
+ instead of RARRAY_PTR().
- * missing.h (isinf): define as a macro if finite() and isnan()
- are available. [ruby-core:02032]
+ * io.c (rb_io_s_popen): ditto.
-Mon Dec 22 17:07:31 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * numeric.c (num_step_size): ditto.
- * configure.in (mingw): set isnan, finite and isinf to yes.
+ * vm_eval.c (rb_apply): ditto.
-Mon Dec 22 13:40:19 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * vm_eval.c (rb_eval_cmd): ditto.
- * lib/soap/property.rb: passing block by reference.
+Mon Mar 17 10:11:59 2014 Eric Wong <e@80x24.org>
-Mon Dec 22 00:32:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * variable.c (rb_const_set): delete existing entry on redefinition
+ [Bug #9645]
+ * test/ruby/test_const.rb (test_redefinition): test for leak
- * eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of
- ALLOW_INTS which may switch context. [ruby-dev:22319]
+Sun Mar 16 21:33:01 2014 Zachary Scott <e@zzak.io>
- * ext/syck/emitter.c (syck_emitter_write): str bigger than
- e->bufsize causes buffer overflow. [ruby-dev:22307]
+ * lib/time.rb: [DOC] Fix timezone in example of Time.parse [Bug #9521]
+ Based on patch by @stomar
-Sun Dec 21 17:29:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 16 13:21:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * class.c (rb_check_inheritable): new function. [ruby-dev:22316]
+ * configure.in (DLDFLAGS): insert a space between option and its
+ argument for non-GCC compilers. [ruby-core:61429] [Bug #9624]
- * intern.h: add prototype.
+Sun Mar 16 08:05:06 2014 Eric Wong <e@80x24.org>
- * eval.c (superclass): use rb_check_inheritable().
+ * gc.c (objspace_xcalloc): fix GC accounting
- * object.c (rb_class_initialize): check argument validity.
+Sun Mar 16 06:33:35 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 21 16:25:10 2003 Tanaka Akira <akr@m17n.org>
+ * addr2line.c (fill_lines): return address is just after calling
+ address. Therefore noreturn function with tail call's return
+ address may be in another function.
- * lib/pathname.rb (Pathname#+): re-implemented to resolve ".." in
- beginning of the argument.
- (Pathname#join): concatenate from the last argument.
- (Pathname#parent): just use Pathname#+.
+Sun Mar 16 05:51:55 2014 Zachary Scott <e@zzak.io>
-Sun Dec 21 00:12:37 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/gserver.rb: [DOC] Fixed typo in example by @stomar [Bug #9543]
- * ext/tk/lib/tk.rb: add new methods (TkScrollbar#assign, assign_list)
+Sat Mar 15 18:54:03 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/tk/sample/tkmultilistframe.rb: use TkScrollbar#assign method
+ * ext/.document: remove refinement from documentable directories.
-Sat Dec 20 21:59:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sat Mar 15 11:02:58 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): refine regexp.
+ * configure.in (DLDFLAGS): check for each options to control
+ symbol resolution. [ruby-core:61429] [Bug #9624]
- * lib/webrick/cgi.rb (CGI#start): NPH scripts return status line
- instead of Status: header field.
+Sat Mar 15 07:02:35 2014 Eric Wong <e@80x24.org>
- * lib/webrick/cgi.rb (CGI::Socket): refine some coditions.
+ * st.c (st_update): remove unnecessary assignment
-Sat Dec 20 16:07:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 14 14:58:38 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/optparse.rb (OptionParser::Completion::complete): wrong
- Regexp for word boundary. pointed out by Gavin Sinclair.
+ * addr2line.c (fill_lines): fetch symbol names from ELF binary's
+ symbol table if it is built with cc -g and not stripped.
+ Now ruby can show static symbols on Linux though glibc's
+ backtrace_symbols(3) don't show them.
- * lib/optparse.rb (OptionParser::make_switch): [no-] prefix was
- missing.
+ * addr2line.c (rb_dump_backtrace_with_lines): use dladdr(3) to
+ detect what object file declares the symbol because
+ dl_iterate_phdr can't detect the main executable file
+ and codes on the stack.
+ NOTE: signal trampolines sometimes on the user stack. (FreeBSD)
-Sat Dec 20 11:40:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * addr2line.c (rb_dump_backtrace_with_lines): stop showing
+ backtrace if the function's name is main.
+ NOTE: FreeBSD's backtrace (libexecinfo) shows _start and
+ an additional address. Why it doesn't remove them on dladdr phase
+ is, dladdr may fail to detect the main function but detect
+ as _start function. Therefore it must be after scanning
+ the symbol table and getting correct name.
- * lib/yaml.rb (YAML::YAML): adjust Marshal version.
-Sat Dec 20 03:56:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Fri Mar 14 12:07:46 2014 Zachary Scott <e@zzak.io>
- * eval.c (rb_with_disable_interrupt): prohibit thread context
- switch during proc execution. [ruby-dev:21899]
+ * doc/syntax/literals.rdoc: [DOC] Single quote strings allows escape
+ of backslash as well, patch by @idupree [Fixes GH-553]
+ https://github.com/ruby/ruby/pull/553
-Sat Dec 20 02:41:02 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Mar 14 01:18:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/cgi.rb: add file. (yet another CGI library)
+ * vm.c (invoke_block_from_c): add splattable argument.
- * MANIFEST: add lib/webrick/cgi.rb.
+ * vm.c (vm_invoke_proc): disallow to splat when directly invoked.
-Sat Dec 20 02:18:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_callee_setup_arg):
+ relax arity check of yielded lambda. [ruby-core:61340] [Bug #9605]
- * misc/ruby-mode.el (ruby-calculate-indent): proper indentation
- inside of parentheses. [ruby-dev:22308]
+ * test/ruby/test_yield.rb (TestRubyYieldGen#emu_bind_params): no
+ longer raise ArgumentError when splatting to lambda.
-Fri Dec 19 21:24:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Thu Mar 13 23:51:02 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): should not set
- HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH.
+ * ext/-test-/win32/dln/libdlntest.c (dlntest_ordinal): no need to
+ specify export in the source file because .def file do it.
+ get rid of warning on linking.
- * lib/webrick/https.rb (HTTPRequest#parse): should check presence
- of cert() method to detect SSLSocket.
+Wed Mar 12 11:19:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 19 22:56:46 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * vm_insnhelper.c (vm_callee_setup_arg): disable fastpath if splat
+ argument, since argc may differ for each calls.
+ [ruby-core:61422] [Bug #9622]
- * lib/soap/property.rb (SOAP::Property#load): new method for loading
- property value into existing property tree.
+ * vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an
+ inline function.
- * test/soap/test_property.rb: add test.
+Wed Mar 12 07:26:05 2014 Eric Wong <e@80x24.org>
-Fri Dec 19 19:21:49 2003 akira yamada <akira@ruby-lang.org>
+ * insns.def (opt_regexpmatch2): respect redefined match op
+ Thanks to Sam Rawlins for the fix.
+ * test/ruby/test_string.rb: test based on Tsuyoshi Sawada's report
+ [Bug #9581]
- * lib/runit/cui/testrunner.rb (RUNIT::CUI::TestRunner::run):
- should use Test::Unit::UI::{PROGRESS_ONLY,VERBOSE}.
+Tue Mar 11 22:31:25 2014 Kazuki Tsujimoto <kazuki@callcc.net>
-Fri Dec 19 17:36:49 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/.document: add objspace/objspace_dump.c to document file.
- * ext/tk/sample/tkmultilistbox.rb: bug fix
+Tue Mar 11 22:22:38 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/tk/sample/tkmultilistframe.rb: new sample script
+ * test/objspace/test_objspace.rb (TestObjSpace#test_dump_uninitialized_file):
+ remove dependency on json library.
-Fri Dec 19 03:44:27 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Tue Mar 11 10:55:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httputils.rb (parse_form_data): should return an
- empty Hash if the body is empty.
+ * README.EXT{,.ja} (Appendix B): update contents of `ruby_options`
+ and replace `ruby_run` with `ruby_run_node`. based on the patch
+ by Kaneko Yuichiro at [ruby-dev:48030] [Bug #9619].
-Thu Dec 18 21:47:35 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Mar 11 06:54:00 2014 Scott Francis <scott.francis@shopify.com>
- * lib/mkmf.rb (create_makefile): should remove deffile if it's
- made by miniruby. based on nobu's patch.
+ * ext/objspace/objspace_dump.c: Check fptr before trying to dump RFILE
+ object fd. [GH-562]
-Thu Dec 18 21:44:21 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/objspace/test_objspace.rb: add test
- * eval.c (stack_extend): ignore inline optimization on VC7.
+Tue Mar 11 02:04:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/Makefile.sub (OS, RT): can override.
+ * vm_dump.c (rb_vm_bugreport): show vm maps on FreeBSD.
- * win32/Makefile.sub (LDFLAGS): ditto. shouldn't use pdb:none
- option. based on Tietew's patch [ruby-dev:22289]
+ * vm_dump.c (procstat_vm): copied from FreeBSD.
+ http://svnweb.freebsd.org/base/head/usr.bin/procstat/procstat_vm.c?revision=261780
-Thu Dec 18 16:38:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 10 12:14:26 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * dir.c (fnmatch): unlike find_dirsep(), rb_path_next() never
- return NULL.
+ * configure.in: always check dladdr(1).
-Thu Dec 18 15:27:59 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * addr2line.c (fill_lines): show the line number in C backtrace if
+ ruby is built without --enable-shared (PIE) on Linux.
+ patch is originally by Shinichiro Hamaji
+ https://twitter.com/shinh/status/441957774264504321
+ NOTE: ld doesn't insert __executable_start for PIE.
+ dladdr(3)'s argument must be a function pointer.
- * lib/ipaddr.rb (IPSocket::getaddress): merge usa's patch.
- [ruby-dev:21678]
+Mon Mar 10 10:51:17 2014 ksss <co000ri@gmail.com>
-Wed Dec 17 15:15:30 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_enumerator.rb (test_iterators): fix test for hash
+ iterators. [Fixes GH-558]
- * lib/cgi.rb (CGI::QueryExtension::Value::[]): should work like
- String#[] if more than one arguments are specified.
+Sun Mar 9 14:14:49 2014 Eric Wong <e@80x24.org>
- * lib/delegate.rb: avoid using common instance name as "@obj".
+ * class.c (rb_class_subclass_add): use xmalloc
+ * class.c (rb_module_add_to_subclasses_list): ditto
+ * class.c (rb_class_remove_from_super_subclasses): use xfree
+ * class.c (rb_class_remove_from_module_subclasses): ditto
+ [Bug #9616]
- * lib/cgi.rb (CGI::QueryExtension::Value): Value is no longer
- subclass of String, but DelegateClass(String).
+Sun Mar 9 13:51:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/curses/extconf.rb: restore function check for init_color.
- [ruby-list:38905]
+ * ext/fiddle/function.c (function_call): fix memory leak when an
+ exception occurs at argument conversion or the function call.
- * Makefile.in: need to specify $(MAINLIBS) for the miniruby
- generation rule.
+Sun Mar 9 06:42:40 2014 Eric Wong <e@80x24.org>
- * configure.in: better FreeBSD -lc_r support.
+ * variable.c (struct global_variable): shrink by 8 bytes on 64-bit
-Wed Dec 17 00:16:14 2003 Minero Aoki <aamine@loveruby.net>
+Sat Mar 8 17:42:51 2014 Eric Wong <e@80x24.org>
- * ext/strscan/strscan.c: new method
- StringScanner#beginning_of_line? (alias #bol?)
+ * vm.c (add_opt_method): cleanup to use rb_method_entry_at
- * ext/strscan/strscan.c: new method StringScanner#concat and #<<.
+Sat Mar 8 13:46:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/strscan/strscan.c: StringScanner#new(str) does not duplicate
- nor freeze STR (allow destructive modification).
+ * ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
+ ext/fiddle/handle.c (fiddle_handle_free),
+ ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
+ based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
- * test/strscan/test_stringscanner.rb: test new methods above.
+Sat Mar 8 13:30:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/strscan/test_stringscanner.rb: test destructive string
- modification.
+ * process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
+ may need larger buffers than sysconf values, so retry with
+ expanding the buffer when ERANGE is returned.
+ [ruby-core:61325] [Bug #9600]
-Tue Dec 16 21:20:47 2003 Tanaka Akira <akr@m17n.org>
+Fri Mar 7 19:29:13 2014 Eric Wong <e@80x24.org>
- * lib/pp.rb: don't use local variable `pp'.
+ * vm_eval.c (vm_call0_body): use RARRAY_CONST_PTR
+ (check_funcall_exec): ditto
+ [ruby-core:61360]
- * lib/prettyprint.rb: ditto.
+Fri Mar 7 19:14:11 2014 Eric Wong <e@80x24.org>
-Tue Dec 16 13:20:43 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * vm_eval.c (vm_call0_body): fix RB_GC_GUARD location
+ (check_funcall_exec): ditto
+ [Bug #9609]
- * ext/tk/lib/tk.rb: condition bug of if statement on
- {pack,grid}_propagate methods
+Fri Mar 7 14:48:17 2014 Narihiro Nakamura <authornari@gmail.com>
-Tue Dec 16 03:17:29 2003 why the lucky stiff <why@ruby-lang.org>
+ * parse.y (ENC_SINGLE): Unused macro removed.
- * lib/yaml/rubytypes.rb: comments in strings. [ruby-talk:88012]
+Fri Mar 7 12:06:19 2014 Martin Bosslet <Martin.Bosslet@gmail.com>
- * test/yaml/test_yaml.rb: add test.
+ * test/openssl/test_ssl.rb: Reuse TLS default options from
+ OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.
-Tue Dec 16 01:14:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 6 15:15:24 2014 Zachary Scott <e@zzak.io>
- * eval.c (catch_timer): check rb_thread_crtical in main native
- thread.
+ * doc/syntax/assignment.rdoc: [DOC] Fix assignment directions
+ By @idupree [Fixes GH-555] https://github.com/ruby/ruby/pull/555
- * eval.c (thread_timer): just sends signals periodically, to
- prevent main native thread from receiving them in critical
- section. [ruby-core:01959]
+Thu Mar 6 15:07:18 2014 Zachary Scott <e@zzak.io>
-Mon Dec 15 13:32:22 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * doc/syntax/methods.rdoc: [DOC] Fix example for block arguments
+ By @idupree [Fixes GH-554] https://github.com/ruby/ruby/pull/554
- * dir.c (check_dirname): check string safety and remove extraneous
- trailing directory separators. [ruby-dev:22279]
+Thu Mar 6 10:33:31 2014 Martin Bosslet <Martin.Bosslet@gmail.com>
- * file.c: renamed and externalized rb_path_next,
- rb_path_skip_prefix, rb_path_last_separator, rb_path_end.
+ * lib/openssl/ssl.rb: Explicitly whitelist the default
+ SSL/TLS ciphers. Forbid SSLv2 and SSLv3, disable
+ compression by default.
+ Reported by Jeff Hodges.
+ [ruby-core:59829] [Bug #9424]
- * intern.h: prototypes for rb_path_next, rb_path_skip_prefix,
- rb_path_last_separator, rb_path_end.
+Wed Mar 5 15:56:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 15 09:27:46 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (f_arg_asgn): define optional arguments as argument
+ variables in the rhs default expressions.
+ [ruby-core:61299] [Bug #9593]
- * ext/openssl/ossl_pkcs12.c (ossl_pkcs12_initialize): first argument
- of rb_protect should take an argument of VALUE.
+Wed Mar 5 11:58:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 14 18:46:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
+ error reasons with old OpenSSL, and insert a colon iff formatted
+ message is not empty.
- * ext/socket/socket.c (Init_socket): IPv6 is not supported although
- AF_INET6 is defined on MinGW.
+Wed Mar 5 00:42:00 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/ipaddr.rb (AF_INET6): workaround in the environment which does
- not support IPv6.
+ * ext/pathname/lib/pathname.rb (Pathname#find): add "ignore_error"
+ keyword argument defaulted to true as well as Find#find.
-Sat Dec 13 18:55:16 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 4 23:00:18 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/iconv/charset_alias.rb: preserve original order.
+ * test/ruby/test_eval.rb (TestEval#make_test_binding): renamed.
+ it's not test method.
- * ext/iconv/extconf.rb: remove wrapper file at clean.
+Tue Mar 4 20:50:59 2014 Masaya Tarui <tarui@ruby-lang.org>
-Sat Dec 13 18:09:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * st.c (st_foreach): fix type of hash. not st_data_t but st_index_t.
- * eval.c (thread_timer): use timer by sub-thread and nanosleep.
- [ruby-talk:87519]
+Tue Mar 4 19:41:40 2014 Tanaka Akira <akr@fsij.org>
- * gc.c (Init_stack): no stack adjustment for THREAD_SAFE.
+ * Makefile.in: ".DEFAULT" target removed because it is not for
+ specifying default target.
-Sat Dec 13 17:17:59 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 4 00:25:35 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * eval.c (proc_alloc): cache the created object at first time.
- [ruby-talk:61288], [ruby-dev:22240]
+ * lib/find.rb (Find#find): should pass ignore_error option to enumerators.
-Sat Dec 13 09:01:23 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 3 13:27:35 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: check ucontext.h.
+ * test/test_find.rb (TestFind#test_unsearchable_dir): ruby cannot make
+ directory unreachable by owner on Windows.
- * eval.c: use getcontext/setcontext() instead of setjmp/longjmp()
- on ia64 or with native thread enabled. [ruby-core:01932]
+Mon Mar 3 08:10:04 2014 Eric Wong <e@80x24.org>
-Sat Dec 13 03:09:14 2003 why the lucky stiff <why@ruby-lang.org>
+ * vm_method.c (rb_method_entry_get_without_cache): disable GMC
+ writing if GMC is disabled.
+ [ruby-core:61218]
- * lib/yaml/rubytypes.rb: anonymous struct fix. [ruby-core:01946]
+Mon Mar 3 07:47:17 2014 Eric Wong <e@80x24.org>
- * test/yaml/test_yaml.rb: add test.
+ * README.EXT: wrap GetDBM with do/while(0)
+ * README.EXT.ja: ditto
+ * ext/dbm/dbm.c: ditto, likewise for GetDBM2
+ * ext/gdbm/gdbm.c: ditto
+ * ext/sdbm/init.c: ditto
+ [ruby-core:61217]
-Fri Dec 12 22:36:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Mon Mar 3 07:17:31 2014 Zachary Scott <e@zzak.io>
- * lib/csv.rb: add Cell#to_str and Cell#to_s for /.../ =~ aCell,
- "#{aCell}" and so on.
+ * NEWS: [DOC] Update doc regarding filesystem load when flushing IO
- * test/csv/test_csv.rb: add tests.
+Mon Mar 3 04:37:50 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Dec 12 19:33:06 2003 Minero Aoki <aamine@loveruby.net>
+ * io.c (rb_io_fsync): need to fsync even if on Windows. fixed mistake
+ of r45254 and r45256.
- * lib/fileutils.rb (mkdir): remove trailing `/' from pathes.
+Mon Mar 3 04:21:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/fileutils.rb (rmdir): ditto. [ruby-dev:22238]
+ * test/win32ole: get rid of warnings (unused variable).
- * lib/fileutils.rb (rmdir_r): ditto.
+Mon Mar 3 02:53:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/fileutils.rb (fu_copy_dir): check if it is a directory after
- mkdir(2).
+ * io.c (rb_io_flush_raw): [EXPERIMENTAL] remove force syncing for Win32
+ to speed up IO. this may break some tests, and they'll be fixed
+ later.
+ [ruby-core:58570] [Bug #9153]
-Fri Dec 12 06:06:09 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 3 00:17:43 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (proc_invoke): fix class name in warning message for
- define_method. [ruby-dev:22235]
+ * test/ruby/test_backtrace.rb: get rid of warnings. unused variable,
+ shadowing.
-Thu Dec 11 21:24:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Mar 2 11:15:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkcs12.[ch]: new files. add OpenSSL::PKCS12.
+ * lib/find.rb (Find#find): add "ignore_error" keyword argument
+ defaulted to true. [ruby-core:51025] [Feature #7596]
- * ext/openssl/ossl.[ch]: ditto.
+Sun Mar 2 11:13:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/MANIFEST: add ossl_pkcs12.[ch].
+ * ext/readline/extconf.rb (rl_hook_func_t): define as Function for
+ very old readline versions. [ruby-core:61209] [Bug #9578]
-Thu Dec 11 20:54:28 2003 Minero Aoki <aamine@loveruby.net>
+Sun Mar 2 10:47:58 2014 Eric Wong <e@80x24.org>
- * lib/fileutils.rb (mkdir_p): remove trailing `/' befere mkdir(2).
- mkdir("nonexistdir/") does not work on NetBSD/Alpha 1.6.1.
+ * load.c (ruby_init_ext): make idempotent to suppress warnings
- * lib/fileutils.rb (fu_list): call to_str for all arguments.
+Sat Mar 1 19:51:42 2014 Tanaka Akira <akr@fsij.org>
-Thu Dec 11 20:07:01 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writing
+ stdin_data.
+ (Open3.capture2): Ditto.
+ (Open3.capture2e): Ditto.
- * lib/ftools.rb (makedirs): sync with fileutils.
+Sat Mar 1 19:06:47 2014 Eric Wong <e@80x24.org>
-Thu Dec 11 19:53:03 2003 Minero Aoki <aamine@loveruby.net>
+ * gc.c (ruby_gc_set_params): simplify condition
- * lib/fileutils.rb (mkdir_p): catch all SystemCallErrors.
- (mkdir("C:\") causes EACCESS on Windows 2000/NTFS)
+Sat Mar 1 16:18:40 2014 Tanaka Akira <akr@fsij.org>
-Thu Dec 11 19:08:02 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead
+ of Function to support readline-6.3. (rl_hook_func_t is available
+ since readline-4.2.)
+ Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578]
- * lib/fileutils.rb (mkdir_p): check if it is a directory after
- mkdir(2) instead of before mkdir(2), to avoid race condition.
- [ruby-talk:87730]
- Refer: mkinstalldirs sh script, GNU mkdir(1) (coreutils 5.0)
+Sat Mar 1 16:05:58 2014 Eric Wong <e@80x24.org>
-Thu Dec 11 18:49:30 2003 Minero Aoki <aamine@loveruby.net>
+ * gc.c (ruby_gc_set_params): fix building without RGenGC
- * lib/fileutils.rb: def m( arg ) -> def m(arg).
+Sat Mar 1 11:08:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Dec 11 11:39:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
+ objects.
- * configure.in (ieeefp.h), numeric.c: needed for finite() on
- Solaris. [ruby-core:01921]
+ * ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
+ objects.
- * file.c (rb_stat_inspect): adjust format specifier.
+ * test/psych/test_encoding.rb: add test
- * parse.c (arg_prepend): nodetype() is for debug use.
+ * ext/psych/lib/psych.rb: add version
- * ruby.h (ISASCII, etc): cast to int to get rid of warning.
+Sat Mar 1 10:52:34 2014 Zachary Scott <e@zzak.io>
- * ruby.h (alloca.h): include even in GCC. [ruby-core:01925]
+ * README.EXT.ja: [DOC] Fix typo "macro macro" @utenmiki [Fixes GH-551]
+ https://github.com/ruby/ruby/pull/551
- * ext/bigdecimal/bigdecimal.c (GetVpValue): adjust format
- specifier.
+Fri Feb 28 11:16:55 2014 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_prec, BigDecimal_coerce,
- BigDecimal_divmod): use rb_assoc_new() to suppress memory usage.
+ * numeric.c: Fix Numeric#step with 0 unit [Bug #9575]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_split): ditto.
+Thu Feb 27 17:59:01 2014 Zachary Scott <e@zzak.io>
- * ext/dl/sym.c (rb_dlsym_guardcall): guard itself should be
- volatile.
+ * lib/optparse.rb: [DOC] Add example of generating help with optparse.
+ Patch by @joelmccracken documenting-ruby/ruby#19
+ https://github.com/documenting-ruby/ruby/pull/19
- * ext/iconv/iconv.c (iconv_convert): ensure actual parameter with
- format specifier.
+Thu Feb 27 12:10:09 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): do not
- define unless used.
+ * numeric.c (ruby_num_interval_step_size): check signs and get rid
+ of implementation dependent behavior of negative division.
+ [ruby-core:61106] [Bug #9570]
- * ext/pty/pty.c (getDevice): get rid of warning.
+Thu Feb 27 03:55:45 2014 Zachary Scott <e@zzak.io>
- * ext/socket/socket.c (port_str, sock_s_getaddrinfo,
- sock_s_getnameinfo): FIX2INT() now returns long.
+ * thread.c: [DOC] Typo in comment for _FORTIFY_SOURCE [Fixes GH-548]
+ Patch by @qnet-herwin https://github.com/ruby/ruby/pull/548
- * ext/socket/socket.c (init_inetsock_internal): uninitialized
- variable.
+Wed Feb 26 18:43:43 2014 Koichi Sasada <ko1@atdot.net>
- * ext/syck/rubyext.c (syck_parser_assign_io): add prototype.
+ * gc.c (heap_pages_free_unused_pages): check tomb page availability
+ at first.
+ And return immediately if we don't touch sorted list any more.
- * ext/syck/rubyext.c (rb_syck_mktime, yaml_org_handler): use
- ISDIGIT() instead of isdigit() to avoid warnings and for
- platforms which don't support non-ascii charater.
+Wed Feb 26 14:10:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 10 19:28:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (setup_exception): preserve exception class name encoding
+ in debug mode messages.
- * ext/stringio/stringio.c (strio_read): set EOF flag at short read.
- [ruby-dev:22223], [ruby-dev:22224]
+ * eval.c (setup_exception): preserve errinfo across calling #to_s
+ method on the exception. [ruby-core:61091] [Bug #9568]
-Wed Dec 10 18:07:25 2003 Minero Aoki <aamine@loveruby.net>
+Wed Feb 26 01:29:27 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/erb.rb: new method ERB#filename(=). [ruby-dev:22208]
+ * string.c (sym_find): Add Symbol.find(str), which returns whether given
+ string is defined as symbol or not. [Feature #7854]
-Wed Dec 10 17:54:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 25 22:52:02 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/stringio/stringio.c (strio_read): do not set EOF flag when
- requested length is zero. [ruby-dev:22214]
+ * ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT.
-Wed Dec 10 17:17:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto.
- * io.c (read_all): should return given string even if data read is
- empty. [ruby-dev:22207]
+Tue Feb 25 22:49:30 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Dec 10 17:16:06 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/dl.c (rb_dl_malloc): use NUM2SIZET instead of NUM2INT.
+ Coverity Scan found this bug.
- * ext/stringio/stringio.c (strio_read): adjust behavior at reading
- beyond EOF to IO. [ruby-dev:22205]
+ * ext/fiddle/fiddle.c (rb_fiddle_malloc): ditto.
- * test/ruby/ut_eof.rb (TestEOF::Seek): test behaviors at reading
- beyond EOF.
+Tue Feb 25 12:06:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_file.rb, test/stringio/test_stringio.rb: include
- TestEOF::Seek test case.
+ * win32/Makefile.sub: define PACKED_STRUCT.
-Wed Dec 10 15:01:19 2003 Shugo Maeda <shugo@ruby-lang.org>
+Mon Feb 24 21:41:56 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/monitor/test_monitor.rb (test_cond): use Queue#deq
- instead of sleep.
+ * README.md, README.ja.md: removed (wrong) mode setting for emacs.
-Wed Dec 10 14:45:39 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Mon Feb 24 20:05:41 2014 Eric Wong <e@80x24.org>
- * ext/pty/pty.c (HAVE_SYS_IOCTL_H): need to include <sys/ioctl.h>
- for TIOCSCTTY on *BSD. based on gotoyuzo's patch.
- (ruby-bugs:PR#1211)
+ * configure.in: define PACKED_STRUCT_UNALIGNED for x86*
+ * timev.h (struct vtm): use PACKED_STRUCT_UNALIGNED
+ * time.c (struct time_object): ditto
+ [Bug #9558] non-x86 cannot safely access unaligned addresses
- * ext/pty/pty.c (establishShell): should close descriptors if fork
- failed.
+Mon Feb 24 18:10:02 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Wed Dec 10 12:53:05 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/fiddle/test_function.rb: remove unused variables.
+ * test/fileutils/test_fileutils.rb: ditto.
+ * test/io/console/test_io_console.rb: ditto.
- * win32/win32.h: define execv() using do_aspawn().
+Mon Feb 24 12:37:51 2014 Eric Wong <e@80x24.org>
- * process.c (proc_exec_v): remove #ifdef's which stopped needing.
+ * configure.in: use -Wno-packed-bitfield-compat for GCC 4.4+
+ use __attribute__((packed)) if available
+ * timev.h: shrink and pack struct vtm
+ * time.c: pack struct time_object and adjust/introduce helpers
+ [ruby-core:60794]
-Tue Dec 9 23:32:23 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Feb 23 17:55:50 2014 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/lib/tk.rb, ext/tk/lib/tkcanvas.rb, ext/tk/lib/tkdialog.rb,
- ext/tk/lib/tkentry.rb, ext/tk/lib/tkscrollbox.rb, ext/tk/lib/tktext.rb,
- ext/tk/sample/tkalignbox.rb, ext/tk/sample/tkcombobox.rb,
- ext/tk/sample/tkmultilistbox.rb, ext/tk/sample/tkoptdb.rb, ext/tk/sample/tktextframe.rb,
- ext/tk/sample/demos-en/dialog1.rb, ext/tk/sample/demos-en/dialog2.rb,
- ext/tk/sample/demos-jp/dialog1.rb, ext/tk/sample/demos-jp/dialog2.rb:
- overrided instance methods, which are private methods on the super
- class, are changed to 'private'
+ * lib/rexml/xmltokens.rb: Add missing non ASCII valid characters
+ to element name characters. Now, REXML name tokens exactly
+ match "[5] Name" in the XML spec and "[4] NCName" in the
+ Namespaces in XML spec. See comment about the details.
+ [Bug #9539] [ruby-core:60901]
+ Reported by Mario Barcala. Thanks!!!
-Tue Dec 9 19:53:02 2003 akira yamada <akira@ruby-lang.org>
+ * test/rexml/xpath/test_node.rb: Add tests for the above case.
- * lib/uri/generic.rb (URI::Generic#route_from0): make case insensitive
- for host-part.
+Sun Feb 23 12:18:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/uri/test_generic.rb (test_route): added tests for the above
- change.
+ * ext/socket/raddrinfo.c (inet_pton): use rb_w32_inet_pton, instead of
+ inet_pton directly, which is unavailable on older version Windows.
-Tue Dec 9 14:10:48 2003 Tanaka Akira <akr@m17n.org>
+ * include/ruby/win32.h, win32/win32.c (rb_w32_inet_pton): add a
+ wrapper function for inet_pton minimum supported client is
+ Vista, as well as inet_ntop.
- * io.c (rb_io_check_readable): don't call io_seek if EOF flag is set,
- to avoid clearing EOF flag.
- (rb_io_check_writable): ditto.
+Sun Feb 23 11:33:25 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Tue Dec 9 02:53:55 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * test/net/imap/test_imap.rb: remove unused variables.
+ * test/net/imap/test_imap_response_parser.rb: ditto.
+ * test/net/pop/test_pop.rb: ditto.
- * ext/tk/sample/tkalignbox.rb: new sample script
+Sun Feb 23 02:19:51 2014 Tanaka Akira <akr@fsij.org>
-Tue Dec 9 00:45:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * lib/resolv.rb (bind_random_port): Rescue EPERM for FreeBSD which
+ security.mac.portacl.port_high is changed.
+ See mac_portacl(4) for details.
+ Reported by Jakub Szafranski. [ruby-core:60917] [Bug #9544]
- * lib/test/unit/assertions.rb: renamed #assert_raises to #assert_raise
- and made the former call the latter. [ruby-core:01890]
+Sat Feb 22 23:17:01 2014 Kouhei Sutou <kou@cozmixng.org>
- * test/testunit/test_assertions.rb: ditto.
+ * lib/rexml/xpath_parser.rb: Fix indent.
-Tue Dec 9 00:07:35 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Feb 22 23:15:35 2014 Kouhei Sutou <kou@cozmixng.org>
- * lib/soap/rpc/standaloneServer.rb: add 'shutdown' and 'status'
- methods as delegates to WEBrick.
+ * test/rexml/xpath/test_attribute.rb: Simplify.
- * test/soap/calc/{test_calc.rb,test_calc2.rb},
- test/soap/helloworld/test_helloworld.rb,
- test/wsdl/datetime/test_datetime.rb, test/wsdl/raa/test_raa.rb:
- follow the change.
+Sat Feb 22 20:28:47 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Dec 8 22:48:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/redmine-backporter.rb: more friendly.
- * lib/test/unit/autorunner.rb: remove dependency to a particular
- runner. [ruby-core:01901], [ruby-list:38869]
+Sat Feb 22 20:24:43 2014 Kouhei Sutou <kou@cozmixng.org>
- * lib/test/unit/ui/testrunnerutilities.rb: moved output level
- constants from Console.
+ * test/rexml/test_xpath*.rb: Move to ...
+ * test/rexml/xpath/*.rb: ... here.
- * lib/test/unit/ui/console/testrunner.rb: ditto.
+Sat Feb 22 20:04:41 2014 Kouhei Sutou <kou@cozmixng.org>
- * lib/test/unit/ui/{fox,gtk,gtk2,tk}/testrunner.rb (initialize):
- accept output_level.
+ * test/rexml/listener.rb: Untabify.
-Mon Dec 8 15:03:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 22 19:07:31 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/syck.c (syck_io_str_read): get rid of buffer overflow.
+ * ext/io/console/console.c (console_dev): need read access for conout$
+ because some functions need it. [Bug#9554]
-Mon Dec 8 13:02:11 2003 Minero Aoki <aamine@loveruby.net>
+Sat Feb 22 18:40:58 2014 Eric Wong <e@80x24.org>
- * lib/uri/common.rb: new method URI.regexp. [ruby-dev:22121]
+ * .gitignore: ignore benchmark files
- * test/uri/test_common.rb: add test for URI.regexp.
+Sat Feb 22 01:22:24 2014 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Dec 8 12:44:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bignum.c (bary_mul_precheck): fix a copy-paste error.
+ Coverity Scan found this bug.
- * pack.c: define swap16 and swap32 only if they are not
- defined. OpenBSD defines these macros. [ruby-dev:22181]
+Sat Feb 22 00:58:51 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sun Dec 7 20:54:17 2003 Tanaka Akira <akr@m17n.org>
+ * ext/socket/raddrinfo.c (rb_getaddrinfo): second argument of
+ MEMZERO is type. Coverity Scan found this bug.
- * ext/iconv/iconv.c (map_charset): make case sensitive.
- ext/iconv/charset_alias.rb (charset_alias): don't ignore
- config.charset's information. sort aliases.
+Fri Feb 21 23:47:24 2014 Shugo Maeda <shugo@ruby-lang.org>
-Sat Dec 6 22:58:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * ext/socket/init.c (wait_connectable): break if the socket is
+ writable to avoid infinite loops on FreeBSD and other platforms
+ which conforms to SUSv3. This problem cannot be reproduced with
+ loopback interfaces, so it's hard to write test code.
+ rsock_connect() and wait_connectable() are overly complicated, so
+ they should be refactored, but I commit this fix as a workaround
+ for the release of Ruby 1.9.3 scheduled on Feb 24.
+ [ruby-core:60940] [Bug #9547]
- * ext/openssl/ossl_ssl.c (ossl_start_ssl): new function to wrap
- SSL_connect and SSL_accept; if SSL_connect (or SSL_accept) returned
- but not finished the handshake process, we should retry it.
+Fri Feb 21 23:03:39 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_connect): call ossl_start_ssl.
+ * tool/redmine-backporter.rb: added to handle redmine tickets.
- * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto.
+Fri Feb 21 20:42:01 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_read): allow signal traps.
+ * class.c (rb_mod_init_copy): do nothing if copying self.
+ [ruby-dev:47989] [Bug #9535]
-Sat Dec 6 21:45:10 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * hash.c (rb_hash_initialize_copy): ditto.
- * io.c (flush_before_seek): flush before seek on any platform.
+Fri Feb 21 16:45:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: ditto.
+ * lib/logger.rb (next_rotate_time, previous_period_end): consider
+ DST change.
-Sat Dec 6 17:23:00 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/logger.rb (Logger::LogDevice#check_shift_log): compare the
+ current time with the time for the next rotation to fix rotation
+ miss when date changed between the comparison and log writing.
+ based on the patch by megayu <yuhg2310 AT gmail.com>.
+ [Fixes GH-539]
- * lib/soap/soap.rb(SOAP::Env.getenv): allow upcase environment variable
- as well as downcase one.
+Fri Feb 21 10:39:33 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/soap/netHttpClient.rb(SOAP::NetHttpClient#proxy=): check URI.
+ * test/monitor/test_monitor.rb: remove unused variables.
+ * test/resolv/test_dns.rb: ditto.
+ * test/rexml/test_functions.rb: ditto.
+ * test/rss/test_setup_maker_itunes.rb: ditto.
-Fri Dec 5 23:22:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 21 09:48:56 2014 Eric Wong <e@80x24.org>
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_raises,
- Test::Unit::Assertions::assert_nothing_raised): use the last
- argument as message unless class object.
+ * ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error
+ (bsock_recvmsg_internal): ditto
+ * test/socket/test_unix.rb: test above for infinite loop
- * test/testunit/test_assertions.rb (test_assert_raises): test for
- multiple exception list. [ruby-core:01891]
+Fri Feb 21 08:27:19 2014 Eric Wong <e@80x24.org>
- * test/testunit/test_assertions.rb (test_assert_nothing_raised): test
- for non-exception classes.
+ * include/ruby/ruby.h (RB_GC_GUARD):
+ use rb_gc_guarded_ptr_val on non-GCC/MSC
+ * gc.c (rb_gc_guarded_ptr_val): rename and adjust argument.
+ RB_GC_GUARD should be robust enough for any compiler.
+ [ruby-core:60816] [Bug #7805]
-Fri Dec 5 22:23:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Feb 20 22:21:26 2014 Tanaka Akira <akr@fsij.org>
- * lib/soap/netHttpClient.rb: proxy support did not work. fixed.
+ * ext/socket/raddrinfo.c (numeric_getaddrinfo): Use xcalloc.
+ Suggested by Eric Wong.
+ https://bugs.ruby-lang.org/issues/9525#note-14
- * lib/soap/property.rb: add class methods for loading property from
- stream/file/propertyfile. propertyfile is a file which is located at
- somedir in $:.
+Thu Feb 20 11:21:13 2014 Masaki Matsushita <glass.saga@gmail.com>
- * lib/soap/soap.rb, lib/soap/wsdlDriver.rb, lib/soap/rpc/driver.rb,
- lib/wsdl/importer.rb: load property from propertyfile 'soap/property'
- e.g. /usr/local/lib/ruby/site_ruby/1.8/soap/property.
+ * hash.c (rb_hash_flatten): fix behavior of flatten(-1).
+ [ruby-dev:47988] [Bug #9533]
- * test/soap/test_property.rb, test/soap/test_streamhandler.rb: new file.
+ * test/ruby/test_array.rb: test for above.
-Fri Dec 5 17:26:23 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 19 18:57:02 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_exec_end_proc): maintain tmp_end_procs.
- [ruby-dev:22154]
+ * ext/socket: Bypass getaddrinfo() if node and serv are numeric.
+ Reporeted by Naotoshi Seo. [ruby-core:60801] [Bug #9525]
-Fri Dec 5 13:36:59 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/extconf.rb: Detect struct sockaddr_in6.sin6_len.
- * eval.c (rb_exec_end_proc): should not clear end_procs and
- ephemeral_end_procs before execution. [ruby-dev:22144]
+ * ext/socket/sockport.h (SET_SIN6_LEN): New macro.
+ (INIT_SOCKADDR_IN6): Ditto.
- * eval.c (rb_obj_extend): call Module#extended hook after
- extended_object. [ruby-list:38866]
+ * ext/socket/rubysocket.h (struct rb_addrinfo): Add
+ allocated_by_malloc field.
- * object.c (Init_Object): Module#extended defined.
+ * ext/socket/raddrinfo.c (numeric_getaddrinfo): New function.
+ (rb_getaddrinfo): Call numeric_getaddrinfo at first.
+ (rb_freeaddrinfo): Free struct addrinfo properly when it is
+ allocated by numeric_getaddrinfo.
-Fri Dec 5 13:17:30 2003 Tanaka Akira <akr@m17n.org>
+Wed Feb 19 18:31:48 2014 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_pipe.rb: use IO.pipe instead of IO.popen.
+ * ext/socket: Wrap struct addrinfo by struct rb_addrinfo.
-Fri Dec 5 11:54:45 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 19 17:47:01 2014 Tanaka Akira <akr@fsij.org>
- * ext/stringio/stringio.c (strio_read): follow IO#read.
+ * ext/socket/ipsocket.c (ip_s_getaddress): Don't access freed memory.
- * test/ruby/ut_eof.rb, test/ruby/test_file.rb, test/ruby/test_pipe.rb,
- test/stringio/test_stringio.rb: add EOF test.
+Wed Feb 19 11:39:41 2014 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Dec 5 02:49:35 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: it must see rb_cv_broken_memmem not rb_cv_func_memmem.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_raises):
- allow multiple exception list. [ruby-core:01884]
+Tue Feb 18 23:18:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
- check whether arguments are subclass of Exception.
+ * test/socket/test_socket.rb: unix socket is required by test case.
-Thu Dec 4 23:54:00 2003 Rick Ohnemus <rick.ohnemus@systemware.com>
+Tue Feb 18 20:48:38 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * dln.c (aix_loaderror): should not use member named 'errno' which
- might be a macro (e.g. on AIX).
+ * test/socket/test_addrinfo.rb: remove unused variables.
+ * test/socket/test_nonblock.rb: ditto.
+ * test/socket/test_socket.rb: ditto.
+ * test/socket/test_unix.rb: ditto.
+ * test/testunit/test_parallel.rb: ditto.
+ * test/webrick/test_filehandler.rb: ditto.
+ * test/xmlrpc/test_features.rb: ditto.
+ * test/zlib/test_zlib.rb: ditto.
-Thu Dec 4 23:32:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Feb 18 14:27:18 2014 Shota Fukumori <her@sorah.jp>
- * io.c (read_all): do not depend on lseek position.
- [ruby-dev:22026]
+ * lib/test/unit.rb: Requires minitest < 5.0.0 if Gem is available.
-Thu Dec 4 22:37:26 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 18 14:24:07 2014 Shota Fukumori <her@sorah.jp>
- * eval.c (rb_eval): preserve $! value when retry happens in the
- rescue clause. [ruby-talk:86697]
+ * lib/test/unit/test-unit.gemspec: Add minitest < 5.0.0 dependency
-Thu Dec 4 21:50:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/rbinstall.rb: Add empty implementations for `add_dependency`,
+ `add_runtime_dependency`, `add_development_dependency` for
+ Gem::Specification.
- * lib/drb/drb.rb (DRb::DRbMessage::send_request, send_reply):
- should rescue errors and re-raise DRbConnError on write too.
- [ruby-dev:22132]
+Tue Feb 18 12:06:39 2014 Tanaka Akira <akr@fsij.org>
-Thu Dec 4 16:41:17 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (FILE_COUNT): Removed. (win32.c defines it in itself.)
+ (FILE_READPTR): Ditto.
- * parse.y (exc_list): allow expanding list. [ruby-dev:22134]
+Tue Feb 18 09:35:44 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Dec 4 14:09:24 2003 Minero Aoki <aamine@loveruby.net>
+ * test/test/psych/test_string.rb: remove unused variables.
+ * test/test/psych/test_yaml.rb: ditto.
- * test/fileutils/test_fileutils.rb (test_cp): test if the error is
- kind of SystemCallError. It is needless details that which errno
- is set on each systems.
+Mon Feb 17 21:31:31 2014 Koichi Sasada <ko1@atdot.net>
-Thu Dec 4 13:24:13 2003 Shugo Maeda <shugo@ruby-lang.org>
+ * test/ruby/test_gc.rb: ignore warning messages for running with -w
+ option such as chkbuild.
- * lib/monitor.rb: use Object#__send__ instead of Object#send.
+Mon Feb 17 20:00:27 2014 Tanaka Akira <akr@fsij.org>
-Thu Dec 4 13:17:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * internal.h: Move BDIGIT and related definitions from
+ include/ruby/defines.h.
- * lib/soap/streamHandler.rb: support latest released version of
- http-access2.
+Mon Feb 17 17:41:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 4 13:04:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * marshal.c (marshal_dump, marshal_load): do not recycle wrapper
+ objects, to prevent from segfault with continuation.
+ [ruby-dev:47970] [Bug #9523]
- * lib/soap/soap.rb: add SOAP::Env module for environment repository
- such as HTTP_PROXY.
+Mon Feb 17 15:43:59 2014 Zachary Scott <e@zzak.io>
- * lib/soap/property.rb: property implementation.
+ * doc/keywords.rdoc: [DOC] Add keywords doc by documenting-ruby/ruby#29
+ https://github.com/documenting-ruby/ruby/pull/29
- * lib/soap/streamHandler.rb, lib/soap/wsdlDriver.rb,
- lib/soap/rpc/driver.rb: use soap/property.rb.
+Mon Feb 17 12:31:31 2014 Koichi Sasada <ko1@atdot.net>
- * lib/wsdl/importer.rb, lib/soap/wsdlDriver.rb, lib/soap/rpc/driver.rb:
- use SOAP::Env.
+ * gc.c (get_envparam_double): fix a warning message.
- * lib/soap/netHttpClient.rb: add basic_auth, ssl_config, and cookie
- management interface, but ignored for now.
+Mon Feb 17 12:09:52 2014 Koichi Sasada <ko1@atdot.net>
- * lib/xsd/charset.rb: add XSD::Charset.encoding= interface to set
- wiredump charset explicitly. it was fixed to 'utf-8' when iconv or
- uconv module was found.
+ * gc.c: introduce new environment variable
+ "RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR" to control major/minor GC
+ frequency.
-Thu Dec 4 10:43:58 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ Do full GC when the number of old objects is more than R * N
+ where R is this factor and
+ N is the number of old objects just after last full GC.
- * ext/dl/sym.c (rb_dlsym_guardcall): __declspec(noinline) is VC7
- feature.
+ * test/ruby/test_gc.rb: add a test.
-Thu Dec 4 10:27:12 2003 Minero Aoki <aamine@loveruby.net>
+Mon Feb 17 11:28:40 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * lib/net/http.rb: update hyperlink to the Japanese document.
+ * test/test_pty.rb: ignore warnings to unused variables.
-Thu Dec 4 09:12:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Mon Feb 17 11:27:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * ext/openssl/ossl_asn1.c (asn1time_to_time): should check that
- the underlying value of ASN1_TIME isn't NULL. [ruby-core:01881]
+ * test/test_find.rb: remove unused variables.
-Thu Dec 4 08:29:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Sun Feb 17 02:12:00 2014 Kenta Murata <mrkn@mrkn.jp>
- * lib/webrick/server.rb (GenericServer#start): should rescue
- Exception to avoid unexpected aborting. [ruby-core:01853]
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard.
- * lib/webrick/server.rb (GenericServer#start_thread): should check
- that peeraddr isn't nil before printing.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto.
- * lib/webrick/httpresponse.rb (HTTPResponse#start_thread): should
- rescue Exception to avoid unexpected aborting of thread.
+Sun Feb 16 15:53:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Dec 4 03:48:59 2003 Tanaka Akira <akr@m17n.org>
+ * test/test_securerandom.rb: File.exists? is deprecated. use File.exist?
- * lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted.
- (Pathname#make_link, Pathname#make_symlink): new method.
+Sun Feb 16 15:05:00 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-Thu Dec 4 01:45:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/pathname/test_pathname.rb: File.exists? is deprecated. use File.exist?
- * io.c (argf_read): should not terminate on empty string; wait
- until real EOF. [ruby-dev:21969]
+Sun Feb 16 15:00:28 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
- * io.c (argf_read): should adjust length to read, when length is
- specified and read spans command line argument files.
+ * test/net/ftp/test_ftp.rb: remove unused variables.
+ * test/logger/test_logger.rb: ditto.
-Wed Dec 3 19:38:36 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Feb 16 14:52:46 2014 Eric Wong <e@80x24.org>
- * lib/drb/drb.rb: correct fcntl parameter. [ruby-dev:22120]
+ * dir.c (dir_s_glob): RB_GC_GUARD instead of volatile
-Wed Dec 3 13:49:07 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sun Feb 16 14:33:52 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/lib/tk.rb: 'format'==>'Kernel.format' (avoid override trouble)
+ * include/ruby/ruby.h (RBIGNUM_SIGN): Defined for compatibility.
+ (RBIGNUM_POSITIVE_P): Ditto.
+ (RBIGNUM_NEGATIVE_P): Ditto.
- * ext/tk/lib/tkafter.rb: ditto.
+Sun Feb 16 12:46:47 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tkcanvas.rb: ditto.
+ * io.c (rb_f_backquote): trade volatile for manual recycle
+ rb_gc_force_recycle ensures object is visible until recycle
- * ext/tk/lib/tkdialog.rb: ditto.
+Sun Feb 16 11:55:14 2014 Eric Wong <e@80x24.org>
- * ext/tk/lib/tktext.rb: ditto.
+ * marshal.c (marshal_dump): use rb_gc_force_recycle for GC-safety
+ (marshal_load): ditto
+ [ruby-core:60730] [Bug #7805]
-Wed Dec 3 13:28:13 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 16 08:11:23 2014 Zachary Scott <e@zzak.io>
- * Makefile.in (lex.c): try gperf first, and copy from the source
- directory if failed. [ruby-dev:22123]
+ * README.EXT.ja: [DOC] Fix typo by @utenmiki [Fixes GH-534]
+ https://github.com/ruby/ruby/pull/534
- * ext/extmk.rb (MTIMES): let makefiles depend to mkmf.rb.
+Sun Feb 16 07:48:20 2014 Tanaka Akira <akr@fsij.org>
- * lib/mkmf.rb (configuration): DLDFLAGS was duplicated.
+ * ext/bigdecimal/bigdecimal.c (BIGNUM_ZERO_P): Unused macro removed.
-Tue Dec 2 23:18:12 2003 Minero Aoki <aamine@loveruby.net>
+Sun Feb 16 06:12:23 2014 Tanaka Akira <akr@fsij.org>
- * lib/net/http.rb: wrote the warning about HTTP_PROXY environment
- variable.
+ * internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.
+ (BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS.
+ (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX.
+ (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT.
+ (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN.
+ (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN.
+ (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P.
+ (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P.
+ (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG.
+ (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK.
+ (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT.
+ (BIGNUM_LEN): Renamed from RBIGNUM_LEN.
+ (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS.
+ (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT.
-Tue Dec 2 21:31:42 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c: Follow the above change.
- * bin/testrb: new test runner. [ruby-core:01845]
+ * gc.c: Ditto.
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner.run,
- Test::Unit::AutoRunner#process_args): take test list to run and
- options.
+ * marshal.c: Ditto.
- * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::RUNNERS,
- Test::Unit::AutoRunner#run): should not exit inside a library,
- just return the result instead.
+ * math.c: Ditto.
- * lib/test/unit.rb: ditto.
+ * numeric.c: Ditto.
- * test/runner.rb: exit with the test result.
+ * random.c: Ditto.
-Tue Dec 2 20:18:48 2003 Eric Sunshine <sunshine@sunshineco.com>
+ * rational.c: Ditto.
- * configure.in (AC_PROG_YACC): AC_DEFINE(OLD_YACC) if Yacc is found
- instead of Bison or byacc.
+ * sprintf.c: Ditto.
- * parse.y: If OLD_YACC is defined, ensure that YYMAXDEPTH is at least
- 10000 (Bison's default) since some old versions of Yacc define it as
- low as 150 by default, which is too low for Ruby to parse some files,
- such as date/format.rb. Among other issues, the parse problem causes
- "make test" to fail.
+ * ext/-test-/bignum/bigzero.c: Ditto.
-Tue Dec 2 20:03:20 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/-test-/bignum/intpack.c: Ditto.
- * test/fileutils/test_fileutils.rb: check if Pathnames are usable
- for arguments.
+ * ext/bigdecimal/bigdecimal.c: Ditto.
-Tue Dec 2 04:22:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Sat Feb 15 20:48:49 2014 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/assertions.rb: fixed #assert_no_match message.
+ * configure.in (FILE_READEND): Don't detect it because it is not used.
- * test/testunit/test_assertions.rb: ditto.
+Sat Feb 15 13:22:28 2014 Eric Wong <e@80x24.org>
-Tue Dec 2 00:43:00 2003 why the lucky stiff <why@ruby-lang.org>
+ * probes_helper.h (RUBY_DTRACE_HOOK): correct type for _id
- * ext/syck/syck.c: string buffering bug. decrementing by full
- max_size now. [ruby-core:01834]
+Sat Feb 15 11:47:47 2014 Tanaka Akira <akr@fsij.org>
-Mon Dec 1 21:33:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * bignum.c (rb_big_cmp): Avoid bignum allocation for comparison
+ between bignum and fixnum.
- * numeric.c (num_sadded): prohibit singleton method definition for
- Numerics. fill yet another gap between Fixnum and Bignum.
+Sat Feb 15 10:55:12 2014 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon Dec 1 17:33:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/-test-/win32/fd_setsize/depend: fix wrong dependencies.
+ [ruby-dev:47253]
- * pack.c (htov16): converts endian using swap16. htov32(), hton16,
- hton32 as well. [ruby-talk:85377]
+Sat Feb 15 00:38:54 2014 Tanaka Akira <akr@fsij.org>
- * pack.c (swap16): swap 2 bytes no matter how big short is on the
- platform. swap32() is also prepared.
+ * enum.c: Enumerable#{min,min_by,max,max_by} extended to take an
+ optional argument.
+ (nmin_cmp): New function.
+ (nmin_block_cmp): Ditto
+ (nmin_filter): Ditto.
+ (nmin_i): Ditto.
+ (nmin_run): Ditto.
+ (enum_min): Call nmin_run if the optional argument is given.
+ (nmin_max): Ditto.
+ (nmin_min_by): Ditto.
+ (nmin_max_by): Ditto.
- * numeric.c (rb_num2int): returns long to preserve information.
- rb_fix2int(), rb_num2uint(), rb_fix2uint() as well.
- [ruby-talk:85377]
+ * range.c: Range#{min,max} extended to take an optional argument.
+ (range_min): Call range_first if the optional argument is given.
+ (range_max): Call rb_call_super if the optional argument is given.
- * numeric.c (rb_num2uint): should not check for value range if the
- source value is negative.
+ [ruby-core:57111] [Feature #8887]
-Mon Dec 1 17:14:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Feb 15 00:27:46 2014 Tanaka Akira <akr@fsij.org>
- * sample/optparse/opttest.rb: added.
+ * include/ruby/ruby.h,
+ internal.h,
+ ext/-test-/bignum/bigzero.c: Hide a Bignum definition.
+ [ruby-core:42891] [Feature #6083]
-Mon Dec 1 16:10:52 2003 Dave Thomas <dave@pragprog.com>
+Sat Feb 15 00:13:14 2014 Tanaka Akira <akr@fsij.org>
- * lib/rdoc/rdoc.rb: (etc) initial merge into main tree.
+ * include/ruby/intern.h,
+ include/ruby/io.h,
+ include/ruby/ruby.h,
+ include/ruby/win32.h,
+ include/ruby/backward/rubysig.h,
+ bignum.c,
+ gc.c,
+ io.c,
+ process.c,
+ safe.c,
+ struct.c,
+ thread.c,
+ ext/socket/rubysocket.h,
+ ext/-test-/old_thread_select: Remove deprecated definitions
+ [ruby-core:60581] [Feature #9502]
-Mon Dec 1 14:17:49 2003 Minero Aoki <aamine@loveruby.net>
+Fri Feb 14 18:38:46 2014 Eric Wong <e@80x24.org>
- * lib/fileutils.rb (fu_each_src_dest0): call #to_str to allow
- Pathname for arguments. [ruby-core:01795]
+ * string.c (rb_str_format_m): trade volatile for RB_GC_GUARD
+ RB_GC_GUARD meaning is clear and has better code generation.
+ [ruby-core:60688]
- * test/fileutils/test_fileutils.rb: does much strict test on
- "same" files detecting.
+Thu Feb 13 23:30:30 2014 Shugo Maeda <shugo@ruby-lang.org>
-Mon Dec 1 09:28:14 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): should check ci->me->flag of
+ a refining method in case the method is private.
+ [ruby-core:60111] [Bug #9452]
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): re-export $(XCFLAGS).
+ * vm_method.c (make_method_entry_refined): set me->flag of a refined
+ method entry to NOEX_PUBLIC in case the original method is private
+ and it is refined as a public method. The original flag is stored
+ in me->def->body.orig_me, so it's OK to make a refined method
+ entry public. [ruby-core:60111] [Bug #9452]
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (ARCH_FLAG): export $(ARCH_FLAG) (perhaps empty value).
+ * test/ruby/test_refinement.rb: related tests.
-Mon Dec 1 01:03:27 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Feb 13 18:38:15 2014 Eric Wong <e@80x24.org>
- * lib/mkmf.rb (TRY_LINK, link_command): added support for DLDFLAGS
- and ARCH_FLAG. [ruby-dev:22085]
+ * re.c (rb_reg_raise): remove volatile
+ Unnecessary since r41597
-Sun Nov 30 20:18:07 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Feb 13 18:28:51 2014 Eric Wong <e@80x24.org>
- * configure.in: keep ARCH_FLAG separate. export ARCH_FLAG.
- [ruby-core:01819]
+ * re.c (rb_reg_regcomp): remove volatile
+ Unnecessary since r13261
- * Makefile.in: add ARCH_FLAG to CFLAGS.
+Thu Feb 13 16:54:32 2014 Zachary Scott <e@zzak.io>
- * Makefile.in: add @CPPFLAGS@ to CPPFLAGS.
+ * test/ruby/test_array.rb: Ensure flatten! is used for test_flatten
+ Patch by @ksss [Fixes GH-530] https://github.com/ruby/ruby/pull/530
- * lib/mkmf.rb (link_command, cc_command): use ARCH_FLAG.
+Thu Feb 13 15:43:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (configuration): add ARCH_FLAG to DLDFLAGS.
+ * parse.y (IDSET_ATTRSET_FOR_INTERN): fix off-by-one bug.
- * Makefile.in: add ARCH_FLAG to DLDFLAGS.
+ * parse.y (rb_enc_symname_type): junk ID succeeded by '=' is also
+ attrset ID. [ruby-core:60668] [Bug #8756]
- * configure.in: should put getcwd in AC_CHECK_FUNCS, not
- AC_REPLACE_FUNCS. [ruby-core:01826]
+Thu Feb 13 11:06:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 30 18:22:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * configure.in: check if pthread_setname_np is available.
- * configure.in: do not override CCDLDFLAGS, LDFLAGS, XLDFLAGS,
- DLDFLAGS and LDSHARED.
+ * thread_pthread.c: pthread_setname_np is not available on old
+ Darwins. [ruby-core:60524] [Bug #9492]
- * configure.in: XCFLAGS for compiling ruby itself. ARCH_FLAG is
- reflected in CFLAGS.
+Thu Feb 13 00:56:59 2014 Masaki Matsushita <glass.saga@gmail.com>
- * lib/mkmf.rb: ditto. do not import XCFLAGS from config.status.
+ * configure.in: revert r44922. I should have used AC_CHECK_FUNCS()
+ to just define a symbol if the function is available.
-Sun Nov 30 17:37:36 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Feb 13 00:20:58 2014 Masaki Matsushita <glass.saga@gmail.com>
- * ext/tk/lib/tk.rb: bug fix [ruby-talk:86746]
+ * configure.in: use AC_CHECK_FUNC instead of AC_CHECK_FUNCS
+ if available.
-Sun Nov 30 13:02:00 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Feb 13 00:15:10 2014 Masaki Matsushita <glass.saga@gmail.com>
- * lib/soap/encodingstyle/soapHandler.rb: refactoring - Simplifying
- Conditional Expressions.
+ * configure.in: fix to undefine HAVE_MEMMEM correctly if it is broken.
- * lib/wsdl/soap/definitions.rb: refactoring - Move Method.
+Tue Feb 11 23:54:40 2014 Tanaka Akira <akr@fsij.org>
- * test/xsd/{test_noencoding.rb,noencoding.xml}: new files. test for
- encoding unspecified XML file parsing.
+ * bignum.c (rb_big_cmp): Specialize a comparison to zero.
- * test/wsdl/{test_fault.rb,map,datetime}: new files. test of
- SOAPFault, dateTime and Apache's Map.
+ * ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
+ RBIGNUM_NEGATIVE_P.
+ (BigMath_s_log): Ditto.
-Sun Nov 30 09:35:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 11 22:59:10 2014 Tanaka Akira <akr@fsij.org>
- * string.c (rb_str_update): get rid of SEGV at just allocated String.
- [ruby-core:01812]
+ * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use rb_integer_pack.
+ Fix SEGV by OpenSSL::BN.new(1 << (2**34)).
-Fri Nov 28 23:19:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Feb 11 17:00:38 2014 Zachary Scott <e@zzak.io>
- * gc.c (gc_mark): explicitly check mark recursion levels, instead
- of unreliable stack length.
+ * ext/tk/README.tcltklib: [DOC] Fix typo by @xta [Fixes GH-532]
-Fri Nov 28 22:49:56 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+Sun Feb 9 13:59:29 2014 Tanaka Akira <akr@fsij.org>
- * lib/rinda/rinda.rb: fix TupleSpaceProxy#read, read_all.
+ * configure.in: Fix compilation error.
+ https://bugs.ruby-lang.org/issues/8358#note-16
-Fri Nov 28 21:44:40 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sun Feb 9 05:20:24 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_fileutils.rb (test_ln_s): should be a file, not
- a directory for FreeBSD.
+ * configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting
+ types for 'qsort_r'" instead of AC_RUN_IFELSE.
-Fri Nov 28 19:37:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 9 04:07:34 2014 Zachary Scott <e@zzak.io>
- * hash.c (env_has_value, env_index): must match exactly.
+ * lib/yaml.rb: [DOC] Add links to syck and psych on github [Bug #9501]
+ Based on a patch by Giorgos Tsiftsis
- * test/ruby/test_env.rb (test_has_value, test_index): condition for
- aboves.
+Sun Feb 9 02:13:53 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Nov 28 17:59:20 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/ruby.h (OBJ_TAINTABLE, OBJ_TAINT, OBJ_INFECT),
+ marshal.c (r_entry0): all Numerics never be tainted now.
+ [ruby-core:57346] [Bug #8945]
- * test/ruby/test_env.rb: add tests for ENV.
+Sat Feb 8 23:40:35 2014 Vit Ondruch <vondruch@redhat.com>
-Fri Nov 28 17:47:46 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * configure.in: add quoting brackets and append wildcard for the
+ rest after target_cpu, to properly detect platform for SSE2
+ instructions. [ruby-core:60576] [Bug #8358]
- * lib/drb/drb.rb (DRbMessage#load): rescue Errno::* and raise
- DRbConnError.
+Sat Feb 8 21:44:07 2014 Masaki Matsushita <glass.saga@gmail.com>
-Fri Nov 28 15:41:15 2003 Tanaka Akira <akr@m17n.org>
+ * configure.in: check qsort_r(3) and whether it is GNU version.
+ BSD version has different prototype.
- * lib/pathname.rb (Pathname#realpath): obsolete the force_absolute
- argument.
+ * util.h: use qsort_r() as ruby_qsort() if it is GNU version.
-Fri Nov 28 14:41:52 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * util.c: define ruby_qsort() if needed.
- * lib/soap/streamHandler.rb: drop unused http parameters.
+Sat Feb 8 16:34:36 2014 Tanaka Akira <akr@fsij.org>
- * lib/soap/encodingstyle/soapHandler.rb, lib/soap/mapping/factory.rb,
- lib/soap/mapping/mapping.rb, lib/soap/mapping/registry.rb,
- lib/wsdl/soap/complexType.rb: ApacheSOAP's map support was broken
- under WSDL dynanic client environment. fixed.
+ * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder#get_labels):
+ Make it iterative.
- * test/wsdl/raa/*: add tests.
+Sat Feb 8 15:54:12 2014 Koichi Sasada <ko1@atdot.net>
- * lib/xsd/datatypes.rb: dateTime precision bug fix (at least, I hope.)
- bug of soap4r. XSDDateTimeImple.to_time passed a Float to
- Time.local/Time.gm as an usec, and NUM2LONG(rb_num2long for Float)
- causes rounding error.
+ * gc.c, gc.h (rb_objspace_marked_object_p): added.
+ This function *ONLY* works just after marking phase,
+ before any sweeping.
+ This function is highly depending current GC implementation
+ and can be removed future version.
- * test/soap/test_basetype.rb, test/xsd/test_xsd.rb: add tests.
+Sat Feb 8 15:41:37 2014 Tanaka Akira <akr@fsij.org>
-Fri Nov 28 04:15:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/resolv.rb: Don't set CLOEXEC flag explicitly. (Ruby set it by
+ default.)
- * eval.c (method_arity): used wrong Proc object. [ruby-talk:86504]
+Sat Feb 8 15:27:02 2014 Tanaka Akira <akr@fsij.org>
-Fri Nov 28 00:47:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder): Raise
+ DecodeError if no data before the limit.
+ Reported by Will Bryant. [ruby-core:60557] [Bug #9498]
- * eval.c (rb_f_exit), process.c (rb_f_exit_bang): treat true as
- success, false as failure. [ruby-dev:22067]
+Sat Feb 8 15:11:21 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (rb_f_abort, rb_thread_switch), process.c (rb_f_system): use
- ANSI macro instead of hard coded value.
+ * io.c (SMALLBUF): Unused macro removed.
- * eval.c (rb_f_exit), process.c (rb_f_exit_bang): use VALUEs not but
- TYPEs.
+Fri Feb 7 23:37:49 2014 Tanaka Akira <akr@fsij.org>
-Thu Nov 27 22:05:48 2003 Akinori MUSHA <knu@iDaemons.org>
+ * lib/resolv.rb: Ignore name servers which cause EAFNOSUPPORT on
+ socket creation.
+ Reported by Bjoern Rennhak. [ruby-core:60442] [Bug #9477]
- * eval.c, gc.c: FreeBSD/ia64 currently does not have a way for a
- process to get the base address for the RSE backing store, so
- hardcode it for the moment.
- [submitted by: Marcel Moolenaar <marcel@FreeBSD.org>]
+Fri Feb 7 21:58:48 2014 Zachary Scott <e@zzak.io>
-Thu Nov 27 17:36:42 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/open-uri.rb: [DOC] use lower case version of core classes, same
+ as commit r44878, based on patch by Jonathan Jackson [Bug #9483]
- * ext/tk/lib/tkafter.rb: bug fix on TkTimer#cancel_on_exception=(mode).
- TkTimer#wait recieves the exception of the callback.
- The exception is kept on @return_value.
+Fri Feb 7 21:54:53 2014 Zachary Scott <e@zzak.io>
-Thu Nov 27 16:58:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * ext/ripper/lib/ripper/lexer.rb: [DOC] use lower case version of core
+ classes when referring to return value, since we aren't directly
+ talking about the class. Patch by Jonathan Jackson [Bug #9483]
- * win32/win32.c (rb_w32_stat): remove _fullpath() for NUL: device.
+Fri Feb 7 05:28:38 2014 Eric Wong <e@80x24.org>
-Wed Nov 26 15:38:47 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * constant.h: reduce rb_const_entry_t size on 64-bit
+ Patch by Adam Avilla [ruby-core:60542] [Feature #9496]
- * test/fileutils/test_fileutils.rb (test_ln_s): should take the
- existing symbolic link for OpenBSD.
+Thu Feb 6 15:27:46 2014 Koichi Sasada <ko1@atdot.net>
-Wed Nov 26 04:48:42 2003 why the lucky stiff <why@ruby-lang.org>
+ * gc.c (get_envparam_int): correct warning messages.
- * ext/syck/token.c: removed YYTOKTMP references which
- were causing buffer overflows on large block scalars,
- comments, quoted scalars and plain scalars.
+ * gc.c (get_envparam_double): ditto.
- * ext/syck/rubyext.c: dynamic changing of buffer size.
+Thu Feb 6 15:17:30 2014 Koichi Sasada <ko1@atdot.net>
- * ext/syck/syck.h: default buffer size of 4k.
+ * gc.c (get_envparam_int): don't accept a value equals to lowerbound
+ (changed by last commit) because "" or "foo" (not a number) strings
+ are parsed as 0. They should be rejected.
-Wed Nov 26 00:55:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * gc.c (get_envparam_double): ditto.
- * lib/webrick/httpresponse.rb: add HTTPResponse#keep_alive=.
+Thu Feb 6 09:00:35 2014 Koichi Sasada <ko1@atdot.net>
- * lib/webrick/httpserver.rb (HTTPServer#run): should pass the
- request's keep_alive flag to the response.
+ * gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,
+ then set objspace->rgengc.oldmalloc_increase_limit.
+ Without this fix, the env variable RUBY_GC_OLDMALLOC_LIMIT
+ does not work.
-Tue Nov 25 21:41:35 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * gc.c (get_envparam_int): accept a value equals to lowerbound.
- * defines.h (ENV_IGNORECASE): should define when DOSISH without
- human68k. [ruby-dev:22047]
+ * gc.c (get_envparam_double): ditto.
- * hash.c (env_has_value, env_index): don't ignore case of value.
- [ruby-dev:22048]
+Thu Feb 6 08:23:28 2014 Eric Wong <e@80x24.org>
-Tue Nov 25 21:39:37 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/thread/thread.c (rb_szqueue_max_set): use correct queue and
+ limit wakeups. [Bug #9343][ruby-core:60517]
+ * test/thread/test_queue.rb (test_sized_queue_assign_max):
+ test for bug
- * file.c (path_check_1): honor sticky bits always.
- [ruby-talk:86273]
+Thu Feb 6 07:18:01 2014 Eric Hodel <drbrain@segment7.net>
-Tue Nov 25 20:02:14 2003 Minero Aoki <aamine@loveruby.net>
+ * lib/rubygems: Update to RubyGems 2.2.2. Complete history at:
- * test/fileutils/test_fileutils.rb: do test in more deep
- directory.
+ http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05
- * test/fileutils/test_nowrite.rb: ditto.
+ * test/rubygems: ditto.
-Tue Nov 25 19:04:23 2003 Tanaka Akira <akr@m17n.org>
+Wed Feb 5 20:56:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/open-uri.rb (URI::Generic#find_proxy): ENV case sensitivity test
- refined.
+ * marshal.c (to_be_skipped_id): ignore anonymous attributes.
-Tue Nov 25 18:13:30 2003 Minero Aoki <aamine@loveruby.net>
+ * pack.c (Init_pack): use anonymous ID so that associated objects
+ do not appear in the packed result.
- * test/fileutils/test_fileutils.rb: chdir Dir.tmpdir before each
- test. [ruby-dev:22045]
+ * parse.y (rb_make_internal_id): return an anonymous ID for
+ internal use.
- * test/fileutils/test_nowrite.rb: ditto.
+Wed Feb 5 14:41:56 2014 Koichi Sasada <ko1@atdot.net>
-Tue Nov 25 17:52:11 2003 Tanaka Akira <akr@m17n.org>
+ * vsnprintf.c: remove duplicated def of `UNINITIALIZED_VAR()'.
- * lib/open-uri.rb (URI::Generic#find_proxy): use http_proxy under CGI
- if the environment variable is case sensitive.
+Wed Feb 5 14:40:16 2014 Koichi Sasada <ko1@atdot.net>
-Tue Nov 25 16:41:33 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/objspace/objspace_dump.c (dump_object): use STR_SHARED_P()
+ instead of removed STR_NOCAPA_P() macro.
- * test/wsdl/multiplefault.wsdl, test/wsdl/test_multiplefault.rb:
- removed. this test requires extra libraries in soap4r/1.5.*.
+Wed Feb 5 13:51:33 2014 Koichi Sasada <ko1@atdot.net>
-Tue Nov 25 16:24:42 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * internal.h, vm_core.h: move LIKELY/UNLIKELY/UNINITIALIZED_VAR()
+ macros from vm_core.h to internal.h.
- * lib/soap/**/*.rb, lib/wsdl/**/*.rb, lib/xsd/**/*.rb: changed license;
- GPL2 -> Ruby's.
+ * string.c: remove dependency to "vm_core.h".
- * lib/soap/rpc/driver.rb, lib/soap/wsdlDriver.rb,
- lib/soap/streamHandler.rb: add interface to streamhandler.
+ * common.mk: ditto.
- * lib/soap/marshal.rb: raise error if parse fails.
+Wed Feb 5 13:29:01 2014 Koichi Sasada <ko1@atdot.net>
- * lib/soap/netHttpClient.rb: add https support. Patched by
- Oliver M. Bolzer.
+ * string.c (rb_str_free): use FL_TEST(str, STR_SHARED) directly
+ because str is not embed.
- * lib/soap/netHttpClient.rb: dump HTTP response message body by itself.
+ * string.c (str_replace): remove `FL_SET(str, STR_SHARED)' line
+ because STR_SET_SHARED() set STR_SHARED.
- * lib/soap/rpc/driver.rb, lib/soap/rpc/proxy.rb,
- lib/soap/wsdlDriver.rb: add driver#mandatorycharset interface to foce
- using charset for parsing response from buggy server.
+Wed Feb 5 13:18:08 2014 Koichi Sasada <ko1@atdot.net>
- * lib/soap/encodingstyle/soapHandler.rb: support Apache Axis's half
- typed multi-ref array.
+ * internal.h: remove macros STR_NOCAPA and STR_NOCAPA_P().
- * lib/soap/mapping/factory.rb, lib/soap/mapping/registry.rb: map
- SOAPStruct which has multi-accessors which name are the same, to an
- array.
+ * string.c (rb_str_resize): remove `STR_SET_NOEMBED(str)' because
+ str_make_independent_expand() set NOEMBED flag.
- * lib/soap/rpc/element.rb: fixed illegal parameter order.
+ * string.c (rb_str_resize): remove `STR_NOCAPA_P(str)' check because
+ `str' is independent (not shared).
- * lib/soap/rpc/element.rb: element name of response message could have
- the name other than 'return'.
+Wed Feb 5 12:54:25 2014 Koichi Sasada <ko1@atdot.net>
- * lib/wsdl/operation.rb, lib/wsdl/operationBinding.rb,
- lib/wsdl/soap/classDefCreator.rb, lib/wsdl/soap/methodDefCreator.rb,
- lib/wsdl/soap/methodDefCreatorSupport.rb: WSDL/1.1 allows plural
- fault definition in a operation. [ruby-talk:84948]
+ * string.c: refactoring, especially about string flags.
- * test/wsdl/multiplefault.wsdl, test/wsdl/test_multiplefault.rb: add
- test for above fix.
+ * string.c (STR_UNSET_NOCAPA): removed.
+ Use FL_UNSET() with STR_SHARED.
- * lib/wsdl/soap/complexType.rb: support WSDL array definition with
- maxOccures="unbound".
+ * string.c (rb_str_capacity): check STR_SHARED directly
+ because it is not a embed string.
- * lib/xsd/charset.rb: use cp932 under emx. Patched by
- Siena. / SHINAGAWA, Norihide in [ruby-dev:21972]
+ * string.c (rb_str_modify_expand): ditto.
- * lib/xsd/xmlparser/parser.rb: set @charset nil by default. Nil means
- 'follow encoding declaration in XML'.
+ * string.c (rb_str_shared_replace): use STR_SET_SHARED().
- * sample/soap/digraph.rb, sample/wsdl/amazon/wsdlDriver.rb,
- sample/wsdl/googleSearch/sampleClient.rb,
- sample/wsdl/googleSearch/wsdlDriver.rb,
- test/wsdl/test_emptycomplextype.rb,
- test/wsdl/marshal/test_wsdlmarshal.rb,
- test/xsd/test_xmlschemaparser.rb: use File.open(...) { |f| f.read }
- instead of File.open(...).read. [ruby-dev:21964]
+ * string.c (str_make_independent_expand): remove STR_UNSET_NOCAPA()
+ because `str' is not shared string.
- * test/wsdl/emptycomplextype.wsdl, test/wsdl/test_emptycomplextype.rb:
- simplify the test case.
+Wed Feb 5 12:11:04 2014 Koichi Sasada <ko1@atdot.net>
- * test/wsdl/axisArray/*: add tests for axis's array encoding.
+ * string.c (RESIZE_CAPA): should not resize shared string.
-Tue Nov 25 16:15:29 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Feb 5 11:46:42 2014 Koichi Sasada <ko1@atdot.net>
- * ruby.h: don't treat Cygwin as Windows.
+ * gc.c (gc_mark_children): STR_ASSOC is no longer available.
+ Reported by @nagachika.
+ http://d.hatena.ne.jp/nagachika/20140204
-Tue Nov 25 15:18:28 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Feb 5 11:27:22 2014 Koichi Sasada <ko1@atdot.net>
- * configure.in: change default value of --enable-pthread (default: no)
+ * string.c (rb_str_new_frozen): refactoring code.
+ * Move code from str_new_frozen_with_klass() (and remove it)
+ * `aux.shared' should not be 0 for STR_SHARED strings.
-Tue Nov 25 07:31:16 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 5 04:23:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * parse.y (primary): allow newlines just before right argument
- parenthesis. (ruby-bugs:PR#1221)
+ * ext/psych/lib/psych.rb: New release of psych.
+ * ext/psych/psych.gemspec: ditto
-Mon Nov 24 23:32:06 2003 Tanaka Akira <akr@m17n.org>
+Wed Feb 5 04:16:41 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/open-uri.rb (OpenURI.open_loop, URI::HTTP#proxy_open): use
- catch/throw for redirection instead of exception.
- (OpenURI.open_loop, OpenURI.redirectable?): restrict redirection.
+ * ext/psych/yaml/emitter.c: merge libyaml 0.1.5
+ * 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_private.h: ditto
-Mon Nov 24 19:59:48 2003 Tanaka Akira <akr@m17n.org>
+Tue Feb 4 19:10:29 2014 Koichi Sasada <ko1@atdot.net>
- * lib/open-uri.rb (URI::Generic#find_proxy): use CGI_HTTP_PROXY
- instead of HTTP_PROXY in the CGI environment.
+ * string.c: use long allocator names instead of numbered
+ allocator names.
+ * rb_str_new2 -> rb_str_new_cstr
+ * rb_str_new4 -> rb_str_new_frozen
+ * rb_str_new5 -> rb_str_new_with_class
+ * str_new3 -> str_new_shared
+ * str_new4 -> str_new_frozen_with_klass
-Mon Nov 24 19:32:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Feb 4 17:20:03 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/etc/extconf.rb: check for pw_passwd in struct passwd and
- gr_passwd in struct group for DJGPP.
+ * dir.c (glob_helper): return the filename with actual cases on
+ the filesystem if it is case-insensitive. [ruby-core:42469]
+ [Feature #5994]
- * ext/etc/etc.c: ditto.
+Tue Feb 4 16:16:58 2014 Koichi Sasada <ko1@atdot.net>
- * ext/Setup.dj: support for curses, etc, zlib.
+ * string.c: use STR_SHARED instead of ELTS_SHARED.
+ (same value, but more clear meaning)
-Mon Nov 24 17:00:00 2003 Tanaka Akira <akr@m17n.org>
+Tue Feb 4 16:09:14 2014 Koichi Sasada <ko1@atdot.net>
- * lib/open-uri.rb: validate option names.
- :content_length_proc and :progress_proc option implemented.
+ * string.c: remove STR_ASSOC related code.
+ By r44804, string objects can not have STR_ASSOC flag.
-Mon Nov 24 14:53:10 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * internal.h: ditto.
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): output empty value instead of `-DRUBY_EXPORT'.
+ * ext/objspace/objspace_dump.c (dump_object): ditto.
-Sat Nov 22 23:09:45 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Tue Feb 4 14:07:20 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: set enable_pthread to no on MinGW.
+ * pack.c (str_associate, str_associated): keep associated objects
+ in an instance variables, instead of in the internal structure.
-Sat Nov 22 22:56:20 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * string.c (rb_str_associate, rb_str_associated): deprecate.
- * configure.in: add --enable-pthread option (default: yes)
+Tue Feb 4 12:55:31 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 22 22:48:46 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * string.c (rb_str_modify_expand): enable capacity and disable
+ association with packed objects when setting capa, so that
+ pack("p") string fails to unpack properly after modified.
- * ext/tk/lib/tk.rb: add Tk.grab_release and fix bug of TkComposite
+Tue Feb 4 12:45:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/lib/tkafter.rb: bug fix of TkAfter#start
+ * dir.c (glob_make_pattern): all alphabets are magic characters on
+ case-insensitive filesystems. [ruby-core:42469] [Feature #5994]
- * ext/tk/sample/tkcombobox.rb: new sample script
+Tue Feb 4 09:47:57 2014 Eric Hodel <drbrain@segment7.net>
- * ext/tcltklib/tcltklib.c: add native thread check
+ * lib/rubygems: Update to RubyGems 2.2.2 prerelease to check fixes to
+ CI.
+ * test/rubygems: ditto.
-Sat Nov 22 18:49:47 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Feb 3 12:04:47 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/curses/curses.c (window_nodelay): nodelay() of NetBSD's
- libcruses returns no value, just like keypad().
+ * error.c: [DOC] Exception#cause may return nil. [ci skip]
-Sat Nov 22 17:36:36 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Feb 2 05:48:42 2014 Eric Wong <e@80x24.org>
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (HAVE_GETCWD): output to config.h.
+ * io.c (rb_io_syswrite): add RB_GC_GUARD
+ [Bug #9472][ruby-core:60407]
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub
- (XCFLAGS): output to config.status.
+Sat Feb 1 15:09:16 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Sat Nov 22 13:10:10 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/win32ole/win32ole.c (ole_typedesc2val): add VT_RECORD case.
- * lib/fileutils.rb (have_st_ino?): djgpp has valid st_ino.
+Sat Feb 1 06:38:51 2014 Zachary Scott <e@zzak.io>
-Sat Nov 22 11:28:48 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/drb/drb.rb: [DOC] Add note about start_service for each process
+ Based on a patch by @rosenfeld [Fixes GH-514] [ci skip]
+ https://github.com/ruby/ruby/pull/514
- * gc.c (Init_stack): stack region is far smaller than usual if
- pthread is used.
+Sat Feb 1 06:30:20 2014 Zachary Scott <e@zzak.io>
-Sat Nov 22 07:30:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * error.c: [DOC] Document Exception#cause by @jasonrclark [ci skip]
+ [Fixes GH-519] https://github.com/ruby/ruby/pull/519
- * lib/test/unit/util/backtracefilter.rb: fixed a bug that occurred
- when an exception had no backtrace.
+Sat Feb 1 06:10:49 2014 Zachary Scott <e@zzak.io>
- * test/testunit/util/test_backtracefilter.rb: ditto.
+ * lib/securerandom.rb: [DOC] Add note on require for examples
+ Based on a patch by @schneems [Fixes GH-518] [ci skip]
+ https://github.com/ruby/ruby/pull/518
-Fri Nov 21 16:44:18 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Feb 1 06:04:56 2014 Zachary Scott <e@zzak.io>
- * ext/tk/lib/tkentry.rb: fix the encoding trouble of percent
- substitutions on validatecommand option of TkEntry widget
+ * numeric.c: [DOC] Fix typo in example for #step [ci skip]
+ Patch by @ksss [Fixes GH-522] https://github.com/ruby/ruby/pull/522
- * ext/tk/lib/tk.rb: fix bug on {pack|grid}_propagate() method
+Fri Jan 31 17:01:47 2014 Eric Wong <e@80x24.org>
-Fri Nov 21 16:12:11 2003 Akinori MUSHA <knu@iDaemons.org>
+ * ext/socket/init.c (rsock_socket0): split out SOCK_CLOEXEC version
+ * ext/socket/socket.c (rsock_socketpair0): ditto
+ [ruby-core:60377]
- * ruby.1: Fix markups and grammar.
+Fri Jan 31 03:48:40 2014 Eric Wong <e@80x24.org>
-Fri Nov 21 14:49:42 2003 Minero Aoki <aamine@loveruby.net>
+ * benchmark/driver: avoid large alloc in driver process
+ [ruby-core:59869] [Bug #9430]
- * ruby.1: wrote about ruby related environment variables.
+Thu Jan 30 14:45:49 2014 Shugo Maeda <shugo@ruby-lang.org>
-Fri Nov 21 12:28:03 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * configure.in: use $@ instead of $(.TARGET) because .TARGET is not
+ supported by GNU make.
- * marshal.c (w_extended): singleton methods should not be checked
- when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
+Thu Jan 30 08:26:21 2014 Yusuke Endoh <mame@tsg.ne.jp>
-Fri Nov 21 01:40:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978].
- * configure.in: check <pthread.h>
+Wed Jan 29 20:08:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.h: include pthread.h if existence.
- define is_ruby_native() macro when not HAVE_NATIVETHREAD
+ * io.c (nogvl_copy_stream_sendfile): check socket on other than
+ linux, as sendfile(2) on non-socket fd works only on linux.
+ [Feature #9427]
- * eval.c: undef is_ruby_native() function when not HAVE_NATIVETHREAD
+Wed Jan 29 18:09:48 2014 Eric Wong <e@80x24.org>
-Fri Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * io.c (nogvl_copy_stream_sendfile): remove socket check
+ [ruby-core:59856][Feature #9427]
- * lib/test/unit/assertions.rb: use #__send__ instead of #send.
+Wed Jan 29 04:29:54 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/test/unit/testcase.rb: ditto.
+ * ext/openssl/ossl_ssl.c: pass read_nonblock options to underlying IO
+ when SSL session has not been started.
-Thu Nov 20 19:19:22 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * test/openssl/test_ssl.rb: test for change.
- * configure.in: don't find the Cygwin's pthread library on MinGW.
+Wed Jan 29 03:49:36 2014 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Nov 20 19:15:50 2003 Minero Aoki <aamine@loveruby.net>
+ * ext/fiddle/closure.c: use sizeof(*pcl) for correct sizeof value.
+ [ruby-core:57599] [Bug #8978]. Thanks mame!
- * lib/fileutils.rb (have_st_ino?): emx (OS/2 with EMX) does not
- have st_ino (always 0). [ruby-dev:21972]
+Wed Jan 29 03:36:42 2014 Eric Wong <e@80x24.org>
- * lib/fileutils.rb (rename_cannot_overwrite_file?): emx does not
- allow overwriting files by rename(2).
+ * doc/contributing.rdoc: allow/encourage other git hosts
+ [ruby-core:59807][misc #9421]
- * test/fileutils/test_fileutils.rb: windows? ->
- have_drive_letter?, have_file_perm?
+Tue Jan 28 23:36:01 2014 Tanaka Akira <akr@fsij.org>
-Thu Nov 20 17:50:58 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * ext/socket: Avoid redundant fcntl/fstat syscalls for cloexec
+ sockets.
+ Patch by Eric Wong. [ruby-core:59429] [Feature #9330]
- * ext/tk/sample/tkballoonhelp.rb: new sample script
+Tue Jan 28 20:51:07 2014 Tanaka Akira <akr@fsij.org>
- * ext/tk/sample/tkmultilistbox.rb: ditto
+ * process.c (READ_FROM_CHILD): Apply the last hunk of
+ 0001-process.c-avoid-EINTR-from-Process.spawn.patch written by
+ Eric Wong in [Bug #8770].
- * ext/tk/sample/tktextframe.rb: ditto
+Tue Jan 28 16:31:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 20 13:37:34 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * thread_pthread.c (ruby_init_stack, ruby_stack_overflowed_p):
+ place get_stack above others to get stack boundary information.
+ [ruby-core:60113] [Bug #9454]
- * ruby.h: define is_ruby_native_thread() for no native thread
- environment
+Tue Jan 28 15:27:36 2014 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c: ditto
+ * thread_pthread.c: rlimit is only available on Linux.
+ At least r44712 breaks FreeBSD.
+ [ruby-core:60113] [Bug #9454]
-Thu Nov 20 12:42:47 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Jan 28 15:17:59 2014 Zachary Scott <e@zzak.io>
- * configure.in: always check existence of the pthread library
+ * lib/set.rb: [DOC] Add examples for Set#intersect? and Set#disjoint?
+ Patch by xavier nayrac [Bug #9331] [ci skip]
- * ruby.h: define macros for ruby's native thread check
+Tue Jan 28 15:12:22 2014 Zachary Scott <e@zzak.io>
- * eval.c: add ruby's native thread check
+ * ext/zlib/zlib.c (rb_zlib_adler32): [DOC] Add example for adler32
+ Patch by Vajrasky Kok [Bug #9307] [ci skip]
- * gc.c: ditto
+Tue Jan 28 08:56:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
-Wed Nov 19 14:45:18 2003 Minero Aoki <aamine@loveruby.net>
+ * compile.c (iseq_build_from_ary_body): Use :blockptr instead of :block
+ as hash key when loading serialized instruction sequences from arrays.
+ [Bug #9455] [ruby-core:60146]
- * lib/net/http.rb (to_ary): print more friendly warning message.
+Mon Jan 27 21:52:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 19 14:32:08 2003 Minero Aoki <aamine@loveruby.net>
+ * thread_pthread.c: get current main thread stack size, which may
+ be expanded than allocated size at initialization, by rlimit().
+ [ruby-core:60113] [Bug #9454]
- * lib/fileutils.rb (fu_same?): add djgpp and wince.
+Sat Jan 25 22:17:02 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/fileutils.rb (cannot_overwrite_file?): add wince.
+ * README.ja.md, README.md: update the controller address of
+ mailing lists.
-Wed Nov 19 11:04:47 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jan 25 14:50:42 2014 Eric Wong <normalperson@yhbt.net>
- * lib/fileutils.rb (cannot_overwrite_file?, have_st_ino?): bccwin32
- is same as mswin32.
+ * process.c (send_child_error): retry write on EINTR to fix
+ occasional Errno::EINTR from Process.spawn.
-Wed Nov 19 07:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * process.c (recv_child_error): retry read on EINTR to fix
+ occasional Errno::EINTR from Process.spawn.
- * lib/test/unit.rb: do not run tests if $! is set.
+Sat Jan 25 14:21:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/assertionfailederror.rb: extend StandardError instead
- Exception (irb catches the former but not the latter).
+ * compile.c (iseq_compile_each): result of assignment should be
+ its rhs instead of returned value from a method.
+ [ruby-core:60071] [Bug #9448]
-Tue Nov 18 23:31:36 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Sat Jan 25 11:16:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * missing/memmove.c (memmove): take void *, not char *.
+ * class.c (rb_extract_keywords): treat nil keyword_hash same as 0,
+ for the case rb_scan_args returns nil if no keyword hash.
- * missing.h (memmove): ditto.
+Fri Jan 24 15:13:20 2014 Zachary Scott <e@zzak.io>
- * missing.h (strchr, strrchr): return char *, not int.
+ * lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos
+ Patch by Giorgos Tsiftsis [Bug #9429] [ci skip]
-Tue Nov 18 22:20:10 2003 Minero Aoki <aamine@loveruby.net>
+Thu Jan 23 20:20:17 2014 Koichi Sasada <ko1@atdot.net>
- * lib/fileutils.rb (fu_same?): temporal fix for windows.
+ * test/ruby/envutil.rb: try to wait a bit (0.1sec) when ruby process
+ exits by signals because some SEGV tests fail because of not enough
+ error output.
-Tue Nov 18 19:05:04 2003 Minero Aoki <aamine@loveruby.net>
+Thu Jan 23 20:06:27 2014 Koichi Sasada <ko1@atdot.net>
- * lib/fileutils.rb (fu_same?): check by inode instead of path
- name, to detect two hard links pointing to the same content.
+ * test/ruby/test_settracefunc.rb: check the target thread.
- * test/fileutils.rb: did not create correctly looped symlinks.
+Thu Jan 23 19:59:16 2014 Koichi Sasada <ko1@atdot.net>
-Tue Nov 18 18:23:05 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: check the target thread.
- * ext/stringio/stringio.c (strio_read): behave as IO at empty string.
- [ruby-dev:21939], [ruby-dev:21941]
+Thu Jan 23 14:26:44 2014 Zachary Scott <e@zzak.io>
- * ext/stringio/stringio.c (strio_getc, strio_getline): set EOF flag.
+ * lib/fileutils.rb: [DOC] Fix typo in options_of() example [Bug #9392]
+ Patch by Giorgos Tsiftsis
- * ext/stringio/stringio.c (strio_rewind, strio_seek, strio_ungetc):
- clear EOF flag.
+Thu Jan 23 13:56:16 2014 Zachary Scott <e@zzak.io>
- * test/stringio/test_stringio.rb: imported from [ruby-dev:21941].
+ * README -> README.md: [DOC] Format README with Markdown [Bug #9255]
+ * README.ja -> README.ja.md: ditto
-Tue Nov 18 14:06:35 2003 Minero Aoki <aamine@loveruby.net>
+Wed Jan 22 15:59:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (fu_each_src_dest): raise if src==dest.
- [ruby-talk:85344] [ruby-core:01699]
+ * ext/thread/thread.c (Init_thread): ConditionVariable and Queue
+ are not able to copy. [ruby-core:59961] [Bug #9440]
- * lib/fileutils.rb: use Object#is_a? instead of Class#=== to allow
- e.g. remote objects for receivers.
+Tue Jan 21 20:14:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb: FileTest -> File.
+ * thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
+ where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
+ constant. [ruby-dev:47911] [Bug #9436]
- * lib/fileutils.rb: put parentheses for arguments of File.xxxx?
+Tue Jan 21 17:55:09 2014 Zachary Scott <e@zzak.io>
- * test/fileutils/test_fileutils.rb (test_cp): test "cp a a".
+ * lib/uri/common.rb: [DOC] Use static w3.org uri [ci skip]
+ Patch by @ykzts [Fix GH-484] https://github.com/ruby/ruby/pull/484
- * test/fileutils/test_fileutils.rb (test_mv): test "mv a a".
+Tue Jan 21 16:43:22 2014 Zachary Scott <e@zzak.io>
- * test/fileutils/test_fileutils.rb (test_ln): test "ln a a".
+ * enum.c: [DOC] Add simple example of Enumerable#zip [ci skip]
+ Patch by @nruth on documenting-ruby/ruby#22
+ https://github.com/documenting-ruby/ruby/pull/22
- * test/fileutils/test_fileutils.rb (test_ln_s): test "ln_s a a".
+Tue Jan 21 16:26:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/fileutils/test_fileutils.rb (test_install): test "install a a".
+ * thread_pthread.c (rb_thread_create_timer_thread): expand timer
+ thread stack size to get rid of segfault on FreeBSD/powerpc64.
+ based on the patch by Steve Wills at [ruby-core:59923].
+ [ruby-core:56590] [Bug #8783]
- * test/fileutils/fileasserts.rb: new method assert_symlink.
+Tue Jan 21 04:31:23 2014 Tanaka Akira <akr@fsij.org>
- * test/fileutils/fileasserts.rb: assert_is_directory -> assert_directory.
+ * ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
+ IP_MULTICAST_TTL on Mac OS X and Windows.
-Mon Nov 17 19:38:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Tue Jan 21 00:39:15 2014 Tanaka Akira <akr@fsij.org>
- * file.c (getcwdofdrv): avoid using getcwd() directly, use
- my_getcwd() instead.
+ * ext/socket/option.c: Use "byte" as default argument for
+ IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
+ the original multicast implementation.
- * merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
- <sunshine@sunshineco.com>. [ruby-core:01596]
+Mon Jan 20 20:20:27 2014 Tanaka Akira <akr@fsij.org>
-Mon Nov 17 10:50:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/option.c: Use preprocessor macros to avoid repeated
+ conditionals.
- * lib/optparse.rb (OptionParser::Completion::complete): allow least
- common completion for three or more candidates.
+Mon Jan 20 13:55:03 2014 Zachary Scott <e@zzak.io>
-Mon Nov 17 09:41:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rubygems/version.rb: [DOC] Use gender-neutral pronouns [ci skip]
+ * lib/rubygems/security.rb: ditto
- * lib/test/unit/ui/tk/testrunner.rb,
- lib/test/unit/ui/gtk/testrunner.rb:
- run GUI main loop in sub thread.
+Sun Jan 19 06:38:48 2014 Benoit Daloze <eregontp@gmail.com>
- * lib/test/unit/ui/gtk2/testrunner.rb: imported from rough.
+ * compar.c (cmp_equal): warn for this release and still rescue
+ standard exceptions for a nicer transition. See #7688.
+ Partly reverts r44502.
- * lib/test/unit/autorunner.rb (keyword_display): sort keywords.
+ * test/ruby/test_comparable.rb: adapt assertion to match new behavior.
-Sun Nov 16 18:10:57 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jan 19 06:27:18 2014 Benoit Daloze <eregontp@gmail.com>
- * eval.c (rb_eval): iterator should return value from next inside
- begin/rescue/end. (ruby-bugs:PR#1218)
+ * test/ruby/test_comparable.rb: specify behavior for the different
+ kind of exceptions rescued (or not) by Comparable#==.
-Sun Nov 16 13:26:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jan 18 23:12:19 2014 Tanaka Akira <akr@fsij.org>
- * marshal.c (w_object): LINK check earlier than anything else,
- i.e. do not dump TYPE_IVAR for already dumped objects.
- (ruby-bugs:PR#1220)
+ * ext/socket: Avoid unnecessary ppoll/select on Linux.
+ Patch by Eric Wong. [ruby-core:57950] [Bug #9039]
- * eval.c (rb_eval): call "inherited" only when a new class is
- generated; not on reopening.
+Sat Jan 18 22:57:44 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (eval): prepend error position in evaluating string to
- "mesg" attribute string only when it's available and is a
+ * lib/resolv.rb (Resolv::DNS::Resource::TXT#data): Return concatenated
string.
+ Patch by Ryan Brunner. [ruby-core:58220] [Bug #9093]
-Sun Nov 16 12:16:10 2003 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/protocol.rb: logging response body. [experimental]
- [ruby-list:38800]
-
-Sun Nov 16 10:49:38 2003 Gavin Sinclair <gsinclair@soyabean.com.au>
-
- * lib/thread.rb (Thread.exclusive): wrap method definition in
- class Thread to enable rdoc to process.
-
-Sun Nov 16 09:45:23 2003 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (set_debug_output): warn if method is called
- after #start. [ruby-dev:38798]
-
-Sun Nov 16 04:41:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (eval): do not re-raise exception to avoid unnecessary
- exception copying, instead modify exception and internal
- information to adjust eval().
-
- * eval.c (backtrace): can return the current frame information
- only if lev < -1.
-
-Sat Nov 15 22:16:42 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * /ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext):
- refine error message.
-
-Sat Nov 15 10:05:40 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI.open_loop, OpenURI::HTTP#proxy_open):
- refactored to support options.
- (Buffer): maintain size by this class.
-
-Sat Nov 15 07:40:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_method_node): new API to retrieve method body.
-
-Fri Nov 14 13:21:30 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: fix (en-bugged at 2003/11/07)
-
- * ext/tk/lib/tkdialog.rb: TkDialog.new accepts a parent widget
- argument [ruby-talk:85066]
-
-Thu Nov 13 20:53:35 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (Kernel[#.]open): hard coded URI schemes removed.
- [ruby-ext:02251]
-
-Thu Nov 13 19:17:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * lib/test/unit/ui/tk/testrunner.rb: use grid and panedwindow
- (if available)
-
-Thu Nov 13 17:56:41 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/open-uri.rb (OpenURI.open_uri): use File::RDONLY.
- reported by Take_tk <ggb03124@nifty.ne.jp>.
- [ruby-ext:02245]
-
-Thu Nov 13 16:45:53 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509req.c (ossl_x509req_to_der): add function for
- X509::Request#to_der.
-
-Thu Nov 13 11:31:14 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::Completion#complete): prior shorter
- name to containing longer name.
-
-Thu Nov 13 06:08:54 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: stop freezing some classes
-
- * ext/tk/lib/multi-tk.rb: ditto.
-
-Wed Nov 12 17:32:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/assertions.rb (assert_throws, assert_nothing_thrown):
- uncaught throw in sub thread raises ThreadError.
-
- * lib/test/unit/ui/tk/testrunner.rb (setup_ui): "expand" is not
- necessary.
-
-Wed Nov 12 14:09:43 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/monitor/test_monitor.rb: fix the timing problem by Queue.
-
-Wed Nov 12 12:59:44 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/monitor/test_monitor.rb: added.
-
-Wed Nov 12 10:14:28 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/monitor.rb: refactored. Thanks, Gennady Bystritsky.
-
-Wed Nov 12 06:11:39 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.c (ossl_x509_sk2ary, ossl_x509crl_sk2ary):
- add functions to convert STACK into Array.
-
- * ext/openssl/ossl.h: add prototypes.
-
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_set_certificates,
- ossl_pkcs7_get_certificates, ossl_pkcs7_get_crls,
- ossl_pkcs7_set_crls): add functions for PKCS7#certificates=
- PKCS7#certificates, PKCS7#crls= and PKCS7#crls.
-
-Wed Nov 12 00:47:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/ui/testrunnermediator.rb: should require 'test/unit'.
-
-Tue Nov 11 23:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/ui/gtk/testrunner.rb: added a rescue clause to handle
- the case when the requested font is not available.
-
-Tue Nov 11 22:44:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (appendline): file may not end with newline. a bug if
- READ_DATA_PENDING_PTR is defined. [ruby-talk:84925]
-
-Tue Nov 11 10:42:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: raise an exception when creating TkWindow
- object, because TkWindow class is an abstract class.
-
-Tue Nov 11 03:30:43 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/ext/openssl/ossl_conf.c (ossl_config_get_value): return nil
- if the specified value doesn't exist.
-
- * lib/ext/openssl/ossl_conf.c (ossl_config_get_section): return
- a empty hash if the specified section doesn't exist.
-
-Mon Nov 10 11:40:29 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/monitor.rb (wait): return true on signal/broadcastfalse and
- false on timeout. Thanks Gennady Bystritsky.
-
-Mon Nov 10 00:07:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (primary): primary_value may be 0 when syntax error.
- [ruby-talk:84893]
-
-Sun Nov 9 02:05:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: un-deprecated #assert_not_nil to
- maintain symmetry with #assert_nil. Also added better output for
- #assert_kind_of.
-
- * test/testunit/tc_assertions.rb: ditto.
-
-Sat Nov 8 18:50:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/wsdl/raa/*: add new testcase for WSDL loading, parsing and
- reading.
-
- * test/soap/marshal/*: backport from soap4r/1.5.1. all differences are
- for ruby/1.6.
-
- * lib/soap/*: backport from soap4r/1.5.1. all differences are for
- ruby/1.6.
-
- * lib/wsdl/data.rb, lib/wsdl/xmlSchema/data.rb: move definition of
- ArrayTypeAttrName from ::WSDL::XMLSchema::* to ::WSDL::*.
- [ruby-talk:84813]
-
- * lib/wsdl/soap/definitions.rb: element name typo in custom exception
- struct definition which is needed for wsdlDriver; camelCase ->
- underscore_name.
-
-Sat Nov 8 13:49:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * configure.in: improvement of pthread check
-
-Sat Nov 8 13:28:46 2003 Takaaki Tateishi <ttate@ttsky.net>
-
- * ext/dl/sym.c: Add DL.win32_last_error and DL.last_error.
- Thanks, Kaoru Shirai.
-
-Sat Nov 8 06:19:38 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: To fix 'pthread-enabled Tcl/Tk' problem,
- TclTkIp#_eval calls Tcl_Eval() on the mainloop thread only
- (queueing a handler to the EventQueue).
-
- * ext/tcltklib/README.1st: edit the description of '--with-pthread-ext'
-
-Fri Nov 7 23:23:04 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (Pathname#+): if self or the argument is `.', return
- another.
- (Pathname#parent): if self is `.', return `..'.
- (Pathname#children): if self is `.', don't prepend self for a
- pathname in a result.
- (Pathname#join): re-implemented using Pathname#+.
- (Pathname#find): if self is `.', remove `./' prefix of yielding
- pathname.
-
-Fri Nov 7 10:23:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (make_hostent): get rid of SEGV on aliases
- lookup failure. (ruby-bugs:PR#1215)
-
-Fri Nov 7 04:08:05 2003 UENO Katsuhiro <katsu@blue.sky.or.jp>
-
- * ext/zlib/zlib.c (Init_zlib): define Zlib::GzipReader#each_line as
- an alias of Zlib::GzipReader#each.
-
-Fri Nov 7 01:03:16 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_load): save and restore rb_prohibit_interrupt.
- [ruby-dev:21857]
-
-Thu Nov 6 18:05:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_inspect): show the path also at a closed file.
- [ruby-dev:21851]
-
-Thu Nov 6 11:42:07 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_set_string, strio_reopen): check
- tainted.
-
- * ext/stringio/stringio.c (strio_copy, strio_ungetc, strio_write,
- strio_putc): add infection.
-
- * ext/stringio/stringio.c (strio_path): just nil. [ruby-dev:21846]
-
- * ruby.c (proc_options): reserve searched script path in the
- source file name table. [ruby-list:38765]
-
- * lib/optparse.rb (OptionParser::Completion#complete): default not to
- ignore case on completion. [ruby-talk:84726]
-
- * win32/win32.c (make_cmdvector): process backslashes even if a quote
- is not enclosed.
-
-Wed Nov 5 23:49:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * sample/openssl/gen_csr.rb: there (at least) is a CA which does not
- accept DN in UTF8STRING format. it's a sample.
-
-Wed Nov 5 22:55:16 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * configure.in, eval.c, signal.c: : add '--with-pthread-ext'
- option to fix the pthread trouble on 'tcltklib'
-
- * ext/tcltklib/README.1st: add the description of '--with-pthread-ext'
-
- * ext/tk/lib/tktext.rb : add TkText#text_copy, text_cut, text_paste
- to support Tcl/Tk8.4's tk_textCopy, tk_textCut, tk_textPaste
-
- * ext/tk/lib/tk.rb : add TkMenu#set_focus support Tcl/Tk's
- tk_menuSetFocus
-
-Wed Nov 5 17:33:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_load): allow interrupt during loaded program
- evaluation. [ruby-dev:21834]
-
- * hash.c (rb_hash_fetch): always warn if default argument and a
- block are supplied at the same time. [ruby-dev:21842]
-
- * hash.c (env_fetch): ditto.
-
- * array.c (rb_ary_fetch): ditto.
-
-Wed Nov 5 19:08:47 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):
- do not remove next argument if empty value is placed.
-
- * test/optparse: added.
-
-Wed Nov 5 17:05:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/ui/gtk/testrunner.rb: typo.
-
-Wed Nov 5 11:13:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c: add #include "version.h". this file still depends on it.
-
- * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub,
- wince/Makefile.sub: add version.h dependency to string.c.
-
-Wed Nov 5 09:14:23 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/monitor.rb: revert to the previous revision.
-
-Wed Nov 5 08:39:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.
-
- * lib/webrick/https.rb (HTTPRequest#meta_vars): create
- SSL_CLIENT_CERT_CHAIN_n from @client_cert_chain.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_get_peer_cert_chain): return nil
- if no cert-chain was given.
-
-Tue Nov 4 23:44:48 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * bcc32/Makefile.sub, win32/Makefile.sub, wince/Makefile.sub:
- remove needless version.h dependency.
-
-Tue Nov 4 23:38:43 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * class.c, hash.c, string.c: remove #include "version.h".
-
- * Makefile.in: remove needless version.h dependency.
-
-Tue Nov 4 06:54:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (read_all): fptr->f may be NULL, if IO is closed in the
- signal handler.
-
- * io.c (io_read): ditto.
-
- * string.c (get_pat): remove 1.8.0 warning code.
-
- * string.c (rb_str_match): extend warning until 1.8.2.
-
- * string.c (rb_str_match2): ditto.
-
- * class.c (class_instance_method_list): remove 1.8.0 warnings.
- method_list now recurs. [ruby-dev:21816]
-
- * class.c (rb_obj_singleton_methods): ditto.
-
- * array.c (rb_ary_select): remove select with block.
- [ruby-dev:21824]
-
- * hash.c (rb_hash_select): ditto.
-
- * hash.c (env_select): ditto.
-
- * re.c (match_select): ditto.
-
- * struct.c (rb_struct_select): ditto.
-
-Mon Nov 3 22:53:21 2003 Minero Aoki <aamine@loveruby.net>
-
- * lib/racc/parser.rb: synchronize with Racc 1.4.4.
-
- * ext/racc/cparse/cparse.c: ditto.
-
- * ext/racc/cparse/cparse.c (parse_main): should abort when
- the length of LR state stack <=1, not ==0.
-
-Mon Nov 3 08:50:47 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * process.c (check_uid_switch): remove duplicated error messages.
-
- * process.c (check_gid_switch): ditto.
-
-Sun Nov 2 02:28:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/ssl.rb: new option :SSLExtraChainCert.
-
-Sun Nov 2 01:02:04 2003 Akinori MUSHA <knu@iDaemons.org>
-
- * string.c (rb_str_hash): Update the HASH_PERL alternative hash
- algorithm in sync with Perl 5.8.
-
- * st.c (strhash): Ditto.
-
-Sat Nov 1 18:21:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_peer_cert_chain): add new method
- SSLSocket#peer_cert_chain.
-
- * ext/openssl/ossl_x509req.c (GetX509ReqPtr): new function
- which returns underlying X509_REQ.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_issuer_cert,
- ossl_x509extfactory_set_subject_cert, ossl_x509extfactory_set_crl,
- ossl_x509extfactory_set_subject_req, ossl_x509extfactory_set_config):
- use underlying C struct without duplication not to leak momory.
-
-Sat Nov 1 01:49:03 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/mapping/factory.rb: mark marshalled basetype objects when
- @allow_original_mapping is true. multi-referencing basetype node is
- prohibited in SOAP/1.1 encoding but soap4r's original ruby object
- mapping requires basetype to be marked to detect self referencing
- loop. e.g. o = 1; o.instance_eval { @iv = o } soap4r's original
- mapping is only used through soap/marshal API.
-
- * test/soap/marshal/test_marshal.rb: add tests for self referencing
- immutable objects.
-
- * test/soap/calc/test_calc_cgi.rb: fix test name.
-
-Fri Oct 31 22:26:29 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
-
- * wince/string_wce.c (strrchr): should decrement pointer.
-
- * wince/Makefile.sub: correct a range of isdigit().
-
-Fri Oct 31 12:55:24 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * configure.in, lib/mkmf.rb: add RPATHFLAG for NetBSD.
- [ruby-dev:21791]
-
- * bcc32/Makefile.sub, win32/Makefile.sub, win32/Makefile.sub: ditto.
-
-Fri Oct 31 01:38:14 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * wince/Makefile.sub, win32/Makefile.sub (.y.c): allow white spaces
- at the beginning of line to remove by sed. (ruby-bugs-ja:PR#580)
-
-Fri Oct 31 01:02:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * compar.c (cmp_equal): protect exceptions from <=> comparison
- again. returns nil if any exception or error happened during
- comparison.
-
- * eval.c (search_required): should update *featurep when DLEXT2 is
- defined. (ruby-bugs-ja:PR#581)
-
-Thu Oct 30 23:41:04 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb: add DRbArray
-
- * lib/drb/invokemethod.rb: fix Hash#each problem. [ruby-dev:21773]
-
- * lib/drb/unix.rb: add LoadError. [ruby-dev:21743]
-
-Thu Oct 30 23:19:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/generator.rb: better XML pretty printing.
-
- * lib/soap/encodingstyle/soapHandler.rb: remove unnecessary namespace
- assignment in the element which has "encodingStyle" attribute, and
- add necessary namespace assignment for "arrayType" attribute.
-
- * test/soap/calc/test_calc_cgi.rb: take over $DEBUG to ruby process
- through CGI.
-
-Thu Oct 30 22:59:39 2003 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/yaml2byte.c: HASH const too long. Thanks, matz.
-
-Thu Oct 30 19:13:53 2003 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/syck/MANIFEST: Add yamlbyte.h.
-
-Thu Oct 30 14:25:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (READ_DATA_BUFFERED): new macro to detect whether stdio
- buffer filled.
-
- * io.c (rb_io_fptr_cleanup): move path deallocation to
- rb_io_fptr_finalize (finalizer called by GC).
-
-Thu Oct 30 13:23:39 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (logop): left may be NULL. [ruby-talk:84539]
-
- * eval.c (rb_eval): NODE_CASE nd_head may be NULL.
-
-Thu Oct 30 10:14:51 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/test/unit/autorunner.rb: make fox runner work.
-
-Thu Oct 30 09:32:26 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_f_system): fixed lack of security check before
- calling do_spawn() on win32. [ruby-talk:84555]
-
-Thu Oct 30 02:46:35 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): single array value to normal Proc#call
- (i.e. not via lambda call), should be treated just like yield.
- [ruby-dev:21726]
-
-Thu Oct 30 02:25:48 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/buffering.rb (Buffering#initialize):
- add new method to inherit @sync from @io.sync.
-
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): no need to
- set sync flag explicitly.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): call super.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): set extra chain
- certificates in @extra_chain_cert.
-
-Wed Oct 29 22:02:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/drb/drbtest.rb: use rbconfig.rb to make the path of ruby
- interpreter to exec, instead of test/ruby/envutil.rb,
-
-Wed Oct 29 19:58:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/tcltklib/tcltklib.c (CONST84): define CONST84 when it is not
- defined and TCL_MAJOR_VERSION >= 8.
-
- * ext/tcltklib/tcltklib.c (VwaitVarProc, WaitVariableProc,
- rb_threadVwaitProc): use CONST84 instead of CONST.
-
- * ext/tcltklib/tcltklib.c (ip_rbTkWaitCommand,
- ip_rb_threadTkWaitCommand): use CONST84 always.
-
-Wed Oct 29 17:27:05 2003 Tanaka Akira <akr@m17n.org>
-
- * re.c (rb_reg_s_union, Init_Regexp): new method `Regexp.union'.
-
- * lib/pathname.rb (realpath): examine Dir.pwd because it may have
- symlinks.
-
-Wed Oct 29 17:16:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_longjmp): must not disturb original jump.
- [ruby-dev:21733]
-
-Wed Oct 29 15:28:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_Proc): taint preallocated exception object
- sysstack_error. [ruby-talk:84534]
-
-Wed Oct 29 11:27:39 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (ret_args): node may be NULL. [ruby-talk:84530]
-
-Tue Oct 28 15:20:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/tcltklib/tcltklib.c (VwaitVarProc, ip_rbVwaitObjCmd,
- WaitVariableProc, WaitVisibilityProc, WaitWindowProc,
- ip_rbTkWaitObjCmd, ip_rbTkWaitCommand, rb_threadVwaitProc,
- rb_threadWaitVisibilityProc, rb_threadWaitWindowProc,
- ip_rb_threadVwaitObjCmd, ip_rb_threadTkWaitObjCmd): prototype;
- avoid VC++ warnings.
-
-Mon Oct 27 19:19:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_longjmp): ignore reentering error while warning.
- [ruby-dev:21730]
-
-Mon Oct 27 00:23:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (ip_ruby): bug fix on Win : hang-up when
- calling 'exit' in the Tk callback procedure. [ruby-list:38656]
-
-Sat Oct 25 09:18:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_method_missing): protect exception from within
- "inspect". (ruby-bugs:PR#1204)
-
-Fri Oct 24 23:26:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * hash.c (rb_hash_each): Hash#each should yield single value.
- [ruby-talk:84420]
-
- * hash.c (env_each): ditto for ENV.each.
-
-Thu Oct 23 20:25:32 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/server.rb (GenericServer#start): should rescue
- IOError from IO::accept. [ruby-dev:21692]
-
-Thu Oct 23 17:59:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): initialize stack bottom for embedding.
- [ruby-dev:21686]
-
- * ext/dl/extconf.rb: move list of files to clean from DEPEND file,
- to get rid of macro redefinitions.
-
-Thu Oct 23 13:44:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y: integrate operations for stack_type. [ruby-dev:21681]
-
-Thu Oct 23 00:41:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/soap/calc/*, test/soap/helloworld/*: set logging threshold
- to ERROR.
-
-Wed Oct 22 12:53:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
- ignore tests which raised LoadError.
-
- * test/drb/drbtest.rb, test/ruby/test_beginendblock.rb,
- test/ruby/test_system.rb: avoid requiring same file twice.
-
- * test/drb/test_drbssl.rb, test/drb/test_drbunix.rb: should not use
- ARGV unless invoked directly. do not create test cases unless
- required libraries are available.
-
-Wed Oct 22 02:31:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (ruby_cleanup): should not ignore exit_value in END
- execution. [ruby-dev:21670]
-
-Tue Oct 21 23:16:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (ruby_cleanup): call finalizers and exit procs before
- terminating threads.
-
- * eval.c (ruby_cleanup): preserve ruby_errinfo before ruby_finalize_0().
-
-Tue Oct 21 15:57:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
- prepend the directory of target file to the load path.
-
-Tue Oct 21 15:08:53 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (do_spawn, do_aspawn): should wait child process even
- if callded with P_OVERLAY.
-
- * win32/win32.c (do_spawn, do_aspawn): should return child's exit
- status to parent.
-
-Tue Oct 21 00:35:02 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/soap/calc/*, test/soap/helloworld/*: catch the exception from
- test server thread and recover.
-
-Tue Oct 21 00:22:57 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/*: import drb/runit.
-
-Mon Oct 20 23:55:47 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): set current node after arguments evaluation.
- [ruby-dev:21632]
-
- * eval.c (rb_yield_0): set current node and keep it at local jump.
-
-Mon Oct 20 22:01:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_cleanup): keep thread group for main thread.
- [ruby-dev:21644]
-
-Mon Oct 20 18:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_catch): backout.
-
-Mon Oct 20 17:31:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (PUSH_FRAME): generate unique number to be TAG_JUMP()
- destination.
+Sat Jan 18 22:35:15 2014 Tanaka Akira <akr@fsij.org>
- * eval.c (localjump_destination): use unique number in ruby_frame
- for localjump destination.
+ * io.c (rb_update_max_fd): Return immediately if the given fd is small
+ enough.
-Mon Oct 20 11:31:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jan 18 22:25:53 2014 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_signal.rb (test_signal): restore old trap.
+ * io.c: Test O_CLOEXEC only once.
+ Patch by Eric Wong. [ruby-core:59419] [Feature #9328]
-Mon Oct 20 11:00:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jan 18 21:24:49 2014 Tanaka Akira <akr@fsij.org>
- * gc.c (gc_sweep): loosen page free condition to avoid add_heap()
- race condition. [ruby-dev:21633]
+ * ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
+ option takes a byte on OpenBSD.
+ Fixed by Jeremy Evans. [ruby-core:59496] [Bug #9350]
- * gc.c (gc_sweep): do not update malloc_limit when malloc_increase
- is smaller than malloc_limit.
+Sat Jan 18 21:19:04 2014 Tanaka Akira <akr@fsij.org>
-Mon Oct 20 09:45:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/open-uri.rb: Make proxy disabling working again.
+ Fixed by Christophe Philemotte. [ruby-core:59650] [Bug #9385]
- * lib/debug.rb (debug_command): remove debug print.
+Fri Jan 17 20:05:02 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 20 00:25:41 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/delegate.rb (Delegator): keep source information methods
+ which start and end with '__'. [ruby-core:59718] [Bug #9403]
- * eval.c (search_required): required name must not be changed before
- loading. [ruby-dev:24492]
+Fri Jan 17 17:58:04 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 19 13:12:30 2003 Tanaka Akira <akr@m17n.org>
+ * eval.c (rb_mod_s_constants): return its own constants for other
+ than Module itself. [ruby-core:59763] [Bug #9413]
- * lib/pathname.rb (foreachline, dir_foreach): add obsolete warning.
+Tue Jan 16 00:17:00 2014 Kenta Murata <mrkn@mrkn.jp>
-Sun Oct 19 00:14:22 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.5.
- * test/soap/calc/*, test/soap/helloworkd/*: changed port# of test
- server. (17171)
+Wed Jan 15 20:30:31 2014 Masaki Matsushita <glass.saga@gmail.com>
-Sat Oct 18 23:01:32 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * io.c (io_binwrite): use writev(2) to avoid double write if available.
- * missing/acosh.c (DBL_MANT_DIG): typo fix(ifdef -> ifndef).
+ * configure.in: check writev(2)
-Sat Oct 18 05:48:59 2003 why the lucky stiff <why@ruby-lang.org>
+Wed Jan 15 14:04:33 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/rubyext.c: YAML::Syck::compile method.
+ * string.c (get_encoding): respect BOM on pseudo encodings.
+ [ruby-dev:47895] [Bug #9415]
- * ext/syck/syck.c: Buffer edge bug.
+Wed Jan 15 14:03:47 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/yaml2byte.c: YAML to bytecode converter.
+ * string.c (get_actual_encoding): get actual encoding according to
+ the BOM if exists.
- * ext/syck/yamlbyte.h: Ditto.
+ * string.c (rb_str_inspect): use according encoding, instead of
+ pseudo encodings, UTF-{16,32}. [ruby-core:59757] [Bug #8940]
- * ext/syck/bytecode.c: Bytecode parser fixes to empty collections
- and empty strings.
+Tue Jan 14 21:07:22 2014 Masaki Matsushita <glass.saga@gmail.com>
- * ext/syck/token.c: Ditto.
+ * ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERS
+ on SizedQueue#clear. [ruby-core:59462] [Bug #9342]
-Fri Oct 17 23:07:38 2003 Akinori MUSHA <knu@iDaemons.org>
+ * test/thread/test_queue.rb: add test. the patch is from
+ Justin Collins.
- * ext/enumerator/enumerator.c, ext/enumerator/enumerator.txt:
- Provide Kernel#to_enum as an alias for Kernel#enum_for. Maybe
- this is a better name.
+Tue Jan 14 15:58:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 17 23:00:30 2003 Akinori MUSHA <knu@iDaemons.org>
+ * ext/bigdecimal/bigdecimal.c (CLASS_NAME): macro to wrap
+ depending on PRIsVALUE for 1.9. [Backport #9406]
- * lib/generator.rb: Add rdoc documentation.
+ * ext/bigdecimal/bigdecimal.c (DECIMAL_SIZE_OF_BITS): fallback
+ definition for 2.1 or older. [ruby-core:59750] [Backport #9406]
-Fri Oct 17 22:16:42 2003 Akinori MUSHA <knu@iDaemons.org>
+Tue Jan 14 11:28:44 2014 Yuki Yugui Sonoda <yugui@google.com>
- * lib/set.rb: Reword and fix Overview.
+ * vm_exec.c (cfp): Fixes a SEGV issue in r44554.
+ r11 can be broken by subroutine and sometimes causes SEGV at
+ runtime. Use r13 instead.
- * lib/set.rb: It is not necessary to require
- 'test/unit/ui/console/testrunner'.
+Tue Jan 14 02:20:00 2014 Kenta Murata <mrkn@mrkn.jp>
-Fri Oct 17 11:15:22 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
+ digit for the quotient to be compatible with bigdecimal 1.2.1 and
+ the former. [ruby-core:59365] [#9316] [#9305]
- * test/ruby/test_range.rb: added.
+ * test/bigdecimal/test_bigdecimal.rb: tests for the above change.
- * MANIFEST: add test/ruby/test_range.rb.
+ * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4.
-Fri Oct 17 03:21:23 2003 William Sobel <will.sobel@barra.com>
-
- * ext/socket/socket.c (make_hostent): h_aliases may be NULL.
- (ruby-bugs:PR#1195)
-
- * ext/socket/socket.c (sock_s_gethostbyaddr): ditto.
-
-Fri Oct 17 00:12:41 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: (bug fix) instance variable @frame was used
- without initializing on TkComposite module.
-
-Thu Oct 16 23:51:04 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: If $DEBUG == true and some exception is caused
- in a callback operation, Ruby/Tk shows a (verbose) backtrace
- information on the callback process.
-
-Thu Oct 16 17:09:19 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/debug.rb (DEBUGGER__::Context::debug_command): do not call
- debug_silent_eval() when $1 is not set. (ruby-bugs:PR#1194)
-
-Thu Oct 16 16:54:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (rb_str_upto): ("a"..."a").to_a should return [].
- [ruby-core:01634]
-
-Thu Oct 16 16:40:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb:
- Add Tk::EncodedString and Tk::UTF8_String class to support
- characters using the \uXXXX escape to the UNICODE string.
-
- * ext/tk/sample/{demos-en,demos-jp}/unicodeout.rb
- new demo-scripts (samples of Tk::UTF8_String)
-
- * ext/tk/sample/{demos-en,demos-jp}/widget
- add entries for 'unicodeout.rb'
-
-Thu Oct 16 08:38:06 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/digest/test_digest.rb (test_eq): show failed class.
-
- * test/ruby/test_iterator.rb (test_break, test_return_trace_func):
- test localjump destination.
-
-Wed Oct 15 20:22:31 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/netHttpClient.rb: use URI::HTTP#request_uri instead of
- instance_eval('path_query'). [ruby-list:38575]
-
-Wed Oct 15 17:24:45 2003 URABE Shyouhei <root@mput.dip.jp>
-
- * lib/cgi.rb (CGI::Cookie): tiny typo fix.
-
-Wed Oct 15 15:00:54 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_run): just return FAILURE instead of parse error
- count. [ruby-list:38569]
-
-Wed Oct 15 13:17:02 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/digest/digest.c (rb_digest_base_alloc): need to initialize
- buffer. [ruby-dev:21622]
-
-Wed Oct 15 11:23:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_object): dump extended modules as well.
-
- * marshal.c (r_object0): TYPE_USRMARSHAL should restore extended
- modules before invoking marshal_load. these two fixes are done
- by Masatoshi Seki <m_seki@mva.biglobe.ne.jp>.
-
-Wed Oct 15 09:30:34 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning.
-
- * ext/syck/syck.h: include stdio.h for definition of FILE.
-
-Wed Oct 15 08:09:07 2003 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/bytecode.c: Checkin of YAML bytecode support.
-
- * ext/syck/gram.c: Ditto.
-
- * ext/syck/syck.c: Ditto.
-
- * ext/syck/token.c: Ditto.
-
- * ext/syck/handler.c: Ditto.
-
- * ext/syck/handler.c: Now using 'tag' rather than 'taguri' in type URIs.
-
- * ext/syck/rubyext.c: Ditto (on both counts).
-
-Wed Oct 15 05:05:53 2003 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/generator.rb: A new library which converts an internal
- iterator to an external iterator.
-
- * lib/abbrev.rb: A new library which creates an abbreviation table
- from a list.
-
-Wed Oct 15 04:31:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/sample/demos-en/entry3.rb, ext/tk/sample/demos-jp/entry3.rb :
- new demo-scripts
-
- * ext/tk/sample/demos-en/widget, ext/tk/sample/demos-jp/widget :
- add entries for 'entry3.rb'
-
-Wed Oct 15 04:31:47 2003 Akinori MUSHA <knu@iDaemons.org>
-
- * test/digest/test_digest.rb: Moved from ext/digest/test.rb.
-
-Wed Oct 15 03:53:20 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug
- on the last commit).
-
-Wed Oct 15 00:25:00 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (yylex): argument parentheses preceded by spaces should
- be warned; not error. [ruby-talk:84103]
-
-Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to
- switch on threads smoothly and avoid seg-fault.
-
- * ext/tcltklib/tcltklib.c: add TclTkIp._thread_vwait and
- _thread_tkwait for waiting on a thread. (Because Tcl/Tk's vwait
- and tkwait command wait on an eventloop.)
-
- * ext/tk/lib/multi-tk.rb: support TclTkIp._thread_vwait and
- _thread_tkwait.
-
- * ext/tk/lib/tk.rb: now, TkVariable#wait has 2 arguments.
- If 1st argument is true, waits on a thread. If false, waits on
- an eventloop. If 2nd argument is true, checks existence of
- rootwidgets. If false, doesn't. Default is wait(true, false).
-
- * ext/tk/lib/tk.rb: add TkVariable#tkwait(arg) which is equal to
- TkVariable#wait(arg, true). wait_visibility and wait_destroy
- have an argument for waiting on a thread or an eventloop.
-
- * ext/tk/lib/tk.rb: improve of accessing Tcl/Tk's special variables.
-
- * ext/tk/lib/tkafter.rb: support 'wait on a thread' and 'wait on
- an eventloop'.
-
-Wed Oct 15 00:10:24 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/baseData.rb: Introduce SOAPType as the common ancestor of
- SOAPBasetype and SOAPCompoundtype.
-
- * lib/soap/generator.rb, lib/soap/element.rb, lib/soap/encodingstyle/*:
- Encoding methods signature change. Pass SOAPGenerator as a parameter.
-
- * lib/soap/mapping/*, test/soap/marshal/test_marshal.rb: Refactoring
- for better marshalling/unmarshalling support. Now I think SOAP
- marshaller supports all kind of object graph which is supported by
- Ruby's original marshaller. Of course there could be bugs as always.
- Find it. :-)
-
- * lib/soap/rpc/standaloneServer.rb: Set severity threshould to INFO.
- DEBUG is too noisy.
-
- * lib/xsd/datatypes.rb: DateTime#of is obsoleted. Use DateTime#offset.
-
- * test/wsdl/emptycomplextype.wsdl, test/xsd/xmlschema.xml: Avoid
- useless warning.
-
-Tue Oct 14 19:09:35 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_finalize_0): return the given exit status unless
- SystemExit got raised.
-
-Tue Oct 14 11:53:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (ruby_stop): never return.
-
- * ruby.h (ruby_run): ditto.
-
-Tue Oct 14 04:43:55 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (realpath): make ELOOP check bit more robust.
- (children): prepend self by default.
- (chroot): obsoleted.
-
-Tue Oct 14 02:29:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_require_safe): segfault after loading .so.
-
-Tue Oct 14 02:05:23 2003 Akinori MUSHA <knu@iDaemons.org>
-
- * ext/Setup*, ext/enumerator/*: Add ext/enumerator, a helper
- module for the Enumerable interface.
-
-Mon Oct 13 23:55:59 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * test/ruby/envutil.rb: use Config::CONFIG["ruby_install_name"],
- not "ruby".
-
-Mon Oct 13 23:57:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_feature_p): match by classified suffix.
-
- * eval.c (rb_require_safe): require library in the specified safe
- level.
-
- * variable.c (rb_autoload, rb_autoload_load): restore safe level
- when autoload was called. [ruby-dev:21338]
-
- * intern.h: prototypes; rb_require_safe.
-
- * test/runner.rb: accept non-option arguments.
-
-Mon Oct 13 20:49:51 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * string.c (str_new4): should not preserve FL_TAINT status in the
- internal shared string. [ruby-dev:21601]
-
- * string.c (rb_str_new4): ditto.
-
- * eval.c: use EXIT_SUCCESS and EXIT_FAILURE for exit values.
-
- * process.c: ditto. [ruby-list:38521]
-
-Mon Oct 13 19:51:02 2003 Koji Arai <jca02266@nifty.ne.jp>
-
- * lib/debug.rb (debug_command): should enter emacs mode when
- assigned any value to the environment variable "EMACS".
- On Meadow, (getenv "EMACS") is "meadow".
-
-Sun Oct 12 14:45:03 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/win32ole/extconf.rb: check "windows.h", not "windows".
- [ruby-talk:84051]
-
-Sat Oct 11 20:41:03 2003 Corinna Vinschen <corinna@vinschen.de>
-
- * file.c (eaccess): Use access(2) on Cygwin.
-
-Sat Oct 11 17:09:21 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * lib/rexml/quickpath.rb (REXML::QuickPath::match):
- escape '[' to avoid warning.
-
-Sat Oct 11 16:08:41 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb (realpath): check existence of the file.
-
- * lib/pathname.rb (realpath): re-implemented.
- (realpath_root?, realpath_rec): removed
-
-Sat Oct 11 10:19:39 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/monitor.rb: handle exceptions correctly. Thanks, Gennady
- Bystritsky.
-
-Fri Oct 10 07:50:54 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (is_defined): inheritance line adjustment as like as
- rb_call_super().
-
-Fri Oct 10 01:19:00 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): add
- optional argument to specify the DirectoryString type
- (ASN1::UTF8STRING by default). RFC3280 deprecates PrintableString
- for DirectoryString, and strongly requires to use UTF8String for
- all certificates issued after December, 31 2003.
-
- * ext/openssl/lib/openssl/x509.rb (X509::Name::parse): ditto.
-
-Thu Oct 9 23:50:21 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_start_0): prevent thread from GC.
- [ruby-dev:21572]
-
-Thu Oct 9 19:11:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_start_0): non-volatile should be restored from
- volatile.
-
-Thu Oct 9 17:43:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (proc_save_safe_level, proc_get_safe_level,
- proc_set_safe_level): save/restore safe level 1..4.
-
-Thu Oct 9 16:33:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (r_object0): remove unnecessary iv restoration for
- USRMARSHAL. [ruby-dev:21582]
-
- * marshal.c (w_object): dump generic instance variables from
- a string from '_dump'.
-
- * variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
- is not set.
-
- * time.c (time_dump): copy instance variables to dumped string, to
- be included in the marshaled data.
-
- * bignum.c (rb_big2ulong): add range check to ensure round trip.
-
-Thu Oct 9 15:45:27 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * pack.c (uv_to_utf8): change message to "out of range", since
- negative values are not "too big". [ruby-dev:21567]
-
-Thu Oct 9 14:05:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_set_end_proc, rb_exec_end_proc): restore safe level.
- [ruby-dev:21557]
-
-Thu Oct 9 10:51:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_yield_0): no error if block is empty.
-
-Thu Oct 9 06:43:33 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (localjump_error): id should be ID.
-
- * eval.c (rb_eval): nd_rval is set in copy_node_scope().
-
- * eval.c (rb_yield_0): unused variable.
-
- * eval.c (rb_yield_0): nothing to do for empty node.
-
- * eval.c (call_end_proc, proc_invoke): adjust backtrace in END.
- [ruby-dev:21551]
-
- * eval.c (rb_thread_start_0): set the value by break as the result.
- [ruby-dev:21552]
-
- * eval.c (rb_thread_start_0, rb_thread_raise, rb_callcc): save
- variables across THREAD_SAVE_CONTEXT.
-
-Thu Oct 9 12:05:46 2003 Eric Sunshine <sunshine@sunshineco.com>
-
- * configure.in: revived NextStep, OpenStep, and Rhapsody ports which
- had become unbuildable; enhanced --enable-fat-binary option so that
- it accepts a list of desired architectures (rather than assuming a
- fixed list), or defaults to a platform-appropriate list if user does
- not provide an explicit list; made the default list of architectures
- for MAB (fat binary) more comprehensive; now uses -fno-common even
- when building the interpreter (in addition to using it for
- extensions), thus allowing the interpreter to be embedded into a
- plugin module of an external project (in addition to allowing
- embedding directly into an application); added checks for
- <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
- ensures that -I/usr/local/include is employed when extensions'
- extconf.rb scripts invoke have_header() since extension checks on
- NextStep and OpenStep will fail without it if the desired resource
- resides in the /usr/local tree; fixed formatting of --help message.
-
- * Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
- invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
- (see configure's --enable-fat-binary option); added rule for new
- missing/getcwd.c.
-
- * defines.h: fixed endian handling during MAB build (see configure's
- --enable-fat-binary option) to ensure that all portions of the
- project see the correct WORDS_BIGENDIAN value (some extension modules
- were getting the wrong endian setting); added missing constants
- GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
- and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
- define in NeXT section.
-
- * dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
- NextStep since, on some installations, this value always resolves
- uselessly to zero.
-
- * dln.c: added error reporting to NextStep extension loader since the
- previous behavior of failing silently was not useful; now ensures
- that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
- for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
- on Rhapsody since this header lacks multiple-include protection,
- which resulted in "redefinition" compilation errors.
-
- * main.c: also create hard reference to objc_msgSend() on NeXT
- platforms (in addition to Apple platforms).
-
- * lib/mkmf.rb: now exports XCFLAGS from configure script to extension
- makefiles so that extensions can be built MAB (see configure's
- --enable-fat-binary option); also utilize XCFLAGS in cc_command()
- (but not cpp_command() because MAB flags are incompatible with
- direct invocation of `cpp').
-
- * ext/curses/extconf.rb: now additionally checks for presence of these
- curses functions which are not present on NextStep or Openstep:
- bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
- setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
- wscrl(), wsetscrreg()
-
- * ext/curses/curses.c: added appropriate #ifdef's for additional set of
- curses functions now checked by extconf.rb; fixed curses_bkgd() and
- window_bkgd() to correctly return boolean result rather than numeric
- result; fixed window_getbkgd() to correctly signal an error by
- returning nil rather than -1.
-
- * ext/etc/etc.c: setup_passwd() and setup_group() now check for null
- pointers before invoking rb_tainted_str_new2() upon fields extracted
- from `struct passwd' and `struct group' since null pointers in some
- fields are common on NextStep/OpenStep (especially so for the
- `pw_comment' field) and rb_tainted_str_new2() throws an exception
- when it receives a null pointer.
-
- * ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup().
-
- * ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
- gethostbyaddr(), and gethostbyname() from (const char*) to non-const
- (char*) for older platforms such as NextStep and OpenStep.
-
- * ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup(); include
- <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
- argument of gethostbyaddr() and getservbyname() from (const char*) to
- non-const (char*) for older platforms.
-
- * ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
- platforms such as NextStep and OpenStep which lack strdup().
-
-Wed Oct 8 22:19:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit.rb: removed installation instructions.
-
- * lib/test/unit/ui/testrunnermediator.rb: moved the run flag to a more
- central location.
-
- * lib/test/unit.rb: ditto.
-
- * lib/test/unit.rb: extracted the running code in to AutoRunner.
-
- * lib/test/unit/autorunner.rb: added.
-
- * lib/test/unit/collector/objectspace.rb: extracted common test
- collection functionality in to a module.
-
- * lib/test/unit/collector.rb: ditto; added.
-
- * test/testunit/collector/test_objectspace.rb: ditto.
-
- * lib/test/unit/collector/dir.rb: added. Supports collecting tests out
- of a directory structure.
-
- * test/testunit/collector/test_dir.rb: added.
-
- * test/runner.rb: simplified to use the new capabilities.
-
-Tue Oct 7 15:23:09 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb: add tests for nested BEGIN/END.
-
- * test/ruby/beginmainend.rb: add tests for nested BEGIN/END.
-
- * test/ruby/endblockwarn.rb: new file added to test of END-in-method
- warning.
-
-Tue Oct 7 12:23:47 2003 Tanaka Akira <akr@m17n.org>
-
- * ext/fcntl/fcntl.c (Init_fcntl): define Fcntl::O_ACCMODE.
-
- * ext/socket/extconf.rb: useless assignment removed.
-
-Tue Oct 7 09:13:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb (test_endinmethod): END{} is now
- allowed in eval.
-
-Tue Oct 7 04:15:25 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt): should not expand mrhs if lhs is solely starred.
-
-Tue Oct 7 02:57:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (stmt): rhs of multiple assignment should not be
- expanded using "to_a". [ruby-dev:21527]
-
-Tue Oct 7 01:42:34 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): use appropriate
- free function for ASN1_OBJECT.
-
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_sn): add new function for
- ASN1::ObjectId#sn; it returns short name text representation of OID.
-
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_ln): add new function for
- ASN1::ObjectId#ln; it returns long name text representation of OID.
-
- * ext/openssl/ossl_asn1.c (ossl_asn1obj_get_oid): add new function for
- ASN1::ObjectId#oid; it returns numerical representation of OID.
-
-Mon Oct 6 22:59:46 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/csv.rb (IOReader, BasicWriter): call binmode when a given IO
- respond_to?(:binmode). record separator was wrong when you gave
- text mode IO to Reader.parse and Writer.generate.
-
- * test/csv/test_csv.rb: add tests for above change.
-
-Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
-
- * ext/socket/extconf.rb: check recvmsg even if sendmsg is exists.
-
- * ext/socket/socket.c (thread_read_select): restored.
-
-Mon Oct 6 16:23:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_object): wrong method name in the message.
-
-Mon Oct 6 16:02:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (stmt): END in method should cause warning.
- [ruby-dev:21519]
-
-Mon Oct 6 15:17:23 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_iterator.rb (test_block_argument_without_paren):
- added. (follows sample/test.rb)
-
-Mon Oct 6 11:57:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb, test/ruby/beginmainend.rb: added
- test for eval-ed BEGIN END order.
-
-Mon Oct 6 09:19:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_object): should pass "weak" value to next level.
- [ruby-dev:21496]
-
- * eval.c (proc_alloc): should not use cached object if klass is
- different. [ruby-talk:83685]
-
-Sun Oct 5 23:27:09 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb: version information is added in document.
-
-Sun Oct 5 23:07:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_f_END): block should be given. [ruby-dev:21497]
-
-Sun Oct 5 22:51:23 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/ext/openssl/extconf.rb: add check for some engine functions
- unavailable in OpenSSL-0.9.6.
-
- * lib/ext/openssl/ossl_engine.c: ditto.
-
-Sun Oct 5 17:56:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): fix evaluation order. [ruby-list:38431]
-
-Sun Oct 5 15:05:06 2003 akira yamada <akira@ruby-lang.org>
-
- * test/uri/*: translated RUNIT to Test::Unit.
-
-Sun Oct 5 14:37:39 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/xsd/datatypes.rb: Rational -> Decimal string bug fix.
-
- * test/soap/marshal/test_marshal.rb: ditto.
-
- * test/soap/calc/test_calc_cgi.rb: add Config::CONFIG["EXEEXT"] to
- RUBYBIN.
-
-Sun Oct 5 13:47:22 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_beginendblock.rb, test/ruby/beginmainend.rb: add tests
- about scope, order and allowed syntax.
-
-Sun Oct 5 11:54:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/envutil.rb: added. split "rubybin" from test_system.rb.
-
- * test/ruby/test_system.rb: use envutil.rb
-
- * test/ruby/test_beginendblock.rb: added.
-
- * test/ruby/beginmainend.rb: added. used in test_beginendblock.rb.
-
-Sun Oct 5 11:23:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * test/testunit/runit/test_testresult.rb: removed some unnecessary
- cruft.
-
-Sun Oct 5 11:14:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/rubyunit.rb: aliasing TestCase into the top level is
- problematic.
-
- * lib/runit/assert.rb: fixed a couple of bugs caused by recent
- refactoring in Test::Unit.
-
- * test/testunit/runit/*: added.
-
-Sun Oct 5 10:55:29 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/open-uri.rb (URI::Generic#find_proxy): no_proxy support did not
- work. [ruby-dev:21484]
-
-Sun Oct 5 09:52:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: will use pp for output if available.
- Can be disabled by setting Assertions.use_pp = false.
-
- * test/testunit/test_assertions.rb: made a small change to exception
- formatting.
-
-Sun Oct 5 07:42:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: made small improvements to assertion
- messages. Deprecated Assertions#assert_not_nil; use #assert instead.
-
- * test/testunit/test_assertions.rb: ditto.
-
- * test/testunit/util/test_procwrapper.rb: use #assert instead of
- #assert_not_nil.
-
-Sun Oct 5 04:10:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: refactored message building.
-
-Sun Oct 5 03:40:22 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_asn1.h: global symbols should be declared
- as external.
-
-Sun Oct 5 03:03:20 2003 akira yamada <akira@ruby-lang.org>
-
- * test/ruby/test_exception.rb (test_else): added.
-
-Sun Oct 5 02:12:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/test/unit/assertions.rb: changed assertion messages to rely more
- heavily on #inspect. Added backtrace filtering for exceptions in
- assertion messages.
-
- * test/testunit/test_assertions.rb: ditto.
-
-Sun Oct 5 02:12:00 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/acl.rb, lib/drb/ssl.rb: added.
-
- * lib/drb/drb.rb: exit from a thread using 'break'.
-
-Sat Oct 4 21:49:14 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * gc.c (Init_stack): the type of space is changed to unsigned int
- from double. [ruby-dev:21483]
-
-Sat Oct 4 17:52:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/netHttpClient.rb: follow http-access2. hosts which matches
- ENV['no_proxy'] or ENV['NO_PROXY'] are not proxyed.
- - [,:] separated. ("ruby-lang.org:rubyist.net")
- - no regexp. (give "ruby-lang.org", not "*.ruby-lang.org")
- - if you want specify host by IP address, give full address.
- ("192.168.1.1, 192.168.1.2")
-
- * lib/soap/rpc/cgistub.rb: return "Status: XXX MMM" line.
-
- * test/runner.rb: give testsuite name.
-
-Sat Oct 4 15:16:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * marshal.c (w_object): instance variable dump do not cause error
- for objects that cannot be dumped, if they traversed from
- marshal_dump. they are just ignored.
-
- * gc.c (Init_stack): cast "space" (doble value) into unsigned
- int. should run on PowerPC.
-
- * eval.c (rb_eval): should not execute else part if any exception
- is caught. [ruby-dev:21482]
-
- * parse.y (f_args): should allow unparenthesized block argument.
-
- * parse.y (f_rest_arg): should allow unparenthesized rest
- argument.
+Mon Jan 13 14:55:31 2014 Zachary Scott <e@zzak.io>
-Sat Oct 4 14:59:51 2003 Tanaka Akira <akr@m17n.org>
+ * lib/xmlrpc/client.rb: [DOC] Remove note about SSL package on RAA
+ Since RAA has been deprecated, and the SSL package has been replaced
+ with net/https this statement is entirely false and should be
+ deleted. [Bug #9152]
- * lib/pathname.rb (initialize): raise ArgumentError if argument has
- '\0' character.
- (relative_path_from): new method.
- (each_entry): new method for replacement of dir_foreach.
- (foreach, foreachline, dir_foreach, chdir): obsoleted.
+Mon Jan 13 14:47:07 2014 Zachary Scott <e@zzak.io>
-Sat Oct 4 12:58:48 2003 akira yamada <akira@ruby-lang.org>
+ * lib/net/smtp.rb: [DOC] Remove dead link to RAA by Giorgos Tsiftsis
+ Fixes the following bugs: [Bug #9152] [Bug #9268] [Bug #9394]
+ * lib/open-uri.rb: ditto
- * test/uri/* (6 files): added.
+Mon Jan 13 14:25:55 2014 Zachary Scott <e@zzak.io>
-Sat Oct 4 12:44:45 2003 akira yamada <akira@ruby-lang.org>
+ * ext/openssl/ossl_pkey_dh.c: Fixed typo by Sandor Szuecs [Bug #9243]
- * lib/uri/ftp.rb, lib/uri/mailto.rb: renamed to #to_s from #to_str.
+Mon Jan 13 12:03:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
-Sat Oct 4 07:33:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS
+ instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong.
+ [Bug #9302] [ruby-core:59324]
- * lib/test/unit/testsuite.rb: changed #<< to return self, and added
- #delete.
+ * test/thread/test_queue.rb: add test
- * test/testunit/test_testsuite.rb: ditto. Also slightly refactored
- #test_size.
+Sun Jan 12 16:41:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/collector/objectspace.rb: collector now preserves the
- hierarchy of suites.
+ * iseq.c (iseq_load): keep type_map to get rid of memory leak.
+ based on a patch by Eric Wong at [ruby-core:59699]. [Bug #9399]
- * test/testunit/collector/test_objectspace.rb: ditto.
+Sun Jan 12 09:21:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 4 04:48:49 2003 why the lucky stiff <why@ruby-lang.org>
+ * include/ruby/util.h (DECIMAL_SIZE_OF_BITS): a preprocessor
+ constant macro to approximate decimal representation size of n-bits
+ integer.
- * ext/syck/rubyext.c: default keys handled.
+ * iseq.c (register_label): use DECIMAL_SIZE_OF_BITS for better
+ approximation.
- * ext/syck/syck.h: lowered default buffer size to 16k for increased
- performance.
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
- * test/yaml: checkin of basic unit tests.
+ * common.mk (iseq.o), ext/bigdecimal/depend (bigdecimal.o): add
+ dependency to ruby/util.h for DECIMAL_SIZE_OF_BITS.
-Sat Oct 4 04:24:19 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jan 10 16:27:20 2014 Yuki Yugui Sonoda <yugui@google.com>
- * ext/openssl/extconf.rb: add check for X509V3_set_nconf.
+ * vm_exec.c (cfp): Avoid generating invalid binary for
+ NativeClient.
+ r15 on x86_64 is reserved by NativeClient. So r15 to cfp used to
+ generate invalid binary under some combinations of compiler
+ optimization flags.
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_config):
- cannot implement if X509V3_set_nconf doesn't exist.
+Fri Jan 10 18:01:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 4 02:12:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_super_method): allow bound method from a
+ module, yet another method transplanting.
- * lib/xsd/datatypes.rb: dump sign by itself. under the problematic
- platform, sprintf("%+.10g", -0.0) => +0. sigh.
+Fri Jan 10 13:34:04 2014 Aman Gupta <ruby@tmm1.net>
- * sample/wsdl/amazon/*: update schema ver2 to ver3.
+ * insns.def (opt_aref_with): new instruction to optimize Hash#[],
+ removing any allocation overhead when used with a string literal
+ key. Patch by normalperson (Eric Wong). [ruby-core:59640] [Bug #9382]
+ * insns.def (opt_aset_with): new instruction to optimize Hash#[]=
+ * compile.c (iseq_compile_each): compiler shortcuts for new
+ instructions
+ * hash.c (static VALUE rb_hash_compare_by_id_p): fix documentation for
+ Hash#compare_by_identity to reflect frozen string sharing
+ * test/ruby/test_hash.rb (class TestHash): test for new behavior
-Sat Oct 4 01:33:46 2003 Tanaka Akira <akr@m17n.org>
+Fri Jan 10 06:23:21 2014 Benoit Daloze <eregontp@gmail.com>
- * lib/pathname.rb (initialize): duplicate and freeze argument.
- (to_s): return duplicated string.
- (children): new method.
- (each_line): new alias to foreachline.
+ * range.c (Range#size): [DOC] improve description and add examples.
+ Patch by @skade. [Fixes GH-501]
-Fri Oct 3 16:13:19 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+Fri Jan 10 00:47:52 2014 Josef Stribny <strzibny@gmail.com>
- * ext/openssl/ossl_asn1.c: add DER encoder and decoder.
+ * ext/tk/extconf.rb: fix to pass arrays instead of strings to
+ libpathflag. patch at [ruby-core:59665]. [Bug #9386]
- * ext/openssl/ossl_asn1.h: add OpenSSL::ASN1 module.
+Thu Jan 9 20:49:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl.c (Init_openssl): call Init_ossl_asn1.
+ * configure.in: -mstackrealign is necessary for -msse2 working.
+ [ruby-core:54716] [Bug #8349]
- * ext/openssl/extconf.rb: check if X509_ATTRIBUTE has field "single".
+ * configure.in: use SSE2 instructions to drop unexpected precisions on
+ other than mingw. [ruby-core:59472] [Bug #8358]
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): accept
- DER encoded data argument.
+Thu Jan 9 20:31:10 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_get_value): return
- DER encoded data in OpenSSL::ASN1 types.
+ * hash.c (rb_objid_hash): should return `long'. brushup r44534.
-Fri Oct 3 13:02:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+ * object.c (rb_obj_hash): follow above change.
- * lib/test/unit.rb: refactored to use optparse.
+Thu Jan 9 19:12:37 2014 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit.rb: added support for selecting the output
- level from the command-line.
+ * vm.c (rb_vm_pop_cfunc_frame): added. It cares c_return event.
+ The patch base by drkaes (Stefan Kaes).
+ [Bug #9321]
- * lib/test/unit.rb: added a command-line switch to stop processing
- the command-line, allowing arguments to be passed to tests.
+ * variable.c (rb_mod_const_missing): use rb_vm_pop_cfunc_frame()
+ instead of rb_frame_pop().
- * lib/test/unit.rb: changed the method for specifying a runner or a
- filter from the command-line.
+ * vm_eval.c (raise_method_missing): ditto.
- * lib/test/unit/collector/objectspace.rb: fixed a bug causing all
- tests to be excluded when the filter was set to an empty array.
+ * vm_eval.c (rb_iterate): ditto.
- * test/testunit/collector/test_objectspace.rb: ditto.
+ * internal.h (rb_vm_pop_cfunc_frame): add decl.
-Fri Oct 3 08:14:32 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add tests.
+ provided by drkaes (Stefan Kaes).
- * lib/irb/ruby-lex.rb (RubyLex::identify_identifier): support
- 'class ::Foo' syntax. [ruby-talk:83514]
+ * vm.c, eval.c, include/ruby/intern.h (rb_frame_pop):
+ move definition of rb_frame_pop() and deprecate it.
+ It doesn't care about `return' events.
-Fri Oct 3 08:01:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Thu Jan 9 17:40:28 2014 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/test/unit/assertions.rb: added a default message for #assert,
- #assert_block, and #flunk.
+ * hash.c (rb_any_hash): should treat the return value of rb_objid_hash()
+ as `long', because ruby assumes the hash value of the object id of
+ an object is `long'.
+ this fixes test failures on mswin64 introduced at r44525.
- * test/testunit/test_assertions.rb: ditto.
+Thu Jan 9 09:55:20 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/test/unit/failure.rb: failures now show a better trace of where
- they occurred.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
+ quotes should not have changed. [ruby-core:59316] [Bug #9300]
- * test/testunit/test_failure.rb: ditto (added).
+ * ext/psych/lib/psych.rb: fixed missing require.
- * lib/test/unit/testcase.rb: ditto.
+ * test/psych/test_string.rb: test
- * test/testunit/test_testcase.rb: ditto.
+Thu Jan 9 09:51:00 2014 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/test/unit/util/backtracefilter.rb: added.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: anonymous structs
+ should be able to roundtrip. Thanks @splattael!
- * test/testunit/util/test_backtracefilter.rb: added.
+ * test/psych/test_object_references.rb: test for change
- * lib/test/unit/error.rb: changed to use BacktraceFilter and improved
- output.
+Wed Jan 8 22:53:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/testunit/test_error.rb: ditto.
+ * vm_insnhelper.c (vm_search_super_method): when super called in a
+ bound UnboundMethod generated from a module, no superclass is
+ found since the current defined class is the module, then call
+ method_missing in that case. [ruby-core:59619] [Bug #9377]
-Thu Oct 2 20:33:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 8 15:55:21 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/iconv/iconv.c (iconv_failure_initialize): conform with
- orthodox initialization method.
+ * hash.c (rb_objid_hash): return hash value from object ID with a
+ salt, extract from rb_any_hash().
- * ext/iconv/iconv.c (iconv_fail): initialize exception instance
- from the class, and do not share instance variables with the
- others. [ruby-dev:21470]
+ * object.c (rb_obj_hash): return same value as rb_any_hash().
+ fix r44125. [ruby-core:59638] [Bug #9381]
-Thu Oct 2 18:20:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 8 13:12:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (Init_Time): define initialize. [ruby-dev:21469]
+ * lib/timeout.rb (Timeout::ExitException.catch): pass arguments
+ for new instance.
-Thu Oct 2 17:39:38 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * lib/timeout.rb (Timeout::ExitException#exception): fallback to
+ Timeout::Error if couldn't throw. [ruby-dev:47872] [Bug #9380]
- * ext/openssl/ossl_engine.c: add a new module OpenSSL::Engine.
- it supports OpenSSL hardware cryptographic engine interface.
+ * lib/timeout.rb (Timeout#timeout): initialize ExitException with
+ message for the fallback case.
- * ext/openssl/ossl_engine.h: ditto.
+Tue Jan 7 12:43:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/MANIFEST: add ossl_engine.c and ossl_engine.h.
+ * lib/timeout.rb (Timeout#timeout): should not rescue ordinarily
+ raised ExitException, which should not be thrown.
- * ext/openssl/extconf.rb: add check for openssl/engine.h.
+ * lib/timeout.rb (Timeout::ExitException.catch): set @thread only if
+ it ought to be caught.
- * ext/openssl/ossl.c: call Init_ossl_engine().
+ * lib/timeout.rb (Timeout#timeout): when a custom exception is given,
+ no instance is needed to be caught, so defer creating new instance
+ until it is raised. [ruby-core:59511] [Bug #9354]
- * ext/openssl/ossl.h: include openssl/engine.h.
+Tue Jan 7 10:16:02 2014 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_pkey_{rsa,dsa,dh}.c: check if underlying
- EVP_PKEY referes engine.
+ * lib/rubygems: Update to RubyGems master 21e409d / RubyGems 2.2.1.
-Thu Oct 2 17:22:37 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ See http://rubygems.rubyforge.org/rubygems-update/History_txt.html
+ for a list of bug fixes.
- * time.c (time_load): restore instance variables (if any) before
- loading from marshaled data.
+ * test/rubygems: ditto.
-Thu Oct 2 14:19:15 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 7 10:10:46 2014 Eric Wong <e@80x24.org>
- * ext/iconv/iconv.c (iconv_fail): now yield erred substring, and
- set error object to $!.
+ * ext/json/generator/depend: add build dependencies for json extension
+ [Bug #9374] [ruby-core:59609]
+ * ext/json/parser/depend: ditto
- * ext/iconv/iconv.c (iconv_convert): error handler block should
- return appended part and the rest. if rest is nil, the
- conversion stops.
+Tue Jan 7 04:35:46 2014 Aman Gupta <ruby@tmm1.net>
-Thu Oct 2 12:00:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (ary_add_hash): Fix consistency issue between Array#uniq and
+ Array#uniq! [Bug #9340] [ruby-core:59457]
+ * test/ruby/test_array.rb (class TestArray): regression test for above.
- * variable.c (rb_const_defined_0): look up constants in Object as
- well. [ruby-dev:21458]
+Mon Jan 6 21:28:48 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/ruby/test_defined.rb (TestDefined::test_defined): test for
- constants.
+ * .gitignore: ignore *-fake.rb generated even when CROSS_COMPILING = no
+ since r42862.
-Thu Oct 2 11:17:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Sun Jan 5 20:14:14 2014 Benoit Daloze <eregontp@gmail.com>
- * lib/test/unit/assertions.rb: should not capture an
- AssertionFailedError unless explicitly requested.
+ * compar.c (cmp_equal): remove error hiding in Comparable#==.
+ Comparable#== no longer rescues exceptions silently.
+ This was the cause of quite a couple bugs. See #7688. [EXPERIMENTAL]
- * test/testunit/test_assertions.rb: ditto.
+ * test/ruby/test_comparable.rb: adapt assertion to match new behavior.
- * test/testunit/collector/test_objectspace.rb: fixed a test failure
- caused by methods being returned in different orders on different
- platforms by moving test sorting from TestSuite into the locations
- where suites are constructed. [ruby-talk:83156]
+ * lib/rdoc/method_attr.rb: fix bugs discovered by this change.
- * lib/test/unit/testcase.rb: ditto.
+ * test/rdoc/test_rdoc_normal_class.rb: fix bugs in tests.
- * lib/test/unit/testsuite.rb: ditto.
+Sat Jan 4 22:44:00 2014 Charlie Somerville <charliesome@ruby-lang.org>
- * lib/test/unit/collector/objectspace.rb: ditto.
+ * struct.c (rb_struct_set): return assigned value from setter method
+ rather than struct object. [Bug #9353] [ruby-core:59509]
-Thu Oct 2 03:25:01 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_struct.rb (test_setter_method_returns_value): add test
- * eval.c (rb_thread_raise): prototype; avoid VC++ warning.
+Sat Jan 4 21:44:31 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Thu Oct 2 01:37:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/ruby/test_gc.rb (TestGc#test_latest_gc_info): use
+ GC.stat(:key) instead of GC.stat.
- * time.c (time_mdump): new marshal dumper. _dump is still
- available for compatibility.
+Sat Jan 4 19:15:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (time_mload): new marshal loader.
+ * ext/socket/socket.c (rsock_syserr_fail_host_port): use format flags,
+ '+' to inspect, ' ' to quote unprintables.
- * marshal.c (w_object): preserve instance variables for objects
- with marshal_dump.
+ * ext/socket/socket.c (rsock_syserr_fail_path): ditto.
- * marshal.c (r_object0): restore instance variables before calling
- marshal_load.
+ * ext/socket/socket.c (rsock_syserr_fail_raddrinfo): ditto.
- * error.c (rb_warn_m): always return nil.
+ * ext/socket/socket.c (rsock_syserr_fail_host_port): add errno
+ argument version and use rb_syserr_fail_str() instead of
+ rb_sys_fail_str() with restoring errno.
-Thu Oct 2 01:32:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/socket.c (rsock_syserr_fail_path): ditto, and
+ rb_syserr_fail().
- * eval.c (rb_f_block_given_p): real required condition is
- ruby_frame->prev->iter == ITER_CUR.
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto, use
+ rsock_syserr_fail_raddrinfo().
- * eval.c (rb_block_given_p): ditto.
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto.
- * eval.c (block_pass): update ruby_frame->iter only when previous
- value is ITER_NOT.
+ * ext/socket/socket.c (setup_domain_and_type): ditto.
-Thu Oct 2 01:02:35 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jan 4 17:18:58 2014 Kazuki Tsujimoto <kazuki@callcc.net>
- * variable.c (rb_const_defined_at): should exclude constants from
- Object when TYPE(klass) == T_MODULE *and* exclude is on.
- [ruby-dev:21458]
+ * vm.c (RubyVM::OPTS): get rid of a garbage character.
- * variable.c (rb_const_get_0): do not lookup constants from Object
- when TYPE(klass) == T_MODULE *and* exclude is on.
+Sat Jan 4 10:17:54 2014 Eric Hodel <drbrain@segment7.net>
-Thu Oct 2 00:21:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/rinda/ring.rb (Rinda::RingFinger#make_socket): Use
+ ipv4_multicast_ttl option for portability.
- * test/logger/test_logger.rb: unlinking file before close causes
- problem under win32 box.
+Sat Jan 4 10:15:47 2014 Eric Hodel <drbrain@segment7.net>
- * lib/xsd/datatypes.rb(XSDFloat, XSDDouble): add +/- sign explicitly
- when stringified and embedded into XML instance. Ruby's sprintf may
- format -0.0 as "0.0" (no minus sign) depending on underlying C
- sprintf implementation.
+ * lib/rinda/ring.rb (Rinda::RingFinger#make_socket): Use
+ ipv4_multicast_loop option for portability. Patch by Jeremy Evans.
+ [ruby-trunk - Bug #9351]
- * test/xsd/test_xsd.rb, test/soap/test_basetype.rb: follow above change.
+Fri Jan 3 19:09:00 2014 Eric Wong <normalperson@yhbt.net>
- * test/soap/calc/*: give httpd config param "CGIInterpreter".
- "/usr/bin/env ruby" thing does not work under non-Unix boxes.
+ * ext/socket/socket.c (rsock_sys_fail_host_port): save and restore errno
+ before calling rb_sys_fail_str to prevent [BUG] errno == 0.
+ Patch by Eric Wong. [ruby-core:59498] [Bug #9352]
-Sat Oct 2 00:42:20 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/socket/socket.c (rsock_sys_fail_path): ditto
+ * ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto
+ * ext/socket/socket.c (rsock_sys_fail_raddrinfo_or_sockaddr): ditto
- * marshal.c (r_byte): retrieve pointer from string value for each
- time. [ruby-dev:24404]
+Fri Jan 3 10:43:57 2014 Aman Gupta <ruby@tmm1.net>
- * marshal.c (r_bytes0): ditto.
+ * test/net/imap/cacert.pem: generate new CA cert, since the last one
+ expired. [Bug #9341] [ruby-core:59459]
+ * test/net/imap/server.crt: new server cert signed with updated CA.
+ * test/net/imap/Makefile: add `make regen_certs` to automate this
+ process.
- * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
+Fri Jan 3 00:09:54 2014 Benoit Daloze <eregontp@gmail.com>
- * io.c (io_read): should freeze all reading buffer.
- [ruby-dev:24400]
+ * ext/bigdecimal: update class method call style from :: to .
+ in documentation and usage.
- * string.c (rb_str_sum): should use bignums when bits is greater
- than or equals to sizeof(long)*CHAR_BITS. [ruby-dev:24395]
+ * ext/bigdecimal/lib/bigdecimal/math.rb: [DOC] fix examples values.
+ Computations were made using ruby 2.0.0p247 to ensure
+ no effect of the recent BigDecimal bug.
- * eval.c (specific_eval): defer pointer retrieval to prevent
- unsafe sourcefile string modification. [ruby-dev:24382]
+ * ext/bigdecimal/sample/nlsolve.rb: fix indent.
- * string.c (rb_str_sum): wrong cast caused wrong result.
- [ruby-dev:24385]
+Thu Jan 2 16:07:21 2014 Masaki Matsushita <glass.saga@gmail.com>
- * enum.c (enum_sort_by): hide temporary array from
- ObjectSpace.each_object. [ruby-dev:24386]
+ * io.c (io_fwrite): freeze converted str.
- * string.c (rb_str_sum): check was done with false pointer.
- [ruby-dev:24383]
+Thu Jan 2 04:15:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
+ * eval.c (rb_longjmp): remove an extra modifier from the forward
+ declaration to match the actual definition. [ruby-core:59451]
+ [Bug #9338]
-Thu Oct 2 00:25:21 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 2 01:23:30 2014 Masaki Matsushita <glass.saga@gmail.com>
- * signal.c (ruby_signal_name): adjust to the prototype.
+ * vm_eval.c (method_missing): use ALLOCV_N() instead of
+ ALLOCA_N() and rb_ary_tmp_new().
- * process.c (pst_inspect): ditto.
+Thu Jan 2 00:53:16 2014 Masaki Matsushita <glass.saga@gmail.com>
- * ext/etc/etc.c (etc_getgrent, Init_etc): typo.
+ * array.c (rb_ary_zip): use ALLOCV_N() instead of ALLOCA_N().
-Wed Oct 1 20:49:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jan 2 00:04:29 2014 Masaki Matsushita <glass.saga@gmail.com>
- * gc.c (heaps): manage slots and limits together. [ruby-dev:21453]
+ * hash.c (rb_hash_keys): make rb_hash_keys() static.
+ it is no longer used from array.c since r43969.
+ the patch is from normalperson (Eric Wong).
+ [ruby-core:59449] [Feature #9336]
- * gc.c (add_heap): should not clear heaps slot even if realloc()
- failed.
+ * internal.h: remove definition of rb_hash_keys().
-Wed Oct 1 20:36:49 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Jan 1 18:19:35 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * MANIFEST: add wince/mkconfig_wce.rb.
+ * configure.in: reset LDFLAGS and DLDFLAGS for opt-dir again after
+ LIBPATHFLAG and RPATHFLAG are set. [ruby-dev:47868] [Bug #9317]
-Wed Oct 1 17:22:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jan 1 11:12:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/etc/etc.c: add new functions: setpwent, getpwent, endpwent,
- setgrent, getgrent, endgrent.
+ * configure.in: use SSE2 instructions for drop unexpected
+ precisions. [ruby-core:54738] [Bug #8358]
- * ext/socket/socket.c (sock_s_gethostbyname): do not reverse lookup.
+Tue Dec 31 23:49:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Oct 1 17:01:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval.c (rb_f_raise): add cause: optional keyword argument.
+ [ruby-core:58610] [Feature #8257] [EXPERIMENTAL]
- * eval.c (rb_load): Object scope had priority over required file
- scope. [ruby-dev:21415]
+Tue Dec 31 21:44:17 2013 Akio Tajima <artonx@yahoo.co.jp>
-Wed Oct 1 14:09:53 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * win32/Makefile.sub: remove HAVE_FSEEKO because fseeko removed from win32/win32.c
+ Fixed [Bug #9333].
- * wince/mkconfig_wce.rb: sorry, forget to commit.
+Tue Dec 31 21:02:27 2013 Masaki Matsushita <glass.saga@gmail.com>
-Wed Oct 1 10:08:42 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+ * io.c (io_fwrite): allocate frozen str only when str is not converted.
- * wince/setup.mak: add sigmarionIII SDK support.
+Tue Dec 31 15:44:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * wince/Makefile.sub: ditto.
+ * lib/mkmf.rb (RbConfig): expand RUBY_SO_NAME for extensions
+ backward compatibility. [ruby-core:59426] [Bug #9329]
- * wince/mkexports.rb: fix linker error in SH4.
+Mon Dec 30 23:33:07 2013 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * wince/mkconfig_wce.rb: camouflage RUBY_PLATFORM for compiling ext.
+ * variable.c: [DOC] adding extra example in docs.
+ patched by Steve Klabnik. [Bug #9210]
-Wed Oct 1 08:02:52 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
+Mon Dec 30 18:34:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * wince/time_wce.c (time): add zero check.
+ * encoding.c (must_encindex, rb_enc_from_index, rb_obj_encoding): mask
+ encoding index and ignore dummy flags. [ruby-core:59354] [Bug #9314]
-Tue Sep 30 16:11:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Dec 30 16:11:52 2013 WATANABE Hirofumi <eban@ruby-lang.org>
- * Makefile.in: copy lex.c from $(srcdir) if it's not the current
- directory. [ruby-dev:21437]
+ * tool/make-snapshot: needs CXXFLAGS. [ruby-core:59393][Bug #9320]
-Tue Sep 30 11:29:23 2003 Tanaka Akira <akr@m17n.org>
+Sun Dec 29 18:36:54 2013 Shota Fukumori <her@sorah.jp>
- * process.c (pst_inspect): describe stopped process "stopped".
+ * lib/mkmf.rb (configuration): Make CXXFLAGS customizable.
+ Patch by Kohei Suzuki (eagletmt). [Fixes GH-492]
-Tue Sep 30 09:31:56 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 29 12:11:11 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/runner.rb: glob for directories.
+ * proc.c (mnew_from_me): keep iclass as-is, to make inheritance
+ chain consistent. [ruby-core:59358] [Bug #9315]
-Tue Sep 30 09:11:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * proc.c (method_owner): return the original defined_class from
+ prepended iclass, instead.
- * eval.c (rb_eval): while/until should not capture break unless
- they are destination of the break.
+Sun Dec 29 08:47:24 2013 Lucas Allan Amorim <lucas.allan@gmail.com>
-Tue Sep 30 03:12:02 2003 Minero Aoki <aamine@loveruby.net>
+ * test/ruby/test_sprintf.rb (test_hash): Added tests for sprintf
+ with a hash as parameter. [Fixes GH-491]
- * lib/net/http.rb (finish): revert to 1.93.
+Sun Dec 29 07:27:51 2013 Benoit Daloze <eregontp@gmail.com>
- * lib/net/pop.rb (finish): revert to 1.60.
+ * compar.c (cmp_eq_recursive): Fix the return value, the value for
+ failed #<=> should be nil. It was raising a NoMethodError for
+ the test case TestComparable#test_no_cmp (undefined method `>'
+ for false:FalseClass). Yet one more reason for #7688.
- * lib/net/smtp.rb (finish): revert to 1.67.
+Sat Dec 28 22:21:59 2013 Benoit Daloze <eregontp@gmail.com>
- * lib/net/http.rb (do_start): ensure to close socket if failed to
- start session.
+ * object.c (Kernel#<=>) surround Comparable operators with <code> tags.
+ The #== method was hidden in ri/rdoc's output and was highlighting
+ the line instead.
- * lib/net/pop.rb (do_start): ditto.
+Sat Dec 28 17:24:00 2013 DV Suresh <e@dvsuresh.me>
- * lib/net/smtp.rb (do_start): ditto.
-
- * lib/net/smtp.rb: SMTP#started? wrongly returned false always.
-
-Tue Sep 30 02:54:49 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/ruby/test_iterator.rb: new test
- test_break__nested_loop[123].
-
-Mon Sep 29 23:39:13 2003 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/http.rb (finish): does not raise IOError even if
- !started?, to allow closing socket which was opened before
- session started.
-
- * lib/net/pop.rb (finish): ditto.
-
- * lib/net/smtp.rb (finish): ditto.
-
-Mon Sep 29 19:06:51 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * ext/win32ole/extconf.rb: add windows.h checking.
- (ruby-bugs:PR#1185)
-
-Mon Sep 29 16:18:30 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: check if the given logdevice object respond_to :write
- and :close, not is_a? IO. duck duck.
-
- * test/logger/test_logger.rb: self IO.pipe reading/writing may be
- locked by the flood. use tempfile.
-
- * lib/wsdl/xmlSchema/data.rb: wrong constant reference.
-
-Mon Sep 29 16:11:23 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb: clean up temporary symlink.
- Patched by NaHi. [ruby-dev:21420]
-
-Mon Sep 29 11:16:55 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_thread_atfork): wrong format specifier.
- [ruby-dev:21428]
-
- * process.c (pst_inspect): better description.
-
-Mon Sep 29 02:31:44 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/utils.rb (Utils::su): use setgid and setuid to
- set real and effective IDs. and setup group access list by
- initgroups.
-
-Sun Sep 28 11:14:19 2003 Koji Arai <jca02266@nifty.ne.jp>
-
- * ext/digest/digest.c (Init_digest): `copy_object' was deprecated.
- `initialize_copy' should be defined.
-
- * ext/stringio/stringio.c (Init_stringio): ditto.
-
-Sat Sep 27 18:25:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/xsd/charset.rb: XSD::Charset.is_ces did return always true under
- $KCODE = "NONE" environment. check added.
-
- * test/xsd/test_xsd.rb: add tests for above fix.
-
-Sat Sep 27 15:58:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/rpc/cgistub.rb: make logging severity threshold higher.
-
- * lib/soap/rpc/standaloneServer.rb: defer WEBrick server start to give
- a chance to reset logging severity threshold.
-
- * test/soap/calc/test_*, test/soap/helloworld/test_helloworld.rb: run
- silent.
-
-Sat Sep 27 09:44:18 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/test_fileutils.rb: clear all errors on Windows.
- [ruby-dev:21417]
-
- * test/fileutils/test_nowrite.rb: ditto.
-
-Mon Sep 27 09:14:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * array.c (rb_ary_delete): comparison may change the capacity.
- [ruby-dev:24348]
-
- * array.c (rb_ary_fill): fill should honor length argument.
- [ruby-dev:24346]
-
- * array.c (rb_ary_replace): should not use ptr from shared array.
- [ruby-dev:24345]
-
- * ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
- [ruby-talk:113807]
-
-Sat Sep 27 04:57:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_file.rb: new file. only asserts unlink-before-close
- behaviour now.
-
- * test/soap/marshal/test_digraph.rb: should close before unlink.
- unlink-before-close pattern is not needed here.
-
-Sat Sep 27 03:32:37 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/soap/*, test/wsdl/*, test/xsd/*: move TestCase classes into
- each module namespace. TestMarshal in
- test/soap/marshal/test_marshal.rb crashed with
- test/ruby/test_marshal.rb.
-
-Sat Sep 27 01:30:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_connect): on win32, type of the 4th
- argument of getsockopt is char *.
-
-Fri Sep 26 18:35:40 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/resolv-replace.rb: 1.8 compliance. [ruby-talk:82946]
-
-Fri Sep 26 17:39:27 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_marshal.rb: add test for ruby's objects.
-
-Fri Sep 26 09:52:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defines.h (flush_register_windows): use volatile only for gcc on
- Solaris. [ruby-dev:21403]
-
- * lib/mkmf.rb (xsystem): use system directly to honor shell meta
- charaters.
-
-Fri Sep 26 00:10:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/README: updated.
-
-Thu Sep 25 17:48:10 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/openssl/ossl.c (ossl_buf2str): fix type of 1st argument for
- rb_protect.
-
- * ext/openssl/ossl_hmac.c (ossl_hmac_digest): should return meaningful
- value.
-
-Thu Sep 25 09:00:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * lib/ostruct.rb: Added OpenStruct#==.
-
- * test/ostruct/test_ostruct.rb: Added.
-
-Thu Sep 25 07:55:26 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole.c, ext/openssl/ossl_pkey_dsa.c,
- ext/openssl/ossl_pkey_rsa.c, ext/bigdecimal/bigdecimal.h: must
- not use C++ or C99 style comment yet. (ruby-bugs:PR#1184)
-
-Thu Sep 25 00:23:22 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * MANIFEST: add SOAP4R.
-
-Thu Sep 25 00:13:15 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/soap/* (29 files): SOAP4R added.
-
- * lib/wsdl/* (42 files): WSDL4R added.
-
- * lib/xsd/* (12 files): XSD4R added.
-
- * test/soap/* (16 files): added.
-
- * test/wsdl/* (2 files): added.
-
- * test/xsd/* (3 files): added.
-
- * sample/soap/* (27 files): added.
-
- * sample/wsdl/* (13 files): added.
-
-Wed Sep 24 02:08:11 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpservlet/cgihandler.rb: conform to mswin32.
- [ruby-talk:82735], [ruby-talk:82748], [ruby-talk:82818]
-
-Tue Sep 23 23:10:16 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: add Logger#<<(msg) for writing msg without any
- formatting.
-
- * test/logger/test_logger.rb: ditto.
-
-Tue Sep 23 20:47:51 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * error.c (rb_warn_m): should not warn if -W0 is specified.
- [ruby-talk:82675]
-
-Mon Sep 22 21:28:57 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * MANIFEST: updated.
-
-Mon Sep 22 19:22:26 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * configure.in (AC_CHECK_FUNCS): add setuid and setgid.
-
-Mon Sep 22 12:34:55 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * util.c (ruby_strtod): skip preceding zeros before counting
- digits in the mantissa. (ruby-bugs:PR#1181)
-
-Sun Sep 21 04:12:36 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): the argument
- should be a String.
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): ditt.
-
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): ditto.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): ditto.
-
-Sat Sep 20 11:49:05 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: typo fixed.
-
- * test/logger/test_logger.rb: new file.
-
-Fri Sep 19 11:39:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
-
- * test/testunit/*: Added.
-
- * lib/test/unit.rb: Documentation update.
-
- * lib/test/unit/ui/console/testrunner.rb (TestRunner#initialize):
- Ditto.
-
- * lib/test/unit.rb: Factored out an ObjectSpace collector.
-
- * lib/test/unit/collector/objectspace.rb: Ditto.
-
- * sample/testunit/*: Added.
-
-Fri Sep 19 01:00:48 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/log.rb (BasicLog#log): get rid of as ineffectual
- condition.
-
- * lib/webrick/log.rb (BasicLog#format): add "\n" to message.
-
-Thu Sep 18 22:43:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): should push PROT_PCALL tag for orphans.
-
- * eval.c (proc_invoke): should update "result" for orphans.
-
-Thu Sep 18 20:33:03 2003 Tietew <tietew-ml-ruby-list@tietew.net>
-
- * parse.y (str_xquote): do not prepend escapes in
- backqoute literals. [ruby-list:38409]
-
-Thu Sep 18 20:30:17 2003 Tanaka Akira <akr@m17n.org>
-
- * lib/pathname.rb: update document.
-
-Thu Sep 18 15:27:05 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/logger.rb: new file. Logger, formerly called devel-logger or
- Devel::Logger.
-
- * sample/logger/*: new file. samples of logger.rb.
-
-Wed Sep 17 23:41:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (localjump_destination): should not raise ThreadError
- exception for "break". [ruby-dev:21348]
-
- * eval.c (proc_invoke): use result instead of prot_tag->retval.
- retval is no longer propagated to the ancestors.
-
-Wed Sep 17 20:34:00 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (tokadd_string, parse_string, yylex): escaped terminator
- is now interpreted as is. [ruby-talk:82206]
-
-Wed Sep 17 18:52:36 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/fileutils/fileassertions.rb: new file.
-
- * test/fileutils/test_fileutils.rb: new file.
-
- * test/fileutils/test_nowrite.rb: new file.
-
-Wed Sep 17 18:51:02 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/strscan/test_stringscanner.rb: require test/unit.
-
-Wed Sep 17 18:35:34 2003 Minero Aoki <aamine@loveruby.net>
-
- * test/strscan/test_stringscanner.rb: new file.
-
-Wed Sep 17 18:03:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl: all files are reviewed to simplify and avoid memory leak.
-
- * ext/openssl/extconf.rb: add check for assert.h.
-
- * ext/openssl/ossl.c (ossl_buf2str): new function to convert
- C buffer to String and free buffer.
-
- * ext/openssl/ossl.c (ossl_x509_ary2sk): new function to convert
- Array of OpenSSL::X509 to STACK_OF(X509) with exception safe.
-
- * ext/openssl/ossl.c (ossl_to_der, ossl_to_der_if_possible): new
- functions to convert object to DER string.
-
- * ext/openssl/ossl.h: ditto.
-
- * ext/openssl/ossl_bio.c (ossl_membio2str): new function to convert
- BIO to String object and free BIO.
-
- * ext/openssl/ossl_bio.h: ditto.
-
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_to_der): add for "to_der".
-
- * ext/openssl/ossl_x509name.c (ossl_x509name_to_der): ditto.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_to_der): ditto.
-
- * ext/openssl/ossl_x509ext.c (create_ext_from_array): removed
- and reimplement in openssl/x509.rb.
-
- * ext/openssl/ossl_x509attr.c: reimplemented and disable some
- method temporarily. this class doesn't work fine without ASN.1
- data support;-) I'll rewrite in near future.
-
- * ext/openssl/lib/openssl/x509.c (X509::Attribute): get rid off
- unused code.
-
- * ext/openssl/lib/openssl/x509.c (X509::ExtensionFactory): refine all.
-
-Tue Sep 16 22:25:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/csv/test_csv.rb: add negative tests of row_sep.
-
-Tue Sep 16 18:02:36 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * regex.c (re_compile_pattern): should not translate character
- class range edge. [ruby-list:38393]
-
-Tue Sep 16 16:47:56 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * MANIFEST: add test/csv/mac.csv.
-
- * win32/Makefile.sub, bcc32/Makefile.sub (test): add phony NUL target.
-
-Mon Sep 15 19:02:52 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * lib/csv.rb: add extra pamameter to specify row(record) separater
- character. To parse Mac's CR separated CSV, do like this.
- CSV.open("mac.csv", "r", ?,, ?\r) { |row| p row.to_a }
- The 3rd parameter in this example ?, is for column separater and the
- 4th ?\r is for row separater. Row separater is nil by default. Nil
- separater means "\r\n" or "\n".
-
- * test/csv/test_csv.rb: add tests for above feature.
-
- * test/csv/mac.csv: added. Sample CR separated CSV file.
-
-Fri Sep 12 22:41:48 2003 Michal Rokos <m.rokos@sh.cvut.cz>
-
- * ext/openssl/ossl.c: move ASN.1 stuff to ossl_asn1.[ch]
-
- * ext/openssl/ossl.c: move BIO stuff to ossl_bio.[ch]
-
- * ext/openssl/ossl_asn1.[ch]: new files
-
- * ext/openssl/ossl_bio.[ch]: new files
-
-Fri Sep 12 12:30:41 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * intern.h (rb_disable_super, rb_enable_super): replace with dummy
- expressions instead of prototypes. the functions remain yet for
- binary compatibility. [ruby-talk:81758]
-
-Fri Sep 12 12:09:54 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * bignum.c (rb_big_and): convert argument using 'to_int'.
-
- * bignum.c (rb_big_or): ditto.
-
- * bignum.c (rb_big_xor): ditto.
-
-Fri Sep 12 07:06:14 2003 David Black <dblack@superlink.net>
-
- * lib/scanf.rb: Took out useless @matched_item variable; some small
- refactoring.
-
-Thu Sep 11 08:43:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_f_require): allow "require" on $SAFE>0, if feature
- name is not tainted.
-
- * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream):
- Supports StringIO.
-
-Wed Sep 10 22:47:30 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.h: add a workaround for win32 platform.
- libeay32.dll doesn't export functions defined in conf_api.h.
-
- * ext/openssl/ossl_config.c (ossl_config_initialize): ditto.
-
- * ext/openssl/ossl_config.c (ossl_config_add_value): ditto.
-
- * ext/openssl/ossl_config.c (set_conf_section_i): should check
- if the argument is Array.
-
-Wed Sep 10 22:41:54 2003 Tietew <tietew@tietew.net>
-
- * eval.c (win32_get_exception_list): avoid VC7 warning.
- [ruby-win32:577]
-
-Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (struct tag): dst should be VALUE.
-
-Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (localjump_destination): stop at the scope where the current
- block was created. [ruby-dev:21353]
-
-Tue Sep 9 05:17:04 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_config.rb: avoid compile error in OpenSSL-0.9.6.
-
-Tue Sep 9 02:41:35 2003 Michal Rokos <m.rokos@sh.cvut.cz>
-
- * ext/openssl/ossl_config.c: Refine compatibility.
-
-Tue Sep 9 01:50:45 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/httpserver.rb (HTTPServer#access_log): add "\n" to
- the message.
-
- * lib/webrick/log.rb (BasicLog#log): add "\n" only if needed.
-
-Mon Sep 8 22:15:33 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tk/lib/multi-tk.rb: modify security check at creating
- a new interpreter
-
-Mon Sep 8 20:00:12 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb, lib/optparse/version.rb: search also all
- capital versions.
-
-Mon Sep 8 19:26:33 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl.h: include openssl/conf.h and openssl/conf_api.h.
-
- * ext/openssl/ossl_config.c: refine all with backward compatibility.
-
- * ext/openssl/ossl_config.h: export GetConfigPtr() and DupConfigPtr().
-
- * ext/openssl/ossl_x509.c: added new constants under X509 module.
- DEFAULT_CERT_AREA, DEFAULT_CERT_DIR, DEFAULT_CERT_FILE,
- DEFAULT_CERT_DIR_ENV, DEFAULT_CERT_FILE_ENV and DEFAULT_PRIVATE_DIR.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_free): don't free
- the members of the struct. it's left to GC.
-
- * ext/openssl/ossl_x509ext.c (ossl_x509_set_config): add for config=.
-
- * ext/openssl/ossl_x509ext.c (Xossl_x509extfactory_initialize):
- add attr readers: issuer_certificate, subject_certificate,
- subject_request, crl and config.
-
-Mon Sep 8 18:26:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/accesslog.rb (AccessLog::setup_params): use req.port
- instead of config[:Port] or req.request_uri.port.
-
- * lib/webrick/httprequest.rb (HTTPRequest#meta_vars): ditto.
-
- * lib/webrick/httpservlet/filehandler.rb (FileHandler#dir_list): ditto.
-
- * lib/webrick/config.rb: :Listen option never be used.
-
- * lib/webrick/server.rb (GenericServer#initialize): don't use :Listen
- option and add warning message.
-
- * lib/webrick/log.rb (BasicLog#<<): shortcut of log(INFO, ...).
-
- * lib/webrick/httpserver.rb (HTTPServer#accesslog): use << for logging.
-
-Sun Sep 7 16:08:28 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (lib_mainloop_core): fixed signal-trap bug
-
- * ext/tk/lib/*.rb : Ruby/Tk works at $SAFE == 4
-
-Sat Sep 6 02:26:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_*.rb: assert_same, assert_match, and so on.
-
-Sat Sep 6 18:45:46 2003 Mauricio Fernandez <batsman.geo@yahoo.com>
-
- * parse.y (assignable): call rb_compile_error(), not rb_bug().
- [ruby-core:01523]
-
-Sat Sep 6 17:40:41 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ruby_missing.c: rid of unnecessary backward
- compatibility stuff. and remove DEFINE_ALLOC_WRAPPER from
- all sources.
-
- * ext/openssl/ossl_x509ext.c (X509::Extension.new): new method.
-
- * ext/openssl/ossl_x509ext.c (X509::Extension#oid=): new method.
-
- * ext/openssl/ossl_x509ext.c (X509::Extension#value=): new method.
-
- * ext/openssl/ossl_x509ext.c (X509::Extension#critical=): new method.
-
-Sat Sep 6 01:23:22 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (CreateChild): need to quote cmd if RUBYSHELL is set.
-
- * win32/win32.c (CreateChild): fix condition about whether to call
- shell or not.
-
-Sat Sep 6 00:36:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
-
- * Makefile.in (test): phony target.
-
- * lib/mkmf.rb (have_library, find_library): configure by library
- name.
-
- * lib/optparse.rb (OptionParser#order, #permute, #parse): allow an
- array as argument.
-
- * test/ruby/test_*.rb: moved invariants to left side in
- assert_equal, and use assert_nil, assert_raises and so on.
-
- * win32/win32.c (isInternalCmd): distinguish command.com and
- cmd.exe.
-
- * win32/win32.c (make_cmdvector): a character just after wildcard
- was ignored. [ruby-core:01518]
-
-Fri Sep 5 20:27:08 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'
-
-Fri Sep 5 18:00:51 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/x509.rb: new method X509::Name::parse.
-
- * ext/openssl/ossl_digest.c: add ossl_digest_new().
-
- * ext/openssl/ossl_digest.h: ditto.
-
- * ext/openssl/ossl_cipher.c: add ossl_cipher_new().
-
- * ext/openssl/ossl_cipher.h: ditto.
-
-Fri Sep 5 15:32:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): should not
- search delimiter forward if found in backward.
-
-Fri Sep 5 13:32:48 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/runner.rb: arguments should be keys.
-
-Fri Sep 5 12:09:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * test/ruby/test_system.rb (test_system): check existence of ruby
- interpreter.
-
-Fri Sep 5 11:32:17 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (--version): fix assignment/reference order.
-
- * lib/optparse.rb (OptionParser#help): new; OptionParser#to_s may
- be deprecated in future.
-
- * lib/optparse/version.rb (OptionParser#show_version): hide Object.
-
- * test/runner.rb: fix optparse usage.
-
- * test/runner.rb: glob all testsuits if no tests given.
-
-Fri Sep 5 10:42:58 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/runner.rb: added. gets testcases from command line and runs it.
-
- * test/ruby/test_gc.rb: remove useless part which was for dumping test
- result.
-
-Fri Sep 5 09:28:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby/test_gc.rb: added. splitter.rb which I made to split
- sample/test.rb into test/ruby/test_* kindly removed GC test (the
- last section in the original test) to reduce things to be worried.
-
-Fri Sep 5 03:00:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_iterator.rb (test_block_in_arg): add no block
- given tests.
-
- * test/ruby/test_iterator.rb (test_ljump): uncomment LocalJumpError
- test.
-
-Fri Sep 5 01:10:11 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/ruby: tests for ruby itself.
-
- * test/ruby/test_*.rb: split sample/test.rb into 28 test/unit testcases.
- some tests could not be translates... search '!!' mark to see it.
-
- * test/csv/test_csv.rb: should require 'csv', not '../lib/csv'. test
- runner should set load path correctly.
-
-Fri Sep 5 01:03:59 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/csv/test_csv.rb: close opened files for CSV::IOBuf explicitly.
- opened file cannot be removed under win32 box.
-
-Thu Sep 4 23:59:40 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (tokadd_string): newlines have no special meanings in
- %w/%W, otherwise they are ignored only when interpolation is
- enabled. [ruby-dev:21325]
-
-Thu Sep 4 19:38:25 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * ext/io/wait/.cvsignore: added.
-
- * ext/openssl/.cvsignore: added.
-
-Thu Sep 4 19:28:24 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * sample/openssl: added. Sample of standard distribution library
- should be locate in sample/{module_name}/*.
-
- * ext/openssl/sample/*: removed. move to sample/openssl/*.
-
-Thu Sep 4 18:02:15 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/csv/test_csv.rb: use remove_const to reduce warnings. use
- Dir.tmpdir to locate working files.
-
-Thu Sep 4 17:41:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-mode.el (ruby-here-doc-beg-re): underscore also is
- valid delimiter.
-
- * misc/ruby-mode.el (ruby-here-doc-end-match): must quote
- arbitrary string to use as regexp.
-
- * misc/ruby-mode.el (ruby-font-lock-maybe-here-docs): must not
- call `ruby-here-doc-end-match' unless `ruby-here-doc-beg-re'
- matched.
-
-Thu Sep 4 15:40:07 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test/csv/test_csv.rb: run on test/unit original layer.
-
-Thu Sep 4 12:54:50 2003 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/token.c: headerless documents with root-level spacing now
- honored.
-
-Thu Sep 4 00:06:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (mark_frame_adj): need to adjust argv pointer if using
- system's alloca. [ruby-core:01503]
-
-Wed Sep 3 21:33:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
-
- * test: add test directory. Test::Unit aware testcases and needed
- files should be located in this directory. dir/file name convention;
- test/{module_name}/test_{testcase_name}.rb
- test/{module_name}/{needed_files}
- someday, someone will write testrunner which searches test_*.rb and
- run testcases automatically.
-
- * test/csv/*: add testcase for lib/csv.rb.
-
-Wed Sep 3 01:37:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * io.c (rb_f_gets): should call next_argv() before type check
- current_file. [ruby-list:38336]
-
-Tue Sep 2 20:37:15 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): warning
- for skipping server verification.
-
-Tue Sep 2 23:36:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (proc_invoke): should retrieve retval when pcall is true.
-
-Tue Sep 2 14:09:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).
- the patch is submitted by nmu <nmu@users.sourceforge.jp>.
-
- * ext/socket/getaddrinfo.c (getaddrinfo): should use in6_addr8 on
- some platforms.
-
- * ext/socket/getnameinfo.c (getnameinfo): ditto.
-
-Tue Sep 2 14:02:19 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception
-
- * ext/tk/lib/{tk.rb, tkcanvas.rb, tkfont.rb, tktext.rb} :
- bug fix and improvement of font control
-
-Tue Sep 2 09:51:36 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): should not handle exceptions within rescue
- argument. [ruby-talk:80804]
-
-Tue Sep 2 00:44:37 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_memsearch): fix overrun. [ruby-talk:80759]
-
-Tue Sep 2 00:41:27 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/iconv/iconv.c (map_charset): use lower case keys.
-
- * ext/iconv/iconv.c (iconv_fail): just yield error and return the
- result if a block is given.
-
- * ext/iconv/iconv.c (iconv_convert): yield error and append the
- result if a block is given.
-
- * ext/iconv/charset_alias.rb (charset_alias): optional third
- argument.
-
- * ext/iconv/charset_alias.rb (charset_alias): use CP932 instead of
- SHIFT_JIS on cygwin.
-
-Mon Sep 1 18:34:25 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval): make tail recursion in ELSE clause of
- RESCUE a jump.
-
-Mon Sep 1 18:00:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (aref_args): forgot to call NEW_SPLAT(). reported by
- Dave Butcher.
-
- * eval.c (Init_Thread): protect thgroup_default. suggested by Guy
- Decoux in [ruby-talk:80623]
-
-Mon Sep 1 16:59:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_thread_switch): add RESTORE_EXIT; exit by another
- thread termination.
-
- * eval.c (rb_thread_start_0): should not error_print() within
- terminated thread, because $stderr used by it might be
- overriden now. [ruby-dev:21280]
-
-Sun Aug 31 22:46:55 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * eval.c (TAG_DST()): take no argument.
-
- * process.c (p_gid_sw_ensure): return VALUE.
-
-Sun Aug 31 22:27:10 2003 Hidetoshi NAGAI <nagai@dumbo.ai.kyutech.ac.jp>
-
- * process.c (p_gid_sw_ensure): lack of function type
-
-Sun Aug 31 12:25:06 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
-
- * lib/optparse.rb: --version takes an optional argument; "all" or
- a list of package names.
-
-Sun Aug 31 10:17:02 2003 Tadayoshi Funaba <tadf@dotrb.org>
-
- * lib/date/format.rb: yyyy/mm is not an acceptable format.
-
- * lib/time.rb: follow above.
-
-Sat Aug 30 14:25:43 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_iter_break): should not call TAG_JUMP directly.
-
-Sat Aug 30 03:58:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (struct BLOCK): remove BLOCKTAG, use scope instead.
-
- * eval.c (POP_TAG): no longer propagate retval. retval is now set
- directly by localjump_destination().
-
- * eval.c (localjump_destination): new function to cast
- return/break local jump.
-
- * eval.c (rb_yield_0): stop TAG_RETURN/TAG_BREAK escaping.
-
-Fri Aug 29 22:35:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * bigdecimal.c *.html: The 2nd arg. for add,sub,mult, and div is 0,
- then result will be the same as +,-,*,/ respectively.
-
-Fri Aug 29 17:30:15 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
-
- * process.c: bug fix
-
- * process.c: add rb_secure(2) to methods of Process::{UID,GID,Sys}
-
- * process.c: deny handling IDs during evaluating the block given to
- the Process::{UID,GID}.switch method
-
- * ext/tcltklib/tcltklib.c : some methods have no effect if on slave-IP
-
- * ext/tcltklib/tcltklib.c : can create a interpreter without Tk
-
- * ext/tcltklib/tcltklib.c : bug fix on handling exceptions
-
- * ext/tcltklib/MANUAL.euc : modify
-
- * ext/tk/lib/tk.rb : freeze some core modules
-
- * ext/tk/lib/multi-tk.rb : more secure
-
- * ext/tk/lib/tk.rb: TkVariable.new(array) --> treat the array as the
- Tk's list
-
- * ext/tk/lib/tk.rb: improve accessibility of TkVariable object
-
- * ext/tk/lib/tk.rb, ext/tk/lib/tkfont.rb, ext/tk/lib/tkcanvas.rb,
- ext/tk/lib/tktext.rb : fix bug of font handling
-
- * ext/tk/lib/tkfont.rb TkFont.new() accepts compound fonts
-
-Thu Aug 28 22:07:12 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_autoload_load): call const_missing if autoloading
- constant is not defined to allow hook.
-
- * eval.c (rb_eval): use rb_const_get_from() instead of
- rb_const_get_at().
-
- * eval.c (is_defined): forgot to check NODE_COLON3.
-
-Thu Aug 28 17:30:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * variable.c (rb_const_get_0): should check constants defined in
- included modules, if klass is Object. [ruby-talk:79302]
-
- * numeric.c (check_uint): check should be done using UINT_MAX, not
- INT_MAX. this fix is submitted by Lyle Johnson
- <lyle@knology.net> in [ruby-core:01486]
-
-Thu Aug 28 05:02:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (singleton): typo fixed (ruby-bugs-ja:PR#562)
-
-Thu Aug 28 02:37:45 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_eval): *a = [1,2] now assigns [[1,2]] to a.
- consistent with *a = [1], which set [[1]] to a.
-
- * node.h: merge NODE_RESTARY to NODE_SPLAT.
-
- * parse.y: rules simplified a bit by removing NODE_RESTARY.
-
- * sample/test.rb: updated for new assignment behavior.
-
-Wed Aug 27 22:33:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_bug): should not use other methods; this function is
- not for ordinary use. [ruby-dev:21259]
-
-Wed Aug 27 15:07:57 2003 Minero Aoki <aamine@loveruby.net>
-
- * lib/net/smtp.rb (check_response): AUTH CRAM-MD5 returns 334
- response. [ruby-list:38279]
-
-Wed Aug 27 05:10:15 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (map_errno): support winsock error.
-
- * win32/win32.c (pipe_exec, CreateChild, poll_child_status, waitpid,
- kill, link, rb_w32_rename, unixtime_to_filetime, rb_w32_utime):
- pass errno to map_errno().
-
- * win32/win32.c (rb_w32_select, rb_w32_accept, rb_w32_bind,
- rb_w32_connect, rb_w32_getpeername, rb_w32_getsockname,
- rb_w32_getsockopt, rb_w32_ioctlsocket, rb_w32_listen, rb_w32_recv,
- rb_w32_recvfrom, rb_w32_send, rb_w32_sendto, rb_w32_setsockopt,
- rb_w32_shutdown, rb_w32_socket, rb_w32_gethostbyaddr,
- rb_w32_gethostbyname, rb_w32_gethostname, rb_w32_getprotobyname,
- rb_w32_getprotobynumber, rb_w32_getservbyname, rb_w32_getservbyport,
- rb_w32_fclose, rb_w32_close): use map_errno().
-
- * win32/win32.h: add winsock errors.
-
-Tue Aug 26 23:53:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * lib/ostruct.rb (OpenStruct::method_missing): prohibit modifying
- frozen OpenStruct. [ruby-talk:80214]
-
-Tue Aug 26 20:03:50 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_tmpsrc): add the hook for source.
- [ruby-list:38122]
-
-Tue Aug 26 15:59:53 2003 why the lucky stiff <why@ruby-lang.org>
-
- * implicit.c (syck_type_id_to_taguri): corrected detection of
- x-private types.
-
-Sun Aug 24 01:02:48 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (file_expand_path): performance improvement.
- [ruby-talk:79748]
-
-Sat Aug 23 23:41:16 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
- apparent cases. [ruby-talk:79748]
-
-Sat Aug 23 18:56:53 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/nkf/nkf.c (rb_nkf_putchar): should use rb_str_resize() to just
- resize a string, rb_str_cat() disallows NULL. [ruby-dev:21237]
-
-Sat Aug 23 16:48:41 2003 Keiju Ishitsuka <keiju@ishitsuka.com>
-
- * lib/irb/ruby-lex.rb: bug fix for "foo" !~ /bar/. [ruby-talk:79942]
-
-Sat Aug 23 15:59:58 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (rb_eval, rb_iterate, block_pass): reduce PUSH/POP_TAG and
- EXEC_TAG() for retry. [ruby-dev:21216]
-
-Sat Aug 23 02:32:33 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (rb_yield_splat): should check if "values" is array.
-
- * enum.c (each_with_index_i): typo.
-
-Fri Aug 22 17:07:05 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * enum.c (inject_i): use rb_yield_values.
-
- * enum.c (each_with_index_i): ditto.
-
- * eval.c (rb_yield_splat): new function to call "yield *values".
-
- * string.c (rb_str_scan): use rb_yield_splat().
-
-Fri Aug 22 06:13:22 2003 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/rubyext.c: refactoring of the transfer method
- dispatch. added yaml_org_handler for faster dispatch of
- transfers to base types.
-
- * lib/yaml/rubytypes.rb: removed handling of builtins from
- Ruby library.
-
- * ext/syck/token.c: quoted and block scalars are now implicit !str
-
- * ext/syck/implicit.c: empty string detected as !null.
-
-Fri Aug 22 01:00:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (block_pass): improve passing current block.
-
-Fri Aug 22 00:13:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c: Int. overflow bug in multiplication
- fixed, and VpNmlz() speed up.
-
-Wed Aug 20 16:44:49 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (ruby_connect): many systems seem to have
- a problem in select() after EINPROGRESS. [ruby-list:38080]
-
-Wed Aug 20 01:31:17 2003 why the lucky stiff <why@ruby-lang.org>
-
- * ext/syck/syck.h: Parser definition problems on HP-UX.
- [ruby-talk:79389]
-
- * ext/syck/handler.c (syck_hdlr_get_anchor): Memory leak.
-
- * ext/syck/syck.s (syck_io_file_read): Bad arguments to fread.
-
- * ext/syck/rubyext.c: Tainting issues.
-
-Tue Aug 19 23:20:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c .h .html: to_s("+") implemented.
-
- * ext/bigdecimal/lib/bigdecimal/math.rb: E implemented.
-
-Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * lib/webrick/ssl.rb: new file; SSL/TLS enhancement for GenericServer.
-
- * lib/webrick/https.rb: SSLSocket handling is moved to webrick/ssl.rb.
-
- * lib/webrick/compat.rb (File::fnmatch): remove old migration code.
-
- * lib/webrick/httpserver.rb (HTTPServer#run): ditto.
-
- * lib/webrick/server.rb (GenericServer#listen): the body of this
- method is pull out as Utils::create_lisnteners.
-
- * lib/webrick/utils.rb (Utils::create_lisnteners): new method.
-
- * lib/webrick/server.rb (GenericServer#start): should rescue
- unknown errors. and refine comments.
-
- * ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): should close
- socket if SSLSocket raises error.
-
-Tue Aug 19 11:19:33 2003 Shugo Maeda <shugo@ruby-lang.org>
-
- * io.c (next_argv): should not call GetOpenFile() if rb_stdout is
- not a IO (T_FILE).
-
-Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/ossl_ssl.c: sync_close is moved to SSLSocket as
- a builtin.
-
- * ext/openssl/lib/openssl/buffering.rb (Buffering#close): ditto.
-
- * ext/openssl/lib/openssl/buffering.rb (Buffering#puts): should
- add a return to the tails of each line.
-
- * ext/openssl/lib/openssl/ssl.rb: new class OpenSSL::SSL::SSLServer.
-
- * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): use sync_close.
-
- * ext/openssl/sample/echo_svr.rb: use SSLServer.
-
- * ext/openssl/sample/echo_cli.rb: add example of SSLSocket#sync_close.
-
-Tue Aug 19 01:24:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): Mac OS X standard
- headers are inconsistent at this macro. [ruby-core:01432]
-
- * ext/curses/extconf.rb: check if _XOPEN_SOURCE_EXTENDED breaks.
-
- * ext/tcltklib/stubs.c: Status macro in X11/Xthreads.h bothers
- winspool.h
-
- * instruby.rb: make list at first instead of iterator.
- [ruby-talk:79347]
-
-Mon Aug 18 11:23:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): preserve raw order for **.
-
-Sun Aug 17 23:39:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/extconf.rb (HAVE_VA_ARGS_MACRO): need to compile.
-
-Sun Aug 17 17:10:03 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
-
- * ext/openssl/lib/openssl/ssl.rb (SSLSocket#sync_close=): add a
- method to specify if the underlying IO will be closed in
- SSLSocket#close.
-
- * ext/openssl/lib/openssl/buffering.rb: add forwarders to
- setsockopt, getsockopt and fcntl.
-
- * ext/openssl/lib/net/protocols.rb: enable sync for SSLSocket.
-
-Sun Aug 17 11:32:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): should not force to remake Makefile when
- installation and so on.
-
-Sat Aug 16 23:58:18 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_symbol, w_object): get rid of warnings.
-
- * re.c (rb_memsearch): ditto.
-
- * time.c (time_dump): ditto.
-
- * ext/extmk.rb (extmake): not continue making when extconf.rb
- failed.
-
- * ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely.
-
- * ext/openssl/ossl.h: remove version.h dependency.
-
- * ext/openssl/ruby_missing.h: ditto.
-
- * lib/mkmf.rb (pkg_config): use --libs output except with
- only-L for other options. [ruby-list:38099]
-
- * lib/mkmf.rb (create_makefile): separate rule for static
- library from shared object.
-
- * win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub:
- define exec_prefix and libdir.
-
-Fri Aug 15 23:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c .h: Bug in combination of limit & div
- method fixed.
-
- * ext/bigdecimal/lib/bigdecimal/math.rb: atan() & sqrt() added.
-
-Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (HUGE_ST_INO): check whether struct stat.st_ino
- is larger than long. [ruby-dev:21194]
- http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html
-
- * error.c (syserr_eqq): errno might exceed Fixnum limit.
-
- * error.c (Init_Exception): moved base initialization from
- init_syserr().
-
- * inits.c (rb_call_inits): postpone initializing errnos until
- Bignum is available.
-
-Fri Aug 15 12:01:43 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let
- keyname() and so on be declared.
-
- * ext/curses/curses.c (curses_resizeterm, window_resize):
- arguments conflicted with macros in term.h.
-
- * ext/curses/curses.c (Curses module methods): ensure
- initialized. [ruby-dev:21191]
-
-Fri Aug 15 02:08:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * gc.c (id2ref): recycle check should be done by klass == 0.
- [ruby-core:01408]
-
-Fri Aug 15 01:34:23 2003 Michal Rokos <m.rokos@sh.cvut.cz>
-
- * ext/openssl/ossl_pkey.c: move generate_cb here
-
- * ext/openssl/ossl_pkey_{dh|dsa|rsa}.c: adapt to this cb
-
- * ext/openssl/openssl_missing.[ch]: add (0.9.6x, x<j) missing BN funcs
-
- * ext/openssl/ossl_bn.c: use supplied funcs from openssl_missing.c
-
-Fri Aug 15 00:38:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c: Bug in div method fixed.
-
- * ext/bigdecimal/lib/bigdecimal/math.rb: Newly added.
-
- * ext/bigdecimal/sample/pi.rb: Changed so as to use math.rb.
-
-Thu Aug 14 21:19:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (Init_Thread): Continuation#[] added. [ruby-talk:79028]
-
-Thu Aug 14 20:03:34 2003 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (OLE_FREE): should not call
- ole_message_loop.
-
- * ext/win32ole/win32ole.c (ole_event_free): ditto.
-
- * ext/win32ole/win32ole.c (ole_initialize): stop calling
- OleUninitialize at exit.
-
-Thu Aug 14 11:27:37 2003 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gc.c (rb_data_object_alloc): check type of 1st argument.
- [ruby-dev:21192]
-
-Thu Aug 14 00:21:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs.
-
- * parse.y (lhs): ditto.
-
- * parse.y (yylex): should return tCOLON3 right after kCLASS.
- [ruby-talk:78918]
-
- * error.c (exc_initialize): was converting argument to string too
- eagerly. Only check was needed. [ruby-talk:78958]
-
-Wed Aug 13 23:31:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c .h .html: Ambiguity of
- BigDecimal::limit removed.
-
-Wed Aug 13 19:21:34 2003 Christian Neukirchen <chneukirchen@yahoo.de>
-
- * lib/webrick/https.rb (HTTPServer#run): should set syncing-mode
- to SSLSocket. [ruby-talk:78919]
-
-Wed Aug 13 18:13:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * eval.c (POP_BLOCK): turn on BLOCK_LEFT flag when leaving block.
-
- * eval.c (proc_invoke): unpack return/break destination when block
- is already left.
-
-Wed Aug 13 15:58:31 2003 WATANABE Hirofumi <eban@ruby-lang.org>
-
- * object.c (rb_class_s_alloc): add function prototype to avoid VC++
- warning.
-
-Wed Aug 13 13:50:59 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * benchmark/bm_so_meteor_contest.rb: [DOC] Fix a few typos
+ * ext/fiddle/lib/fiddle/import.rb: ditto
+ * ext/psych/lib/psych.rb: ditto
+ * ext/psych/lib/psych/nodes/sequence.rb: ditto
+ * ext/tk/lib/multi-tk.rb: ditto
+ * ext/tk/lib/tcltk.rb: ditto
- * ext/Win32API/Win32API.c (Win32API_initialize): should pass some
- class to first argument of Data_Wrap_Struct(). (ruby-bugs:PR#1109)
+Sat Dec 28 00:42:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 12 16:55:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
+ isolate command argument state from outer scope.
+ [ruby-core:59342] [Bug #9308]
- * Makefile.in: static link libraries to LIBRUBY_SO with static linked
- ext. [ruby-dev:21157]
+Fri Dec 27 13:25:03 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/extmk.rb (extmake): sort extension library initialization order.
+ * win32/{setup.mak,Makefile.sub}: update fake.rb like
+ template/fake.rb.in.
- * ext/extmk.rb (extmake): compact $extlibs.
+Thu Dec 26 16:10:41 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * win32/Makefile.sub (fake.rb): should depend on version.h because
+ if RUBY_VERSION is updated, fake.rb need to say the new version
+ to avoid install error in rbconfig.rb.
- * eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
- flag before calling getcontext(2).
+Thu Dec 26 14:25:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (struct thread): add member to save backing store on
- IA64. (ruby-bugs PR1086)
+ * hash.c (HASH_REJECT_COPY_EXTRA_STATES): turn off the old
+ behavior, copying extra states by accident.
- * eval.c (thread_mark): mark IA64 backing store region.
+Thu Dec 26 10:49:14 2013 Yukihiro Matsumoto <matz@ruby-lang.org>
- * eval.c (thread_free): free saved IA64 backing store.
+ * version.h (RUBY_VERSION): 2.2.0 development has started.
- * eval.c (rb_thread_save_context): save IA64 backing store as well.
+Thu Dec 26 10:27:53 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_thread_restore_context): restore IA64 backing store.
+ * tool/merger.rb (tag): support 2.1.1 semi-automatic tagging and 2.2.0
+ explicit tagging.
- * eval.c (THREAD_ALLOC): initialize IA64 members.
+Thu Dec 26 06:35:25 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Aug 11 22:31:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * proc.c: Having any mandatory keyword argument increases min arity
+ [#9299]
- * lib/debug.rb(debug_command): inspection command should inspect
- resulting value even if it's nil. [ruby-dev:21180] by OMAE, jun
- <jun66j5@ybb.ne.jp>.
+Thu Dec 26 06:27:08 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * lib/debug.rb(debug_command): incomplete regexp.
+ * proc.c: Having optional keyword arguments makes maximum arity +1,
+ not unlimited [#8072]
-Mon Aug 11 17:33:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 26 01:09:57 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval.c (rb_call_super): do not use rb_block_given_p() for
- check. [ruby-talk:78656]
+ * tool/release.sh: make symbolic links.
- * eval.c (BEGIN_CALLARGS): push ITER_NOT only when ITER_PRE.
+Thu Dec 26 00:45:33 2013 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Aug 10 10:43:05 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * tool/make-snapshot: support new version scheme.
- * ext/openssl/lib/openssl/buffering.rb: increase BLOCK_SIZE
- from 1k to 16k bytes. [ruby-talk:78603]
+Wed Dec 25 22:44:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): enable
- partial write to allow interruption in SSLSocket#write.
+ * compile.c (iseq_set_arguments): set arg_keyword_check from
+ nd_cflag, which is set by parser. internal ID is used for
+ unnamed keyword rest argument, which should be separated from no
+ keyword check.
-Sun Aug 10 00:34:16 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
+ present.
- * cygwin/GNUmakefile: remove unnecessary '--drive-name=$(CC)'
- for ccache.
+ * parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
+ equals to that keyword rest is not present.
-Sat Aug 9 10:36:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Dec 25 22:32:19 2013 Zachary Scott <e@zzak.io>
- * marshal.c (w_object): do not dump generic instance variable when
- marshal_dump is defined.
+ * lib/abbrev.rb: [DOC] rdoc format patch by Giorgos Tsiftsis [Bug #9146]
-Sat Aug 9 00:35:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+Wed Dec 25 20:30:10 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal.c: F style output(like 1234.56789) implemented
- to to_s method.
- * ext/bigdecimal_??.html: F style output(like 1234.56789)
- implemented to to_s method.
+ * iseq.c (rb_iseq_parameters): push argument type symbol only for
+ unnamed rest keywords argument.
-Fri Aug 8 12:33:17 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+Wed Dec 25 20:28:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * bcc32/Makefile.sub: rubyw.exe should be a Windows GUI program.
- add the -aa option to WLDFLAGS.
+ * proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if
+ having rest keywords argument. [ruby-core:53298] [Bug #8072]
-Fri Aug 8 11:29:26 2003 Koji Arai <jca02266@nifty.ne.jp>
+Wed Dec 25 18:29:22 2013 Koichi Sasada <ko1@atdot.net>
- * marshal.c (w_object): should set `c_arg' at first.
+ * vm_insnhelper.c (argument_error): insert dummy frame to make
+ a backtrace object intead of modify backtrace string array.
+ [Bug #9295]
-Fri Aug 8 03:22:28 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+ * test/ruby/test_backtrace.rb: add a test for this patch.
+ fix test to compare a result of Exception#backtrace with
+ a result of Exception#backtrace_locations.
- * lib/webrick/httputils.rb (FormData#list): should not take
- a side effect for the receiver.
+Wed Dec 25 13:00:54 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 7 14:40:37 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * configure.in: let mingw do something black-magic, and check if
+ _gmtime64_s() is available actually.
- * cygwin/GNUmakefile: better --disbale-shared option support.
+ * win32/win32.c (gmtime_s, localtime_s): use _gmtime64_s() and
+ _localtime64_s() if available, not depending on very confusing
+ mingw variants macros. based on the patch by phasis68 (Heesob
+ Park) at [ruby-core:58764]. [ruby-core:58391] [Bug #9119]
- * cygwin/GNUmakefile: add forwarding DLL target for cygwin.
+Wed Dec 25 12:33:41 2013 Yusuke Endoh <mame@tsg.ne.jp>
-Thu Aug 7 14:21:05 2003 Corinna Vinschen <vinschen@redhat.com>
+ * sample/trick2013/: added the award-winning entries of TRICK 2013.
+ See https://github.com/tric/trick2013 for the contest outline.
+ (Matz has approved the attachment.)
- * configure.in: Fix Cygwin specific naming of libraries to
- be net distribution compliant. (ruby-bugs:PR#1077)
- cygwin-ruby18.dll -> cygruby18.dll
+Wed Dec 25 10:42:02 2013 Yamashita Yuu <yamashita@geishatokyo.com>
-Thu Aug 7 12:51:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c (Init_ossl_ssl): Declare a constant
+ `OP_MSIE_SSLV2_RSA_PADDING` only if the macro is defined. The
+ `SSL_OP_MSIE_SSLV2_RSA_PADDING` has been removed from latest
+ snapshot of OpenSSL 1.0.1. [Fixes GH-488]
- * eval.c (rb_f_at_exit): should not be called without a block.
- block_given check added.
+Wed Dec 25 01:03:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 7 06:46:06 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * proc.c (bind_local_variables): allowing binding to list its
+ local variables. patch by Jack Danger Canty <jackdanger AT
+ squareup.com> at [ruby-core:56543]. [Feature #8773]
- * eval.c (rb_call0): forgot to pop ruby_class.
+Tue Dec 24 23:20:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * eval.c (rb_call0): update ruby_class as well as ruby_cref.
- (ruby-bugs-ja:PR#540)
+ * test/fileutils/fileasserts.rb (assert_ownership_user): new
+ assertion for user ownership.
-Thu Aug 7 04:52:50 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/fileutils/test_fileutils.rb (test_chown_error),
+ (test_chown_without_permission, test_chown_with_root):
+ based on the patch by vajrasky (Vajrasky Kok) at
+ [ruby-core:59298]. [Feature #9292]
- * eval.c (rb_yield_0): remove ruby_frame->cbase and unify to
- ruby_cref. [ruby-talk:78141]
+Tue Dec 24 16:28:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 7 04:19:15 2003 Akinori MUSHA <knu@iDaemons.org>
+ * proc.c (rb_mod_define_method): consider visibility only if self
+ in the caller is same as the receiver, otherwise make public as
+ well as old behavior. [ruby-core:57747] [Bug #9005]
+ [ruby-core:58497] [Bug #9141]
- * gc.c: FreeBSD/ia64's mcontext_t is a bit different from that of
- Linux/ia64. This makes gc.c compile but miniruby coredumps for
- the moment.
+ * vm.c (rb_vm_cref_in_context): return ruby level cref if self is
+ same.
-Thu Aug 7 00:15:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
+Tue Dec 24 14:13:14 2013 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal.c: Comparison results adjusted to Float's.
- * ext/bigdecimal.c: Use rb_num_coerce_????(x,y) instead of own.
+ * README.EXT: add a refer to URL.
-Wed Aug 6 22:58:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
+Tue Dec 24 13:48:45 2013 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit/testcase.rb: Added equality checking.
- * lib/test/unit/testsuite.rb: Added equality checking.
- * lib/test/unit/assertions.rb: Fixed a warning.
+ * README.EXT: add a document about RGenGC.
+ Reviewed by havenwood.
+ [misc #8962]
-Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * README.EXT.ja: ditto.
- * ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137]
+Tue Dec 24 12:11:43 2013 Koichi Sasada <ko1@atdot.net>
- * ext/extmk.rb (extmake): set library name as source file name in
- Init_ext(). [ruby-dev:21137]
+ * include/ruby/ruby.h (RARRAY_ASET): try to avoid compiler warning.
+ [Bug #9287]
- * lib/mkmf.rb (Logging::postpone): postpone logging messages after
- heading message as the result of the block.
+Tue Dec 24 05:04:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (macro_defined?): append newline to src unless ended
- with it.
+ * test/fileutils/test_fileutils.rb (setup): should not call
+ Process.groups for Windows. get rid of many errors introduced by
+ r44364.
- * lib/mkmf.rb (have_library): treat nil function name as "main".
- (ruby-bugs:PR#1083)
+Mon Dec 23 18:37:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (pkg_config): should append additional libraries to
- $libs but not $LIBS. [ruby-dev:21137]
+ * test/fileutils/fileasserts.rb (assert_ownership_group): new
+ assertion for group ownership.
- * ext/io/wait/extconf.rb: check DOSISH macro instead of platform.
+ * test/fileutils/test_fileutils.rb (test_chown{,_verbose,_noop}):
+ based on the patch by vajrasky (Vajrasky Kok) at
+ [ruby-core:59281]. [Feature #9286]
- * ext/digest/sha1/extconf.rb: have_library already appends library
- name.
+Mon Dec 23 15:53:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Aug 6 17:23:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * hash.c (HAS_EXTRA_STATES): warn extra states only when something
+ differ. [ruby-core:59254] [Bug #9275]
- * eval.c: initialize /* OK */ variables by Qnil to stop warnings.
+Mon Dec 23 12:42:13 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Aug 6 04:58:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+ * array.c: Have to_h raise on elements that are not key-value pairs
+ [#9239]
- * ext/Setup*: add io/wait and openssl.
+ * enum.c: ditto
-Wed Aug 6 01:13:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Mon Dec 23 05:01:55 2013 Zachary Scott <e@zzak.io>
- * eval.c (rb_f_autoload): use ruby_cbase instead of ruby_class.
+ * doc/syntax/methods.rdoc: [DOC] Added example for underscore
+ conventions in method names. Also added doc to clarify encoding
+ character set support for Ruby programs and elaborated on defining
+ predicate and bang methods. Based on a patch by @gaurish
+ [Fixes GH-477] https://github.com/ruby/ruby/pull/477
- * eval.c (rb_f_autoload_p): ditto.
+Mon Dec 23 03:18:09 2013 Zachary Scott <e@zzak.io>
- * class.c (rb_mod_init_copy): no longer implements independent
- clone and dup methods. override "initialize_copy" instead.
- [ruby-core:01352]
+ * doc/ChangeLog-1.9.3: [DOC] Fix typos by @dvsuresh
+ [Fixes GH-485] https://github.com/ruby/ruby/pull/485
+ * ext/openssl/ossl_config.c: ditto
+ * lib/rss/utils.rb, lib/time.rb: ditto
+ * test/ruby/envutil.rb: ditto
- * object.c (rb_class_s_alloc): define Class allocation function.
- this makes Classes to follow clone framework that uses
- initialize_copy.
+Sun Dec 22 23:56:56 2013 Zachary Scott <e@zzak.io>
- * object.c (rb_class_initialize): separate instantiation and
- initialization.
+ * lib/{rake,rdoc,rss}/*, test/rexml/test_listener.rb: [DOC] Fix typos
+ by @dvsuresh [Fixes GH-486] https://github.com/ruby/ruby/pull/486
- * object.c (rb_obj_alloc): prohibit instantiation from
- uninitialized class.
+Sun Dec 22 11:08:47 2013 Eric Hodel <drbrain@segment7.net>
- * object.c (rb_class_superclass): check uninitialized class.
+ * test/rubygems/test_gem_ext_builder.rb: Fix warning due to ambiguous
+ expression.
- * array.c (rb_ary_fill): wrong index processing with block. this
- fix was done by Koji Arai <JCA02266@nifty.ne.jp> [ruby-list:38029]
+Sun Dec 22 11:05:53 2013 Eric Hodel <drbrain@segment7.net>
- * marshal.c (w_object): should preserve generic ivar for nil,
- true, false, symbols, and fixnums.
+ * lib/rubygems/commands/install_command.rb: Restore gem install
+ --ignore-dependencies for remote gems
+ * test/rubygems/test_gem_commands_install_command.rb: Test for the
+ above.
- * marshal.c (w_uclass): base_klass check should be done after
- rb_class_real().
+Sun Dec 22 10:23:40 2013 Eric Hodel <drbrain@segment7.net>
-Wed Aug 6 01:18:50 2003 Minero Aoki <aamine@loveruby.net>
+ * lib/rdoc.rb: Set RDoc to release version.
- * lib/net/http.rb: update document.
+Sun Dec 22 10:19:07 2013 Eric Hodel <drbrain@segment7.net>
- * lib/net/pop.rb: ditto.
+ * lib/rubygems.rb: Set RubyGems to release version.
- * lib/net/protocol.rb: ditto.
+Sun Dec 22 10:16:08 2013 Eric Hodel <drbrain@segment7.net>
-Wed Aug 6 00:48:37 2003 Koji Arai <jca02266@nifty.ne.jp>
+ * lib/rubygems.rb (module Gem): Fix comment for
+ Gem::load_path_insert_index.
- * marshal.c (w_object): should recommend marshal_dump rather than
- _dump_data.
+Sun Dec 22 04:07:55 2013 Koichi Sasada <ko1@atdot.net>
-Tue Aug 5 17:58:57 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+ * gc.c (ruby_gc_set_params): don't show obsolete warnings for
+ RUBY_FREE_MIN/RUBY_HEAP_MIN_SLOTS if
+ RUBY_GC_HEAP_FREE_SLOTS/RUBY_GC_HEAP_INIT_SLOTS are given.
+ [Bug #9276]
- * lib/fileutils.rb (install): should preserve timestamp only.
+Sat Dec 21 13:00:20 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 5 17:31:59 2003 Ian Macdonald <ian@caliban.org>
+ * file.c: remove unnecessary the source path from EEXIST error
+ messages and show the destination path only. [ruby-core:59202]
+ [Feature #9263]
- * lib/shell/command-processor.rb (Shell::CommandProcessor::rmdir):
- simple typo.
+Sat Dec 21 12:37:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not
+ consider encodings in hosts file. [ruby-core:59239] [Bug #9273]
- * eval.c (rb_load): should preserve current source file/line.
+ * lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto.
-Tue Aug 5 10:04:42 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 21 05:43:27 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (str_new4): ptr may refer null_str.
+ * tool/make-snapshot: replace RUBY_PATCHLEVEL_STR in version.h to
+ show users that this ruby is a preview/rc version.
-Mon Aug 4 17:25:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Dec 21 05:03:49 2013 NAKAMURA Usaku <usa@ruby-lang.org>
- * stable version 1.8.0 released.
+ * win32/Makefile.sub (fake.rb): fixed wrong RUBY_PLATFORM, to correctly
+ install win32.h.
+ [ruby-core:58801][Bug #9199] reported by arton.
+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
Local variables:
+coding: us-ascii
add-log-time-format: (lambda ()
(let* ((time (current-time))
(system-time-locale "C")
@@ -24143,4 +14845,6 @@ add-log-time-format: (lambda ()
(format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t)))
indent-tabs-mode: t
tab-width: 8
+change-log-indent-text: 2
end:
+vim: tabstop=8 shiftwidth=2
diff --git a/GPL b/GPL
index 5b6e7c66c2..d159169d10 100644
--- a/GPL
+++ b/GPL
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb
new file mode 100644
index 0000000000..b97a08d928
--- /dev/null
+++ b/KNOWNBUGS.rb
@@ -0,0 +1,5 @@
+#
+# This test file concludes tests which point out known bugs.
+# So all tests will cause failure.
+#
+
diff --git a/LEGAL b/LEGAL
index 908eb270f5..24e36e6231 100644
--- a/LEGAL
+++ b/LEGAL
@@ -5,34 +5,90 @@ 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.
-regex.[ch]:
-
- These files are under LGPL. Treat them as LGPL says. (See the file
- LGPL for details)
-
- Extended regular expression matching and search library.
- Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file LGPL. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
- Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto)
- Last change: May 21, 1993 by t^2
- removed gapped buffer support, multiple syntax support by matz <matz@nts.co.jp>
- Perl5 extension added by matz <matz@caelum.co.jp>
- UTF-8 extension added Jan 16 1999 by Yoshida Masato <yoshidam@tau.bekkoame.ne.jp>
+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]:
+regerror.c:
+regexec.c:
+regint.h:
+regparse.[ch]:
+enc/ascii.c
+enc/big5.c
+enc/cp949.c
+enc/emacs_mule.c
+enc/encdb.c
+enc/euc_jp.c
+enc/euc_kr.c
+enc/euc_tw.c
+enc/gb18030.c
+enc/gb2312.c
+enc/gbk.c
+enc/iso_8859_1.c
+enc/iso_8859_10.c
+enc/iso_8859_11.c
+enc/iso_8859_13.c
+enc/iso_8859_14.c
+enc/iso_8859_15.c
+enc/iso_8859_16.c
+enc/iso_8859_2.c
+enc/iso_8859_3.c
+enc/iso_8859_4.c
+enc/iso_8859_5.c
+enc/iso_8859_6.c
+enc/iso_8859_7.c
+enc/iso_8859_8.c
+enc/iso_8859_9.c
+enc/koi8_r.c
+enc/koi8_u.c
+enc/shift_jis.c
+enc/unicode.c
+enc/us_ascii.c
+enc/utf_16be.c
+enc/utf_16le.c
+enc/utf_32be.c
+enc/utf_32le.c
+enc/utf_8.c
+enc/windows_1251.c
+
+Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+
+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,
+ this of Ruby follows the license of Ruby.
configure:
@@ -43,9 +99,8 @@ configure:
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-config.guess:
-config.sub:
-parse.c:
+tool/config.guess:
+tool/config.sub:
As long as you distribute these files with the file configure, they
are covered under the Ruby's license.
@@ -72,7 +127,58 @@ parse.c:
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that program.
+parse.c:
+
+ 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.
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+ /* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
util.c (partly):
+
+ Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose without fee is hereby granted, provided that this entire notice
+ is included in all copies of any software which is or includes a copy
+ or modification of this software and in all copies of the supporting
+ documentation for such software.
+
+ THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
+ REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
+ OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+
win32/win32.[ch]:
You can apply the Artistic License to these files. (or GPL,
@@ -83,6 +189,32 @@ win32/win32.[ch]:
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the perl README file.
+util.c (partly):
+
+ Copyright (c) 2004-2008 David Schultz <das@FreeBSD.ORG>
+ 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.
+
random.c
This file is under the new-style BSD license.
@@ -92,11 +224,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
@@ -109,8 +241,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
@@ -130,72 +262,137 @@ random.c
http://www.math.keio.ac.jp/matumoto/emt.html
email: matumoto@math.keio.ac.jp
+vm_dump.c:procstat_vm
+
+ * 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
+ paragraph 3 below is now null and void.
+
+ Copyright (c) 1990, 1993
+ The Regents of the University of California. All rights reserved.
+
+ This code is derived from software contributed to Berkeley by
+ Chris Torek.
+
+ 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. 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.
+
+ IMPORTANT NOTE:
+ --------------
+ From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+ paragraph 3 above is now null and void.
+
st.[ch]:
-x68/*:
missing/alloca.c:
missing/dup2.c:
+missing/erf.c:
missing/finite.c:
missing/hypot.c:
missing/isinf.c:
missing/isnan.c:
+missing/lgamma_r.c:
missing/memcmp.c:
missing/memmove.c:
-missing/strcasecmp.c:
missing/strchr.c:
-missing/streror.c:
-missing/strftime.c:
-missing/strncasecmp.c:
missing/strstr.c:
missing/strtol.c:
+missing/tgamma.c:
ext/digest/sha1/sha1.[ch]:
These files are all under public domain.
-missing/strtod.c:
-
- This file will not be used on most platforms depending on how the
- configure script results. In any case you must not receive any fee
- with the file itself.
-
- Copyright (c) 1988-1993 The Regents of the University of California.
- Copyright (c) 1994 Sun Microsystems, Inc.
+missing/crypt.c:
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies. The University of California
- makes no representations about the suitability of this
- software for any purpose. It is provided "as is" without
- express or implied warranty.
+ This file is under the old-style BSD license. Note that the
+ paragraph 3 below is now null and void.
-missing/strtoul.c:
+ Copyright (c) 1989, 1993
+ The Regents of the University of California. All rights reserved.
- This file will not be used on most platforms depending on how the
- configure script results. In any case you must not receive any fee
- with the file itself.
+ This code is derived from software contributed to Berkeley by
+ Tom Truscott.
- Copyright 1988 Regents of the University of California
+ 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. 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.
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies. The University of California
- makes no representations about the suitability of this
- software for any purpose. It is provided "as is" without
- express or implied warranty.
+ 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.
-missing/erf.c:
-missing/crypt.c:
-missing/vsnprintf.c:
+missing/setproctitle.c
This file is under the old-style BSD license. Note that the
paragraph 3 below is now null and void.
- Copyright (c) 1990, 1993
- The Regents of the University of California. All rights reserved.
-
- This code is derived from software contributed to Berkeley by
- Chris Torek.
+ Copyright 2003 Damien Miller
+ Copyright (c) 1983, 1995-1997 Eric P. Allman
+ Copyright (c) 1988, 1993
+ The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -221,10 +418,46 @@ missing/vsnprintf.c:
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
- IMPORTANT NOTE:
- --------------
- From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
- paragraph 3 above is now null and void.
+missing/strlcat.c
+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.
+
+ 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
+
+ This file is from http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c.
+ Ruby uses a modified version. The file contains the following
+ author/copyright notice:
+
+ Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11
+ Permission to use, copy, modify, and distribute this software
+ for any purpose and without fee is hereby granted. The author
+ disclaims all warranties with regard to this software.
ext/digest/md5/md5.[ch]:
@@ -264,18 +497,7 @@ ext/digest/rmd160/rmd160.[ch]:
Copyright (c) Katholieke Universiteit Leuven
1996, All Rights Reserved
-ext/digest/rmd160/rmd160hl.c:
-ext/digest/sha1/sha1hl.c:
-
- These files are under the beer-ware license.
-
- "THE BEER-WARE LICENSE" (Revision 42):
- <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
- can do whatever you want with this stuff. If we meet some day, and you think
- this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
-
ext/digest/sha2/sha2.[ch]:
-ext/digest/sha2/sha2hl.c:
These files are under the new-style BSD license.
@@ -313,7 +535,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.
@@ -364,7 +586,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/LGPL b/LGPL
deleted file mode 100644
index b1e3f5a263..0000000000
--- a/LGPL
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/Makefile.in b/Makefile.in
index 9eaab0be4d..7da2488b46 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,17 +1,34 @@
SHELL = /bin/sh
-NULLCMD = :
+NULLCMD = @NULLCMD@
+n=$(NULLCMD)
+ECHO1 = $(V:1=$n)
+RUNCMD = $(SHELL)
+CDPATH = .
+CHDIR = @CHDIR@
+exec = exec
+NULL = /dev/null
+PATH_SEPARATOR = @PATH_SEPARATOR@
#### Start of system configuration section. ####
srcdir = @srcdir@
-VPATH = $(srcdir):$(srcdir)/missing
+top_srcdir = $(srcdir)
+hdrdir = $(srcdir)/include
+PLATFORM_DIR = @PLATFORM_DIR@
CC = @CC@
-YACC = @YACC@
+CPP = @CPP@
+LD = @LD@
+YACC = bison
PURIFY =
AUTOCONF = autoconf
@SET_MAKE@
MKFILES = @MAKEFILES@
+BASERUBY = @BASERUBY@
+HAVE_BASERUBY = @HAVE_BASERUBY@
+TEST_RUNNABLE = @TEST_RUNNABLE@
+CROSS_COMPILING = @CROSS_COMPILING@
+DOXYGEN = @DOXYGEN@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -24,40 +41,78 @@ datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
+archlibdir = @archlibdir@
+ruby_version = @ruby_version@
TESTUI = console
TESTS =
-RDOCTARGET = @RDOCTARGET@
+INSTALLDOC = @INSTALLDOC@
+DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
-RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
empty =
+CC_VERSION = @CC_VERSION@
OUTFLAG = @OUTFLAG@$(empty)
-CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
+COUTFLAG = @COUTFLAG@$(empty)
+ARCH_FLAG = @ARCH_FLAG@
+CFLAGS_NO_ARCH = @CFLAGS@
+CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
-CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
+warnflags = @warnflags@ @strict_warnflags@
+cppflags = @cppflags@
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
+XCFLAGS = @XCFLAGS@
+CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
-EXTLDFLAGS =
+EXTLDFLAGS = @EXTLDFLAGS@
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
+EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) @ARCH_FLAG@
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
SOLIBS = @SOLIBS@
MAINLIBS = @MAINLIBS@
-MINIOBJS = @MINIOBJS@
-
+ARCHMINIOBJS = @MINIOBJS@
+DLNOBJ = @DLNOBJ@
+ENCOBJS = @ENCOBJS@
+EXTOBJS = @EXTOBJS@
+BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
+BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
+BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+POSTLINK = @POSTLINK@
+
+RUBY_BASE_NAME=@RUBY_BASE_NAME@
+RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
EXEEXT = @EXEEXT@
+LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
-MINIRUBY = @MINIRUBY@ $(MINIRUBYOPT)
-RUNRUBY = @RUNRUBY@ $(RUNRUBYOPT) --
+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_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args'
+XRUBY = @XRUBY@
+BTESTRUBY = @BTESTRUBY@\
+ $(MINIRUBYOPT)
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+XRUBY_LIBDIR = @XRUBY_LIBDIR@
+XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
+XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
#### End of system configuration section. ####
@@ -72,131 +127,380 @@ LIBRUBY = @LIBRUBY@
LIBRUBYARG = @LIBRUBYARG@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
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@
+CP = cp
+MV = mv
RM = rm -f
+RMDIR = @RMDIR@
+RMDIRS = @RMDIRS@
+RMALL = @RMALL@
NM = @NM@
AR = @AR@
ARFLAGS = rcu
RANLIB = @RANLIB@
AS = @AS@
-ASFLAGS = @ASFLAGS@
+ASFLAGS = @ASFLAGS@ $(INCFLAGS)
+IFCHANGE = $(srcdir)/tool/ifchange
+SET_LC_MESSAGES = env LC_MESSAGES=C
+OBJDUMP = @OBJDUMP@
+OBJCOPY = @OBJCOPY@
+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))
OBJEXT = @OBJEXT@
+ASMEXT = S
+DLEXT = @DLEXT@
MANTYPE = @MANTYPE@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
INSTALLED_LIST= .installed.list
+
+NEWLINE_C = newline.c
+MINIPRELUDE_C = miniprelude.c
+PRELUDE_C = prelude.c
+RBCONFIG = .rbconfig.time
+
+SRC_FILE = $<
+OS_SRC_FILE = $<
+DEST_FILE = $@
+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
-all:
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
-.DEFAULT: all
+all:
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
miniruby$(EXEEXT):
- @$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
+ @-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(POSTLINK)
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
# supported.
$(LIBRUBY_A):
@$(RM) $@
- $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
+ $(ECHO) linking static-library $@
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(INITOBJS)
@-$(RANLIB) $@ 2> /dev/null || true
+ $(ECHO) verifying static-library $@
+ @$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
+ @$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
- $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
- @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
+ $(ECHO) linking shared-library $@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(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; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
-
-fake.rb: Makefile
- @echo ' \
- class Object; \
- CROSS_COMPILING = RUBY_PLATFORM; \
- remove_const :RUBY_PLATFORM; \
- remove_const :RUBY_VERSION; \
- RUBY_PLATFORM = "@arch@"; \
- RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
- end; \
- if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
- class File; \
- remove_const :ALT_SEPARATOR; \
- ALT_SEPARATOR = "\\"; \
- end; \
- end; \
- ' > $@
-
-Makefile: $(srcdir)/Makefile.in
-
-$(MKFILES): config.status $(srcdir)/common.mk
- MAKE=$(MAKE) $(SHELL) ./config.status
- @{ \
+$(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
+
+install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
+ $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
+ $(ECHO) installing cross-compiling stuff
+ $(Q) $(MAKEDIRS) $(XRUBY_RUBYLIBDIR)/$(arch) $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(Q) sed '/^\$$:\.unshift/q' $(arch)-fake.rb > fake.rb
+ $(Q) $(BASERUBY) -p \
+ -e '~/^\s*CONFIG\["LDFLAGS"\]/ and' \
+ -e '$$_[/(?=\s*"$$)/] = %q[ #{(CONFIG["LIBPATHFLAG"]%File.dirname(__FILE__)).strip}]' \
+ rbconfig.rb > fake-rbconfig.rb
+ $(INSTALL_SCRIPT) fake.rb $(XRUBY_RUBYLIBDIR)/$(arch)/fake.rb
+ $(INSTALL_SCRIPT) fake-rbconfig.rb $(XRUBY_RUBYLIBDIR)/$(arch)/rbconfig.rb
+ @$(RM) fake.rb fake-rbconfig.rb
+ $(INSTALL_DATA) $(arch_hdrdir)/ruby/config.h $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(INSTALL_DATA) $(top_srcdir)/include/ruby/win32.h $(XRUBY_RUBYHDRDIR)/ruby
+ $(INSTALL_DATA) $(LIBRUBY) $(LIBRUBY_A) $(XRUBY_RUBYLIBDIR)/$(arch)
+ $(INSTALL_PROGRAM) $(LIBRUBY_SO) $(XRUBY_RUBYLIBDIR)/$(arch)
+
+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; \
+ { \
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 "Makefile updated, restart."; exit 1; }
+ { echo "$@ updated, restart."; exit 1; }
+
+uncommon.mk: $(srcdir)/common.mk
+ sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
+
+.PHONY: reconfig
+reconfig-args = $(srcdir)/configure $(configure_args)
+config.status-args = ./config.status --recheck
+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; "$$@"
-config.status: $(srcdir)/configure
- MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
+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
- cd $(srcdir) && $(AUTOCONF)
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF)
+
+incs: id.h
+all-incs: probes.h
+
+# Things which should be considered:
+# * with gperf v.s. without gperf
+# * committers may have various versions of gperf
+# * ./configure v.s. ../ruby/configure
+# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime.
+# * svn checkout generate a file with mtime as current time
+# * ext4 and XFS has a mtime with fractional part
+lex.c: defs/keywords
+ @\
+ if cmp -s $(srcdir)/defs/lex.c.src $?; then \
+ [ $(Q) ] && echo copying $@ || set -x; \
+ $(CP) $(srcdir)/lex.c.blt $@; \
+ else \
+ [ $(Q) ] && echo generating $@ || set -x; \
+ 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; \
+ fi
-lex.c: keywords
- ( gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && mv $@.tmp $@ ) || \
- if test -f $@; then \
- touch $@ && echo $@ touched.; \
+NAME2CTYPE_OPTIONS = -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p
+
+enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
+ $(MAKEDIRS) $(@D)
+ @set +e; \
+ if cmp -s $(?:.kwd=.src) $?; then \
+ set -x; \
+ $(CP) $(?:.kwd=.h.blt) $@; \
else \
- cp $(srcdir)/lex.c $@ && echo $@ copied.; \
+ trap '$(RM) $@-1.h $@-2.h' 0 && \
+ set -x; \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-1.h && \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/d;/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-2.h && \
+ diff -DUSE_UNICODE_PROPERTIES $@-1.h $@-2.h > $@.tmp || :; \
+ $(MV) $@.tmp $@ && \
+ $(CP) $? $(?:.kwd=.src) && \
+ $(CP) $@ $(?:.kwd=.h.blt); \
fi
-.y.c:
- $(YACC) $<
- sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@
- rm -f y.tab.c
+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@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+ @$(ECHO) compiling $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
.s.@OBJEXT@:
- $(AS) $(ASFLAGS) -o $@ $<
+ @$(ECHO) assembling $<
+ $(Q) $(AS) $(ASFLAGS) -o $@ $<
+
+.c.S:
+ @$(ECHO) translating $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
+
+.c.i:
+ @$(ECHO) preprocessing $<
+ $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
+
+.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/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 probes.stamp
+ @$(ECHO) processing probes in object files
+ $(Q) $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_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)
clean-local::
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
+ $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
+ enc/encinit.c enc/encinit.$(OBJEXT)
+ -$(Q)$(RM) $(pkgconfig_DATA)
distclean-local::
- @$(RM) ext/config.cache $(RBCONFIG)
+ $(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
+ -$(Q)$(RM) run.gdb
+ -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
+ -$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
+
+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 | sed 's:~$$::'; \
+ `; shift; \
+ cd ..; \
+ for dir do \
+ echo $(@:-ext=)ing "$$dir"; \
+ (cd "ext/$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \
+ case "$@" in \
+ *distclean-ext*|*realclean-ext*) \
+ $(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
+ esac; \
+ done
+ -$(Q)$(RM) ext/extinit.$(OBJEXT)
+
+distclean-ext realclean-ext::
+ -$(Q)$(RM) ext/extinit.c
+ -$(Q)$(RMDIR) ext 2> /dev/null || true
+
+clean-extout:
+
+clean-enc distclean-enc realclean-enc:
+ @test -f "$(ENC_MK)" || exit 0; \
+ echo $(@:-enc=ing) encodings; \
+ exec $(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(OUTFLAG)$@ -c ext/extinit.c
-
-update-rubyspec:
- if [ -d $(srcdir)/rubyspec ]; then \
- cd $(srcdir)/rubyspec/mspec; \
- git pull; \
- cd ../spec; \
- git pull; \
+ $(ECHO) compiling $@
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+
+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 ...; \
+ exec git pull; \
else \
- mkdir $(srcdir)/rubyspec; \
- git clone $(MSPEC_GIT_URL) $(srcdir)/rubyspec/mspec; \
- git clone $(RUBYSPEC_GIT_URL) $(srcdir)/rubyspec/spec; \
+ echo retrieving mspec ...; \
+ exec git clone $(MSPEC_GIT_URL) spec/mspec; \
fi
-test-rubyspec:
- @if [ ! -d $(srcdir)/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
- RUBY_EXE="$(RUNRUBY)" $(RUNRUBY) $(srcdir)/rubyspec/mspec/bin/mspec-run --background --prefix $(srcdir)/rubyspec/spec -B $(srcdir)/rubyspec/spec/ruby.$(MAJOR).$(MINOR).mspec
+update-rubyspec: update-mspec
+ @$(CHDIR) $(srcdir); \
+ if [ -d spec/rubyspec ]; then \
+ cd spec/rubyspec; \
+ echo updating rubyspec ...; \
+ exec git pull; \
+ else \
+ echo retrieving rubyspec ...; \
+ 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-coverage:
+ @$(CHDIR) $(srcdir); \
+ if [ -d coverage/simplecov ]; then \
+ cd coverage/simplecov; \
+ echo updating simplecov ...; \
+ exec git pull; \
+ else \
+ echo retrieving simplecov ...; \
+ exec git clone $(SIMPLECOV_GIT_URL) coverage/simplecov; \
+ fi
+
+INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
+ vmtc.inc vm.inc
+
+$(INSNS): $(srcdir)/insns.def vm_opts.h \
+ $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \
+ $(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 965ce6de5a..5ac07db507 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
-= NEWS
+# -*- rdoc -*-
+
+= NEWS for Ruby 2.2.0
This document is a list of user visible feature changes made between
releases except for bug fixes.
@@ -7,632 +9,355 @@ 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.
-* REXML
-
- * REXML::Document.entity_expansion_limit=
-
- New method to set the entity expansion limit. By default the limit is
- set to 10000. See the following URL for details.
-
- http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
-
-== Changes since the 1.8.6 release
-
-=== Configuration changes
-
-* vendor_ruby directory
-
- A new library directory named `vendor_ruby' is introduced in
- addition to `site_ruby'. The idea is to separate libraries
- installed by the package system (`vendor') from manually (`site')
- installed libraries preventing the former from getting overwritten
- by the latter, while preserving the user option to override vendor
- libraries with site libraries. (`site_ruby' takes precedence over
- `vendor_ruby')
-
- If you are a package maintainer, make each library package configure
- the library passing the `--vendor' option to `extconf.rb' so that
- the library files will get installed under `vendor_ruby'.
-
- You can change the directory locations using configure options such
- as `--with-sitedir=DIR' and `--with-vendordir=DIR'.
-
-=== Global constants
-
-* new constants
-
- * RUBY_COPYRIGHT
- * RUBY_DESCRIPTION
-
-=== Library updates (outstanding ones only)
-
-* new library
-
- * securerandom
-
-* builtin classes
-
- * Array#flatten
- * Array#flatten!
-
- Takes an optional argument that determines the level of recursion
- to flatten.
-
- * Array#eql?
- * Array#hash
- * Array#==
- * Array#<=>
-
- Handle recursive data properly.
-
- * Array#index
- * Array#rindex
-
- Take a block instead of an argument.
-
- * Array#collect!
- * Array#map!
- * Array#each
- * Array#each_index
- * Array#reverse_each
- * Array#reject
- * Array#reject!
- * Array#delete_if
-
- Return an enumerator if no block is given.
-
- Note that #map and #collect still return an array unlike Ruby 1.9
- to keep compatibility.
-
- * Array#pop
- * Array#shift
-
- Take an optional argument specifying the number of elements to
- remove.
-
- * Array#choice
- * Array#combination
- * Array#cycle
- * Array#drop
- * Array#drop_while
- * Array#permutation
- * Array#product
- * Array#shuffle
- * Array#shuffle!
- * Array#take,
- * Array#take_while
-
- New methods.
-
- * Binding#eval
-
- New method.
-
- * Dir#each
- * Dir#foreach
-
- Return an enumerator if no block is given.
-
- * Enumerable::Enumerator
-
- New class for various enumeration defined by the enumerator library.
-
- * Enumerable#each_slice
- * Enumerable#each_cons
- * Object#to_enum
- * Object#enum_for
-
- New methods for various enumeration defined by the enumerator library.
-
- * Enumerable#count
- * Enumerable#cycle
- * Enumerable#drop
- * Enumerable#drop_while
- * Enumerable#find_index
- * Enumerable#first
- * Enumerable#group_by
- * Enumerable#max_by
- * Enumerable#min_by
- * Enumerable#minmax
- * Enumerable#minmax_by
- * Enumerable#none?
- * Enumerable#one?
- * Enumerable#take
- * Enumerable#take_while
-
- New methods.
-
- * Enumerable#find
- * Enumerable#find_all
- * Enumerable#partition
- * Enumerable#reject
- * Enumerable#select
- * Enumerable#sort_by
-
- Return an enumerator if no block is given.
-
- Note that #map and #collect still return an array unlike Ruby 1.9
- to keep compatibility.
-
- * Enumerable#inject
-
- Accepts a binary operator instead of a block.
-
- * Enumerable#reduce
-
- New alias to #inject.
-
- * Hash#eql?
- * Hash#hash
- * Hash#==
-
- Handle recursive data properly.
-
- * Hash#delete_if
- * Hash#each
- * Hash#each_key
- * Hash#each_pair
- * Hash#each_value
- * Hash#reject!
- * Hash#select
- * ENV.delete_if
- * ENV.each
- * ENV.each_key
- * ENV.each_pair
- * ENV.each_value
- * ENV.reject!
- * ENV.select
-
- Return an enumerator if no block is given.
-
- * GC.stress
- * GC.stress=
-
- New methods.
-
- * Integer#ord
- * Integer#odd?
- * Integer#even?
- * Integer#pred
-
- New methods.
-
- * Integer#downto
- * Integer#times
- * Integer#upto
-
- Return an enumerator if no block is given.
-
- * IO#each
- * IO#each_line
- * IO#each_byte
- * IO.foreach
- * ARGF.each
- * ARGF.each_line
- * ARGF.each_byte
-
- Return an enumerator if no block is given.
-
- * IO#bytes
- * IO#chars
- * IO#each_char
- * IO#getbyte
- * IO#lines
- * IO#readbyte
- * ARGF.bytes
- * ARGF.chars
- * ARGF.each_char
- * ARGF.getbyte
- * ARGF.lines
- * ARGF.readbyte
-
- New methods.
-
- * Method#name
- * Method#owner
- * Method#receiver
- * UnboundMethod#name
- * UnboundMethod#owner
-
- New methods.
-
- * Module#class_exec
- * Module#module_exec
-
- New methods.
-
- * Numeric#step
-
- Return an enumerator if no block is given.
-
- * Object#instance_exec
- * Object#tap
-
- New methods.
-
- * ObjectSpace.each_object
-
- Return an enumerator if no block is given.
-
- * Process.exec implemented.
-
- * Range#each
- * Range#step
-
- Return an enumerator if no block is given.
-
- * Regexp.union accepts an array of patterns.
-
- * String#bytesize
-
- New method, returning the size in bytes. (alias length and size)
-
- * String#chars
- * String#each_char
- * String#partition
- * String#rpartition
- * String#start_with?
- * String#end_with?
-
- New methods. These are $KCODE aware unlike #index, #rindex and
- #include?.
-
- * String#each_byte
- * String#each
- * String#each_line
- * String#gsub(pattern)
-
- Return an enumerator if no block is given.
-
- * String#upto
-
- An optional second argument is added to specify if the last value
- should be included.
-
- * StopIteration
-
- New exception class that causes Kernel#loop to stop iteration when
- raised.
-
- * Struct#each
- * Struct#each_pair
-
- Return an enumerator if no block is given.
-
- * Symbol#to_proc
-
- New method.
-
- * __method__
-
- New global function that returns the name of the current method as
- a Symbol.
-
-* enumerator
-
- * Enumerator is now a built-in module. The #next and #rewind
- methods are implemented using the "generator" library. Use with
- care and be aware of the performance loss.
-
-* ipaddr
-
- * New methods
- * IPAddr#<=>
- * IPAddr#succ
-
- IPAddr objects are now comparable and enumerable having these
- methods. This also means that it is possible to have a Range
- object between two IPAddr objects.
-
- * IPAddr#to_range
-
- A new method to create a Range object for the (network) address.
-
- * Type coercion support
- * IPAddr#&
- * IPAddr#|
- * IPAddr#==
- * IPAddr#include?
-
- These methods now accept a string or an integer instead of an
- IPAddr object as the argument.
-
-* net/smtp
-
- * Support SSL/TLS.
-
-* openssl
-
- * New classes
- * OpenSSL::PKey::EC
- * OpenSSL::PKey::EC::Group
- * OpenSSL::PKey::EC::Point
- * OpenSSL::PKey::PKCS5
- * OpenSSL::SSL::Session
-
- * Documentation!
-
- * Various new methods (see documentation).
-
- * Remove redundant module namespace in Cipher, Digest, PKCS7, PKCS12.
- Compatibility classes are provided which will be removed in Ruby 1.9.
-
-* shellwords
-
- * Add methods for escaping shell-unsafe characters:
- * Shellwords.join
- * Shellwords.escape
- * Array#shelljoin
- * String#shellescape
-
- * Add shorthand methods:
- * Shellwords.split (alias shellwords)
- * String#shellsplit
-
-* stringio
-
- * StringIO#getbyte
- * StringIO#readbyte
-
- New methods. (aliases for compatibility with 1.9)
-
- * StringIO#each_char
- * StringIO#chars
-
- New methods.
-
- * StringIO#each
- * StringIO#each_line
- * StringIO#each_byte
-
- Return an enumerator if no block is given.
-
-* tempfile
-
- * Tempfile.open and Tempfile.new now accept a suffix for the
- temporary file to be created. To specify a suffix, pass an array
- of [basename, suffix] as the first argument.
-
- Tempfile.open(['image', 'jpg']) { |tempfile| ... }
-
-* tmpdir
-
- * New method:
-
- * Dir.mktmpdir
-
-* uri
-
- * added LDAPS scheme.
- * Change for RFC3986:
- * FTP
- * URI('ftp://example.com/foo').path #=> 'foo'
- * URI('ftp://example.com/%2Ffoo').path #=> '/foo'
- * URI::FTP.build([nil, 'example.com', nil, '/foo', 'i').to_s #=> 'ftp://example.com/%2Ffoo;type=i'
- * URI merge
- * URI('http://a/b/c/d;p?q').merge('?y') == URI('http://a/b/c/d;p?y')
- * URI('http://a/b/c/d;p?q').merge('/./g') == URI('http://a/g')
- * URI('http://a/b/c/d;p?q').merge('/../g') == URI('http://a/g')
- * URI('http://a/b/c/d;p?q').merge('../../../g') == URI('http://a/g')
- * URI('http://a/b/c/d;p?q').merge('../../../../g') == URI('http://a/g')
-
-* rss
-
- * 0.1.6 -> 0.2.4
-
- * Fix image module URI
-
- * Atom support
-
- * ITunes module support
-
- * Slash module support
-
- * content:encoded with RSS 2.0 support
-
-=== Interpreter Implementation
-
-* passing a block to a Proc [experimental]
-
- This implementation in current shape is known to be buggy/broken,
- especially with nested block invocation. Take this as an
- experimental feature.
-
-* stack trace
-
- On non-SystemStackError exception, full stack trace is shown.
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* String#slice! had some unintentional bugs and they have been fixed
- because either they disagreed with documentation or their respective
- behavior of #slice. Unfortunately, this causes some
- incompatibilities in the following (somewhat rare) cases.
-
- * #slice! no longer expands the array when an out-of-boundary value
- is given.
-
- # Ruby 1.8.6
- a = [1,2]
- a.slice!(4,0) #=> nil
- a #=> [1,2,nil,nil]
-
- # Ruby 1.8.7
- a = [1,2]
- a.slice!(4,0) #=> nil
- a #=> [1,2]
-
- * #slice! no longer raises an exception but returns nil when a
- negative length or out-of-boundary negative position is given.
-
- # Ruby 1.8.6
- a = [1,2]
- a.slice!(1,-1) #=> (raises IndexError)
- a.slice!(-5,1) #=> (raises IndexError)
-
- # Ruby 1.8.7
- a = [1,2]
- a.slice!(1,-1) #=> nil
- a.slice!(-5,1) #=> nil
-
-* String#to_i, String#hex and String#oct no longer accept a sequence
- of underscores (`__') as part of a number.
-
- # Ruby 1.8.6
- '1__0'.to_i #=> 10
- '1__0'.to_i(2) #=> 2 # 0b10
- '1__0'.oct #=> 8 # 010
- '1__0'.hex #=> 16 # 0x10
-
- # Ruby 1.8.7
- '1__0'.to_i #=> 1
- '1__0'.to_i(2) #=> 1
- '1__0'.oct #=> 1
- '1__0'.hex #=> 1
-
- The old behavior was inconsistent with Ruby syntax and considered as
- a bug.
-
-* date
-
- * Date.parse
-
- '##.##.##' (where each '#' is a digit) is now taken as 'YY.MM.DD'
- instead of 'MM.DD.YY'. While the change may confuse you, you can
- always use Date.strptime() when you know what you are dealing
- with.
-
-* stringio
-
- * StringIO#each_byte
-
- The return value changed from nil to self. This is what the
- document says and the same as each_line() does.
-
-* tempfile
-
- * The file name format has changed. No dots are included by default
- in temporary file names any more. See above for how to specify a
- suffix.
-
-* uri
-
- * See above for details.
-
-== Changes since the 1.8.5 release
-
-=== New platforms/build tools support
-
-* IA64 HP-UX
-
-* Visual C++ 8 SP1
-
-* autoconf 2.6x
-
-=== Global constants
-
-* RUBY_PATCHLEVEL
-
- New constant since 1.8.5-p1.
-
-=== Library updates (outstanding ones only)
-
-* builtin classes
-
- * New method: Kernel#instance_variable_defined?
-
- * New method: Module#class_variable_defined?
-
- * New feature: Dir::glob() can now take an array of glob patterns.
-
-* date
-
- * Updated based on date2 4.0.3.
-
-* digest
-
- * New internal APIs for C and Ruby.
-
- * Support for autoloading.
-
- require 'digest'
-
- # autoloads digest/md5
- md = Digest::MD5.digest("string")
-
- * New digest class methods: file
-
- * New digest instance methods: clone, reset, new, inspect,
- digest_length (alias size or length), block_length()
-
- * New library: digest/bubblebabble
-
- * New function: Digest(name)
-
-* fileutils
-
- * New option for FileUtils.cp_r(): :remove_destination
-
-* nkf
-
- * Updated based on nkf as of 2007-01-28.
-
-* thread
-
- * Replaced with much faster mutex implementation in C. The former
- implementation, which is slow but considered to be stable, is
- available with a configure option `--disable-fastthread'.
-
-* tk
-
- * Updated Tile extension support based on Tile 0.7.8.
-
- * Support --without-X11 configure option for non-X11 versions of
- Tcl/Tk (e.g. Tcl/Tk Aqua).
-
- * New sample script: irbtkw.rbw -- IRB on Ruby/Tk. It has no trouble
- about STDIN blocking on Windows.
-
-* webrick
-
- * New method: WEBrick::Cookie.parse_set_cookies()
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* builtin classes
-
- * String#intern now raises SecurityError when $SAFE level is greater
- than zero.
-
-* date
-
- * Time#to_date and Time#to_datetime are added as private methods.
- They cause name conflict error in ActiveSupport 1.4.1 and prior,
- which comes with Rails 1.2.2 and prior. Updating ActiveSupport
- and/or Rails to the latest versions fixes the problem.
-
-* digest
-
- * The constructor does no longer take an initial string to feed.
- The following examples show how to migrate:
-
- # Before
- md = Digest::MD5.new("string")
- # After (works with any version)
- md = Digest::MD5.new.update("string")
-
- # Before
- hd = Digest::MD5.new("string").hexdigest
- # After (works with any version)
- hd = Digest::MD5.hexdigest("string")
-
-* fileutils
+== Changes since the 2.1.0 release
+
+=== Language changes
+
+* nil/true/false
+ * nil/true/false objects are frozen. [Feature #8923]
+
+* Hash literal
+ * Symbol key followed by a colon can be quoted. [Feature #4276]
+
+* default argument
+ fixed a very longstanding bug that an optional argument was not
+ accessible in its default value expression. [Bug #9593]
+
+=== Core classes updates (outstanding ones only)
+
+* Binding
+ * New methods:
+ * Binding#local_variables
+ * Binding#receiver
+
+* Dir
+ * New methods:
+ * Dir#fileno
+
+* Enumerable
+ * New methods:
+ * Enumerable#slice_after
+ * Enumerable#slice_when
+ * Extended methods:
+ * min, min_by, max and max_by supports optional argument to return
+ multiple elements.
+
+* Float
+ * New methods:
+ * Float#next_float
+ * Float#prev_float
+
+* File
+ * New methods:
+ * File.birthtime
+ * File#birthtime
+
+* File::Stat
+ * New methods:
+ * File::Stat#birthtime
+
+* GC
+ * GC.latest_gc_info returns :state to represent current GC status.
+ * Improvements
+ * Introduce incremental marking for major GC. [Feature #10137]
+
+* IO
+ * Improvements
+ * IO#nonblock_read and IO#nonblock_write for pipes on Windows are supported.
+
+* Kernel
+ * New methods:
+ * Kernel#itself
+ * Improvements
+ * Kernel#throw raises UncaughtThrowError, subclass of ArgumentError when
+ there is no corresponding catch block, instead of ArgumentError.
+
+* Process
+ * Extended method:
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+
+* String
+ * New methods:
+ * String#unicode_normalize
+ * String#unicode_normalize!
+ * String#unicode_normalized?
+
+* Symbol
+ * Improvements
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able.
+
+* Method
+ * New methods:
+ * Method#curry([arity]) returns a curried Proc.
+ * Method#super_method returns a Method of superclass, which would be called
+ when super is used.
+
+=== Core classes compatibility issues (excluding feature bug fixes)
+
+* Enumerable
+ * Enumerable#slice_before's state management deprecated.
+ * Enumerable#chunk's state management deprecated.
+
+* GC
+ * incompatible changes:
+ * Rename GC.stat entries. [Feature #9924]
+ See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+
+* Hash
+ * incompatible changes:
+ * Change overriding policy for duplicated key. [Bug #10315]
+ { **hash1, **hash2 } contains values of hash2 for duplicated keys.
+
+* IO
+ * incompatible changes:
+ * When flushing file IO with IO#flush, you cannot assume that the metadata
+ of the file is updated immediately. On some platforms (especially
+ Windows), it is delayed until the filesystem load is decreased.
+ Use IO#fsync if you want to guarantee updating metadata.
+ * IO#each_codepoint raises an exception at incomplete character
+ before EOF when conversion takes place. [Bug #11444]
+
+* Math
+ * incompatible changes:
+ * Math.log now raises Math::DomainError instead of returning NaN if the
+ base is less than 0, and returns NaN instead of -infinity if both of
+ two arguments are 0.
+ * Math.atan2 now returns values like as expected by C99 if both two
+ arguments are infinity.
+
+* Proc
+ * incompatible changes:
+ * ArgumentError is no longer raised when lambda Proc is passed as a
+ block, and the number of yielded arguments does not match the formal
+ arguments of the lambda, if just an array is yielded and its length
+ matches.
+
+* Process
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+ Before Ruby 2.2, it was opened in read mode.
+
+=== Stdlib updates (outstanding ones only)
+
+* Continuation
+ * callcc is obsolete. use Fiber instead.
+
+* Digest
+
+ * Digest() should now be thread-safe. If you have a problem with
+ regard to on-demand loading under a multi-threaded environment,
+ preload "digest/*" modules on boot or use this method instead of
+ directly referencing Digest::*.
+ * Digest::HMAC has been removed just as previously noticed.
+
+* DL
+ * DL has been removed from stdlib. Please use Fiddle instead!
+
+* Etc
+ * New methods:
+ * Etc.uname
+ * Etc.sysconf
+ * Etc.confstr
+ * IO#pathconf
+ * Etc.nprocessors
+
+* Find, Pathname
+ * Extended methods:
+ * find method accepts "ignore_error" keyword argument.
+
+* Matrix
+ * New methods:
+ * Matrix#first_minor(row, column) returns the submatrix obtained
+ by deleting the specified row and column.
+ * Matrix#cofactor(row, column) returns the (row, column) cofactor
+ which is obtained by multiplying the first minor by (-1)**(row + column).
+ * Matrix#adjugate returns the adjugate of the matrix.
+ * hstack and vstack are new instance and class methods to stack matrices
+ horizontally and vertically.
+ * Matrix#laplace_expansion(row_or_column: num) returns the laplace_expansion
+ along the +num+ -th row or column.
+ * Vector.basis(size:, index:) returns the specified basis vector.
+ * Unary - and + added for Vector and Matrix.
+ * Vector#cross_product generalized to arbitrary dimensions.
+ * Vector#dot and #cross are aliases for #inner_product and #cross_product.
+ * Vector#angle_with returns the angle with its argument
+ * New instance and class method independent? to test linear independence.
+
+* Pathname
+ * Pathname#/ is aliased to Pathname#+.
+ * New methods:
+ * Pathname#birthtime
+
+* Rake
+ * Updated to Rake 10.4.0. For full release notes see:
+
+ http://docs.seattlerb.org/rake/History_rdoc.html#label-10.4.0
+
+* RubyGems
+ * Updated to RubyGems 2.4.2. For full release notes see:
+
+ http://docs.seattlerb.org/rubygems/History_txt.html#label-2.4.2+%2F+2014-10-01
+
+* TSort
+ * TSort.tsort_each, TSort.each_strongly_connected_component and
+ TSort.each_strongly_connected_component_from returns an enumerator if
+ no block given.
+
+* XMLRPC
+ * Added new parser class named LibXMLStreamParser.
+
+=== Stdlib compatibility issues (excluding feature bug fixes)
+
+* lib/mathn.rb
+ * Show deprecated warning [Feature #10169]
+
+* ext/date/lib/date/format.rb
+ * Removed because it's empty file.
+
+* Digest
+ * Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead.
+
+* time.rb
+ * Time.parse, Time.strptime, Time.rfc2822, Time.xmlschema may produce
+ fixed-offset Time objects.
+ It is happen when usual localtime doesn't preserve the offset from UTC.
+ * Time.httpdate produces always UTC Time object.
+ * Time.strptime raises ArgumentError when no date information.
+
+* lib/rational.rb
+ * Removed because it is deprecated from 2009.
+
+* lib/complex.rb
+ * Removed because it is deprecated from 2009.
+
+* lib/prettyprint.rb
+ * Removed PrettyPrint#first?
+
+* lib/minitest/*.rb
+ * Removed because it conflicts to minitest 5. [Feature #9711]
+
+* lib/test/**/*.rb
+ * Removed because it conflicts to minitest 5, and it was just an wrapper
+ of minitest 4. [Feature #9711]
+
+* lib/uri
+ * support RFC 3986. [Feature #2542]
+
+* GServer
+ * GServer is extracted to gserver gem. It's unmaintain code.
+
+* Logger
+ * Logger::Application is extracted to logger-application gem. It's unmaintain code.
+
+* ObjectSpace (after requiring "objspace")
+ * ObjectSpace.memsize_of(obj) returns a size includes sizeof(RVALUE).
+ [Bug #8984]
+
+* Prime
+ * incompatible changes:
+ * Prime.prime? now returns false for negative numbers. This method
+ should not be used to know the number is composite or not. [Bug #7395]
+
+* Psych
+ * Removed Psych::EngineManager [Bug #8344]
+
+=== Built-in global variables compatibility issues
+
+=== C API updates
+
+* Deprecated APIs removed. [Feature #9502]
+
+ Check_SafeStr -> SafeStringValue
+ rb_check_safe_str -> SafeStringValue
+ rb_quad_pack -> rb_integer_pack
+ rb_quad_unpack -> rb_integer_unpack
+ rb_read_check : access struct FILE internal. no replacement.
+ rb_struct_iv_get : internal function. no replacement.
+ struct rb_blocking_region_buffer : internal type. no replacement.
+ rb_thread_blocking_region_begin -> rb_thread_call_without_gvl family
+ rb_thread_blocking_region_end -> rb_thread_call_without_gvl family
+ TRAP_BEG -> rb_thread_call_without_gvl family
+ TRAP_END -> rb_thread_call_without_gvl family
+ rb_thread_select -> rb_thread_fd_select
+ struct rb_exec_arg : internal type. no replacement.
+ rb_exec : internal function. no replacement.
+ rb_exec_arg_addopt : internal function. no replacement.
+ rb_exec_arg_fixup : internal function. no replacement.
+ rb_exec_arg_init : internal function. no replacement.
+ rb_exec_err : internal function. no replacement.
+ rb_fork : internal function. no replacement.
+ rb_fork_err : internal function. no replacement.
+ rb_proc_exec_n : internal function. no replacement.
+ rb_run_exec_options : internal function. no replacement.
+ rb_run_exec_options_err : internal function. no replacement.
+ rb_thread_blocking_region -> rb_thread_call_without_gvl family
+ rb_thread_polling -> rb_thread_wait_for
+ rb_big2str0 : internal function. no replacement.
+ rb_big2ulong_pack -> rb_integer_pack
+ rb_gc_set_params : internal function. no replacement.
+ rb_io_mode_flags -> rb_io_modestr_fmode
+ rb_io_modenum_flags -> rb_io_oflags_fmode
- * A minor implementation change breaks Rake <=0.7.1.
- Updating Rake to 0.7.2 or higher fixes the problem.
+* struct RBignum is hidden. [Feature #6083]
+ Use rb_integer_pack and rb_integer_unpack instead.
-* tk
+* struct RRational is hidden. [Feature #9513]
+ Use rb_rational_num and rb_rational_den instead.
+
+* rb_big_new and rb_big_resize takes a size_t instead of long.
- * Tk::X_Scrollable (Y_Scrollable) is renamed to Tk::XScrollable
- (YScrollable). Tk::X_Scrollable (Y_Scrollable) is still available,
- but it is an alias name.
+* rb_num2long returns a long instead of SIGNED_VALUE.
+
+* rb_num2ulong returns an unsigned long instead of VALUE.
+
+* st hash table uses power-of-two sizes for speed [Feature #9425].
+ Lookups are 10-25% faster if using appropriate hash functions.
+ However, weaknesses in hash distribution can no longer be masked
+ by prime number-sized tables, so extensions may need to tweak
+ hash functions to ensure good distribution.
+
+* rb_sym2str() added. This is almost same as `rb_id2str(SYM2ID(sym))`
+ but not pinning a dynamic symbol.
+
+* rb_str_cat_cstr() added. This is same as `rb_str_cat2()`.
+
+* `rb_str_substr()` and `rb_str_subseq()` will share middle of a string,
+ but not only the end of a string, in the future. Therefore, result
+ strings may not be NUL-terminated, `StringValueCStr()` is needed
+ calling to obtain a NUL-terminated C string.
+
+* rb_tracepoint_new() supports new internal events accessible only from C:
+ * RUBY_INTERNAL_EVENT_GC_ENTER
+ * RUBY_INTERNAL_EVENT_GC_EXIT
+ r47528
+
+* rb_hash_delete() now does not call the block given to the current method.
+
+* rb_extract_keywords() and rb_get_kwargs() exported. See README.EXT
+ for details.
+
+=== Build system updates
+
+* jemalloc is optionally supported via `./configure --with-jemalloc`
+ jemalloc may be suitable when system malloc is slow or prone
+ to fragmentation. [Feature #9113]
+
+=== Implementation changes
+
+* GC
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able [Feature #9634]
+ * Introduce incremental marking for major GC. [Feature #10137]
+ * Enable lazy sweep on GC caused by malloc().
+
+* VM
+ * Use frozen string literals for Hash#[] and Hash#[]=
+ * Fast keyword arguments passing [Feature #10440]
+ * Allow to receive huge splatted array by a rest argument
+ [Feature #10440]
+
+* Process
+ * Process creation methods, such as spawn(), uses vfork() system call.
+ vfork() is faster than fork() when the parent process uses huge memory.
diff --git a/README b/README
deleted file mode 100644
index 1b79781367..0000000000
--- a/README
+++ /dev/null
@@ -1,118 +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(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 machines, and on DOS,
- Windows, Mac, BeOS etc.)
-
-
-* How to get Ruby
-
-The Ruby distribution files can be found in the following FTP site:
-
- ftp://ftp.ruby-lang.org/pub/ruby/
-
-The latest source code of this version series can be checked out
-through SVN with the following command:
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8/
-
-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
-
-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/
-
-
-* 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 <ruby-talk-ctl@ruby-lang.org>.
-
-
-* How to compile and install
-
-This is what you need to do to compile and install Ruby:
-
- 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 optflags=.. and warnflags=.. as necessary
- to override them.
-
- 3. Edit defines.h if you need. Usually this step will not be needed.
-
- 4. 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 does not allow dynamic loading),
- remove comment mark from the line "#option nodynamic" in
- ext/Setup.
-
- 5. Run make.
-
- 6. Optionally, run 'make test' to check whether the compiled Ruby
- interpreter works well. If you see the message "test succeeded",
- your ruby works as it should (hopefully).
-
- 7. Run 'make install'
-
- 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:
-
- matz@netlab.jp
-
--------------------------------------------------------
-created at: Thu Aug 3 11:57:36 JST 1995
-Local variables:
-mode: indented-text
-end:
diff --git a/README.EXT b/README.EXT
index 637b19d25b..3e010c3002 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1,58 +1,58 @@
-.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
+# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
This document explains how to make extension libraries for Ruby.
-1. Basic knowledge
+= 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.
+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
+1. Identify the VALUE's data type
+2. Convert the VALUE into C data
Converting to the wrong data type may cause serious problems.
-
-1.1 Data-types
+== 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_FIXNUM Fixnum(31bit integer)
- T_HASH associative array
- T_STRUCT (Ruby) structure
- T_BIGNUM multi precision integer
- T_FILE IO
- T_TRUE true
- T_FALSE false
- T_DATA data
- T_SYMBOL symbol
+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
- T_MATCH
- T_UNDEF
- T_VARMAP
- T_SCOPE
- T_NODE
+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.
-1.2 Check Data Type of the VALUE
+== 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
@@ -74,151 +74,272 @@ data types, your code will look something like this:
break;
}
-There is the data-type check function
+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.
+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)
-1.3 Convert VALUE into C data
+== Convert VALUE into C Data
-The data for type T_NIL, T_FALSE, T_TRUE are nil, true, false
+The data for type T_NIL, T_FALSE, T_TRUE are nil, false, true
respectively. They are singletons for the data type.
-
-The T_FIXNUM data is a 31bit length fixed integer (63bit length on
-some machines), which can be converted to a C integer by using the
-FIX2INT() macro. There is also NUM2INT() which converts any Ruby
-numbers into C integers. The NUM2INT() macro 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.
-
-In version 1.7 or later it is recommended that you use the new macros
+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 depends 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 include 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
+StringValuePtr(var) does the 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.
-In version 1.6 or earlier, STR2CSTR() was used to do the same thing
-but now it is deprecated in version 1.7, because STR2CSTR() has a risk
-of a dangling pointer problem in the to_str() impliclit conversion.
+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".
-
-For example, `RSTRING(str)->len' is the way to get the size of the
-Ruby String object. The allocated region can be accessed by
-`RSTRING(str)->ptr'. For arrays, use `RARRAY(ary)->len' and
-`RARRAY(ary)->ptr' respectively.
+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". However, we do not recommend
+to access RXXXX data directly because these data structures are complex.
+Use corresponding rb_xxx() functions to access the internal struct.
+For example, to access an entry of array, use rb_ary_entry(ary, offset)
+and rb_ary_store(ary, offset, obj).
+
+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)'.
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.
+are responsible for the result. This ends up being the cause of
+interesting bugs.
-1.4 Convert C data into VALUE
+== Convert C Data into VALUE
To convert C data to Ruby values:
- * FIXNUM
+FIXNUM ::
- left shift 1 bit, and turn on LSB.
+ left shift 1 bit, and turn on its least significant bit (LSB).
- * Other pointer values
+Other pointer values::
- cast to VALUE.
+ cast to VALUE.
-You can determine whether a VALUE is pointer or not by checking its LSB.
+You can determine whether a VALUE is a pointer or not by checking its LSB.
-Notice Ruby does not allow arbitrary pointer values to be a VALUE. They
+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.
+To convert C numbers to Ruby values, use these macros:
- INT2FIX() for integers within 31bits.
- INT2NUM() for arbitrary sized integer.
+INT2FIX() :: for integers within 31bits.
+INT2NUM() :: for arbitrary sized integers.
INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
range, but is a bit slower.
-1.5 Manipulating Ruby data
+== 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_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal.
+
+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.
+
+ Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+ (or Object#inspect if '+' flag is set) output (and related argument
+ must be a VALUE). Since it conflicts with "%i", for integers in
+ format strings, use "%d".
+
+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) ::
+rb_str_cat_cstr(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.
-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:
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc) ::
- String functions
+ Creates a new Ruby string with the specified encoding.
- rb_str_new(const char *ptr, long len)
+rb_enc_str_new_literal(const char *ptr) ::
- Creates a new Ruby string.
+ Creates a new Ruby string from a C string literal with the specified
+ encoding.
- rb_str_new2(const char *ptr)
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_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)).
+ Creates a new Ruby string with encoding US-ASCII.
- rb_tainted_str_new(const char *ptr, long len)
+rb_usascii_str_new_literal(const char *ptr) ::
- Creates a new tainted Ruby string. Strings from external data
- sources should be tainted.
+ Creates a new Ruby string from a C string literal with encoding
+ US-ASCII.
- rb_tainted_str_new2(const char *ptr)
+rb_utf8_str_new(const char *ptr, long len) ::
+rb_utf8_str_new_cstr(const char *ptr) ::
- Creates a new tainted Ruby string from a C string.
+ Creates a new Ruby string with encoding UTF-8.
- rb_str_cat(VALUE str, const char *ptr, long len)
+rb_utf8_str_new_literal(const char *ptr) ::
- Appends len bytes of data from ptr to the Ruby string.
+ Creates a new Ruby string from a C string literal with encoding
+ UTF-8.
- Array functions
+rb_str_resize(VALUE str, long len) ::
- rb_ary_new()
+ Resizes a 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.
- Creates an array with no elements.
+rb_str_set_len(VALUE str, long len) ::
- rb_ary_new2(long len)
+ Sets the length of a Ruby string. If str is not modifiable, this
+ function raises an exception. This function preserves the content
+ up to len bytes, regardless RSTRING_LEN(str). len must not exceed
+ the capacity of str.
- Creates an array with no elements, allocating internal buffer
- for len elements.
+=== Array Functions
- rb_ary_new3(long n, ...)
+rb_ary_new() ::
- Creates an n-element array from the arguments.
+ Creates an array with no elements.
- rb_ary_new4(long n, VALUE *elts)
+rb_ary_new2(long len) ::
+rb_ary_new_capa(long len) ::
- Creates an n-element array from a C array.
+ Creates an array with no elements, allocating internal buffer
+ for len elements.
- 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_new3(long n, ...) ::
+rb_ary_new_from_args(long n, ...) ::
- Array operations. The first argument to each functions must be an
- array. They may dump core if other types are given.
+ Creates an n-element array from the arguments.
-2. Extending Ruby with C
+rb_ary_new4(long n, VALUE *elts) ::
+rb_ary_new_from_values(long n, VALUE *elts) ::
-2.1 Addding new features to Ruby
+ 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) ::
+
+ Equivalent to Array#[].
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ ary[offset]
+
+rb_ary_store(VALUE ary, long offset, VALUE obj) ::
+
+ ary[offset] = obj
+
+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
+* Classes, Modules
+* Methods, Singleton Methods
+* Constants
-2.1.1 Class/module definition
+=== Class and Module Definition
To define a class or module, use the functions below:
@@ -233,21 +354,21 @@ 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)
-2.1.2 Method/singleton method definition
+=== Method and Singleton Method Definition
To define methods or singleton methods, use these functions:
- void rb_define_method(VALUE klass, 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,
+ 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.
+the arguments.
If argc is -1, the function will be called as:
@@ -264,15 +385,23 @@ will be called like:
where obj is the receiver, and args is the Ruby array containing
actual arguments.
-There are two more functions to define methods. One is to define
-private methods:
+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,
+ 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)
-The other is to define 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:
+At last, rb_define_module_function defines a module function,
+which are private AND singleton methods of the module.
+For example, sqrt is a module function defined in the Math module.
+It can be called in the following way:
Math.sqrt(4)
@@ -283,10 +412,10 @@ or
To define module functions, use:
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
-Oh, in addition, function-like methods, which are private methods defined
+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)
@@ -295,16 +424,30 @@ 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 have to take the klass as the argument and return a newly
-allocated instance. This instance should be empty as possible,
+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.
-2.1.3 Constant definition
+If you are overriding an existing method of any ancestor of your class,
+you may rely on:
+
+ VALUE rb_call_super(int argc, const VALUE *argv)
+
+To achieve the receiver of the current scope (if no other way is
+available), you can use:
+
+ VALUE rb_current_receiver(void)
+
+=== Constant Definition
We have 2 functions to define constants:
@@ -314,11 +457,11 @@ We have 2 functions to define constants:
The former is to define a constant under specified class/module. The
latter is to define a global constant.
-2.2 Use Ruby features from C
+== Use Ruby Features from C
There are several ways to invoke Ruby's features from C code.
-2.2.1 Evaluate Ruby Programs in a String
+=== 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:
@@ -328,23 +471,56 @@ evaluate the string as Ruby program. This function will do the job:
Evaluation is done under the current context, thus current local variables
of the innermost method (which is defined by Ruby) can be accessed.
-2.2.2 ID or Symbol
+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 occurred. 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
-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:
+or
- :Identifier
+ :"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 retrieve Symbol from Ruby object (Symbol or String) given as
+an argument by using
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+These functions are similar to above functions except that these
+return a Symbol instead of an ID.
You can convert C ID to Ruby Symbol by using
@@ -354,7 +530,7 @@ and to convert Ruby Symbol object to ID, use
ID SYM2ID(VALUE symbol)
-2.2.3 Invoke Ruby method from C
+=== Invoke Ruby Method from C
To invoke methods directly, you can use the function below
@@ -363,11 +539,11 @@ To invoke methods directly, you can use the function below
This function invokes a method on the recv, with the method name
specified by the symbol mid.
-2.2.4 Accessing the variables and constants
+=== 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.
+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:
@@ -380,13 +556,14 @@ To access the constants of the class/module:
VALUE rb_const_get(VALUE obj, ID id)
-See 2.1.3 for defining new constant.
+See also Constant Definition above.
-3. Information sharing between Ruby and C
+= Information Sharing Between Ruby and C
-3.1 Ruby constants that C can be accessed from C
+=== Ruby Constants That Can Be Accessed From C
-The following Ruby constants can be referred from C.
+As stated in section 1.3,
+the following Ruby constants can be referred from C.
Qtrue
Qfalse
@@ -397,7 +574,7 @@ Boolean values. Qfalse is false in C also (i.e. 0).
Ruby nil in C scope.
-3.2 Global variables shared between C and Ruby
+== 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:
@@ -416,30 +593,37 @@ function below.
You can defined hooked variables. The accessor functions (getter and
setter) are called on access to the hooked variables.
- void rb_define_hooked_variable(constchar *name, VALUE *var,
+ 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().
- 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, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
-This function defines a Ruby global variable without a corresponding C
+
+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:
- (*getter)(ID id, void *data, struct global_entry* entry);
- (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
+ VALUE (*getter)(ID id);
+ void (*setter)(VALUE val, ID id);
+
-3.3 Encapsulate C data into a Ruby object
+== 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, ptr)
+ 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
@@ -448,6 +632,10 @@ 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)
@@ -468,31 +656,34 @@ Data_Get_Struct().
A pointer to the structure will be assigned to the variable sval.
-See the example below for details.
+See the example below for details.
-4. Example - Creating dbm extension
+= Example - Creating the 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.
-(1) make the directory
+== Make the Directory
% mkdir ext/dbm
Make a directory for the extension library under ext directory.
-(2) design the library
+== Design the Library
You need to design the library features, before making it.
-(3) write C code.
+== 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
@@ -500,53 +691,49 @@ the library.
Here's the example of an initializing function.
---
-Init_dbm()
-{
- /* 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.
+ void
+ Init_dbm(void)
+ {
+ /* define DBM class */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBM includes Enumerable 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);
---
-struct dbmdata {
- int di_size;
- DBM *di_dbm;
-};
+ /* ... */
+ /* 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.
-obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
---
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
-This code wraps the dbmdata structure into a Ruby object. We avoid wrapping
-DBM* directly, because we want to cache size information.
+ 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();\
-}
---
+ #define GetDBM(obj, dbmp) do {\
+ Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
This sort of complicated macro does the retrieving and close checking for
the DBM.
@@ -554,14 +741,11 @@ 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(obj, keystr)
- VALUE obj, keystr;
-{
- :
-}
---
+ 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.
@@ -569,52 +753,44 @@ arguments to the method.
Second, methods with an arbitrary number of arguments receive
arguments like this:
---
-static VALUE
-fdbm_s_open(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
-{
- :
- if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
- mode = 0666; /* default value */
- }
- :
-}
---
+ 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. For example, "11" means that the method requires at least one
-argument, and at most receives two arguments.
+arguments. The third argument is a string that specifies how to
+capture method arguments and assign them to the following VALUE
+references.
-Methods with an arbitrary number of arguments can receive arguments
-by Ruby's array, like this:
---
-static VALUE
-fdbm_indexes(obj, args)
- VALUE obj, args;
-{
- :
-}
---
+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
+*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)
-(4) prepare extconf.rb
+== Prepare extconf.rb
If the file named extconf.rb exists, it will be executed to generate
Makefile.
@@ -627,10 +803,26 @@ need to put
at the top of the file. You can use the functions below to check
various conditions.
- have_library(lib, func): check whether library containing function exists.
- have_func(func, header): check whether function exists
- have_header(header): check whether header file exists
- create_makefile(target): generate Makefile
+ 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 executable 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.
@@ -647,7 +839,7 @@ If a compilation condition is not fulfilled, you should not call
``create_makefile''. The Makefile will not be generated, compilation will
not be done.
-(5) prepare depend (optional)
+== Prepare Depend (Optional)
If the file named depend exists, Makefile will include that file to
check dependencies. You can make this file by invoking
@@ -656,7 +848,7 @@ check dependencies. You can make this file by invoking
It's harmless. Prepare it.
-(6) generate Makefile
+== Generate Makefile
Try generating the Makefile by:
@@ -671,7 +863,7 @@ 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.
-(7) make
+== Run make
Type
@@ -680,482 +872,857 @@ Type
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.
-(8) debug
+== 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.
-(9) done, now you have the extension library
+== 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
+= Appendix A. Ruby Source Files Overview
-ruby language core
+== Ruby Language Core
- class.c
- error.c
- eval.c
- gc.c
- object.c
- parse.y
- variable.c
+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
-utility functions
+== 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 switching
+ 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)
- dln.c
regex.c
- st.c
- util.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== Utility Functions
-ruby interpreter implementation
+debug.c :: debug symbols for C debugger
+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
-class library
+ 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
+
- array.c
- bignum.c
- compar.c
- dir.c
- enum.c
- file.c
- hash.c
- io.c
- marshal.c
- math.c
- numeric.c
- pack.c
- prec.c
- process.c
- random.c
- range.c
- re.c
- signal.c
- sprintf.c
- string.c
- struct.c
- time.c
+= Appendix B. Ruby Extension API Reference
-Appendix B. Ruby extension API reference
+== Types
-** Types
+VALUE ::
- 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).
-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
-** Variables and constants
+Qnil::
+ nil object
- Qnil
+Qtrue::
+ true object (default true value)
-const: nil object
+Qfalse::
+ false object
- Qtrue
+== C Pointer Wrapping
-const: true object(default true value)
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
- Qfalse
+ 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.
-const: false object
+Data_Make_Struct(klass, type, mark, free, sval) ::
-** C pointer wrapping
+ This macro allocates memory using malloc(), assigns it to the variable
+ sval, and returns the DATA encapsulating the pointer to memory region.
- Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
+Data_Get_Struct(data, type, 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.
+ This macro retrieves the pointer value from DATA, and assigns it to
+ the variable sval.
- Data_Make_Struct(klass, type, mark, free, sval)
+== Checking Data Types
-This macro allocates memory using malloc(), assigns it to the variable
-sval, and returns the DATA encapsulating the pointer to memory region.
+TYPE(value) ::
- Data_Get_Struct(data, type, sval)
+ Internal type (T_NIL, T_FIXNUM, etc.)
-This macro retrieves the pointer value from DATA, and assigns it to
-the variable sval.
+FIXNUM_P(value) ::
-** Checking data types
+ Is +value+ a Fixnum?
-TYPE(value)
-FIXNUM_P(value)
-NIL_P(value)
-void Check_Type(VALUE value, int type)
-void Check_SafeStr(VALUE value)
+NIL_P(value) ::
-** Data type conversion
+ Is +value+ nil?
-FIX2INT(value)
-INT2FIX(i)
-NUM2INT(value)
-INT2NUM(i)
-NUM2DBL(value)
-rb_float_new(f)
-StringValue(value)
-StringValuePtr(value)
-StringValueCStr(value)
-rb_str_new2(s)
+void Check_Type(VALUE value, int type) ::
-** defining class/module
+ Ensures +value+ is of the given internal +type+ or raises a TypeError
- VALUE rb_define_class(const char *name, VALUE super)
+SaveStringValue(value) ::
-Defines a new Ruby class as a subclass of super.
+ Checks that +value+ is a String and is not tainted
- VALUE rb_define_class_under(VALUE module, const char *name, VALUE super)
+== Data Type Conversion
-Creates a new Ruby class as a subclass of super, under the module's
-namespace.
+FIX2INT(value), INT2FIX(i) ::
- VALUE rb_define_module(const char *name)
+ Fixnum <-> integer
-Defines a new Ruby module.
+FIX2LONG(value), LONG2FIX(l) ::
- VALUE rb_define_module_under(VALUE module, const char *name)
+ Fixnum <-> long
-Defines a new Ruby module under the module's namespace.
+NUM2INT(value), INT2NUM(i) ::
- void rb_include_module(VALUE klass, VALUE module)
+ Numeric <-> integer
-Includes module into class. If class already includes it, just
-ignored.
+NUM2UINT(value), UINT2NUM(ui) ::
- void rb_extend_object(VALUE object, VALUE module)
+ Numeric <-> unsigned integer
-Extend the object with the module's attributes.
+NUM2LONG(value), LONG2NUM(l) ::
-** Defining Global Variables
+ Numeric <-> long
- void rb_define_variable(const char *name, VALUE *var)
+NUM2ULONG(value), ULONG2NUM(ul) ::
-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.
+ Numeric <-> unsigned long
- void rb_define_readonly_variable(const char *name, VALUE *var)
+NUM2LL(value), LL2NUM(ll) ::
-Defines a read-only global variable. Works just like
-rb_define_variable(), except the defined variable is read-only.
+ Numeric <-> long long
- void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), VALUE (*setter)())
+NUM2ULL(value), ULL2NUM(ull) ::
-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:
+ Numeric <-> unsigned long long
- VALUE getter(ID id)
- void setter(VALUE val, ID id)
+NUM2OFFT(value), OFFT2NUM(off) ::
-The getter function must return the value for the access.
+ Numeric <-> off_t
- void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), VALUE (*setter)())
+NUM2SIZET(value), SIZET2NUM(size) ::
-Defines hooked variable. It's a virtual variable with a C variable.
-The getter is called as
+ Numeric <-> size_t
- VALUE getter(ID id, VALUE *var)
+NUM2SSIZET(value), SSIZET2NUM(ssize) ::
-returning a new value. The setter is called as
+ Numeric <-> ssize_t
- void setter(VALUE val, ID id, VALUE *var)
+rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags) ::
-GC requires C global variables which hold Ruby values to be marked.
+ Numeric <-> Arbitrary size integer buffer
- void rb_global_variable(VALUE *var)
+NUM2DBL(value) ::
-Tells GC to protect these variables.
+ Numeric -> double
-** Constant Definition
+rb_float_new(f) ::
- void rb_define_const(VALUE klass, const char *name, VALUE val)
+ double -> Float
-Defines a new constant under the class/module.
+RSTRING_LEN(str) ::
- void rb_define_global_const(const char *name, VALUE val)
+ String -> length of String data in bytes
-Defines a global constant. This is just the same as
+RSTRING_PTR(str) ::
- rb_define_const(cKernal, name, val)
+ String -> pointer to String data
+ Note that the result pointer may not be NUL-terminated
-** Method Definition
+StringValue(value) ::
- rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ Object with #to_str -> String
-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.
+StringValuePtr(value) ::
- rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ Object with #to_str -> pointer to String data
-Defines a private method for the class. Arguments are same as
-rb_define_method().
+StringValueCStr(value) ::
- rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ Object with #to_str -> pointer to String data without NUL bytes
+ It is guaranteed that the result data is NUL-terminated
-Defines a singleton method. Arguments are same as rb_define_method().
+rb_str_new2(s) ::
- rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
+ char * -> String
-Retrieve argument from argc, argv. The fmt is the format string for
-the arguments, such as "12" for 1 non-optional argument, 2 optional
-arguments. If `*' appears at the end of fmt, it means the rest of
-the arguments are assigned to the corresponding variable, packed in
-an array.
+== Defining Classes and Modules
-** Invoking Ruby method
+VALUE rb_define_class(const char *name, VALUE super) ::
- VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
+ Defines a new Ruby class as a subclass of super.
-Invokes a method. To retrieve mid from a method name, use rb_intern().
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
- VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ Creates a new Ruby class as a subclass of super, under the module's
+ namespace.
-Invokes a method, passing arguments by an array of values.
+VALUE rb_define_module(const char *name) ::
- VALUE rb_eval_string(const char *str)
+ Defines a new Ruby module.
-Compiles and executes the string as a Ruby program.
+VALUE rb_define_module_under(VALUE module, const char *name) ::
- ID rb_intern(const char *name)
+ Defines a new Ruby module under the module's namespace.
-Returns ID corresponding to the name.
+void rb_include_module(VALUE klass, VALUE module) ::
- char *rb_id2name(ID id)
+ Includes module into class. If class already includes it, just ignored.
-Returns the name corresponding ID.
+void rb_extend_object(VALUE object, VALUE module) ::
- char *rb_class2name(VALUE klass)
+ Extend the object with the module's attributes.
-Returns the name of the class.
+== Defining Global Variables
- int rb_respond_to(VALUE object, ID id)
+void rb_define_variable(const char *name, VALUE *var) ::
-Returns true if the object responds to the message specified by id.
+ 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.
-** Instance Variables
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
- VALUE rb_iv_get(VALUE obj, const char *name)
+ Defines a read-only global variable. Works just like
+ rb_define_variable(), except the defined variable is read-only.
-Retrieve the value of the instance variable. If the name is not
-prefixed by `@', that variable shall be inaccessible from Ruby.
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
- VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
+ 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:
-Sets the value of the instance variable.
+ VALUE getter(ID id)
+ void setter(VALUE val, ID id)
-** Control Structure
+ The getter function must return the value for the access.
- VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
-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.
-
- VALUE rb_yield(VALUE val)
+ Defines hooked variable. It's a virtual variable with a C variable.
+ The getter is called as
-Evaluates the block with value val.
+ VALUE getter(ID id, VALUE *var)
- VALUE rb_rescue(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)
+ returning a new value. The setter is called as
-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.
+ void setter(VALUE val, ID id, VALUE *var)
- VALUE rb_ensure(VALUE (*func1)(), void *arg1, void (*func2)(), void *arg2)
+ GC requires C global variables which hold Ruby values to be marked.
-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.
+void rb_global_variable(VALUE *var)
-** Exceptions and Errors
+ Tells GC to protect these variables.
- void rb_warn(const char *fmt, ...)
+== Constant Definition
-Prints a warning message according to a printf-like format.
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
- void rb_warning(const char *fmt, ...)
+ Defines a new constant under the class/module.
-Prints a warning message according to a printf-like format, if
-$VERBOSE is true.
+void rb_define_global_const(const char *name, VALUE val) ::
-void rb_raise(rb_eRuntimeError, const char *fmt, ...)
+ Defines a global constant. This is just the same as
-Raises RuntimeError. The fmt is a format string just like printf().
+ rb_define_const(rb_cObject, name, val)
- void rb_raise(VALUE exception, const char *fmt, ...)
+== Method Definition
-Raises a class exception. The fmt is a format string just like printf().
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
- void rb_fatal(const char *fmt, ...)
+ 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.
-Raises a fatal error, terminates the interpreter. No exception handling
-will be done for fatal errors, but ensure blocks will be executed.
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
- void rb_bug(const char *fmt, ...)
+ Defines a private method for the class. Arguments are same as
+ rb_define_method().
-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.
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-** Initialize and Start the Interpreter
+ 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.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
+
+ Retrieves argument VALUEs bound to keywords, which directed by +table+
+ into +values+. First +required+ number of IDs referred by +table+ are
+ mandatory, and succeeding +optional+ (- +optional+ - 1 if
+ +optional+ is negative) number of IDs are optional. If a
+ mandatory key is not contained in +keyword_hash+, raises "missing
+ keyword" +ArgumentError+. If an optional key is not present in
+ +keyword_hash+, the corresponding element in +values+ is not changed.
+ If +optional+ is negative, rest of +keyword_hash+ are stored in the
+ next to optional +values+ as a new Hash, otherwise raises "unknown
+ keyword" +ArgumentError+.
+
+VALUE rb_extract_keywords(VALUE *original_hash)
+
+ Extracts pairs whose key is a symbol into a new hash from a hash
+ object referred by +original_hash+. If the original hash contains
+ non-symbol keys, then they are copied to another hash and the new hash
+ is stored through +original_hash+, else 0 is stored.
+
+== 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().
+ Able to call even private/protected methods.
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call even private/protected methods.
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call only public methods.
+
+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 obj, 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)(), VALUE arg1, VALUE (*func2)(), VALUE 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 occurred.
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ Calls the function func with arg as the argument. If no exception
+ occurred 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.
+
+Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+(or Object#inspect if '+' flag is set) output (and related argument
+must be a VALUE). Since it conflicts with "%i", for integers in
+format strings, use "%d".
+
+== Initialize and Start the Interpreter
The embedding API functions are below (not needed for extension libraries):
- void ruby_init()
+void ruby_init() ::
-Initializes the interpreter.
+ Initializes the interpreter.
- void ruby_options(int argc, char **argv)
+void *ruby_options(int argc, char **argv) ::
-Process command line arguments for the interpreter.
+ Process command line arguments for the interpreter.
+ And compiles the Ruby source to execute.
+ It returns an opaque pointer to the compiled source
+ or an internal special value.
- void ruby_run()
+int ruby_run_node(void *n) ::
-Starts execution of the interpreter.
+ Runs the given compiled source and exits this process.
+ It returns EXIT_SUCCESS if successfully runs the source.
+ Otherwise, it returns other value.
- void ruby_script(char *name)
+void ruby_script(char *name) ::
-Specifies the name of the script ($0).
+ Specifies the name of the script ($0).
-** Hooks for the Interpreter Events
+== Hooks for the Interpreter Events
- void rb_add_event_hook(rb_event_hook_func_t func, rb_event_t 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
+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, NODE *node,
- VALUE self, ID id, VALUE klass)
+ 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)
+ int rb_remove_event_hook(rb_event_hook_func_t func)
Removes the specified hook function.
-Appendix C. Functions Available in extconf.rb
+== 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.
+
+= Appendix C. Functions available for use in extconf.rb
+
+See documentation for {mkmf}[rdoc-ref:MakeMakefile].
+
+= Appendix D. Generational GC
+
+Ruby 2.1 introduced a generational garbage collector (called RGenGC).
+RGenGC (mostly) keeps compatibility.
+
+Generally, the use of the technique called write barriers is required in
+extension libraries for generational GC
+(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29).
+RGenGC works fine without write barriers in extension libraries.
+
+If your library adheres to the following tips, performance can
+be further improved. Especially, the "Don't touch pointers directly" section is
+important.
+
+== Incompatibility
+
+You can't write RBASIC(obj)->klass field directly because it is const
+value now.
+
+Basically you should not write this field because MRI expects it to be
+an immutable field, but if you want to do it in your extension you can
+use the following functions:
+
+VALUE rb_obj_hide(VALUE obj) ::
+
+ Clear RBasic::klass field. The object will be an internal object.
+ ObjectSpace::each_object can't find this object.
+
+VALUE rb_obj_reveal(VALUE obj, VALUE klass) ::
+
+ Reset RBasic::klass to be klass.
+ We expect the `klass' is hidden class by rb_obj_hide().
-These functions are available in extconf.rb:
+== Write barriers
- have_macro(macro, headers)
+RGenGC doesn't require write barriers to support generational GC.
+However, caring about write barrier can improve the performance of
+RGenGC. Please check the following tips.
-Checks whether macro is defined with header. Returns true if the macro
-is defined.
+=== Don't touch pointers directly
- have_library(lib, func)
+In MRI (include/ruby/ruby.h), some macros to acquire pointers to the
+internal data structures are supported such as RARRAY_PTR(),
+RSTRUCT_PTR() and so on.
-Checks whether the library exists, containing the specified function.
-Returns true if the library exists.
+DO NOT USE THESE MACROS and instead use the corresponding C-APIs such as
+rb_ary_aref(), rb_ary_store() and so on.
- find_library(lib, func, path...)
+=== Consider whether to insert write barriers
-Checks whether a library which contains the specified function exists in
-path. Returns true if the library exists.
+You don't need to care about write barriers if you only use built-in
+types.
- have_func(func, header)
+If you support T_DATA objects, you may consider using write barriers.
-Checks whether func exists with header. Returns true if the function
-exists. To check functions in an additional library, you need to
-check that library first using have_library().
+Inserting write barriers into T_DATA objects only works with the
+following type objects: (a) long-lived objects, (b) when a huge number
+of objects are generated and (c) container-type objects that have
+references to other objects. If your extension provides such a type of
+T_DATA objects, consider inserting write barriers.
- have_var(var, header)
+(a): short-lived objects don't become old generation objects.
+(b): only a few oldgen objects don't have performance impact.
+(c): only a few references don't have performance impact.
-Checks whether var exists with header. Returns true if the variable
-exists. To check variables in an additional library, you need to
-check that library first using have_library().
+Inserting write barriers is a very difficult hack, it is easy to
+introduce critical bugs. And inserting write barriers has several areas
+of overhead. Basically we don't recommend you insert write barriers.
+Please carefully consider the risks.
- have_header(header)
+=== Combine with built-in types
-Checks whether header exists. Returns true if the header file exists.
+Please consider utilizing built-in types. Most built-in types support
+write barrier, so you can use them to avoid manually inserting write
+barriers.
- find_header(header, path...)
+For example, if your T_DATA has references to other objects, then you
+can move these references to Array. A T_DATA object only has a reference
+to an array object. Or you can also use a Struct object to gather a
+T_DATA object (without any references) and an that Array contains
+references.
-Checks whether header exists in path. Returns true if the header file
-exists.
+With use of such techniques, you don't need to insert write barriers
+anymore.
- have_struct_member(type, member, header)
+=== Insert write barriers
-Checks whether type has member with header. Returns true if the type
-is defined and has the member.
+[AGAIN] Inserting write barriers is a very difficult hack, and it is
+easy to introduce critical bugs. And inserting write barriers has
+several areas of overhead. Basically we don't recommend you insert write
+barriers. Please carefully consider the risks.
- have_type(type, header, opt)
+Before inserting write barriers, you need to know about RGenGC algorithm
+(gc.c will help you). Macros and functions to insert write barriers are
+available in in include/ruby/ruby.h. An example is available in iseq.c.
-Checks whether type is defined with header. Returns true if the type
-is defined.
+For a complete guide for RGenGC and write barriers, please refer to
+<https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RGenGC>.
- check_sizeof(type, header)
+= Appendix E. RB_GC_GUARD to protect from premature GC
-Checks the size of type in char with header. Returns the size if the
-type is defined, otherwise nil.
+C Ruby currently uses conservative garbage collection, thus VALUE
+variables must remain visible on the stack or registers to ensure any
+associated data remains usable. Optimizing C compilers are not designed
+with conservative garbage collection in mind, so they may optimize away
+the original VALUE even if the code depends on data associated with that
+VALUE.
- create_makefile(target)
+The following example illustrates the use of RB_GC_GUARD to ensure
+the contents of sptr remain valid while the second invocation of
+rb_str_new_cstr is running.
-Generates the Makefile for the extension library. If you don't invoke
-this method, the compilation will not be done.
+ VALUE s, w;
+ const char *sptr;
- find_executable(bin, path)
+ s = rb_str_new_cstr("hello world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ sptr = RSTRING_PTR(s);
+ w = rb_str_new_cstr(sptr + 6); /* Possible GC invocation */
-Finds command in path, which is File::PATH_SEPARATOR-separated list of
-directories. If path is nil or omitted, environment varialbe PATH
-will be used. Returns the path name of the command if it is found,
-otherwise nil.
+ RB_GC_GUARD(s); /* ensure s (and thus sptr) do not get GC-ed */
- with_config(withval[, default=nil])
+In the above example, RB_GC_GUARD must be placed _after_ the last use of
+sptr. Placing RB_GC_GUARD before dereferencing sptr would be of no use.
+RB_GC_GUARD is only effective on the VALUE data type, not converted C
+data types.
-Parses the command line options and returns the value specified by
---with-<withval>.
+RB_GC_GUARD would not be necessary at all in the above example if
+non-inlined function calls are made on the `s' VALUE after sptr is
+dereferenced. Thus, in the above example, calling any un-inlined
+function on `s' such as:
- enable_config(config, *defaults)
- disable_config(config, *defaults)
+ rb_str_modify(s);
-Parses the command line options for boolean. Returns true if
---enable-<config> is given, or false if --disable-<config> is given.
-Otherwise, yields defaults to the given block and returns the result
-if it is called with a block, or returns defaults.
+Will ensure `s' stays on the stack or register to prevent a
+GC invocation from prematurely freeing it.
- dir_config(target[, default_dir])
- dir_config(target[, default_include, default_lib])
+Using the RB_GC_GUARD macro is preferable to using the "volatile"
+keyword in C. RB_GC_GUARD has the following advantages:
-Parses the command line options and adds the directories specified by
---with-<target>-dir, --with-<target>-include, and/or --with-<target>-lib
-to $CFLAGS and/or $LDFLAGS. --with-<target>-dir=/path is equivalent to
---with-<target>-include=/path/include --with-<target>-lib=/path/lib.
-Returns an array of the added directories ([include_dir, lib_dir]).
+1) the intent of the macro use is clear
- pkg_config(pkg)
+2) RB_GC_GUARD only affects its call site, "volatile" generates some
+ extra code every time the variable is used, hurting optimization.
-Obtains the information for pkg by pkg-config command. The actual
-command name can be overriden by --with-pkg-config command line
-option.
+3) "volatile" implementations may be buggy/inconsistent in some
+ compilers and architectures. RB_GC_GUARD is customizable for broken
+ systems/compilers without those without negatively affecting other
+ systems.
/*
* Local variables:
diff --git a/README.EXT.ja b/README.EXT.ja
index 73425c2cdb..b662d4dfdb 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1,1261 +1,1717 @@
-.\" README.EXT.ja - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
+# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-Ruby¤Î³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Îºî¤êÊý¤òÀâÌÀ¤·¤Þ¤¹¡¥
+Rubyã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã®ä½œã‚Šæ–¹ã‚’説明ã—ã¾ã™ï¼Ž
-1¡¥´ðÁÃÃμ±
+= 基礎知識
-C¤ÎÊÑ¿ô¤Ë¤Ï·¿¤¬¤¢¤ê¡¤¥Ç¡¼¥¿¤Ë¤Ï·¿¤¬¤¢¤ê¤Þ¤»¤ó¡¥¤Ç¤¹¤«¤é¡¤¤¿
-¤È¤¨¤Ð¥Ý¥¤¥ó¥¿¤òint¤ÎÊÑ¿ô¤ËÂåÆþ¤¹¤ë¤È¡¤¤½¤ÎÃͤÏÀ°¿ô¤È¤·¤Æ¼è
-¤ê°·¤ï¤ì¤Þ¤¹¡¥µÕ¤ËRuby¤ÎÊÑ¿ô¤Ë¤Ï·¿¤¬¤Ê¤¯¡¤¥Ç¡¼¥¿¤Ë·¿¤¬¤¢¤ê¤Þ
-¤¹¡¥¤³¤Î°ã¤¤¤Î¤¿¤á¡¤C¤ÈRuby¤ÏÁê¸ß¤ËÊÑ´¹¤·¤Ê¤±¤ì¤Ð¡¤¤ª¸ß¤¤¤Î
-¥Ç¡¼¥¿¤ò¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡¥
+Cã®å¤‰æ•°ã«ã¯åž‹ãŒã‚り,データã«ã¯åž‹ãŒã‚りã¾ã›ã‚“.ã§ã™ã‹ã‚‰ï¼ŒãŸ
+ã¨ãˆã°ãƒã‚¤ãƒ³ã‚¿ã‚’intã®å¤‰æ•°ã«ä»£å…¥ã™ã‚‹ã¨ï¼Œãã®å€¤ã¯æ•´æ•°ã¨ã—ã¦å–
+り扱ã‚れã¾ã™ï¼Žé€†ã«Rubyã®å¤‰æ•°ã«ã¯åž‹ãŒãªã,データã«åž‹ãŒã‚りã¾
+ã™ï¼Žã“ã®é•ã„ã®ãŸã‚,Cã¨Rubyã¯ç›¸äº’ã«å¤‰æ›ã—ãªã‘れã°ï¼ŒãŠäº’ã„ã®
+データをアクセスã§ãã¾ã›ã‚“.
-Ruby¤Î¥Ç¡¼¥¿¤ÏVALUE¤È¤¤¤¦C¤Î·¿¤Çɽ¸½¤µ¤ì¤Þ¤¹¡¥VALUE·¿¤Î¥Ç¡¼
-¥¿¤Ï¤½¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ò¼«Ê¬¤ÇÃΤäƤ¤¤Þ¤¹¡¥¤³¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤È
-¤¤¤¦¤Î¤Ï¥Ç¡¼¥¿(¥ª¥Ö¥¸¥§¥¯¥È)¤Î¼ÂºÝ¤Î¹½Â¤¤ò°ÕÌ£¤·¤Æ¤¤¤Æ¡¤Ruby
-¤Î¥¯¥é¥¹¤È¤Ï¤Þ¤¿°ã¤Ã¤¿¤â¤Î¤Ç¤¹¡¥
+Rubyã®ãƒ‡ãƒ¼ã‚¿ã¯VALUEã¨ã„ã†Cã®åž‹ã§è¡¨ç¾ã•れã¾ã™ï¼ŽVALUEåž‹ã®ãƒ‡ãƒ¼
+ã‚¿ã¯ãã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を自分ã§çŸ¥ã£ã¦ã„ã¾ã™ï¼Žã“ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¨
+ã„ã†ã®ã¯ãƒ‡ãƒ¼ã‚¿(オブジェクト)ã®å®Ÿéš›ã®æ§‹é€ ã‚’æ„味ã—ã¦ã„ã¦ï¼ŒRuby
+ã®ã‚¯ãƒ©ã‚¹ã¨ã¯ã¾ãŸé•ã£ãŸã‚‚ã®ã§ã™ï¼Ž
-VALUE¤«¤éC¤Ë¤È¤Ã¤Æ°ÕÌ£¤Î¤¢¤ë¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¤¿¤á¤Ë¤Ï
+VALUEã‹ã‚‰Cã«ã¨ã£ã¦æ„味ã®ã‚るデータをå–り出ã™ãŸã‚ã«ã¯
- (1) VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤òÃΤë
- (2) VALUE¤òC¤Î¥Ç¡¼¥¿¤ËÊÑ´¹¤¹¤ë
+1. VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—を知る
+2. VALUEã‚’Cã®ãƒ‡ãƒ¼ã‚¿ã«å¤‰æ›ã™ã‚‹
-¤ÎξÊý¤¬É¬ÍפǤ¹¡¥(1)¤ò˺¤ì¤ë¤È´Ö°ã¤Ã¤¿¥Ç¡¼¥¿¤ÎÊÑ´¹¤¬¹Ô¤ï¤ì
-¤Æ¡¤ºÇ°­¥×¥í¥°¥é¥à¤¬core dump¤·¤Þ¤¹¡¥
+ã®ä¸¡æ–¹ãŒå¿…è¦ã§ã™ï¼Ž(1)を忘れるã¨é–“é•ã£ãŸãƒ‡ãƒ¼ã‚¿ã®å¤‰æ›ãŒè¡Œã‚れ
+ã¦ï¼Œæœ€æ‚ªãƒ—ログラムãŒcore dumpã—ã¾ã™ï¼Ž
-1.1 ¥Ç¡¼¥¿¥¿¥¤¥×
+== データタイプ
-Ruby¤Ë¤Ï¥æ¡¼¥¶¤¬»È¤¦²ÄǽÀ­¤Î¤¢¤ë°Ê²¼¤Î¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡¥
+Rubyã«ã¯ãƒ¦ãƒ¼ã‚¶ãŒä½¿ã†å¯èƒ½æ€§ã®ã‚る以下ã®ã‚¿ã‚¤ãƒ—ãŒã‚りã¾ã™ï¼Ž
- T_NIL nil
- T_OBJECT Ä̾ï¤Î¥ª¥Ö¥¸¥§¥¯¥È
- T_CLASS ¥¯¥é¥¹
- T_MODULE ¥â¥¸¥å¡¼¥ë
- T_FLOAT ÉâÆ°¾®¿ôÅÀ¿ô
- T_STRING ʸ»úÎó
- T_REGEXP Àµµ¬É½¸½
- T_ARRAY ÇÛÎó
- T_FIXNUM Fixnum(31bitĹÀ°¿ô)
- T_HASH Ï¢ÁÛÇÛÎó
- T_STRUCT (Ruby¤Î)¹½Â¤ÂÎ
- T_BIGNUM ¿ÇÜĹÀ°¿ô
- T_FILE Æþ½ÐÎÏ
- T_TRUE ¿¿
- T_FALSE µ¶
- T_DATA ¥Ç¡¼¥¿
- T_SYMBOL ¥·¥ó¥Ü¥ë
+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_VARMAP
- T_SCOPE
- T_NODE
+ T_ICLASS
+ T_MATCH
+ T_UNDEF
+ T_NODE
+ T_ZOMBIE
-¤Û¤È¤ó¤É¤Î¥¿¥¤¥×¤ÏC¤Î¹½Â¤ÂΤǼÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+ã»ã¨ã‚“ã©ã®ã‚¿ã‚¤ãƒ—ã¯Cã®æ§‹é€ ä½“ã§å®Ÿè£…ã•れã¦ã„ã¾ã™ï¼Ž
-1.2 VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ò¥Á¥§¥Ã¥¯¤¹¤ë
+== VALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹
-ruby.h¤Ç¤ÏTYPE()¤È¤¤¤¦¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¤VALUE¤Î¥Ç¡¼¥¿
-¥¿¥¤¥×¤òÃΤ뤳¤È¤¬½ÐÍè¤Þ¤¹¡¥TYPE()¥Þ¥¯¥í¤Ï¾å¤Ç¾Ò²ð¤·¤¿T_XXXX
-¤Î·Á¼°¤ÎÄê¿ô¤òÊÖ¤·¤Þ¤¹¡¥VALUE¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤Ë±þ¤¸¤Æ½èÍý¤¹¤ë
-¾ì¹ç¤Ë¤Ï¡¤TYPE()¤ÎÃͤÇʬ´ô¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
+ruby.hã§ã¯TYPE()ã¨ã„ã†ãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„ã¦ï¼ŒVALUEã®ãƒ‡ãƒ¼ã‚¿
+タイプを知るã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼ŽTYPE()マクロã¯ä¸Šã§ç´¹ä»‹ã—ãŸT_XXXX
+ã®å½¢å¼ã®å®šæ•°ã‚’è¿”ã—ã¾ã™ï¼ŽVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã«å¿œã˜ã¦å‡¦ç†ã™ã‚‹
+å ´åˆã«ã¯ï¼ŒTYPE()ã®å€¤ã§åˆ†å²ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
switch (TYPE(obj)) {
case T_FIXNUM:
- /* 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¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤¬Àµ¤·¤¤¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹
-¤ë¤¿¤á¤Ë¤Ï¡¤¤³¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯valueãŒtypeã§ç„¡ã‘れã°ï¼Œä¾‹å¤–を発生ã•ã›ã¾ã™ï¼Žå¼•æ•°ã¨
+ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸVALUEã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ãŒæ­£ã—ã„ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™
+ã‚‹ãŸã‚ã«ã¯ï¼Œã“ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-FIXNUM¤ÈNIL¤Ë´Ø¤·¤Æ¤Ï¤è¤ê¹â®¤ÊȽÊÌ¥Þ¥¯¥í¤¬ÍѰդµ¤ì¤Æ¤¤¤Þ¤¹¡¥
+FIXNUMã¨NILã«é–¢ã—ã¦ã¯ã‚ˆã‚Šé«˜é€Ÿãªåˆ¤åˆ¥ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„ã¾ã™ï¼Ž
FIXNUM_P(obj)
NIL_P(obj)
-1.3 VALUE¤òC¤Î¥Ç¡¼¥¿¤ËÊÑ´¹¤¹¤ë
+== 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()ã€ãŒã‚りã¾ã™ï¼Ž
-¥Ç¡¼¥¿¥¿¥¤¥×¤¬T_NIL, T_FALSE, T_TRUE¤Ç¤¢¤ë»þ¡¤¥Ç¡¼¥¿¤Ï¤½¤ì¤¾
-¤ìnil, false, true¤Ç¤¹¡¥¤³¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤Ò¤È
-¤Ä¤º¤Ä¤·¤«Â¸ºß¤·¤Þ¤»¤ó¡¥
+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 文字ãŒå«ã¾ã‚Œã¦ã„ã‚‹å¯èƒ½æ€§ã‚‚ã‚りã¾ã™ï¼Ž
-¥Ç¡¼¥¿¥¿¥¤¥×¤¬T_FIXNUM¤Î»þ¡¤¤³¤ì¤Ï31bit¤Î¥µ¥¤¥º¤ò»ý¤ÄÀ°¿ô¤Ç
-¤¹¡¥FIXNUM¤òC¤ÎÀ°¿ô¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¤Ï¥Þ¥¯¥í¡ÖFIX2INT()¡×¤ò»È
-¤¤¤Þ¤¹¡¥¤½¤ì¤«¤é¡¤FIXNUM¤Ë¸Â¤é¤ºRuby¤Î¥Ç¡¼¥¿¤òÀ°¿ô¤ËÊÑ´¹¤¹¤ë
-¡ÖNUM2INT()¡×¤È¤¤¤¦¥Þ¥¯¥í¤¬¤¢¤ê¤Þ¤¹¡¥¤³¤Î¥Þ¥¯¥í¤Ï¥Ç¡¼¥¿¥¿¥¤
-¥×¤Î¥Á¥§¥Ã¥¯Ìµ¤·¤Ç»È¤¨¤Þ¤¹(À°¿ô¤ËÊÑ´¹¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤ÏÎã³°¤¬
-ȯÀ¸¤¹¤ë)¡¥Æ±Íͤ˥Á¥§¥Ã¥¯Ìµ¤·¤Ç»È¤¨¤ëÊÑ´¹¥Þ¥¯¥í¤Ïdouble¤ò
-¼è¤ê½Ð¤¹¡ÖNUM2DBL()¡×¤¬¤¢¤ê¤Þ¤¹¡£
+ãれ以外ã®ãƒ‡ãƒ¼ã‚¿ã‚¿ã‚¤ãƒ—ã¯å¯¾å¿œã™ã‚‹Cã®æ§‹é€ ä½“ãŒã‚りã¾ã™ï¼Žå¯¾å¿œã™
+る構造体ã®ã‚ã‚‹VALUEã¯ãã®ã¾ã¾ã‚­ãƒ£ã‚¹ãƒˆ(型変æ›)ã™ã‚Œã°æ§‹é€ ä½“ã®
+ãƒã‚¤ãƒ³ã‚¿ã«å¤‰æ›ã§ãã¾ã™ï¼Ž
-char* ¤ò¼è¤ê½Ð¤¹¾ì¹ç¡¢version 1.6 °ÊÁ°¤Ç¤Ï¡ÖSTR2CSTR()¡×¤È
-¤¤¤¦¥Þ¥¯¥í¤ò»È¤Ã¤Æ¤¤¤Þ¤·¤¿¤¬¡¢¤³¤ì¤Ï to_str() ¤Ë¤è¤ë°ÅÌÛ¤Î
-·¿ÊÑ´¹·ë²Ì¤¬ GC ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¡¢version 1.7 °Ê¹ß¤Ç¤Ï
-obsolete ¤È¤Ê¤ê¡¢Âå¤ï¤ê¤Ë StringValue() ¤È StringValuePtr()
-¤ò»È¤¦»ö¤ò¿ä¾©¤·¤Æ¤¤¤Þ¤¹¡£StringValue(var) ¤Ï var ¤¬ String
- ¤Ç¤¢¤ì¤Ð²¿¤â¤»¤º¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð var ¤ò var.to_str() ¤Î·ë²Ì¤Ë
-ÃÖ¤­´¹¤¨¤ë¥Þ¥¯¥í¡¢StringValuePtr(var) ¤ÏƱÍÍ¤Ë var ¤òÃÖ¤­´¹¤¨
-¤Æ¤«¤é var ¤Îʸ»úÎóɽ¸½¤ËÂФ¹¤ë char* ¤òÊÖ¤¹¥Þ¥¯¥í¤Ç¤¹¡£var ¤Î
-ÆâÍÆ¤òľÀÜÃÖ¤­´¹¤¨¤ë½èÍý¤¬Æþ¤ë¤Î¤Ç¡¢var ¤Ï lvalue ¤Ç¤¢¤ëɬÍפ¬
-¤¢¤ê¤Þ¤¹¡£
+構造体ã¯ã€Œstruct RXxxxxã€ã¨ã„ã†åå‰ã§ruby.hã§å®šç¾©ã•れã¦ã„ã¾
+ã™ï¼Žä¾‹ãˆã°æ–‡å­—列ã¯ã€Œstruct RStringã€ã§ã™ï¼Žå®Ÿéš›ã«ä½¿ã†å¯èƒ½æ€§ãŒ
+ã‚ã‚‹ã®ã¯æ–‡å­—列ã¨é…列ãらã„ã ã¨æ€ã„ã¾ã™ï¼Ž
-¤½¤ì°Ê³°¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ÏÂбþ¤¹¤ëC¤Î¹½Â¤ÂΤ¬¤¢¤ê¤Þ¤¹¡¥Âбþ¤¹
-¤ë¹½Â¤ÂΤΤ¢¤ëVALUE¤Ï¤½¤Î¤Þ¤Þ¥­¥ã¥¹¥È(·¿ÊÑ´¹)¤¹¤ì¤Ð¹½Â¤ÂΤÎ
-¥Ý¥¤¥ó¥¿¤ËÊÑ´¹¤Ç¤­¤Þ¤¹¡¥
+ruby.hã§ã¯æ§‹é€ ä½“ã¸ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãƒžã‚¯ãƒ­ã‚‚「RXXXXX()ã€(全部大文
+å­—ã«ã—ãŸã‚‚ã®)ã¨ã„ã†åå‰ã§æä¾›ã•れã¦ã„ã¾ã™(例: RSTRING()).ãŸ
+ã ã—ã€æ§‹é€ ä½“ã¸ã®ç›´æŽ¥ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ã§ãã‚‹ã ã‘é¿ã‘,対応ã™ã‚‹
+rb_xxxx() ã¨ã„ã£ãŸé–¢æ•°ã‚’使ã†ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.例ãˆã°ï¼Œé…列ã®
+è¦ç´ ã¸ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹å ´åˆã¯ï¼Œrb_ary_entry(ary, offset),
+rb_ary_store(ary, offset, obj) を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
-¹½Â¤ÂΤϡÖstruct RXxxxx¡×¤È¤¤¤¦Ì¾Á°¤Çruby.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ
-¤¹¡¥Î㤨¤Ðʸ»úÎó¤Ï¡Östruct RString¡×¤Ç¤¹¡¥¼ÂºÝ¤Ë»È¤¦²ÄǽÀ­¤¬
-¤¢¤ë¤Î¤Ïʸ»úÎó¤ÈÇÛÎ󤯤餤¤À¤È»×¤¤¤Þ¤¹¡¥
+構造体ã‹ã‚‰ãƒ‡ãƒ¼ã‚¿ã‚’å–り出ã™ãƒžã‚¯ãƒ­ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Žæ–‡å­—列
+strã®é•·ã•ã‚’å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_LEN(str)ã€ã¨ã—,文字列strã‚’
+char*ã¨ã—ã¦å¾—ã‚‹ãŸã‚ã«ã¯ã€ŒRSTRING_PTR(str)ã€ã¨ã—ã¾ã™ï¼Ž
-ruby.h¤Ç¤Ï¹½Â¤ÂΤإ­¥ã¥¹¥È¤¹¤ë¥Þ¥¯¥í¤â¡ÖRXXXXX()¡×(Á´ÉôÂçʸ
-»ú¤Ë¤·¤¿¤â¤Î)¤È¤¤¤¦Ì¾Á°¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹(Îã: RSTRING())¡¥
+Rubyã®æ§‹é€ ä½“を直接アクセスã™ã‚‹æ™‚ã«æ°—ã‚’ã¤ã‘ãªã‘れã°ãªã‚‰ãªã„ã“
+ã¨ã¯ï¼Œé…åˆ—ã‚„æ–‡å­—åˆ—ã®æ§‹é€ ä½“ã®ä¸­èº«ã¯å‚ç…§ã™ã‚‹ã ã‘ã§ï¼Œç›´æŽ¥å¤‰æ›´ã—
+ãªã„ã“ã¨ã§ã™ï¼Žç›´æŽ¥å¤‰æ›´ã—ãŸå ´åˆï¼Œã‚ªãƒ–ジェクトã®å†…å®¹ã®æ•´åˆæ€§ãŒ
+ã¨ã‚Œãªããªã£ã¦ï¼Œæ€ã‚ã¬ãƒã‚°ã®åŽŸå› ã«ãªã‚Šã¾ã™ï¼Ž
-Î㤨¤Ð¡¤Ê¸»úÎóstr¤ÎŤµ¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡ÖRSTRING(str)->len¡×¤È
-¤·¡¤Ê¸»úÎóstr¤òchar*¤È¤·¤ÆÆÀ¤ë¤¿¤á¤Ë¤Ï¡ÖRSTRING(str)->ptr¡×
-¤È¤·¤Þ¤¹¡¥ÇÛÎó¤Î¾ì¹ç¤Ë¤Ï¡¤¤½¤ì¤¾¤ì¡ÖRARRAY(ary)->len¡×¡¤
-¡ÖRARRAY(ary)->ptr¡×¤È¤Ê¤ê¤Þ¤¹¡¥
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’VALUEã«å¤‰æ›ã™ã‚‹
-Ruby¤Î¹½Â¤ÂΤòľÀÜ¥¢¥¯¥»¥¹¤¹¤ë»þ¤Ëµ¤¤ò¤Ä¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³
-¤È¤Ï¡¤ÇÛÎó¤äʸ»úÎó¤Î¹½Â¤ÂΤÎÃæ¿È¤Ï»²¾È¤¹¤ë¤À¤±¤Ç¡¤Ä¾ÀÜÊѹ¹¤·
-¤Ê¤¤¤³¤È¤Ç¤¹¡¥Ä¾ÀÜÊѹ¹¤·¤¿¾ì¹ç¡¤¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆâÍÆ¤ÎÀ°¹çÀ­¤¬
-¤È¤ì¤Ê¤¯¤Ê¤Ã¤Æ¡¤»×¤ï¤Ì¥Ð¥°¤Î¸¶°ø¤Ë¤Ê¤ê¤Þ¤¹¡¥
+VALUEã®å®Ÿéš›ã®æ§‹é€ ã¯
-1.4 C¤Î¥Ç¡¼¥¿¤òVALUE¤ËÊÑ´¹¤¹¤ë
+FIXNUMã®å ´åˆ ::
-VALUE¤Î¼ÂºÝ¤Î¹½Â¤¤Ï
+ 1bit左シフトã—ã¦ï¼ŒLSBã‚’ç«‹ã¦ã‚‹ï¼Ž
- * FIXNUM¤Î¾ì¹ç
+ãã®ä»–ã®ãƒã‚¤ãƒ³ã‚¿ã®å ´åˆ ::
- 1bitº¸¥·¥Õ¥È¤·¤Æ¡¤LSB¤òΩ¤Æ¤ë¡¥
+ ãã®ã¾ã¾VALUEã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ï¼Ž
- * ¤½¤Î¾¤Î¥Ý¥¤¥ó¥¿¤Î¾ì¹ç
+ã¨ãªã£ã¦ã„ã¾ã™ï¼Žã‚ˆã£ã¦ï¼ŒLSBã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚Œã°VALUEãŒFIXNUMã‹ã©
+ã†ã‹ã‚ã‹ã‚‹ã‚ã‘ã§ã™(ãƒã‚¤ãƒ³ã‚¿ã®LSBãŒç«‹ã£ã¦ã„ãªã„ã“ã¨ã‚’仮定ã—ã¦
+ã„ã‚‹).
- ¤½¤Î¤Þ¤ÞVALUE¤Ë¥­¥ã¥¹¥È¤¹¤ë¡¥
+ã§ã™ã‹ã‚‰ï¼ŒFIXNUM以外ã®Rubyã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã®æ§‹é€ ä½“ã¯å˜ã«VALUE
+ã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ã ã‘ã§VALUEã«å¤‰æ›å‡ºæ¥ã¾ã™ï¼ŽãŸã ã—,任æ„ã®æ§‹é€ 
+体ãŒVALUEã«ã‚­ãƒ£ã‚¹ãƒˆå‡ºæ¥ã‚‹ã‚ã‘ã§ã¯ã‚りã¾ã›ã‚“.キャストã™ã‚‹ã®
+ã¯Rubyã®çŸ¥ã£ã¦ã„る構造体(ruby.hã§å®šç¾©ã•れã¦ã„ã‚‹struct RXxxx
+ã®ã‚‚ã®)ã ã‘ã§ã™ï¼Ž
-¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥¤è¤Ã¤Æ¡¤LSB¤ò¥Á¥§¥Ã¥¯¤¹¤ì¤ÐVALUE¤¬FIXNUM¤«¤É
-¤¦¤«¤ï¤«¤ë¤ï¤±¤Ç¤¹(¥Ý¥¤¥ó¥¿¤ÎLSB¤¬Î©¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤ò²¾Äꤷ¤Æ
-¤¤¤ë)¡¥
+FIXNUMã«é–¢ã—ã¦ã¯å¤‰æ›ãƒžã‚¯ãƒ­ã‚’経由ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼ŽCã®æ•´æ•°
+ã‹ã‚‰VALUEã«å¤‰æ›ã™ã‚‹ãƒžã‚¯ãƒ­ã¯ä»¥ä¸‹ã®ã‚‚ã®ãŒã‚りã¾ã™ï¼Žå¿…è¦ã«å¿œã˜
+ã¦ä½¿ã„分ã‘ã¦ãã ã•ã„.
-¤Ç¤¹¤«¤é¡¤FIXNUM°Ê³°¤ÎRuby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤ÂΤÏñ¤ËVALUE
-¤Ë¥­¥ã¥¹¥È¤¹¤ë¤À¤±¤ÇVALUE¤ËÊÑ´¹½ÐÍè¤Þ¤¹¡¥¤¿¤À¤·¡¤Ç¤°Õ¤Î¹½Â¤
-ÂΤ¬VALUE¤Ë¥­¥ã¥¹¥È½ÐÍè¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¥¥­¥ã¥¹¥È¤¹¤ë¤Î
-¤ÏRuby¤ÎÃΤäƤ¤¤ë¹½Â¤ÂÎ(ruby.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëstruct RXxxx
-¤Î¤â¤Î)¤À¤±¤Ç¤¹¡¥
+INT2FIX() :: ã‚‚ã¨ã®æ•´æ•°ãŒ31bitã¾ãŸã¯63bit以内ã«åŽã¾ã‚‹è‡ªä¿¡
+ ãŒã‚る時
+INT2NUM() :: ä»»æ„ã®æ•´æ•°ã‹ã‚‰VALUEã¸
-FIXNUM¤Ë´Ø¤·¤Æ¤ÏÊÑ´¹¥Þ¥¯¥í¤ò·Ðͳ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥C¤ÎÀ°¿ô
-¤«¤éVALUE¤ËÊÑ´¹¤¹¤ë¥Þ¥¯¥í¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡¥É¬Íפ˱þ¤¸
-¤Æ»È¤¤Ê¬¤±¤Æ¤¯¤À¤µ¤¤¡¥
+INT2NUM()ã¯æ•´æ•°ãŒFIXNUMã®ç¯„囲ã«åŽã¾ã‚‰ãªã„å ´åˆï¼ŒBignumã«å¤‰æ›
+ã—ã¦ãれã¾ã™(ãŒï¼Œå°‘ã—é…ã„).
- INT2FIX() ¤â¤È¤ÎÀ°¿ô¤¬31bit°ÊÆâ¤Ë¼ý¤Þ¤ë¼«¿®¤¬¤¢¤ë»þ
- INT2NUM() Ǥ°Õ¤ÎÀ°¿ô¤«¤éVALUE¤Ø
+== Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹
-INT2NUM()¤ÏÀ°¿ô¤¬FIXNUM¤ÎÈϰϤ˼ý¤Þ¤é¤Ê¤¤¾ì¹ç¡¤Bignum¤ËÊÑ´¹
-¤·¤Æ¤¯¤ì¤Þ¤¹(¤¬¡¤¾¯¤·ÃÙ¤¤)¡¥
+先程も述ã¹ãŸé€šã‚Šï¼ŒRubyã®æ§‹é€ ä½“をアクセスã™ã‚‹æ™‚ã«å†…å®¹ã®æ›´æ–°ã‚’
+行ã†ã“ã¨ã¯å‹§ã‚られã¾ã›ã‚“.ã§ï¼ŒRubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹æ™‚ã«ã¯
+RubyãŒç”¨æ„ã—ã¦ã„る関数を用ã„ã¦ãã ã•ã„.
-1.5 Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë
+ã“ã“ã§ã¯ã‚‚ã£ã¨ã‚‚使ã‚れるã§ã‚ã‚ã†æ–‡å­—列ã¨é…列ã®ç”Ÿæˆ/æ“作を行
+ã†é–¢æ•°ã‚’ã‚ã’ã¾ã™(全部ã§ã¯ãªã„ã§ã™).
-ÀèÄø¤â½Ò¤Ù¤¿Ä̤ꡤRuby¤Î¹½Â¤ÂΤò¥¢¥¯¥»¥¹¤¹¤ë»þ¤ËÆâÍÆ¤Î¹¹¿·¤ò
-¹Ô¤¦¤³¤È¤Ï´«¤á¤é¤ì¤Þ¤»¤ó¡¥¤Ç¡¤Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë»þ¤Ë¤Ï
-Ruby¤¬ÍѰդ·¤Æ¤¤¤ë´Ø¿ô¤òÍѤ¤¤Æ¤¯¤À¤µ¤¤¡¥
+=== 文字列ã«å¯¾ã™ã‚‹é–¢æ•°
-¤³¤³¤Ç¤Ï¤â¤Ã¤È¤â»È¤ï¤ì¤ë¤Ç¤¢¤í¤¦Ê¸»úÎó¤ÈÇÛÎó¤ÎÀ¸À®/Áàºî¤ò¹Ô
-¤¤´Ø¿ô¤ò¤¢¤²¤Þ¤¹(Á´Éô¤Ç¤Ï¤Ê¤¤¤Ç¤¹)¡¥
+rb_str_new(const char *ptr, long len) ::
- ʸ»úÎó¤ËÂФ¹¤ë´Ø¿ô
+ æ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- rb_str_new(const char *ptr, long len)
+rb_str_new2(const char *ptr)
+rb_str_new_cstr(const char *ptr)
- ¿·¤·¤¤Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥
+ Cã®æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_new(ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
- rb_str_new2(const char *ptr)
+rb_str_new_literal(const char *ptr)
- C¤Îʸ»úÎ󤫤éRuby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥¤³¤Î´Ø¿ô¤Îµ¡Ç½¤Ï
- rb_str_new(ptr, strlen(ptr))¤ÈƱÅù¤Ç¤¢¤ë¡¥
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- rb_tainted_str_new(const char *ptr, long len)
+rb_tainted_str_new(const char *ptr, long len)
- ±øÀ÷¥Þ¡¼¥¯¤¬Éղ䵤줿¿·¤·¤¤Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥³°Éô
- ¤«¤é¤Î¥Ç¡¼¥¿¤Ë´ð¤Å¤¯Ê¸»úÎó¤Ë¤Ï±øÀ÷¥Þ¡¼¥¯¤¬Éղ䵤ì¤ë¤Ù¤­
- ¤Ç¤¢¤ë¡¥
+ 汚染マークãŒä»˜åŠ ã•ã‚ŒãŸæ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žå¤–部
+ ã‹ã‚‰ã®ãƒ‡ãƒ¼ã‚¿ã«åŸºã¥ã文字列ã«ã¯æ±šæŸ“マークãŒä»˜åŠ ã•れるã¹ã
+ ã§ã‚る.
- rb_tainted_str_new2(const char *ptr)
+rb_tainted_str_new2(const char *ptr)
+rb_tainted_str_new_cstr(const char *ptr)
- C¤Îʸ»úÎ󤫤鱸À÷¥Þ¡¼¥¯¤¬Éղ䵤줿Ruby¤Îʸ»úÎó¤òÀ¸À®¤¹¤ë¡¥
+ Cã®æ–‡å­—列ã‹ã‚‰æ±šæŸ“マークãŒä»˜åŠ ã•れãŸRubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- rb_str_cat(VALUE str, const char *ptr, long len)
+rb_sprintf(const char *format, ...)
+rb_vsprintf(const char *format, va_list ap)
- Ruby¤Îʸ»úÎóstr¤Ëlen¥Ð¥¤¥È¤Îʸ»úÎóptr¤òÄɲ乤롥
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- ÇÛÎó¤ËÂФ¹¤ë´Ø¿ô
+ 注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹
+ ã¨ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れ
+ ã¯"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
- rb_ary_new()
+rb_str_cat(VALUE str, const char *ptr, long len)
- Í×ÁǤ¬0¤ÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ Rubyã®æ–‡å­—列strã«lenãƒã‚¤ãƒˆã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Ž
- rb_ary_new2(long len)
+rb_str_cat2(VALUE str, const char* ptr)
+rb_str_cat_cstr(VALUE str, const char* ptr)
- Í×ÁǤ¬0¤ÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥lenÍ×ÁÇʬ¤ÎÎΰè¤ò¤¢¤é¤«¤¸¤á³ä¤ê
- Åö¤Æ¤Æ¤ª¤¯¡¥
+ Rubyã®æ–‡å­—列strã«Cã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_cat(str, ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
- rb_ary_new3(long n, ...)
+rb_str_catf(VALUE str, const char* format, ...)
+rb_str_vcatf(VALUE str, const char* format, va_list ap)
- °ú¿ô¤Ç»ØÄꤷ¤¿nÍ×ÁǤò´Þ¤àÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列strã«è¿½åŠ ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯ï¼Œãれãžã‚Œ
+ rb_str_cat2(str, rb_sprintf(format, ...)) ã‚„
+ rb_str_cat2(str, rb_vsprintf(format, ap)) ã¨åŒç­‰ã§ã‚る.
- rb_ary_new4(long n, VALUE *elts)
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc)
- ÇÛÎó¤ÇÍ¿¤¨¤¿nÍ×ÁǤÎÇÛÎó¤òÀ¸À®¤¹¤ë¡¥
+ 指定ã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
- 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_enc_str_new_literal(const char *ptr)
- Array¤ÎƱ̾¤Î¥á¥½¥Ã¥É¤ÈƱ¤¸Æ¯¤­¤ò¤¹¤ë´Ø¿ô¡¥Âè1°ú¿ô¤Ïɬ¤º
- ÇÛÎó¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¥
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰æŒ‡å®šã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
-2¡¥Ruby¤Îµ¡Ç½¤ò»È¤¦
+rb_usascii_str_new(const char *ptr, long len)
+rb_usascii_str_new_cstr(const char *ptr)
-¸¶ÍýŪ¤ËRuby¤Ç½ñ¤±¤ë¤³¤È¤ÏC¤Ç¤â½ñ¤±¤Þ¤¹¡¥Ruby¤½¤Î¤â¤Î¤¬C¤Çµ­
-½Ò¤µ¤ì¤Æ¤¤¤ë¤ó¤Ç¤¹¤«¤é¡¤ÅöÁ³¤È¤¤¤¨¤ÐÅöÁ³¤Ê¤ó¤Ç¤¹¤±¤É¡¥¤³¤³¤Ç
-¤ÏRuby¤Î³ÈÄ¥¤Ë»È¤¦¤³¤È¤¬Â¿¤¤¤À¤í¤¦¤Èͽ¬¤µ¤ì¤ëµ¡Ç½¤òÃæ¿´¤Ë¾Ò
-²ð¤·¤Þ¤¹¡¥
+ エンコーディングãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
-2.1 Ruby¤Ëµ¡Ç½¤òÄɲ乤ë
+rb_usascii_str_new_literal(const char *ptr)
-Ruby¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»È¤¨¤ÐRuby¥¤¥ó¥¿¥×¥ê¥¿¤Ë¿·¤·¤¤µ¡Ç½
-¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡¥Ruby¤Ç¤Ï°Ê²¼¤Îµ¡Ç½¤òÄɲä¹¤ë´Ø¿ô¤¬
-Ä󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
- * ¥¯¥é¥¹¡¤¥â¥¸¥å¡¼¥ë
- * ¥á¥½¥Ã¥É¡¤ÆÃ°Û¥á¥½¥Ã¥É¤Ê¤É
- * Äê¿ô
+rb_utf8_str_new(const char *ptr, long len)
+rb_utf8_str_new_cstr(const char *ptr)
-¤Ç¤Ï½ç¤Ë¾Ò²ð¤·¤Þ¤¹¡¥
+ エンコーディングãŒUTF-8ã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
-2.1.1 ¥¯¥é¥¹/¥â¥¸¥å¡¼¥ëÄêµÁ
+rb_utf8_str_new_literal(const char *ptr)
-¥¯¥é¥¹¤ä¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë¤Ï¡¤°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUTF-8ã®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)
+rb_ary_new_capa(long len)
+
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Žlenè¦ç´ åˆ†ã®é ˜åŸŸã‚’ã‚らã‹ã˜ã‚割り
+ 当ã¦ã¦ãŠã.
+
+rb_ary_new3(long n, ...)
+rb_ary_new_from_args(long n, ...)
+
+ å¼•æ•°ã§æŒ‡å®šã—ãŸnè¦ç´ ã‚’å«ã‚€é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new4(long n, VALUE *elts)
+rb_ary_new_from_values(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_store(VALUE ary, long offset, VALUE obj) ::
+
+ ary[offset] = obj
+
+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)
-2.1.2 ¥á¥½¥Ã¥É/ÆÃ°Û¥á¥½¥Ã¥ÉÄêµÁ
+=== メソッド/特異メソッド定義
-¥á¥½¥Ã¥É¤äÆÃ°Û¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+メソッドや特異メソッドを定義ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
- void rb_define_method(VALUE klass, const char *name,
- VALUE (*func)(), int argc)
+ 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)
- void rb_define_singleton_method(VALUE object, const char *name,
- VALUE (*func)(), int argc)
+念ã®ãŸã‚説明ã™ã‚‹ã¨ã€Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã€ã¨ã¯ï¼Œãã®ç‰¹å®šã®ã‚ªãƒ–ジェク
+トã«å¯¾ã—ã¦ã ã‘有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã™ï¼ŽRubyã§ã¯ã‚ˆãSmalltalkã«ãŠ
+ã‘るクラスメソッドã¨ã—ã¦ï¼Œã‚¯ãƒ©ã‚¹ã«å¯¾ã™ã‚‹ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒä½¿ã‚れ
+ã¾ã™ï¼Ž
-ǰ¤Î¤¿¤áÀâÌÀ¤¹¤ë¤È¡ÖÆÃ°Û¥á¥½¥Ã¥É¡×¤È¤Ï¡¤¤½¤ÎÆÃÄê¤Î¥ª¥Ö¥¸¥§¥¯
-¥È¤ËÂФ·¤Æ¤À¤±Í­¸ú¤Ê¥á¥½¥Ã¥É¤Ç¤¹¡¥Ruby¤Ç¤Ï¤è¤¯Smalltalk¤Ë¤ª
-¤±¤ë¥¯¥é¥¹¥á¥½¥Ã¥É¤È¤·¤Æ¡¤¥¯¥é¥¹¤ËÂФ¹¤ëÆÃ°Û¥á¥½¥Ã¥É¤¬»È¤ï¤ì
-¤Þ¤¹¡¥
+ã“れらã®é–¢æ•°ã® argcã¨ã„ã†å¼•æ•°ã¯Cã®é–¢æ•°ã¸æ¸¡ã•ã‚Œã‚‹å¼•æ•°ã®æ•°(ã¨
+å½¢å¼)を決ã‚ã¾ã™ï¼ŽargcãŒ0ä»¥ä¸Šã®æ™‚ã¯é–¢æ•°ã«å¼•ãæ¸¡ã™å¼•æ•°ã®æ•°ã‚’æ„
+味ã—ã¾ã™ï¼Ž16個以上ã®å¼•æ•°ã¯ä½¿ãˆã¾ã›ã‚“(ãŒï¼Œè¦ã‚Šã¾ã›ã‚“よã­ï¼Œã
+ã‚“ãªã«).実際ã®é–¢æ•°ã«ã¯å…ˆé ­ã®å¼•æ•°ã¨ã—ã¦selfãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã®
+ã§ï¼ŒæŒ‡å®šã—ãŸæ•°ã‚ˆã‚Š1多ã„引数をæŒã¤ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
-¤³¤ì¤é¤Î´Ø¿ô¤Î argc¤È¤¤¤¦°ú¿ô¤ÏC¤Î´Ø¿ô¤ØÅϤµ¤ì¤ë°ú¿ô¤Î¿ô(¤È
-·Á¼°)¤ò·è¤á¤Þ¤¹¡¥argc¤¬0°Ê¾å¤Î»þ¤Ï´Ø¿ô¤Ë°ú¤­ÅϤ¹°ú¿ô¤Î¿ô¤ò°Õ
-Ì£¤·¤Þ¤¹¡¥16¸Ä°Ê¾å¤Î°ú¿ô¤Ï»È¤¨¤Þ¤»¤ó(¤¬¡¤Íפê¤Þ¤»¤ó¤è¤Í¡¤¤½
-¤ó¤Ê¤Ë)¡¥¼ÂºÝ¤Î´Ø¿ô¤Ë¤ÏÀèÆ¬¤Î°ú¿ô¤È¤·¤Æself¤¬Í¿¤¨¤é¤ì¤Þ¤¹¤Î
-¤Ç¡¤»ØÄꤷ¤¿¿ô¤è¤ê1¿¤¤°ú¿ô¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
+argcãŒè² ã®æ™‚ã¯å¼•æ•°ã®æ•°ã§ã¯ãªã,形å¼ã‚’指定ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+argcãŒ-1ã®æ™‚ã¯å¼•æ•°ã‚’é…列ã«å…¥ã‚Œã¦æ¸¡ã•れã¾ã™ï¼ŽargcãŒ-2ã®æ™‚ã¯å¼•
+æ•°ã¯Rubyã®é…列ã¨ã—ã¦æ¸¡ã•れã¾ã™ï¼Ž
-argc¤¬Éé¤Î»þ¤Ï°ú¿ô¤Î¿ô¤Ç¤Ï¤Ê¤¯¡¤·Á¼°¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
-argc¤¬-1¤Î»þ¤Ï°ú¿ô¤òÇÛÎó¤ËÆþ¤ì¤ÆÅϤµ¤ì¤Þ¤¹¡¥argc¤¬-2¤Î»þ¤Ï°ú
-¿ô¤ÏRuby¤ÎÇÛÎó¤È¤·¤ÆÅϤµ¤ì¤Þ¤¹¡¥
+メソッドを定義ã™ã‚‹é–¢æ•°ã¯ã¾ã ã„ãã¤ã‹ã‚りã¾ã™. ã²ã¨ã¤ã¯ãƒ¡ã‚½ãƒƒãƒ‰
+åã¨ã—ã¦IDã‚’å–りã¾ã™. IDã«ã¤ã„ã¦ã¯2.2.2ã‚’å‚ç…§.
-¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ï¤â¤¦Æó¤Ä¤¢¤ê¤Þ¤¹¡¥¤Ò¤È¤Ä¤Ïprivate¥á
-¥½¥Ã¥É¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ç¡¤°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¤Ç¤¹¡¥
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
- void rb_define_private_method(VALUE klass, const char *name,
+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¥á¥½¥Ã¥É¤È¤Ï´Ø¿ô·Á¼°¤Ç¤·¤«¸Æ¤Ó½Ð¤¹¤³¤È¤Î½ÐÍè¤Ê¤¤¥á¥½¥Ã
-¥É¤Ç¤¹¡¥
+privateメソッドã¨ã¯é–¢æ•°å½¢å¼ã§ã—ã‹å‘¼ã³å‡ºã™ã“ã¨ã®å‡ºæ¥ãªã„メソッ
+ドã§ã™ï¼Ž
-¤â¤¦¤Ò¤È¤Ä¤Ï¥â¥¸¥å¡¼¥ë´Ø¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¤Ç¤¹¡¥¥â¥¸¥å¡¼¥ë´Ø¿ô
-¤È¤Ï¥â¥¸¥å¡¼¥ë¤ÎÆÃ°Û¥á¥½¥Ã¥É¤Ç¤¢¤ê¡¤Æ±»þ¤Ëprivate¥á¥½¥Ã¥É¤Ç
-¤â¤¢¤ë¤â¤Î¤Ç¤¹¡¥Îã¤ò¤¢¤²¤ë¤ÈMath¥â¥¸¥å¡¼¥ë¤Îsqrt()¤Ê¤É¤¬¤¢¤²
-¤é¤ì¤Þ¤¹¡¥¤³¤Î¥á¥½¥Ã¥É¤Ï
+最後ã«ï¼Œ rb_define_module関数ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã—ã¾ã™ï¼Ž
+モジュール関数ã¨ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚Šï¼ŒåŒæ™‚ã«
+privateメソッドã§ã‚‚ã‚ã‚‹ã‚‚ã®ã§ã™ï¼Žä¾‹ã‚’ã‚ã’ã‚‹ã¨Mathモジュール
+ã®sqrt()ãªã©ãŒã‚ã’られã¾ã™ï¼Žã“ã®ãƒ¡ã‚½ãƒƒãƒ‰ã¯
Math.sqrt(4)
-¤È¤¤¤¦·Á¼°¤Ç¤â
+ã¨ã„ã†å½¢å¼ã§ã‚‚
include Math
sqrt(4)
-¤È¤¤¤¦·Á¼°¤Ç¤â»È¤¨¤Þ¤¹¡¥¥â¥¸¥å¡¼¥ë´Ø¿ô¤òÄêµÁ¤¹¤ë´Ø¿ô¤Ï°Ê²¼¤Î
-Ä̤ê¤Ç¤¹¡¥
+ã¨ã„ã†å½¢å¼ã§ã‚‚使ãˆã¾ã™ï¼Žãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®
+通りã§ã™ï¼Ž
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
-´Ø¿ôŪ¥á¥½¥Ã¥É(Kernel¥â¥¸¥å¡¼¥ë¤Îprivate method)¤òÄêµÁ¤¹¤ë¤¿
-¤á¤Î´Ø¿ô¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡¥
+関数的メソッド(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);
-¥¯¥é¥¹¥á¥½¥Ã¥Éallocate¤òÄêµÁ¤·¤¿¤êºï½ü¤·¤¿¤ê¤¹¤ë¤¿¤á¤Î´Ø¿ô¤Ï
-°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
+属性ã®å–得・設定メソッドを定義ã™ã‚‹ã«ã¯
+
+ 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¤Ï¥¯¥é¥¹¤ò°ú¿ô¤È¤·¤Æ¼õ¤±¼è¤Ã¤Æ¡¢¿·¤·¤¯³ä¤êÅö¤Æ¤é¤ì¤¿¥¤¥ó
-¥¹¥¿¥ó¥¹¤òÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£¤³¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ï¡¢³°Éô¥ê
-¥½¡¼¥¹¤Ê¤É¤ò´Þ¤Þ¤Ê¤¤¡¢¤Ç¤­¤ë¤À¤±¡Ö¶õ¡×¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¤¤¿¤Û¤¦
-¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£
+funcã¯ã‚¯ãƒ©ã‚¹ã‚’引数ã¨ã—ã¦å—ã‘å–ã£ã¦ï¼Œæ–°ã—ã割り当ã¦ã‚‰ã‚ŒãŸã‚¤ãƒ³
+スタンスを返ã•ãªãã¦ã¯ãªã‚Šã¾ã›ã‚“.ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã¯ï¼Œå¤–部リ
+ソースãªã©ã‚’å«ã¾ãªã„,ã§ãã‚‹ã ã‘「空ã€ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸã»ã†
+ãŒã‚ˆã„ã§ã—ょã†ï¼Ž
+
+継承ã—ãŸã‚¯ãƒ©ã‚¹ã«ã‚る既存ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã—ã¦ã„ã‚‹ãª
+ら,オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使
+ã„ã¾ã™ï¼Ž
-2.1.3 Äê¿ôÄêµÁ
+ VALUE rb_call_super(int argc, const VALUE *argv)
-³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤¬É¬ÍפÊÄê¿ô¤Ï¤¢¤é¤«¤¸¤áÄêµÁ¤·¤Æ¤ª¤¤¤¿Êý¤¬Îɤ¤
-¤Ç¤·¤ç¤¦¡¥Äê¿ô¤òÄêµÁ¤¹¤ë´Ø¿ô¤ÏÆó¤Ä¤¢¤ê¤Þ¤¹¡¥
+ç¾åœ¨ã®ã‚¹ã‚³ãƒ¼ãƒ—ã®ãƒ¬ã‚·ãƒ¼ãƒã¯(ä»–ã«æ–¹æ³•ãŒãªã‘れã°),以下ã®é–¢æ•°ã§
+å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼Ž
+
+ VALUE rb_current_receiver(void)
+
+=== 定数定義
+
+拡張ライブラリãŒå¿…è¦ãªå®šæ•°ã¯ã‚らã‹ã˜ã‚定義ã—ã¦ãŠã„ãŸæ–¹ãŒè‰¯ã„
+ã§ã—ょã†ï¼Žå®šæ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯äºŒã¤ã‚りã¾ã™ï¼Ž
void rb_define_const(VALUE klass, const char *name, VALUE val)
void rb_define_global_const(const char *name, VALUE val)
-Á°¼Ô¤ÏÆÃÄê¤Î¥¯¥é¥¹/¥â¥¸¥å¡¼¥ë¤Ë°¤¹¤ëÄê¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¡¤¸å
-¼Ô¤Ï¥°¥í¡¼¥Ð¥ë¤ÊÄê¿ô¤òÄêµÁ¤¹¤ë¤â¤Î¤Ç¤¹¡¥
+å‰è€…ã¯ç‰¹å®šã®ã‚¯ãƒ©ã‚¹/モジュールã«å±žã™ã‚‹å®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ï¼Œå¾Œ
+者ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«ãªå®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ã§ã™ï¼Ž
-2.2 Ruby¤Îµ¡Ç½¤òC¤«¤é¸Æ¤Ó½Ð¤¹
+== Rubyã®æ©Ÿèƒ½ã‚’Cã‹ã‚‰å‘¼ã³å‡ºã™
-´û¤Ë¡Ø1.5 Ruby¤Î¥Ç¡¼¥¿¤òÁàºî¤¹¤ë¡Ù¤Ç°ìÉô¾Ò²ð¤·¤¿¤è¤¦¤Ê´Ø¿ô¤ò
-»È¤¨¤Ð¡¤Ruby¤Îµ¡Ç½¤ò¼Â¸½¤·¤Æ¤¤¤ë´Ø¿ô¤òľÀܸƤӽФ¹¤³¤È¤¬½ÐÍè
-¤Þ¤¹¡¥
+æ—¢ã«ã€Ž1.5 Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹ã€ã§ä¸€éƒ¨ç´¹ä»‹ã—ãŸã‚ˆã†ãªé–¢æ•°ã‚’
+使ãˆã°ï¼ŒRubyã®æ©Ÿèƒ½ã‚’実ç¾ã—ã¦ã„る関数を直接呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥
+ã¾ã™ï¼Ž
-# ¤³¤Î¤è¤¦¤Ê´Ø¿ô¤Î°ìÍ÷ɽ¤Ï¤¤¤Þ¤Î¤È¤³¤í¤¢¤ê¤Þ¤»¤ó¡¥¥½¡¼¥¹¤ò¸«
-# ¤ë¤·¤«¤Ê¤¤¤Ç¤¹¤Í¡¥
+# ã“ã®ã‚ˆã†ãªé–¢æ•°ã®ä¸€è¦§è¡¨ã¯ã„ã¾ã®ã¨ã“ã‚ã‚りã¾ã›ã‚“.ソースを見
+# ã‚‹ã—ã‹ãªã„ã§ã™ã­ï¼Ž
-¤½¤ì°Ê³°¤Ë¤âRuby¤Îµ¡Ç½¤ò¸Æ¤Ó½Ð¤¹ÊýË¡¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡¥
+ãれ以外ã«ã‚‚Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™æ–¹æ³•ã¯ã„ãã¤ã‹ã‚りã¾ã™ï¼Ž
-2.2.1 Ruby¤Î¥×¥í¥°¥é¥à¤òeval¤¹¤ë
+=== Rubyã®ãƒ—ログラムをevalã™ã‚‹
-C¤«¤éRuby¤Îµ¡Ç½¤ò¸Æ¤Ó½Ð¤¹¤â¤Ã¤È¤â´Êñ¤ÊÊýË¡¤È¤·¤Æ¡¤Ê¸»úÎó¤Ç
-Í¿¤¨¤é¤ì¤¿Ruby¤Î¥×¥í¥°¥é¥à¤òɾ²Á¤¹¤ë°Ê²¼¤Î´Ø¿ô¤¬¤¢¤ê¤Þ¤¹¡¥
+Cã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™ã‚‚ã£ã¨ã‚‚ç°¡å˜ãªæ–¹æ³•ã¨ã—ã¦ï¼Œæ–‡å­—列ã§
+与ãˆã‚‰ã‚ŒãŸRubyã®ãƒ—ログラムを評価ã™ã‚‹ä»¥ä¸‹ã®é–¢æ•°ãŒã‚りã¾ã™ï¼Ž
VALUE rb_eval_string(const char *str)
-¤³¤Îɾ²Á¤Ï¸½ºß¤Î´Ä¶­¤Ç¹Ô¤ï¤ì¤Þ¤¹¡¥¤Ä¤Þ¤ê¡¤¸½ºß¤Î¥í¡¼¥«¥ëÊÑ¿ô
-¤Ê¤É¤ò¼õ¤±·Ñ¤®¤Þ¤¹¡¥
+ã“ã®è©•価ã¯ç¾åœ¨ã®ç’°å¢ƒã§è¡Œã‚れã¾ã™ï¼Žã¤ã¾ã‚Šï¼Œç¾åœ¨ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°
+ãªã©ã‚’å—ã‘ç¶™ãŽã¾ã™ï¼Ž
+
+評価ã¯ä¾‹å¤–を発生ã™ã‚‹ã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†. より安全
+ãªé–¢æ•°ã‚‚ã‚りã¾ã™.
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
-2.2.2 ID¤Þ¤¿¤Ï¥·¥ó¥Ü¥ë
+ã“ã®é–¢æ•°ã¯ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã¨nilã‚’è¿”ã—ã¾ã™ï¼Žãã—ã¦ï¼ŒæˆåŠŸæ™‚ã«ã¯
+*stateã¯ã‚¼ãƒ­ã«ï¼Œã•ã‚‚ãªãã°éžã‚¼ãƒ­ã«ãªã‚Šã¾ã™ï¼Ž
-C¤«¤éʸ»úÎó¤ò·Ðͳ¤»¤º¤ËRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤â¤Ç¤­¤Þ
-¤¹¡¥¤½¤ÎÁ°¤Ë¡¤Ruby¥¤¥ó¥¿¥×¥ê¥¿Æâ¤Ç¥á¥½¥Ã¥É¤äÊÑ¿ô̾¤ò»ØÄꤹ¤ë
-»þ¤Ë»È¤ï¤ì¤Æ¤¤¤ëID¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡¥
+=== IDã¾ãŸã¯ã‚·ãƒ³ãƒœãƒ«
-ID¤È¤ÏÊÑ¿ô̾¡¤¥á¥½¥Ã¥É̾¤òɽ¤¹À°¿ô¤Ç¤¹¡¥Ruby¤Ç¤ÏID¤ËÂбþ¤¹¤ë
-¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¥·¥ó¥Ü¥ë(Symbol)¤¬¤¢¤ê¡¤
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã“ã¨ã‚‚ã§ãã¾
+ã™ï¼Žãã®å‰ã«ï¼ŒRubyインタプリタ内ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚„変数åを指定ã™ã‚‹
+時ã«ä½¿ã‚れã¦ã„ã‚‹IDã«ã¤ã„ã¦èª¬æ˜Žã—ã¦ãŠãã¾ã—ょã†ï¼Ž
- :¼±ÊÌ»Ò
+IDã¨ã¯å¤‰æ•°å,メソッドåã‚’è¡¨ã™æ•´æ•°ã§ã™ï¼ŽRubyã®ä¸­ã§ã¯
-¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥C¤«¤é¤³¤ÎÀ°¿ô¤òÆÀ¤ë¤¿¤á¤Ë¤Ï´Ø¿ô
+ :識別å­
+
+ã¾ãŸã¯
+
+ :"ä»»æ„ã®æ–‡å­—列"
+
+ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼ŽCã‹ã‚‰ã“ã®æ•´æ•°ã‚’å¾—ã‚‹ãŸã‚ã«ã¯é–¢æ•°
rb_intern(const char *name)
+ rb_intern_str(VALUE name)
-¤ò»È¤¤¤Þ¤¹¡¥Ruby¤«¤é°ú¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¥·¥ó¥Ü¥ë(¤Þ¤¿¤Ïʸ»ú
-Îó)¤òID¤ËÊÑ´¹¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+を使ã„ã¾ã™ï¼Ž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)
-ID¤«¤é¥·¥ó¥Ü¥ë¤òÆÀ¤ë¤¿¤á¤Ë¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+ã‚‚ã—引数ãŒã‚·ãƒ³ãƒœãƒ«ã§ã‚‚文字列ã§ã‚‚ãªã‘れã°ï¼Œto_strãƒ¡ã‚½ãƒƒãƒ‰ã§æ–‡
+字列ã«å¤‰æ›ã—よã†ã¨ã—ã¾ã™ï¼Žç¬¬äºŒã®é–¢æ•°ã¯ãã®å¤‰æ›çµæžœã‚’*nameã«ä¿
+å­˜ã—,ãã®åå‰ãŒæ—¢çŸ¥ã®ã‚·ãƒ³ãƒœãƒ«ã§ãªã„å ´åˆã¯0ã‚’è¿”ã—ã¾ã™ï¼Žã“ã®é–¢
+æ•°ãŒ0以外を返ã—ãŸå ´åˆã¯*nameã¯å¸¸ã«ã‚·ãƒ³ãƒœãƒ«ã‹æ–‡å­—列ã§ã‚り,0ã‚’
+è¿”ã—ãŸå ´åˆã¯å¸¸ã«æ–‡å­—列ã§ã™ï¼Žç¬¬ä¸‰ã®é–¢æ•°ã¯Rubyã®æ–‡å­—列ã§ã¯ãªã
+NUL終端ã•れãŸCã®æ–‡å­—列を使ã„ã¾ã™ï¼Ž
- VALUE ID2SYM(ID id)
+Rubyã‹ã‚‰å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸã‚·ãƒ³ãƒœãƒ«(ã¾ãŸã¯æ–‡å­—列)をシンボル
+ã«å¤‰æ›ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
-¥·¥ó¥Ü¥ë¤«¤éID¤òÆÀ¤ë¤¿¤á¤Ë¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
- ID SYM2ID(VALUE symbol)
+ã“れらã®é–¢æ•°ã¯ï¼ŒIDã®ä»£ã‚りã«ã‚·ãƒ³ãƒœãƒ«ã‚’è¿”ã™ã“ã¨ã‚’除ã‘ã°ä¸Šè¨˜ã®
+関数ã¨åŒã˜ã§ã™ï¼Ž
-2.2.3 C¤«¤éRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹
+=== Cã‹ã‚‰Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™
-C¤«¤éʸ»úÎó¤ò·Ðͳ¤»¤º¤ËRuby¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤¿¤á¤Ë¤Ï°Ê²¼
-¤Î´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ãŸã‚ã«ã¯ä»¥ä¸‹
+ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
-¤³¤Î´Ø¿ô¤Ï¥ª¥Ö¥¸¥§¥¯¥Èrecv¤Îmid¤Ç»ØÄꤵ¤ì¤ë¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð
-¤·¤Þ¤¹¡¥¤½¤Î¾¤Ë°ú¿ô¤Î»ØÄê¤Î»ÅÊý¤¬°ã¤¦°Ê²¼¤Î´Ø¿ô¤â¤¢¤ê¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯ã‚ªãƒ–ジェクトrecvã®midã§æŒ‡å®šã•れるメソッドを呼ã³å‡º
+ã—ã¾ã™ï¼Žãã®ä»–ã«å¼•æ•°ã®æŒ‡å®šã®ä»•æ–¹ãŒé•ã†ä»¥ä¸‹ã®é–¢æ•°ã‚‚ã‚りã¾ã™ï¼Ž
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv)
VALUE rb_apply(VALUE recv, ID mid, VALUE args)
-apply¤Ë¤Ï°ú¿ô¤È¤·¤ÆRuby¤ÎÇÛÎó¤òÍ¿¤¨¤Þ¤¹¡¥
+applyã«ã¯å¼•æ•°ã¨ã—ã¦Rubyã®é…列を与ãˆã¾ã™ï¼Ž
-2.2.4 ÊÑ¿ô/Äê¿ô¤ò»²¾È/¹¹¿·¤¹¤ë
+=== 変数/定数をå‚ç…§/æ›´æ–°ã™ã‚‹
-C¤«¤é´Ø¿ô¤ò»È¤Ã¤Æ»²¾È¡¦¹¹¿·¤Ç¤­¤ë¤Î¤Ï¡¤Äê¿ô¡¤¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ
-¿ô¤Ç¤¹¡¥Âç°èÊÑ¿ô¤Ï°ìÉô¤Î¤â¤Î¤ÏC¤ÎÂç°èÊÑ¿ô¤È¤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­
-¤Þ¤¹¡¥¥í¡¼¥«¥ëÊÑ¿ô¤ò»²¾È¤¹¤ëÊýË¡¤Ï¸ø³«¤·¤Æ¤¤¤Þ¤»¤ó¡¥
+Cã‹ã‚‰é–¢æ•°ã‚’使ã£ã¦å‚照・更新ã§ãã‚‹ã®ã¯ï¼Œå®šæ•°ï¼Œã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰
+æ•°ã§ã™ï¼Žå¤§åŸŸå¤‰æ•°ã¯ä¸€éƒ¨ã®ã‚‚ã®ã¯Cã®å¤§åŸŸå¤‰æ•°ã¨ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã§ã
+ã¾ã™ï¼Žãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã‚’å‚ç…§ã™ã‚‹æ–¹æ³•ã¯å…¬é–‹ã—ã¦ã„ã¾ã›ã‚“.
-¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤ò»²¾È¡¦¹¹¿·¤¹¤ë´Ø¿ô¤Ï°Ê²¼¤ÎÄÌ
-¤ê¤Ç¤¹¡¥
+オブジェクトã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’å‚照・更新ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®é€š
+りã§ã™ï¼Ž
VALUE rb_ivar_get(VALUE obj, ID id)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
-id¤Ïrb_intern()¤ÇÆÀ¤é¤ì¤ë¤â¤Î¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+idã¯rb_intern()ã§å¾—られるもã®ã‚’使ã£ã¦ãã ã•ã„.
-Äê¿ô¤ò»²¾È¤¹¤ë¤Ë¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+定数をå‚ç…§ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦ãã ã•ã„.
VALUE rb_const_get(VALUE obj, ID id)
-Äê¿ô¤ò¿·¤·¤¯ÄêµÁ¤¹¤ë¤¿¤á¤Ë¤Ï¡Ø2.1.3 Äê¿ôÄêµÁ¡Ù¤Ç¾Ò²ð¤µ
-¤ì¤Æ¤¤¤ë´Ø¿ô¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥
+定数を新ã—ã定義ã™ã‚‹ãŸã‚ã«ã¯ã€Ž2.1.3 定数定義ã€ã§ç´¹ä»‹ã•
+れã¦ã„る関数を使ã£ã¦ãã ã•ã„.
-3¡¥Ruby¤ÈC¤È¤Î¾ðÊó¶¦Í­
+= Rubyã¨Cã¨ã®æƒ…報共有
-C¸À¸ì¤ÈRuby¤Î´Ö¤Ç¾ðÊó¤ò¶¦Í­¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤Æ²òÀ⤷¤Þ¤¹¡¥
+C言語ã¨Rubyã®é–“ã§æƒ…報を共有ã™ã‚‹æ–¹æ³•ã«ã¤ã„ã¦è§£èª¬ã—ã¾ã™ï¼Ž
-3.1 C¤«¤é»²¾È¤Ç¤­¤ëRuby¤ÎÄê¿ô
+== Cã‹ã‚‰å‚ç…§ã§ãã‚‹Rubyã®å®šæ•°
-°Ê²¼¤ÎRuby¤ÎÄê¿ô¤ÏC¤Î¥ì¥Ù¥ë¤«¤é»²¾È¤Ç¤­¤Þ¤¹¡¥
+以下ã®Rubyã®å®šæ•°ã¯Cã®ãƒ¬ãƒ™ãƒ«ã‹ã‚‰å‚ç…§ã§ãã¾ã™ï¼Ž
Qtrue
Qfalse
- ¿¿µ¶ÃÍ¡¥Qfalse¤ÏC¸À¸ì¤Ç¤âµ¶¤È¤ß¤Ê¤µ¤ì¤Þ¤¹(¤Ä¤Þ¤ê0)¡¥
+真å½å€¤ï¼ŽQfalseã¯C言語ã§ã‚‚å½ã¨ã¿ãªã•れã¾ã™(ã¤ã¾ã‚Š0).
Qnil
- C¸À¸ì¤«¤é¸«¤¿¡Önil¡×¡¥
+C言語ã‹ã‚‰è¦‹ãŸã€Œnilã€ï¼Ž
-3.2 C¤ÈRuby¤Ç¶¦Í­¤µ¤ì¤ëÂç°èÊÑ¿ô
+== Cã¨Rubyã§å…±æœ‰ã•れる大域変数
-C¤ÈRuby¤ÇÂç°èÊÑ¿ô¤ò»È¤Ã¤Æ¾ðÊó¤ò¶¦Í­¤Ç¤­¤Þ¤¹¡¥¶¦Í­¤Ç¤­¤ëÂç°è
-ÊÑ¿ô¤Ë¤Ï¤¤¤¯¤Ä¤«¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡¥¤½¤Î¤Ê¤«¤Ç¤â¤Ã¤È¤âÎɤ¯»È¤ï
-¤ì¤ë¤È»×¤ï¤ì¤ë¤Î¤Ïrb_define_variable()¤Ç¤¹¡¥
+Cã¨Rubyã§å¤§åŸŸå¤‰æ•°ã‚’使ã£ã¦æƒ…報を共有ã§ãã¾ã™ï¼Žå…±æœ‰ã§ãる大域
+変数ã«ã¯ã„ãã¤ã‹ã®ç¨®é¡žãŒã‚りã¾ã™ï¼Žãã®ãªã‹ã§ã‚‚ã£ã¨ã‚‚良ã使ã‚
+ã‚Œã‚‹ã¨æ€ã‚れるã®ã¯rb_define_variable()ã§ã™ï¼Ž
void rb_define_variable(const char *name, VALUE *var)
-¤³¤Î´Ø¿ô¤ÏRuby¤ÈC¤È¤Ç¶¦Í­¤¹¤ëÂç°èÊÑ¿ô¤òÄêµÁ¤·¤Þ¤¹¡¥ÊÑ¿ô̾¤¬
-`$'¤Ç»Ï¤Þ¤é¤Ê¤¤»þ¤Ë¤Ï¼«Æ°Åª¤ËÄɲ䵤ì¤Þ¤¹¡¥¤³¤ÎÊÑ¿ô¤ÎÃͤòÊÑ
-¹¹¤¹¤ë¤È¼«Æ°Åª¤ËRuby¤ÎÂбþ¤¹¤ëÊÑ¿ô¤ÎÃͤâÊѤï¤ê¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹å¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾ã™ï¼Žå¤‰æ•°åãŒ
+`$'ã§å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®å€¤ã‚’変
+æ›´ã™ã‚‹ã¨è‡ªå‹•çš„ã«Rubyã®å¯¾å¿œã™ã‚‹å¤‰æ•°ã®å€¤ã‚‚変ã‚りã¾ã™ï¼Ž
-¤Þ¤¿Ruby¦¤«¤é¤Ï¹¹¿·¤Ç¤­¤Ê¤¤ÊÑ¿ô¤â¤¢¤ê¤Þ¤¹¡¥¤³¤Îread only¤Î
-ÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤ÇÄêµÁ¤·¤Þ¤¹¡¥
+ã¾ãŸRubyå´ã‹ã‚‰ã¯æ›´æ–°ã§ããªã„変数もã‚りã¾ã™ï¼Žã“ã®read onlyã®
+変数ã¯ä»¥ä¸‹ã®é–¢æ•°ã§å®šç¾©ã—ã¾ã™ï¼Ž
void rb_define_readonly_variable(const char *name, VALUE *var)
-¤³¤ì¤éÊÑ¿ô¤Î¾¤Ëhook¤ò¤Ä¤±¤¿Âç°èÊÑ¿ô¤òÄêµÁ¤Ç¤­¤Þ¤¹¡¥hookÉÕ¤­
-¤ÎÂç°èÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤òÍѤ¤¤ÆÄêµÁ¤·¤Þ¤¹¡¥hookÉÕ¤­Âç°èÊÑ¿ô¤Î
-Ãͤλ²¾È¤äÀßÄê¤Ïhook¤Ç¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
+ã“れら変数ã®ä»–ã«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¤ò»ØÄꤷ¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã¯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);
-# getter¤âsetter¤â0¤Ê¤é¤Ðrb_define_variable()¤ÈƱ¤¸¤Ë¤Ê¤ë¡¥
-¤½¤ì¤«¤é¡¤C¤Î´Ø¿ô¤Ë¤è¤Ã¤Æ¼Â¸½¤µ¤ì¤ëRuby¤ÎÂç°èÊÑ¿ô¤òÄêµÁ¤¹¤ë
-´Ø¿ô¤¬¤¢¤ê¤Þ¤¹¡¥
+ãれã‹ã‚‰ï¼Œå¯¾å¿œã™ã‚‹Cã®å¤‰æ•°ã‚’æŒãŸãªã„Rubyã®å¤§åŸŸå¤‰æ•°ã‚’定義ã™ã‚‹
+ã“ã¨ã‚‚ã§ãã¾ã™. ãã®å¤‰æ•°ã®å€¤ã¯ãƒ•ック関数ã®ã¿ã«ã‚ˆã£ã¦å–得・設定
+ã•れã¾ã™.
void rb_define_virtual_variable(const char *name,
VALUE (*getter)(), void (*setter)())
-¤³¤Î´Ø¿ô¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤¿Ruby¤ÎÂç°èÊÑ¿ô¤¬»²¾È¤µ¤ì¤¿»þ¤Ë¤Ï
-getter¤¬¡¤ÊÑ¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ïsetter¤¬¸Æ¤Ð¤ì¤Þ¤¹¡¥
+ã“ã®é–¢æ•°ã«ã‚ˆã£ã¦å®šç¾©ã•れãŸRubyã®å¤§åŸŸå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯
+getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œã¾ã™ï¼Ž
-getter¤Èsetter¤Î»ÅÍͤϰʲ¼¤ÎÄ̤ê¤Ç¤¹¡¥
+getterã¨setterã®ä»•様ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
- (*getter)(ID id, void *data, struct global_entry* entry);
- (*setter)(VALUE val, ID id, void *data, struct global_entry* entry);
+ (*getter)(ID id);
+ (*setter)(VALUE val, ID id);
-3.3 C¤Î¥Ç¡¼¥¿¤òRuby¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤¹¤ë
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’Rubyオブジェクトã«ã™ã‚‹
-C¤ÎÀ¤³¦¤ÇÄêµÁ¤µ¤ì¤¿¥Ç¡¼¥¿(¹½Â¤ÂÎ)¤òRuby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ
-¼è¤ê°·¤¤¤¿¤¤¾ì¹ç¤¬¤¢¤ê¤¨¤Þ¤¹¡¥¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï¡¤Data¤È¤¤¤¦
-Ruby¥ª¥Ö¥¸¥§¥¯¥È¤ËC¤Î¹½Â¤ÂÎ(¤Ø¤Î¥Ý¥¤¥ó¥¿)¤ò¤¯¤ë¤à¤³¤È¤ÇRuby
-¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¼è¤ê°·¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥
+Cã®ä¸–界ã§å®šç¾©ã•れãŸãƒ‡ãƒ¼ã‚¿(構造体)ã‚’Rubyã®ã‚ªãƒ–ジェクトã¨ã—ã¦
+å–り扱ã„ãŸã„å ´åˆãŒã‚りãˆã¾ã™ï¼Žã“ã®ã‚ˆã†ãªå ´åˆã«ã¯ï¼ŒDataã¨ã„ã†
+Rubyオブジェクトã«Cã®æ§‹é€ ä½“(ã¸ã®ãƒã‚¤ãƒ³ã‚¿)ã‚’ãã‚‹ã‚€ã“ã¨ã§Ruby
+オブジェクトã¨ã—ã¦å–り扱ãˆã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™ï¼Ž
-Data¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¤·¤Æ¹½Â¤ÂΤòRuby¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥«¥×¥»¥ë
-²½¤¹¤ë¤¿¤á¤Ë¤Ï¡¤°Ê²¼¤Î¥Þ¥¯¥í¤ò»È¤¤¤Þ¤¹¡¥
+Dataオブジェクトを生æˆã—ã¦æ§‹é€ ä½“ã‚’Rubyオブジェクトã«ã‚«ãƒ—セル
+化ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’使ã„ã¾ã™ï¼Ž
- Data_Wrap_Struct(klass, mark, free, ptr)
+ Data_Wrap_Struct(klass, mark, free, sval)
-¤³¤Î¥Þ¥¯¥í¤ÎÌá¤êÃͤÏÀ¸À®¤µ¤ì¤¿Data¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡¥
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Ž
-klass¤Ï¤³¤ÎData¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¯¥é¥¹¤Ç¤¹¡¥ptr¤Ï¥«¥×¥»¥ë²½¤¹¤ë
-C¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¹¡¥mark¤Ï¤³¤Î¹½Â¤ÂΤ¬Ruby¤Î¥ª¥Ö¥¸¥§
-¥¯¥È¤Ø¤Î»²¾È¤¬¤¢¤ë»þ¤Ë»È¤¦´Ø¿ô¤Ç¤¹¡¥¤½¤Î¤è¤¦¤Ê»²¾È¤ò´Þ¤Þ¤Ê¤¤
-»þ¤Ë¤Ï0¤ò»ØÄꤷ¤Þ¤¹¡¥
+klassã¯ã“ã®Dataオブジェクトã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Žmarkã¯ã“ã®æ§‹é€ ä½“ãŒ
+Rubyã®ã‚ªãƒ–ジェクトã¸ã®å‚ç…§ãŒã‚る時ã«ä½¿ã†é–¢æ•°ã§ã™ï¼Žãã®ã‚ˆã†ãª
+å‚ç…§ã‚’å«ã¾ãªã„時ã«ã¯0を指定ã—ã¾ã™ï¼Ž
-# ¤½¤Î¤è¤¦¤Ê»²¾È¤Ï´«¤á¤é¤ì¤Þ¤»¤ó¡¥
+# ãã®ã‚ˆã†ãªå‚ç…§ã¯å‹§ã‚られã¾ã›ã‚“.
-free¤Ï¤³¤Î¹½Â¤ÂΤ¬¤â¤¦ÉÔÍפˤʤä¿»þ¤Ë¸Æ¤Ð¤ì¤ë´Ø¿ô¤Ç¤¹¡¥¤³¤Î
-´Ø¿ô¤¬¥¬¡¼¥Ù¡¼¥¸¥³¥ì¥¯¥¿¤«¤é¸Æ¤Ð¤ì¤Þ¤¹¡¥¤³¤ì¤¬-1¤Î¾ì¹ç¤Ï¡¤Ã±
-½ã¤Ë³«Êü¤µ¤ì¤Þ¤¹¡¥
+freeã¯ã“ã®æ§‹é€ ä½“ãŒã‚‚ã†ä¸è¦ã«ãªã£ãŸæ™‚ã«å‘¼ã°ã‚Œã‚‹é–¢æ•°ã§ã™ï¼Žã“ã®
+関数ãŒã‚¬ãƒ¼ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚¿ã‹ã‚‰å‘¼ã°ã‚Œã¾ã™ï¼Žã“れãŒ-1ã®å ´åˆã¯ï¼Œå˜
+ç´”ã«é–‹æ”¾ã•れã¾ã™ï¼Ž
-C¤Î¹½Â¤ÂΤγäÅö¤ÈData¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤òƱ»þ¤Ë¹Ô¤¦¥Þ¥¯¥í¤È
-¤·¤Æ°Ê²¼¤Î¤â¤Î¤¬Ä󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡¥
+markãŠã‚ˆã³free関数ã¯GC実行中ã«å‘¼ã³å‡ºã•れã¾ã™.
+ãªãŠ, GC実行中ã¯Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¯ç¦æ­¢ã•れã¾
+ã™. よã£ã¦, markãŠã‚ˆã³free関数ã§Rubyオブジェクトã®ã‚¢ãƒ­ã‚±ãƒ¼ã‚·
+ョンã¯è¡Œã‚ãªã„ã§ãã ã•ã„.
+
+Cã®æ§‹é€ ä½“ã®å‰²å½“ã¨Dataオブジェクトã®ç”Ÿæˆã‚’åŒæ™‚ã«è¡Œã†ãƒžã‚¯ãƒ­ã¨
+ã—ã¦ä»¥ä¸‹ã®ã‚‚ã®ãŒæä¾›ã•れã¦ã„ã¾ã™ï¼Ž
Data_Make_Struct(klass, type, mark, free, sval)
-¤³¤Î¥Þ¥¯¥í¤ÎÌá¤êÃͤÏÀ¸À®¤µ¤ì¤¿Data¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡¥
+ã“ã®ãƒžã‚¯ãƒ­ã®æˆ»ã‚Šå€¤ã¯ç”Ÿæˆã•れãŸDataオブジェクトã§ã™ï¼Žã“ã®ãƒžã‚¯
+ロã¯ä»¥ä¸‹ã®å¼ã®ã‚ˆã†ã«åƒãã¾ã™:
+
+ (sval = ALLOC(type), Data_Wrap_Struct(klass, mark, free, sval))
-klass, mark, free¤ÏData_Wrap_Struct¤ÈƱ¤¸Æ¯¤­¤ò¤·¤Þ¤¹¡¥type
-¤Ï³ä¤êÅö¤Æ¤ëC¹½Â¤ÂΤη¿¤Ç¤¹¡¥³ä¤êÅö¤Æ¤é¤ì¤¿¹½Â¤ÂΤÏÊÑ¿ôsval
-¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡¥¤³¤ÎÊÑ¿ô¤Î·¿¤Ï (type*) ¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥
+klass, mark, freeã¯Data_Wrap_Structã¨åŒã˜åƒãã‚’ã—ã¾ã™ï¼Žtype
+ã¯å‰²ã‚Šå½“ã¦ã‚‹C構造体ã®åž‹ã§ã™ï¼Žå‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸæ§‹é€ ä½“ã¯å¤‰æ•°sval
+ã«ä»£å…¥ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®åž‹ã¯ (type*) ã§ã‚ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-Data¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥Ý¥¤¥ó¥¿¤ò¼è¤ê½Ð¤¹¤Î¤Ï°Ê²¼¤Î¥Þ¥¯¥í¤òÍѤ¤
-¤Þ¤¹¡¥
+Dataオブジェクトã‹ã‚‰ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã™ã®ã¯ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ã‚’用ã„
+ã¾ã™ï¼Ž
Data_Get_Struct(obj, type, sval)
-C¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ÏÊÑ¿ôsval¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡¥
+Cã®æ§‹é€ ä½“ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¯å¤‰æ•°svalã«ä»£å…¥ã•れã¾ã™ï¼Ž
-¤³¤ì¤é¤ÎData¤Î»È¤¤Êý¤Ï¤Á¤ç¤Ã¤Èʬ¤«¤ê¤Ë¤¯¤¤¤Î¤Ç¡¤¸å¤ÇÀâÌÀ¤¹¤ë
-ÎãÂê¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥
+ã“れらã®Dataã®ä½¿ã„æ–¹ã¯ã¡ã‚‡ã£ã¨åˆ†ã‹ã‚Šã«ãã„ã®ã§ï¼Œå¾Œã§èª¬æ˜Žã™ã‚‹
+例題をå‚ç…§ã—ã¦ãã ã•ã„.
-4¡¥ÎãÂê - dbm¥Ñ¥Ã¥±¡¼¥¸¤òºî¤ë
+= 例題 - dbmパッケージを作る
-¤³¤³¤Þ¤Ç¤ÎÀâÌÀ¤Ç¤È¤ê¤¢¤¨¤º³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ïºî¤ì¤ë¤Ï¤º¤Ç¤¹¡¥
-Ruby¤Îext¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¹¤Ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëdbm¥é¥¤¥Ö¥é¥ê¤òÎã¤Ë
-¤·¤ÆÃʳ¬Åª¤ËÀâÌÀ¤·¤Þ¤¹¡¥
+ã“ã“ã¾ã§ã®èª¬æ˜Žã§ã¨ã‚Šã‚ãˆãšæ‹¡å¼µãƒ©ã‚¤ãƒ–ãƒ©ãƒªã¯ä½œã‚Œã‚‹ã¯ãšã§ã™ï¼Ž
+Rubyã®extディレクトリã«ã™ã§ã«å«ã¾ã‚Œã¦ã„ã‚‹dbmライブラリを例ã«
+ã—ã¦æ®µéšŽçš„ã«èª¬æ˜Žã—ã¾ã™ï¼Ž
-(1) ¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤ë
+== ディレクトリを作る
% mkdir ext/dbm
-Ruby 1.1¤«¤é¤ÏǤ°Õ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤òºî
-¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡¥Ruby¤ËÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Ë
-¤ÏRuby¤òŸ³«¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¡¤ext¥Ç¥£¥ì¥¯¥È¥ê¤ÎÃæ¤Ë³ÈÄ¥
-¥é¥¤¥Ö¥é¥êÍѤΥǥ£¥ì¥¯¥È¥ê¤òºî¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥Ì¾Á°¤ÏŬÅö¤Ë
-Áª¤ó¤Ç¹½¤¤¤Þ¤»¤ó¡¥
-
-(2) À߷פ¹¤ë
-
-¤Þ¤¢¡¤ÅöÁ³¤Ê¤ó¤Ç¤¹¤±¤É¡¤¤É¤¦¤¤¤¦µ¡Ç½¤ò¼Â¸½¤¹¤ë¤«¤É¤¦¤«¤Þ¤ºÀß
-·×¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥¤É¤ó¤Ê¥¯¥é¥¹¤ò¤Ä¤¯¤ë¤«¡¤¤½¤Î¥¯¥é¥¹¤Ë¤Ï
-¤É¤ó¤Ê¥á¥½¥Ã¥É¤¬¤¢¤ë¤«¡¤¥¯¥é¥¹¤¬Ä󶡤¹¤ëÄê¿ô¤Ê¤É¤Ë¤Ä¤¤¤ÆÀß·×
-¤·¤Þ¤¹¡¥
-
-(3) C¥³¡¼¥É¤ò½ñ¤¯
-
-³ÈÄ¥¥é¥¤¥Ö¥é¥êËÜÂΤȤʤëC¸À¸ì¤Î¥½¡¼¥¹¤ò½ñ¤­¤Þ¤¹¡¥C¸À¸ì¤Î¥½¡¼
-¥¹¤¬¤Ò¤È¤Ä¤Î»þ¤Ë¤Ï¡Ö¥é¥¤¥Ö¥é¥ê̾.c¡×¤òÁª¤Ö¤ÈÎɤ¤¤Ç¤·¤ç¤¦¡¥C
-¸À¸ì¤Î¥½¡¼¥¹¤¬Ê£¿ô¤Î¾ì¹ç¤Ë¤ÏµÕ¤Ë¡Ö¥é¥¤¥Ö¥é¥ê̾.c¡×¤È¤¤¤¦¥Õ¥¡
-¥¤¥ë̾¤ÏÈò¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤È¥â¥¸¥å¡¼
-¥ëÀ¸À®»þ¤ËÃæ´ÖŪ¤ËÀ¸À®¤µ¤ì¤ë¡Ö¥é¥¤¥Ö¥é¥ê̾.o¡×¤È¤¤¤¦¥Õ¥¡¥¤¥ë
-¤È¤¬¾×ÆÍ¤¹¤ë¤«¤é¤Ç¤¹¡¥
-
-Ruby¤Ï³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ë»þ¤Ë¡ÖInit_¥é¥¤¥Ö¥é¥ê̾¡×¤È
-¤¤¤¦´Ø¿ô¤ò¼«Æ°Åª¤Ë¼Â¹Ô¤·¤Þ¤¹¡¥dbm¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¡ÖInit_dbm¡×
-¤Ç¤¹¡¥¤³¤Î´Ø¿ô¤ÎÃæ¤Ç¥¯¥é¥¹¡¤¥â¥¸¥å¡¼¥ë¡¤¥á¥½¥Ã¥É¡¤Äê¿ô¤Ê¤É¤Î
-ÄêµÁ¤ò¹Ô¤¤¤Þ¤¹¡¥dbm.c¤«¤é°ìÉô°úÍѤ·¤Þ¤¹¡¥
-
---
-Init_dbm()
-{
- /* 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(obj, keystr)
- VALUE obj, keystr;
-{
- :
-}
---
-
-°ú¿ô¤Î¿ô¤¬¸ÇÄê¤Î¥¿¥¤¥×¤ÏÂè1°ú¿ô¤¬self¡¤Âè2°ú¿ô°Ê¹ß¤¬¥á¥½¥Ã¥É
-¤Î°ú¿ô¤È¤Ê¤ê¤Þ¤¹¡¥
-
-°ú¿ô¤Î¿ô¤¬ÉÔÄê¤Î¤â¤Î¤ÏC¤ÎÇÛÎó¤Ç¼õ¤±¤ë¤â¤Î¤ÈRuby¤ÎÇÛÎó¤Ç¼õ¤±
-¤ë¤â¤Î¤È¤¬¤¢¤ê¤Þ¤¹¡¥dbm¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ç¡¤C¤ÎÇÛÎó¤Ç¼õ¤±¤ë¤â¤Î
-¤ÏDBM¤Î¥¯¥é¥¹¥á¥½¥Ã¥É¤Ç¤¢¤ëopen()¤Ç¤¹¡¥¤³¤ì¤ò¼ÂÁõ¤·¤Æ¤¤¤ë´Ø
-¿ôfdbm_s_open()¤Ï¤³¤¦¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥
-
---
-static VALUE
-fdbm_s_open(argc, argv, klass)
- 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ÊÑ¿ô°Ê¹ß¤Ë»ØÄꤷ¤¿ÊÑ¿ô¤ËÃͤòÂåÆþ¤·¤Æ¤¯¤ì¤Þ¤¹¡¥¤³¤Î
-¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¤Âè1ʸ»úÌܤ¬¾Êά¤Ç¤­¤Ê¤¤°ú¿ô¤Î¿ô¡¤Âè2ʸ»úÌܤ¬
-¾Êά¤Ç¤­¤ë°ú¿ô¤Î¿ô¡¤Âè3ʸ»úÌܤ¬Âбþ¤¹¤ëÁê¼ê¤¬Ìµ¤¤¤¢¤Þ¤ê¤Î°ú
-¿ô¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¼¨¤¹"*"¤Ç¤¹¡¥2ʸ»úÌܤÈ3ʸ»úÌܤϾÊά¤Ç¤­¤Þ
-¤¹¡¥dbm.c¤ÎÎã¤Ç¤Ï¡¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï"11"¤Ç¤¹¤«¤é¡¤°ú¿ô¤ÏºÇÄã1¤Ä
-¤Ç¡¤2¤Ä¤Þ¤Çµö¤µ¤ì¤ë¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡¥¾Êά¤µ¤ì¤Æ¤¤¤ë»þ¤Î
-ÊÑ¿ô¤ÎÃͤÏnil(C¸À¸ì¤Î¥ì¥Ù¥ë¤Ç¤ÏQnil)¤Ë¤Ê¤ê¤Þ¤¹¡¥
-
-Ruby¤ÎÇÛÎó¤Ç°ú¿ô¤ò¼õ¤±¼è¤ë¤â¤Î¤Ïindexes¤¬¤¢¤ê¤Þ¤¹¡¥¼ÂÁõ¤Ï¤³
-¤¦¤Ç¤¹¡¥
-
---
-static VALUE
-fdbm_indexes(obj, args)
- VALUE obj, args;
-{
- :
-}
---
-
-Âè1°ú¿ô¤Ïself¡¤Âè2°ú¿ô¤ÏRuby¤ÎÇÛÎó¤Ç¤¹¡¥
-
-** Ãí°Õ»ö¹à
-
-Ruby¤È¶¦Í­¤Ï¤·¤Ê¤¤¤¬Ruby¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò³ÊǼ¤¹¤ë²ÄǽÀ­¤Î¤¢¤ë
-C¤ÎÂç°èÊÑ¿ô¤Ï°Ê²¼¤Î´Ø¿ô¤ò»È¤Ã¤ÆRuby¥¤¥ó¥¿¥×¥ê¥¿¤ËÊÑ¿ô¤Î¸ºß
-¤ò¶µ¤¨¤Æ¤¢¤²¤Æ¤¯¤À¤µ¤¤¡¥¤Ç¤Ê¤¤¤ÈGC¤Ç¥È¥é¥Ö¥ë¤òµ¯¤³¤·¤Þ¤¹¡¥
+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クラスを定義ã™ã‚‹ */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBMã¯Enumerableモジュールをインクルードã™ã‚‹ */
+ 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) do {\
+ Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
+
+ã¡ã‚‡ã£ã¨è¤‡é›‘ãªãƒžã‚¯ãƒ­ã§ã™ãŒï¼Œè¦ã™ã‚‹ã«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)
-(4) extconf.rb¤òÍѰդ¹¤ë
+== extconf.rbを用æ„ã™ã‚‹
-Makefile¤òºî¤ë¾ì¹ç¤Î¿÷·¿¤Ë¤Ê¤ëextconf.rb¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤òºî¤ê
-¤Þ¤¹¡¥extconf.rb¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥³¥ó¥Ñ¥¤¥ë¤ËɬÍפʾò·ï¤Î¥Á¥§¥Ã
-¥¯¤Ê¤É¤ò¹Ô¤¦¤³¤È¤¬ÌÜŪ¤Ç¤¹¡¥¤Þ¤º¡¤
+Makefileを作る場åˆã®é››åž‹ã«ãªã‚‹extconf.rbã¨ã„ã†ãƒ•ァイルを作り
+ã¾ã™ï¼Žextconf.rbã¯ãƒ©ã‚¤ãƒ–ラリã®ã‚³ãƒ³ãƒ‘イルã«å¿…è¦ãªæ¡ä»¶ã®ãƒã‚§ãƒƒ
+クãªã©ã‚’行ã†ã“ã¨ãŒç›®çš„ã§ã™ï¼Žã¾ãšï¼Œ
require 'mkmf'
-¤òextconf.rb¤ÎÀèÆ¬¤ËÃÖ¤­¤Þ¤¹¡¥extconf.rb¤ÎÃæ¤Ç¤Ï°Ê²¼¤ÎRuby´Ø
-¿ô¤ò»È¤¦¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥
+ã‚’extconf.rbã®å…ˆé ­ã«ç½®ãã¾ã™ï¼Žextconf.rbã®ä¸­ã§ã¯ä»¥ä¸‹ã®Rubyé–¢
+数を使ã†ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Ž
- have_library(lib, func): ¥é¥¤¥Ö¥é¥ê¤Î¸ºß¥Á¥§¥Ã¥¯
- have_func(func, header): ´Ø¿ô¤Î¸ºß¥Á¥§¥Ã¥¯
- have_header(header): ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¸ºß¥Á¥§¥Ã¥¯
- create_makefile(target): Makefile¤ÎÀ¸À®
+ 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: ¥ê¥ó¥¯¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë̾¤Î¥ê¥¹¥È
+ $CFLAGS: コンパイル時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Oãªã©)
+ $CPPFLAGS: プリプロセッサã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Iã‚„-Dãªã©)
+ $LDFLAGS: リンク時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Lãªã©)
+ $objs: リンクã•れるオブジェクトファイルåã®ãƒªã‚¹ãƒˆ
-¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¤Ï¡¢Ä̾ï¤Ï¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò¸¡º÷¤·
-¤Æ¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤Þ¤¹¤¬¡¢make¤ÎÅÓÃæ¤Ç¥½¡¼¥¹¤òÀ¸À®¤¹¤ë¤è¤¦¤Ê
-¾ì¹ç¤ÏÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+オブジェクトファイルã®ãƒªã‚¹ãƒˆã¯ï¼Œé€šå¸¸ã¯ã‚½ãƒ¼ã‚¹ãƒ•ァイルを検索ã—
+ã¦è‡ªå‹•çš„ã«ç”Ÿæˆã•れã¾ã™ãŒï¼Œmakeã®é€”中ã§ã‚½ãƒ¼ã‚¹ã‚’生æˆã™ã‚‹ã‚ˆã†ãª
+å ´åˆã¯æ˜Žç¤ºçš„ã«æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
-¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¾ò·ï¤¬Â·¤ï¤º¡¤¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó
-¥Ñ¥¤¥ë¤·¤Ê¤¤»þ¤Ë¤Ïcreate_makefile¤ò¸Æ¤Ð¤Ê¤±¤ì¤ÐMakefile¤ÏÀ¸
-À®¤µ¤ì¤º¡¤¥³¥ó¥Ñ¥¤¥ë¤â¹Ô¤ï¤ì¤Þ¤»¤ó¡¥
+ライブラリをコンパイルã™ã‚‹æ¡ä»¶ãŒæƒã‚ãšï¼Œãã®ãƒ©ã‚¤ãƒ–ラリをコン
+パイルã—ãªã„時ã«ã¯create_makefileを呼ã°ãªã‘れã°Makefileã¯ç”Ÿ
+æˆã•れãšï¼Œã‚³ãƒ³ãƒ‘イルも行ã‚れã¾ã›ã‚“.
-(5) depend¤òÍѰդ¹¤ë
+== dependを用æ„ã™ã‚‹
-¤â¤·¡¤¥Ç¥£¥ì¥¯¥È¥ê¤Ëdepend¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ì¤Ð¡¤
-Makefile¤¬°Í¸´Ø·¸¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤ì¤Þ¤¹¡¥
+ã‚‚ã—,ディレクトリã«dependã¨ã„ã†ãƒ•ァイルãŒå­˜åœ¨ã™ã‚Œã°ï¼Œ
+MakefileãŒä¾å­˜é–¢ä¿‚ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ãれã¾ã™ï¼Ž
% gcc -MM *.c > depend
-¤Ê¤É¤Çºî¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥¤¢¤Ã¤ÆÂ»¤Ï̵¤¤¤Ç¤·¤ç¤¦¡¥
+ãªã©ã§ä½œã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã‚ã£ã¦æã¯ç„¡ã„ã§ã—ょã†ï¼Ž
-(6) Makefile¤òÀ¸À®¤¹¤ë
+== Makefileを生æˆã™ã‚‹
-Makefile¤ò¼ÂºÝ¤ËÀ¸À®¤¹¤ë¤¿¤á¤Ë¤Ï
+Makefileを実際ã«ç”Ÿæˆã™ã‚‹ãŸã‚ã«ã¯
ruby extconf.rb
-¤È¤·¤Þ¤¹¡¥extconf.rb¤Ë require 'mkmf' ¤Î¹Ô¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¨¥é¡¼
-¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¤°ú¿ô¤òÄɲä·¤Æ
+ã¨ã—ã¾ã™ï¼Žextconf.rbã« require 'mkmf' ã®è¡ŒãŒãªã„å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼
+ã«ãªã‚Šã¾ã™ã®ã§ï¼Œå¼•数を追加ã—ã¦
ruby -r mkmf extconf.rb
-¤È¤·¤Æ¤¯¤À¤µ¤¤¡¥
+ã¨ã—ã¦ãã ã•ã„.
-site_ruby ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¯¡¢
-vendor_ruby ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¾ì¹ç¤Ë¤Ï
-°Ê²¼¤Î¤è¤¦¤Ë --vendor ¥ª¥×¥·¥ç¥ó¤ò²Ã¤¨¤Æ¤¯¤À¤µ¤¤¡¥
+site_ruby ディレクトリã§ãªã,
+vendor_ruby ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹å ´åˆã«ã¯
+以下ã®ã‚ˆã†ã« --vendor オプションを加ãˆã¦ãã ã•ã„.
ruby extconf.rb --vendor
-¥Ç¥£¥ì¥¯¥È¥ê¤òext°Ê²¼¤ËÍѰդ·¤¿¾ì¹ç¤Ë¤ÏRubyÁ´ÂΤÎmake¤Î»þ¤Ë
-¼«Æ°Åª¤ËMakefile¤¬À¸À®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¤¤³¤Î¥¹¥Æ¥Ã¥×¤ÏÉÔÍפǤ¹¡¥
+ディレクトリをext以下ã«ç”¨æ„ã—ãŸå ´åˆã«ã¯Ruby全体ã®makeã®æ™‚ã«
+自動的ã«MakefileãŒç”Ÿæˆã•れã¾ã™ã®ã§ï¼Œã“ã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ä¸è¦ã§ã™ï¼Ž
-(7) make¤¹¤ë
+== makeã™ã‚‹
-ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤òÀ¸À®¤¹¤ë¾ì¹ç¤Ë¤Ï¤½¤Î¾ì¤Çmake¤·¤Æ¤¯¤À¤µ
-¤¤¡¥É¬ÍפǤ¢¤ì¤Ð make install ¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡¥
+動的リンクライブラリを生æˆã™ã‚‹å ´åˆã«ã¯ãã®å ´ã§makeã—ã¦ãã ã•
+ã„.必è¦ã§ã‚れ㰠make install ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¾ã™ï¼Ž
-ext°Ê²¼¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òÍѰդ·¤¿¾ì¹ç¤Ï¡¤Ruby¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç
-make¤ò¼Â¹Ô¤¹¤ë¤ÈMakefile¤òÀ¸À®¤«¤émake¡¤É¬Íפˤè¤Ã¤Æ¤Ï¤½¤Î¥â
-¥¸¥å¡¼¥ë¤ÎRuby¤Ø¤Î¥ê¥ó¥¯¤Þ¤Ç¼«Æ°Åª¤Ë¼Â¹Ô¤·¤Æ¤¯¤ì¤Þ¤¹¡¥
-extconf.rb¤ò½ñ¤­´¹¤¨¤ë¤Ê¤É¤·¤ÆMakefile¤ÎºÆÀ¸À®¤¬É¬Íפʻþ¤Ï¤Þ
-¤¿Ruby¥Ç¥£¥ì¥¯¥È¥ê¤Çmake¤·¤Æ¤¯¤À¤µ¤¤¡¥
+ext以下ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’用æ„ã—ãŸå ´åˆã¯ï¼ŒRubyã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§
+makeを実行ã™ã‚‹ã¨Makefileを生æˆã‹ã‚‰make,必è¦ã«ã‚ˆã£ã¦ã¯ãã®ãƒ¢
+ジュールã®Rubyã¸ã®ãƒªãƒ³ã‚¯ã¾ã§è‡ªå‹•çš„ã«å®Ÿè¡Œã—ã¦ãれã¾ã™ï¼Ž
+extconf.rbã‚’æ›¸ãæ›ãˆã‚‹ãªã©ã—ã¦Makefileã®å†ç”ŸæˆãŒå¿…è¦ãªæ™‚ã¯ã¾
+ãŸRubyディレクトリã§makeã—ã¦ãã ã•ã„.
-³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ïmake install¤ÇRuby¥é¥¤¥Ö¥é¥ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î
-²¼¤Ë¥³¥Ô¡¼¤µ¤ì¤Þ¤¹¡¥¤â¤·³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤Æ»È¤¦Ruby¤Çµ­
-½Ò¤µ¤ì¤¿¥×¥í¥°¥é¥à¤¬¤¢¤ê¡¤Ruby¥é¥¤¥Ö¥é¥ê¤ËÃÖ¤­¤¿¤¤¾ì¹ç¤Ë¤Ï¡¤
-³ÈÄ¥¥é¥¤¥Ö¥é¥êÍѤΥǥ£¥ì¥¯¥È¥ê¤Î²¼¤Ë lib ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê
-¤òºî¤ê¡¤¤½¤³¤Ë ³ÈÄ¥»Ò .rb ¤Î¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤ª¤±¤ÐƱ»þ¤Ë¥¤¥ó
-¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡¥
+拡張ライブラリã¯make installã§Rubyライブラリã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®
+下ã«ã‚³ãƒ”ーã•れã¾ã™ï¼Žã‚‚ã—æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨å”調ã—ã¦ä½¿ã†Rubyã§è¨˜
+è¿°ã•れãŸãƒ—ログラムãŒã‚り,Rubyライブラリã«ç½®ããŸã„å ´åˆã«ã¯ï¼Œ
+拡張ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ã« lib ã¨ã„ã†ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
+を作り,ãã“ã« æ‹¡å¼µå­ .rb ã®ãƒ•ァイルを置ã„ã¦ãŠã‘ã°åŒæ™‚ã«ã‚¤ãƒ³
+ストールã•れã¾ã™ï¼Ž
-(8) ¥Ç¥Ð¥Ã¥°
+== デãƒãƒƒã‚°
-¤Þ¤¢¡¤¥Ç¥Ð¥Ã¥°¤·¤Ê¤¤¤Èư¤«¤Ê¤¤¤Ç¤·¤ç¤¦¤Í¡¥ext/Setup¤Ë¥Ç¥£¥ì
-¥¯¥È¥ê̾¤ò½ñ¤¯¤ÈÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë¤Î¤Ç¥Ç¥Ð¥Ã¥¬¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê
-¤ê¤Þ¤¹¡¥¤½¤Îʬ¥³¥ó¥Ñ¥¤¥ë¤¬ÃÙ¤¯¤Ê¤ê¤Þ¤¹¤±¤É¡¥
+ã¾ã‚,デãƒãƒƒã‚°ã—ãªã„ã¨å‹•ã‹ãªã„ã§ã—ょã†ã­ï¼Žext/Setupã«ãƒ‡ã‚£ãƒ¬
+クトリåを書ãã¨é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹ã®ã§ãƒ‡ãƒãƒƒã‚¬ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãª
+りã¾ã™ï¼Žãã®åˆ†ã‚³ãƒ³ãƒ‘イルãŒé…ããªã‚Šã¾ã™ã‘ã©ï¼Ž
-(9) ¤Ç¤­¤¢¤¬¤ê
+== ã§ãã‚ãŒã‚Š
-¸å¤Ï¤³¤Ã¤½¤ê»È¤¦¤Ê¤ê¡¤¹­¤¯¸ø³«¤¹¤ë¤Ê¤ê¡¤Çä¤ë¤Ê¤ê¡¤¤´¼«Í³¤Ë¤ª
-»È¤¤¤¯¤À¤µ¤¤¡¥Ruby¤Îºî¼Ô¤Ï³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤·¤Æ°ìÀڤθ¢Íø¤ò
-¼çÄ¥¤·¤Þ¤»¤ó¡¥
+後ã¯ã“ã£ãり使ã†ãªã‚Šï¼Œåºƒã公開ã™ã‚‹ãªã‚Šï¼Œå£²ã‚‹ãªã‚Šï¼Œã”自由ã«ãŠ
+使ã„ãã ã•ã„.Rubyã®ä½œè€…ã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«é–¢ã—ã¦ä¸€åˆ‡ã®æ¨©åˆ©ã‚’
+主張ã—ã¾ã›ã‚“.
-Appendix A. Ruby¤Î¥½¡¼¥¹¥³¡¼¥É¤ÎʬÎà
+= Appendix A. Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®åˆ†é¡ž
-Ruby¤Î¥½¡¼¥¹¤Ï¤¤¤¯¤Ä¤«¤ËʬÎह¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡¥¤³¤Î¤¦¤Á¥¯¥é
-¥¹¥é¥¤¥Ö¥é¥ê¤ÎÉôʬ¤Ï´ðËÜŪ¤Ë³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤ÈƱ¤¸ºî¤êÊý¤Ë¤Ê¤Ã
-¤Æ¤¤¤Þ¤¹¡¥¤³¤ì¤é¤Î¥½¡¼¥¹¤Ïº£¤Þ¤Ç¤ÎÀâÌÀ¤Ç¤Û¤È¤ó¤ÉÍý²ò¤Ç¤­¤ë¤È
-»×¤¤¤Þ¤¹¡¥
+Rubyã®ã‚½ãƒ¼ã‚¹ã¯ã„ãã¤ã‹ã«åˆ†é¡žã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã“ã®ã†ã¡ã‚¯ãƒ©
+スライブラリã®éƒ¨åˆ†ã¯åŸºæœ¬çš„ã«æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨åŒã˜ä½œã‚Šæ–¹ã«ãªã£
+ã¦ã„ã¾ã™ï¼Žã“れらã®ã‚½ãƒ¼ã‚¹ã¯ä»Šã¾ã§ã®èª¬æ˜Žã§ã»ã¨ã‚“ã©ç†è§£ã§ãã‚‹ã¨
+æ€ã„ã¾ã™ï¼Ž
-Ruby¸À¸ì¤Î¥³¥¢
+== Ruby言語ã®ã‚³ã‚¢
- class.c
- error.c
- eval.c
- gc.c
- object.c
- parse.y
- variable.c
+class.c :: クラスã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
+error.c :: 例外クラスã¨ä¾‹å¤–機構
+gc.c :: 記憶領域管ç†
+load.c :: ライブラリã®ãƒ­ãƒ¼ãƒ‰
+object.c :: オブジェクト
+variable.c :: 変数ã¨å®šæ•°
-¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô
+== Rubyã®æ§‹æ–‡è§£æžå™¨
+
+ parse.y : å­—å¥è§£æžå™¨ã¨æ§‹æ–‡å®šç¾©
+ -> parse.c : 自動生æˆ
+ defs/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
+
+ defs/opt_insns_unif.def : 命令èžåˆ
+ defs/opt_operand.def : 最é©åŒ–ã®ãŸã‚ã®å®šç¾©
+
+ -> insn*.inc : 自動生æˆ
+ -> opt*.inc : 自動生æˆ
+ -> vm.inc : 自動生æˆ
+
+== æ­£è¦è¡¨ç¾ã‚¨ãƒ³ã‚¸ãƒ³ (鬼車)
- dln.c
regex.c
- st.c
- util.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¥³¥Þ¥ó¥É¤Î¼ÂÁõ
+== 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 :: 自動生æˆ
- array.c
- bignum.c
- compar.c
- dir.c
- enum.c
- file.c
- hash.c
- io.c
- marshal.c
- math.c
- numeric.c
- pack.c
- prec.c
- process.c
- random.c
- range.c
- re.c
- signal.c
- sprintf.c
- string.c
- struct.c
- time.c
+== 多言語化
-Appendix B. ³ÈÄ¥ÍÑ´Ø¿ô¥ê¥Õ¥¡¥ì¥ó¥¹
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: エンコーディングクラス群
+enc/trans/* :: コードãƒã‚¤ãƒ³ãƒˆå¯¾å¿œè¡¨
-C¸À¸ì¤«¤éRuby¤Îµ¡Ç½¤òÍøÍѤ¹¤ëAPI¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡¥
+== gorubyコマンドã®å®Ÿè£…
-** ·¿
+ goruby.c
+ golf_prelude.rb : goruby固有ã®ãƒ©ã‚¤ãƒ–ラリ
+ -> golf_prelude.c : 自動生æˆ
-VALUE
+= Appendix B. 拡張用関数リファレンス
- Ruby¥ª¥Ö¥¸¥§¥¯¥È¤òɽ¸½¤¹¤ë·¿¡¥É¬Íפ˱þ¤¸¤Æ¥­¥ã¥¹¥È¤·¤ÆÍѤ¤¤ë¡¥
- ÁȤ߹þ¤ß·¿¤òɽ¸½¤¹¤ëC¤Î·¿¤Ïruby.h¤Ëµ­½Ò¤·¤Æ¤¢¤ëR¤Ç»Ï¤Þ¤ë¹½Â¤
- ÂΤǤ¢¤ë¡¥VALUE·¿¤ò¤³¤ì¤é¤Ë¥­¥ã¥¹¥È¤¹¤ë¤¿¤á¤ËR¤Ç»Ï¤Þ¤ë¹½Â¤ÂÎ
- ̾¤òÁ´¤ÆÂçʸ»ú¤Ë¤·¤¿Ì¾Á°¤Î¥Þ¥¯¥í¤¬ÍѰդµ¤ì¤Æ¤¤¤ë¡¥
+C言語ã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’利用ã™ã‚‹APIã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚る.
-** ÊÑ¿ô¡¦Äê¿ô
+== åž‹
-Qnil
+VALUE ::
- Äê¿ô: nil¥ª¥Ö¥¸¥§¥¯¥È
+ Rubyオブジェクトを表ç¾ã™ã‚‹åž‹ï¼Žå¿…è¦ã«å¿œã˜ã¦ã‚­ãƒ£ã‚¹ãƒˆã—ã¦ç”¨ã„る.
+ 組ã¿è¾¼ã¿åž‹ã‚’表ç¾ã™ã‚‹Cã®åž‹ã¯ruby.hã«è¨˜è¿°ã—ã¦ã‚ã‚‹Rã§å§‹ã¾ã‚‹æ§‹é€ 
+ 体ã§ã‚る.VALUE型をã“れらã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãŸã‚ã«Rã§å§‹ã¾ã‚‹æ§‹é€ ä½“
+ åã‚’å…¨ã¦å¤§æ–‡å­—ã«ã—ãŸåå‰ã®ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„る.
-Qtrue
+== 変数・定数
- Äê¿ô: true¥ª¥Ö¥¸¥§¥¯¥È(¿¿¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ)
+Qnil ::
-Qfalse
+ 定数: nilオブジェクト
- Äê¿ô: false¥ª¥Ö¥¸¥§¥¯¥È
+Qtrue ::
-** C¥Ç¡¼¥¿¤Î¥«¥×¥»¥ë²½
+ 定数: trueオブジェクト(真ã®ãƒ‡ãƒ•ォルト値)
-Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
+Qfalse ::
- C¤ÎǤ°Õ¤Î¥Ý¥¤¥ó¥¿¤ò¥«¥×¥»¥ë²½¤·¤¿Ruby¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡¥¤³
- ¤Î¥Ý¥¤¥ó¥¿¤¬Ruby¤«¤é¥¢¥¯¥»¥¹¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿»þ¡¤free¤Ç»ØÄꤷ¤¿
- ´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë¡¥¤Þ¤¿¡¤¤³¤Î¥Ý¥¤¥ó¥¿¤Î»Ø¤¹¥Ç¡¼¥¿¤¬Â¾¤ÎRuby¥ª¥Ö
- ¥¸¥§¥¯¥È¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¡¤mark¤Ë»ØÄꤹ¤ë´Ø¿ô¤Ç¥Þ¡¼¥¯¤¹¤ëɬÍ×
- ¤¬¤¢¤ë¡¥
+ 定数: falseオブジェクト
-Data_Make_Struct(klass, type, mark, free, sval)
+== Cデータã®ã‚«ãƒ—セル化
- type·¿¤Î¥á¥â¥ê¤òmalloc¤·¡¤ÊÑ¿ôsval¤ËÂåÆþ¤·¤¿¸å¡¤¤½¤ì¤ò¥«¥×¥»
- ¥ë²½¤·¤¿¥Ç¡¼¥¿¤òÊÖ¤¹¥Þ¥¯¥í¡¥
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
-Data_Get_Struct(data, type, sval)
+ Cã®ä»»æ„ã®ãƒã‚¤ãƒ³ã‚¿ã‚’カプセル化ã—ãŸRubyオブジェクトを返ã™ï¼Žã“
+ ã®ãƒã‚¤ãƒ³ã‚¿ãŒRubyã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã•れãªããªã£ãŸæ™‚,freeã§æŒ‡å®šã—ãŸ
+ 関数ãŒå‘¼ã°ã‚Œã‚‹ï¼Žã¾ãŸï¼Œã“ã®ãƒã‚¤ãƒ³ã‚¿ã®æŒ‡ã™ãƒ‡ãƒ¼ã‚¿ãŒä»–ã®Rubyオブ
+ ジェクトを指ã—ã¦ã„ã‚‹å ´åˆï¼Œmarkã«æŒ‡å®šã™ã‚‹é–¢æ•°ã§ãƒžãƒ¼ã‚¯ã™ã‚‹å¿…è¦
+ ãŒã‚る.
- data¤«¤étype·¿¤Î¥Ý¥¤¥ó¥¿¤ò¼è¤ê½Ð¤·ÊÑ¿ôsval¤ËÂåÆþ¤¹¤ë¥Þ¥¯¥í¡¥
+Data_Make_Struct(klass, type, mark, free, sval) ::
-** ·¿¥Á¥§¥Ã¥¯
+ typeåž‹ã®ãƒ¡ãƒ¢ãƒªã‚’mallocã—,変数svalã«ä»£å…¥ã—ãŸå¾Œï¼Œãれをカプセ
+ ル化ã—ãŸãƒ‡ãƒ¼ã‚¿ã‚’è¿”ã™ãƒžã‚¯ãƒ­ï¼Ž
-TYPE(value)
-FIXNUM_P(value)
-NIL_P(value)
-void Check_Type(VALUE value, int type)
-void Check_SafeStr(VALUE value)
+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)
-NUM2INT(value)
-INT2NUM(i)
-NUM2DBL(value)
-rb_float_new(f)
-StringValue(value)
-StringValuePtr(value)
-StringValueCStr(value)
-rb_str_new2(s)
+ 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)
+ rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags)
+ NUM2DBL(value)
+ rb_float_new(f)
+ RSTRING_LEN(str)
+ RSTRING_PTR(str)
+ StringValue(value)
+ StringValuePtr(value)
+ StringValueCStr(value)
+ rb_str_new2(s)
-** ¥¯¥é¥¹/¥â¥¸¥å¡¼¥ëÄêµÁ
+== クラス/モジュール定義
-VALUE rb_define_class(const char *name, VALUE super)
+VALUE rb_define_class(const char *name, VALUE super) ::
- super¤Î¥µ¥Ö¥¯¥é¥¹¤È¤·¤Æ¿·¤·¤¤Ruby¥¯¥é¥¹¤òÄêµÁ¤¹¤ë¡¥
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã™ã‚‹ï¼Ž
-VALUE rb_define_class_under(VALUE module, const char *name, VALUE super)
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
- super¤Î¥µ¥Ö¥¯¥é¥¹¤È¤·¤Æ¿·¤·¤¤Ruby¥¯¥é¥¹¤òÄêµÁ¤·¡¤module¤Î
- Äê¿ô¤È¤·¤ÆÄêµÁ¤¹¤ë¡¥
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã—,moduleã®
+ 定数ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-VALUE rb_define_module(const char *name)
+VALUE rb_define_module(const char *name) ::
- ¿·¤·¤¤Ruby¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤¹¤ë¡¥
+ æ–°ã—ã„Rubyモジュールを定義ã™ã‚‹ï¼Ž
-VALUE rb_define_module_under(VALUE module, const char *name)
+VALUE rb_define_module_under(VALUE module, const char *name) ::
- ¿·¤·¤¤Ruby¥â¥¸¥å¡¼¥ë¤òÄêµÁ¤·¡¤module¤ÎÄê¿ô¤È¤·¤ÆÄêµÁ¤¹¤ë¡¥
+ æ–°ã—ã„Rubyモジュールを定義ã—,moduleã®å®šæ•°ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
-void rb_include_module(VALUE klass, VALUE module)
+void rb_include_module(VALUE klass, VALUE module) ::
- ¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë¡¥class¤¬¤¹¤Ç¤Ëmodule¤ò¥¤¥ó¥¯
- ¥ë¡¼¥É¤·¤Æ¤¤¤ë»þ¤Ë¤Ï²¿¤â¤·¤Ê¤¤(¿½Å¥¤¥ó¥¯¥ë¡¼¥É¤Î¶Ø»ß)¡¥
+ モジュールをインクルードã™ã‚‹ï¼ŽclassãŒã™ã§ã«moduleをインク
+ ルードã—ã¦ã„る時ã«ã¯ä½•ã‚‚ã—ãªã„(多é‡ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰ã®ç¦æ­¢).
-void rb_extend_object(VALUE object, VALUE module)
+void rb_extend_object(VALUE object, VALUE module) ::
- ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥â¥¸¥å¡¼¥ë(¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥á¥½¥Ã¥É)¤Ç³ÈÄ¥¤¹¤ë¡¥
+ オブジェクトをモジュール(ã§å®šç¾©ã•れã¦ã„るメソッド)ã§æ‹¡å¼µã™ã‚‹ï¼Ž
-** Âç°èÊÑ¿ôÄêµÁ
+== 大域変数定義
-void rb_define_variable(const char *name, VALUE *var)
+void rb_define_variable(const char *name, VALUE *var) ::
- Ruby¤ÈC¤È¤Ç¶¦Í­¤¹¤ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô̾¤¬`$'¤Ç
- »Ï¤Þ¤é¤Ê¤¤»þ¤Ë¤Ï¼«Æ°Åª¤ËÄɲ䵤ì¤ë¡¥name¤È¤·¤ÆRuby¤Î¼±ÊÌ»Ò
- ¤È¤·¤Æµö¤µ¤ì¤Ê¤¤Ê¸»ú(Î㤨¤Ð` ')¤ò´Þ¤à¾ì¹ç¤Ë¤ÏRuby¥×¥í¥°¥é
- ¥à¤«¤é¤Ï¸«¤¨¤Ê¤¯¤Ê¤ë¡¥
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°åãŒ`$'ã§
+ å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れる.nameã¨ã—ã¦Rubyã®è­˜åˆ¥å­
+ ã¨ã—ã¦è¨±ã•れãªã„文字(例ãˆã°` ')ã‚’å«ã‚€å ´åˆã«ã¯Rubyプログラ
+ ムã‹ã‚‰ã¯è¦‹ãˆãªããªã‚‹ï¼Ž
-void rb_define_readonly_variable(const char *name, VALUE *var)
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
- Ruby¤ÈC¤È¤Ç¶¦Í­¤¹¤ëread only¤Î¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥
- read only¤Ç¤¢¤ë¤³¤È°Ê³°¤Ïrb_define_variable()¤ÈƱ¤¸¡¥
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹read onlyã®ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Ž
+ read onlyã§ã‚ã‚‹ã“ã¨ä»¥å¤–ã¯rb_define_variable()ã¨åŒã˜ï¼Ž
-void rb_define_virtual_variable(const char *name,
- VALUE (*getter)(), void (*setter)())
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
- ´Ø¿ô¤Ë¤è¤Ã¤Æ¼Â¸½¤µ¤ì¤ëRubyÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô¤¬»²¾È¤µ¤ì¤¿
- »þ¤Ë¤Ïgetter¤¬¡¤ÊÑ¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ïsetter¤¬¸Æ¤Ð¤ì
- ¤ë¡¥
+ 関数ã«ã‚ˆã£ã¦å®Ÿç¾ã•れるRuby変数を定義ã™ã‚‹ï¼Žå¤‰æ•°ãŒå‚ç…§ã•れãŸ
+ 時ã«ã¯getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œ
+ る.
-void rb_define_hooked_variable(const char *name, VALUE *var,
- VALUE (*getter)(), void (*setter)())
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
- ´Ø¿ô¤Ë¤è¤Ã¤Æhook¤Î¤Ä¤±¤é¤ì¤¿¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤òÄêµÁ¤¹¤ë¡¥ÊÑ¿ô
- ¤¬»²¾È¤µ¤ì¤¿»þ¤Ë¤Ïgetter¤¬¡¤´Ø¿ô¤ËÃͤ¬¥»¥Ã¥È¤µ¤ì¤¿»þ¤Ë¤Ï
- setter¤¬¸Æ¤Ð¤ì¤ë¡¥getter¤äsetter¤Ë0¤ò»ØÄꤷ¤¿»þ¤Ë¤Ïhook¤ò
- »ØÄꤷ¤Ê¤¤¤Î¤ÈƱ¤¸»ö¤Ë¤Ê¤ë¡¥
+ 関数ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°
+ ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯getterãŒï¼Œé–¢æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯
+ setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žgetterã‚„setterã«0を指定ã—ãŸæ™‚ã«ã¯hookã‚’
+ 指定ã—ãªã„ã®ã¨åŒã˜äº‹ã«ãªã‚‹ï¼Ž
void rb_global_variable(VALUE *var)
- GC¤Î¤¿¤á¡¤Ruby¥×¥í¥°¥é¥à¤«¤é¤Ï¥¢¥¯¥»¥¹¤µ¤ì¤Ê¤¤¤¬, Ruby¥ª¥Ö
- ¥¸¥§¥¯¥È¤ò´Þ¤àÂç°èÊÑ¿ô¤ò¥Þ¡¼¥¯¤¹¤ë¡¥
+ GCã®ãŸã‚,Rubyプログラムã‹ã‚‰ã¯ã‚¢ã‚¯ã‚»ã‚¹ã•れãªã„ãŒ, Rubyオブ
+ ジェクトをå«ã‚€å¤§åŸŸå¤‰æ•°ã‚’マークã™ã‚‹ï¼Ž
-** Äê¿ô
+== 定数
-void rb_define_const(VALUE klass, const char *name, VALUE val)
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
- Äê¿ô¤òÄêµÁ¤¹¤ë¡¥
+ 定数を定義ã™ã‚‹ï¼Ž
-void rb_define_global_const(const char *name, VALUE val)
+void rb_define_global_const(const char *name, VALUE val) ::
- Âç°èÄê¿ô¤òÄêµÁ¤¹¤ë¡¥
+ 大域定数を定義ã™ã‚‹ï¼Ž
- rb_define_const(rb_cObject, name, val)
+ rb_define_const(rb_cObject, name, val)
- ¤ÈƱ¤¸°ÕÌ£¡¥
+ ã¨åŒã˜æ„味.
-** ¥á¥½¥Ã¥ÉÄêµÁ
+== メソッド定義
-rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+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)
+ メソッドを定義ã™ã‚‹ï¼Žargcã¯selfを除ãå¼•æ•°ã®æ•°ï¼ŽargcãŒ-1ã®æ™‚,
+ 関数ã«ã¯å¼•æ•°ã®æ•°(selfã‚’å«ã¾ãªã„)を第1引数, 引数ã®é…列を第2
+ 引数ã¨ã™ã‚‹å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹(第3引数ã¯self).argcãŒ-2ã®æ™‚,
+ 第1引数ãŒself, 第2引数ãŒargs(argsã¯å¼•æ•°ã‚’å«ã‚€Rubyã®é…列)ã¨
+ ã„ã†å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹ï¼Ž
- private¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¡¥°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¡¥
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
+ privateメソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
- ÆÃ°Û¥á¥½¥Ã¥É¤òÄêµÁ¤¹¤ë¡¥°ú¿ô¤Ïrb_define_method()¤ÈƱ¤¸¡¥
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
-rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
+ 特異メソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
- argc, argv·Á¼°¤ÇÍ¿¤¨¤é¤ì¤¿°ú¿ô¤òʬ²ò¤¹¤ë¡¥fmt¤Ïɬ¿Ü°ú¿ô¤Î¿ô,
- Éղðú¿ô¤Î¿ô, »Ä¤ê¤Î°ú¿ô¤¬¤¢¤ë¤«¤ò»ØÄꤹ¤ëʸ»úÎó¤Ç, "¿ô»ú
- ¿ô»ú*"¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡¥ 2 ÈÖÌܤοô»ú¤È"*"¤Ï¤½¤ì¤¾¤ì¾Êά²Ä
- ǽ¤Ç¤¢¤ë¡¥É¬¿Ü°ú¿ô¤¬°ì¤Ä¤â¤Ê¤¤¾ì¹ç¤Ï0¤ò»ØÄꤹ¤ë¡¥Âè3°ú¿ô°Ê
- ¹ß¤ÏÊÑ¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç, ³ºÅö¤¹¤ëÍ×ÁǤ¬¤½¤ÎÊÑ¿ô¤Ë³ÊǼ¤µ¤ì¤ë¡¥
- Éղðú¿ô¤ËÂбþ¤¹¤ë°ú¿ô¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÏÊÑ¿ô¤ËQnil¤¬
- ÂåÆþ¤µ¤ì¤ë¡¥
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
-** Ruby¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·
+ argc, argvå½¢å¼ã§ä¸Žãˆã‚‰ã‚ŒãŸæŒ‡å®šã•れãŸãƒ•ォーマットã«å¾“ã£ã¦å¼•
+ 数を分解ã—,続ãVALUEã¸ã®å‚ç…§ã«ã‚»ãƒƒãƒˆã—ã¾ã™ï¼Žã“ã®ãƒ•ォーマッ
+ トã¯ï¼ŒABNFã§è¨˜è¿°ã™ã‚‹ã¨ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
-VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
- ¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·¡¥Ê¸»úÎ󤫤émid¤òÆÀ¤ë¤¿¤á¤Ë¤Ïrb_intern()¤ò
- »È¤¦¡¥
+ 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
-VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ 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 := "&" ; イテレータブロックをå–å¾—ã™ã‚‹ãŸã‚ã®
+ ; 指定
- ¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤·¡¥°ú¿ô¤òargc, argv·Á¼°¤ÇÅϤ¹¡¥
+ フォーマットãŒ"12"ã®å ´åˆï¼Œå¼•æ•°ã¯æœ€ä½Ž1ã¤ã§ï¼Œ3ã¤(1+2)ã¾ã§è¨±ã•
+ れるã¨ã„ã†æ„味ã«ãªã‚Šã¾ã™ï¼Žå¾“ã£ã¦ï¼Œãƒ•ォーマット文字列ã«ç¶šã„
+ ã¦3ã¤ã®VALUEã¸ã®å‚ç…§ã‚’ç½®ãå¿…è¦ãŒã‚りã¾ã™ï¼Žãれらã«ã¯å–å¾—ã—ãŸ
+ 変数ãŒã‚»ãƒƒãƒˆã•れã¾ã™ï¼Žå¤‰æ•°ã¸ã®å‚ç…§ã®ä»£ã‚りã«NULLを指定ã™ã‚‹
+ ã“ã¨ã‚‚ã§ã,ãã®å ´åˆã¯å–å¾—ã—ãŸå¼•æ•°ã®å€¤ã¯æ¨ã¦ã‚‰ã‚Œã¾ã™ï¼ŽãªãŠï¼Œ
+ çœç•¥å¯èƒ½å¼•æ•°ãŒçœç•¥ã•ã‚ŒãŸæ™‚ã®å¤‰æ•°ã®å€¤ã¯nil(C言語ã®ãƒ¬ãƒ™ãƒ«ã§ã¯
+ Qnil)ã«ãªã‚Šã¾ã™ï¼Ž
+
+ 返り値ã¯ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ã§ã™ï¼Žã‚ªãƒ—ションãƒãƒƒã‚·ãƒ¥ãŠã‚ˆã³ã‚¤
+ ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã¯æ•°ãˆã¾ã›ã‚“.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
+
+ ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã§æŒ‡å®šã•れãŸå€¤ã‚’tableã«ã—ãŸãŒã£ã¦å–り出ã—ã¾ã™ï¼Ž
+ tableã®æœ€åˆã®required個ã®IDã¯å¿…須キーワードを表ã—,続ã
+ optional (optionalãŒè² ã®å ´åˆã¯-optional-1) 個ã®IDã¯çœç•¥å¯èƒ½
+ キーワードã§ã™ï¼Žå¿…須キーワードãŒkeyword_hash中ã«ãªã„å ´åˆï¼Œ
+ "missing keyword"ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Žçœç•¥å¯èƒ½ã‚­ãƒ¼ãƒ¯ãƒ¼
+ ドãŒãªã„å ´åˆã¯ï¼Œvalues中ã®å¯¾å¿œã™ã‚‹è¦ç´ ã¯å¤‰æ›´ã•れã¾ã›ã‚“.
+ keyword_hashã«ä½¿ç”¨ã•れãªã„è¦ç´ ãŒã‚ã‚‹å ´åˆã¯ï¼ŒoptionalãŒè² ãªã‚‰
+ æ–°ã—ã„Hashã¨ã—ã¦çœç•¥å¯èƒ½å¼•æ•°ã®æ¬¡ã«ä¿å­˜ã•れã¾ã™ãŒï¼Œãã†ã§ãªã‘
+ れã°"unknown keyword"ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Ž
+
+VALUE rb_extract_keywords(VALUE *original_hash)
+
+ original_hashã§å‚ç…§ã•れるHashオブジェクトã‹ã‚‰ï¼ŒSymbolã§ã‚ã‚‹
+ キーã¨ãã®å€¤ã‚’æ–°ã—ã„Hashã«å–り出ã—ã¾ã™ï¼Žoriginal_hashã®æŒ‡ã™
+ å…ˆã«ã¯ï¼Œå…ƒã®HashãŒSymbol以外ã®ã‚­ãƒ¼ã‚’å«ã‚“ã§ã„ãŸå ´åˆã¯ãれらãŒ
+ コピーã•れãŸåˆ¥ã®æ–°ã—ã„Hash,ãã†ã§ãªã‘れã°0ãŒä¿å­˜ã•れã¾ã™ï¼Ž
+
+== Rubyメソッド呼ã³å‡ºã—
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ メソッド呼ã³å‡ºã—.文字列ã‹ã‚‰midã‚’å¾—ã‚‹ãŸã‚ã«ã¯rb_intern()ã‚’
+ 使ã†ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.引数をargc, argvå½¢å¼ã§æ¸¡ã™ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.
+ publicãªãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å‘¼ã¹ãªã„.
VALUE rb_eval_string(const char *str)
- ʸ»úÎó¤òRuby¥¹¥¯¥ê¥×¥È¤È¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¡¦¼Â¹Ô¤¹¤ë¡¥
+ 文字列を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) ::
-ID rb_intern(const char *name)
+ objãŒidã§ç¤ºã•れるメソッドをæŒã¤ã‹ã©ã†ã‹ã‚’è¿”ã™ï¼Ž
- ʸ»úÎó¤ËÂбþ¤¹¤ëID¤òÊÖ¤¹¡¥
+== インスタンス変数
-char *rb_id2name(ID id)
+VALUE rb_iv_get(VALUE obj, const char *name) ::
- ID¤ËÂбþ¤¹¤ëʸ»úÎó¤òÊÖ¤¹(¥Ç¥Ð¥Ã¥°ÍÑ)¡¥
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ã‚’得る.`@'ã§å§‹ã¾ã‚‰ãªã„インスタン
+ ス変数㯠Rubyプログラムã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„「隠れãŸã€ã‚¤ãƒ³
+ スタンス変数ã«ãªã‚‹ï¼Žå®šæ•°ã¯å¤§æ–‡å­—ã®åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯
+ モジュール)ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã¨ã—ã¦å®Ÿè£…ã•れã¦ã„る.
-char *rb_class2name(VALUE klass)
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
- ¥¯¥é¥¹¤Î̾Á°¤òÊÖ¤¹(¥Ç¥Ð¥Ã¥°ÍÑ)¡¥¥¯¥é¥¹¤¬Ì¾Á°¤ò»ý¤¿¤Ê¤¤»þ¤Ë¤Ï,
- ÁÄÀè¤òÁ̤äÆÌ¾Á°¤ò»ý¤Ä¥¯¥é¥¹¤Î̾Á°¤òÊÖ¤¹¡¥
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’valã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼Ž
-int rb_respond_to(VALUE obj, ID id)
+== 制御構造
- obj¤¬id¤Ç¼¨¤µ¤ì¤ë¥á¥½¥Ã¥É¤ò»ý¤Ä¤«¤É¤¦¤«¤òÊÖ¤¹¡£
+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ã•れãŸå€¤ã‚’å–り出ã™ã“ã¨ãŒã§ãる.
-VALUE rb_iv_get(VALUE obj, const char *name)
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
- obj¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤ÎÃͤòÆÀ¤ë¡¥`@'¤Ç»Ï¤Þ¤é¤Ê¤¤¥¤¥ó¥¹¥¿¥ó
- ¥¹ÊÑ¿ô¤Ï Ruby¥×¥í¥°¥é¥à¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¡Ö±£¤ì¤¿¡×¥¤¥ó
- ¥¹¥¿¥ó¥¹ÊÑ¿ô¤Ë¤Ê¤ë¡¥Äê¿ô¤ÏÂçʸ»ú¤Î̾Á°¤ò»ý¤Ä¥¯¥é¥¹(¤Þ¤¿¤Ï
- ¥â¥¸¥å¡¼¥ë)¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡¥
+ func2をブロックã¨ã—ã¦è¨­å®šã—, func1をイテレータã¨ã—ã¦å‘¼ã¶ï¼Ž
+ func1ã«ã¯ arg1ãŒå¼•æ•°ã¨ã—ã¦æ¸¡ã•れ, func2ã«ã¯ç¬¬1引数ã«ã‚¤ãƒ†ãƒ¬ãƒ¼
+ ã‚¿ã‹ã‚‰ä¸Žãˆã‚‰ã‚ŒãŸå€¤, 第2引数ã«arg2ãŒæ¸¡ã•れる.
-VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
+ 1.9ã§rb_iterateを使ã†å ´åˆã¯, func1ã®ä¸­ã§Rubyレベルã®ãƒ¡ã‚½ãƒƒãƒ‰
+ を呼ã³å‡ºã•ãªã‘れã°ãªã‚‰ãªã„.
+ 1.9ã§obsoleteã¨ãªã£ãŸ. 代ã‚りã«rb_block_callãŒç”¨æ„ã•れãŸ.
- obj¤Î¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô¤òval¤Ë¥»¥Ã¥È¤¹¤ë¡¥
+VALUE rb_yield(VALUE val) ::
-** À©¸æ¹½Â¤
+ valを値ã¨ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ロックを呼ã³å‡ºã™ï¼Ž
-VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
- func2¤ò¥Ö¥í¥Ã¥¯¤È¤·¤ÆÀßÄꤷ, func1¤ò¥¤¥Æ¥ì¡¼¥¿¤È¤·¤Æ¸Æ¤Ö¡¥
- func1¤Ë¤Ï arg1¤¬°ú¿ô¤È¤·¤ÆÅϤµ¤ì, func2¤Ë¤ÏÂè1°ú¿ô¤Ë¥¤¥Æ¥ì¡¼
- ¥¿¤«¤éÍ¿¤¨¤é¤ì¤¿ÃÍ, Âè2°ú¿ô¤Ëarg2¤¬ÅϤµ¤ì¤ë¡¥
-
-VALUE rb_yield(VALUE val)
+ 関数func1ã‚’arg1を引数ã«å‘¼ã³å‡ºã™ï¼Žfunc1ã®å®Ÿè¡Œä¸­ã«ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãŸæ™‚ã«ã¯ func2ã‚’arg2を引数ã¨ã—ã¦å‘¼ã¶ï¼Žæˆ»ã‚Šå€¤ã¯ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãªã‹ã£ãŸæ™‚ã¯func1ã®æˆ»ã‚Šå€¤, 例外ãŒç™ºç”Ÿã—ãŸæ™‚ã«ã¯func2ã®æˆ»
+ り値ã§ã‚る.
- val¤òÃͤȤ·¤Æ¥¤¥Æ¥ì¡¼¥¿¥Ö¥í¥Ã¥¯¤ò¸Æ¤Ó½Ð¤¹¡¥
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
-VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
+ 関数func1ã‚’arg1を引数ã¨ã—ã¦å®Ÿè¡Œã—, 実行終了後(ãŸã¨ãˆä¾‹å¤–ãŒ
+ 発生ã—ã¦ã‚‚) func2ã‚’arg2を引数ã¨ã—ã¦å®Ÿè¡Œã™ã‚‹ï¼Žæˆ»ã‚Šå€¤ã¯func1
+ ã®æˆ»ã‚Šå€¤ã§ã‚ã‚‹(例外ãŒç™ºç”Ÿã—ãŸæ™‚ã¯æˆ»ã‚‰ãªã„).
- ´Ø¿ôfunc1¤òarg1¤ò°ú¿ô¤Ë¸Æ¤Ó½Ð¤¹¡¥func1¤Î¼Â¹ÔÃæ¤ËÎã³°¤¬È¯À¸
- ¤·¤¿»þ¤Ë¤Ï func2¤òarg2¤ò°ú¿ô¤È¤·¤Æ¸Æ¤Ö¡¥Ìá¤êÃͤÏÎã³°¤¬È¯À¸
- ¤·¤Ê¤«¤Ã¤¿»þ¤Ïfunc1¤ÎÌá¤êÃÍ, Îã³°¤¬È¯À¸¤·¤¿»þ¤Ë¤Ïfunc2¤ÎÌá
- ¤êÃͤǤ¢¤ë¡¥
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
-VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, void (*func2)(), VALUE arg2)
+ 関数funcã‚’argを引数ã¨ã—ã¦å®Ÿè¡Œã—, 例外ãŒç™ºç”Ÿã—ãªã‘れã°ãã®æˆ»
+ り値を返ã™ï¼Žä¾‹å¤–ãŒç™ºç”Ÿã—ãŸå ´åˆã¯, *stateã«éž0をセットã—ã¦
+ Qnilã‚’è¿”ã™ï¼Ž
+ rb_jump_tag()を呼ã°ãšã«æ•æ‰ã—ãŸä¾‹å¤–を無視ã™ã‚‹å ´åˆã«ã¯ï¼Œ
+ rb_set_errinfo(Qnil)ã§ã‚¨ãƒ©ãƒ¼æƒ…報をクリアã—ãªã‘れã°ãªã‚‰ãªã„.
- ´Ø¿ôfunc1¤òarg1¤ò°ú¿ô¤È¤·¤Æ¼Â¹Ô¤·, ¼Â¹Ô½ªÎ»¸å(¤¿¤È¤¨Îã³°¤¬
- ȯÀ¸¤·¤Æ¤â) func2¤òarg2¤ò°ú¿ô¤È¤·¤Æ¼Â¹Ô¤¹¤ë¡¥Ìá¤êÃͤÏfunc1
- ¤ÎÌá¤êÃͤǤ¢¤ë(Îã³°¤¬È¯À¸¤·¤¿»þ¤ÏÌá¤é¤Ê¤¤)¡¥
+void rb_jump_tag(int state) ::
-** Îã³°¡¦¥¨¥é¡¼
+ rb_protect()ã‚„rb_eval_string_protect()ã§æ•æ‰ã•れãŸä¾‹å¤–ã‚’å†
+ é€ã™ã‚‹ï¼Žstateã¯ãれらã®é–¢æ•°ã‹ã‚‰è¿”ã•れãŸå€¤ã§ãªã‘れã°ãªã‚‰ãªã„.
+ ã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
-void rb_warning(const char *fmt, ...)
+void rb_iter_break() ::
- rb_verbose»þ¤Ëɸ½à¥¨¥é¡¼½ÐÎϤ˷ٹð¾ðÊó¤òɽ¼¨¤¹¤ë¡¥°ú¿ô¤Ï
- printf()¤ÈƱ¤¸¡¥
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックを終了ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡º
+ ã—å…ƒã«æˆ»ã‚‰ãªã„.
-void rb_raise(rb_eRuntimeError, const char *fmt, ...)
+void rb_iter_break_value(VALUE value) ::
- RuntimeErrorÎã³°¤òȯÀ¸¤µ¤»¤ë¡¥°ú¿ô¤Ïprintf()¤ÈƱ¤¸¡¥
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックをvalueã§çµ‚了ã™ã‚‹ï¼Žãƒ–ロックã¯å¼•æ•°ã§
+ 与ãˆã‚‰ã‚ŒãŸvalueã‚’è¿”ã™ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
-void rb_raise(VALUE exception, const char *fmt, ...)
+== 例外・エラー
- exception¤Ç»ØÄꤷ¤¿Îã³°¤òȯÀ¸¤µ¤»¤ë¡¥fmt°Ê²¼¤Î°ú¿ô¤Ï
- printf()¤ÈƱ¤¸¡¥
+void rb_warning(const char *fmt, ...) ::
-void rb_fatal(const char *fmt, ...)
+ rb_verboseæ™‚ã«æ¨™æº–エラー出力ã«è­¦å‘Šæƒ…報を表示ã™ã‚‹ï¼Žå¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
- Ã×̿ŪÎã³°¤òȯÀ¸¤µ¤»¤ë¡¥Ä̾ï¤ÎÎã³°½èÍý¤Ï¹Ô¤Ê¤ï¤ì¤º, ¥¤¥ó¥¿¡¼
- ¥×¥ê¥¿¤¬½ªÎ»¤¹¤ë(¤¿¤À¤·ensure¤Ç»ØÄꤵ¤ì¤¿¥³¡¼¥É¤Ï½ªÎ»Á°¤Ë
- ¼Â¹Ô¤µ¤ì¤ë)¡¥
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
-void rb_bug(const char *fmt, ...)
+ RuntimeError例外を発生ã•ã›ã‚‹ï¼Žå¼•æ•°ã¯printf()ã¨åŒã˜ï¼Ž
- ¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ê¤É¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Ç¤·¤«È¯À¸¤¹¤ë¤Ï¤º¤Î¤Ê¤¤
- ¾õ¶·¤Î»þ¸Æ¤Ö¡¥¥¤¥ó¥¿¡¼¥×¥ê¥¿¤Ï¥³¥¢¥À¥ó¥×¤·Ä¾¤Á¤Ë½ªÎ»¤¹¤ë¡¥
- Îã³°½èÍý¤Ï°ìÀڹԤʤï¤ì¤Ê¤¤¡¥
+void rb_raise(VALUE exception, const char *fmt, ...) ::
-** Ruby¤Î½é´ü²½¡¦¼Â¹Ô
+ exceptionã§æŒ‡å®šã—ãŸä¾‹å¤–を発生ã•ã›ã‚‹ï¼Žfmt以下ã®å¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
-Ruby¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËËä¤á¹þ¤à¾ì¹ç¤Ë¤Ï°Ê²¼¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹
-¤ò»È¤¦¡¥Ä̾ï¤Î³ÈÄ¥¥é¥¤¥Ö¥é¥ê¤Ë¤ÏɬÍפʤ¤¡¥
+void rb_fatal(const char *fmt, ...) ::
-void ruby_init()
+ 致命的例外を発生ã•ã›ã‚‹ï¼Žé€šå¸¸ã®ä¾‹å¤–処ç†ã¯è¡Œãªã‚れãš, インター
+ プリタãŒçµ‚了ã™ã‚‹(ãŸã ã—ensureã§æŒ‡å®šã•れãŸã‚³ãƒ¼ãƒ‰ã¯çµ‚了å‰ã«
+ 実行ã•れる).
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤Î½é´ü²½¤ò¹Ô¤Ê¤¦¡¥
+void rb_bug(const char *fmt, ...) ::
-void ruby_options(int argc, char **argv)
+ インタープリタãªã©ãƒ—ログラムã®ãƒã‚°ã§ã—ã‹ç™ºç”Ÿã™ã‚‹ã¯ãšã®ãªã„
+ 状æ³ã®æ™‚呼ã¶ï¼Žã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã¯ã‚³ã‚¢ãƒ€ãƒ³ãƒ—ã—ç›´ã¡ã«çµ‚了ã™ã‚‹ï¼Ž
+ 例外処ç†ã¯ä¸€åˆ‡è¡Œãªã‚れãªã„.
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¿ô¤Î½èÍý¤ò¹Ô¤Ê¤¦¡¥
+注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨
+ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れã¯
+"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
-void ruby_run()
+== Rubyã®åˆæœŸåŒ–・実行
- Ruby¥¤¥ó¥¿¥×¥ê¥¿¤ò¼Â¹Ô¤¹¤ë¡¥
+Rubyをアプリケーションã«åŸ‹ã‚込む場åˆã«ã¯ä»¥ä¸‹ã®ã‚¤ãƒ³ã‚¿ãƒ•ェース
+を使ã†ï¼Žé€šå¸¸ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¯å¿…è¦ãªã„.
-void ruby_script(char *name)
+void ruby_init() ::
- Ruby¤Î¥¹¥¯¥ê¥×¥È̾($0)¤òÀßÄꤹ¤ë¡¥
+ Rubyインタプリタã®åˆæœŸåŒ–を行ãªã†ï¼Ž
+void *ruby_options(int argc, char **argv) ::
-Appendix C. extconf.rb¤Ç»È¤¨¤ë´Ø¿ô¤¿¤Á
+ Rubyインタプリタã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•æ•°ã®å‡¦ç†ã‚’行ãªã„,
+ Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’コンパイルã™ã‚‹ï¼Ž
+ コンパイルã•れãŸã‚½ãƒ¼ã‚¹ã¸ã®ãƒã‚¤ãƒ³ã‚¿ï¼Œã‚‚ã—ãã¯ç‰¹æ®Šå€¤ã‚’è¿”ã™.
-extconf.rb¤ÎÃæ¤Ç¤ÏÍøÍѲÄǽ¤Ê¥³¥ó¥Ñ¥¤¥ë¾ò·ï¥Á¥§¥Ã¥¯¤Î´Ø¿ô¤Ï°Ê
-²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡¥
+int ruby_run_node(void *n) ::
-have_macro(macro, headers)
+ コンパイルã•れãŸã‚³ãƒ¼ãƒ‰ã‚’実行ã™ã‚‹ï¼Ž
+ å®Ÿè¡Œã«æˆåŠŸã—ãŸå ´åˆã¯EXIT_SUCCESSを,エラーãŒèµ·ã“ã£ãŸã¨ãã¯ãれ以外を返ã™ï¼Ž
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ¥Þ¥¯¥ímacro¤¬ÄêµÁ¤µ
- ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þtrue
- ¤òÊÖ¤¹¡¥
+void ruby_script(char *name) ::
-have_library(lib, func)
+ Rubyã®ã‚¹ã‚¯ãƒªãƒ—トå($0)を設定ã™ã‚‹ï¼Ž
- ´Ø¿ôfunc¤òÄêµÁ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥êlib¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥
- ¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë»þ¡¤true¤òÊÖ¤¹¡¥
+== インタプリタã®ã‚¤ãƒ™ãƒ³ãƒˆã®ãƒ•ック
-find_library(lib, func, path...)
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
- ´Ø¿ôfunc¤òÄêµÁ¤·¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥êlib¤Î¸ºß¤ò -Lpath ¤òÄɲÃ
- ¤·¤Ê¤¬¤é¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥é¥¤¥Ö¥é¥ê¤¬¸«ÉÕ¤«¤Ã¤¿»þ¡¤true¤òÊÖ¤¹¡¥
+指定ã•れãŸã‚¤ãƒ³ã‚¿ãƒ—リタã®ã‚¤ãƒ™ãƒ³ãƒˆã«å¯¾ã™ã‚‹ãƒ•ック関数を追加ã—ã¾ã™ï¼Ž
+eventsã¯ä»¥ä¸‹ã®å€¤ã®orã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“:
-have_func(func, header)
+ 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
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ´Ø¿ôfunc¤Î¸ºß¤ò¥Á¥§¥Ã
- ¥¯¤¹¤ë¡¥func¤¬É¸½à¤Ç¤Ï¥ê¥ó¥¯¤µ¤ì¤Ê¤¤¥é¥¤¥Ö¥é¥êÆâ¤Î¤â¤Î¤Ç¤¢
- ¤ë»þ¤Ë¤ÏÀè¤Ëhave_library¤Ç¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤¯
- »ö¡¥´Ø¿ô¤¬Â¸ºß¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+rb_event_hook_func_tã®å®šç¾©ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™:
-have_var(var, header)
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤ÆÊÑ¿ôvar¤Î¸ºß¤ò¥Á¥§¥Ã
- ¥¯¤¹¤ë¡¥var¤¬É¸½à¤Ç¤Ï¥ê¥ó¥¯¤µ¤ì¤Ê¤¤¥é¥¤¥Ö¥é¥êÆâ¤Î¤â¤Î¤Ç¤¢
- ¤ë»þ¤Ë¤ÏÀè¤Ëhave_library¤Ç¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ª¤¯
- »ö¡¥ÊÑ¿ô¤¬Â¸ºß¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+rb_add_event_hook() ã®ç¬¬3引数 data ã¯ï¼Œãƒ•ック関数ã®ç¬¬2引数ã¨
+ã—ã¦æ¸¡ã•れã¾ã™ï¼Žã“れã¯1.8ã§ã¯ç¾åœ¨ã®NODEã¸ã®ãƒã‚¤ãƒ³ã‚¿ã§ã—ãŸï¼Žä»¥
+下㮠RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
-have_header(header)
+ int rb_remove_event_hook(rb_event_hook_func_t func)
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹
- ¤ë»þtrue¤òÊÖ¤¹¡¥
+指定ã•れãŸãƒ•ック関数を削除ã—ã¾ã™ï¼Ž
-find_header(header, path...)
+== äº’æ›æ€§ã®ãŸã‚ã®ãƒžã‚¯ãƒ­
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤Î¸ºß¤ò -Ipath ¤òÄɲ䷤ʤ¬¤é¥Á¥§¥Ã¥¯
- ¤¹¤ë¡¥¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤¬¸«ÉÕ¤«¤Ã¤¿»þ¡¤true¤òÊÖ¤¹¡¥
+APIã®äº’æ›æ€§ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ãŸã‚ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ãŒãƒ‡ãƒ•ォルトã§å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
-have_struct_member(type, member, header)
+NORETURN_STYLE_NEW ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤Ë¥á¥ó¥Ðmember
- ¤¬Â¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Æ¡¤member¤ò
- »ý¤Ä¤¹¤ë»þtrue¤òÊÖ¤¹¡¥
+ NORETURN マクロãŒé–¢æ•°åž‹ãƒžã‚¯ãƒ­ã¨ã—ã¦å®šç¾©ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-have_type(type, header, opt)
+HAVE_RB_DEFINE_ALLOC_FUNC ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤¬Â¸ºß¤¹¤ë¤«¤ò
- ¥Á¥§¥Ã¥¯¤¹¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þtrue¤òÊÖ¤¹¡¥
+ rb_define_alloc_func() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ï¼Œã¤ã¾ã‚Š
+ allocation framework ãŒä½¿ã‚れるã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_define_alloc_func", "ruby.h")
+ ã®çµæžœã¨åŒã˜ï¼Ž
-check_sizeof(type, header)
+HAVE_RB_REG_NEW_STR ::
- ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëheader¤ò¥¤¥ó¥¯¥ë¡¼¥É¤·¤Æ·¿type¤Îcharñ°Ì¥µ¥¤
- ¥º¤òÄ´¤Ù¤ë¡¥type¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë»þ¤½¤Î¥µ¥¤¥º¤òÊÖ¤¹¡¥ÄêµÁ¤µ
- ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ïnil¤òÊÖ¤¹¡¥
+ Stringオブジェクトã‹ã‚‰Regexpオブジェクトを作る
+ rb_reg_new_str() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_reg_new_str", "ruby.h").
+ ã®çµæžœã¨åŒã˜ï¼Ž
-create_makefile(target)
+HAVE_RB_IO_T ::
- ³ÈÄ¥¥é¥¤¥Ö¥é¥êÍѤÎMakefile¤òÀ¸À®¤¹¤ë¡¥¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤±¤ì
- ¤Ð¤½¤Î¥é¥¤¥Ö¥é¥ê¤Ï¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Ê¤¤¡¥target¤Ï¥â¥¸¥å¡¼¥ë̾
- ¤òɽ¤¹¡¥
+ rb_io_t åž‹ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-find_executable(command, path)
+USE_SYMBOL_AS_METHOD_NAME ::
- ¥³¥Þ¥ó¥Écommand¤òFile::PATH_SEPARATOR¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥¹Ì¾¤Î
- ¥ê¥¹¥Èpath¤«¤éõ¤¹¡¥path¤¬nil¤Þ¤¿¤Ï¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¤´Ä¶­
- ÊÑ¿ôPATH¤ÎÃͤò»ÈÍѤ¹¤ë¡¥¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç
- ¤Ï¥Ñ¥¹¤ò´Þ¤à¥Õ¥¡¥¤¥ë̾¡¤¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ïnil¤òÊÖ¤¹¡¥
+ メソッドåã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼ŒModule#methods, #singleton_methods
+ ãªã©ãŒSymbolã‚’è¿”ã™ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-with_config(withval[, default=nil])
+HAVE_RUBY_*_H ::
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--with-<withval>¤Ç»ØÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥óÃͤòÆÀ¤ë¡¥
+ ruby.h ã§å®šç¾©ã•れã¦ã„る.対応ã™ã‚‹ãƒ˜ãƒƒãƒ€ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨
+ ã‚’æ„味ã™ã‚‹ï¼ŽãŸã¨ãˆã°ï¼ŒHAVE_RUBY_ST_H ãŒå®šç¾©ã•れã¦ã„ã‚‹å ´åˆã¯
+ å˜ãªã‚‹ st.h ã§ã¯ãªã ruby/st.h を使用ã™ã‚‹ï¼Ž
-enable_config(config, *defaults)
-disable_config(config, *defaults)
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--enable-<config>¤Þ¤¿¤Ï
- --disable-<config>¤Ç»ØÄꤵ¤ì¤¿¿¿µ¶ÃͤòÆÀ¤ë¡¥
- --enable-<config>¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ïtrue¡¤
- --disable-<config>¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤Ïfalse¤òÊÖ¤¹¡¥
- ¤É¤Á¤é¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¤¥Ö¥í¥Ã¥¯¤Ä¤­¤Ç¸Æ¤Ó½Ð¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
- *defaults¤òyield¤·¤¿·ë²Ì¡¤¥Ö¥í¥Ã¥¯¤Ê¤·¤Ê¤é*defaults¤òÊÖ¤¹¡¥
+ rb_add_event_hook() ãŒãƒ•ãƒƒã‚¯é–¢æ•°ã«æ¸¡ã™ data を第3引数ã¨ã—ã¦
+ å—ã‘å–ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
-dir_config(target[, default_dir])
-dir_config(target[, default_include, default_lib])
+= Appendix C. extconf.rbã§ä½¿ãˆã‚‹é–¢æ•°ãŸã¡
- ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Î--with-<target>-dir, --with-<target>-include,
- --with-<target>-lib¤Î¤¤¤º¤ì¤«¤Ç»ØÄꤵ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò
- $CFLAGS ¤ä $LDFLAGS ¤ËÄɲ乤롥--with-<target>-dir=/path¤Ï
+extconf.rbã®ä¸­ã§ã¯åˆ©ç”¨å¯èƒ½ãªã‚³ãƒ³ãƒ‘イルæ¡ä»¶ãƒã‚§ãƒƒã‚¯ã®é–¢æ•°ã¯ä»¥
+下ã®é€šã‚Šã§ã‚る.
+
+have_macro(macro, headers) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦ãƒžã‚¯ãƒ­macroãŒå®šç¾©ã•
+ れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„る時true
+ ã‚’è¿”ã™ï¼Ž
+
+have_library(lib, func) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+ ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«è¿½åŠ ã—,trueã‚’è¿”ã™ï¼Ž
+
+find_library(lib, func, path...) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ -Lpath を追加
+ ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«
+ 追加ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_func(func, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦é–¢æ•°funcã®å­˜åœ¨ã‚’ãƒã‚§
+ ックã™ã‚‹ï¼ŽfuncãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§
+ ã‚る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠ
+ ã事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{FUNC}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_var(var, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦å¤‰æ•°varã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒ
+ クã™ã‚‹ï¼ŽvarãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§ã‚
+ る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠã
+ 事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{VAR}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_header(header) ::
+
+ ヘッダファイルã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ
+ プリプロセッサマクロ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+find_header(header, path...) ::
+
+ ヘッダファイルheaderã®å­˜åœ¨ã‚’ -Ipath を追加ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯
+ ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+have_struct_member(type, member[, header[, opt]]) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå®šç¾©ã•れ,
+ ãªãŠã‹ã¤ãƒ¡ãƒ³ãƒmemberãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«
+ æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ `HAVE_{TYPE}_{MEMBER}` ã‚’
+ 定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_type(type, header, opt) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’
+ ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_TYPE_{TYPE}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+check_sizeof(type, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeã®charå˜ä½ã‚µã‚¤
+ ズを調ã¹ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `SIZEOF_{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])
+ ã¨ç­‰ä¾¡ã§ã‚る.追加ã•れ㟠include ディレクトリ㨠lib ディレ
+ クトリã®é…列を返ã™ï¼Ž ([include_dir, lib_dir])
+
+pkg_config(pkg, option=nil) ::
+
+ pkg-configコマンドã‹ã‚‰ãƒ‘ッケージpkgã®æƒ…報を [cflags, ldflags, libs]
+ ã®é…列ã¨ã—ã¦å¾—る.$CFLAGS, $LDFLAGS, $libs ã«ã¯ãれãžã‚Œã®å€¤ãŒ
+ 追加ã•れる.
+
+ pkg-configã®å®Ÿéš›ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ï¼Œä»¥ä¸‹ã®é †ã§è©¦ã•れる.
+
+ 1. コマンドラインã§--with-{pkg}-config={command}オプションãŒ
+ 指定ã•れãŸå ´åˆ: {command} {option}
+ 2. {pkg}-config {option}
+ 3. pkg-config {option} {pkg}
+
+ optionãŒæŒ‡å®šã•れãŸå ´åˆã¯ï¼Œä¸Šè¨˜ã®é…列ã®ä»£ã‚りã«ãã®ã‚ªãƒ—ションを
+ 指定ã—ã¦å¾—られãŸå‡ºåŠ›ã‚’stripã—ãŸã‚‚ã®ã‚’è¿”ã™ï¼Ž
+
+= Appendix D. 世代別GC
+
+Ruby 2.1ã‹ã‚‰ä¸–代別GCã«å¯¾å¿œã—ã¾ã—ãŸï¼Žæˆ‘々ã¯ã“れをRGenGCã¨å‘¼ã‚“ã§ã„ã¾ã™ï¼Ž
+RGenGCã¯ï¼ŒéŽåŽ»ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ï¼ˆã»ã¼ï¼‰äº’æ›æ€§ã‚’ä¿ã¤ã‚ˆã†ã«é–‹ç™ºã•れã¦ã„ã‚‹
+ãŸã‚,拡張ライブラリå´ã®å¯¾å¿œã¯ã»ã¼ä¸è¦ã§ã™ï¼Ž
+
+ãŸã ã—,対応をã™ã‚‹ã“ã¨ã§æ€§èƒ½ã‚’å‘上ã™ã‚‹ã“ã¨ãŒã§ãã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼Žã‚‚ã—
+拡張ライブラリã«é«˜ã„性能ãŒå¿…è¦ã§ã‚ã‚‹å ´åˆã¯å¯¾å¿œã‚’検討ã—ã¦ä¸‹ã•ã„.
-pkg_config(pkg)
+ã¨ãã«RARRAY_PTR()/RHASH_TBL()ã®ã‚ˆã†ãªãƒžã‚¯ãƒ­ã‚’用ã„ã¦ãƒã‚¤ãƒ³ã‚¿ã«ç›´æŽ¥ã‚¢ã‚¯ã‚»
+スã™ã‚‹ã‚ˆã†ãªã‚³ãƒ¼ãƒ‰ã¯æ›¸ã‹ãªã„よã†ã«ã—ã¦ä¸‹ã•ã„.代ã‚りã«ï¼Œrb_ary_aref(),
+rb_ary_store() ãªã©ã®ï¼Œé©åˆ‡ãª API 関数を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
- pkg-config¥³¥Þ¥ó¥É¤«¤é¥Ñ¥Ã¥±¡¼¥¸pkg¤Î¾ðÊó¤òÆÀ¤ë¡¥
- pkg-config¤Î¼ÂºÝ¤Î¥³¥Þ¥ó¥É̾¤Ï¡¤--with-pkg-config¥³¥Þ¥ó¥É
- ¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤Ç»ØÄê²Äǽ¡¥
+ãã®ã»ã‹ï¼Œå¯¾å¿œã«ã¤ã„ã¦ã®è©³ç´°ã¯ README.EXT ã®ã€ŒAppendix D. Generational
+GCã€ã‚’å‚ç…§ã—ã¦ä¸‹ã•ã„.
/*
* Local variables:
diff --git a/README.ja b/README.ja
deleted file mode 100644
index 71ce4ee12c..0000000000
--- a/README.ja
+++ /dev/null
@@ -1,164 +0,0 @@
-* Ruby¤È¤Ï
-
-Ruby¤Ï¥·¥ó¥×¥ë¤«¤Ä¶¯ÎϤʥª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¹¥¯¥ê¥×¥È¸À¸ì¤Ç¤¹¡¥
-Ruby¤ÏºÇ½é¤«¤é½ã¿è¤Ê¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¸À¸ì¤È¤·¤ÆÀ߷פµ¤ì¤Æ¤¤¤Þ
-¤¹¤«¤é¡¤¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥×¥í¥°¥é¥ß¥ó¥°¤ò¼ê·Ú¤Ë¹Ô¤¦»ö¤¬½ÐÍè¤Þ
-¤¹¡¥¤â¤Á¤í¤óÄ̾ï¤Î¼ê³¤­·¿¤Î¥×¥í¥°¥é¥ß¥ó¥°¤â²Äǽ¤Ç¤¹¡¥
-
-Ruby¤Ï¥Æ¥­¥¹¥È½èÍý´Ø·¸¤ÎǽÎϤʤɤËÍ¥¤ì¡¤Perl¤ÈƱ¤¸¤¯¤é¤¤¶¯ÎÏ
-¤Ç¤¹¡¥¤µ¤é¤Ë¥·¥ó¥×¥ë¤Êʸˡ¤È¡¤Îã³°½èÍý¤ä¥¤¥Æ¥ì¡¼¥¿¤Ê¤É¤Îµ¡¹½
-¤Ë¤è¤Ã¤Æ¡¤¤è¤êʬ¤«¤ê¤ä¤¹¤¤¥×¥í¥°¥é¥ß¥ó¥°¤¬½ÐÍè¤Þ¤¹¡¥
-
-
-* Ruby¤ÎÆÃĹ
-
- + ¥·¥ó¥×¥ë¤Êʸˡ
- + ÉáÄ̤Υª¥Ö¥¸¥§¥¯¥È»Ø¸þµ¡Ç½(¥¯¥é¥¹¡¤¥á¥½¥Ã¥É¥³¡¼¥ë¤Ê¤É)
- + ÆÃ¼ì¤Ê¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þµ¡Ç½(Mixin, ÆÃ°Û¥á¥½¥Ã¥É¤Ê¤É)
- + ±é»»»Ò¥ª¡¼¥Ð¡¼¥í¡¼¥É
- + Îã³°½èÍýµ¡Ç½
- + ¥¤¥Æ¥ì¡¼¥¿¤È¥¯¥í¡¼¥¸¥ã
- + ¥¬¡¼¥Ù¡¼¥¸¥³¥ì¥¯¥¿
- + ¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥Ç¥£¥ó¥° (¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤ë)
- + °Ü¿¢À­¤¬¹â¤¤¡¥Â¿¤¯¤ÎUNIX¾å¤Çư¤¯¤À¤±¤Ç¤Ê¤¯¡¤DOS¤äWindows¡¤
- Mac¡¤BeOS¤Ê¤É¤Î¾å¤Ç¤âư¤¯
-
-
-* Æþ¼êË¡
-
-** FTP¤Ç
-
-°Ê²¼¤Î¾ì½ê¤Ë¤ª¤¤¤Æ¤¢¤ê¤Þ¤¹¡¥
-
- ftp://ftp.ruby-lang.org/pub/ruby/
-
-** Subversion¤Ç
-
-ËÜ¥Ö¥é¥ó¥Á¤ÎRuby¤ÎºÇ¿·¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤Þ¤¹¡¥
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8/
-
-³«È¯Àèü¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¼èÆÀ¤Ç¤­¤Þ¤¹¡¥
-
- $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-
-¾¤Ë³«È¯Ãæ¤Î¥Ö¥é¥ó¥Á¤Î°ìÍ÷¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤Ç¸«¤é¤ì¤Þ¤¹¡¥
-
- $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
-
-
-* ¥Û¡¼¥à¥Ú¡¼¥¸
-
-Ruby¤Î¥Û¡¼¥à¥Ú¡¼¥¸¤ÎURL¤Ï
-
- http://www.ruby-lang.org/
-
-¤Ç¤¹¡¥
-
-
-* ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È
-
-Ruby¤Î¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤¬¤¢¤ê¤Þ¤¹¡£»²²Ã´õ˾¤ÎÊý¤Ï
-
- ruby-list-ctl@ruby-lang.org
-
-¤Þ¤ÇËÜʸ¤Ë
-
- subscribe YourFirstName YourFamilyName
-
-¤È½ñ¤¤¤ÆÁ÷¤Ã¤Æ²¼¤µ¤¤¡£
-
-Ruby³«È¯¼Ô¸þ¤±¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤â¤¢¤ê¤Þ¤¹¡£¤³¤Á¤é¤Ç¤Ïruby¤Î¥Ð
-¥°¡¢¾­Íè¤Î»ÅÍͳÈÄ¥¤Ê¤É¼ÂÁõ¾å¤ÎÌäÂê¤Ë¤Ä¤¤¤ÆµÄÏÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-»²²Ã´õ˾¤ÎÊý¤Ï
-
- 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¥ª¥×¥·¥ç¥ó¤Ç optflags=.. warnflags=.. Åù
- ¤Ç¾å½ñ¤­¤Ç¤­¤Þ¤¹¡¥
-
- 3. (ɬÍפʤé¤Ð)defines.h¤òÊÔ½¸¤¹¤ë
-
- ¿ʬ¡¤É¬Í×̵¤¤¤È»×¤¤¤Þ¤¹¡¥
-
- 4. (ɬÍפʤé¤Ð)ext/Setup¤ËÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë³ÈÄ¥¥â¥¸¥å¡¼¥ë¤ò
- »ØÄꤹ¤ë
-
- ext/Setup¤Ëµ­½Ò¤·¤¿¥â¥¸¥å¡¼¥ë¤ÏÀÅŪ¤Ë¥ê¥ó¥¯¤µ¤ì¤Þ¤¹¡¥
-
- ¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥Ç¥£¥ó¥°¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥¢¡¼¥­¥Æ¥¯
- ¥Á¥ã¤Ç¤ÏSetup¤Î1¹ÔÌܤΡÖoption nodynamic¡×¤È¤¤¤¦¹Ô¤Î¥³
- ¥á¥ó¥È¤ò³°¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤¤³¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç
- ³ÈÄ¥¥â¥¸¥å¡¼¥ë¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤¤¢¤é¤«¤¸¤áÀÅŪ¤Ë¥ê¥ó
- ¥¯¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
-
- 5. make¤ò¼Â¹Ô¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë
-
- 6. make test¤Ç¥Æ¥¹¥È¤ò¹Ô¤¦¡¥
-
- ¡Ötest succeeded¡×¤Èɽ¼¨¤µ¤ì¤ì¤ÐÀ®¸ù¤Ç¤¹¡¥¤¿¤À¤·¥Æ¥¹¥È
- ¤ËÀ®¸ù¤·¤Æ¤â´°àú¤À¤ÈÊݾڤµ¤ì¤Æ¤¤¤ëÌõ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¥
-
- 7. make install
-
- root¤Çºî¶È¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡¥
-
-¤â¤·¡¤¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Î¥í¥°¤È¥Þ
-¥·¥ó¡¤OS¤Î¼ïÎà¤ò´Þ¤à¤Ç¤­¤ë¤À¤±¾Ü¤·¤¤¥ì¥Ý¡¼¥È¤òºî¼Ô¤ËÁ÷¤Ã¤Æ¤¯
-¤À¤µ¤ë¤È¾¤ÎÊý¤Î¤¿¤á¤Ë¤â¤Ê¤ê¤Þ¤¹¡¥
-
-
-* °Ü¿¢
-
-UNIX¤Ç¤¢¤ì¤Ðconfigure¤¬¤Û¤È¤ó¤É¤Îº¹°Û¤òµÛ¼ý¤·¤Æ¤¯¤ì¤ë¤Ï¤º¤Ç
-¤¹¤¬¡¤»×¤ï¤Ì¸«Íî¤È¤·¤¬¤¢¤Ã¤¿¾ì¹ç(¤¢¤ë¤Ë°ã¤¤¤Ê¤¤)¡¤ºî¼Ô¤Ë¤½¤Î
-¤³¤È¤ò¥ì¥Ý¡¼¥È¤¹¤ì¤Ð¡¤²ò·è¤Ç¤­¤ë¤«¤âÃΤì¤Þ¤»¤ó¡¥
-
-¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤â¤Ã¤È¤â°Í¸¤¹¤ë¤Î¤ÏGCÉô¤Ç¤¹¡¥Ruby¤ÎGC¤ÏÂоÝ
-¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤¬setjmp()¤Ë¤è¤Ã¤ÆÁ´¤Æ¤Î¥ì¥¸¥¹¥¿¤ò jmp_buf¤Ë
-³ÊǼ¤¹¤ë¤³¤È¤È¡¤jmp_buf¤È¥¹¥¿¥Ã¥¯¤¬32bit¥¢¥é¥¤¥ó¥á¥ó¥È¤µ¤ì¤Æ
-¤¤¤ë¤³¤È¤ò²¾Äꤷ¤Æ¤¤¤Þ¤¹¡¥ÆÃ¤ËÁ°¼Ô¤¬À®Î©¤·¤Ê¤¤¾ì¹ç¤ÎÂбþ¤ÏÈó
-¾ï¤Ëº¤Æñ¤Ç¤·¤ç¤¦¡¥¸å¼Ô¤Î²ò·è¤ÏÈæ³ÓŪ´Êñ¤Ç¡¤gc.c¤Ç¥¹¥¿¥Ã¥¯¤ò
-¥Þ¡¼¥¯¤·¤Æ¤¤¤ëÉôʬ¤Ë¥¢¥é¥¤¥ó¥á¥ó¥È¤Î¥Ð¥¤¥È¿ô¤À¤±¤º¤é¤·¤Æ¥Þ¡¼
-¥¯¤¹¤ë¥³¡¼¥É¤òÄɲ乤ë¤À¤±¤ÇºÑ¤ß¤Þ¤¹¡¥¡Ödefined(THINK_C)¡×¤Ç
-³ç¤é¤ì¤Æ¤¤¤ëÉôʬ¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤
-
-# ¼ÂºÝ¤Ë¤ÏRuby¤ÏThink C¤Ç¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤Þ¤»¤ó¡¥
-
-¥ì¥¸¥¹¥¿¥¦¥£¥ó¥É¥¦¤ò»ý¤ÄCPU¤Ç¤Ï¡¤¥ì¥¸¥¹¥¿¥¦¥£¥ó¥É¥¦¤ò¥¹¥¿¥Ã
-¥¯¤Ë¥Õ¥é¥Ã¥·¥å¤¹¤ë¥¢¥»¥ó¥Ö¥é¥³¡¼¥É¤òÄɲ乤ëɬÍפ¬¤¢¤ë¤«¤âÃÎ
-¤ì¤Þ¤»¤ó¡¥
-
-
-* ÇÛÉÛ¾ò·ï
-
-COPYING.ja¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-
-* Ãø¼Ô
-
-¥³¥á¥ó¥È¡¤¥Ð¥°¥ì¥Ý¡¼¥È¤½¤Î¾¤Ï matz@netlab.jp ¤Þ¤Ç¡¥
--------------------------------------------------------
-created at: Thu Aug 3 11:57:36 JST 1995
-Local variables:
-mode: indented-text
-end:
diff --git a/README.ja.md b/README.ja.md
new file mode 100644
index 0000000000..1e9bae7e0c
--- /dev/null
+++ b/README.ja.md
@@ -0,0 +1,163 @@
+# 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}/${PLATFOR
+ M}`
+ * `${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}/${P
+ LATFORM}`
+ * `${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` ファイルをå‚ç…§ã—ã¦ãã ã•ã„。
+
+## 著者
+
+コメント,ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆãã®ä»–㯠mailto:matz@ruby-lang.org ã¾ã§ï¼Ž
+---
+created at: Thu Aug 3 11:57:36 JST 1995
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..c6498a8cca
--- /dev/null
+++ b/README.md
@@ -0,0 +1,161 @@
+# 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
+
+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 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 the 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 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}/${PLATFOR
+ M}`
+ * `${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}/${P
+ LATFORM}`
+ * `${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
+
+## The Author
+
+Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in
+1995.
+
+<mailto:matz@ruby-lang.org>
diff --git a/ToDo b/ToDo
deleted file mode 100644
index b55e399edf..0000000000
--- a/ToDo
+++ /dev/null
@@ -1,126 +0,0 @@
-Language Spec.
-
-- Class#allocate - basicNew
-- class Foo::Bar<Baz .. end, module Boo::Bar .. end
-* operator !! for rescue. ???
-* objectify characters
-* ../... outside condition invokes operator method too.
-* ... inside condition turns off just before right condition.???
-* package or access control for global variables??
-* named arguments like foo(nation:="german") or foo(nation: "german").
-* method to retrieve argument information (needs new C API)
-* multiple return values, yield values. maybe incompatible ???
-* cascading method invocation ???
-* def Class#method .. end ??
-* def Foo::Bar::baz() .. end ??
-* I18N (or M17N) script/string/regexp
-* Fixnum 0 as false ????
-* discourage use of symbol variables (e.g. $/, etc.) in manual
-* discourage use of Perlish features by giving warnings.
-* non confusing in-block local variable (is it possible?)
- + remove scope by block
- + variables appears within block may have independent values.
-* Regexp: make /o thread safe.
-* decide whether begin with rescue or ensure make do..while loop.
-* a +1 to be a+1, not a(+1).
-* unify == and eql? again
-* to_i returns nil if str contains no digit.
-* raise exception by `` error
-* jar like combined library package. -> RubyGems?
-* resumable Exception via Exception#resume.
-* method combination, e.g. before, after, around, etc.
-* .. or something like defadvice in Emacs.
-* property - for methods, or for objects in general.
-* "in" modifier, to annotate, or to encourage assertion.
-* selector namespace - something like generic-flet in CLOS, to help RubyBehavior
-* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
-* warn/error "bare word" method, like "foo", you should type "foo()"
-* clarify evaluation order of operator argument (=~, .., ...)
-* :symbol => value hash in the form of {symbol: value, ...} ??
-
-Hacking Interpreter
-
-- generational GC
-* non-blocking open (e.g. for named pipe) for thread
-* avoid blocking with gethostbyname/gethostbyaddr (use fork ???)
-* objectify interpreters ???
-* remove rb_eval() recursions
-* syntax tree -> bytecode ???
-* scrambled script, or script filter
-* setuid ruby
-* performance tune for in-block (dynamic) local variables.
-* give warnings to assign magic variables.
-* export rb_io_{addstr,printf,puts,print}
-* autoload should work with threads [ruby-talk:4589]
-* remove stdio dependency from IOs.
-* warn for inconsistent local variable usage (lv m and method m at the same time).
-* MicroRuby
-* Built-in Interactive Ruby.
-* Parser API
-* trap every method invocation, which can be enabled by e.g. trap_call :method.
-* unify Errno exceptions of same errno, or new exception comparison scheme.
-* 2.times{|i| if i==0 then a = 15 else puts eval("a") end} should print nil.
-* Thread#max_stack_size attribute (possible??)
-
-Standard Libraries
-
-- Module#define_method which takes a name and a body (block, proc or method).
-- Enume#inject
-- Array#fetch
-- IO::for_fd
-- Process::waitall [ruby-talk:4557]
-- Process::Status
-- File::lchown, File::lchmod; xxx - still need work for non existing platforms
-- move Time::times to Process.
-- Enumerable#sort_by for Schwartzian transformation
-- fork_and_kill_other_threads.
-- signal list (Signal::trap, Signal::list).
-- move NameError under StandardError.
-- Integer#to_s(base)
-- Hash::new{default}
-- hash etc. should handle self referenceing array/hash
-- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
-- use Mersenne Twister RNG for random.
-- deprecate Array#indexes, and Array#indices.
-- remove dependency on MAXPATHLEN.
-* String#scanf(?)
-* Object#fmt(?)
-* Time::strptime
-* Integer[num], Float[num]; Fixnum[num]?
-* method to retrieve non-number trailer for to_i/to_f.
-* Stream or Port, abstract superclass of IO ?
-* String#{pred,prev}, String#downto
-* optional stepsize argument for succ()
-* Ruby module -- Ruby::Version, Ruby::Interpreter
-* introduce Boolean class; super of TrueClass, FalseClass
-* synchronized method - synchronized{...}, synchronized :foo, :bar
-* Array#&, Array#| to allow duplication. ???
-* way to specify immortal (fork endurance) thread;
-* or raise ForkException to every thread but fork caller.
-* new user-defined marshal scheme. _dump(dumper), _load(restorer)
-* library to load per-user profile seeking .ruby_profile or ruby.ini file.
-* warning framework (warn, warning for Ruby level)
-* marshal should not depend on sprintf (works bad with locale).
-* ternary arg pow: a.pow(b,c) == a**b%c
-* new caller(), e.g. call_stack; needs better name.
-* pointer share mechanism similar to one in String for Array.
-* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
-* save both "feature names" and "normalized path" in $"
-* implement Mutex_m (or MutexMixin) using Mutex.
-
-Extension Libraries
-
-* ptk.rb pTk wrapper that is compatible to tk.rb
-* Berkeley DB extension
-* BitVector
-* thread-safe fcgi
-
-Ruby Libraries
-
-* urllib.rb, nttplib.rb, etc.
-* format like perl's
-
-Tools
-
-* freeze or undump to bundle everything
-* bundle using zlib
diff --git a/addr2line.c b/addr2line.c
new file mode 100644
index 0000000000..c8faf48d62
--- /dev/null
+++ b/addr2line.c
@@ -0,0 +1,1208 @@
+/**********************************************************************
+
+ addr2line.c -
+
+ $Author$
+
+ Copyright (C) 2010 Shinichiro Hamaji
+
+**********************************************************************/
+
+#include "ruby/config.h"
+#include "ruby/missing.h"
+#include "addr2line.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef USE_ELF
+
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#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
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
+
+#ifdef HAVE_DLADDR
+# include <dlfcn.h>
+#endif
+
+#define DW_LNS_copy 0x01
+#define DW_LNS_advance_pc 0x02
+#define DW_LNS_advance_line 0x03
+#define DW_LNS_set_file 0x04
+#define DW_LNS_set_column 0x05
+#define DW_LNS_negate_stmt 0x06
+#define DW_LNS_set_basic_block 0x07
+#define DW_LNS_const_add_pc 0x08
+#define DW_LNS_fixed_advance_pc 0x09
+#define DW_LNS_set_prologue_end 0x0a /* DWARF3 */
+#define DW_LNS_set_epilogue_begin 0x0b /* DWARF3 */
+#define DW_LNS_set_isa 0x0c /* DWARF3 */
+
+/* Line number extended opcode name. */
+#define DW_LNE_end_sequence 0x01
+#define DW_LNE_set_address 0x02
+#define DW_LNE_define_file 0x03
+#define DW_LNE_set_discriminator 0x04 /* DWARF4 */
+
+#ifndef ElfW
+# if SIZEOF_VOIDP == 8
+# define ElfW(x) Elf64##_##x
+# else
+# 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;
+};
+
+/* Avoid consuming stack as this module may be used from signal handler */
+static char binary_filename[PATH_MAX];
+
+static unsigned long
+uleb128(char **p)
+{
+ unsigned long r = 0;
+ int s = 0;
+ for (;;) {
+ unsigned char b = *(unsigned char *)(*p)++;
+ if (b < 0x80) {
+ r += (unsigned long)b << s;
+ break;
+ }
+ r += (b & 0x7f) << s;
+ s += 7;
+ }
+ return r;
+}
+
+static long
+sleb128(char **p)
+{
+ long r = 0;
+ int s = 0;
+ for (;;) {
+ unsigned char b = *(unsigned char *)(*p)++;
+ if (b < 0x80) {
+ if (b & 0x40) {
+ r -= (0x80 - b) << s;
+ }
+ else {
+ r += (b & 0x3f) << s;
+ }
+ break;
+ }
+ r += (b & 0x7f) << s;
+ s += 7;
+ }
+ return r;
+}
+
+static const char *
+get_nth_dirname(unsigned long dir, char *p)
+{
+ if (!dir--) {
+ return "";
+ }
+ while (dir--) {
+ while (*p) p++;
+ p++;
+ if (!*p) {
+ kprintf("Unexpected directory number %lu in %s\n",
+ dir, binary_filename);
+ return "";
+ }
+ }
+ return p;
+}
+
+static void
+fill_filename(int file, char *include_directories, char *filenames,
+ line_info_t *line)
+{
+ int i;
+ char *p = filenames;
+ char *filename;
+ unsigned long dir;
+ for (i = 1; i <= file; i++) {
+ filename = p;
+ if (!*p) {
+ /* Need to output binary file name? */
+ kprintf("Unexpected file number %d in %s\n",
+ file, binary_filename);
+ return;
+ }
+ while (*p) p++;
+ p++;
+ dir = uleb128(&p);
+ /* last modified. */
+ uleb128(&p);
+ /* size of the file. */
+ uleb128(&p);
+
+ if (i == file) {
+ line->filename = filename;
+ line->dirname = get_nth_dirname(dir, include_directories);
+ }
+ }
+}
+
+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)
+{
+ int i;
+ addr += obj->base_addr;
+ for (i = offset; i < num_traces; i++) {
+ uintptr_t a = (uintptr_t)traces[i];
+ /* 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) {
+ fill_filename(file, include_directories, filenames, &lines[i]);
+ lines[i].line = 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)
+{
+ char *p, *cu_end, *cu_start, *include_directories, *filenames;
+ unsigned long unit_length;
+ int default_is_stmt, line_base;
+ unsigned int header_length, minimum_instruction_length, line_range,
+ opcode_base;
+ /* unsigned char *standard_opcode_lengths; */
+
+ /* The registers. */
+ unsigned long addr = 0;
+ unsigned int file = 1;
+ unsigned int line = 1;
+ /* unsigned int column = 0; */
+ int is_stmt;
+ /* int basic_block = 0; */
+ /* int end_sequence = 0; */
+ /* int prologue_end = 0; */
+ /* int epilogue_begin = 0; */
+ /* unsigned int isa = 0; */
+
+ p = *debug_line;
+
+ unit_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
+ if (unit_length == 0xffffffff) {
+ unit_length = *(unsigned long *)p;
+ p += sizeof(unsigned long);
+ }
+
+ cu_end = p + unit_length;
+
+ /*dwarf_version = *(unsigned short *)p;*/
+ p += 2;
+
+ header_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
+
+ cu_start = p + header_length;
+
+ minimum_instruction_length = *(unsigned char *)p;
+ p++;
+
+ is_stmt = default_is_stmt = *(unsigned char *)p;
+ p++;
+
+ line_base = *(signed char *)p;
+ p++;
+
+ line_range = *(unsigned char *)p;
+ p++;
+
+ opcode_base = *(unsigned char *)p;
+ p++;
+
+ /* standard_opcode_lengths = (unsigned char *)p - 1; */
+ p += opcode_base - 1;
+
+ include_directories = p;
+
+ /* skip include directories */
+ while (*p) {
+ while (*p) p++;
+ p++;
+ }
+ p++;
+
+ filenames = p;
+
+ p = cu_start;
+
+#define FILL_LINE() \
+ do { \
+ fill_line(num_traces, traces, addr, file, line, \
+ include_directories, filenames, \
+ obj, lines, offset); \
+ /*basic_block = prologue_end = epilogue_begin = 0;*/ \
+ } while (0)
+
+ while (p < cu_end) {
+ unsigned long a;
+ unsigned char op = *p++;
+ switch (op) {
+ case DW_LNS_copy:
+ FILL_LINE();
+ break;
+ case DW_LNS_advance_pc:
+ a = uleb128(&p);
+ addr += a;
+ break;
+ case DW_LNS_advance_line: {
+ long a = sleb128(&p);
+ line += a;
+ break;
+ }
+ case DW_LNS_set_file:
+ file = (unsigned int)uleb128(&p);
+ break;
+ case DW_LNS_set_column:
+ /*column = (unsigned int)*/(void)uleb128(&p);
+ break;
+ case DW_LNS_negate_stmt:
+ is_stmt = !is_stmt;
+ break;
+ case DW_LNS_set_basic_block:
+ /*basic_block = 1; */
+ break;
+ case DW_LNS_const_add_pc:
+ a = ((255 - opcode_base) / line_range) *
+ minimum_instruction_length;
+ addr += a;
+ break;
+ case DW_LNS_fixed_advance_pc:
+ a = *(unsigned char *)p++;
+ addr += a;
+ break;
+ case DW_LNS_set_prologue_end:
+ /* prologue_end = 1; */
+ break;
+ case DW_LNS_set_epilogue_begin:
+ /* epilogue_begin = 1; */
+ break;
+ case DW_LNS_set_isa:
+ /* isa = (unsigned int)*/(void)uleb128(&p);
+ break;
+ case 0:
+ a = *(unsigned char *)p++;
+ op = *p++;
+ switch (op) {
+ case DW_LNE_end_sequence:
+ /* end_sequence = 1; */
+ FILL_LINE();
+ addr = 0;
+ file = 1;
+ line = 1;
+ /* column = 0; */
+ is_stmt = default_is_stmt;
+ /* end_sequence = 0; */
+ /* isa = 0; */
+ break;
+ case DW_LNE_set_address:
+ addr = *(unsigned long *)p;
+ p += sizeof(unsigned long);
+ break;
+ case DW_LNE_define_file:
+ kprintf("Unsupported operation in %s\n",
+ binary_filename);
+ break;
+ case DW_LNE_set_discriminator:
+ /* TODO:currently ignore */
+ uleb128(&p);
+ break;
+ default:
+ kprintf("Unknown extended opcode: %d in %s\n",
+ op, binary_filename);
+ }
+ break;
+ default: {
+ unsigned long addr_incr;
+ unsigned long line_incr;
+ a = op - opcode_base;
+ addr_incr = (a / line_range) * minimum_instruction_length;
+ line_incr = line_base + (a % line_range);
+ addr += (unsigned int)addr_incr;
+ line += (unsigned int)line_incr;
+ FILL_LINE();
+ }
+ }
+ }
+ *debug_line = p;
+}
+
+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_end = debug_line + size;
+ while (debug_line < debug_line_end) {
+ parse_debug_line_cu(num_traces, traces, &debug_line, obj, lines, offset);
+ }
+ if (debug_line != debug_line_end) {
+ kprintf("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;
+}
+
+static void
+follow_debuglink(char *debuglink, int num_traces, void **traces,
+ obj_info_t **objp, line_info_t *lines, int offset)
+{
+ /* 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) {
+ return;
+ }
+ p[1] = '\0';
+
+ 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);
+}
+
+/* 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)
+{
+ int i, j;
+ char *shstr;
+ char *section_name;
+ ElfW(Ehdr) *ehdr;
+ ElfW(Shdr) *shdr, *shstr_shdr;
+ ElfW(Shdr) *debug_line_shdr = NULL, *gnu_debuglink_shdr = NULL;
+ 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;
+ }
+ filesize = lseek(fd, 0, SEEK_END);
+ if (filesize < 0) {
+ int e = errno;
+ close(fd);
+ kprintf("lseek: %s\n", strerror(e));
+ goto fail;
+ }
+#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;
+ }
+#endif
+ lseek(fd, 0, SEEK_SET);
+ /* async-signal unsafe */
+ file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0);
+ if (file == MAP_FAILED) {
+ int e = errno;
+ close(fd);
+ kprintf("mmap: %s\n", strerror(e));
+ goto fail;
+ }
+
+ ehdr = (ElfW(Ehdr) *)file;
+ if (memcmp(ehdr->e_ident, "\177ELF", 4) != 0) {
+ /*
+ * Huh? Maybe filename was overridden by setproctitle() and
+ * it match non-elf file.
+ */
+ close(fd);
+ goto fail;
+ }
+
+ obj->fd = fd;
+ obj->mapped = file;
+ obj->mapped_size = (size_t)filesize;
+
+ shdr = (ElfW(Shdr) *)(file + ehdr->e_shoff);
+
+ shstr_shdr = shdr + ehdr->e_shstrndx;
+ shstr = file + shstr_shdr->sh_offset;
+
+ 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;
+ 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;
+ }
+ }
+ }
+
+ if (!debug_line_shdr) {
+ /* This file doesn't have .debug_line section,
+ 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);
+ }
+ goto finish;
+ }
+
+ 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;
+}
+
+#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)
+{
+ 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;
+ }
+ len--; /* sysctl sets strlen+1 */
+ return len;
+}
+#else
+#undef HAVE_MAIN_EXE_PATH
+#endif
+
+void
+rb_dump_backtrace_with_lines(int num_traces, void **traces)
+{
+ 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;
+ }
+ }
+ }
+#endif
+
+ /* fill source lines by reading dwarf */
+ 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;
+ }
+ }
+ *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);
+ }
+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);
+ }
+ 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
new file mode 100644
index 0000000000..d99f010934
--- /dev/null
+++ b/addr2line.h
@@ -0,0 +1,21 @@
+/**********************************************************************
+
+ addr2line.h -
+
+ $Author$
+
+ Copyright (C) 2010 Shinichiro Hamaji
+
+**********************************************************************/
+
+#ifndef RUBY_ADDR2LINE_H
+#define RUBY_ADDR2LINE_H
+
+#ifdef USE_ELF
+
+void
+rb_dump_backtrace_with_lines(int num_traces, void **traces);
+
+#endif /* USE_ELF */
+
+#endif /* RUBY_ADDR2LINE_H */
diff --git a/array.c b/array.c
index 89f74d01ff..28e43c68c0 100644
--- a/array.c
+++ b/array.c
@@ -3,164 +3,505 @@
array.c -
$Author$
- $Date$
created at: Fri Aug 6 09:46:12 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby.h"
-#include "util.h"
-#include "st.h"
+#include "internal.h"
+#include "ruby/util.h"
+#include "ruby/st.h"
+#include "probes.h"
+#include "id.h"
+
+#ifndef ARRAY_DEBUG
+# define NDEBUG
+#endif
+#include <assert.h>
VALUE rb_cArray;
-static ID id_cmp;
+
+static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
-#define ARY_MAX_SIZE (LONG_MAX / sizeof(VALUE))
+#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
+
+# define ARY_SHARED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary),ELTS_SHARED)!=0)
+# define ARY_EMBED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
+
+#define ARY_HEAP_PTR(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.ptr)
+#define ARY_HEAP_LEN(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.len)
+#define ARY_EMBED_PTR(a) (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary)
+#define ARY_EMBED_LEN(a) \
+ (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)); \
+ FL_SET((a), RARRAY_EMBED_FLAG); \
+} while (0)
+#define FL_UNSET_EMBED(ary) FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
+#define FL_SET_SHARED(ary) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ FL_SET((ary), ELTS_SHARED); \
+} while (0)
+#define FL_UNSET_SHARED(ary) FL_UNSET((ary), ELTS_SHARED)
+
+#define ARY_SET_PTR(ary, p) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.ptr = (p); \
+} while (0)
+#define ARY_SET_EMBED_LEN(ary, n) do { \
+ long tmp_n = (n); \
+ assert(ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK; \
+ RBASIC(ary)->flags |= (tmp_n) << RARRAY_EMBED_LEN_SHIFT; \
+} while (0)
+#define ARY_SET_HEAP_LEN(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ RARRAY(ary)->as.heap.len = (n); \
+} while (0)
+#define ARY_SET_LEN(ary, n) do { \
+ if (ARY_EMBED_P(ary)) { \
+ ARY_SET_EMBED_LEN((ary), (n)); \
+ } \
+ else { \
+ ARY_SET_HEAP_LEN((ary), (n)); \
+ } \
+ assert(RARRAY_LEN(ary) == (n)); \
+} while (0)
+#define ARY_INCREASE_PTR(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.ptr += (n); \
+} while (0)
+#define ARY_INCREASE_LEN(ary, n) do { \
+ assert(!OBJ_FROZEN(ary)); \
+ if (ARY_EMBED_P(ary)) { \
+ ARY_SET_EMBED_LEN((ary), RARRAY_LEN(ary)+(n)); \
+ } \
+ else { \
+ RARRAY(ary)->as.heap.len += (n); \
+ } \
+} while (0)
+
+#define ARY_CAPA(ary) (ARY_EMBED_P(ary) ? RARRAY_EMBED_LEN_MAX : \
+ ARY_SHARED_ROOT_P(ary) ? RARRAY_LEN(ary) : RARRAY(ary)->as.heap.aux.capa)
+#define ARY_SET_CAPA(ary, n) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ assert(!ARY_SHARED_P(ary)); \
+ assert(!OBJ_FROZEN(ary)); \
+ RARRAY(ary)->as.heap.aux.capa = (n); \
+} while (0)
+
+#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_); \
+} 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); \
+} while (0)
+#define FL_SET_SHARED_ROOT(ary) do { \
+ assert(!ARY_EMBED_P(ary)); \
+ 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(mem, size)
- register VALUE *mem;
- register long size;
+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(mem, size, val)
- register VALUE *mem;
- register long size;
- register VALUE val;
+memfill(register VALUE *mem, register long size, register VALUE val)
{
while (size--) {
*mem++ = val;
}
}
-#define ARY_TMPLOCK FL_USER1
+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)
+{
+ assert(RARRAY_LEN(ary) <= capacity);
+ assert(!OBJ_FROZEN(ary));
+ assert(!ARY_SHARED_P(ary));
+ if (capacity > RARRAY_EMBED_LEN_MAX) {
+ if (ARY_EMBED_P(ary)) {
+ long len = ARY_EMBED_LEN(ary);
+ VALUE *ptr = ALLOC_N(VALUE, (capacity));
+ MEMCPY(ptr, ARY_EMBED_PTR(ary), VALUE, len);
+ FL_UNSET_EMBED(ary);
+ ARY_SET_PTR(ary, ptr);
+ ARY_SET_HEAP_LEN(ary, len);
+ }
+ else {
+ SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity, RARRAY(ary)->as.heap.aux.capa);
+ }
+ 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);
+ FL_SET_EMBED(ary);
+ ARY_SET_LEN(ary, len);
+ ruby_xfree((VALUE *)ptr);
+ }
+ }
+}
static inline void
-rb_ary_modify_check(ary)
- VALUE ary;
+ary_shrink_capa(VALUE ary)
{
- if (OBJ_FROZEN(ary)) rb_error_frozen("array");
- if (FL_TEST(ary, ARY_TMPLOCK))
- rb_raise(rb_eRuntimeError, "can't modify array during iteration");
- if (!OBJ_TAINTED(ary) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: can't modify array");
+ 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
-rb_ary_modify(ary)
- VALUE ary;
+ary_double_capa(VALUE ary, long min)
{
- VALUE *ptr;
+ long new_capa = ARY_CAPA(ary) / 2;
+ if (new_capa < ARY_DEFAULT_SIZE) {
+ new_capa = ARY_DEFAULT_SIZE;
+ }
+ if (new_capa >= ARY_MAX_SIZE - min) {
+ new_capa = (ARY_MAX_SIZE - min) / 2;
+ }
+ new_capa += min;
+ ary_resize_capa(ary, new_capa);
+}
+
+static void
+rb_ary_decrement_share(VALUE shared)
+{
+ if (shared) {
+ long num = ARY_SHARED_NUM(shared) - 1;
+ if (num == 0) {
+ rb_ary_free(shared);
+ rb_gc_force_recycle(shared);
+ }
+ else if (num > 0) {
+ ARY_SET_SHARED_NUM(shared, num);
+ }
+ }
+}
+
+static void
+rb_ary_unshare(VALUE ary)
+{
+ VALUE shared = RARRAY(ary)->as.heap.aux.shared;
+ rb_ary_decrement_share(shared);
+ FL_UNSET_SHARED(ary);
+}
+
+static inline void
+rb_ary_unshare_safe(VALUE ary)
+{
+ if (ARY_SHARED_P(ary) && !ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ }
+}
+
+static VALUE
+rb_ary_increment_share(VALUE shared)
+{
+ long num = ARY_SHARED_NUM(shared);
+ if (num >= 0) {
+ ARY_SET_SHARED_NUM(shared, num + 1);
+ }
+ return shared;
+}
+
+static void
+rb_ary_set_shared(VALUE ary, VALUE shared)
+{
+ rb_ary_increment_share(shared);
+ FL_SET_SHARED(ary);
+ ARY_SET_SHARED(ary, shared);
+}
+
+static inline void
+rb_ary_modify_check(VALUE ary)
+{
+ rb_check_frozen(ary);
+}
+
+void
+rb_ary_modify(VALUE ary)
+{
rb_ary_modify_check(ary);
- if (FL_TEST(ary, ELTS_SHARED)) {
- ptr = ALLOC_N(VALUE, RARRAY(ary)->len);
- FL_UNSET(ary, ELTS_SHARED);
- RARRAY(ary)->aux.capa = RARRAY(ary)->len;
- MEMCPY(ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(ary)->ptr = ptr;
+ if (ARY_SHARED_P(ary)) {
+ long shared_len, len = RARRAY_LEN(ary);
+ VALUE shared = ARY_SHARED(ary);
+ if (len <= RARRAY_EMBED_LEN_MAX) {
+ const VALUE *ptr = ARY_HEAP_PTR(ary);
+ FL_UNSET_SHARED(ary);
+ FL_SET_EMBED(ary);
+ MEMCPY((VALUE *)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);
+ 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);
+ rb_ary_unshare(ary);
+ ARY_SET_CAPA(ary, len);
+ ARY_SET_PTR(ary, ptr);
+ }
+
+ rb_gc_writebarrier_remember(ary);
}
}
+static VALUE
+ary_ensure_room_for_push(VALUE ary, long add_len)
+{
+ long old_len = RARRAY_LEN(ary);
+ long new_len = old_len + 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)) {
+ rb_ary_modify_check(ary);
+ return shared;
+ }
+ else {
+ /* if array is shared, then 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;
+ }
+ }
+ }
+ }
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (new_len > capa) {
+ ary_double_capa(ary, new_len);
+ }
+
+ return ary;
+}
+
+/*
+ * call-seq:
+ * ary.freeze -> ary
+ *
+ * Calls Object#freeze on +ary+ to prevent any further
+ * modification. A RuntimeError will be raised if a modification
+ * attempt is made.
+ *
+ */
+
VALUE
-rb_ary_freeze(ary)
- VALUE ary;
+rb_ary_freeze(VALUE ary)
{
return rb_obj_freeze(ary);
}
/*
* call-seq:
- * array.frozen? -> true or false
+ * ary.frozen? -> true or false
*
- * Return <code>true</code> if this array is frozen (or temporarily frozen
- * while being sorted).
+ * Return +true+ if this array is frozen (or temporarily frozen
+ * while being sorted). See also Object#frozen?
*/
static VALUE
-rb_ary_frozen_p(ary)
- VALUE ary;
+rb_ary_frozen_p(VALUE ary)
{
if (OBJ_FROZEN(ary)) return Qtrue;
- if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue;
return Qfalse;
}
-static VALUE ary_alloc _((VALUE));
+/* This can be used to take a snapshot of an array (with
+ e.g. rb_ary_replace) and check later whether the array has been
+ modified from the snapshot. The snapshot is cheap, though if
+ something does modify the array it will pay the cost of copying
+ it. If Array#pop or Array#shift has been called, the array will
+ be still shared with the snapshot, but the array length will
+ differ. */
+VALUE
+rb_ary_shared_with_p(VALUE ary1, VALUE ary2)
+{
+ if (!ARY_EMBED_P(ary1) && ARY_SHARED_P(ary1) &&
+ !ARY_EMBED_P(ary2) && ARY_SHARED_P(ary2) &&
+ RARRAY(ary1)->as.heap.aux.shared == RARRAY(ary2)->as.heap.aux.shared &&
+ RARRAY(ary1)->as.heap.len == RARRAY(ary2)->as.heap.len) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
static VALUE
-ary_alloc(klass)
- VALUE klass;
+ary_alloc(VALUE klass)
{
- NEWOBJ(ary, struct RArray);
- OBJSETUP(ary, klass, T_ARRAY);
+ 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);
+ */
+ return (VALUE)ary;
+}
- ary->len = 0;
- ary->ptr = 0;
- ary->aux.capa = 0;
+static VALUE
+empty_ary_alloc(VALUE klass)
+{
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
- return (VALUE)ary;
+ return ary_alloc(klass);
}
static VALUE
-ary_new(klass, len)
- VALUE klass;
- long len;
+ary_new(VALUE klass, long capa)
{
- VALUE ary = ary_alloc(klass);
+ VALUE ary,*ptr;
- if (len < 0) {
+ if (capa < 0) {
rb_raise(rb_eArgError, "negative array size (or size too big)");
}
- if (len > ARY_MAX_SIZE) {
+ if (capa > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
- if (len == 0) len++;
- RARRAY(ary)->ptr = ALLOC_N(VALUE, len);
- RARRAY(ary)->aux.capa = len;
+
+ 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_CAPA(ary, capa);
+ ARY_SET_HEAP_LEN(ary, 0);
+ }
return ary;
}
VALUE
-rb_ary_new2(len)
- long len;
+rb_ary_new_capa(long capa)
{
- return ary_new(rb_cArray, len);
+ return ary_new(rb_cArray, capa);
}
-
VALUE
-rb_ary_new()
+rb_ary_new(void)
{
- return rb_ary_new2(ARY_DEFAULT_SIZE);
+ return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
}
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
-
VALUE
-#ifdef HAVE_STDARG_PROTOTYPES
-rb_ary_new3(long n, ...)
-#else
-rb_ary_new3(n, va_alist)
- long n;
- va_dcl
-#endif
+(rb_ary_new_from_args)(long n, ...)
{
va_list ar;
VALUE ary;
@@ -168,141 +509,240 @@ rb_ary_new3(n, va_alist)
ary = rb_ary_new2(n);
- va_init_list(ar, n);
+ va_start(ar, n);
for (i=0; i<n; i++) {
- RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
+ ARY_SET(ary, i, va_arg(ar, VALUE));
}
va_end(ar);
- RARRAY(ary)->len = n;
+ ARY_SET_LEN(ary, n);
return ary;
}
VALUE
-rb_ary_new4(n, elts)
- long n;
- const VALUE *elts;
+rb_ary_new_from_values(long n, const VALUE *elts)
{
VALUE ary;
ary = rb_ary_new2(n);
if (n > 0 && elts) {
- MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n);
+ ary_memcpy(ary, 0, n, elts);
+ ARY_SET_LEN(ary, n);
}
- /* This assignment to len will be moved to the above "if" block in Ruby 1.9 */
- RARRAY(ary)->len = n;
+ return ary;
+}
+VALUE
+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;
}
-static VALUE
-ary_make_shared(ary)
- VALUE 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));
+ }
+}
+
+RUBY_FUNC_EXPORTED size_t
+rb_ary_memsize(VALUE ary)
+{
+ if (ARY_OWNS_HEAP_P(ary)) {
+ return RARRAY(ary)->as.heap.aux.capa * sizeof(VALUE);
+ }
+ else {
+ return 0;
+ }
+}
+
+static inline void
+ary_discard(VALUE ary)
{
- if (!FL_TEST(ary, ELTS_SHARED)) {
- NEWOBJ(shared, struct RArray);
- OBJSETUP(shared, rb_cArray, T_ARRAY);
+ rb_ary_free(ary);
+ RBASIC(ary)->flags |= RARRAY_EMBED_FLAG;
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK;
+}
- shared->len = RARRAY(ary)->len;
- shared->ptr = RARRAY(ary)->ptr;
- shared->aux.capa = RARRAY(ary)->aux.capa;
- RARRAY(ary)->aux.shared = (VALUE)shared;
- FL_SET(ary, ELTS_SHARED);
+static VALUE
+ary_make_shared(VALUE ary)
+{
+ assert(!ARY_EMBED_P(ary));
+ if (ARY_SHARED_P(ary)) {
+ return ARY_SHARED(ary);
+ }
+ else if (ARY_SHARED_ROOT_P(ary)) {
+ return ary;
+ }
+ else if (OBJ_FROZEN(ary)) {
+ ary_shrink_capa(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));
+ 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);
+ FL_SET_SHARED_ROOT(shared);
+ ARY_SET_SHARED_NUM((VALUE)shared, 1);
+ FL_SET_SHARED(ary);
+ ARY_SET_SHARED(ary, (VALUE)shared);
OBJ_FREEZE(shared);
return (VALUE)shared;
}
+}
+
+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);
+ return subst;
+ }
else {
- return RARRAY(ary)->aux.shared;
+ return rb_ary_increment_share(ary_make_shared(ary));
}
}
VALUE
-rb_assoc_new(car, cdr)
- VALUE car, cdr;
+rb_assoc_new(VALUE car, VALUE cdr)
{
- VALUE ary;
-
- ary = rb_ary_new2(2);
- RARRAY(ary)->ptr[0] = car;
- RARRAY(ary)->ptr[1] = cdr;
- RARRAY(ary)->len = 2;
-
- return ary;
+ return rb_ary_new3(2, car, cdr);
}
static VALUE
-to_ary(ary)
- VALUE ary;
+to_ary(VALUE ary)
{
return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
VALUE
-rb_check_array_type(ary)
- VALUE ary;
+rb_check_array_type(VALUE ary)
{
return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
-static VALUE rb_ary_replace _((VALUE, VALUE));
+/*
+ * call-seq:
+ * Array.try_convert(obj) -> array or nil
+ *
+ * Tries to convert +obj+ into an array, using +to_ary+ method. Returns the
+ * converted array or +nil+ if +obj+ cannot be converted for any reason.
+ * This method can be used to check if an argument is an array.
+ *
+ * Array.try_convert([1]) #=> [1]
+ * Array.try_convert("1") #=> nil
+ *
+ * if tmp = Array.try_convert(arg)
+ * # the argument is an array
+ * elsif tmp = String.try_convert(arg)
+ * # the argument is a string
+ * end
+ *
+ */
+
+static VALUE
+rb_ary_s_try_convert(VALUE dummy, VALUE ary)
+{
+ return rb_check_array_type(ary);
+}
/*
* call-seq:
- * Array.new(size=0, obj=nil)
+ * Array.new(size=0, default=nil)
* Array.new(array)
* Array.new(size) {|index| block }
*
- * Returns a new array. In the first form, the new array is
- * empty. In the second it is created with _size_ copies of _obj_
- * (that is, _size_ references to the same
- * _obj_). The third form creates a copy of the array
- * passed as a parameter (the array is generated by calling
- * to_ary on the parameter). In the last form, an array
- * of the given size is created. Each element in this array is
- * calculated by passing the element's index to the given block and
- * storing the return value.
- *
- * Array.new
- * Array.new(2)
- * Array.new(5, "A")
- *
- * # only one copy of the object is created
+ * 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+.
+ *
+ * The second form creates a copy of the array passed as a parameter (the
+ * array is generated by calling to_ary on the parameter).
+ *
+ * first_array = ["Matz", "Guido"]
+ *
+ * second_array = Array.new(first_array) #=> ["Matz", "Guido"]
+ *
+ * first_array.equal? second_array #=> false
+ *
+ * In the last form, an array of the given size is created. Each element in
+ * this array is created by passing the element's index to the given block
+ * and storing the return value.
+ *
+ * Array.new(3){ |index| index ** 2 }
+ * # => [0, 1, 4]
+ *
+ * == Common gotchas
+ *
+ * When sending the second parameter, the same object will be used as the
+ * value for all the array elements:
+ *
* a = Array.new(2, Hash.new)
+ * # => [{}, {}]
+ *
* a[0]['cat'] = 'feline'
- * a
+ * a # => [{"cat"=>"feline"}, {"cat"=>"feline"}]
+ *
* a[1]['cat'] = 'Felix'
- * a
- *
- * # here multiple copies are created
+ * a # => [{"cat"=>"Felix"}, {"cat"=>"Felix"}]
+ *
+ * Since all the Array elements store the same hash, changes to one of them
+ * will affect them all.
+ *
+ * If multiple copies are what you want, you should use the block
+ * version which uses the result of that block each time an element
+ * of the array needs to be initialized:
+ *
* a = Array.new(2) { Hash.new }
* a[0]['cat'] = 'feline'
- * a
- *
- * squares = Array.new(5) {|i| i*i}
- * squares
- *
- * copy = Array.new(squares)
+ * a # => [{"cat"=>"feline"}, {}]
+ *
*/
static VALUE
-rb_ary_initialize(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
{
long len;
VALUE size, val;
rb_ary_modify(ary);
- if (rb_scan_args(argc, argv, "02", &size, &val) == 0) {
- RARRAY(ary)->len = 0;
+ 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));
+ }
+ rb_ary_unshare_safe(ary);
+ FL_SET_EMBED(ary);
+ ARY_SET_EMBED_LEN(ary, 0);
if (rb_block_given_p()) {
rb_warning("given block not used");
}
return ary;
}
-
+ rb_scan_args(argc, argv, "02", &size, &val);
if (argc == 1 && !FIXNUM_P(size)) {
val = rb_check_array_type(size);
if (!NIL_P(val)) {
@@ -312,16 +752,16 @@ rb_ary_initialize(argc, argv, 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");
}
- if (len > RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
- }
+ /* recheck after argument conversion */
+ rb_ary_modify(ary);
+ ary_resize_capa(ary, len);
if (rb_block_given_p()) {
long i;
@@ -330,54 +770,46 @@ rb_ary_initialize(argc, argv, ary)
}
for (i=0; i<len; i++) {
rb_ary_store(ary, i, rb_yield(LONG2NUM(i)));
- RARRAY(ary)->len = i + 1;
+ ARY_SET_LEN(ary, i + 1);
}
}
else {
- memfill(RARRAY(ary)->ptr, len, val);
- RARRAY(ary)->len = len;
+ ary_memfill(ary, 0, len, val);
+ ARY_SET_LEN(ary, len);
}
-
return ary;
}
-
-/*
-* Returns a new array populated with the given objects.
-*
-* Array.[]( 1, 'a', /^A/ )
-* Array[ 1, 'a', /^A/ ]
-* [ 1, 'a', /^A/ ]
-*/
+/*
+ * Returns a new array populated with the given objects.
+ *
+ * Array.[]( 1, 'a', /^A/ ) # => [1, "a", /^A/]
+ * Array[ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ * [ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ */
static VALUE
-rb_ary_s_create(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
{
- VALUE ary = ary_alloc(klass);
-
- if (argc > 0) {
- RARRAY(ary)->ptr = ALLOC_N(VALUE, argc);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
+ VALUE ary = ary_new(klass, argc);
+ if (argc > 0 && argv) {
+ ary_memcpy(ary, 0, argc, argv);
+ ARY_SET_LEN(ary, argc);
}
- RARRAY(ary)->len = RARRAY(ary)->aux.capa = argc;
return ary;
}
void
-rb_ary_store(ary, idx, val)
- VALUE ary;
- long idx;
- VALUE val;
+rb_ary_store(VALUE ary, long idx, VALUE val)
{
+ long len = RARRAY_LEN(ary);
+
if (idx < 0) {
- idx += RARRAY(ary)->len;
+ idx += len;
if (idx < 0) {
- rb_raise(rb_eIndexError, "index %ld out of array",
- idx - RARRAY(ary)->len);
+ rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
+ idx - len, -len);
}
}
else if (idx >= ARY_MAX_SIZE) {
@@ -385,78 +817,86 @@ rb_ary_store(ary, idx, val)
}
rb_ary_modify(ary);
- if (idx >= RARRAY(ary)->aux.capa) {
- long new_capa = RARRAY(ary)->aux.capa / 2;
-
- if (new_capa < ARY_DEFAULT_SIZE) {
- new_capa = ARY_DEFAULT_SIZE;
- }
- if (new_capa >= ARY_MAX_SIZE - idx) {
- new_capa = (ARY_MAX_SIZE - idx) / 2;
- }
- new_capa += idx;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, new_capa);
- RARRAY(ary)->aux.capa = new_capa;
+ if (idx >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, idx);
}
- if (idx > RARRAY(ary)->len) {
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len,
- idx-RARRAY(ary)->len + 1);
+ if (idx > len) {
+ ary_mem_clear(ary, len, idx - len + 1);
}
- if (idx >= RARRAY(ary)->len) {
- RARRAY(ary)->len = idx + 1;
+ if (idx >= len) {
+ ARY_SET_LEN(ary, idx + 1);
}
- RARRAY(ary)->ptr[idx] = val;
+ ARY_SET(ary, idx, val);
}
static VALUE
-ary_shared_array(klass, ary)
- VALUE klass;
- VALUE ary;
+ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
{
- VALUE val = ary_alloc(klass);
+ assert(offset >= 0);
+ assert(len >= 0);
+ assert(offset+len <= RARRAY_LEN(ary));
+
+ if (len <= RARRAY_EMBED_LEN_MAX) {
+ VALUE result = ary_alloc(klass);
+ ary_memcpy(result, 0, len, RARRAY_CONST_PTR(ary) + offset);
+ ARY_SET_EMBED_LEN(result, len);
+ return result;
+ }
+ else {
+ VALUE shared, result = ary_alloc(klass);
+ FL_UNSET_EMBED(result);
+
+ shared = ary_make_shared(ary);
+ ARY_SET_PTR(result, RARRAY_CONST_PTR(ary));
+ ARY_SET_LEN(result, RARRAY_LEN(ary));
+ rb_ary_set_shared(result, shared);
+
+ ARY_INCREASE_PTR(result, offset);
+ ARY_SET_LEN(result, len);
+ return result;
+ }
+}
- ary_make_shared(ary);
- RARRAY(val)->ptr = RARRAY(ary)->ptr;
- RARRAY(val)->len = RARRAY(ary)->len;
- RARRAY(val)->aux.shared = RARRAY(ary)->aux.shared;
- FL_SET(val, ELTS_SHARED);
- return val;
+static VALUE
+ary_make_shared_copy(VALUE ary)
+{
+ return ary_make_partial(ary, rb_obj_class(ary), 0, RARRAY_LEN(ary));
}
+enum ary_take_pos_flags
+{
+ ARY_TAKE_FIRST = 0,
+ ARY_TAKE_LAST = 1
+};
+
static VALUE
-ary_shared_first(argc, argv, ary, last)
- int argc;
- VALUE *argv;
- VALUE ary;
- int last;
+ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
{
- VALUE nv, result;
+ VALUE nv;
long n;
+ long len;
long offset = 0;
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
- if (n > RARRAY(ary)->len) {
- n = RARRAY(ary)->len;
+ len = RARRAY_LEN(ary);
+ if (n > len) {
+ n = len;
}
else if (n < 0) {
rb_raise(rb_eArgError, "negative array size");
}
if (last) {
- offset = RARRAY(ary)->len - n;
+ offset = len - n;
}
- result = ary_shared_array(rb_cArray, ary);
- RARRAY(result)->ptr += offset;
- RARRAY(result)->len = n;
-
- return result;
+ return ary_make_partial(ary, rb_cArray, offset, n);
}
/*
* call-seq:
- * array << obj -> array
- *
+ * ary << obj -> ary
+ *
* Append---Pushes the given object on to the end of this array. This
* expression returns the array itself, so several appends
* may be chained together.
@@ -467,65 +907,79 @@ ary_shared_first(argc, argv, ary, last)
*/
VALUE
-rb_ary_push(ary, item)
- VALUE ary;
- VALUE item;
+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_SET_LEN(ary, idx + 1);
+ return ary;
+}
+
+VALUE
+rb_ary_cat(VALUE ary, const VALUE *argv, long len)
{
- rb_ary_store(ary, RARRAY(ary)->len, item);
+ long oldlen = RARRAY_LEN(ary);
+ VALUE target_ary = ary_ensure_room_for_push(ary, len);
+ ary_memcpy0(ary, oldlen, len, argv, target_ary);
+ ARY_SET_LEN(ary, oldlen + len);
return ary;
}
-/*
+/*
* call-seq:
- * array.push(obj, ... ) -> array
- *
- * Append---Pushes the given object(s) on to the end of this array. This
+ * ary.push(obj, ... ) -> ary
+ *
+ * Append --- Pushes the given object(s) on to the end of this array. This
* expression returns the array itself, so several appends
- * may be chained together.
+ * may be chained together. See also Array#pop for the opposite
+ * effect.
*
* a = [ "a", "b", "c" ]
- * a.push("d", "e", "f")
+ * a.push("d", "e", "f")
* #=> ["a", "b", "c", "d", "e", "f"]
+ * [1, 2, 3,].push(4).push(5)
+ * #=> [1, 2, 3, 4, 5]
*/
static VALUE
-rb_ary_push_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
{
- while (argc--) {
- rb_ary_push(ary, *argv++);
- }
- return ary;
+ return rb_ary_cat(ary, argv, argc);
}
VALUE
-rb_ary_pop(ary)
- VALUE ary;
+rb_ary_pop(VALUE ary)
{
+ long n;
rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- if (!FL_TEST(ary, ELTS_SHARED) &&
- RARRAY(ary)->len * 3 < RARRAY(ary)->aux.capa &&
- RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
- RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
+ n = RARRAY_LEN(ary);
+ if (n == 0) return Qnil;
+ if (ARY_OWNS_HEAP_P(ary) &&
+ n * 3 < ARY_CAPA(ary) &&
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE)
+ {
+ ary_resize_capa(ary, n * 2);
}
- return RARRAY(ary)->ptr[--RARRAY(ary)->len];
+ --n;
+ ARY_SET_LEN(ary, n);
+ return RARRAY_AREF(ary, n);
}
/*
* call-seq:
- * array.pop -> obj or nil
- * array.pop(n) -> array
- *
- * Removes the last element from <i>self</i> and returns it, or
- * <code>nil</code> if the array is empty.
+ * ary.pop -> obj or nil
+ * ary.pop(n) -> new_ary
+ *
+ * Removes the last element from +self+ and returns it, or
+ * +nil+ if the array is empty.
+ *
+ * If a number +n+ is given, returns an array of the last +n+ elements
+ * (or less) just like <code>array.slice!(-n, n)</code> does. See also
+ * Array#push for the opposite effect.
*
- * If a number _n_ is given, returns an array of the last n elements
- * (or less) just like <code>array.slice!(-n, n)</code> does.
- *
* a = [ "a", "b", "c", "d" ]
* a.pop #=> "d"
* a.pop(2) #=> ["b", "c"]
@@ -533,10 +987,7 @@ rb_ary_pop(ary)
*/
static VALUE
-rb_ary_pop_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_pop_m(int argc, VALUE *argv, VALUE ary)
{
VALUE result;
@@ -545,47 +996,56 @@ rb_ary_pop_m(argc, argv, ary)
}
rb_ary_modify_check(ary);
- result = ary_shared_first(argc, argv, ary, Qtrue);
- RARRAY(ary)->len -= RARRAY(result)->len;
+ result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
+ ARY_INCREASE_LEN(ary, -RARRAY_LEN(result));
return result;
}
VALUE
-rb_ary_shift(ary)
- VALUE ary;
+rb_ary_shift(VALUE ary)
{
VALUE top;
+ long len = RARRAY_LEN(ary);
rb_ary_modify_check(ary);
- if (RARRAY(ary)->len == 0) return Qnil;
- top = RARRAY(ary)->ptr[0];
- if (!FL_TEST(ary, ELTS_SHARED)) {
- if (RARRAY(ary)->len < ARY_DEFAULT_SIZE) {
- MEMMOVE(RARRAY(ary)->ptr, RARRAY(ary)->ptr+1, VALUE, RARRAY(ary)->len-1);
- RARRAY(ary)->len--;
- return top;
- }
- RARRAY(ary)->ptr[0] = Qnil;
+ if (len == 0) return Qnil;
+ top = RARRAY_AREF(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 */
+ ARY_INCREASE_LEN(ary, -1);
+ return top;
+ }
+ assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
+
+ ARY_SET(ary, 0, Qnil);
ary_make_shared(ary);
}
- RARRAY(ary)->ptr++; /* shift ptr */
- RARRAY(ary)->len--;
+ else if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
+ RARRAY_PTR_USE(ary, ptr, ptr[0] = Qnil);
+ }
+ ARY_INCREASE_PTR(ary, 1); /* shift ptr */
+ ARY_INCREASE_LEN(ary, -1);
return top;
}
/*
* call-seq:
- * array.shift -> obj or nil
- * array.shift(n) -> array
- *
- * Returns the first element of <i>self</i> and removes it (shifting all
- * other elements down by one). Returns <code>nil</code> if the array
+ * ary.shift -> obj or nil
+ * ary.shift(n) -> new_ary
+ *
+ * Removes the first element of +self+ and returns it (shifting all
+ * other elements down by one). Returns +nil+ if the array
* is empty.
*
- * If a number _n_ is given, returns an array of the first n elements
- * (or less) just like <code>array.slice!(0, n)</code> does.
- *
+ * If a number +n+ is given, returns an array of the first +n+ elements
+ * (or less) just like <code>array.slice!(0, n)</code> does. With +ary+
+ * containing only the remainder elements, not including what was shifted to
+ * +new_ary+. See also Array#unshift for the opposite effect.
+ *
* args = [ "-m", "-q", "filename" ]
* args.shift #=> "-m"
* args #=> ["-q", "filename"]
@@ -596,10 +1056,7 @@ rb_ary_shift(ary)
*/
static VALUE
-rb_ary_shift_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
{
VALUE result;
long n;
@@ -609,145 +1066,176 @@ rb_ary_shift_m(argc, argv, ary)
}
rb_ary_modify_check(ary);
- result = ary_shared_first(argc, argv, ary, Qfalse);
- n = RARRAY(result)->len;
- if (FL_TEST(ary, ELTS_SHARED)) {
- RARRAY(ary)->ptr += n;
- RARRAY(ary)->len -= n;
+ 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))) {
+ ary_mem_clear(ary, 0, n);
}
+ ARY_INCREASE_PTR(ary, n);
+ }
else {
- MEMMOVE(RARRAY(ary)->ptr, RARRAY(ary)->ptr+n, VALUE, RARRAY(ary)->len-n);
- RARRAY(ary)->len -= n;
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr, ptr + n, VALUE, RARRAY_LEN(ary)-n);
+ }); /* WB: no new reference */
}
+ ARY_INCREASE_LEN(ary, -n);
return result;
}
-VALUE
-rb_ary_unshift(ary, item)
- VALUE ary, item;
+static VALUE
+ary_ensure_room_for_unshift(VALUE ary, int argc)
{
- rb_ary_modify(ary);
- if (RARRAY(ary)->len == RARRAY(ary)->aux.capa) {
- long capa_inc = RARRAY(ary)->aux.capa / 2;
- if (capa_inc < ARY_DEFAULT_SIZE) {
- capa_inc = ARY_DEFAULT_SIZE;
+ 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);
+ }
+
+ 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);
+ goto makeroom_if_need;
}
- RARRAY(ary)->aux.capa += capa_inc;
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
}
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + 1, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (capa - (capa >> 6) <= new_len) {
+ ary_double_capa(ary, new_len);
+ }
- RARRAY(ary)->len++;
- RARRAY(ary)->ptr[0] = item;
+ /* use shared array for big "queues" */
+ if (new_len > ARY_DEFAULT_SIZE * 4) {
+ /* make a room for unshifted items */
+ capa = ARY_CAPA(ary);
+ ary_make_shared(ary);
- return ary;
+ head = sharedp = RARRAY_CONST_PTR(ary);
+ goto makeroom;
+ makeroom_if_need:
+ if (head - sharedp < argc) {
+ long room;
+ makeroom:
+ room = capa - new_len;
+ room -= room >> 4;
+ MEMMOVE((VALUE *)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;
+ }
}
/*
* call-seq:
- * array.unshift(obj, ...) -> array
- *
- * Prepends objects to the front of <i>array</i>.
- * other elements up one.
- *
+ * ary.unshift(obj, ...) -> ary
+ *
+ * Prepends objects to the front of +self+, moving other elements upwards.
+ * See also Array#shift for the opposite effect.
+ *
* a = [ "b", "c", "d" ]
* a.unshift("a") #=> ["a", "b", "c", "d"]
* a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"]
*/
static VALUE
-rb_ary_unshift_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
- long len = RARRAY(ary)->len;
+ long len = RARRAY_LEN(ary);
+ VALUE target_ary;
- if (argc == 0) return ary;
-
- /* make rooms by setting the last item */
- rb_ary_store(ary, len + argc - 1, Qnil);
+ if (argc == 0) {
+ rb_ary_modify_check(ary);
+ return ary;
+ }
- /* sliding items */
- MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
- MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
-
+ target_ary = ary_ensure_room_for_unshift(ary, argc);
+ ary_memcpy0(ary, 0, argc, argv, target_ary);
+ ARY_SET_LEN(ary, len + argc);
return ary;
}
+VALUE
+rb_ary_unshift(VALUE ary, VALUE item)
+{
+ return rb_ary_unshift_m(1,&item,ary);
+}
+
/* faster version - use this if you don't need to treat negative offset */
static inline VALUE
-rb_ary_elt(ary, offset)
- VALUE ary;
- long offset;
+rb_ary_elt(VALUE ary, long offset)
{
- if (RARRAY(ary)->len == 0) return Qnil;
- if (offset < 0 || RARRAY(ary)->len <= offset) {
+ long len = RARRAY_LEN(ary);
+ if (len == 0) return Qnil;
+ if (offset < 0 || len <= offset) {
return Qnil;
}
- return RARRAY(ary)->ptr[offset];
+ return RARRAY_AREF(ary, offset);
}
VALUE
-rb_ary_entry(ary, offset)
- VALUE ary;
- long offset;
+rb_ary_entry(VALUE ary, long offset)
{
if (offset < 0) {
- offset += RARRAY(ary)->len;
+ offset += RARRAY_LEN(ary);
}
return rb_ary_elt(ary, offset);
}
-static VALUE
-rb_ary_subseq(ary, beg, len)
- VALUE ary;
- long beg, len;
+VALUE
+rb_ary_subseq(VALUE ary, long beg, long len)
{
- VALUE klass, ary2, shared;
- VALUE *ptr;
+ VALUE klass;
+ long alen = RARRAY_LEN(ary);
- if (beg > RARRAY(ary)->len) return Qnil;
+ if (beg > alen) return Qnil;
if (beg < 0 || len < 0) return Qnil;
- if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
- len = RARRAY(ary)->len - beg;
- if (len < 0)
- len = 0;
+ if (alen < len || alen < beg + len) {
+ len = alen - beg;
}
klass = rb_obj_class(ary);
if (len == 0) return ary_new(klass, 0);
- shared = ary_make_shared(ary);
- ptr = RARRAY(ary)->ptr;
- ary2 = ary_alloc(klass);
- RARRAY(ary2)->ptr = ptr + beg;
- RARRAY(ary2)->len = len;
- RARRAY(ary2)->aux.shared = shared;
- FL_SET(ary2, ELTS_SHARED);
-
- return ary2;
+ return ary_make_partial(ary, klass, beg, len);
}
-/*
+/*
* call-seq:
- * array[index] -> obj or nil
- * array[start, length] -> an_array or nil
- * array[range] -> an_array or nil
- * array.slice(index) -> obj or nil
- * array.slice(start, length) -> an_array or nil
- * array.slice(range) -> an_array or nil
+ * ary[index] -> obj or nil
+ * ary[start, length] -> new_ary or nil
+ * ary[range] -> new_ary or nil
+ * ary.slice(index) -> obj or nil
+ * ary.slice(start, length) -> new_ary or nil
+ * ary.slice(range) -> new_ary or nil
+ *
+ * Element Reference --- Returns the element at +index+, or returns a
+ * subarray starting at the +start+ index and continuing for +length+
+ * elements, or returns a subarray specified by +range+ of indices.
+ *
+ * Negative indices count backward from the end of the array (-1 is the last
+ * element). For +start+ and +range+ cases the starting index is just before
+ * an element. Additionally, an empty array is returned when the starting
+ * index for an element range is at the end of the array.
*
- * Element Reference---Returns the element at _index_,
- * or returns a subarray starting at _start_ and
- * continuing for _length_ elements, or returns a subarray
- * specified by _range_.
- * Negative indices count backward from the end of the
- * array (-1 is the last element). Returns nil if the index
- * (or starting index) are out of range.
+ * Returns +nil+ if the index (or starting index) are out of range.
*
* a = [ "a", "b", "c", "d", "e" ]
* a[2] + a[0] + a[1] #=> "cab"
@@ -759,44 +1247,36 @@ rb_ary_subseq(ary, beg, len)
* a[-3, 3] #=> [ "c", "d", "e" ]
* # special cases
* a[5] #=> nil
+ * a[6, 1] #=> nil
* a[5, 1] #=> []
* a[5..10] #=> []
*
*/
VALUE
-rb_ary_aref(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_aref(int argc, const VALUE *argv, VALUE ary)
{
VALUE arg;
long beg, len;
if (argc == 2) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
if (beg < 0) {
- beg += RARRAY(ary)->len;
+ beg += RARRAY_LEN(ary);
}
return rb_ary_subseq(ary, beg, len);
}
if (argc != 1) {
- rb_scan_args(argc, argv, "11", 0, 0);
+ rb_scan_args(argc, argv, "11", NULL, NULL);
}
arg = argv[0];
/* special case - speeding up */
if (FIXNUM_P(arg)) {
return rb_ary_entry(ary, FIX2LONG(arg));
}
- if (SYMBOL_P(arg)) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
/* check if idx is Range */
- switch (rb_range_beg_len(arg, &beg, &len, RARRAY(ary)->len, 0)) {
+ switch (rb_range_beg_len(arg, &beg, &len, RARRAY_LEN(ary), 0)) {
case Qfalse:
break;
case Qnil:
@@ -807,15 +1287,13 @@ rb_ary_aref(argc, argv, ary)
return rb_ary_entry(ary, NUM2LONG(arg));
}
-/*
+/*
* call-seq:
- * array.at(index) -> obj or nil
+ * ary.at(index) -> obj or nil
*
- * Returns the element at _index_. A
- * negative index counts from the end of _self_. Returns +nil+
- * if the index is out of range. See also <code>Array#[]</code>.
- * (<code>Array#at</code> is slightly faster than <code>Array#[]</code>,
- * as it does not accept ranges and so on.)
+ * Returns the element at +index+. A negative index counts from the end of
+ * +self+. Returns +nil+ if the index is out of range. See also
+ * Array#[].
*
* a = [ "a", "b", "c", "d", "e" ]
* a.at(0) #=> "a"
@@ -823,93 +1301,91 @@ rb_ary_aref(argc, argv, ary)
*/
static VALUE
-rb_ary_at(ary, pos)
- VALUE ary, pos;
+rb_ary_at(VALUE ary, VALUE pos)
{
return rb_ary_entry(ary, NUM2LONG(pos));
}
/*
* call-seq:
- * array.first -> obj or nil
- * array.first(n) -> an_array
+ * ary.first -> obj or nil
+ * ary.first(n) -> new_ary
*
* Returns the first element, or the first +n+ elements, of the array.
- * If the array is empty, the first form returns <code>nil</code>, and the
- * second form returns an empty array.
+ * If the array is empty, the first form returns +nil+, and the
+ * second form returns an empty array. See also Array#last for
+ * the opposite effect.
*
* a = [ "q", "r", "s", "t" ]
- * a.first #=> "q"
- * a.first(1) #=> ["q"]
- * a.first(3) #=> ["q", "r", "s"]
+ * a.first #=> "q"
+ * a.first(2) #=> ["q", "r"]
*/
static VALUE
-rb_ary_first(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_first(int argc, VALUE *argv, VALUE ary)
{
if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[0];
+ if (RARRAY_LEN(ary) == 0) return Qnil;
+ return RARRAY_AREF(ary, 0);
}
else {
- return ary_shared_first(argc, argv, ary, Qfalse);
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
}
}
/*
* call-seq:
- * array.last -> obj or nil
- * array.last(n) -> an_array
- *
- * Returns the last element(s) of <i>self</i>. If the array is empty,
- * the first form returns <code>nil</code>.
- *
- * [ "w", "x", "y", "z" ].last #=> "z"
+ * ary.last -> obj or nil
+ * ary.last(n) -> new_ary
+ *
+ * Returns the last element(s) of +self+. If the array is empty,
+ * the first form returns +nil+.
+ *
+ * See also Array#first for the opposite effect.
+ *
+ * a = [ "w", "x", "y", "z" ]
+ * a.last #=> "z"
+ * a.last(2) #=> ["y", "z"]
*/
-static VALUE
-rb_ary_last(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+VALUE
+rb_ary_last(int argc, const VALUE *argv, VALUE ary)
{
if (argc == 0) {
- if (RARRAY(ary)->len == 0) return Qnil;
- return RARRAY(ary)->ptr[RARRAY(ary)->len-1];
+ long len = RARRAY_LEN(ary);
+ if (len == 0) return Qnil;
+ return RARRAY_AREF(ary, len-1);
}
else {
- return ary_shared_first(argc, argv, ary, Qtrue);
+ return ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
}
}
/*
* call-seq:
- * array.fetch(index) -> obj
- * array.fetch(index, default ) -> obj
- * array.fetch(index) {|index| block } -> obj
- *
- * Tries to return the element at position <i>index</i>. If the index
- * lies outside the array, the first form throws an
- * <code>IndexError</code> exception, the second form returns
- * <i>default</i>, and the third form returns the value of invoking
- * the block, passing in the index. Negative values of <i>index</i>
- * count from the end of the array.
- *
+ * ary.fetch(index) -> obj
+ * ary.fetch(index, default) -> obj
+ * ary.fetch(index) { |index| block } -> obj
+ *
+ * Tries to return the element at position +index+, but throws an IndexError
+ * exception if the referenced +index+ lies outside of the array bounds. This
+ * error can be prevented by supplying a second argument, which will act as a
+ * +default+ value.
+ *
+ * Alternatively, if a block is given it will only be executed when an
+ * invalid +index+ is referenced. Negative values of +index+ count from the
+ * end of the array.
+ *
* a = [ 11, 22, 33, 44 ]
* a.fetch(1) #=> 22
* a.fetch(-1) #=> 44
* a.fetch(4, 'cat') #=> "cat"
- * a.fetch(4) { |i| i*i } #=> 16
+ * a.fetch(100) { |i| puts "#{i} is out of bounds" }
+ * #=> "100 is out of bounds"
*/
static VALUE
-rb_ary_fetch(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
{
VALUE pos, ifnone;
long block_given;
@@ -923,233 +1399,305 @@ rb_ary_fetch(argc, argv, ary)
idx = NUM2LONG(pos);
if (idx < 0) {
- idx += RARRAY(ary)->len;
+ idx += RARRAY_LEN(ary);
}
- if (idx < 0 || RARRAY(ary)->len <= idx) {
+ if (idx < 0 || RARRAY_LEN(ary) <= idx) {
if (block_given) return rb_yield(pos);
if (argc == 1) {
- rb_raise(rb_eIndexError, "index %ld out of array", idx);
+ rb_raise(rb_eIndexError, "index %ld outside of array bounds: %ld...%ld",
+ idx - (idx < 0 ? RARRAY_LEN(ary) : 0), -RARRAY_LEN(ary), RARRAY_LEN(ary));
}
return ifnone;
}
- return RARRAY(ary)->ptr[idx];
+ return RARRAY_AREF(ary, idx);
}
/*
* call-seq:
- * array.index(obj) -> int or nil
- * array.index {|item| block} -> int or nil
- *
- * Returns the index of the first object in <i>self</i> such that is
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns first object for which <em>block</em> is true.
- * Returns <code>nil</code> if no match is found.
- *
- * a = [ "a", "b", "c" ]
- * a.index("b") #=> 1
- * a.index("z") #=> nil
- * a.index{|x|x=="b"} #=> 1
+ * 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
+ *
+ * Returns the _index_ of the first object in +ary+ such that the object is
+ * <code>==</code> to +obj+.
+ *
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+. Returns +nil+ if no
+ * match is found.
*
- * This is an alias of <code>#find_index</code>.
+ * See also Array#rindex.
+ *
+ * An Enumerator is returned if neither a block nor argument is given.
+ *
+ * a = [ "a", "b", "c" ]
+ * a.index("b") #=> 1
+ * a.index("z") #=> nil
+ * a.index { |x| x == "b" } #=> 1
*/
static VALUE
-rb_ary_index(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_index(int argc, VALUE *argv, VALUE ary)
{
+ const VALUE *ptr;
VALUE val;
- long i;
+ long i, len;
- if (argc == 0) {
+ if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
return LONG2NUM(i);
}
}
return Qnil;
}
- rb_scan_args(argc, argv, "01", &val);
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (rb_equal(RARRAY(ary)->ptr[i], val))
+ rb_check_arity(argc, 0, 1);
+ val = argv[0];
+ 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:
return LONG2NUM(i);
+ case Qfalse:
+ continue;
+ }
+ len = RARRAY_LEN(ary);
+ ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
/*
* call-seq:
- * array.rindex(obj) -> int or nil
- *
- * Returns the index of the last object in <i>array</i>
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns first object for which <em>block</em> is
- * true. Returns <code>nil</code> if no match is found.
- *
+ * ary.rindex(obj) -> int or nil
+ * ary.rindex { |item| block } -> int or nil
+ * ary.rindex -> Enumerator
+ *
+ * Returns the _index_ of the last object in +self+ <code>==</code> to +obj+.
+ *
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+, starting from the last
+ * object.
+ *
+ * Returns +nil+ if no match is found.
+ *
+ * See also Array#index.
+ *
+ * If neither block nor argument is given, an Enumerator is returned instead.
+ *
* a = [ "a", "b", "b", "b", "c" ]
- * a.rindex("b") #=> 3
- * a.rindex("z") #=> nil
- * a.rindex{|x|x=="b"} #=> 3
+ * a.rindex("b") #=> 3
+ * a.rindex("z") #=> nil
+ * a.rindex { |x| x == "b" } #=> 3
*/
static VALUE
-rb_ary_rindex(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
{
+ const VALUE *ptr;
VALUE val;
- long i = RARRAY(ary)->len;
+ long i = RARRAY_LEN(ary), len;
if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
while (i--) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i])))
+ if (RTEST(rb_yield(RARRAY_AREF(ary, i))))
return LONG2NUM(i);
- if (i > RARRAY(ary)->len) {
- i = RARRAY(ary)->len;
+ if (i > (len = RARRAY_LEN(ary))) {
+ i = len;
}
}
return Qnil;
}
- rb_scan_args(argc, argv, "01", &val);
+ rb_check_arity(argc, 0, 1);
+ val = argv[0];
+ if (rb_block_given_p())
+ rb_warn("given block not used");
+ ptr = RARRAY_CONST_PTR(ary);
while (i--) {
- if (rb_equal(RARRAY(ary)->ptr[i], val))
+ VALUE e = ptr[i];
+ switch (rb_equal_opt(e, val)) {
+ case Qundef:
+ if (!rb_equal(e, val)) break;
+ case Qtrue:
return LONG2NUM(i);
- if (i > RARRAY(ary)->len) {
- i = RARRAY(ary)->len;
+ case Qfalse:
+ continue;
+ }
+ if (i > (len = RARRAY_LEN(ary))) {
+ i = len;
}
+ ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
-/*
- * call-seq:
- * array.indexes( i1, i2, ... iN ) -> an_array
- * array.indices( i1, i2, ... iN ) -> an_array
- *
- * Deprecated; use <code>Array#values_at</code>.
- */
-
-static VALUE
-rb_ary_indexes(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
-{
- VALUE new_ary;
- long i;
-
- rb_warn("Array#%s is deprecated; use Array#values_at", rb_id2name(rb_frame_last_func()));
- new_ary = rb_ary_new2(argc);
- for (i=0; i<argc; i++) {
- rb_ary_push(new_ary, rb_ary_aref(1, argv+i, ary));
- }
-
- return new_ary;
-}
-
VALUE
-rb_ary_to_ary(obj)
- VALUE obj;
+rb_ary_to_ary(VALUE obj)
{
- if (TYPE(obj) == T_ARRAY) {
- return obj;
- }
- if (rb_respond_to(obj, rb_intern("to_ary"))) {
- return rb_convert_type(obj, T_ARRAY, "Array", "to_ary");
- }
+ VALUE tmp = rb_check_array_type(obj);
+
+ if (!NIL_P(tmp)) return tmp;
return rb_ary_new3(1, obj);
}
static void
-rb_ary_splice(ary, beg, len, rpl)
- VALUE ary;
- long beg, len;
- VALUE rpl;
+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 += RARRAY(ary)->len;
+ beg += olen;
if (beg < 0) {
- beg -= RARRAY(ary)->len;
- rb_raise(rb_eIndexError, "index %ld out of array", beg);
+ rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
+ beg - olen, -olen);
}
}
- if (RARRAY(ary)->len < len || RARRAY(ary)->len < beg + len) {
- len = RARRAY(ary)->len - beg;
+ if (olen < len || olen < beg + len) {
+ len = olen - beg;
}
- if (NIL_P(rpl)) {
+ if (rpl == Qundef) {
rlen = 0;
}
else {
rpl = rb_ary_to_ary(rpl);
- rlen = RARRAY(rpl)->len;
+ rlen = RARRAY_LEN(rpl);
+ olen = RARRAY_LEN(ary); /* ary may be resized in rpl.to_ary too */
}
- rb_ary_modify(ary);
-
- if (beg >= RARRAY(ary)->len) {
+ if (beg >= olen) {
+ VALUE target_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 */
len = beg + rlen;
- if (len >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
- RARRAY(ary)->aux.capa = len;
- }
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, beg - RARRAY(ary)->len);
+ ary_mem_clear(ary, olen, beg - olen);
if (rlen > 0) {
- MEMCPY(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
+ ary_memcpy0(ary, beg, rlen, RARRAY_CONST_PTR(rpl), target_ary);
}
- RARRAY(ary)->len = len;
+ ARY_SET_LEN(ary, len);
}
else {
long alen;
- if (beg + len > RARRAY(ary)->len) {
- len = RARRAY(ary)->len - beg;
+ if (olen - len > ARY_MAX_SIZE - rlen) {
+ rb_raise(rb_eIndexError, "index %ld too big", olen + rlen - len);
}
-
- alen = RARRAY(ary)->len + rlen - len;
- if (alen >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, alen);
- RARRAY(ary)->aux.capa = alen;
+ rb_ary_modify(ary);
+ alen = olen + rlen - len;
+ if (alen >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, alen);
}
if (len != rlen) {
- MEMMOVE(RARRAY(ary)->ptr + beg + rlen, RARRAY(ary)->ptr + beg + len,
- VALUE, RARRAY(ary)->len - (beg + len));
- RARRAY(ary)->len = alen;
+ RARRAY_PTR_USE(ary, ptr,
+ MEMMOVE(ptr + beg + rlen, ptr + beg + len,
+ VALUE, olen - (beg + len)));
+ ARY_SET_LEN(ary, alen);
}
if (rlen > 0) {
- MEMMOVE(RARRAY(ary)->ptr + beg, RARRAY(rpl)->ptr, VALUE, rlen);
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_CONST_PTR(rpl), VALUE, rlen);
}
}
+ RB_GC_GUARD(rpl);
}
-/*
+void
+rb_ary_set_len(VALUE ary, long len)
+{
+ long capa;
+
+ rb_ary_modify_check(ary);
+ if (ARY_SHARED_P(ary)) {
+ rb_raise(rb_eRuntimeError, "can't set length of shared ");
+ }
+ if (len > (capa = (long)ARY_CAPA(ary))) {
+ rb_bug("probable buffer overflow: %ld for %ld", len, capa);
+ }
+ ARY_SET_LEN(ary, len);
+}
+
+/*!
+ * expands or shrinks \a ary to \a len elements.
+ * expanded region will be filled with Qnil.
+ * \param ary an array
+ * \param len new size
+ * \return \a ary
+ * \post the size of \a ary is \a len.
+ */
+VALUE
+rb_ary_resize(VALUE ary, long len)
+{
+ long olen;
+
+ rb_ary_modify(ary);
+ olen = RARRAY_LEN(ary);
+ if (len == olen) return ary;
+ if (len > ARY_MAX_SIZE) {
+ rb_raise(rb_eIndexError, "index %ld too big", len);
+ }
+ if (len > olen) {
+ if (len >= ARY_CAPA(ary)) {
+ ary_double_capa(ary, len);
+ }
+ ary_mem_clear(ary, olen, len - olen);
+ ARY_SET_LEN(ary, len);
+ }
+ else if (ARY_EMBED_P(ary)) {
+ ARY_SET_EMBED_LEN(ary, len);
+ }
+ else if (len <= RARRAY_EMBED_LEN_MAX) {
+ 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 */
+ 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);
+ ARY_SET_CAPA(ary, len);
+ }
+ ARY_SET_HEAP_LEN(ary, len);
+ }
+ return ary;
+}
+
+/*
* call-seq:
- * array[index] = obj -> obj
- * array[start, length] = obj or an_array or nil -> obj or an_array or nil
- * array[range] = obj or an_array or nil -> obj or an_array or nil
+ * ary[index] = obj -> obj
+ * ary[start, length] = obj or other_ary or nil -> obj or other_ary or nil
+ * ary[range] = obj or other_ary or nil -> obj or other_ary or nil
+ *
+ * Element Assignment --- Sets the element at +index+, or replaces a subarray
+ * from the +start+ index for +length+ elements, or replaces a subarray
+ * specified by the +range+ of indices.
+ *
+ * If indices are greater than the current capacity of the array, the array
+ * grows automatically. Elements are inserted into the array at +start+ if
+ * +length+ is zero.
+ *
+ * Negative indices will count backward from the end of the array. For
+ * +start+ and +range+ cases the starting index is just before an element.
+ *
+ * An IndexError is raised if a negative index points past the beginning of
+ * the array.
+ *
+ * See also Array#push, and Array#unshift.
*
- * Element Assignment---Sets the element at _index_,
- * or replaces a subarray starting at _start_ and
- * continuing for _length_ elements, or replaces a subarray
- * specified by _range_. If indices are greater than
- * the current capacity of the array, the array grows
- * automatically. A negative indices will count backward
- * from the end of the array. Inserts elements if _length_ is
- * zero. If +nil+ is used in the second and third form,
- * deletes elements from _self_. An +IndexError+ is raised if a
- * negative index points past the beginning of the array. See also
- * <code>Array#push</code>, and <code>Array#unshift</code>.
- *
* a = Array.new
* a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
* a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]
@@ -1157,38 +1705,31 @@ rb_ary_splice(ary, beg, len, rpl)
* a[0, 2] = "?" #=> ["?", 2, nil, "4"]
* a[0..2] = "A" #=> ["A", "4"]
* a[-1] = "Z" #=> ["A", "Z"]
- * a[1..-1] = nil #=> ["A"]
+ * a[1..-1] = nil #=> ["A", nil]
+ * a[1..-1] = [] #=> ["A"]
+ * a[0, 0] = [ 1, 2 ] #=> [1, 2, "A"]
+ * a[3, 0] = "B" #=> [1, 2, "A", "B"]
*/
static VALUE
-rb_ary_aset(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_aset(int argc, VALUE *argv, VALUE ary)
{
long offset, beg, len;
if (argc == 3) {
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
- if (SYMBOL_P(argv[1])) {
- rb_raise(rb_eTypeError, "Symbol as subarray length");
- }
- rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]);
+ rb_ary_modify_check(ary);
+ beg = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
+ rb_ary_splice(ary, beg, len, argv[2]);
return argv[2];
}
- if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
- }
+ rb_check_arity(argc, 2, 2);
+ rb_ary_modify_check(ary);
if (FIXNUM_P(argv[0])) {
offset = FIX2LONG(argv[0]);
goto fixnum;
}
- if (SYMBOL_P(argv[0])) {
- rb_raise(rb_eTypeError, "Symbol as array index");
- }
- if (rb_range_beg_len(argv[0], &beg, &len, RARRAY(ary)->len, 1)) {
+ if (rb_range_beg_len(argv[0], &beg, &len, RARRAY_LEN(ary), 1)) {
/* check if idx is Range */
rb_ary_splice(ary, beg, len, argv[1]);
return argv[1];
@@ -1202,31 +1743,31 @@ fixnum:
/*
* call-seq:
- * array.insert(index, obj...) -> array
- *
- * Inserts the given values before the element with the given index
- * (which may be negative).
- *
+ * ary.insert(index, obj...) -> ary
+ *
+ * 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.
+ *
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
* a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
*/
static VALUE
-rb_ary_insert(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_insert(int argc, VALUE *argv, VALUE ary)
{
long pos;
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ rb_ary_modify_check(ary);
if (argc == 1) return ary;
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
pos = NUM2LONG(argv[0]);
if (pos == -1) {
- pos = RARRAY(ary)->len;
+ pos = RARRAY_LEN(ary);
}
if (pos < 0) {
pos++;
@@ -1235,57 +1776,71 @@ rb_ary_insert(argc, argv, ary)
return 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:
- * array.each {|item| block } -> array
- *
- * Calls <i>block</i> once for each element in <i>self</i>, passing that
- * element as a parameter.
- *
+ * ary.each { |item| block } -> ary
+ * ary.each -> Enumerator
+ *
+ * Calls the given block once for each element in +self+, passing that element
+ * as a parameter.
+ *
+ * An Enumerator is returned if no block is given.
+ *
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* a -- b -- c --
*/
VALUE
-rb_ary_each(ary)
- VALUE ary;
+rb_ary_each(VALUE array)
{
long i;
+ volatile VALUE ary = array;
- RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY(ary)->len; i++) {
- rb_yield(RARRAY(ary)->ptr[i]);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_yield(RARRAY_AREF(ary, i));
}
return ary;
}
/*
* call-seq:
- * array.each_index {|index| block } -> array
- *
- * Same as <code>Array#each</code>, but passes the index of the element
- * instead of the element itself.
- *
+ * ary.each_index { |index| block } -> ary
+ * ary.each_index -> Enumerator
+ *
+ * Same as Array#each, but passes the +index+ of the element instead of the
+ * element itself.
+ *
+ * An Enumerator is returned if no block is given.
+ *
* a = [ "a", "b", "c" ]
* a.each_index {|x| print x, " -- " }
- *
+ *
* produces:
- *
+ *
* 0 -- 1 -- 2 --
*/
static VALUE
-rb_ary_each_index(ary)
- VALUE ary;
+rb_ary_each_index(VALUE ary)
{
long i;
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
- RETURN_ENUMERATOR(ary, 0, 0);
- for (i=0; i<RARRAY(ary)->len; i++) {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(LONG2NUM(i));
}
return ary;
@@ -1293,31 +1848,32 @@ rb_ary_each_index(ary)
/*
* call-seq:
- * array.reverse_each {|item| block }
- *
- * Same as <code>Array#each</code>, but traverses <i>self</i> in reverse
- * order.
- *
+ * ary.reverse_each { |item| block } -> ary
+ * ary.reverse_each -> Enumerator
+ *
+ * Same as Array#each, but traverses +self+ in reverse order.
+ *
* a = [ "a", "b", "c" ]
* a.reverse_each {|x| print x, " " }
- *
+ *
* produces:
- *
+ *
* c b a
*/
static VALUE
-rb_ary_reverse_each(ary)
- VALUE ary;
+rb_ary_reverse_each(VALUE ary)
{
long len;
- RETURN_ENUMERATOR(ary, 0, 0);
- len = RARRAY(ary)->len;
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ len = RARRAY_LEN(ary);
while (len--) {
- rb_yield(RARRAY(ary)->ptr[len]);
- if (RARRAY(ary)->len < len) {
- len = RARRAY(ary)->len;
+ long nlen;
+ rb_yield(RARRAY_AREF(ary, len));
+ nlen = RARRAY_LEN(ary);
+ if (nlen < len) {
+ len = nlen;
}
}
return ary;
@@ -1325,483 +1881,659 @@ rb_ary_reverse_each(ary)
/*
* call-seq:
- * array.length -> int
- *
- * Returns the number of elements in <i>self</i>. May be zero.
- *
+ * ary.length -> int
+ *
+ * Returns the number of elements in +self+. May be zero.
+ *
* [ 1, 2, 3, 4, 5 ].length #=> 5
+ * [].length #=> 0
*/
static VALUE
-rb_ary_length(ary)
- VALUE ary;
+rb_ary_length(VALUE ary)
{
- return LONG2NUM(RARRAY(ary)->len);
+ long len = RARRAY_LEN(ary);
+ return LONG2NUM(len);
}
/*
* call-seq:
- * array.empty? -> true or false
- *
- * Returns <code>true</code> if <i>self</i> array contains no elements.
- *
+ * ary.empty? -> true or false
+ *
+ * Returns +true+ if +self+ contains no elements.
+ *
* [].empty? #=> true
*/
static VALUE
-rb_ary_empty_p(ary)
- VALUE ary;
+rb_ary_empty_p(VALUE ary)
{
- if (RARRAY(ary)->len == 0)
+ if (RARRAY_LEN(ary) == 0)
return Qtrue;
return Qfalse;
}
VALUE
-rb_ary_dup(ary)
- VALUE ary;
+rb_ary_dup(VALUE ary)
{
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
-
- DUPSETUP(dup, ary);
- MEMCPY(RARRAY(dup)->ptr, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
- RARRAY(dup)->len = RARRAY(ary)->len;
+ 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);
return dup;
}
+VALUE
+rb_ary_resurrect(VALUE ary)
+{
+ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_CONST_PTR(ary));
+}
+
extern VALUE rb_output_fs;
+static void ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first);
+
static VALUE
-inspect_join(ary, arg)
- VALUE ary;
- VALUE *arg;
+recursive_join(VALUE obj, VALUE argp, int recur)
{
- return rb_ary_join(arg[0], arg[1]);
+ VALUE *arg = (VALUE *)argp;
+ VALUE ary = arg[0];
+ VALUE sep = arg[1];
+ VALUE result = arg[2];
+ int *first = (int *)arg[3];
+
+ if (recur) {
+ rb_raise(rb_eArgError, "recursive array join");
+ }
+ else {
+ ary_join_1(obj, ary, sep, 0, result, first);
+ }
+ return Qnil;
}
-VALUE
-rb_ary_join(ary, sep)
- VALUE ary, sep;
+static void
+ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
{
- long len = 1, i;
- int taint = Qfalse;
- VALUE result, tmp;
-
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
- if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = Qtrue;
+ long i;
+ VALUE val;
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = rb_check_string_type(RARRAY(ary)->ptr[i]);
- len += NIL_P(tmp) ? 10 : RSTRING(tmp)->len;
- }
- if (!NIL_P(sep)) {
- StringValue(sep);
- len += RSTRING(sep)->len * (RARRAY(ary)->len - 1);
+ if (max > 0) rb_enc_copy(result, RARRAY_AREF(ary, 0));
+ for (i=0; i<max; i++) {
+ val = RARRAY_AREF(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);
}
- result = rb_str_buf_new(len);
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = RARRAY(ary)->ptr[i];
- switch (TYPE(tmp)) {
- case T_STRING:
- break;
- case T_ARRAY:
- if (tmp == ary || rb_inspecting_p(tmp)) {
- tmp = rb_str_new2("[...]");
+}
+
+static void
+ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
+{
+ VALUE val, tmp;
+
+ for (; i<RARRAY_LEN(ary); i++) {
+ if (i > 0 && !NIL_P(sep))
+ rb_str_buf_append(result, sep);
+
+ val = RARRAY_AREF(ary, i);
+ if (RB_TYPE_P(val, T_STRING)) {
+ str_join:
+ rb_str_buf_append(result, val);
+ *first = FALSE;
+ }
+ else if (RB_TYPE_P(val, T_ARRAY)) {
+ obj = val;
+ ary_join:
+ if (val == ary) {
+ rb_raise(rb_eArgError, "recursive array join");
}
else {
- VALUE args[2];
+ VALUE args[4];
- args[0] = tmp;
+ args[0] = val;
args[1] = sep;
- tmp = rb_protect_inspect(inspect_join, ary, (VALUE)args);
+ args[2] = result;
+ args[3] = (VALUE)first;
+ rb_exec_recursive(recursive_join, obj, (VALUE)args);
}
- break;
- default:
- tmp = rb_obj_as_string(tmp);
}
- if (i > 0 && !NIL_P(sep))
- rb_str_buf_append(result, sep);
- rb_str_buf_append(result, tmp);
- if (OBJ_TAINTED(tmp)) taint = Qtrue;
+ else {
+ tmp = rb_check_string_type(val);
+ if (!NIL_P(tmp)) {
+ val = tmp;
+ goto str_join;
+ }
+ tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_ary");
+ if (!NIL_P(tmp)) {
+ obj = val;
+ val = tmp;
+ goto ary_join;
+ }
+ val = rb_obj_as_string(val);
+ if (*first) {
+ rb_enc_copy(result, val);
+ *first = FALSE;
+ }
+ goto str_join;
+ }
}
+}
+
+VALUE
+rb_ary_join(VALUE ary, VALUE sep)
+{
+ long len = 1, i;
+ int taint = FALSE;
+ VALUE val, tmp, result;
+ if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
+ if (OBJ_TAINTED(ary)) taint = 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);
+ tmp = rb_check_string_type(val);
+
+ if (NIL_P(tmp) || tmp != val) {
+ int first;
+ result = rb_str_buf_new(len + (RARRAY_LEN(ary)-i)*10);
+ rb_enc_associate(result, rb_usascii_encoding());
+ if (taint) OBJ_TAINT(result);
+ ary_join_0(ary, sep, i, result);
+ first = i == 0;
+ ary_join_1(ary, ary, sep, i, result, &first);
+ return result;
+ }
+
+ len += RSTRING_LEN(tmp);
+ }
+
+ result = rb_str_buf_new(len);
if (taint) OBJ_TAINT(result);
+ ary_join_0(ary, sep, RARRAY_LEN(ary), result);
+
return result;
}
/*
* call-seq:
- * array.join(sep=$,) -> str
- *
+ * ary.join(separator=$,) -> str
+ *
* Returns a string created by converting each element of the array to
- * a string, separated by <i>sep</i>.
- *
+ * a string, separated by the given +separator+.
+ * If the +separator+ is +nil+, it uses current $,.
+ * If both the +separator+ and $, are nil, it uses empty string.
+ *
* [ "a", "b", "c" ].join #=> "abc"
* [ "a", "b", "c" ].join("-") #=> "a-b-c"
*/
static VALUE
-rb_ary_join_m(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
{
VALUE sep;
rb_scan_args(argc, argv, "01", &sep);
if (NIL_P(sep)) sep = rb_output_fs;
-
+
return rb_ary_join(ary, sep);
}
+static VALUE
+inspect_ary(VALUE ary, VALUE dummy, int recur)
+{
+ int tainted = OBJ_TAINTED(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));
+ if (OBJ_TAINTED(s)) tainted = 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);
+ return str;
+}
+
/*
* call-seq:
- * array.to_s -> string
- *
- * Returns _self_<code>.join</code>.
- *
- * [ "a", "e", "i", "o" ].to_s #=> "aeio"
+ * ary.inspect -> string
+ * ary.to_s -> string
+ *
+ * Creates a string representation of +self+.
*
+ * [ "a", "b", "c" ].to_s #=> "[\"a\", \"b\", \"c\"]"
*/
-VALUE
-rb_ary_to_s(ary)
- VALUE ary;
+static VALUE
+rb_ary_inspect(VALUE ary)
{
- if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
-
- return rb_ary_join(ary, rb_output_fs);
+ if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new2("[]");
+ return rb_exec_recursive(inspect_ary, ary, 0);
}
-static ID inspect_key;
+VALUE
+rb_ary_to_s(VALUE ary)
+{
+ return rb_ary_inspect(ary);
+}
-struct inspect_arg {
- VALUE (*func)();
- VALUE arg1, arg2;
-};
+/*
+ * call-seq:
+ * ary.to_a -> ary
+ *
+ * Returns +self+.
+ *
+ * If called on a subclass of Array, converts the receiver to an Array object.
+ */
static VALUE
-inspect_call(arg)
- struct inspect_arg *arg;
+rb_ary_to_a(VALUE ary)
{
- return (*arg->func)(arg->arg1, arg->arg2);
+ if (rb_obj_class(ary) != rb_cArray) {
+ VALUE dup = rb_ary_new2(RARRAY_LEN(ary));
+ rb_ary_replace(dup, ary);
+ return dup;
+ }
+ return 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
-get_inspect_tbl(create)
- int create;
+rb_ary_to_h(VALUE ary)
{
- VALUE inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key);
-
- if (NIL_P(inspect_tbl)) {
- if (create) {
- tbl_init:
- inspect_tbl = rb_ary_new();
- rb_thread_local_aset(rb_thread_current(), inspect_key, inspect_tbl);
+ long i;
+ VALUE hash = rb_hash_new();
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ VALUE key_value_pair = rb_check_array_type(rb_ary_elt(ary, i));
+ if (NIL_P(key_value_pair)) {
+ rb_raise(rb_eTypeError, "wrong element type %s at %ld (expected array)",
+ rb_builtin_class_name(rb_ary_elt(ary, i)), 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));
}
- else if (TYPE(inspect_tbl) != T_ARRAY) {
- rb_warn("invalid inspect_tbl value");
- if (create) goto tbl_init;
- rb_thread_local_aset(rb_thread_current(), inspect_key, Qnil);
- return Qnil;
- }
- return inspect_tbl;
+ return hash;
}
+/*
+ * call-seq:
+ * ary.to_ary -> ary
+ *
+ * Returns +self+.
+ */
+
static VALUE
-inspect_ensure(obj)
- VALUE obj;
+rb_ary_to_ary_m(VALUE ary)
{
- VALUE inspect_tbl;
-
- inspect_tbl = get_inspect_tbl(Qfalse);
- if (!NIL_P(inspect_tbl)) {
- rb_ary_pop(inspect_tbl);
- }
- return 0;
+ return ary;
}
-VALUE
-rb_protect_inspect(func, obj, arg)
- VALUE (*func)(ANYARGS);
- VALUE obj, arg;
+static void
+ary_reverse(VALUE *p1, VALUE *p2)
{
- struct inspect_arg iarg;
- VALUE inspect_tbl;
- VALUE id;
-
- inspect_tbl = get_inspect_tbl(Qtrue);
- id = rb_obj_id(obj);
- if (rb_ary_includes(inspect_tbl, id)) {
- return (*func)(obj, arg);
+ while (p1 < p2) {
+ VALUE tmp = *p1;
+ *p1++ = *p2;
+ *p2-- = tmp;
}
- rb_ary_push(inspect_tbl, id);
- iarg.func = func;
- iarg.arg1 = obj;
- iarg.arg2 = arg;
-
- return rb_ensure(inspect_call, (VALUE)&iarg, inspect_ensure, obj);
}
VALUE
-rb_inspecting_p(obj)
- VALUE obj;
+rb_ary_reverse(VALUE ary)
{
- VALUE inspect_tbl;
+ VALUE *p2;
+ long len = RARRAY_LEN(ary);
- inspect_tbl = get_inspect_tbl(Qfalse);
- if (NIL_P(inspect_tbl)) return Qfalse;
- return rb_ary_includes(inspect_tbl, rb_obj_id(obj));
-}
-
-static VALUE
-inspect_ary(ary)
- VALUE ary;
-{
- int tainted = OBJ_TAINTED(ary);
- long i;
- VALUE s, str;
-
- str = rb_str_buf_new2("[");
- for (i=0; i<RARRAY(ary)->len; i++) {
- s = rb_inspect(RARRAY(ary)->ptr[i]);
- if (OBJ_TAINTED(s)) tainted = Qtrue;
- if (i > 0) rb_str_buf_cat2(str, ", ");
- rb_str_buf_append(str, s);
+ 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 */
}
- rb_str_buf_cat2(str, "]");
- if (tainted) OBJ_TAINT(str);
- return str;
+ return ary;
}
/*
* call-seq:
- * array.inspect -> string
+ * ary.reverse! -> ary
+ *
+ * Reverses +self+ in place.
*
- * Create a printable version of <i>array</i>.
+ * a = [ "a", "b", "c" ]
+ * a.reverse! #=> ["c", "b", "a"]
+ * a #=> ["c", "b", "a"]
*/
static VALUE
-rb_ary_inspect(ary)
- VALUE ary;
+rb_ary_reverse_bang(VALUE ary)
{
- if (RARRAY(ary)->len == 0) return rb_str_new2("[]");
- if (rb_inspecting_p(ary)) return rb_str_new2("[...]");
- return rb_protect_inspect(inspect_ary, ary, 0);
+ return rb_ary_reverse(ary);
}
/*
* call-seq:
- * array.to_a -> array
- *
- * Returns _self_. If called on a subclass of Array, converts
- * the receiver to an Array object.
+ * ary.reverse -> new_ary
+ *
+ * Returns a new array containing +self+'s elements in reverse order.
+ *
+ * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
+ * [ 1 ].reverse #=> [1]
*/
static VALUE
-rb_ary_to_a(ary)
- VALUE ary;
+rb_ary_reverse_m(VALUE ary)
{
- if (rb_obj_class(ary) != rb_cArray) {
- VALUE dup = rb_ary_new2(RARRAY(ary)->len);
- rb_ary_replace(dup, ary);
- return dup;
+ long len = RARRAY_LEN(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;
+ do *p2-- = *p1++; while (--len > 0);
}
- return ary;
+ ARY_SET_LEN(dup, RARRAY_LEN(ary));
+ return dup;
}
-/*
- * call-seq:
- * array.to_ary -> array
- *
- * Returns _self_.
- */
-
-static VALUE
-rb_ary_to_ary_m(ary)
- VALUE ary;
+static inline long
+rotate_count(long cnt, long len)
{
- return ary;
+ return (cnt < 0) ? (len - (~cnt % len) - 1) : (cnt % len);
}
VALUE
-rb_ary_reverse(ary)
- VALUE ary;
+rb_ary_rotate(VALUE ary, long cnt)
{
- VALUE *p1, *p2;
- VALUE tmp;
-
rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- p1 = RARRAY(ary)->ptr;
- p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
- while (p1 < p2) {
- tmp = *p1;
- *p1++ = *p2;
- *p2-- = tmp;
+ if (cnt != 0) {
+ VALUE *ptr = RARRAY_PTR(ary);
+ long len = RARRAY_LEN(ary);
+
+ if (len > 0 && (cnt = rotate_count(cnt, len)) > 0) {
+ --len;
+ if (cnt < len) ary_reverse(ptr + cnt, ptr + len);
+ if (--cnt > 0) ary_reverse(ptr, ptr + cnt);
+ if (len > 0) ary_reverse(ptr, ptr + len);
+ return ary;
}
}
- return ary;
+
+ return Qnil;
}
/*
* call-seq:
- * array.reverse! -> array
- *
- * Reverses _self_ in place.
- *
- * a = [ "a", "b", "c" ]
- * a.reverse! #=> ["c", "b", "a"]
- * a #=> ["c", "b", "a"]
+ * ary.rotate!(count=1) -> ary
+ *
+ * Rotates +self+ in place so that the element at +count+ comes first, and
+ * returns +self+.
+ *
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of the array where +-1+ is the last element.
+ *
+ * a = [ "a", "b", "c", "d" ]
+ * a.rotate! #=> ["b", "c", "d", "a"]
+ * a #=> ["b", "c", "d", "a"]
+ * a.rotate!(2) #=> ["d", "a", "b", "c"]
+ * a.rotate!(-3) #=> ["a", "b", "c", "d"]
*/
static VALUE
-rb_ary_reverse_bang(ary)
- VALUE ary;
+rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
{
- return rb_ary_reverse(ary);
+ long n = 1;
+
+ switch (argc) {
+ case 1: n = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
+ rb_ary_rotate(ary, n);
+ return ary;
}
/*
* call-seq:
- * array.reverse -> an_array
- *
- * Returns a new array containing <i>self</i>'s elements in reverse order.
- *
- * [ "a", "b", "c" ].reverse #=> ["c", "b", "a"]
- * [ 1 ].reverse #=> [1]
+ * ary.rotate(count=1) -> new_ary
+ *
+ * Returns a new array by rotating +self+ so that the element at +count+ is
+ * the first element of the new array.
+ *
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of +self+ where +-1+ is the last element.
+ *
+ * a = [ "a", "b", "c", "d" ]
+ * a.rotate #=> ["b", "c", "d", "a"]
+ * a #=> ["a", "b", "c", "d"]
+ * a.rotate(2) #=> ["c", "d", "a", "b"]
+ * a.rotate(-3) #=> ["b", "c", "d", "a"]
*/
static VALUE
-rb_ary_reverse_m(ary)
- VALUE ary;
+rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
{
- return rb_ary_reverse(rb_ary_dup(ary));
+ VALUE rotated;
+ const VALUE *ptr;
+ long len, cnt = 1;
+
+ switch (argc) {
+ case 1: cnt = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
+
+ len = RARRAY_LEN(ary);
+ rotated = rb_ary_new2(len);
+ if (len > 0) {
+ cnt = rotate_count(cnt, len);
+ ptr = RARRAY_CONST_PTR(ary);
+ len -= cnt;
+ ary_memcpy(rotated, 0, len, ptr + cnt);
+ ary_memcpy(rotated, len, cnt, ptr);
+ }
+ ARY_SET_LEN(rotated, RARRAY_LEN(ary));
+ return rotated;
}
struct ary_sort_data {
VALUE ary;
- VALUE *ptr;
- long len;
+ int opt_methods;
+ int opt_inited;
};
-static void
-ary_sort_check(data)
- struct ary_sort_data *data;
+enum {
+ sort_opt_Fixnum,
+ sort_opt_String,
+ sort_optimizable_count
+};
+
+#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
+
+#define SORT_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(sort_opt_,type))
+#define SORT_OPTIMIZABLE(data, type) \
+ (((data)->opt_inited & SORT_OPTIMIZABLE_BIT(type)) ? \
+ ((data)->opt_methods & SORT_OPTIMIZABLE_BIT(type)) : \
+ (((data)->opt_inited |= SORT_OPTIMIZABLE_BIT(type)), \
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
+ ((data)->opt_methods |= SORT_OPTIMIZABLE_BIT(type))))
+
+static VALUE
+sort_reentered(VALUE ary)
{
- if (RARRAY(data->ary)->ptr != data->ptr || RARRAY(data->ary)->len != data->len) {
- rb_raise(rb_eArgError, "array modified during sort");
+ if (RBASIC(ary)->klass) {
+ rb_raise(rb_eRuntimeError, "sort reentered");
}
+ return Qnil;
}
static int
-sort_1(a, b, data)
- VALUE *a, *b;
- struct ary_sort_data *data;
+sort_1(const void *ap, const void *bp, void *dummy)
{
- VALUE retval = rb_yield_values(2, *a, *b);
+ struct ary_sort_data *data = dummy;
+ VALUE retval = sort_reentered(data->ary);
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- n = rb_cmpint(retval, *a, *b);
- ary_sort_check(data);
+ retval = rb_yield_values(2, a, b);
+ n = rb_cmpint(retval, a, b);
+ sort_reentered(data->ary);
return n;
}
static int
-sort_2(ap, bp, data)
- VALUE *ap, *bp;
- struct ary_sort_data *data;
+sort_2(const void *ap, const void *bp, void *dummy)
{
- VALUE retval;
- VALUE a = *ap, b = *bp;
+ struct ary_sort_data *data = dummy;
+ VALUE retval = sort_reentered(data->ary);
+ VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- if (FIXNUM_P(a) && FIXNUM_P(b)) {
+ if (FIXNUM_P(a) && FIXNUM_P(b) && SORT_OPTIMIZABLE(data, Fixnum)) {
if ((long)a > (long)b) return 1;
if ((long)a < (long)b) return -1;
return 0;
}
- if (TYPE(a) == T_STRING) {
- if (TYPE(b) == T_STRING) return rb_str_cmp(a, b);
+ if (STRING_P(a) && STRING_P(b) && SORT_OPTIMIZABLE(data, String)) {
+ return rb_str_cmp(a, b);
}
- retval = rb_funcall(a, id_cmp, 1, b);
+ retval = rb_funcallv(a, id_cmp, 1, &b);
n = rb_cmpint(retval, a, b);
- ary_sort_check(data);
+ sort_reentered(data->ary);
return n;
}
-static VALUE
-sort_internal(ary)
- VALUE ary;
-{
- struct ary_sort_data data;
-
- data.ary = ary;
- data.ptr = RARRAY(ary)->ptr; data.len = RARRAY(ary)->len;
- qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE),
- rb_block_given_p()?sort_1:sort_2, &data);
- return ary;
-}
-
-static VALUE
-sort_unlock(ary)
- VALUE ary;
-{
- FL_UNSET(ary, ARY_TMPLOCK);
- return ary;
-}
-
/*
* call-seq:
- * array.sort! -> array
- * array.sort! {| a,b | block } -> array
- *
- * Sorts _self_. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
+ * ary.sort! -> ary
+ * ary.sort! { |a, b| block } -> ary
+ *
+ * Sorts +self+ in place.
+ *
+ * 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
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
+ *
+ * See also Enumerable#sort_by.
+ *
* a = [ "d", "a", "e", "c", "b" ]
- * a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort! #=> ["a", "b", "c", "d", "e"]
+ * a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
-rb_ary_sort_bang(ary)
- VALUE ary;
+rb_ary_sort_bang(VALUE ary)
{
rb_ary_modify(ary);
- if (RARRAY(ary)->len > 1) {
- FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
- rb_ensure(sort_internal, ary, sort_unlock, ary);
+ assert(!ARY_SHARED_P(ary));
+ if (RARRAY_LEN(ary) > 1) {
+ VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
+ struct ary_sort_data data;
+ long len = RARRAY_LEN(ary);
+
+ RBASIC_CLEAR_CLASS(tmp);
+ 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);
+ if (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));
+ ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
+ }
+ else {
+ if (!ARY_EMBED_P(ary) && ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
+ FL_UNSET_SHARED(ary);
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
+ }
+ else {
+ assert(!ARY_SHARED_P(tmp));
+ if (ARY_EMBED_P(ary)) {
+ FL_UNSET_EMBED(ary);
+ }
+ else if (ARY_SHARED_P(ary)) {
+ /* ary might be destructively operated in the given block */
+ rb_ary_unshare(ary);
+ }
+ else {
+ ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
+ }
+ ARY_SET_PTR(ary, RARRAY_CONST_PTR(tmp));
+ ARY_SET_HEAP_LEN(ary, len);
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
+ }
+ /* tmp was lost ownership for the ptr */
+ FL_UNSET(tmp, FL_FREEZE);
+ FL_SET_EMBED(tmp);
+ ARY_SET_EMBED_LEN(tmp, 0);
+ FL_SET(tmp, FL_FREEZE);
+ }
+ /* tmp will be GC'ed. */
+ RBASIC_SET_CLASS_RAW(tmp, rb_cArray); /* rb_cArray must be marked */
}
return ary;
}
/*
* call-seq:
- * array.sort -> an_array
- * array.sort {| a,b | block } -> an_array
- *
- * Returns a new array created by sorting <i>self</i>. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
- *
+ * ary.sort -> new_ary
+ * ary.sort { |a, b| block } -> new_ary
+ *
+ * Returns a new array created by sorting +self+.
+ *
+ * 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
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
+ *
+ *
+ * See also Enumerable#sort_by.
+ *
* a = [ "d", "a", "e", "c", "b" ]
* a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
-rb_ary_sort(ary)
- VALUE ary;
+rb_ary_sort(VALUE ary)
{
ary = rb_ary_dup(ary);
rb_ary_sort_bang(ary);
@@ -1810,71 +2542,209 @@ rb_ary_sort(ary)
/*
* call-seq:
- * array.collect {|item| block } -> an_array
- * array.map {|item| block } -> an_array
- *
- * Invokes <i>block</i> once for each element of <i>self</i>. Creates a
- * new array containing the values returned by the block.
- * See also <code>Enumerable#collect</code>.
- *
+ * ary.bsearch {|x| block } -> elem
+ *
+ * By using binary search, finds a value from this array which meets
+ * the given condition in O(log n) where n is the size of the array.
+ *
+ * You can use this method in two use cases: a find-minimum mode and
+ * a find-any mode. In either case, the elements of the array must be
+ * monotone (or sorted) with respect to the block.
+ *
+ * In find-minimum mode (this is a good choice for typical use case),
+ * the block must return true or false, and there must be an index i
+ * (0 <= i <= ary.size) so that:
+ *
+ * - the block returns false for any element whose index is less than
+ * i, and
+ * - the block returns true for any element whose index is greater
+ * than or equal to i.
+ *
+ * This method returns the i-th element. If i is equal to ary.size,
+ * it returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * ary.bsearch {|x| x >= 4 } #=> 4
+ * ary.bsearch {|x| x >= 6 } #=> 7
+ * ary.bsearch {|x| x >= -1 } #=> 0
+ * ary.bsearch {|x| x >= 100 } #=> nil
+ *
+ * In find-any mode (this behaves like libc's bsearch(3)), the block
+ * must return a number, and there must be two indices i and j
+ * (0 <= i <= j <= ary.size) so that:
+ *
+ * - the block returns a positive number for ary[k] if 0 <= k < i,
+ * - the block returns zero for ary[k] if i <= k < j, and
+ * - the block returns a negative number for ary[k] if
+ * j <= k < ary.size.
+ *
+ * Under this condition, this method returns any element whose index
+ * is within i...j. If i is equal to j (i.e., there is no element
+ * that satisfies the block), this method returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * # try to find v such that 4 <= v < 8
+ * ary.bsearch {|x| 1 - x / 4 } #=> 4 or 7
+ * # try to find v such that 8 <= v < 10
+ * ary.bsearch {|x| 4 - x / 2 } #=> nil
+ *
+ * You must not mix the two modes at a time; the block must always
+ * return either true/false, or always return a number. It is
+ * undefined which value is actually picked up at each iteration.
+ */
+
+static VALUE
+rb_ary_bsearch(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 (FIX2INT(v) == 0) return val;
+ smaller = FIX2INT(v) < 0;
+ }
+ else if (v == Qtrue) {
+ satisfied = 1;
+ smaller = 1;
+ }
+ else if (v == Qfalse || v == Qnil) {
+ 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, INT2FIX(0))) {
+ case 0: return val;
+ case 1: smaller = 1; break;
+ case -1: smaller = 0;
+ }
+ }
+ else {
+ rb_raise(rb_eTypeError, "wrong argument type %s"
+ " (must be numeric, true, false or nil)",
+ rb_obj_classname(v));
+ }
+ if (smaller) {
+ high = mid;
+ }
+ else {
+ low = mid + 1;
+ }
+ }
+ if (low == RARRAY_LEN(ary)) return Qnil;
+ if (!satisfied) return Qnil;
+ return rb_ary_entry(ary, low);
+}
+
+
+static VALUE
+sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
+{
+ return rb_yield(i);
+}
+
+/*
+ * call-seq:
+ * ary.sort_by! { |obj| block } -> ary
+ * ary.sort_by! -> Enumerator
+ *
+ * Sorts +self+ in place using a set of keys generated by mapping the
+ * values in +self+ through the given block.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ */
+
+static VALUE
+rb_ary_sort_by_bang(VALUE ary)
+{
+ VALUE sorted;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_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);
+ return ary;
+}
+
+
+/*
+ * call-seq:
+ * ary.collect { |item| block } -> new_ary
+ * ary.map { |item| block } -> new_ary
+ * ary.collect -> Enumerator
+ * ary.map -> Enumerator
+ *
+ * Invokes the given block once for each element of +self+.
+ *
+ * Creates a new array containing the values returned by the block.
+ *
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
* a = [ "a", "b", "c", "d" ]
- * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * 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"]
*/
static VALUE
-rb_ary_collect(ary)
- VALUE ary;
+rb_ary_collect(VALUE ary)
{
long i;
VALUE collect;
- if (!rb_block_given_p()) {
- return rb_ary_new4(RARRAY(ary)->len, RARRAY(ary)->ptr);
- }
-
- collect = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_push(collect, rb_yield(RARRAY(ary)->ptr[i]));
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_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)));
}
return collect;
}
-/*
+
+/*
* call-seq:
- * array.collect! {|item| block } -> array
- * array.map! {|item| block } -> array
+ * ary.collect! {|item| block } -> ary
+ * ary.map! {|item| block } -> ary
+ * ary.collect! -> Enumerator
+ * ary.map! -> Enumerator
+ *
+ * Invokes the given block once for each element of +self+, replacing the
+ * element with the value returned by the block.
+ *
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
- * Invokes the block once for each element of _self_, replacing the
- * element with the value returned by _block_.
- * See also <code>Enumerable#collect</code>.
- *
* a = [ "a", "b", "c", "d" ]
- * a.collect! {|x| x + "!" }
- * 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
-rb_ary_collect_bang(ary)
- VALUE ary;
+rb_ary_collect_bang(VALUE ary)
{
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
rb_ary_modify(ary);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_ary_store(ary, i, rb_yield(RARRAY(ary)->ptr[i]));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_ary_store(ary, i, rb_yield(RARRAY_AREF(ary, i)));
}
return ary;
}
VALUE
-rb_values_at(obj, olen, argc, argv, func)
- VALUE obj;
- long olen;
- int argc;
- VALUE *argv;
- VALUE (*func) _((VALUE,long));
+rb_get_values_at(VALUE obj, long olen, int argc, const VALUE *argv, VALUE (*func) (VALUE, long))
{
VALUE result = rb_ary_new2(argc);
long beg, len, i, j;
@@ -1885,15 +2755,13 @@ rb_values_at(obj, olen, argc, argv, func)
continue;
}
/* check if idx is Range */
- switch (rb_range_beg_len(argv[i], &beg, &len, olen, 0)) {
- case Qfalse:
- break;
- case Qnil:
- continue;
- default:
- for (j=0; j<len; j++) {
- rb_ary_push(result, (*func)(obj, j+beg));
+ if (rb_range_beg_len(argv[i], &beg, &len, olen, 1)) {
+ long end = olen < beg+len ? olen : beg+len;
+ for (j = beg; j < end; j++) {
+ rb_ary_push(result, (*func)(obj, j));
}
+ if (beg + len > j)
+ rb_ary_resize(result, RARRAY_LEN(result) + (beg + len) - j);
continue;
}
rb_ary_push(result, (*func)(obj, NUM2LONG(argv[i])));
@@ -1901,54 +2769,59 @@ rb_values_at(obj, olen, argc, argv, func)
return result;
}
-/*
+/*
* call-seq:
- * array.values_at(selector,... ) -> an_array
+ * ary.values_at(selector, ...) -> new_ary
+ *
+ * Returns an array containing the elements in +self+ corresponding to the
+ * given +selector+(s).
+ *
+ * The selectors may be either integer indices or ranges.
+ *
+ * See also Array#select.
*
- * Returns an array containing the elements in
- * _self_ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
- * See also <code>Array#select</code>.
- *
* a = %w{ a b c d e f }
- * a.values_at(1, 3, 5)
- * a.values_at(1, 3, 5, 7)
- * a.values_at(-1, -3, -5, -7)
- * a.values_at(1..3, 2...5)
+ * a.values_at(1, 3, 5) # => ["b", "d", "f"]
+ * a.values_at(1, 3, 5, 7) # => ["b", "d", "f", nil]
+ * a.values_at(-1, -2, -2, -7) # => ["f", "e", "e", nil]
+ * a.values_at(4..6, 3...6) # => ["e", "f", nil, "d", "e", "f"]
*/
static VALUE
-rb_ary_values_at(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
{
- return rb_values_at(ary, RARRAY(ary)->len, argc, argv, rb_ary_entry);
+ return rb_get_values_at(ary, RARRAY_LEN(ary), argc, argv, rb_ary_entry);
}
+
/*
* call-seq:
- * array.select {|item| block } -> an_array
- *
- * Invokes the block passing in successive elements from <i>array</i>,
- * returning an array containing those elements for which the block
- * returns a true value (equivalent to <code>Enumerable#select</code>).
- *
+ * ary.select { |item| block } -> new_ary
+ * ary.select -> Enumerator
+ *
+ * Returns a new array containing all elements of +ary+
+ * for which the given +block+ returns a true value.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
+ *
* a = %w{ a b c d e f }
- * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
+ * a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ *
+ * See also Enumerable#select.
*/
static VALUE
-rb_ary_select(ary)
- VALUE ary;
+rb_ary_select(VALUE ary)
{
VALUE result;
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
- result = rb_ary_new2(RARRAY(ary)->len);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ result = rb_ary_new2(RARRAY_LEN(ary));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
rb_ary_push(result, rb_ary_elt(ary, i));
}
}
@@ -1957,14 +2830,92 @@ rb_ary_select(ary)
/*
* call-seq:
- * array.delete(obj) -> obj or nil
- * array.delete(obj) { block } -> obj or nil
- *
- * Deletes items from <i>self</i> that are equal to <i>obj</i>. If
- * the item is not found, returns <code>nil</code>. If the optional
- * code block is given, returns the result of <i>block</i> if the item
- * is not found.
- *
+ * ary.select! {|item| block } -> ary or nil
+ * ary.select! -> Enumerator
+ *
+ * Invokes the given block passing in successive elements from +self+,
+ * deleting elements for which the block returns a +false+ value.
+ *
+ * If changes were made, it will return +self+, otherwise it returns +nil+.
+ *
+ * See also Array#keep_if
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ */
+
+static VALUE
+rb_ary_select_bang(VALUE ary)
+{
+ long i1, i2;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ rb_ary_modify(ary);
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE v = RARRAY_AREF(ary, i1);
+ if (!RTEST(rb_yield(v))) continue;
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, v);
+ }
+ i2++;
+ }
+
+ if (i1 == i2) return Qnil;
+ if (i2 < i1)
+ ARY_SET_LEN(ary, i2);
+ return ary;
+}
+
+/*
+ * call-seq:
+ * ary.keep_if { |item| block } -> ary
+ * ary.keep_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which the given block evaluates to
+ * +false+.
+ *
+ * See also Array#select!
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * a = %w{ a b c d e f }
+ * a.keep_if { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ */
+
+static VALUE
+rb_ary_keep_if(VALUE ary)
+{
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ rb_ary_select_bang(ary);
+ return ary;
+}
+
+static void
+ary_resize_smaller(VALUE ary, long len)
+{
+ rb_ary_modify(ary);
+ if (RARRAY_LEN(ary) > len) {
+ ARY_SET_LEN(ary, len);
+ if (len * 2 < ARY_CAPA(ary) &&
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
+ ary_resize_capa(ary, len * 2);
+ }
+ }
+}
+
+/*
+ * call-seq:
+ * ary.delete(obj) -> item or nil
+ * ary.delete(obj) { block } -> item or result of block
+ *
+ * Deletes all items from +self+ that are equal to +obj+.
+ *
+ * Returns the last deleted item, or +nil+ if no matching item is found.
+ *
+ * If the optional code block is given, the result of the block is returned if
+ * the item is not found. (To remove +nil+ elements and get an informative
+ * return value, use Array#compact!)
+ *
* a = [ "a", "b", "b", "b", "c" ]
* a.delete("b") #=> "b"
* a #=> ["a", "c"]
@@ -1973,47 +2924,62 @@ rb_ary_select(ary)
*/
VALUE
-rb_ary_delete(ary, item)
- VALUE ary;
- VALUE item;
+rb_ary_delete(VALUE ary, VALUE item)
{
+ VALUE v = item;
long i1, i2;
- for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
- VALUE e = RARRAY(ary)->ptr[i1];
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE e = RARRAY_AREF(ary, i1);
- if (rb_equal(e, item)) continue;
+ if (rb_equal(e, item)) {
+ v = e;
+ continue;
+ }
if (i1 != i2) {
rb_ary_store(ary, i2, e);
}
i2++;
}
- if (RARRAY(ary)->len == i2) {
+ if (RARRAY_LEN(ary) == i2) {
if (rb_block_given_p()) {
return rb_yield(item);
}
return Qnil;
}
- rb_ary_modify(ary);
- if (RARRAY(ary)->len > i2) {
- RARRAY(ary)->len = i2;
- if (i2 * 2 < RARRAY(ary)->aux.capa &&
- RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, i2 * 2);
- RARRAY(ary)->aux.capa = i2 * 2;
+ ary_resize_smaller(ary, i2);
+
+ return v;
+}
+
+void
+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);
+
+ if (e == item) {
+ continue;
+ }
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, e);
}
+ i2++;
+ }
+ if (RARRAY_LEN(ary) == i2) {
+ return;
}
- return item;
+ ary_resize_smaller(ary, i2);
}
VALUE
-rb_ary_delete_at(ary, pos)
- VALUE ary;
- long pos;
+rb_ary_delete_at(VALUE ary, long pos)
{
- long i, len = RARRAY(ary)->len;
+ long len = RARRAY_LEN(ary);
VALUE del;
if (pos >= len) return Qnil;
@@ -2023,52 +2989,48 @@ rb_ary_delete_at(ary, pos)
}
rb_ary_modify(ary);
- del = RARRAY(ary)->ptr[pos];
- for (i = pos + 1; i < len; i++, pos++) {
- RARRAY(ary)->ptr[pos] = RARRAY(ary)->ptr[i];
- }
- RARRAY(ary)->len = pos;
+ del = RARRAY_AREF(ary, pos);
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr+pos, ptr+pos+1, VALUE, len-pos-1);
+ });
+ ARY_INCREASE_LEN(ary, -1);
return del;
}
/*
* call-seq:
- * array.delete_at(index) -> obj or nil
- *
- * Deletes the element at the specified index, returning that element,
- * or <code>nil</code> if the index is out of range. See also
- * <code>Array#slice!</code>.
- *
- * a = %w( ant bat cat dog )
+ * ary.delete_at(index) -> obj or nil
+ *
+ * Deletes the element at the specified +index+, returning that element, or
+ * +nil+ if the +index+ is out of range.
+ *
+ * See also Array#slice!
+ *
+ * a = ["ant", "bat", "cat", "dog"]
* a.delete_at(2) #=> "cat"
* a #=> ["ant", "bat", "dog"]
* a.delete_at(99) #=> nil
*/
static VALUE
-rb_ary_delete_at_m(ary, pos)
- VALUE ary, pos;
+rb_ary_delete_at_m(VALUE ary, VALUE pos)
{
return rb_ary_delete_at(ary, NUM2LONG(pos));
}
/*
* call-seq:
- * array.slice!(index) -> obj or nil
- * array.slice!(start, length) -> sub_array or nil
- * array.slice!(range) -> sub_array or nil
- *
- * Deletes the element(s) given by an index (optionally with a length)
- * or by a range. Returns the deleted object, subarray, or
- * <code>nil</code> if the index is out of range. Equivalent to:
- *
- * def slice!(*args)
- * result = self[*args]
- * self[*args] = nil
- * result
- * end
- *
+ * ary.slice!(index) -> obj or nil
+ * ary.slice!(start, length) -> new_ary or nil
+ * ary.slice!(range) -> new_ary or nil
+ *
+ * Deletes the element(s) given by an +index+ (optionally up to +length+
+ * elements) or by a +range+.
+ *
+ * Returns the deleted object (or objects), or +nil+ if the +index+ is out of
+ * range.
+ *
* a = [ "a", "b", "c" ]
* a.slice!(1) #=> "b"
* a #=> ["a", "c"]
@@ -2079,18 +3041,15 @@ rb_ary_delete_at_m(ary, pos)
*/
static VALUE
-rb_ary_slice_bang(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
{
VALUE arg1, arg2;
long pos, len, orig_len;
rb_ary_modify_check(ary);
- if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
- pos = NUM2LONG(arg1);
- len = NUM2LONG(arg2);
+ if (argc == 2) {
+ pos = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
delete_pos_len:
if (len < 0) return Qnil;
orig_len = RARRAY_LEN(ary);
@@ -2103,12 +3062,18 @@ rb_ary_slice_bang(argc, argv, ary)
len = orig_len - pos;
}
if (len == 0) return rb_ary_new2(0);
- arg2 = rb_ary_new4(len, RARRAY_PTR(ary)+pos);
- RBASIC(arg2)->klass = rb_obj_class(ary);
- rb_ary_splice(ary, pos, len, Qnil); /* Qundef in 1.9 */
+ arg2 = rb_ary_new4(len, RARRAY_CONST_PTR(ary)+pos);
+ RBASIC_SET_CLASS(arg2, rb_obj_class(ary));
+ rb_ary_splice(ary, pos, len, Qundef);
return arg2;
}
+ if (argc != 1) {
+ /* error report */
+ rb_scan_args(argc, argv, "11", NULL, NULL);
+ }
+ arg1 = argv[0];
+
if (!FIXNUM_P(arg1)) {
switch (rb_range_beg_len(arg1, &pos, &len, RARRAY_LEN(ary), 0)) {
case Qtrue:
@@ -2126,170 +3091,254 @@ rb_ary_slice_bang(argc, argv, ary)
return rb_ary_delete_at(ary, NUM2LONG(arg1));
}
-/*
- * call-seq:
- * array.reject! {|item| block } -> array or nil
- *
- * Equivalent to <code>Array#delete_if</code>, deleting elements from
- * _self_ for which the block evaluates to true, but returns
- * <code>nil</code> if no changes were made. Also see
- * <code>Enumerable#reject</code>.
- */
+static VALUE
+ary_reject(VALUE orig, VALUE result)
+{
+ long i;
+
+ for (i = 0; i < RARRAY_LEN(orig); i++) {
+ VALUE v = RARRAY_AREF(orig, i);
+ if (!RTEST(rb_yield(v))) {
+ rb_ary_push(result, v);
+ }
+ }
+ return result;
+}
static VALUE
-rb_ary_reject_bang(ary)
- VALUE ary;
+ary_reject_bang(VALUE ary)
{
- long i1, i2;
+ long i;
+ VALUE result = Qnil;
- RETURN_ENUMERATOR(ary, 0, 0);
- rb_ary_modify(ary);
- for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) {
- VALUE v = RARRAY(ary)->ptr[i1];
- if (RTEST(rb_yield(v))) continue;
- if (i1 != i2) {
- rb_ary_store(ary, i2, v);
+ rb_ary_modify_check(ary);
+ for (i = 0; i < RARRAY_LEN(ary); ) {
+ VALUE v = RARRAY_AREF(ary, i);
+ if (RTEST(rb_yield(v))) {
+ rb_ary_delete_at(ary, i);
+ result = ary;
+ }
+ else {
+ i++;
}
- i2++;
}
- if (RARRAY(ary)->len == i2) return Qnil;
- if (i2 < RARRAY(ary)->len)
- RARRAY(ary)->len = i2;
+ return result;
+}
- return ary;
+/*
+ * call-seq:
+ * ary.reject! { |item| block } -> ary or nil
+ * ary.reject! -> Enumerator
+ *
+ * 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 is changed instantly every time the block is called, not after
+ * the iteration is over.
+ *
+ * See also Enumerable#reject and Array#delete_if.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ */
+
+static VALUE
+rb_ary_reject_bang(VALUE ary)
+{
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ return ary_reject_bang(ary);
}
/*
* call-seq:
- * array.reject {|item| block } -> an_array
- *
- * Returns a new array containing the items in _self_
- * for which the block is not true.
+ * ary.reject {|item| block } -> new_ary
+ * ary.reject -> Enumerator
+ *
+ * Returns a new array containing the items in +self+ for which the given
+ * block is not +true+.
+ *
+ * See also Array#delete_if
+ *
+ * If no block is given, an Enumerator is returned instead.
*/
static VALUE
-rb_ary_reject(ary)
- VALUE ary;
+rb_ary_reject(VALUE ary)
{
- RETURN_ENUMERATOR(ary, 0, 0);
- ary = rb_ary_dup(ary);
- rb_ary_reject_bang(ary);
- return ary;
+ VALUE rejected_ary;
+
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ rejected_ary = rb_ary_new();
+ ary_reject(ary, rejected_ary);
+ return rejected_ary;
}
/*
* call-seq:
- * array.delete_if {|item| block } -> array
- *
- * Deletes every element of <i>self</i> for which <i>block</i> evaluates
- * to <code>true</code>.
- *
- * a = [ "a", "b", "c" ]
- * a.delete_if {|x| x >= "b" } #=> ["a"]
+ * ary.delete_if { |item| block } -> ary
+ * ary.delete_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which block evaluates to +true+.
+ *
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
+ *
+ * See also Array#reject!
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * scores = [ 97, 42, 75 ]
+ * scores.delete_if {|score| score < 80 } #=> [97]
*/
static VALUE
-rb_ary_delete_if(ary)
- VALUE ary;
+rb_ary_delete_if(VALUE ary)
{
- RETURN_ENUMERATOR(ary, 0, 0);
- rb_ary_reject_bang(ary);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
+ ary_reject_bang(ary);
return ary;
}
+static VALUE
+take_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, cbarg))
+{
+ 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);
+ return Qnil;
+}
+
+static VALUE
+take_items(VALUE obj, long n)
+{
+ VALUE result = rb_check_array_type(obj);
+ VALUE args[2];
+
+ if (!NIL_P(result)) return rb_ary_subseq(result, 0, 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));
+ return result;
+}
+
+
/*
* call-seq:
- * array.zip(arg, ...) -> an_array
- * array.zip(arg, ...) {| arr | block } -> nil
- *
- * Converts any arguments to arrays, then merges elements of
- * <i>self</i> with corresponding elements from each argument. This
- * generates a sequence of <code>self.size</code> <em>n</em>-element
- * arrays, where <em>n</em> is one more that the count of arguments. If
- * the size of any argument is less than <code>enumObj.size</code>,
- * <code>nil</code> values are supplied. If a block given, it is
- * invoked for each output array, otherwise an array of arrays is
- * returned.
- *
+ * ary.zip(arg, ...) -> new_ary
+ * ary.zip(arg, ...) { |arr| block } -> nil
+ *
+ * Converts any arguments to arrays, then merges elements of +self+ with
+ * 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.
+ *
+ * If the size of any argument is less than the size of the initial array,
+ * +nil+ values are supplied.
+ *
+ * If a block is given, it is invoked for each output +array+, otherwise an
+ * array of arrays is returned.
+ *
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
- *
- * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
- * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
- * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]]
+ * [1, 2, 3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+ * [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
+ * a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
*/
static VALUE
-rb_ary_zip(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_zip(int argc, VALUE *argv, VALUE ary)
{
int i, j;
- long len;
- VALUE result;
+ long len = RARRAY_LEN(ary);
+ VALUE result = Qnil;
for (i=0; i<argc; i++) {
- argv[i] = to_ary(argv[i]);
+ argv[i] = take_items(argv[i], len);
}
+
if (rb_block_given_p()) {
- for (i=0; i<RARRAY(ary)->len; i++) {
- VALUE tmp = rb_ary_new2(argc+1);
+ int arity = rb_block_arity();
- 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));
+ 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);
+ }
+
+ if (work) ALLOCV_END(work);
+ }
+ 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);
}
- rb_yield(tmp);
}
- return Qnil;
}
- len = RARRAY(ary)->len;
- result = rb_ary_new2(len);
- for (i=0; i<len; i++) {
- VALUE tmp = rb_ary_new2(argc+1);
+ 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, rb_ary_elt(ary, i));
- for (j=0; j<argc; j++) {
- rb_ary_push(tmp, rb_ary_elt(argv[j], i));
+ 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_ary_push(result, tmp);
}
- rb_ary_push(result, tmp);
}
+
return result;
}
/*
* call-seq:
- * array.transpose -> an_array
- *
- * Assumes that <i>self</i> is an array of arrays and transposes the
- * rows and columns.
- *
+ * ary.transpose -> new_ary
+ *
+ * Assumes that +self+ is an array of arrays and transposes the rows and
+ * columns.
+ *
* a = [[1,2], [3,4], [5,6]]
* a.transpose #=> [[1, 3, 5], [2, 4, 6]]
+ *
+ * If the length of the subarrays don't match, an IndexError is raised.
*/
static VALUE
-rb_ary_transpose(ary)
- VALUE ary;
+rb_ary_transpose(VALUE ary)
{
long elen = -1, alen, i, j;
VALUE tmp, result = 0;
- alen = RARRAY(ary)->len;
+ alen = RARRAY_LEN(ary);
if (alen == 0) return rb_ary_dup(ary);
for (i=0; i<alen; i++) {
tmp = to_ary(rb_ary_elt(ary, i));
if (elen < 0) { /* first element */
- elen = RARRAY(tmp)->len;
+ elen = RARRAY_LEN(tmp);
result = rb_ary_new2(elen);
for (j=0; j<elen; j++) {
rb_ary_store(result, j, rb_ary_new2(alen));
}
}
- else if (elen != RARRAY(tmp)->len) {
- rb_raise(rb_eIndexError, "element size differs (%d should be %d)",
- RARRAY(tmp)->len, elen);
+ else if (elen != RARRAY_LEN(tmp)) {
+ rb_raise(rb_eIndexError, "element size differs (%ld should be %ld)",
+ RARRAY_LEN(tmp), elen);
}
for (j=0; j<elen; j++) {
rb_ary_store(rb_ary_elt(result, j), i, rb_ary_elt(tmp, j));
@@ -2300,96 +3349,123 @@ rb_ary_transpose(ary)
/*
* call-seq:
- * array.replace(other_array) -> array
- *
- * Replaces the contents of <i>self</i> with the contents of
- * <i>other_array</i>, truncating or expanding if necessary.
- *
+ * 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.
+ *
* a = [ "a", "b", "c", "d", "e" ]
* a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
* a #=> ["x", "y", "z"]
*/
-static VALUE
-rb_ary_replace(copy, orig)
- VALUE copy, orig;
+VALUE
+rb_ary_replace(VALUE copy, VALUE orig)
{
- VALUE shared;
-
- rb_ary_modify(copy);
+ rb_ary_modify_check(copy);
orig = to_ary(orig);
if (copy == orig) return copy;
- shared = ary_make_shared(orig);
- if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED))
- free(RARRAY(copy)->ptr);
- RARRAY(copy)->ptr = RARRAY(orig)->ptr;
- RARRAY(copy)->len = RARRAY(orig)->len;
- RARRAY(copy)->aux.shared = shared;
- FL_SET(copy, ELTS_SHARED);
+ if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
+ VALUE shared = 0;
+
+ if (ARY_OWNS_HEAP_P(copy)) {
+ RARRAY_PTR_USE(copy, ptr, ruby_sized_xfree(ptr, ARY_HEAP_SIZE(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));
+ if (shared) {
+ rb_ary_decrement_share(shared);
+ }
+ ARY_SET_LEN(copy, RARRAY_LEN(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)));
+ }
+ else {
+ rb_ary_unshare_safe(copy);
+ }
+ FL_UNSET_EMBED(copy);
+ ARY_SET_PTR(copy, RARRAY_CONST_PTR(orig));
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
+ rb_ary_set_shared(copy, shared);
+ }
return copy;
}
-/*
+/*
* call-seq:
- * array.clear -> array
+ * ary.clear -> ary
*
- * Removes all elements from _self_.
+ * Removes all elements from +self+.
*
* a = [ "a", "b", "c", "d", "e" ]
* a.clear #=> [ ]
*/
VALUE
-rb_ary_clear(ary)
- VALUE ary;
+rb_ary_clear(VALUE ary)
{
- rb_ary_modify(ary);
- RARRAY(ary)->len = 0;
- if (ARY_DEFAULT_SIZE * 2 < RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, ARY_DEFAULT_SIZE * 2);
- RARRAY(ary)->aux.capa = ARY_DEFAULT_SIZE * 2;
+ rb_ary_modify_check(ary);
+ ARY_SET_LEN(ary, 0);
+ if (ARY_SHARED_P(ary)) {
+ if (!ARY_EMBED_P(ary)) {
+ rb_ary_unshare(ary);
+ FL_SET_EMBED(ary);
+ }
+ }
+ else if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
+ ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
}
return ary;
}
/*
* call-seq:
- * array.fill(obj) -> array
- * array.fill(obj, start [, length]) -> array
- * array.fill(obj, range ) -> array
- * array.fill {|index| block } -> array
- * array.fill(start [, length] ) {|index| block } -> array
- * array.fill(range) {|index| block } -> array
- *
- * The first three forms set the selected elements of <i>self</i> (which
- * may be the entire array) to <i>obj</i>. A <i>start</i> of
- * <code>nil</code> is equivalent to zero. A <i>length</i> of
- * <code>nil</code> is equivalent to <i>self.length</i>. The last three
- * forms fill the array with the value of the block. The block is
- * passed the absolute index of each element to be filled.
- *
+ * ary.fill(obj) -> ary
+ * ary.fill(obj, start [, length]) -> ary
+ * ary.fill(obj, range ) -> ary
+ * ary.fill { |index| block } -> ary
+ * ary.fill(start [, length] ) { |index| block } -> ary
+ * ary.fill(range) { |index| block } -> ary
+ *
+ * The first three forms set the selected elements of +self+ (which
+ * may be the entire array) to +obj+.
+ *
+ * A +start+ of +nil+ is equivalent to zero.
+ *
+ * A +length+ of +nil+ is equivalent to the length of the array.
+ *
+ * The last three forms fill the array with the value of the given block,
+ * which is passed the absolute index of each element to be filled.
+ *
+ * Negative values of +start+ count from the end of the array, where +-1+ is
+ * the last element.
+ *
* a = [ "a", "b", "c", "d" ]
* a.fill("x") #=> ["x", "x", "x", "x"]
* a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
* a.fill("y", 0..1) #=> ["y", "y", "z", "z"]
- * a.fill {|i| i*i} #=> [0, 1, 4, 9]
- * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27]
+ * a.fill { |i| i*i } #=> [0, 1, 4, 9]
+ * a.fill(-2) { |i| i*i*i } #=> [0, 1, 8, 27]
*/
static VALUE
-rb_ary_fill(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+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 = Qfalse;
+ int block_p = FALSE;
if (rb_block_given_p()) {
- block_p = Qtrue;
+ block_p = TRUE;
rb_scan_args(argc, argv, "02", &arg1, &arg2);
argc += 1; /* hackish */
}
@@ -2399,20 +3475,20 @@ rb_ary_fill(argc, argv, ary)
switch (argc) {
case 1:
beg = 0;
- len = RARRAY(ary)->len;
+ len = RARRAY_LEN(ary);
break;
case 2:
- if (rb_range_beg_len(arg1, &beg, &len, RARRAY(ary)->len, 1)) {
+ if (rb_range_beg_len(arg1, &beg, &len, RARRAY_LEN(ary), 1)) {
break;
}
/* fall through */
case 3:
beg = NIL_P(arg1) ? 0 : NUM2LONG(arg1);
if (beg < 0) {
- beg = RARRAY(ary)->len + beg;
+ beg = RARRAY_LEN(ary) + beg;
if (beg < 0) beg = 0;
}
- len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2);
+ len = NIL_P(arg2) ? RARRAY_LEN(ary) - beg : NUM2LONG(arg2);
break;
}
rb_ary_modify(ary);
@@ -2423,13 +3499,12 @@ rb_ary_fill(argc, argv, ary)
rb_raise(rb_eArgError, "argument too big");
}
end = beg + len;
- if (end > RARRAY(ary)->len) {
- if (end >= RARRAY(ary)->aux.capa) {
- REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
- RARRAY(ary)->aux.capa = end;
+ if (RARRAY_LEN(ary) < end) {
+ if (end >= ARY_CAPA(ary)) {
+ ary_resize_capa(ary, end);
}
- rb_mem_clear(RARRAY(ary)->ptr + RARRAY(ary)->len, end - RARRAY(ary)->len);
- RARRAY(ary)->len = end;
+ ary_mem_clear(ary, RARRAY_LEN(ary), end - RARRAY_LEN(ary));
+ ARY_SET_LEN(ary, end);
}
if (block_p) {
@@ -2438,76 +3513,93 @@ rb_ary_fill(argc, argv, ary)
for (i=beg; i<end; i++) {
v = rb_yield(LONG2NUM(i));
- if (i>=RARRAY(ary)->len) break;
- RARRAY(ary)->ptr[i] = v;
+ if (i>=RARRAY_LEN(ary)) break;
+ ARY_SET(ary, i, v);
}
}
else {
- p = RARRAY(ary)->ptr + beg;
- pend = p + len;
- while (p < pend) {
- *p++ = item;
- }
+ ary_memfill(ary, beg, len, item);
}
return ary;
}
-/*
+/*
* call-seq:
- * array + other_array -> an_array
+ * ary + other_ary -> new_ary
*
- * Concatenation---Returns a new array built by concatenating the
+ * Concatenation --- Returns a new array built by concatenating the
* two arrays together to produce a third array.
- *
+ *
* [ 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.
+ *
+ * See also Array#concat.
*/
VALUE
-rb_ary_plus(x, y)
- VALUE x, y;
+rb_ary_plus(VALUE x, VALUE y)
{
VALUE z;
- long len;
+ long len, xlen, ylen;
y = to_ary(y);
- len = RARRAY(x)->len + RARRAY(y)->len;
+ xlen = RARRAY_LEN(x);
+ ylen = RARRAY_LEN(y);
+ len = xlen + ylen;
z = rb_ary_new2(len);
- MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len);
- MEMCPY(RARRAY(z)->ptr + RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len);
- RARRAY(z)->len = len;
+
+ ary_memcpy(z, 0, xlen, RARRAY_CONST_PTR(x));
+ ary_memcpy(z, xlen, ylen, RARRAY_CONST_PTR(y));
+ ARY_SET_LEN(z, len);
return z;
}
-/*
+/*
* call-seq:
- * array.concat(other_array) -> array
+ * ary.concat(other_ary) -> ary
+ *
+ * Appends the elements of +other_ary+ to +self+.
*
- * Appends the elements in other_array to _self_.
- *
* [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
+ * a = [ 1, 2, 3 ]
+ * a.concat( [ 4, 5 ] )
+ * a #=> [ 1, 2, 3, 4, 5 ]
+ *
+ * See also Array#+.
*/
-
VALUE
-rb_ary_concat(x, y)
- VALUE x, y;
+rb_ary_concat(VALUE x, VALUE y)
{
+ rb_ary_modify_check(x);
y = to_ary(y);
- if (RARRAY(y)->len > 0) {
- rb_ary_splice(x, RARRAY(x)->len, 0, y);
+ if (RARRAY_LEN(y) > 0) {
+ rb_ary_splice(x, RARRAY_LEN(x), 0, y);
}
return x;
}
-/*
+/*
* call-seq:
- * array * int -> an_array
- * array * str -> a_string
+ * ary * int -> new_ary
+ * ary * str -> new_string
+ *
+ * Repetition --- With a String argument, equivalent to
+ * <code>ary.join(str)</code>.
*
- * Repetition---With a String argument, equivalent to
- * self.join(str). Otherwise, returns a new array
- * built by concatenating the _int_ copies of _self_.
+ * Otherwise, returns a new array built by concatenating the +int+ copies of
+ * +self+.
*
*
* [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ]
@@ -2516,11 +3608,11 @@ rb_ary_concat(x, y)
*/
static VALUE
-rb_ary_times(ary, times)
- VALUE ary, times;
+rb_ary_times(VALUE ary, VALUE times)
{
VALUE ary2, tmp;
- long i, len;
+ const VALUE *ptr;
+ long t, len;
tmp = rb_check_string_type(times);
if (!NIL_P(tmp)) {
@@ -2528,37 +3620,50 @@ rb_ary_times(ary, times)
}
len = NUM2LONG(times);
- if (len == 0) return ary_new(rb_obj_class(ary), 0);
+ if (len == 0) {
+ ary2 = ary_new(rb_obj_class(ary), 0);
+ goto out;
+ }
if (len < 0) {
rb_raise(rb_eArgError, "negative argument");
}
- if (ARY_MAX_SIZE/len < RARRAY(ary)->len) {
+ if (ARY_MAX_SIZE/len < RARRAY_LEN(ary)) {
rb_raise(rb_eArgError, "argument too big");
}
- len *= RARRAY(ary)->len;
+ len *= RARRAY_LEN(ary);
ary2 = ary_new(rb_obj_class(ary), len);
- RARRAY(ary2)->len = len;
-
- for (i=0; i<len; i+=RARRAY(ary)->len) {
- MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ ARY_SET_LEN(ary2, len);
+
+ ptr = RARRAY_CONST_PTR(ary);
+ 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));
+ t *= 2;
+ }
+ if (t < len) {
+ ary_memcpy(ary2, t, len-t, RARRAY_CONST_PTR(ary2));
+ }
}
+ out:
OBJ_INFECT(ary2, ary);
return ary2;
}
-/*
+/*
* call-seq:
- * array.assoc(obj) -> an_array 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>.
*
- * Searches through an array whose elements are also arrays
- * comparing _obj_ with the first element of each contained array
- * using obj.==.
- * Returns the first contained array that matches (that
- * is, the first associated array),
- * or +nil+ if no match is found.
- * See also <code>Array#rassoc</code>.
+ * Returns the first contained array that matches (that is, the first
+ * associated array), or +nil+ if no match is found.
+ *
+ * See also Array#rassoc
*
* s1 = [ "colors", "red", "blue", "green" ]
* s2 = [ "letters", "a", "b", "c" ]
@@ -2569,16 +3674,15 @@ rb_ary_times(ary, times)
*/
VALUE
-rb_ary_assoc(ary, key)
- VALUE ary, key;
+rb_ary_assoc(VALUE ary, VALUE key)
{
long i;
VALUE v;
- for (i = 0; i < RARRAY(ary)->len; ++i) {
- v = rb_check_array_type(RARRAY(ary)->ptr[i]);
- if (!NIL_P(v) && RARRAY(v)->len > 0 &&
- rb_equal(RARRAY(v)->ptr[0], key))
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ v = rb_check_array_type(RARRAY_AREF(ary, i));
+ if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
+ rb_equal(RARRAY_AREF(v, 0), key))
return v;
}
return Qnil;
@@ -2586,58 +3690,78 @@ rb_ary_assoc(ary, key)
/*
* call-seq:
- * array.rassoc(key) -> an_array or nil
- *
- * Searches through the array whose elements are also arrays. Compares
- * <em>key</em> with the second element of each contained array using
- * <code>==</code>. Returns the first contained array that matches. See
- * also <code>Array#assoc</code>.
- *
+ * ary.rassoc(obj) -> new_ary or nil
+ *
+ * Searches through the array whose elements are also arrays.
+ *
+ * Compares +obj+ with the second element of each contained array using
+ * <code>obj.==</code>.
+ *
+ * Returns the first contained array that matches +obj+.
+ *
+ * See also Array#assoc.
+ *
* a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ]
* a.rassoc("two") #=> [2, "two"]
* a.rassoc("four") #=> nil
*/
VALUE
-rb_ary_rassoc(ary, value)
- VALUE ary, value;
+rb_ary_rassoc(VALUE ary, VALUE value)
{
long i;
VALUE v;
- for (i = 0; i < RARRAY(ary)->len; ++i) {
- v = RARRAY(ary)->ptr[i];
- if (TYPE(v) == T_ARRAY &&
- RARRAY(v)->len > 1 &&
- rb_equal(RARRAY(v)->ptr[1], value))
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ v = RARRAY_AREF(ary, i);
+ if (RB_TYPE_P(v, T_ARRAY) &&
+ RARRAY_LEN(v) > 1 &&
+ rb_equal(RARRAY_AREF(v, 1), value))
return v;
}
return Qnil;
}
-static VALUE recursive_equal _((VALUE, VALUE, int));
static VALUE
-recursive_equal(ary1, ary2, recur)
- VALUE ary1, ary2;
- int recur;
-{
- long i;
-
- if (recur) return Qfalse;
- for (i=0; i<RARRAY(ary1)->len; i++) {
- if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
- return Qfalse;
+recursive_equal(VALUE ary1, VALUE ary2, int recur)
+{
+ long i, len1;
+ const VALUE *p1, *p2;
+
+ if (recur) return Qtrue; /* Subtle! */
+
+ p1 = RARRAY_CONST_PTR(ary1);
+ p2 = RARRAY_CONST_PTR(ary2);
+ len1 = RARRAY_LEN(ary1);
+
+ for (i = 0; i < len1; i++) {
+ if (*p1 != *p2) {
+ if (rb_equal(*p1, *p2)) {
+ len1 = RARRAY_LEN(ary1);
+ if (len1 != RARRAY_LEN(ary2))
+ return Qfalse;
+ if (len1 < i)
+ return Qtrue;
+ p1 = RARRAY_CONST_PTR(ary1) + i;
+ p2 = RARRAY_CONST_PTR(ary2) + i;
+ }
+ else {
+ return Qfalse;
+ }
+ }
+ p1++;
+ p2++;
}
return Qtrue;
}
-/*
+/*
* call-seq:
- * array == other_array -> bool
+ * ary == other_ary -> bool
*
- * Equality---Two arrays are equal if they contain the same number
- * of elements and if each element is equal to (according to
- * Object.==) the corresponding element in the other array.
+ * Equality --- Two arrays are equal if they contain the same number of
+ * elements and if each element is equal to (according to Object#==) the
+ * corresponding element in +other_ary+.
*
* [ "a", "c" ] == [ "a", "c", 7 ] #=> false
* [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
@@ -2646,30 +3770,27 @@ recursive_equal(ary1, ary2, recur)
*/
static VALUE
-rb_ary_equal(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_equal(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) {
- if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
+ if (!RB_TYPE_P(ary2, T_ARRAY)) {
+ if (!rb_respond_to(ary2, idTo_ary)) {
return Qfalse;
}
return rb_equal(ary2, ary1);
}
- if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
- return rb_exec_recursive(recursive_equal, ary1, ary2);
+ 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);
}
-static VALUE recursive_eql _((VALUE, VALUE, int));
static VALUE
-recursive_eql(ary1, ary2, recur)
- VALUE ary1, ary2;
- int recur;
+recursive_eql(VALUE ary1, VALUE ary2, int recur)
{
long i;
- if (recur) return Qfalse;
- for (i=0; i<RARRAY(ary1)->len; i++) {
+ if (recur) return Qtrue; /* Subtle! */
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
return Qfalse;
}
@@ -2678,82 +3799,76 @@ recursive_eql(ary1, ary2, recur)
/*
* call-seq:
- * array.eql?(other) -> true or false
+ * ary.eql?(other) -> true or false
*
- * Returns <code>true</code> if _array_ and _other_ are the same object,
- * or are both arrays with the same content.
+ * Returns +true+ if +self+ and +other+ are the same object,
+ * or are both arrays with the same content (according to Object#eql?).
*/
static VALUE
-rb_ary_eql(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_eql(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) return Qfalse;
- if (RARRAY(ary1)->len != RARRAY(ary2)->len) return Qfalse;
- return rb_exec_recursive(recursive_eql, ary1, ary2);
-}
-
-static VALUE recursive_hash _((VALUE, VALUE, int));
-static VALUE
-recursive_hash(ary, dummy, recur)
- VALUE ary;
- VALUE dummy;
- int recur;
-{
- long i, h;
- VALUE n;
-
- if (recur) {
- return LONG2FIX(0);
- }
-
- h = RARRAY(ary)->len;
- for (i=0; i<RARRAY(ary)->len; i++) {
- h = (h << 1) | (h<0 ? 1 : 0);
- n = rb_hash(RARRAY(ary)->ptr[i]);
- h ^= NUM2LONG(n);
- }
- return LONG2FIX(h);
+ 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);
}
/*
* call-seq:
- * array.hash -> fixnum
+ * ary.hash -> fixnum
+ *
+ * Compute a hash-code for this array.
+ *
+ * Two arrays with the same content will have the same hash code (and will
+ * compare using #eql?).
*
- * Compute a hash-code for this array. Two arrays with the same content
- * will have the same hash code (and will compare using <code>eql?</code>).
+ * See also Object#hash.
*/
static VALUE
-rb_ary_hash(ary)
- VALUE ary;
+rb_ary_hash(VALUE ary)
{
- return rb_exec_recursive(recursive_hash, ary, 0);
+ 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);
}
/*
* call-seq:
- * array.include?(obj) -> true or false
- *
- * Returns <code>true</code> if the given object is present in
- * <i>self</i> (that is, if any object <code>==</code> <i>anObject</i>),
- * <code>false</code> otherwise.
- *
+ * 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+.
+ *
* a = [ "a", "b", "c" ]
* a.include?("b") #=> true
* a.include?("z") #=> false
*/
VALUE
-rb_ary_includes(ary, item)
- VALUE ary;
- VALUE item;
+rb_ary_includes(VALUE ary, VALUE item)
{
long i;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- if (rb_equal(RARRAY(ary)->ptr[i], item)) {
+ 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:
return Qtrue;
}
}
@@ -2761,22 +3876,19 @@ rb_ary_includes(ary, item)
}
-static VALUE recursive_cmp _((VALUE, VALUE, int));
static VALUE
-recursive_cmp(ary1, ary2, recur)
- VALUE ary1;
- VALUE ary2;
- int recur;
+recursive_cmp(VALUE ary1, VALUE ary2, int recur)
{
long i, len;
- if (recur) return Qnil;
- len = RARRAY(ary1)->len;
- if (len > RARRAY(ary2)->len) {
- len = RARRAY(ary2)->len;
+ if (recur) return Qundef; /* Subtle! */
+ len = RARRAY_LEN(ary1);
+ if (len > RARRAY_LEN(ary2)) {
+ len = RARRAY_LEN(ary2);
}
for (i=0; i<len; i++) {
- VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
+ VALUE e1 = rb_ary_elt(ary1, i), e2 = rb_ary_elt(ary2, i);
+ VALUE v = rb_funcallv(e1, id_cmp, 1, &e2);
if (v != INT2FIX(0)) {
return v;
}
@@ -2784,265 +3896,385 @@ recursive_cmp(ary1, ary2, recur)
return Qundef;
}
-/*
+/*
* call-seq:
- * array <=> other_array -> -1, 0, +1
+ * ary <=> other_ary -> -1, 0, +1 or nil
+ *
+ * Comparison --- Returns an integer (+-1+, +0+, or <code>+1</code>) if this
+ * array is less than, equal to, or greater than +other_ary+.
+ *
+ * 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.
+ *
+ * If all the elements are equal, then the result 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+.
*
- * Comparison---Returns an integer (-1, 0,
- * or +1) if this array is less than, equal to, or greater than
- * other_array. Each object in each array is compared
- * (using <=>). If any value isn't
- * equal, then that inequality is the return value. If all the
- * values found are equal, then the return is based on a
- * comparison of the array lengths. Thus, two arrays are
- * ``equal'' according to <code>Array#<=></code> 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.
- *
* [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
* [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
+ * [ 1, 2 ] <=> [ 1, :two ] #=> nil
*
*/
VALUE
-rb_ary_cmp(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_cmp(VALUE ary1, VALUE ary2)
{
long len;
VALUE v;
- ary2 = to_ary(ary2);
+ ary2 = rb_check_array_type(ary2);
+ if (NIL_P(ary2)) return Qnil;
if (ary1 == ary2) return INT2FIX(0);
- v = rb_exec_recursive(recursive_cmp, ary1, ary2);
+ v = rb_exec_recursive_paired(recursive_cmp, ary1, ary2, ary2);
if (v != Qundef) return v;
- len = RARRAY(ary1)->len - RARRAY(ary2)->len;
+ len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
if (len == 0) return INT2FIX(0);
if (len > 0) return INT2FIX(1);
return INT2FIX(-1);
}
static VALUE
-ary_make_hash(ary1, ary2)
- VALUE ary1, ary2;
+ary_add_hash(VALUE hash, VALUE ary)
{
- VALUE hash = rb_hash_new();
long i;
- for (i=0; i<RARRAY(ary1)->len; i++) {
- rb_hash_aset(hash, RARRAY(ary1)->ptr[i], Qtrue);
+ 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);
+ }
}
- if (ary2) {
- for (i=0; i<RARRAY(ary2)->len; i++) {
- rb_hash_aset(hash, RARRAY(ary2)->ptr[i], Qtrue);
+ return hash;
+}
+
+static inline VALUE
+ary_tmp_hash_new(void)
+{
+ VALUE hash = rb_hash_new();
+
+ RBASIC_CLEAR_CLASS(hash);
+ return hash;
+}
+
+static VALUE
+ary_make_hash(VALUE ary)
+{
+ VALUE hash = ary_tmp_hash_new();
+ return ary_add_hash(hash, ary);
+}
+
+static VALUE
+ary_add_hash_by(VALUE hash, VALUE ary)
+{
+ long i;
+
+ for (i = 0; i < RARRAY_LEN(ary); ++i) {
+ VALUE v = rb_ary_elt(ary, i), k = rb_yield(v);
+ if (rb_hash_lookup2(hash, k, Qundef) == Qundef) {
+ rb_hash_aset(hash, k, v);
}
}
return hash;
}
-/*
+static VALUE
+ary_make_hash_by(VALUE ary)
+{
+ VALUE hash = ary_tmp_hash_new();
+ return ary_add_hash_by(hash, ary);
+}
+
+static inline void
+ary_recycle_hash(VALUE hash)
+{
+ if (RHASH(hash)->ntbl) {
+ st_table *tbl = RHASH(hash)->ntbl;
+ RHASH(hash)->ntbl = 0;
+ st_free_table(tbl);
+ }
+ RB_GC_GUARD(hash);
+}
+
+/*
* call-seq:
- * array - other_array -> an_array
+ * ary - other_ary -> new_ary
+ *
+ * Array Difference
*
- * Array Difference---Returns a new array that is a copy of
- * the original array, removing any items that also appear in
- * other_array. (If you need set-like behavior, see the
- * library class Set.)
+ * 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.
+ *
+ * It compares elements using their #hash and #eql? methods for efficiency.
*
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
+ *
+ * If you need set-like behavior, see the library class Set.
*/
static VALUE
-rb_ary_diff(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_diff(VALUE ary1, VALUE ary2)
{
VALUE ary3;
- volatile VALUE hash;
+ VALUE hash;
long i;
- hash = ary_make_hash(to_ary(ary2), 0);
+ hash = ary_make_hash(to_ary(ary2));
ary3 = rb_ary_new();
- for (i=0; i<RARRAY(ary1)->len; i++) {
- if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue;
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (st_lookup(rb_hash_tbl_raw(hash), RARRAY_AREF(ary1, i), 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
+ ary_recycle_hash(hash);
return ary3;
}
-/*
+/*
* call-seq:
- * array & other_array
+ * ary & other_ary -> new_ary
*
- * Set Intersection---Returns a new array
- * containing elements common to the two arrays, with no duplicates.
+ * Set Intersection --- Returns a new array containing elements common to the
+ * two arrays, excluding any duplicates. The order is preserved from the
+ * original array.
*
- * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * It compares elements using their #hash and #eql? methods for efficiency.
+ *
+ * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
+ *
+ * See also Array#uniq.
*/
static VALUE
-rb_ary_and(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_and(VALUE ary1, VALUE ary2)
{
- VALUE hash, ary3, v, vv;
+ VALUE hash, ary3, v;
+ st_table *table;
+ st_data_t vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY(ary1)->len < RARRAY(ary2)->len ?
- RARRAY(ary1)->len : RARRAY(ary2)->len);
- hash = ary_make_hash(ary2, 0);
-
- for (i=0; i<RARRAY(ary1)->len; i++) {
- v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
+ ary3 = rb_ary_new();
+ if (RARRAY_LEN(ary2) == 0) return ary3;
+ hash = ary_make_hash(ary2);
+ table = rb_hash_tbl_raw(hash);
+
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ v = RARRAY_AREF(ary1, i);
+ vv = (st_data_t)v;
+ if (st_delete(table, &vv, 0)) {
rb_ary_push(ary3, v);
}
}
+ ary_recycle_hash(hash);
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:
- * array | other_array -> an_array
+ * ary | other_ary -> new_ary
*
- * Set Union---Returns a new array by joining this array with
- * other_array, removing duplicates.
+ * Set Union --- Returns a new array by joining +ary+ with +other_ary+,
+ * excluding any duplicates and preserving the order from the original array.
*
- * [ "a", "b", "c" ] | [ "c", "d", "a" ]
- * #=> [ "a", "b", "c", "d" ]
+ * It compares elements using their #hash and #eql? methods for efficiency.
+ *
+ * [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
+ *
+ * See also Array#uniq.
*/
static VALUE
-rb_ary_or(ary1, ary2)
- VALUE ary1, ary2;
+rb_ary_or(VALUE ary1, VALUE ary2)
{
VALUE hash, ary3;
- VALUE v, vv;
long i;
ary2 = to_ary(ary2);
- ary3 = rb_ary_new2(RARRAY(ary1)->len+RARRAY(ary2)->len);
- hash = ary_make_hash(ary1, ary2);
+ hash = ary_make_hash(ary1);
- for (i=0; i<RARRAY(ary1)->len; i++) {
- v = vv = rb_ary_elt(ary1, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
- rb_ary_push(ary3, v);
- }
- }
- for (i=0; i<RARRAY(ary2)->len; i++) {
- v = vv = rb_ary_elt(ary2, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&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);
}
}
+ ary3 = rb_hash_values(hash);
+ ary_recycle_hash(hash);
return ary3;
}
+static int
+push_value(st_data_t key, st_data_t val, st_data_t ary)
+{
+ rb_ary_push((VALUE)ary, (VALUE)val);
+ return ST_CONTINUE;
+}
+
/*
* call-seq:
- * array.uniq! -> array or nil
- *
- * Removes duplicate elements from _self_.
- * Returns <code>nil</code> if no changes are made (that is, no
- * duplicates are found).
- *
+ * ary.uniq! -> ary or nil
+ * ary.uniq! { |item| ... } -> ary or nil
+ *
+ * Removes duplicate elements from +self+.
+ *
+ * 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.
+ *
+ * Returns +nil+ if no changes are made (that is, no duplicates are found).
+ *
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq! #=> ["a", "b", "c"]
+ * a.uniq! # => ["a", "b", "c"]
+ *
* b = [ "a", "b", "c" ]
- * b.uniq! #=> nil
+ * b.uniq! # => nil
+ *
+ * c = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * c.uniq! { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
-rb_ary_uniq_bang(ary)
- VALUE ary;
+rb_ary_uniq_bang(VALUE ary)
{
- VALUE hash, v, vv;
- long i, j;
-
- hash = ary_make_hash(ary, 0);
+ VALUE hash;
+ long hash_size;
- if (RARRAY(ary)->len == RHASH(hash)->tbl->num_entries) {
+ rb_ary_modify_check(ary);
+ if (RARRAY_LEN(ary) <= 1)
+ return Qnil;
+ 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;
}
- for (i=j=0; i<RARRAY(ary)->len; i++) {
- v = vv = rb_ary_elt(ary, i);
- if (st_delete(RHASH(hash)->tbl, (st_data_t*)&vv, 0)) {
- rb_ary_store(ary, j++, v);
- }
+ 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);
}
- RARRAY(ary)->len = j;
+ ary_resize_capa(ary, hash_size);
+ st_foreach(rb_hash_tbl_raw(hash), push_value, ary);
+ ary_recycle_hash(hash);
return ary;
}
/*
* call-seq:
- * array.uniq -> an_array
- *
- * Returns a new array by removing duplicate values in <i>self</i>.
- *
+ * ary.uniq -> new_ary
+ * ary.uniq { |item| ... } -> new_ary
+ *
+ * Returns a new array by removing duplicate values in +self+.
+ *
+ * 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.
+ *
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq #=> ["a", "b", "c"]
+ * a.uniq # => ["a", "b", "c"]
+ *
+ * b = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
-rb_ary_uniq(ary)
- VALUE ary;
+rb_ary_uniq(VALUE ary)
{
- ary = rb_ary_dup(ary);
- rb_ary_uniq_bang(ary);
- return ary;
+ VALUE hash, uniq;
+
+ 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);
+ }
+ else {
+ hash = ary_make_hash(ary);
+ uniq = rb_hash_values(hash);
+ }
+ RBASIC_SET_CLASS(uniq, rb_obj_class(ary));
+ ary_recycle_hash(hash);
+
+ return uniq;
}
-/*
+/*
* call-seq:
- * array.compact! -> array or nil
+ * ary.compact! -> ary or nil
+ *
+ * Removes +nil+ elements from the array.
*
- * Removes +nil+ elements from array.
- * Returns +nil+ if no changes were made.
+ * Returns +nil+ if no changes were made, otherwise returns the array.
*
* [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
* [ "a", "b", "c" ].compact! #=> nil
*/
static VALUE
-rb_ary_compact_bang(ary)
- VALUE ary;
+rb_ary_compact_bang(VALUE ary)
{
VALUE *p, *t, *end;
+ long n;
rb_ary_modify(ary);
- p = t = RARRAY(ary)->ptr;
- end = p + RARRAY(ary)->len;
-
+ p = t = (VALUE *)RARRAY_CONST_PTR(ary); /* WB: no new reference */
+ end = p + RARRAY_LEN(ary);
+
while (t < end) {
if (NIL_P(*t)) t++;
else *p++ = *t++;
}
- if (RARRAY(ary)->len == (p - RARRAY(ary)->ptr)) {
+ n = p - RARRAY_CONST_PTR(ary);
+ if (RARRAY_LEN(ary) == n) {
return Qnil;
}
- RARRAY(ary)->len = RARRAY(ary)->aux.capa = (p - RARRAY(ary)->ptr);
- REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
+ ary_resize_smaller(ary, n);
return ary;
}
/*
* call-seq:
- * array.compact -> an_array
+ * ary.compact -> new_ary
*
- * Returns a copy of _self_ with all +nil+ elements removed.
+ * Returns a copy of +self+ with all +nil+ elements removed.
*
* [ "a", nil, "b", nil, "c", nil ].compact
* #=> [ "a", "b", "c" ]
*/
static VALUE
-rb_ary_compact(ary)
- VALUE ary;
+rb_ary_compact(VALUE ary)
{
ary = rb_ary_dup(ary);
rb_ary_compact_bang(ary);
@@ -3051,72 +4283,50 @@ rb_ary_compact(ary)
/*
* call-seq:
- * array.nitems -> int
- *
- * Returns the number of non-<code>nil</code> elements in _self_.
+ * ary.count -> int
+ * ary.count(obj) -> int
+ * ary.count { |item| block } -> int
*
- * May be zero.
- *
- * [ 1, nil, 3, nil, 5 ].nitems #=> 3
- */
-
-static VALUE
-rb_ary_nitems(ary)
- VALUE ary;
-{
- long n = 0;
- VALUE *p, *pend;
-
- for (p = RARRAY(ary)->ptr, pend = p + RARRAY(ary)->len; p < pend; p++) {
- if (!NIL_P(*p)) n++;
- }
- return LONG2NUM(n);
-}
-
-/*
- * call-seq:
- * array.count -> int
- * array.count(obj) -> int
- * array.count { |item| block } -> int
- *
- * Returns the number of elements. If an argument is given, counts
- * the number of elements which equals to <i>obj</i>. If a block is
- * given, counts the number of elements yielding a true value.
+ * Returns the number of elements.
+ *
+ * If an argument is given, counts the number of elements which equal +obj+
+ * using <code>==</code>.
+ *
+ * If a block is given, counts the number of elements for which the block
+ * returns a true value.
*
* ary = [1, 2, 4, 2]
- * ary.count # => 4
- * ary.count(2) # => 2
- * ary.count{|x|x%2==0} # => 3
+ * ary.count #=> 4
+ * ary.count(2) #=> 2
+ * ary.count { |x| x%2 == 0 } #=> 3
*
*/
static VALUE
-rb_ary_count(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_count(int argc, VALUE *argv, VALUE ary)
{
- long n = 0;
+ long i, n = 0;
if (argc == 0) {
- VALUE *p, *pend;
+ VALUE v;
if (!rb_block_given_p())
return LONG2NUM(RARRAY_LEN(ary));
- for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
- if (RTEST(rb_yield(*p))) n++;
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ v = RARRAY_AREF(ary, i);
+ if (RTEST(rb_yield(v))) n++;
}
}
else {
- VALUE obj, *p, *pend;
+ VALUE obj;
rb_scan_args(argc, argv, "1", &obj);
if (rb_block_given_p()) {
rb_warn("given block not used");
}
- for (p = RARRAY_PTR(ary), pend = p + RARRAY_LEN(ary); p < pend; p++) {
- if (rb_equal(*p, obj)) n++;
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (rb_equal(RARRAY_AREF(ary, i), obj)) n++;
}
}
@@ -3124,10 +4334,7 @@ rb_ary_count(argc, argv, ary)
}
static VALUE
-flatten(ary, level, modified)
- VALUE ary;
- int level;
- int *modified;
+flatten(VALUE ary, int level, int *modified)
{
long i = 0;
VALUE stack, result, tmp, elt;
@@ -3141,13 +4348,13 @@ flatten(ary, level, modified)
*modified = 0;
while (1) {
- while (i < RARRAY(ary)->len) {
- elt = RARRAY(ary)->ptr[i++];
+ while (i < RARRAY_LEN(ary)) {
+ elt = RARRAY_AREF(ary, i++);
tmp = rb_check_array_type(elt);
if (RBASIC(result)->klass) {
rb_raise(rb_eRuntimeError, "flatten reentered");
}
- if (NIL_P(tmp) || (level >= 0 && RARRAY(stack)->len / 2 >= level)) {
+ if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
rb_ary_push(result, elt);
}
else {
@@ -3164,7 +4371,7 @@ flatten(ary, level, modified)
i = 0;
}
}
- if (RARRAY(stack)->len == 0) {
+ if (RARRAY_LEN(stack) == 0) {
break;
}
id = (st_data_t)ary;
@@ -3176,20 +4383,22 @@ flatten(ary, level, modified)
st_free_table(memo);
- RBASIC(result)->klass = rb_class_of(ary);
+ RBASIC_SET_CLASS(result, rb_obj_class(ary));
return result;
}
/*
* call-seq:
- * array.flatten! -> array or nil
- * array.flatten!(level) -> array or nil
- *
- * Flattens _self_ in place.
- * Returns <code>nil</code> if no modifications were made (i.e.,
- * <i>array</i> contains no subarrays.) If the optional <i>level</i>
- * argument determines the level of recursion to flatten.
- *
+ * ary.flatten! -> ary or nil
+ * ary.flatten!(level) -> ary or nil
+ *
+ * Flattens +self+ in place.
+ *
+ * Returns +nil+ if no modifications were made (i.e., the array contains no
+ * subarrays.)
+ *
+ * The optional +level+ argument determines the level of recursion to flatten.
+ *
* a = [ 1, 2, [3, [4, 5] ] ]
* a.flatten! #=> [1, 2, 3, 4, 5]
* a.flatten! #=> nil
@@ -3199,35 +4408,42 @@ flatten(ary, level, modified)
*/
static VALUE
-rb_ary_flatten_bang(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
{
int mod = 0, level = -1;
VALUE result, lv;
rb_scan_args(argc, argv, "01", &lv);
+ rb_ary_modify_check(ary);
if (!NIL_P(lv)) level = NUM2INT(lv);
- if (level == 0) return ary;
+ if (level == 0) return Qnil;
result = flatten(ary, level, &mod);
- if (mod == 0) return Qnil;
+ if (mod == 0) {
+ ary_discard(result);
+ return Qnil;
+ }
+ if (!(mod = ARY_EMBED_P(result))) rb_obj_freeze(result);
rb_ary_replace(ary, result);
+ if (mod) ARY_SET_EMBED_LEN(result, 0);
return ary;
}
/*
* call-seq:
- * array.flatten -> an_array
- * array.flatten(level) -> an_array
- *
- * Returns a new array that is a one-dimensional flattening of this
- * array (recursively). That is, for every element that is an array,
- * extract its elements into the new array. If the optional
- * <i>level</i> argument determines the level of recursion to flatten.
- *
+ * ary.flatten -> new_ary
+ * ary.flatten(level) -> new_ary
+ *
+ * Returns a new array that is a one-dimensional flattening of +self+
+ * (recursively).
+ *
+ * That is, for every element that is an array, extract its elements into
+ * the new array.
+ *
+ * The optional +level+ argument determines the level of recursion to
+ * flatten.
+ *
* s = [ 1, 2, 3 ] #=> [1, 2, 3]
* t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
* a = [ s, t, 9, 10 ] #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]
@@ -3237,117 +4453,276 @@ rb_ary_flatten_bang(argc, argv, ary)
*/
static VALUE
-rb_ary_flatten(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
{
int mod = 0, level = -1;
VALUE result, lv;
rb_scan_args(argc, argv, "01", &lv);
if (!NIL_P(lv)) level = NUM2INT(lv);
- if (level == 0) return ary;
+ if (level == 0) return ary_make_shared_copy(ary);
result = flatten(ary, level, &mod);
- if (OBJ_TAINTED(ary)) OBJ_TAINT(result);
+ OBJ_INFECT(result, ary);
return result;
}
+#define OPTHASH_GIVEN_P(opts) \
+ (argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
+static ID id_random;
+
+#define RAND_UPTO(max) (long)rb_random_ulong_limited((randgen), (max)-1)
+
/*
* call-seq:
- * array.shuffle! -> array or nil
- *
- * Shuffles elements in _self_ in place.
+ * ary.shuffle! -> ary
+ * ary.shuffle!(random: rng) -> ary
+ *
+ * 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(ary)
- VALUE ary;
+rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
{
- long i = RARRAY(ary)->len;
+ VALUE opts, randgen = rb_cRandom;
+ long i, len;
- rb_ary_modify(ary);
- while (i) {
- long j = rb_genrand_real()*i;
- VALUE tmp = RARRAY(ary)->ptr[--i];
- RARRAY(ary)->ptr[i] = RARRAY(ary)->ptr[j];
- RARRAY(ary)->ptr[j] = tmp;
+ 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;
+ }
}
+ 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;
+ }
+ }); /* WB: no new reference */
return ary;
}
/*
* call-seq:
- * array.shuffle -> an_array
- *
- * Returns a new array with elements of this array shuffled.
- *
+ * ary.shuffle -> new_ary
+ * ary.shuffle(random: rng) -> new_ary
+ *
+ * Returns a new array with elements of +self+ shuffled.
+ *
* 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.
+ *
+ * a.shuffle(random: Random.new(1)) #=> [1, 3, 2]
*/
static VALUE
-rb_ary_shuffle(VALUE ary)
+rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
{
ary = rb_ary_dup(ary);
- rb_ary_shuffle_bang(ary);
+ rb_ary_shuffle_bang(argc, argv, ary);
return ary;
}
/*
* call-seq:
- * array.choice -> obj
- *
- * Choose a random element from an array.
+ * ary.sample -> obj
+ * ary.sample(random: rng) -> obj
+ * ary.sample(n) -> new_ary
+ * ary.sample(n, random: rng) -> new_ary
+ *
+ * Choose a random element or +n+ random elements from the array.
+ *
+ * The elements are chosen by using random and unique indices into the array
+ * in order to ensure that an element doesn't repeat itself unless the array
+ * already contained duplicate elements.
+ *
+ * If the array is empty the first form returns +nil+ and the second form
+ * returns an empty array.
+ *
+ * The optional +rng+ argument will be used as the random number generator.
+ *
+ * a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
+ * a.sample #=> 7
+ * a.sample(4) #=> [6, 4, 2, 5]
*/
static VALUE
-rb_ary_choice(ary)
- VALUE ary;
+rb_ary_sample(int argc, VALUE *argv, VALUE ary)
{
- long i, j;
+ VALUE nv, result;
+ 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;
+ }
+ }
+ len = RARRAY_LEN(ary);
+ if (argc == 0) {
+ if (len < 2)
+ i = 0;
+ else
+ i = RAND_UPTO(len);
+
+ return rb_ary_elt(ary, i);
+ }
+ rb_scan_args(argc, argv, "1", &nv);
+ n = NUM2LONG(nv);
+ if (n < 0) rb_raise(rb_eArgError, "negative sample number");
+ if (n > len) n = len;
+ if (n <= numberof(idx)) {
+ for (i = 0; i < n; ++i) {
+ rnds[i] = RAND_UPTO(len - i);
+ }
+ }
+ 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);
+ }
+ }
+ if (n > len) n = len;
+ switch (n) {
+ case 0:
+ return rb_ary_new_capa(0);
+ case 1:
+ i = rnds[0];
+ return rb_ary_new_from_values(1, &RARRAY_AREF(ary, 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));
+ case 3:
+ i = rnds[0];
+ j = rnds[1];
+ k = rnds[2];
+ {
+ long l = j, g = i;
+ 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));
+ }
+ if (n <= numberof(idx)) {
+ long sorted[numberof(idx)];
+ sorted[0] = idx[0] = rnds[0];
+ for (i=1; i<n; i++) {
+ k = rnds[i];
+ for (j = 0; j < i; ++j) {
+ if (k < sorted[j]) break;
+ ++k;
+ }
+ 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]);
+ }
+ });
+ }
+ else {
+ result = rb_ary_dup(ary);
+ RBASIC_CLEAR_CLASS(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);
+ }
+ ARY_SET_LEN(result, n);
- i = RARRAY(ary)->len;
- if (i == 0) return Qnil;
- j = rb_genrand_real()*i;
- return RARRAY(ary)->ptr[j];
+ return result;
}
+static VALUE
+rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
+{
+ long mul;
+ VALUE n = Qnil;
+ if (args && (RARRAY_LEN(args) > 0)) {
+ n = RARRAY_AREF(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);
+}
/*
* call-seq:
- * ary.cycle {|obj| block }
- * ary.cycle(n) {|obj| block }
- *
- * Calls <i>block</i> for each element repeatedly _n_ times or
- * forever if none or nil is given. If a non-positive number is
- * given or the array is empty, does nothing. Returns nil if the
- * loop has finished without getting interrupted.
- *
+ * ary.cycle(n=nil) { |obj| block } -> nil
+ * ary.cycle(n=nil) -> Enumerator
+ *
+ * Calls the given block for each element +n+ times or forever if +nil+ is
+ * given.
+ *
+ * Does nothing if a non-positive number is given or the array is empty.
+ *
+ * Returns +nil+ if the loop has finished without getting interrupted.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
* a = ["a", "b", "c"]
- * a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
- * a.cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
- *
+ * a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
+ * a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
+ *
*/
static VALUE
-rb_ary_cycle(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
{
long n, i;
VALUE nv = Qnil;
rb_scan_args(argc, argv, "01", &nv);
- RETURN_ENUMERATOR(ary, argc, argv);
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_cycle_size);
if (NIL_P(nv)) {
n = -1;
}
@@ -3356,160 +4731,233 @@ rb_ary_cycle(argc, argv, ary)
if (n <= 0) return Qnil;
}
- while (RARRAY(ary)->len > 0 && (n < 0 || 0 < n--)) {
- for (i=0; i<RARRAY(ary)->len; i++) {
- rb_yield(RARRAY(ary)->ptr[i]);
+ while (RARRAY_LEN(ary) > 0 && (n < 0 || 0 < n--)) {
+ for (i=0; i<RARRAY_LEN(ary); i++) {
+ rb_yield(RARRAY_AREF(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 tmpary(n) rb_ary_tmp_new(n)
+#define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))
/*
- * Recursively compute permutations of r elements of the set [0..n-1].
+ * 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>.
+ *
* When we have a complete permutation of array indexes, copy the values
- * at those indexes into a new array and yield that array.
+ * at those indexes into a new array and yield that array.
*
- * n: the size of the set
+ * 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(n, r, p, index, used, values)
- long n, r, *p, index;
- int *used;
- VALUE values;
+permute0(const long n, const long r, long *const p, char *const used, const VALUE values)
{
- long i,j;
- for (i = 0; i < n; i++) {
- if (used[i] == 0) {
+ 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;
p[index] = i;
+ used[i] = 1; /* mark index used */
+ ++index;
if (index < r-1) { /* if not done yet */
- used[i] = 1; /* mark index used */
- permute0(n, r, p, index+1, /* recurse */
- used, values);
- used[i] = 0; /* index unused */
+ p[index] = i = 0;
+ continue;
}
- 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(result)->ptr;
- const VALUE *values_array = RARRAY(values)->ptr;
-
- for (j = 0; j < r; j++) result_array[j] = values_array[p[j]];
- RARRAY(result)->len = r;
- rb_yield(result);
+ for (i = 0; i < n; ++i) {
+ if (used[i]) continue;
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
+ rb_raise(rb_eRuntimeError, "permute reentered");
+ }
}
+ i = p[--index]; /* pop index */
+ used[i] = 0; /* index unused */
+ p[index] = ++i;
}
}
}
/*
+ * Returns the product of from, from-1, ..., from - how_many + 1.
+ * http://en.wikipedia.org/wiki/Pochhammer_symbol
+ */
+static VALUE
+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);
+ }
+ return cnt;
+}
+
+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);
+}
+
+static VALUE
+rb_ary_permutation_size(VALUE ary, VALUE args, VALUE eobj)
+{
+ long n = RARRAY_LEN(ary);
+ long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_AREF(args, 0)) : n;
+
+ return descending_factorial(n, k);
+}
+
+/*
* call-seq:
- * ary.permutation { |p| block } -> array
- * ary.permutation -> enumerator
- * ary.permutation(n) { |p| block } -> array
- * ary.permutation(n) -> enumerator
- *
- * When invoked with a block, yield all permutations of length <i>n</i>
- * of the elements of <i>ary</i>, then return the array itself.
- * If <i>n</i> is not specified, yield all permutations of all elements.
- * The implementation makes no guarantees about the order in which
- * the permutations are yielded.
+ * ary.permutation { |p| block } -> ary
+ * ary.permutation -> Enumerator
+ * ary.permutation(n) { |p| block } -> ary
+ * ary.permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all permutations of length +n+ of the
+ * elements of the array, then return the array itself.
+ *
+ * If +n+ is not specified, yield all permutations of all elements.
+ *
+ * The implementation makes no guarantees about the order in which the
+ * permutations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
- * When invoked without a block, return an enumerator object instead.
- *
* Examples:
*
- * a = [1, 2, 3]
- * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
- * a.permutation(1).to_a #=> [[1],[2],[3]]
- * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
- * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
- * a.permutation(0).to_a #=> [[]] # one permutation of length 0
- * a.permutation(4).to_a #=> [] # no permutations of length 4
+ * a = [1, 2, 3]
+ * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(1).to_a #=> [[1],[2],[3]]
+ * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
+ * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(0).to_a #=> [[]] # one permutation of length 0
+ * a.permutation(4).to_a #=> [] # no permutations of length 4
*/
static VALUE
-rb_ary_permutation(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
{
VALUE num;
long r, n, i;
- n = RARRAY(ary)->len; /* Array length */
- RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
+ n = RARRAY_LEN(ary); /* Array length */
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_permutation_size); /* Return enumerator if no block */
rb_scan_args(argc, argv, "01", &num);
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
- if (r < 0 || n < r) {
+ if (r < 0 || n < r) {
/* no permutations: yield nothing */
}
else if (r == 0) { /* exactly one permutation: the zero-length array */
rb_yield(rb_ary_new2(0));
}
else if (r == 1) { /* this is a special, easy case */
- for (i = 0; i < RARRAY(ary)->len; i++) {
- rb_yield(rb_ary_new3(1, RARRAY(ary)->ptr[i]));
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
else { /* this is the general case */
- volatile VALUE t0 = tmpbuf(n,sizeof(long));
- long *p = (long*)RSTRING(t0)->ptr;
- volatile VALUE t1 = tmpbuf(n,sizeof(int));
- int *used = (int*)RSTRING(t1)->ptr;
- VALUE ary0 = ary_make_shared(ary); /* private defensive copy of ary */
+ volatile VALUE t0;
+ long *p = (long*)ALLOCV(t0, r*sizeof(long)+n*sizeof(char));
+ char *used = (char*)(p + r);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC_CLEAR_CLASS(ary0);
- for (i = 0; i < n; i++) used[i] = 0; /* initialize array */
+ MEMZERO(used, char, n); /* initialize array */
- permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */
- RB_GC_GUARD(t0);
- RB_GC_GUARD(t1);
+ permute0(n, r, p, used, ary0); /* compute and yield permutations */
+ ALLOCV_END(t0);
+ RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
}
-static long
-combi_len(n, k)
- long n, k;
+static void
+combinate0(const long len, const long n, long *const stack, const VALUE values)
{
- long i, val = 1;
+ long lev = 0;
- if (k*2 > n) k = n-k;
- if (k == 0) return 1;
- if (k < 0) return 0;
- val = 1;
- for (i=1; i <= k; i++,n--) {
- long m = val;
- val *= n;
- if (val < m) {
- rb_raise(rb_eRangeError, "too big for combination");
+ MEMZERO(stack+1, long, n);
+ stack[0] = -1;
+ for (;;) {
+ for (lev++; lev < n; lev++) {
+ stack[lev+1] = stack[lev]+1;
}
- val /= i;
+ 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);
}
- return val;
+}
+
+static VALUE
+rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_AREF(args, 0));
+
+ return binomial_coefficient(k, n);
}
/*
* call-seq:
* ary.combination(n) { |c| block } -> ary
- * ary.combination(n) -> enumerator
- *
- * When invoked with a block, yields all combinations of length <i>n</i>
- * of elements from <i>ary</i> and then returns <i>ary</i> itself.
- * The implementation makes no guarantees about the order in which
- * the combinations are yielded.
- *
- * When invoked without a block, returns an enumerator object instead.
- *
+ * ary.combination(n) -> Enumerator
+ *
+ * When invoked with a block, yields all combinations of length +n+ of elements
+ * from the array and then returns the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the
+ * combinations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
* Examples:
*
* a = [1, 2, 3, 4]
@@ -3519,19 +4967,17 @@ combi_len(n, k)
* a.combination(4).to_a #=> [[1,2,3,4]]
* a.combination(0).to_a #=> [[]] # one combination of length 0
* a.combination(5).to_a #=> [] # no combinations of length 5
- *
+ *
*/
static VALUE
-rb_ary_combination(ary, num)
- VALUE ary;
- VALUE num;
+rb_ary_combination(VALUE ary, VALUE num)
{
- long n, i, len;
+ long i, n, len;
n = NUM2LONG(num);
- RETURN_ENUMERATOR(ary, 1, &num);
- len = RARRAY(ary)->len;
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_combination_size);
+ len = RARRAY_LEN(ary);
if (n < 0 || len < n) {
/* yield nothing */
}
@@ -3540,88 +4986,292 @@ rb_ary_combination(ary, num)
}
else if (n == 1) {
for (i = 0; i < len; i++) {
- rb_yield(rb_ary_new3(1, RARRAY(ary)->ptr[i]));
+ rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
else {
- volatile VALUE t0 = tmpbuf(n+1, sizeof(long));
- long *stack = (long*)RSTRING(t0)->ptr;
- long nlen = combi_len(len, n);
- volatile VALUE cc = rb_ary_new2(n);
- VALUE *chosen = RARRAY(cc)->ptr;
- long lev = 0;
-
- RBASIC(cc)->klass = 0;
- MEMZERO(stack, long, n);
- stack[0] = -1;
- for (i = 0; i < nlen; i++) {
- chosen[lev] = RARRAY(ary)->ptr[stack[lev+1]];
- for (lev++; lev < n; lev++) {
- chosen[lev] = RARRAY(ary)->ptr[stack[lev+1] = stack[lev]+1];
+ 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);
+ }
+ return ary;
+}
+
+/*
+ * 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
+ * values at those indexes into a new array and yield that array.
+ *
+ * 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
+ * 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)
+{
+ long i = 0, index = 0;
+
+ p[index] = i;
+ for (;;) {
+ if (++index < r-1) {
+ p[index] = i = 0;
+ continue;
+ }
+ for (i = 0; i < n; ++i) {
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
+ rb_raise(rb_eRuntimeError, "repeated permute reentered");
}
- rb_yield(rb_ary_new4(n, chosen));
- do {
- stack[lev--]++;
- } while (lev && (stack[lev+1]+n == len+lev+1));
}
+ do {
+ if (index <= 0) return;
+ } while ((i = ++p[--index]) >= n);
+ }
+}
+
+static VALUE
+rb_ary_repeated_permutation_size(VALUE ary, VALUE args, VALUE eobj)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_AREF(args, 0));
+ VALUE v;
+
+ if (k < 0) {
+ return LONG2FIX(0);
+ }
+
+ v = LONG2NUM(k);
+ return rb_funcallv(LONG2NUM(n), id_power, 1, &v);
+}
+
+/*
+ * call-seq:
+ * ary.repeated_permutation(n) { |p| block } -> ary
+ * ary.repeated_permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all repeated permutations of length +n+ of
+ * the elements of the array, then return the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the repeated
+ * permutations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2]
+ * a.repeated_permutation(1).to_a #=> [[1], [2]]
+ * a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
+ * a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
+ * # [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
+ * a.repeated_permutation(0).to_a #=> [[]] # one permutation of length 0
+ */
+
+static VALUE
+rb_ary_repeated_permutation(VALUE ary, VALUE num)
+{
+ long r, n, i;
+
+ n = RARRAY_LEN(ary); /* Array length */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_permutation_size); /* Return Enumerator if no block */
+ r = NUM2LONG(num); /* Permutation size from argument */
+
+ if (r < 0) {
+ /* no permutations: yield nothing */
+ }
+ else if (r == 0) { /* exactly one permutation: the zero-length array */
+ rb_yield(rb_ary_new2(0));
+ }
+ 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)));
+ }
+ }
+ else { /* this is the general case */
+ volatile VALUE t0;
+ long *p = ALLOCV_N(long, t0, r);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC_CLEAR_CLASS(ary0);
+
+ rpermute0(n, r, p, ary0); /* compute and yield repeated permutations */
+ ALLOCV_END(t0);
+ RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
+ }
+ return ary;
+}
+
+static void
+rcombinate0(const long n, const long r, long *const p, const long rest, const VALUE values)
+{
+ long i = 0, index = 0;
+
+ p[index] = i;
+ for (;;) {
+ if (++index < r-1) {
+ p[index] = i;
+ continue;
+ }
+ for (; i < n; ++i) {
+ p[index] = i;
+ if (!yield_indexed_values(values, r, p)) {
+ 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)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_AREF(args, 0));
+ if (k == 0) {
+ return LONG2FIX(1);
+ }
+ return binomial_coefficient(k, n + k - 1);
+}
+
+/*
+ * call-seq:
+ * ary.repeated_combination(n) { |c| block } -> ary
+ * ary.repeated_combination(n) -> Enumerator
+ *
+ * When invoked with a block, yields all repeated combinations of length +n+ of
+ * elements from the array and then returns the array itself.
+ *
+ * The implementation makes no guarantees about the order in which the repeated
+ * combinations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * Examples:
+ *
+ * a = [1, 2, 3]
+ * a.repeated_combination(1).to_a #=> [[1], [2], [3]]
+ * a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
+ * a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
+ * # [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
+ * a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
+ * # [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
+ * # [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
+ * a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
+ *
+ */
+
+static VALUE
+rb_ary_repeated_combination(VALUE ary, VALUE num)
+{
+ long n, i, len;
+
+ n = NUM2LONG(num); /* Combination size from argument */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_combination_size); /* Return enumerator if no block */
+ len = RARRAY_LEN(ary);
+ if (n < 0) {
+ /* yield nothing */
+ }
+ else if (n == 0) {
+ rb_yield(rb_ary_new2(0));
+ }
+ else if (n == 1) {
+ for (i = 0; i < len; i++) {
+ rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
+ }
+ }
+ else if (len == 0) {
+ /* yield nothing */
+ }
+ else {
+ volatile VALUE t0;
+ long *p = ALLOCV_N(long, t0, n);
+ VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
+ RBASIC_CLEAR_CLASS(ary0);
+
+ rcombinate0(len, n, p, n, ary0); /* compute and yield repeated combinations */
+ ALLOCV_END(t0);
+ RBASIC_SET_CLASS_RAW(ary0, rb_cArray);
}
return ary;
}
/*
* call-seq:
- * ary.product(other_ary, ...)
- *
+ * ary.product(other_ary, ...) -> new_ary
+ * ary.product(other_ary, ...) { |p| block } -> ary
+ *
* Returns an array of all combinations of elements from all arrays.
- * The length of the returned array is the product of the length
- * of ary and the argument arrays
- *
- * [1,2,3].product([4,5]) # => [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
- * [1,2].product([1,2]) # => [[1,1],[1,2],[2,1],[2,2]]
- * [1,2].product([3,4],[5,6]) # => [[1,3,5],[1,3,6],[1,4,5],[1,4,6],
+ *
+ * The length of the returned array is the product of the length of +self+ and
+ * the argument arrays.
+ *
+ * If given a block, #product will yield all combinations and return +self+
+ * instead.
+ *
+ * [1,2,3].product([4,5]) #=> [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
+ * [1,2].product([1,2]) #=> [[1,1],[1,2],[2,1],[2,2]]
+ * [1,2].product([3,4],[5,6]) #=> [[1,3,5],[1,3,6],[1,4,5],[1,4,6],
* # [2,3,5],[2,3,6],[2,4,5],[2,4,6]]
- * [1,2].product() # => [[1],[2]]
- * [1,2].product([]) # => []
+ * [1,2].product() #=> [[1],[2]]
+ * [1,2].product([]) #=> []
*/
static VALUE
-rb_ary_product(argc, argv, ary)
- int argc;
- VALUE *argv;
- VALUE ary;
+rb_ary_product(int argc, VALUE *argv, VALUE ary)
{
int n = argc+1; /* How many arrays we're operating on */
- volatile VALUE t0 = tmpbuf(n, sizeof(VALUE));
+ volatile VALUE t0 = tmpary(n);
volatile VALUE t1 = tmpbuf(n, sizeof(int));
- VALUE *arrays = (VALUE*)RSTRING(t0)->ptr; /* The arrays we're computing the product of */
- int *counters = (int*)RSTRING(t1)->ptr; /* The current position in each one */
- VALUE result; /* The array we'll be returning */
+ VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */
+ int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
+ VALUE result = Qnil; /* The array we'll be returning, when no block given */
long i,j;
long resultlen = 1;
- RBASIC(t0)->klass = 0;
- RBASIC(t1)->klass = 0;
+ RBASIC_CLEAR_CLASS(t0);
+ RBASIC_CLEAR_CLASS(t1);
/* initialize the arrays of arrays */
+ ARY_SET_LEN(t0, n);
arrays[0] = ary;
+ for (i = 1; i < n; i++) arrays[i] = Qnil;
for (i = 1; i < n; i++) arrays[i] = to_ary(argv[i-1]);
-
+
/* initialize the counters for the arrays */
for (i = 0; i < n; i++) counters[i] = 0;
- /* Compute the length of the result array; return [] if any is empty */
- for (i = 0; i < n; i++) {
- long k = RARRAY(arrays[i])->len, l = resultlen;
- if (k == 0) return rb_ary_new2(0);
- resultlen *= k;
- if (resultlen < k || resultlen < l || resultlen / k != l) {
- rb_raise(rb_eRangeError, "too big to product");
+ /* Otherwise, allocate and fill in an array of results */
+ if (rb_block_given_p()) {
+ /* Make defensive copies of arrays; exit if any is empty */
+ for (i = 0; i < n; i++) {
+ if (RARRAY_LEN(arrays[i]) == 0) goto done;
+ arrays[i] = ary_make_shared_copy(arrays[i]);
}
}
-
- /* Otherwise, allocate and fill in an array of results */
- result = rb_ary_new2(resultlen);
- for (i = 0; i < resultlen; i++) {
+ 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]);
+ 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;
+ }
+ result = rb_ary_new2(resultlen);
+ }
+ for (;;) {
int m;
/* fill in one subarray */
VALUE subarray = rb_ary_new2(n);
@@ -3630,7 +5280,19 @@ rb_ary_product(argc, argv, ary)
}
/* put it on the result array */
- rb_ary_push(result, subarray);
+ if (NIL_P(result)) {
+ FL_SET(t0, FL_USER5);
+ rb_yield(subarray);
+ if (! FL_TEST(t0, FL_USER5)) {
+ rb_raise(rb_eRuntimeError, "product reentered");
+ }
+ else {
+ FL_UNSET(t0, FL_USER5);
+ }
+ }
+ else {
+ rb_ary_push(result, subarray);
+ }
/*
* Increment the last counter. If it overflows, reset to 0
@@ -3638,81 +5300,92 @@ rb_ary_product(argc, argv, ary)
*/
m = n-1;
counters[m]++;
- while (m > 0 && counters[m] == RARRAY(arrays[m])->len) {
+ while (counters[m] == RARRAY_LEN(arrays[m])) {
counters[m] = 0;
- m--;
+ /* If the first counter overflows, we are done */
+ if (--m < 0) goto done;
counters[m]++;
}
}
+done:
+ tmpary_discard(t0);
+ tmpbuf_discard(t1);
- return result;
+ return NIL_P(result) ? ary : result;
}
/*
* call-seq:
- * ary.take(n) => array
- *
- * Returns first n elements from <i>ary</i>.
- *
+ * ary.take(n) -> new_ary
+ *
+ * Returns first +n+ elements from the array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#drop
+ *
* a = [1, 2, 3, 4, 5, 0]
- * a.take(3) # => [1, 2, 3]
- *
+ * a.take(3) #=> [1, 2, 3]
+ *
*/
static VALUE
-rb_ary_take(obj, n)
- VALUE obj;
- VALUE n;
+rb_ary_take(VALUE obj, VALUE n)
{
long len = NUM2LONG(n);
if (len < 0) {
rb_raise(rb_eArgError, "attempt to take negative size");
}
-
return rb_ary_subseq(obj, 0, len);
}
/*
* call-seq:
- * ary.take_while {|arr| block } => array
- *
- * Passes elements to the block until the block returns nil or false,
- * then stops iterating and returns an array of all prior elements.
- *
+ * ary.take_while { |arr| block } -> new_ary
+ * ary.take_while -> Enumerator
+ *
+ * Passes elements to the block until the block returns +nil+ or +false+, then
+ * stops iterating and returns an array of all prior elements.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * See also Array#drop_while
+ *
* a = [1, 2, 3, 4, 5, 0]
- * a.take_while {|i| i < 3 } # => [1, 2]
- *
+ * a.take_while { |i| i < 3 } #=> [1, 2]
+ *
*/
static VALUE
-rb_ary_take_while(ary)
- VALUE ary;
+rb_ary_take_while(VALUE ary)
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- if (!RTEST(rb_yield(RARRAY(ary)->ptr[i]))) break;
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (!RTEST(rb_yield(RARRAY_AREF(ary, i)))) break;
}
return rb_ary_take(ary, LONG2FIX(i));
}
/*
* call-seq:
- * ary.drop(n) => array
- *
- * Drops first n elements from <i>ary</i>, and returns rest elements
- * in an array.
- *
+ * ary.drop(n) -> new_ary
+ *
+ * Drops first +n+ elements from +ary+ and returns the rest of the elements in
+ * an array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#take
+ *
* a = [1, 2, 3, 4, 5, 0]
- * a.drop(3) # => [4, 5, 0]
- *
+ * a.drop(3) #=> [4, 5, 0]
+ *
*/
static VALUE
-rb_ary_drop(ary, n)
- VALUE ary;
- VALUE n;
+rb_ary_drop(VALUE ary, VALUE n)
{
VALUE result;
long pos = NUM2LONG(n);
@@ -3720,60 +5393,322 @@ rb_ary_drop(ary, n)
rb_raise(rb_eArgError, "attempt to drop negative size");
}
- result = rb_ary_subseq(ary, pos, RARRAY(ary)->len);
+ result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
if (result == Qnil) result = rb_ary_new();
return result;
}
/*
* call-seq:
- * ary.drop_while {|arr| block } => array
- *
- * Drops elements up to, but not including, the first element for
- * which the block returns nil or false and returns an array
- * containing the remaining elements.
- *
+ * ary.drop_while { |arr| block } -> new_ary
+ * ary.drop_while -> Enumerator
+ *
+ * Drops elements up to, but not including, the first element for which the
+ * block returns +nil+ or +false+ and returns an array containing the
+ * remaining elements.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * See also Array#take_while
+ *
* a = [1, 2, 3, 4, 5, 0]
- * a.drop_while {|i| i < 3 } # => [3, 4, 5, 0]
- *
+ * a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]
+ *
*/
static VALUE
-rb_ary_drop_while(ary)
- VALUE ary;
+rb_ary_drop_while(VALUE ary)
{
long i;
RETURN_ENUMERATOR(ary, 0, 0);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- if (!RTEST(rb_yield(RARRAY(ary)->ptr[i]))) break;
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ if (!RTEST(rb_yield(RARRAY_AREF(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;
+}
-/* Arrays are ordered, integer-indexed collections of any object.
- * Array indexing starts at 0, as in C or Java. A negative index is
- * assumed to be relative to the end of the array---that is, an index of -1
- * indicates the last element of the array, -2 is the next to last
- * element in the array, and so on.
+/*
+ * Arrays are ordered, integer-indexed collections of any object.
+ *
+ * Array indexing starts at 0, as in C or Java. A negative index is assumed
+ * to be relative to the end of the array---that is, an index of -1 indicates
+ * the last element of the array, -2 is the next to last element in the
+ * array, and so on.
+ *
+ * == Creating Arrays
+ *
+ * A new array can be created by using the literal constructor
+ * <code>[]</code>. Arrays can contain different types of objects. For
+ * example, the array below contains an Integer, a String and a Float:
+ *
+ * ary = [1, "two", 3.0] #=> [1, "two", 3.0]
+ *
+ * An array can also be created by explicitly calling Array.new with zero, one
+ * (the initial size of the Array) or two arguments (the initial size and a
+ * default object).
+ *
+ * ary = Array.new #=> []
+ * Array.new(3) #=> [nil, nil, nil]
+ * Array.new(3, true) #=> [true, true, true]
+ *
+ * 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
+ * instantiate arrays with natively immutable objects such as Symbols,
+ * numbers, true or false.
+ *
+ * To create an array with separate objects a block can be passed instead.
+ * This method is safe to use with mutable objects such as hashes, strings or
+ * other arrays:
+ *
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ *
+ * This is also a quick way to build up multi-dimensional arrays:
+ *
+ * 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
+ * Array class has proprietary methods for accessing, searching and otherwise
+ * manipulating arrays.
+ *
+ * Some of the more common ones are illustrated below.
+ *
+ * == Accessing Elements
+ *
+ * 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.
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr[2] #=> 3
+ * arr[100] #=> nil
+ * 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
+ *
+ * arr.at(0) #=> 1
+ *
+ * The #slice method works in an identical manner to Array#[].
+ *
+ * To raise an error for indices outside of the array bounds or else to
+ * provide a default value when that happens, you can use #fetch.
+ *
+ * arr = ['a', 'b', 'c', 'd', 'e', 'f']
+ * arr.fetch(100) #=> IndexError: index 100 outside of array bounds: -6...6
+ * arr.fetch(100, "oops") #=> "oops"
+ *
+ * The special methods #first and #last will return the first and last
+ * elements of an array, respectively.
+ *
+ * arr.first #=> 1
+ * arr.last #=> 6
+ *
+ * To return the first +n+ elements of an array, use #take
+ *
+ * arr.take(3) #=> [1, 2, 3]
+ *
+ * #drop does the opposite of #take, by returning the elements after +n+
+ * elements have been dropped:
+ *
+ * arr.drop(3) #=> [4, 5, 6]
+ *
+ * == Obtaining Information about an Array
+ *
+ * Arrays keep track of their own length at all times. To query an array
+ * about the number of elements it contains, use #length, #count or #size.
+ *
+ * browsers = ['Chrome', 'Firefox', 'Safari', 'Opera', 'IE']
+ * browsers.length #=> 5
+ * browsers.count #=> 5
+ *
+ * To check whether an array contains any elements at all
+ *
+ * browsers.empty? #=> false
+ *
+ * To check whether a particular item is included in the array
+ *
+ * browsers.include?('Konqueror') #=> false
+ *
+ * == Adding Items to Arrays
+ *
+ * Items can be added to the end of an array by using either #push or #<<
+ *
+ * arr = [1, 2, 3, 4]
+ * arr.push(5) #=> [1, 2, 3, 4, 5]
+ * arr << 6 #=> [1, 2, 3, 4, 5, 6]
+ *
+ * #unshift will add a new item to the beginning of an array.
+ *
+ * arr.unshift(0) #=> [0, 1, 2, 3, 4, 5, 6]
+ *
+ * With #insert you can add a new element to an array at any position.
+ *
+ * arr.insert(3, 'apple') #=> [0, 1, 2, 'apple', 3, 4, 5, 6]
+ *
+ * Using the #insert method, you can also insert multiple values at once:
+ *
+ * arr.insert(3, 'orange', 'pear', 'grapefruit')
+ * #=> [0, 1, 2, "orange", "pear", "grapefruit", "apple", 3, 4, 5, 6]
+ *
+ * == Removing Items from an Array
+ *
+ * The method #pop removes the last element in an array and returns it:
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.pop #=> 6
+ * arr #=> [1, 2, 3, 4, 5]
+ *
+ * To retrieve and at the same time remove the first item, use #shift:
+ *
+ * arr.shift #=> 1
+ * arr #=> [2, 3, 4, 5]
+ *
+ * To delete an element at a particular index:
+ *
+ * arr.delete_at(2) #=> 4
+ * arr #=> [2, 3, 5]
+ *
+ * To delete a particular element anywhere in an array, use #delete:
+ *
+ * arr = [1, 2, 2, 3]
+ * arr.delete(2) #=> 2
+ * arr #=> [1,3]
+ *
+ * A useful method if you need to remove +nil+ values from an array is
+ * #compact:
+ *
+ * arr = ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact! #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, 'bar', 7, 'baz']
+ *
+ * Another common need is to remove duplicate elements from an array.
+ *
+ * It has the non-destructive #uniq, and destructive method #uniq!
+ *
+ * arr = [2, 5, 6, 556, 6, 6, 8, 9, 0, 123, 556]
+ * arr.uniq #=> [2, 5, 6, 556, 8, 9, 0, 123]
+ *
+ * == Iterating over Arrays
+ *
+ * Like all classes that include the Enumerable module, Array has an each
+ * method, which defines what elements should be iterated over and how. In
+ * case of Array's #each, all elements in the Array instance are yielded to
+ * the supplied block in sequence.
+ *
+ * Note that this operation leaves the array unchanged.
+ *
+ * arr = [1, 2, 3, 4, 5]
+ * arr.each { |a| print a -= 10, " " }
+ * # prints: -9 -8 -7 -6 -5
+ * #=> [1, 2, 3, 4, 5]
+ *
+ * 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]
+ * str = ""
+ * words.reverse_each { |word| str += "#{word} " }
+ * p str #=> "sixth fifth fourth third second first "
+ *
+ * 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:
+ *
+ * arr.map { |a| 2*a } #=> [2, 4, 6, 8, 10]
+ * arr #=> [1, 2, 3, 4, 5]
+ * arr.map! { |a| a**2 } #=> [1, 4, 9, 16, 25]
+ * arr #=> [1, 4, 9, 16, 25]
+ *
+ * == Selecting Items from an Array
+ *
+ * Elements can be selected from an array according to criteria defined in a
+ * block. The selection can happen in a destructive or a non-destructive
+ * manner. While the destructive operations will modify the array they were
+ * called on, the non-destructive methods usually return a new array with the
+ * selected elements, but leave the original array unchanged.
+ *
+ * === Non-destructive Selection
+ *
+ * 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.drop_while { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [1, 2, 3, 4, 5, 6]
+ *
+ * === Destructive Selection
+ *
+ * #select! and #reject! are the corresponding destructive methods to #select
+ * and #reject
+ *
+ * Similar to #select vs. #reject, #delete_if and #keep_if have the exact
+ * opposite result when supplied with the same block:
+ *
+ * arr.delete_if { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [4, 5, 6]
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.keep_if { |a| a < 4 } #=> [1, 2, 3]
+ * arr #=> [1, 2, 3]
+ *
*/
void
-Init_Array()
+Init_Array(void)
{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
rb_cArray = rb_define_class("Array", rb_cObject);
rb_include_module(rb_cArray, rb_mEnumerable);
- rb_define_alloc_func(rb_cArray, ary_alloc);
+ rb_define_alloc_func(rb_cArray, empty_ary_alloc);
rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
+ rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
rb_define_method(rb_cArray, "initialize_copy", rb_ary_replace, 1);
- rb_define_method(rb_cArray, "to_s", rb_ary_to_s, 0);
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);
@@ -3803,18 +5738,21 @@ Init_Array()
rb_define_method(rb_cArray, "find_index", rb_ary_index, -1);
rb_define_method(rb_cArray, "index", rb_ary_index, -1);
rb_define_method(rb_cArray, "rindex", rb_ary_rindex, -1);
- rb_define_method(rb_cArray, "indexes", rb_ary_indexes, -1);
- rb_define_method(rb_cArray, "indices", rb_ary_indexes, -1);
rb_define_method(rb_cArray, "join", rb_ary_join_m, -1);
rb_define_method(rb_cArray, "reverse", rb_ary_reverse_m, 0);
rb_define_method(rb_cArray, "reverse!", rb_ary_reverse_bang, 0);
+ rb_define_method(rb_cArray, "rotate", rb_ary_rotate_m, -1);
+ rb_define_method(rb_cArray, "rotate!", rb_ary_rotate_bang, -1);
rb_define_method(rb_cArray, "sort", rb_ary_sort, 0);
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
+ rb_define_method(rb_cArray, "sort_by!", rb_ary_sort_by_bang, 0);
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "select", rb_ary_select, 0);
+ rb_define_method(rb_cArray, "select!", rb_ary_select_bang, 0);
+ rb_define_method(rb_cArray, "keep_if", rb_ary_keep_if, 0);
rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1);
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1);
@@ -3848,21 +5786,26 @@ Init_Array()
rb_define_method(rb_cArray, "compact!", rb_ary_compact_bang, 0);
rb_define_method(rb_cArray, "flatten", rb_ary_flatten, -1);
rb_define_method(rb_cArray, "flatten!", rb_ary_flatten_bang, -1);
- rb_define_method(rb_cArray, "nitems", rb_ary_nitems, 0);
rb_define_method(rb_cArray, "count", rb_ary_count, -1);
- rb_define_method(rb_cArray, "shuffle!", rb_ary_shuffle_bang, 0);
- rb_define_method(rb_cArray, "shuffle", rb_ary_shuffle, 0);
- rb_define_method(rb_cArray, "choice", rb_ary_choice, 0);
+ rb_define_method(rb_cArray, "shuffle!", rb_ary_shuffle_bang, -1);
+ rb_define_method(rb_cArray, "shuffle", rb_ary_shuffle, -1);
+ rb_define_method(rb_cArray, "sample", rb_ary_sample, -1);
rb_define_method(rb_cArray, "cycle", rb_ary_cycle, -1);
rb_define_method(rb_cArray, "permutation", rb_ary_permutation, -1);
rb_define_method(rb_cArray, "combination", rb_ary_combination, 1);
+ rb_define_method(rb_cArray, "repeated_permutation", rb_ary_repeated_permutation, 1);
+ rb_define_method(rb_cArray, "repeated_combination", rb_ary_repeated_combination, 1);
rb_define_method(rb_cArray, "product", rb_ary_product, -1);
rb_define_method(rb_cArray, "take", rb_ary_take, 1);
rb_define_method(rb_cArray, "take_while", rb_ary_take_while, 0);
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, "any?", rb_ary_any_p, 0);
id_cmp = rb_intern("<=>");
- inspect_key = rb_intern("__inspect_key__");
+ id_random = rb_intern("random");
+ id_div = rb_intern("div");
+ id_power = rb_intern("**");
}
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
deleted file mode 100644
index 713b5c69df..0000000000
--- a/bcc32/Makefile.sub
+++ /dev/null
@@ -1,549 +0,0 @@
-# -*- makefile -*-
-
-SHELL = $(COMSPEC)
-MKFILES = Makefile
-
-#### Start of system configuration section. ####
-!ifndef OS
-OS = bccwin32
-!endif
-!if !defined(RT)
-!error RT not defined. Retry from configure pass.
-!endif
-
-## 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)
-!endif
-!ifndef icondirs
-!ifdef ICONDIRS
-icondirs=$(ICONDIRS)
-!endif
-!endif
-!ifdef icondirs
-icondirs=$(icondirs:\=/)
-iconinc=-I$(icondirs: = -I)
-!endif
-###############
-
-VPATH = $(srcdir):$(srcdir)/missing
-.SUFFIXES: .y
-
-!ifndef CC
-CC = bcc32
-!endif
-!ifndef CPP
-CPP = cpp32
-!endif
-!ifndef RC
-RC = brcc32
-!endif
-!ifndef YACC
-YACC = byacc
-!endif
-!ifndef AR
-AR = tlib
-!endif
-
-PURIFY =
-AUTOCONF = autoconf
-RM = $(srcdir:/=\)\win32\rm.bat
-
-!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 = /share
-!endif
-!ifndef EXTOUT
-EXTOUT = .ext
-!endif
-!ifndef RIDATADIR
-RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
-!endif
-!ifndef TESTUI
-TESTUI = console
-!endif
-!ifndef TESTS
-TESTS =
-!endif
-!ifndef RDOCTARGET
-RDOCTARGET = install-nodoc
-!endif
-
-OUTFLAG = -o
-!ifndef CFLAGS
-CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
-!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 crypt.obj erf.obj win32.obj
-
-!ifndef STACK
-STACK = 0x2000000
-!endif
-
-XCFLAGS = -DRUBY_EXPORT -I. -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) "$(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)
-
-PREP = miniruby$(EXEEXT)
-
-OBJEXT = obj
-
-INSTALLED_LIST= .installed.list
-
-WINMAINOBJ = winmain.$(OBJEXT)
-MINIOBJS = dmydln.$(OBJEXT)
-
-.path.c = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
-.path.h = .;$(srcdir);$(srcdir)/win32;$(srcdir)/missing
-.path.y = $(srcdir)
-.path. = $(srcdir)
-
-.c.obj:
- $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
-
-.rc.res:
- $(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:/=\)
-
-.y.c:
- $(YACC) $(YFLAGS) $(<:\=/)
- sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
- @del y.tab.c
-
-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
-|
-
-CONFIG_H = ./.config.h.time
-
-config: config.status
-
-config.status: $(CONFIG_H)
-
-$(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
- @$(srcdir:/=\)\win32\ifchange.bat config.h &&|
-\#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_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 4
-\#define SIZEOF_VOIDP 4
-\#define SIZEOF_FLOAT 4
-\#define SIZEOF_DOUBLE 8
-\#define SIZEOF_TIME_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
-\#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_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_CHSIZE 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 DLEXT ".so"
-\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
-\#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
-\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
-\#define RUBY_VENDOR_LIB "/lib/ruby/vendor_ruby"
-\#define RUBY_VENDOR_LIB2 "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)"
-\#define RUBY_PLATFORM "$(ARCH)-$(OS)"
-\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
-\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
-\#define RUBY_VENDOR_ARCHLIB "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
-|
- @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,@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@,,;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,@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,@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,@CP@,copy > nul,;t t
-s,@LIBOBJS@, acosh.obj crypt.obj erf.obj win32.obj,;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,@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) -c $$(<:/=\),;t t
-s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -P -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,@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,@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),$@,nul,$(LIBRUBY_A) $(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
- @$(MINIRUBY) $(srcdir)/win32/resource.rb \
- -ruby_name=$(RUBY_INSTALL_NAME) \
- -rubyw_name=$(RUBYW_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) \
- . $(icondirs) $(srcdir)/win32
-
-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)
-
-distclean-local::
- @$(RM) ext\config.cache $(RBCONFIG:/=\)
- @$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
-
-update-rubyspec:
- @echo SPEC_EXISTS=0 > $@.mk
- @if exist $(srcdir:/=\)\rubyspec\nul echo SPEC_EXISTS=1 >> $@.mk
- @type >> $@.mk &&|
-$()update-rubyspec:
-$() @del $@.mk
-$()!if $$(SPEC_EXISTS)
-$() cd $(srcdir:/=\)\rubyspec\mspec
-$() git pull
-$() cd ..\spec\rubyspec
-$() git pull
-$()!else
-$() git clone $(MSPEC_GIT_URL) $(srcdir)/rubyspec/mspec
-$() git clone $(RUBYSPEC_GIT_URL) $(srcdir)/rubyspec/spec/rubyspec
-$()!endif
-|
- @$(MAKE) -$(MAKEFLAGS)$(MFLAGS) -f $@.mk
-
-test-rubyspec:
- @echo SPEC_EXISTS=0 > $@.mk
- @if exist $(srcdir:/=\)\rubyspec\nul echo SPEC_EXISTS=1 >> $@.mk
- @type >> $@.mk &&|
-$()test-rubyspec:
-$()!if $$(SPEC_EXISTS)
-$() $(RUNRUBY) $(srcdir)/rubyspec/mspec/bin/mspec -r$(srcdir)/ext/purelib.rb $(srcdir)/rubyspec/spec/rubyspec/$(MAJOR).$(MINOR)
-$()!else
-$() @echo No rubyspec here. put rubyspec to srcdir first.
-$() @cd $(srcdir:/=\)\rubyspec
-$()!endif
-|
- @$(MAKE) -$(MAKEFLAGS) -f $@.mk
-
-ext/extinit.obj: ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
-
-main.$(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
-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
-regex.$(OBJEXT): win32.h
-ruby.$(OBJEXT): win32.h
-signal.$(OBJEXT): win32.h
-sprintf.$(OBJEXT): win32.h
-st.$(OBJEXT): win32.h
-string.$(OBJEXT): win32.h
-struct.$(OBJEXT): win32.h
-time.$(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
deleted file mode 100644
index c27a1261f1..0000000000
--- a/bcc32/README.bcc32
+++ /dev/null
@@ -1,137 +0,0 @@
-=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.
- * byacc ((<URL:http://gnuwin32.sourceforge.net/packages/byacc.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:\ruby-1.6.7>bcc32\configure.bat
-
-(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 DESTDIR=<install_directory> install%))'
-
- This command will create following directories and install files onto them.
- * <install_directory>\bin
- * <install_directory>\lib
- * <install_directory>\lib\ruby
- * <install_directory>\lib\ruby\<MAJOR>.<MINOR>
- * <install_directory>\lib\ruby\<MAJOR>.<MINOR>\<PLATFORM>
- * <install_directory>\lib\ruby\site_ruby
- * <install_directory>\lib\ruby\site_ruby\<MAJOR>.<MINOR>
- * <install_directory>\lib\ruby\site_ruby\<MAJOR>.<MINOR>\<PLATFORM>
- * <install_directory>\man\man1
- If Ruby's version is `x.y.z', the ((|<MAJOR>|)) is `x' and the ((|<MINOR>|)) is `y'.
- The ((|<PLATFORM>|)) is usually `(({i586-bccwin32}))'.
-
-(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
- make
- make test
- make DESTDIR=/usr/local 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 target i386-bccwin32
- make
- make test
- make DESTDIR=/usr/local 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
- make
- make test
- make DESTDIR=C:/usr/local 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
deleted file mode 100755
index 95575cbc60..0000000000
--- a/bcc32/configure.bat
+++ /dev/null
@@ -1,152 +0,0 @@
-@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" == "--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
-: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-static-linked-ext link external modules statically
- echo --disable-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
deleted file mode 100755
index dc523e2541..0000000000
--- a/bcc32/mkexports.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-#!./miniruby -s
-
-$name = $library = $description = nil
-
-SYM = {}
-STDIN.reopen(open("nul"))
-ARGV.each do |obj|
- IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
- next unless /(?:PUBDEF|PUBD32)/ =~ l
- SYM[$1] = true if /'(.*?)'/ =~ l
- end
-end
-
-exports = []
-if $name
- exports << "Name " + $name
-elsif $library
- exports << "Library " + $library
-end
-exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
-
-if $output
- open($output, 'w') {|f| f.puts exports.join("\n")}
-else
- puts exports.join("\n")
-end
diff --git a/bcc32/setup.mak b/bcc32/setup.mak
deleted file mode 100644
index 483292ed51..0000000000
--- a/bcc32/setup.mak
+++ /dev/null
@@ -1,163 +0,0 @@
-# -*- 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
-|
-!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 &&|
-\#include "version.h"
-MAJOR = RUBY_VERSION_MAJOR
-MINOR = RUBY_VERSION_MINOR
-TEENY = RUBY_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-: 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_answer.rb b/benchmark/bm_app_answer.rb
new file mode 100644
index 0000000000..3cd8a8fd37
--- /dev/null
+++ b/benchmark/bm_app_answer.rb
@@ -0,0 +1,15 @@
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+def the_answer_to_life_the_universe_and_everything
+ (ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i
+end
+
+answer = the_answer_to_life_the_universe_and_everything
diff --git a/benchmark/bm_app_aobench.rb b/benchmark/bm_app_aobench.rb
new file mode 100644
index 0000000000..ffab116fcd
--- /dev/null
+++ b/benchmark/bm_app_aobench.rb
@@ -0,0 +1,291 @@
+# 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)
+
+ # Subsmpling
+ 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_erb.rb b/benchmark/bm_app_erb.rb
new file mode 100644
index 0000000000..77c66a7949
--- /dev/null
+++ b/benchmark/bm_app_erb.rb
@@ -0,0 +1,26 @@
+#
+# Create many HTML strings with ERB.
+#
+
+require 'erb'
+
+data = DATA.read
+max = 15_000
+title = "hello world!"
+content = "hello world!\n" * 10
+
+max.times{
+ ERB.new(data).result(binding)
+}
+
+__END__
+
+<html>
+ <head> <%= title %> </head>
+ <body>
+ <h1> <%= title %> </h1>
+ <p>
+ <%= content %>
+ </p>
+ </body>
+</html>
diff --git a/benchmark/bm_app_factorial.rb b/benchmark/bm_app_factorial.rb
new file mode 100644
index 0000000000..45f471dfdb
--- /dev/null
+++ b/benchmark/bm_app_factorial.rb
@@ -0,0 +1,11 @@
+def fact(n)
+ if(n > 1)
+ n * fact(n-1)
+ else
+ 1
+ end
+end
+
+100.times {
+ fact(5000)
+}
diff --git a/benchmark/bm_app_fib.rb b/benchmark/bm_app_fib.rb
new file mode 100644
index 0000000000..34a7b2e725
--- /dev/null
+++ b/benchmark/bm_app_fib.rb
@@ -0,0 +1,10 @@
+def fib n
+ if n < 3
+ 1
+ else
+ fib(n-1) + fib(n-2)
+ end
+end
+
+fib(34)
+
diff --git a/benchmark/bm_app_lc_fizzbuzz.rb b/benchmark/bm_app_lc_fizzbuzz.rb
new file mode 100644
index 0000000000..f09574bbeb
--- /dev/null
+++ b/benchmark/bm_app_lc_fizzbuzz.rb
@@ -0,0 +1,52 @@
+#
+# 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_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
new file mode 100644
index 0000000000..801b75e8e2
--- /dev/null
+++ b/benchmark/bm_app_mandelbrot.rb
@@ -0,0 +1,23 @@
+require 'complex'
+
+def mandelbrot? z
+ i = 0
+ while i<100
+ i += 1
+ z = z * z
+ return false if z.abs > 2
+ end
+ true
+end
+
+ary = []
+
+(0..1000).each{|dx|
+ (0..1000).each{|dy|
+ x = dx / 50.0
+ y = dy / 50.0
+ c = Complex(x, y)
+ ary << c if mandelbrot?(c)
+ }
+}
+
diff --git a/benchmark/bm_app_pentomino.rb b/benchmark/bm_app_pentomino.rb
new file mode 100644
index 0000000000..59c63f358e
--- /dev/null
+++ b/benchmark/bm_app_pentomino.rb
@@ -0,0 +1,259 @@
+#!/usr/local/bin/ruby
+# This program is contributed by Shin Nishiyama
+
+
+# modified by K.Sasada
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n, a, nb)
+ nb.each{|x|
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ [-ROW, -1, 1, ROW].each{|d|
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ }
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ }
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ (0...ROW*COL).each{|i|
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ }
+end
+
+def pboard
+ return # skip print
+ print "No. #$no\n"
+ (0...COL).each{|i|
+ print "|"
+ (0...ROW-NP).each{|j|
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ }
+ print "\n"
+ }
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ x.each{|s|
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ }
+ if f == 0 then
+ x.each{|s|
+ $b[pos+s] = i
+ }
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ x.each{|s|
+ $b[pos+s] = -1
+ }
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
+
+
+__END__
+
+# original
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n,a,nb)
+ for x in nb
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ for d in [-ROW, -1, 1, ROW]
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ end
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ end
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ for i in 0...ROW*COL
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ end
+end
+
+def pboard
+ print "No. #$no\n"
+ for i in 0...COL
+ print "|"
+ for j in 0...ROW-NP
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ end
+ print "\n"
+ end
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ for s in x do
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ end
+ if f == 0 then
+ for s in x do
+ $b[pos+s] = i
+ end
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ for s in x do
+ $b[pos+s] = -1
+ end
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
diff --git a/benchmark/bm_app_raise.rb b/benchmark/bm_app_raise.rb
new file mode 100644
index 0000000000..5db8f95d50
--- /dev/null
+++ b/benchmark/bm_app_raise.rb
@@ -0,0 +1,8 @@
+i = 0
+while i<300000
+ i += 1
+ begin
+ raise
+ rescue
+ end
+end
diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb
new file mode 100644
index 0000000000..7eed7c1aed
--- /dev/null
+++ b/benchmark/bm_app_strconcat.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<2_000_000
+ "#{1+1} #{1+1} #{1+1}"
+ i += 1
+end
diff --git a/benchmark/bm_app_tak.rb b/benchmark/bm_app_tak.rb
new file mode 100644
index 0000000000..efe5380f4e
--- /dev/null
+++ b/benchmark/bm_app_tak.rb
@@ -0,0 +1,13 @@
+
+def tak x, y, z
+ unless y < x
+ z
+ else
+ tak( tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+ end
+end
+
+tak(18, 9, 0)
+
diff --git a/benchmark/bm_app_tarai.rb b/benchmark/bm_app_tarai.rb
new file mode 100644
index 0000000000..4c146f5ccf
--- /dev/null
+++ b/benchmark/bm_app_tarai.rb
@@ -0,0 +1,10 @@
+def tarai( x, y, z )
+ if x <= y
+ then y
+ else tarai(tarai(x-1, y, z),
+ tarai(y-1, z, x),
+ tarai(z-1, x, y))
+ end
+end
+
+tarai(12, 6, 0)
diff --git a/benchmark/bm_app_uri.rb b/benchmark/bm_app_uri.rb
new file mode 100644
index 0000000000..586edfd5dc
--- /dev/null
+++ b/benchmark/bm_app_uri.rb
@@ -0,0 +1,8 @@
+require 'uri'
+
+100_000.times{
+ uri = URI.parse('http://www.ruby-lang.org')
+ uri.scheme
+ uri.host
+ uri.port
+}
diff --git a/benchmark/bm_hash_aref_flo.rb b/benchmark/bm_hash_aref_flo.rb
new file mode 100644
index 0000000000..2217274c82
--- /dev/null
+++ b/benchmark/bm_hash_aref_flo.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..b0913dd4bb
--- /dev/null
+++ b/benchmark/bm_hash_aref_miss.rb
@@ -0,0 +1,5 @@
+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
new file mode 100644
index 0000000000..19439b061b
--- /dev/null
+++ b/benchmark/bm_hash_aref_str.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..f75d163fe6
--- /dev/null
+++ b/benchmark/bm_hash_aref_sym.rb
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 0000000000..9dab8df7be
--- /dev/null
+++ b/benchmark/bm_hash_aref_sym_long.rb
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..e944aae9f2
--- /dev/null
+++ b/benchmark/bm_hash_flatten.rb
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 0000000000..0c7edfed3e
--- /dev/null
+++ b/benchmark/bm_hash_ident_flo.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..b226736c6f
--- /dev/null
+++ b/benchmark/bm_hash_ident_num.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..4b3b58edec
--- /dev/null
+++ b/benchmark/bm_hash_ident_obj.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..8582b38e31
--- /dev/null
+++ b/benchmark/bm_hash_ident_str.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..4c81e3d28e
--- /dev/null
+++ b/benchmark/bm_hash_ident_sym.rb
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..6863cd01f9
--- /dev/null
+++ b/benchmark/bm_hash_keys.rb
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 0000000000..a645671a5b
--- /dev/null
+++ b/benchmark/bm_hash_shift.rb
@@ -0,0 +1,10 @@
+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_values.rb b/benchmark/bm_hash_values.rb
new file mode 100644
index 0000000000..069441302f
--- /dev/null
+++ b/benchmark/bm_hash_values.rb
@@ -0,0 +1,9 @@
+h = {}
+
+10000.times do |i|
+ h[i] = nil
+end
+
+5000.times do
+ h.values
+end
diff --git a/benchmark/bm_io_file_create.rb b/benchmark/bm_io_file_create.rb
new file mode 100644
index 0000000000..2f205c1333
--- /dev/null
+++ b/benchmark/bm_io_file_create.rb
@@ -0,0 +1,13 @@
+#
+# Create files
+#
+
+max = 200_000
+file = './tmpfile_of_bm_io_file_create'
+
+max.times{
+ f = open(file, 'w')
+ f.close#(true)
+}
+File.unlink(file)
+
diff --git a/benchmark/bm_io_file_read.rb b/benchmark/bm_io_file_read.rb
new file mode 100644
index 0000000000..b9e796ed30
--- /dev/null
+++ b/benchmark/bm_io_file_read.rb
@@ -0,0 +1,15 @@
+#
+# Seek and Read file.
+#
+
+require 'tempfile'
+
+max = 200_000
+str = "Hello world! " * 1000
+f = Tempfile.new('yarv-benchmark')
+f.write str
+
+max.times{
+ f.seek 0
+ f.read
+}
diff --git a/benchmark/bm_io_file_write.rb b/benchmark/bm_io_file_write.rb
new file mode 100644
index 0000000000..aa1be0e5fe
--- /dev/null
+++ b/benchmark/bm_io_file_write.rb
@@ -0,0 +1,14 @@
+#
+# Seek and Write file.
+#
+
+require 'tempfile'
+
+max = 200_000
+str = "Hello world! " * 1000
+f = Tempfile.new('yarv-benchmark')
+
+max.times{
+ f.seek 0
+ f.write str
+}
diff --git a/benchmark/bm_io_select.rb b/benchmark/bm_io_select.rb
new file mode 100644
index 0000000000..19248daeb1
--- /dev/null
+++ b/benchmark/bm_io_select.rb
@@ -0,0 +1,9 @@
+# IO.select performance
+
+w = [ IO.pipe[1] ];
+
+nr = 1000000
+nr.times {
+ IO.select nil, w
+}
+
diff --git a/benchmark/bm_io_select2.rb b/benchmark/bm_io_select2.rb
new file mode 100644
index 0000000000..10e37d71b2
--- /dev/null
+++ b/benchmark/bm_io_select2.rb
@@ -0,0 +1,22 @@
+# IO.select performance. worst case of single fd.
+
+ios = []
+nr = 1000000
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
+puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
+
+((max / 2) - 10).times do
+ ios.concat IO.pipe
+end
+
+last = [ ios[-1] ]
+puts "last IO: #{last[0].inspect}"
+
+nr.times do
+ IO.select nil, last
+end
+
diff --git a/benchmark/bm_io_select3.rb b/benchmark/bm_io_select3.rb
new file mode 100644
index 0000000000..7d0ba1f092
--- /dev/null
+++ b/benchmark/bm_io_select3.rb
@@ -0,0 +1,21 @@
+# IO.select performance. a lot of fd
+
+ios = []
+nr = 100
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
+puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
+
+(max - 10).times do
+ r, w = IO.pipe
+ r.close
+ ios.push w
+end
+
+nr.times do
+ IO.select nil, ios
+end
+
diff --git a/benchmark/bm_loop_for.rb b/benchmark/bm_loop_for.rb
new file mode 100644
index 0000000000..0fc4cc1511
--- /dev/null
+++ b/benchmark/bm_loop_for.rb
@@ -0,0 +1,3 @@
+for i in 1..30_000_000
+ #
+end
diff --git a/benchmark/bm_loop_generator.rb b/benchmark/bm_loop_generator.rb
new file mode 100644
index 0000000000..d3375c744c
--- /dev/null
+++ b/benchmark/bm_loop_generator.rb
@@ -0,0 +1,14 @@
+max = 600000
+
+if defined? Fiber
+ gen = (1..max).each
+ loop do
+ gen.next
+ end
+else
+ require 'generator'
+ gen = Generator.new((0..max))
+ while gen.next?
+ gen.next
+ end
+end
diff --git a/benchmark/bm_loop_times.rb b/benchmark/bm_loop_times.rb
new file mode 100644
index 0000000000..521f72ad1a
--- /dev/null
+++ b/benchmark/bm_loop_times.rb
@@ -0,0 +1 @@
+30_000_000.times{|e|}
diff --git a/benchmark/bm_loop_whileloop.rb b/benchmark/bm_loop_whileloop.rb
new file mode 100644
index 0000000000..0072822c06
--- /dev/null
+++ b/benchmark/bm_loop_whileloop.rb
@@ -0,0 +1,4 @@
+i = 0
+while i<30_000_000 # benchmark loop 1
+ i += 1
+end
diff --git a/benchmark/bm_loop_whileloop2.rb b/benchmark/bm_loop_whileloop2.rb
new file mode 100644
index 0000000000..47d02dffc4
--- /dev/null
+++ b/benchmark/bm_loop_whileloop2.rb
@@ -0,0 +1,4 @@
+i = 0
+while i< 6_000_000 # benchmark loop 2
+ i += 1
+end
diff --git a/benchmark/bm_marshal_dump_flo.rb b/benchmark/bm_marshal_dump_flo.rb
new file mode 100644
index 0000000000..9b8d0c6afb
--- /dev/null
+++ b/benchmark/bm_marshal_dump_flo.rb
@@ -0,0 +1,2 @@
+bug10761 = 10000.times.map { |x| x.to_f }
+100.times { Marshal.dump(bug10761) }
diff --git a/benchmark/bm_securerandom.rb b/benchmark/bm_securerandom.rb
new file mode 100644
index 0000000000..a082ea6d5b
--- /dev/null
+++ b/benchmark/bm_securerandom.rb
@@ -0,0 +1,5 @@
+require "securerandom"
+
+20_0000.times do
+ SecureRandom.random_number(100)
+end
diff --git a/benchmark/bm_so_ackermann.rb b/benchmark/bm_so_ackermann.rb
new file mode 100644
index 0000000000..7db5be9050
--- /dev/null
+++ b/benchmark/bm_so_ackermann.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ackermann-ruby.code,v 1.4 2004/11/13 07:40:41 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+NUM = 9
+ack(3, NUM)
+
+
diff --git a/benchmark/bm_so_array.rb b/benchmark/bm_so_array.rb
new file mode 100644
index 0000000000..2b8fce8f99
--- /dev/null
+++ b/benchmark/bm_so_array.rb
@@ -0,0 +1,23 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ary-ruby.code,v 1.4 2004/11/13 07:41:27 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan and Mark Hubbart
+
+n = 9000 # Integer(ARGV.shift || 1)
+
+x = Array.new(n)
+y = Array.new(n, 0)
+
+n.times{|bi|
+ x[bi] = bi + 1
+}
+
+(0 .. 999).each do |e|
+ (n-1).step(0,-1) do |bi|
+ y[bi] += x.at(bi)
+ end
+end
+# puts "#{y.first} #{y.last}"
+
+
diff --git a/benchmark/bm_so_binary_trees.rb b/benchmark/bm_so_binary_trees.rb
new file mode 100644
index 0000000000..b1693e4109
--- /dev/null
+++ b/benchmark/bm_so_binary_trees.rb
@@ -0,0 +1,62 @@
+# The Computer Language Shootout Benchmarks
+# http://shootout.alioth.debian.org
+#
+# contributed by Jesse Millikan
+
+# disable output
+alias puts_orig puts
+def puts str
+ # disable puts
+end
+
+def item_check(tree)
+ if tree[0] == nil
+ tree[1]
+ else
+ tree[1] + item_check(tree[0]) - item_check(tree[2])
+ end
+end
+
+def bottom_up_tree(item, depth)
+ if depth > 0
+ item_item = 2 * item
+ depth -= 1
+ [bottom_up_tree(item_item - 1, depth), item, bottom_up_tree(item_item, depth)]
+ else
+ [nil, item, nil]
+ end
+end
+
+max_depth = 16 # ARGV[0].to_i
+min_depth = 4
+
+max_depth = min_depth + 2 if min_depth + 2 > max_depth
+
+stretch_depth = max_depth + 1
+stretch_tree = bottom_up_tree(0, stretch_depth)
+
+puts "stretch tree of depth #{stretch_depth}\t check: #{item_check(stretch_tree)}"
+stretch_tree = nil
+
+long_lived_tree = bottom_up_tree(0, max_depth)
+
+min_depth.step(max_depth + 1, 2) do |depth|
+ iterations = 2**(max_depth - depth + min_depth)
+
+ check = 0
+
+ for i in 1..iterations
+ temp_tree = bottom_up_tree(i, depth)
+ check += item_check(temp_tree)
+
+ temp_tree = bottom_up_tree(-i, depth)
+ check += item_check(temp_tree)
+ end
+
+ puts "#{iterations * 2}\t trees of depth #{depth}\t check: #{check}"
+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_concatenate.rb b/benchmark/bm_so_concatenate.rb
new file mode 100644
index 0000000000..873214de7c
--- /dev/null
+++ b/benchmark/bm_so_concatenate.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: strcat-ruby.code,v 1.4 2004/11/13 07:43:28 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
+
+STUFF = "hello\n"
+i = 0
+while i<10
+ i += 1
+ hello = ''
+ 4_000_000.times do |e|
+ hello << STUFF
+ end
+end
+# puts hello.length
+
+
diff --git a/benchmark/bm_so_count_words.rb b/benchmark/bm_so_count_words.rb
new file mode 100644
index 0000000000..65f6337a4a
--- /dev/null
+++ b/benchmark/bm_so_count_words.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: wc-ruby.code,v 1.4 2004/11/13 07:43:32 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan
+
+input = open(File.join(File.dirname($0), 'wc.input'), 'rb')
+
+nl = nw = nc = 0
+while true
+ tmp = input.read(4096) or break
+ data = tmp << (input.gets || "")
+ nc += data.length
+ nl += data.count("\n")
+ ((data.strip! || data).tr!("\n", " ") || data).squeeze!
+ nw += data.count(" ") + 1
+end
+# STDERR.puts "#{nl} #{nw} #{nc}"
+
diff --git a/benchmark/bm_so_exception.rb b/benchmark/bm_so_exception.rb
new file mode 100644
index 0000000000..deb003a594
--- /dev/null
+++ b/benchmark/bm_so_exception.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: except-ruby.code,v 1.4 2004/11/13 07:41:33 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+$HI = 0
+$LO = 0
+NUM = 250000 # Integer(ARGV[0] || 1)
+
+
+class Lo_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+class Hi_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+def some_function(num)
+ begin
+ hi_function(num)
+ rescue
+ print "We shouldn't get here, exception is: #{$!.type}\n"
+ end
+end
+
+def hi_function(num)
+ begin
+ lo_function(num)
+ rescue Hi_Exception
+ $HI = $HI + 1
+ end
+end
+
+def lo_function(num)
+ begin
+ blowup(num)
+ rescue Lo_Exception
+ $LO = $LO + 1
+ end
+end
+
+def blowup(num)
+ if num % 2 == 0
+ raise Lo_Exception.new(num)
+ else
+ raise Hi_Exception.new(num)
+ end
+end
+
+
+i = 1
+max = NUM+1
+while i < max
+ i += 1
+ some_function(i+1)
+end
diff --git a/benchmark/bm_so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb
new file mode 100644
index 0000000000..bac5ecd44c
--- /dev/null
+++ b/benchmark/bm_so_fannkuch.rb
@@ -0,0 +1,45 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+# Modified by Ryan Williams
+
+def fannkuch(n)
+ maxFlips, m, r, check = 0, n-1, n, 0
+ count = (1..n).to_a
+ perm = (1..n).to_a
+
+ while true
+ if check < 30
+ puts "#{perm}"
+ check += 1
+ end
+
+ while r != 1
+ count[r-1] = r
+ r -= 1
+ end
+
+ if perm[0] != 1 and perm[m] != n
+ perml = perm.clone #.dup
+ flips = 0
+ while (k = perml.first ) != 1
+ perml = perml.slice!(0, k).reverse + perml
+ flips += 1
+ end
+ maxFlips = flips if flips > maxFlips
+ end
+ while true
+ if r==n then return maxFlips end
+ perm.insert r,perm.shift
+ break if (count[r] -= 1) > 0
+ r += 1
+ end
+ end
+end
+
+def puts *args
+end
+
+N = 9 # (ARGV[0] || 1).to_i
+puts "Pfannkuchen(#{N}) = #{fannkuch(N)}"
+
diff --git a/benchmark/bm_so_fasta.rb b/benchmark/bm_so_fasta.rb
new file mode 100644
index 0000000000..3f759ba7ae
--- /dev/null
+++ b/benchmark/bm_so_fasta.rb
@@ -0,0 +1,81 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+
+$last = 42.0
+def gen_random (max,im=139968,ia=3877,ic=29573)
+ (max * ($last = ($last * ia + ic) % im)) / im
+end
+
+alu =
+ "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
+ "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
+ "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
+ "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
+ "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
+ "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
+ "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
+
+iub = [
+ ["a", 0.27],
+ ["c", 0.12],
+ ["g", 0.12],
+ ["t", 0.27],
+
+ ["B", 0.02],
+ ["D", 0.02],
+ ["H", 0.02],
+ ["K", 0.02],
+ ["M", 0.02],
+ ["N", 0.02],
+ ["R", 0.02],
+ ["S", 0.02],
+ ["V", 0.02],
+ ["W", 0.02],
+ ["Y", 0.02],
+]
+homosapiens = [
+ ["a", 0.3029549426680],
+ ["c", 0.1979883004921],
+ ["g", 0.1975473066391],
+ ["t", 0.3015094502008],
+]
+
+def make_repeat_fasta(id, desc, src, n)
+ puts ">#{id} #{desc}"
+ v = nil
+ width = 60
+ l = src.length
+ s = src * ((n / l) + 1)
+ s.slice!(n, l)
+ puts(s.scan(/.{1,#{width}}/).join("\n"))
+end
+
+def make_random_fasta(id, desc, table, n)
+ puts ">#{id} #{desc}"
+ rand, v = nil,nil
+ width = 60
+ chunk = 1 * width
+ prob = 0.0
+ table.each{|v| v[1]= (prob += v[1])}
+ for i in 1..(n/width)
+ puts((1..width).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+ if n%width != 0
+ puts((1..(n%width)).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+end
+
+
+n = (ARGV[0] or 250_000).to_i
+
+make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
+make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
+make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
+
diff --git a/benchmark/bm_so_k_nucleotide.rb b/benchmark/bm_so_k_nucleotide.rb
new file mode 100644
index 0000000000..dadab3e79c
--- /dev/null
+++ b/benchmark/bm_so_k_nucleotide.rb
@@ -0,0 +1,48 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+#
+# contributed by jose fco. gonzalez
+# modified by Sokolov Yura
+
+seq = String.new
+
+def frecuency( seq,length )
+ n, table = seq.length - length + 1, Hash.new(0)
+ f, i = nil, nil
+ (0 ... length).each do |f|
+ (f ... n).step(length) do |i|
+ table[seq[i,length]] += 1
+ end
+ end
+ [n,table]
+
+end
+
+def sort_by_freq( seq,length )
+ n,table = frecuency( seq,length )
+ a, b, v = nil, nil, nil
+ table.sort{|a,b| b[1] <=> a[1]}.each do |v|
+ puts "%s %.3f" % [v[0].upcase,((v[1]*100).to_f/n)]
+ end
+ puts
+end
+
+def find_seq( seq,s )
+ n,table = frecuency( seq,s.length )
+ puts "#{table[s].to_s}\t#{s.upcase}"
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.100000'), 'rb')
+
+line = input.gets while line !~ /^>THREE/
+line = input.gets
+
+while (line !~ /^>/) & line do
+ seq << line.chomp
+ line = input.gets
+end
+
+[1,2].each {|i| sort_by_freq( seq,i ) }
+
+%w(ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt).each{|s| find_seq( seq,s) }
+
diff --git a/benchmark/bm_so_lists.rb b/benchmark/bm_so_lists.rb
new file mode 100644
index 0000000000..e8f4a2a5f7
--- /dev/null
+++ b/benchmark/bm_so_lists.rb
@@ -0,0 +1,47 @@
+#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
+
+NUM = 300
+SIZE = 10000
+
+def test_lists()
+ # create a list of integers (Li1) from 1 to SIZE
+ li1 = (1..SIZE).to_a
+ # copy the list to li2 (not by individual items)
+ li2 = li1.dup
+ # remove each individual item from left side of li2 and
+ # append to right side of li3 (preserving order)
+ li3 = Array.new
+ while (not li2.empty?)
+ li3.push(li2.shift)
+ end
+ # li2 must now be empty
+ # remove each individual item from right side of li3 and
+ # append to right side of li2 (reversing list)
+ while (not li3.empty?)
+ li2.push(li3.pop)
+ end
+ # li3 must now be empty
+ # reverse li1 in place
+ li1.reverse!
+ # check that first item is now SIZE
+ if li1[0] != SIZE then
+ p "not SIZE"
+ 0
+ else
+ # compare li1 and li2 for equality
+ if li1 != li2 then
+ return(0)
+ else
+ # return the length of the list
+ li1.length
+ end
+ end
+end
+
+i = 0
+while i<NUM
+ i += 1
+ result = test_lists()
+end
+
+result
diff --git a/benchmark/bm_so_mandelbrot.rb b/benchmark/bm_so_mandelbrot.rb
new file mode 100644
index 0000000000..76331c64b8
--- /dev/null
+++ b/benchmark/bm_so_mandelbrot.rb
@@ -0,0 +1,57 @@
+# The Computer Language Benchmarks Game
+# http://shootout.alioth.debian.org/
+#
+# contributed by Karl von Laudermann
+# modified by Jeremy Echols
+
+size = 600 # ARGV[0].to_i
+
+puts "P4\n#{size} #{size}"
+
+ITER = 49 # Iterations - 1 for easy for..in looping
+LIMIT_SQUARED = 4.0 # Presquared limit
+
+byte_acc = 0
+bit_num = 0
+
+count_size = size - 1 # Precomputed size for easy for..in looping
+
+# For..in loops are faster than .upto, .downto, .times, etc.
+for y in 0..count_size
+ for x in 0..count_size
+ zr = 0.0
+ zi = 0.0
+ cr = (2.0*x/size)-1.5
+ ci = (2.0*y/size)-1.0
+ escape = false
+
+ # To make use of the for..in code, we use a dummy variable,
+ # like one would in C
+ for dummy in 0..ITER
+ tr = zr*zr - zi*zi + cr
+ ti = 2*zr*zi + ci
+ zr, zi = tr, ti
+
+ if (zr*zr+zi*zi) > LIMIT_SQUARED
+ escape = true
+ break
+ end
+ end
+
+ byte_acc = (byte_acc << 1) | (escape ? 0b0 : 0b1)
+ bit_num += 1
+
+ # Code is very similar for these cases, but using separate blocks
+ # ensures we skip the shifting when it's unnecessary, which is most cases.
+ if (bit_num == 8)
+ print byte_acc.chr
+ byte_acc = 0
+ bit_num = 0
+ elsif (x == count_size)
+ byte_acc <<= (8 - bit_num)
+ print byte_acc.chr
+ byte_acc = 0
+ bit_num = 0
+ end
+ end
+end
diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb
new file mode 100644
index 0000000000..e2c5c8e559
--- /dev/null
+++ b/benchmark/bm_so_matrix.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: matrix-ruby.code,v 1.4 2004/11/13 07:42:14 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+n = 60 #Integer(ARGV.shift || 1)
+
+size = 40
+
+def mkmatrix(rows, cols)
+ count = 1
+ mx = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ row[j] = count
+ count += 1
+ end
+ mx[bi] = row
+ end
+ mx
+end
+
+def mmult(rows, cols, m1, m2)
+ m3 = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ val = 0
+ (0 .. (cols - 1)).each do |k|
+ val += m1.at(bi).at(k) * m2.at(k).at(j)
+ end
+ row[j] = val
+ end
+ m3[bi] = row
+ end
+ m3
+end
+
+m1 = mkmatrix(size, size)
+m2 = mkmatrix(size, size)
+mm = Array.new
+n.times do
+ mm = mmult(size, size, m1, m2)
+end
+# puts "#{mm[0][0]} #{mm[2][3]} #{mm[3][2]} #{mm[4][4]}"
+
+
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
new file mode 100644
index 0000000000..b8e93bd150
--- /dev/null
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -0,0 +1,564 @@
+#!/usr/bin/env ruby
+#
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+# contributed by Kevin Barnes (Ruby novice)
+
+# PROGRAM: the main body is at the bottom.
+# 1) read about the problem here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
+# 2) see how I represent a board as a bitmask by reading the blank_board comments
+# 3) read as your mental paths take you
+
+def print *args
+end
+
+# class to represent all information about a particular rotation of a particular piece
+class Rotation
+ # an array (by location) containing a bit mask for how the piece maps at the given location.
+ # if the rotation is invalid at that location the mask will contain false
+ attr_reader :start_masks
+
+ # maps a direction to a relative location. these differ depending on whether it is an even or
+ # odd row being mapped from
+ @@rotation_even_adder = { :west => -1, :east => 1, :nw => -7, :ne => -6, :sw => 5, :se => 6 }
+ @@rotation_odd_adder = { :west => -1, :east => 1, :nw => -6, :ne => -5, :sw => 6, :se => 7 }
+
+ def initialize( directions )
+ @even_offsets, @odd_offsets = normalize_offsets( get_values( directions ))
+
+ @even_mask = mask_for_offsets( @even_offsets)
+ @odd_mask = mask_for_offsets( @odd_offsets)
+
+ @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
+ # is true the piece cannot be placed
+ 0.upto(59) do | offset |
+ mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
+ if (blank_board & mask == 0 && !prunable(blank_board | mask, 0, true)) then
+ imask = compute_required( mask, offset)
+ @start_masks[offset] = [ mask, imask, imask | mask ]
+ else
+ @start_masks[offset] = false
+ end
+ end
+ end
+
+ def compute_required( mask, offset )
+ board = blank_board
+ 0.upto(offset) { | i | board |= 1 << i }
+ board |= mask
+ return 0 if (!prunable(board | mask, offset))
+ board = flood_fill(board,58)
+ count = 0
+ imask = 0
+ 0.upto(59) do | i |
+ if (board[i] == 0) then
+ imask |= (1 << i)
+ count += 1
+ end
+ end
+ (count > 0 && count < 5) ? imask : 0
+ end
+
+ def flood_fill( board, location)
+ return board if (board[location] == 1)
+ board |= 1 << location
+ row, col = location.divmod(6)
+ board = flood_fill( board, location - 1) if (col > 0)
+ board = flood_fill( board, location + 1) if (col < 4)
+ if (row % 2 == 0) then
+ board = flood_fill( board, location - 7) if (col > 0 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 5) if (col > 0 && row < 9)
+ else
+ board = flood_fill( board, location - 5) if (col < 4 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 7) if (col < 4 && row < 9)
+ end
+ board
+ end
+
+ # given a location, produces a list of relative locations covered by the piece at this rotation
+ def offsets( location)
+ if is_even( location) then
+ @even_offsets.collect { | value | value + location }
+ else
+ @odd_offsets.collect { | value | value + location }
+ end
+ end
+
+ # returns a set of offsets relative to the top-left most piece of the rotation (by even or odd rows)
+ # this is hard to explain. imagine we have this partial board:
+ # 0 0 0 0 0 x [positions 0-5]
+ # 0 0 1 1 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 1 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # The top-left of the piece is at position 8, the
+ # board would be passed as a set of positions (values array) containing [8,9,14,19,25] not necessarily in that
+ # sorted order. Since that array starts on an odd row, the offsets for an odd row are: [0,1,6,11,17] obtained
+ # by subtracting 8 from everything. Now imagine the piece shifted up and to the right so it's on an even row:
+ # 0 0 0 1 1 x [positions 0-5]
+ # 0 0 1 0 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 0 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # Now the positions are [3,4,8,14,19] which after subtracting the lowest value (3) gives [0,1,5,11,16] thus, the
+ # offsets for this particular piece are (in even, odd order) [0,1,5,11,16],[0,1,6,11,17] which is what
+ # this function would return
+ def normalize_offsets( values)
+ min = values.min
+ even_min = is_even(min)
+ other_min = even_min ? min + 6 : min + 7
+ other_values = values.collect do | value |
+ if is_even(value) then
+ value + 6 - other_min
+ else
+ value + 7 - other_min
+ end
+ end
+ values.collect! { | value | value - min }
+
+ if even_min then
+ [values, other_values]
+ else
+ [other_values, values]
+ end
+ end
+
+ # produce a bitmask representation of an array of offset locations
+ def mask_for_offsets( offsets )
+ mask = 0
+ offsets.each { | value | mask = mask + ( 1 << value ) }
+ mask
+ end
+
+ # finds a "safe" position that a position as described by a list of directions can be placed
+ # without falling off any edge of the board. the values returned a location to place the first piece
+ # at so it will fit after making the described moves
+ def start_adjust( directions )
+ south = east = 0;
+ directions.each do | direction |
+ east += 1 if ( direction == :sw || direction == :nw || direction == :west )
+ south += 1 if ( direction == :nw || direction == :ne )
+ end
+ south * 6 + east
+ end
+
+ # given a set of directions places the piece (as defined by a set of directions) on the board at
+ # a location that will not take it off the edge
+ def get_values ( directions )
+ start = start_adjust(directions)
+ values = [ start ]
+ directions.each do | direction |
+ if (start % 12 >= 6) then
+ start += @@rotation_odd_adder[direction]
+ else
+ start += @@rotation_even_adder[direction]
+ end
+ values += [ start ]
+ end
+
+ # some moves take you back to an existing location, we'll strip duplicates
+ values.uniq
+ end
+end
+
+# describes a piece and caches information about its rotations to as to be efficient for iteration
+# ATTRIBUTES:
+# rotations -- all the rotations of the piece
+# type -- a numeic "name" of the piece
+# masks -- an array by location of all legal rotational masks (a n inner array) for that location
+# placed -- the mask that this piece was last placed at (not a location, but the actual mask used)
+class Piece
+ attr_reader :rotations, :type, :masks
+ attr_accessor :placed
+
+ # transform hashes that change one direction into another when you either flip or rotate a set of directions
+ @@flip_converter = { :west => :west, :east => :east, :nw => :sw, :ne => :se, :sw => :nw, :se => :ne }
+ @@rotate_converter = { :west => :nw, :east => :se, :nw => :ne, :ne => :east, :sw => :west, :se => :sw }
+
+ def initialize( directions, type )
+ @type = type
+ @rotations = Array.new();
+ @map = {}
+
+ generate_rotations( directions )
+ directions.collect! { | value | @@flip_converter[value] }
+ generate_rotations( directions )
+
+ # creates the masks AND a map that returns [location, rotation] for any given mask
+ # this is used when a board is found and we want to draw it, otherwise the map is unused
+ @masks = Array.new();
+ 0.upto(59) do | i |
+ even = true
+ @masks[i] = @rotations.collect do | rotation |
+ mask = rotation.start_masks[i]
+ @map[mask[0]] = [ i, rotation ] if (mask)
+ mask || nil
+ end
+ @masks[i].compact!
+ end
+ end
+
+ # rotates a set of directions through all six angles and adds a Rotation to the list for each one
+ def generate_rotations( directions )
+ 6.times do
+ rotations.push( Rotation.new(directions))
+ directions.collect! { | value | @@rotate_converter[value] }
+ end
+ end
+
+ # given a board string, adds this piece to the board at whatever location/rotation
+ # important: the outbound board string is 5 wide, the normal location notation is six wide (padded)
+ def fill_string( board_string)
+ location, rotation = @map[@placed]
+ rotation.offsets(location).each do | offset |
+ row, col = offset.divmod(6)
+ board_string[ row*5 + col, 1 ] = @type.to_s
+ end
+ end
+end
+
+# a blank bit board having this form:
+#
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 1 1 1 1 1 1
+#
+# where left lest significant bit is the top left and the most significant is the lower right
+# the actual board only consists of the 0 places, the 1 places are blockers to keep things from running
+# off the edges or bottom
+def blank_board
+ 0b111111100000100000100000100000100000100000100000100000100000100000
+end
+
+def full_board
+ 0b111111111111111111111111111111111111111111111111111111111111111111
+end
+
+# determines if a location (bit position) is in an even row
+def is_even( location)
+ (location % 12) < 6
+end
+
+# support function that create three utility maps:
+# $converter -- for each row an array that maps a five bit row (via array mapping)
+# to the a a five bit representation of the bits below it
+# $bit_count -- maps a five bit row (via array mapping) to the number of 1s in the row
+# @@new_regions -- maps a five bit row (via array mapping) to an array of "region" arrays
+# a region array has three values the first is a mask of bits in the region,
+# the second is the count of those bits and the third is identical to the first
+# examples:
+# 0b10010 => [ 0b01100, 2, 0b01100 ], [ 0b00001, 1, 0b00001]
+# 0b01010 => [ 0b10000, 1, 0b10000 ], [ 0b00100, 1, 0b00100 ], [ 0b00001, 1, 0b00001]
+# 0b10001 => [ 0b01110, 3, 0b01110 ]
+def create_collector_support
+ odd_map = [0b11, 0b110, 0b1100, 0b11000, 0b10000]
+ even_map = [0b1, 0b11, 0b110, 0b1100, 0b11000]
+
+ all_odds = Array.new(0b100000)
+ all_evens = Array.new(0b100000)
+ bit_counts = Array.new(0b100000)
+ new_regions = Array.new(0b100000)
+ 0.upto(0b11111) do | i |
+ bit_count = odd = even = 0
+ 0.upto(4) do | bit |
+ if (i[bit] == 1) then
+ bit_count += 1
+ odd |= odd_map[bit]
+ even |= even_map[bit]
+ end
+ end
+ all_odds[i] = odd
+ all_evens[i] = even
+ bit_counts[i] = bit_count
+ new_regions[i] = create_regions( i)
+ end
+
+ $converter = []
+ 10.times { | row | $converter.push((row % 2 == 0) ? all_evens : all_odds) }
+ $bit_counts = bit_counts
+ $regions = new_regions.collect { | set | set.collect { | value | [ value, bit_counts[value], value] } }
+end
+
+# determines if a board is punable, meaning that there is no possibility that it
+# can be filled up with pieces. A board is prunable if there is a grouping of unfilled spaces
+# that are not a multiple of five. The following board is an example of a prunable board:
+# 0 0 1 0 0
+# 0 1 0 0 0
+# 1 1 0 0 0
+# 0 1 0 0 0
+# 0 0 0 0 0
+# ...
+#
+# This board is prunable because the top left corner is only 3 bits in area, no piece will ever fit it
+# parameters:
+# board -- an initial bit board (6 bit padded rows, see blank_board for format)
+# location -- starting location, everything above and to the left is already full
+# slotting -- set to true only when testing initial pieces, when filling normally
+# additional assumptions are possible
+#
+# Algorithm:
+# The algorithm starts at the top row (as determined by location) and iterates a row at a time
+# maintainng counts of active open areas (kept in the collector array) each collector contains
+# three values at the start of an iteration:
+# 0: mask of bits that would be adjacent to the collector in this row
+# 1: the number of bits collected so far
+# 2: a scratch space starting as zero, but used during the computation to represent
+# the empty bits in the new row that are adjacent (position 0)
+# The exact procedure is described in-code
+def prunable( board, location, slotting = false)
+ collectors = []
+ # loop across the rows
+ (location / 6).to_i.upto(9) do | row_on |
+ # obtain a set of regions representing the bits of the current row.
+ regions = $regions[(board >> (row_on * 6)) & 0b11111]
+ converter = $converter[row_on]
+
+ # track the number of collectors at the start of the cycle so that
+ # we don't compute against newly created collectors, only existing collectors
+ initial_collector_count = collectors.length
+
+ # loop against the regions. For each region of the row
+ # we will see if it connects to one or more existing collectors.
+ # if it connects to 1 collector, the bits from the region are added to the
+ # bits of the collector and the mask is placed in collector[2]
+ # If the region overlaps more than one collector then all the collectors
+ # it overlaps with are merged into the first one (the others are set to nil in the array)
+ # if NO collectors are found then the region is copied as a new collector
+ regions.each do | region |
+ collector_found = nil
+ region_mask = region[2]
+ initial_collector_count.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ collector_mask = collector[0]
+ if (collector_mask & region_mask != 0) then
+ if (collector_found) then
+ collector_found[0] |= collector_mask
+ collector_found[1] += collector[1]
+ collector_found[2] |= collector[2]
+ collectors[collector_num] = nil
+ else
+ collector_found = collector
+ collector[1] += region[1]
+ collector[2] |= region_mask
+ end
+ end
+ end
+ end
+ if (collector_found == nil) then
+ collectors.push(Array.new(region))
+ end
+ 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
+ # 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.
+ collectors.length.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ if (collector[2] == 0) then
+ return true if (collector[1] % 5 != 0)
+ collectors[collector_num] = nil
+ else
+ # if a collector matches all bits in the row then we can return unprunable early for the
+ # following 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
+ # a multiple of five
+ # this rule only applies when filling normally, so we ignore the rule if we are "slotting"
+ # in pieces to see what configurations work for them (the only other time this algorithm is used).
+ return false if (collector[2] == 0b11111 && !slotting)
+ collector[0] = converter[collector[2]]
+ collector[2] = 0
+ end
+ end
+ end
+
+ # get rid of all the empty converters for the next round
+ collectors.compact!
+ end
+ return false if (collectors.length <= 1) # 1 collector or less and the region is fine
+ collectors.any? { | collector | (collector[1] % 5) != 0 } # more than 1 and we test them all for bad size
+end
+
+# creates a region given a row mask. see prunable for what a "region" is
+def create_regions( value )
+ regions = []
+ cur_region = 0
+ 5.times do | bit |
+ if (value[bit] == 0) then
+ cur_region |= 1 << bit
+ else
+ if (cur_region != 0 ) then
+ regions.push( cur_region)
+ cur_region = 0;
+ end
+ end
+ end
+ regions.push(cur_region) if (cur_region != 0)
+ regions
+end
+
+# find up to the counted number of solutions (or all solutions) and prints the final result
+def find_all
+ find_top( 1)
+ find_top( 0)
+ print_results
+end
+
+# show the board
+def print_results
+ print "#{@boards_found} solutions found\n\n"
+ print_full_board( @min_board)
+ print "\n"
+ print_full_board( @max_board)
+ print "\n"
+end
+
+# finds solutions. This special version of the main function is only used for the top level
+# the reason for it is basically to force a particular ordering on how the rotations are tested for
+# the first piece. It is called twice, first looking for placements of the odd rotations and then
+# looking for placements of the even locations.
+#
+# WHY?
+# Since any found solution has an inverse we want to maximize finding solutions that are not already found
+# as an inverse. The inverse will ALWAYS be 3 one of the piece configurations that is exactly 3 rotations away
+# (an odd number). Checking even vs odd then produces a higher probability of finding more pieces earlier
+# in the cycle. We still need to keep checking all the permutations, but our probability of finding one will
+# diminsh over time. Since we are TOLD how many to search for this lets us exit before checking all pieces
+# this bennifit is very great when seeking small numbers of solutions and is 0 when looking for more than the
+# maximum number
+def find_top( rotation_skip)
+ board = blank_board
+ (@pieces.length-1).times do
+ piece = @pieces.shift
+ piece.masks[0].each do | mask, imask, cmask |
+ if ((rotation_skip += 1) % 2 == 0) then
+ piece.placed = mask
+ find( 1, 1, board | mask)
+ end
+ end
+ @pieces.push(piece)
+ end
+ piece = @pieces.shift
+ @pieces.push(piece)
+end
+
+# the normail find routine, iterates through the available pieces, checks all rotations at the current location
+# 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
+# placed -- number of pieces placed
+# board -- current state of the board
+#
+# see in-code comments
+def find( start_location, placed, board)
+ # find the next location to place a piece by looking for an empty bit
+ while board[start_location] == 1
+ start_location += 1
+ end
+
+ @pieces.length.times do
+ piece = @pieces.shift
+ piece.masks[start_location].each do | mask, imask, cmask |
+ if ( board & cmask == imask) then
+ piece.placed = mask
+ if (placed == 9) then
+ add_board
+ else
+ find( start_location + 1, placed + 1, board | mask)
+ end
+ end
+ end
+ @pieces.push(piece)
+ end
+end
+
+# print the board
+def print_full_board( board_string)
+ 10.times do | row |
+ print " " if (row % 2 == 1)
+ 5.times do | col |
+ print "#{board_string[row*5 + col,1]} "
+ end
+ print "\n"
+ end
+end
+
+# when a board is found we "draw it" into a string and then flip that string, adding both to
+# the list (hash) of solutions if they are unique.
+def add_board
+ board_string = "99999999999999999999999999999999999999999999999999"
+ @all_pieces.each { | piece | piece.fill_string( board_string ) }
+ save( board_string)
+ save( board_string.reverse)
+end
+
+# adds a board string to the list (if new) and updates the current best/worst board
+def save( board_string)
+ if (@all_boards[board_string] == nil) then
+ @min_board = board_string if (board_string < @min_board)
+ @max_board = board_string if (board_string > @max_board)
+ @all_boards.store(board_string,true)
+ @boards_found += 1
+
+ # the exit motif is a time saver. Ideally the function should return, but those tests
+ # take noticeable time (performance).
+ if (@boards_found == @stop_count) then
+ print_results
+ exit(0)
+ end
+ end
+end
+
+
+##
+## MAIN BODY :)
+##
+create_collector_support
+@pieces = [
+ Piece.new( [ :nw, :ne, :east, :east ], 2),
+ Piece.new( [ :ne, :se, :east, :ne ], 7),
+ Piece.new( [ :ne, :east, :ne, :nw ], 1),
+ Piece.new( [ :east, :sw, :sw, :se ], 6),
+ Piece.new( [ :east, :ne, :se, :ne ], 5),
+ Piece.new( [ :east, :east, :east, :se ], 0),
+ Piece.new( [ :ne, :nw, :se, :east, :se ], 4),
+ Piece.new( [ :se, :se, :se, :west ], 9),
+ Piece.new( [ :se, :se, :east, :se ], 8),
+ Piece.new( [ :east, :east, :sw, :se ], 3)
+ ];
+
+@all_pieces = Array.new( @pieces)
+
+@min_board = "99999999999999999999999999999999999999999999999999"
+@max_board = "00000000000000000000000000000000000000000000000000"
+@stop_count = ARGV[0].to_i || 2089
+@all_boards = {}
+@boards_found = 0
+
+find_all ######## DO IT!!!
+
diff --git a/benchmark/bm_so_nbody.rb b/benchmark/bm_so_nbody.rb
new file mode 100644
index 0000000000..d6c5bb9e61
--- /dev/null
+++ b/benchmark/bm_so_nbody.rb
@@ -0,0 +1,148 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+#
+# Optimized for Ruby by Jesse Millikan
+# From version ported by Michael Neumann from the C gcc version,
+# which was written by Christoph Bauer.
+
+SOLAR_MASS = 4 * Math::PI**2
+DAYS_PER_YEAR = 365.24
+
+def _puts *args
+end
+
+class Planet
+ attr_accessor :x, :y, :z, :vx, :vy, :vz, :mass
+
+ def initialize(x, y, z, vx, vy, vz, mass)
+ @x, @y, @z = x, y, z
+ @vx, @vy, @vz = vx * DAYS_PER_YEAR, vy * DAYS_PER_YEAR, vz * DAYS_PER_YEAR
+ @mass = mass * SOLAR_MASS
+ end
+
+ def move_from_i(bodies, nbodies, dt, i)
+ while i < nbodies
+ b2 = bodies[i]
+ dx = @x - b2.x
+ dy = @y - b2.y
+ dz = @z - b2.z
+
+ distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
+ mag = dt / (distance * distance * distance)
+ b_mass_mag, b2_mass_mag = @mass * mag, b2.mass * mag
+
+ @vx -= dx * b2_mass_mag
+ @vy -= dy * b2_mass_mag
+ @vz -= dz * b2_mass_mag
+ b2.vx += dx * b_mass_mag
+ b2.vy += dy * b_mass_mag
+ b2.vz += dz * b_mass_mag
+ i += 1
+ end
+
+ @x += dt * @vx
+ @y += dt * @vy
+ @z += dt * @vz
+ end
+end
+
+def energy(bodies)
+ e = 0.0
+ nbodies = bodies.size
+
+ for i in 0 ... nbodies
+ b = bodies[i]
+ e += 0.5 * b.mass * (b.vx * b.vx + b.vy * b.vy + b.vz * b.vz)
+ for j in (i + 1) ... nbodies
+ b2 = bodies[j]
+ dx = b.x - b2.x
+ dy = b.y - b2.y
+ dz = b.z - b2.z
+ distance = Math.sqrt(dx * dx + dy * dy + dz * dz)
+ e -= (b.mass * b2.mass) / distance
+ end
+ end
+ e
+end
+
+def offset_momentum(bodies)
+ px, py, pz = 0.0, 0.0, 0.0
+
+ for b in bodies
+ m = b.mass
+ px += b.vx * m
+ py += b.vy * m
+ pz += b.vz * m
+ end
+
+ b = bodies[0]
+ b.vx = - px / SOLAR_MASS
+ b.vy = - py / SOLAR_MASS
+ b.vz = - pz / SOLAR_MASS
+end
+
+BODIES = [
+ # sun
+ Planet.new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
+
+ # jupiter
+ Planet.new(
+ 4.84143144246472090e+00,
+ -1.16032004402742839e+00,
+ -1.03622044471123109e-01,
+ 1.66007664274403694e-03,
+ 7.69901118419740425e-03,
+ -6.90460016972063023e-05,
+ 9.54791938424326609e-04),
+
+ # saturn
+ Planet.new(
+ 8.34336671824457987e+00,
+ 4.12479856412430479e+00,
+ -4.03523417114321381e-01,
+ -2.76742510726862411e-03,
+ 4.99852801234917238e-03,
+ 2.30417297573763929e-05,
+ 2.85885980666130812e-04),
+
+ # uranus
+ Planet.new(
+ 1.28943695621391310e+01,
+ -1.51111514016986312e+01,
+ -2.23307578892655734e-01,
+ 2.96460137564761618e-03,
+ 2.37847173959480950e-03,
+ -2.96589568540237556e-05,
+ 4.36624404335156298e-05),
+
+ # neptune
+ Planet.new(
+ 1.53796971148509165e+01,
+ -2.59193146099879641e+01,
+ 1.79258772950371181e-01,
+ 2.68067772490389322e-03,
+ 1.62824170038242295e-03,
+ -9.51592254519715870e-05,
+ 5.15138902046611451e-05)
+]
+
+init = 200_000 # ARGV[0]
+n = Integer(init)
+
+offset_momentum(BODIES)
+
+puts "%.9f" % energy(BODIES)
+
+nbodies = BODIES.size
+dt = 0.01
+
+n.times do
+ i = 0
+ while i < nbodies
+ b = BODIES[i]
+ b.move_from_i(BODIES, nbodies, dt, i + 1)
+ i += 1
+ end
+end
+
+puts "%.9f" % energy(BODIES)
diff --git a/benchmark/bm_so_nested_loop.rb b/benchmark/bm_so_nested_loop.rb
new file mode 100644
index 0000000000..a0513f8c47
--- /dev/null
+++ b/benchmark/bm_so_nested_loop.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: nestedloop-ruby.code,v 1.4 2004/11/13 07:42:22 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# from Avi Bryant
+
+n = 16 # Integer(ARGV.shift || 1)
+x = 0
+n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ x += 1
+ end
+ end
+ end
+ end
+ end
+end
+# puts x
+
+
diff --git a/benchmark/bm_so_nsieve.rb b/benchmark/bm_so_nsieve.rb
new file mode 100644
index 0000000000..a65cc78233
--- /dev/null
+++ b/benchmark/bm_so_nsieve.rb
@@ -0,0 +1,35 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# contributed by Glenn Parker, March 2005
+# modified by Evan Phoenix, Sept 2006
+
+def sieve(m)
+ flags = Flags.dup[0,m]
+ count = 0
+ pmax = m - 1
+ p = 2
+ while p <= pmax
+ unless flags[p].zero?
+ count += 1
+ mult = p
+ while mult <= pmax
+ flags[mult] = 0
+ mult += p
+ end
+ end
+ p += 1
+ end
+ count
+end
+
+n = 9 # (ARGV[0] || 2).to_i
+Flags = ("\x1" * ( 2 ** n * 10_000)).unpack("c*")
+
+n.downto(n-2) do |exponent|
+ break if exponent < 0
+ m = (1 << exponent) * 10_000
+ # m = (2 ** exponent) * 10_000
+ count = sieve(m)
+ printf "Primes up to %8d %8d\n", m, count
+end
diff --git a/benchmark/bm_so_nsieve_bits.rb b/benchmark/bm_so_nsieve_bits.rb
new file mode 100644
index 0000000000..6f958ee44e
--- /dev/null
+++ b/benchmark/bm_so_nsieve_bits.rb
@@ -0,0 +1,43 @@
+#!/usr/bin/ruby
+#coding: us-ascii
+#
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# nsieve-bits in Ruby
+# Contributed by Glenn Parker, March 2005
+
+CharExponent = 3
+BitsPerChar = 1 << CharExponent
+LowMask = BitsPerChar - 1
+
+def sieve(m)
+ items = "\xFF" * ((m / BitsPerChar) + 1)
+ masks = ""
+ BitsPerChar.times do |b|
+ masks << (1 << b).chr
+ end
+
+ count = 0
+ pmax = m - 1
+ 2.step(pmax, 1) do |p|
+ if items[p >> CharExponent][p & LowMask] == 1
+ count += 1
+ p.step(pmax, p) do |mult|
+ a = mult >> CharExponent
+ b = mult & LowMask
+ items[a] -= masks[b] if items[a][b] != 0
+ end
+ end
+ end
+ count
+end
+
+n = 9 # (ARGV[0] || 2).to_i
+n.step(n - 2, -1) do |exponent|
+ break if exponent < 0
+ m = 2 ** exponent * 10_000
+ count = sieve(m)
+ printf "Primes up to %8d %8d\n", m, count
+end
+
diff --git a/benchmark/bm_so_object.rb b/benchmark/bm_so_object.rb
new file mode 100644
index 0000000000..e8607c7199
--- /dev/null
+++ b/benchmark/bm_so_object.rb
@@ -0,0 +1,56 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: objinst-ruby.code,v 1.4 2004/11/13 07:42:25 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Aristarkh Zagorodnikov
+
+class Toggle
+ def initialize(start_state)
+ @bool = start_state
+ end
+
+ def value
+ @bool
+ end
+
+ def activate
+ @bool = !@bool
+ self
+ end
+end
+
+class NthToggle < Toggle
+ def initialize(start_state, max_counter)
+ super start_state
+ @count_max = max_counter
+ @counter = 0
+ end
+
+ def activate
+ @counter += 1
+ if @counter >= @count_max
+ @bool = !@bool
+ @counter = 0
+ end
+ self
+ end
+end
+
+n = 1500000 # (ARGV.shift || 1).to_i
+
+toggle = Toggle.new 1
+5.times do
+ toggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ toggle = Toggle.new 1
+end
+
+ntoggle = NthToggle.new 1, 3
+8.times do
+ ntoggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ ntoggle = NthToggle.new 1, 3
+end
+
diff --git a/benchmark/bm_so_partial_sums.rb b/benchmark/bm_so_partial_sums.rb
new file mode 100644
index 0000000000..630b45cb8d
--- /dev/null
+++ b/benchmark/bm_so_partial_sums.rb
@@ -0,0 +1,31 @@
+n = 2_500_000 # (ARGV.shift || 1).to_i
+
+alt = 1.0 ; s0 = s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = 0.0
+
+1.upto(n) do |d|
+ d = d.to_f ; d2 = d * d ; d3 = d2 * d ; ds = Math.sin(d) ; dc = Math.cos(d)
+
+ s0 += (2.0 / 3.0) ** (d - 1.0)
+ s1 += 1.0 / Math.sqrt(d)
+ s2 += 1.0 / (d * (d + 1.0))
+ s3 += 1.0 / (d3 * ds * ds)
+ s4 += 1.0 / (d3 * dc * dc)
+ s5 += 1.0 / d
+ s6 += 1.0 / d2
+ s7 += alt / d
+ s8 += alt / (2.0 * d - 1.0)
+
+ alt = -alt
+end
+
+if false
+ printf("%.9f\t(2/3)^k\n", s0)
+ printf("%.9f\tk^-0.5\n", s1)
+ printf("%.9f\t1/k(k+1)\n", s2)
+ printf("%.9f\tFlint Hills\n", s3)
+ printf("%.9f\tCookson Hills\n", s4)
+ printf("%.9f\tHarmonic\n", s5)
+ printf("%.9f\tRiemann Zeta\n", s6)
+ printf("%.9f\tAlternating Harmonic\n", s7)
+ printf("%.9f\tGregory\n", s8)
+end
diff --git a/benchmark/bm_so_pidigits.rb b/benchmark/bm_so_pidigits.rb
new file mode 100644
index 0000000000..c7d6fbfb4d
--- /dev/null
+++ b/benchmark/bm_so_pidigits.rb
@@ -0,0 +1,92 @@
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# contributed by Gabriele Renzi
+
+class PiDigitSpigot
+
+ def initialize()
+ @z = Transformation.new 1,0,0,1
+ @x = Transformation.new 0,0,0,0
+ @inverse = Transformation.new 0,0,0,0
+ end
+
+ def next!
+ @y = @z.extract(3)
+ if safe? @y
+ @z = produce(@y)
+ @y
+ else
+ @z = consume @x.next!()
+ next!()
+ end
+ end
+
+ def safe?(digit)
+ digit == @z.extract(4)
+ end
+
+ def produce(i)
+ @inverse.qrst(10,-10*i,0,1).compose(@z)
+ end
+
+ def consume(a)
+ @z.compose(a)
+ end
+end
+
+
+class Transformation
+ attr_reader :q, :r, :s, :t
+ def initialize (q, r, s, t)
+ @q,@r,@s,@t,@k = q,r,s,t,0
+ end
+
+ def next!()
+ @q = @k = @k + 1
+ @r = 4 * @k + 2
+ @s = 0
+ @t = 2 * @k + 1
+ self
+ end
+
+ def extract(j)
+ (@q * j + @r) / (@s * j + @t)
+ end
+
+ def compose(a)
+ self.class.new( @q * a.q,
+ @q * a.r + r * a.t,
+ @s * a.q + t * a.s,
+ @s * a.r + t * a.t
+ )
+ end
+
+ def qrst *args
+ initialize *args
+ self
+ end
+
+
+end
+
+
+WIDTH = 10
+n = 2_500 # Integer(ARGV[0])
+j = 0
+
+digits = PiDigitSpigot.new
+
+while n > 0
+ if n >= WIDTH
+ WIDTH.times {print digits.next!}
+ j += WIDTH
+ else
+ n.times {print digits.next!}
+ (WIDTH-n).times {print " "}
+ j += n
+ end
+ puts "\t:"+j.to_s
+ n -= WIDTH
+end
+
diff --git a/benchmark/bm_so_random.rb b/benchmark/bm_so_random.rb
new file mode 100644
index 0000000000..a66b9e8e63
--- /dev/null
+++ b/benchmark/bm_so_random.rb
@@ -0,0 +1,20 @@
+# from http://www.bagley.org/~doug/shootout/bench/random/random.ruby
+
+IM = 139968.0
+IA = 3877.0
+IC = 29573.0
+
+$last = 42.0
+
+def gen_random(max)
+ (max * ($last = ($last * IA + IC) % IM)) / IM
+end
+
+N = 3_000_000
+
+i = 0
+while i<N
+ i +=1
+ gen_random(100.0)
+end
+# "%.9f" % gen_random(100.0)
diff --git a/benchmark/bm_so_reverse_complement.rb b/benchmark/bm_so_reverse_complement.rb
new file mode 100644
index 0000000000..82ea666994
--- /dev/null
+++ b/benchmark/bm_so_reverse_complement.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/ruby
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# Contributed by Peter Bjarke Olsen
+# Modified by Doug King
+
+seq=Array.new
+
+def revcomp(seq)
+ seq.reverse!.tr!('wsatugcyrkmbdhvnATUGCYRKMBDHVN','WSTAACGRYMKVHDBNTAACGRYMKVHDBN')
+ stringlen=seq.length
+ 0.step(stringlen-1,60) {|x| print seq.slice(x,60) , "\n"}
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.2500000'), 'rb')
+
+while input.gets
+ if $_ =~ />/
+ if seq.length != 0
+ revcomp(seq.join)
+ seq=Array.new
+ end
+ puts $_
+ else
+ $_.sub(/\n/,'')
+ seq.push $_
+ end
+end
+revcomp(seq.join)
diff --git a/benchmark/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb
new file mode 100644
index 0000000000..43dc302648
--- /dev/null
+++ b/benchmark/bm_so_sieve.rb
@@ -0,0 +1,24 @@
+# from http://www.bagley.org/~doug/shootout/bench/sieve/sieve.ruby
+num = 500
+count = i = j = 0
+flags0 = Array.new(8192,1)
+k = 0
+while k < num
+ k += 1
+ count = 0
+ flags = flags0.dup
+ i = 2
+ while i<8192
+ i += 1
+ if flags[i]
+ # remove all multiples of prime: i
+ j = i*i
+ while j < 8192
+ j += i
+ flags[j] = nil
+ end
+ count += 1
+ end
+ end
+end
+count
diff --git a/benchmark/bm_so_spectralnorm.rb b/benchmark/bm_so_spectralnorm.rb
new file mode 100644
index 0000000000..6b97206689
--- /dev/null
+++ b/benchmark/bm_so_spectralnorm.rb
@@ -0,0 +1,50 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+
+def eval_A(i,j)
+ return 1.0/((i+j)*(i+j+1)/2+i+1)
+end
+
+def eval_A_times_u(u)
+ v, i = nil, nil
+ (0..u.length-1).collect { |i|
+ v = 0
+ for j in 0..u.length-1
+ v += eval_A(i,j)*u[j]
+ end
+ v
+ }
+end
+
+def eval_At_times_u(u)
+ v, i = nil, nil
+ (0..u.length-1).collect{|i|
+ v = 0
+ for j in 0..u.length-1
+ v += eval_A(j,i)*u[j]
+ end
+ v
+ }
+end
+
+def eval_AtA_times_u(u)
+ return eval_At_times_u(eval_A_times_u(u))
+end
+
+n = 500 # ARGV[0].to_i
+
+u=[1]*n
+for i in 1..10
+ v=eval_AtA_times_u(u)
+ u=eval_AtA_times_u(v)
+end
+vBv=0
+vv=0
+for i in 0..n-1
+ vBv += u[i]*v[i]
+ vv += v[i]*v[i]
+end
+
+str = "%0.9f" % (Math.sqrt(vBv/vv)), "\n"
+# print str
diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb
new file mode 100644
index 0000000000..16906f3605
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar.rb
@@ -0,0 +1,14 @@
+class C
+ attr_reader :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = obj.a
+ k = obj.b
+end
diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb
new file mode 100644
index 0000000000..7e7a6b48c0
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar_set.rb
@@ -0,0 +1,14 @@
+class C
+ attr_accessor :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ obj.a = 1
+ obj.b = 2
+end
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
new file mode 100644
index 0000000000..a9f56b15ea
--- /dev/null
+++ b/benchmark/bm_vm1_block.rb
@@ -0,0 +1,10 @@
+def m
+ yield
+end
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m{
+ }
+end
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
new file mode 100644
index 0000000000..ac59ebccf1
--- /dev/null
+++ b/benchmark/bm_vm1_const.rb
@@ -0,0 +1,8 @@
+Const = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = Const
+ k = Const
+end
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
new file mode 100644
index 0000000000..a1596145f2
--- /dev/null
+++ b/benchmark/bm_vm1_ensure.rb
@@ -0,0 +1,11 @@
+i = 0
+while i<30_000_000 # benchmark loop 1
+ i += 1
+ begin
+ begin
+ ensure
+ end
+ ensure
+ end
+end
+
diff --git a/benchmark/bm_vm1_float_simple.rb b/benchmark/bm_vm1_float_simple.rb
new file mode 100644
index 0000000000..d4581439ff
--- /dev/null
+++ b/benchmark/bm_vm1_float_simple.rb
@@ -0,0 +1,7 @@
+i = 0.0; f = 0.0
+while i<30_000_000
+ i += 1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+end
diff --git a/benchmark/bm_vm1_gc_short_lived.rb b/benchmark/bm_vm1_gc_short_lived.rb
new file mode 100644
index 0000000000..e78bca5668
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_lived.rb
@@ -0,0 +1,10 @@
+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
new file mode 100644
index 0000000000..b66052dee0
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_complex_long.rb
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 0000000000..298dbc845b
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_long.rb
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..6b15c1b7bf
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_symbol.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 0000000000..ecfab51dbf
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_ary.rb
@@ -0,0 +1,10 @@
+long_lived = []
+GC.start
+GC.start
+
+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
new file mode 100644
index 0000000000..017eff4f94
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_obj.rb
@@ -0,0 +1,13 @@
+class C
+ attr_accessor :foo
+end
+long_lived = C.new
+GC.start
+GC.start
+
+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_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
new file mode 100644
index 0000000000..68a73cf92f
--- /dev/null
+++ b/benchmark/bm_vm1_ivar.rb
@@ -0,0 +1,8 @@
+@a = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = @a
+ k = @a
+end
diff --git a/benchmark/bm_vm1_ivar_set.rb b/benchmark/bm_vm1_ivar_set.rb
new file mode 100644
index 0000000000..bd81b06c34
--- /dev/null
+++ b/benchmark/bm_vm1_ivar_set.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ @a = 1
+ @b = 2
+end
diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb
new file mode 100644
index 0000000000..353de3ab0e
--- /dev/null
+++ b/benchmark/bm_vm1_length.rb
@@ -0,0 +1,9 @@
+a = 'abc'
+b = [1, 2, 3]
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a.length
+ b.length
+end
+
diff --git a/benchmark/bm_vm1_lvar_init.rb b/benchmark/bm_vm1_lvar_init.rb
new file mode 100644
index 0000000000..36f2068811
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_init.rb
@@ -0,0 +1,18 @@
+def m v
+ unless v
+ # unreachable code
+ v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
+ v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
+ v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
+ v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
+ v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
+ end
+end
+
+i = 0
+
+while i<30_000_000 # while loop 1
+ i += 1
+ m i
+end
+
diff --git a/benchmark/bm_vm1_lvar_set.rb b/benchmark/bm_vm1_lvar_set.rb
new file mode 100644
index 0000000000..222e864134
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_set.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
+end
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
new file mode 100644
index 0000000000..bbb4ae07a4
--- /dev/null
+++ b/benchmark/bm_vm1_neq.rb
@@ -0,0 +1,8 @@
+i = 0
+obj1 = Object.new
+obj2 = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ obj1 != obj2
+end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
new file mode 100644
index 0000000000..b09ecdcc21
--- /dev/null
+++ b/benchmark/bm_vm1_not.rb
@@ -0,0 +1,7 @@
+i = 0
+obj = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ !obj
+end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
new file mode 100644
index 0000000000..b0d3e2bdfa
--- /dev/null
+++ b/benchmark/bm_vm1_rescue.rb
@@ -0,0 +1,7 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ begin
+ rescue
+ end
+end
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
new file mode 100644
index 0000000000..63f9f21675
--- /dev/null
+++ b/benchmark/bm_vm1_simplereturn.rb
@@ -0,0 +1,9 @@
+def m
+ return 1
+end
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m
+end
+
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
new file mode 100644
index 0000000000..918f8b2112
--- /dev/null
+++ b/benchmark/bm_vm1_swap.rb
@@ -0,0 +1,8 @@
+a = 1
+b = 2
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a, b = b, a
+end
+
diff --git a/benchmark/bm_vm1_yield.rb b/benchmark/bm_vm1_yield.rb
new file mode 100644
index 0000000000..775597cea6
--- /dev/null
+++ b/benchmark/bm_vm1_yield.rb
@@ -0,0 +1,10 @@
+def m
+ i = 0
+ while i<30_000_000 # while loop 1
+ i += 1
+ yield
+ end
+end
+
+m{}
+
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
new file mode 100644
index 0000000000..df9037c83c
--- /dev/null
+++ b/benchmark/bm_vm2_array.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [1,2,3,4,5,6,7,8,9,10]
+end
diff --git a/benchmark/bm_vm2_bigarray.rb b/benchmark/bm_vm2_bigarray.rb
new file mode 100644
index 0000000000..b02509d6a2
--- /dev/null
+++ b/benchmark/bm_vm2_bigarray.rb
@@ -0,0 +1,106 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ ]
+end
diff --git a/benchmark/bm_vm2_bighash.rb b/benchmark/bm_vm2_bighash.rb
new file mode 100644
index 0000000000..5e3f437bb8
--- /dev/null
+++ b/benchmark/bm_vm2_bighash.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<60_000 # benchmark loop 2
+ i += 1
+ a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
+end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
new file mode 100644
index 0000000000..adc6e4df0a
--- /dev/null
+++ b/benchmark/bm_vm2_case.rb
@@ -0,0 +1,14 @@
+i = 0
+while i<6_000_000 # while loop 2
+ case :foo
+ when :bar
+ raise
+ when :baz
+ raise
+ when :boo
+ raise
+ when :foo
+ i += 1
+ end
+end
+
diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb
new file mode 100644
index 0000000000..053ed6c912
--- /dev/null
+++ b/benchmark/bm_vm2_defined_method.rb
@@ -0,0 +1,9 @@
+class Object
+ define_method(:m){}
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_dstr.rb b/benchmark/bm_vm2_dstr.rb
new file mode 100644
index 0000000000..58c0f7bbc3
--- /dev/null
+++ b/benchmark/bm_vm2_dstr.rb
@@ -0,0 +1,6 @@
+i = 0
+x = y = 'z'
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ str = "foo#{x}bar#{y}baz"
+end
diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb
new file mode 100644
index 0000000000..307cfc28ef
--- /dev/null
+++ b/benchmark/bm_vm2_eval.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ eval("1")
+end
+
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
new file mode 100644
index 0000000000..a8ccff7138
--- /dev/null
+++ b/benchmark/bm_vm2_method.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_method_missing.rb b/benchmark/bm_vm2_method_missing.rb
new file mode 100644
index 0000000000..2badc73101
--- /dev/null
+++ b/benchmark/bm_vm2_method_missing.rb
@@ -0,0 +1,12 @@
+class C
+ def method_missing mid
+ end
+end
+
+obj = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
+end
diff --git a/benchmark/bm_vm2_method_with_block.rb b/benchmark/bm_vm2_method_with_block.rb
new file mode 100644
index 0000000000..b4efb4f520
--- /dev/null
+++ b/benchmark/bm_vm2_method_with_block.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
+end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
new file mode 100644
index 0000000000..7362f738c5
--- /dev/null
+++ b/benchmark/bm_vm2_mutex.rb
@@ -0,0 +1,9 @@
+require 'thread'
+
+m = Mutex.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m.synchronize{}
+end
diff --git a/benchmark/bm_vm2_newlambda.rb b/benchmark/bm_vm2_newlambda.rb
new file mode 100644
index 0000000000..6422c9b0d0
--- /dev/null
+++ b/benchmark/bm_vm2_newlambda.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ lambda {}
+end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
new file mode 100644
index 0000000000..c82c0e4bce
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ o = (i % 2 == 0) ? o1 : o2
+ o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb
new file mode 100644
index 0000000000..aa5fd1dd38
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method_ov.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ o = (i % 2 == 0) ? o1 : o2
+# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_proc.rb b/benchmark/bm_vm2_proc.rb
new file mode 100644
index 0000000000..65e5217371
--- /dev/null
+++ b/benchmark/bm_vm2_proc.rb
@@ -0,0 +1,14 @@
+def m &b
+ b
+end
+
+pr = m{
+ a = 1
+}
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ pr.call
+end
+
diff --git a/benchmark/bm_vm2_raise1.rb b/benchmark/bm_vm2_raise1.rb
new file mode 100644
index 0000000000..aa5387987f
--- /dev/null
+++ b/benchmark/bm_vm2_raise1.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 1
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_raise2.rb b/benchmark/bm_vm2_raise2.rb
new file mode 100644
index 0000000000..1f61c63157
--- /dev/null
+++ b/benchmark/bm_vm2_raise2.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 10
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
new file mode 100644
index 0000000000..55f9e957a3
--- /dev/null
+++ b/benchmark/bm_vm2_regexp.rb
@@ -0,0 +1,6 @@
+i = 0
+str = 'xxxhogexxx'
+while i<6_000_000 # benchmark loop 2
+ /hoge/ =~ str
+ i += 1
+end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
new file mode 100644
index 0000000000..6a3ab6fdab
--- /dev/null
+++ b/benchmark/bm_vm2_send.rb
@@ -0,0 +1,12 @@
+class C
+ def m
+ end
+end
+
+o = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ o.__send__ :m
+end
diff --git a/benchmark/bm_vm2_struct_big_aref_hi.rb b/benchmark/bm_vm2_struct_big_aref_hi.rb
new file mode 100644
index 0000000000..22cb26b0a5
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_hi.rb
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000000..5e61a7087e
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_lo.rb
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000000..5a1c3d16f3
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aset.rb
@@ -0,0 +1,7 @@
+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_small_aref.rb b/benchmark/bm_vm2_struct_small_aref.rb
new file mode 100644
index 0000000000..8eaa555b41
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aref.rb
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000000..ecd0f95669
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aset.rb
@@ -0,0 +1,7 @@
+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_super.rb b/benchmark/bm_vm2_super.rb
new file mode 100644
index 0000000000..afd8579e7b
--- /dev/null
+++ b/benchmark/bm_vm2_super.rb
@@ -0,0 +1,20 @@
+
+class C
+ def m
+ 1
+ end
+end
+
+class CC < C
+ def m
+ super()
+ end
+end
+
+obj = CC.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ obj.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
new file mode 100644
index 0000000000..1774625942
--- /dev/null
+++ b/benchmark/bm_vm2_unif1.rb
@@ -0,0 +1,8 @@
+i = 0
+def m a, b
+end
+
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m 100, 200
+end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
new file mode 100644
index 0000000000..2a43e62217
--- /dev/null
+++ b/benchmark/bm_vm2_zsuper.rb
@@ -0,0 +1,20 @@
+i = 0
+
+class C
+ def m a
+ 1
+ end
+end
+
+class CC < C
+ def m a
+ super
+ end
+end
+
+obj = CC.new
+
+while i<6_000_000 # benchmark loop 2
+ obj.m 10
+ i += 1
+end
diff --git a/benchmark/bm_vm3_backtrace.rb b/benchmark/bm_vm3_backtrace.rb
new file mode 100644
index 0000000000..0fbf73e1ca
--- /dev/null
+++ b/benchmark/bm_vm3_backtrace.rb
@@ -0,0 +1,22 @@
+# get last backtrace
+
+begin
+ caller(0, 0)
+rescue ArgumentError
+ alias caller_orig caller
+ def caller lev, n
+ caller_orig(lev)[0..n]
+ end
+end
+
+def rec n
+ if n < 0
+ 100_000.times{
+ caller(0, 1)
+ }
+ else
+ rec(n-1)
+ end
+end
+
+rec 50
diff --git a/benchmark/bm_vm3_clearmethodcache.rb b/benchmark/bm_vm3_clearmethodcache.rb
new file mode 100644
index 0000000000..9661323cd2
--- /dev/null
+++ b/benchmark/bm_vm3_clearmethodcache.rb
@@ -0,0 +1,8 @@
+i = 0
+while i<200_000
+ i += 1
+
+ Class.new{
+ def m; end
+ }
+end
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
new file mode 100755
index 0000000000..7db9829d44
--- /dev/null
+++ b/benchmark/bm_vm3_gc.rb
@@ -0,0 +1,7 @@
+#! /usr/bin/ruby
+5000.times do
+ 100.times do
+ {"xxxx"=>"yyyy"}
+ end
+ GC.start
+end
diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb
new file mode 100644
index 0000000000..c993accdda
--- /dev/null
+++ b/benchmark/bm_vm_thread_alive_check1.rb
@@ -0,0 +1,6 @@
+5_000.times{
+ t = Thread.new{}
+ while t.alive?
+ Thread.pass
+ end
+}
diff --git a/benchmark/bm_vm_thread_close.rb b/benchmark/bm_vm_thread_close.rb
new file mode 100644
index 0000000000..3e9a265ce8
--- /dev/null
+++ b/benchmark/bm_vm_thread_close.rb
@@ -0,0 +1,6 @@
+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_create_join.rb b/benchmark/bm_vm_thread_create_join.rb
new file mode 100644
index 0000000000..393cd45df9
--- /dev/null
+++ b/benchmark/bm_vm_thread_create_join.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<100_000 # benchmark loop 3
+ i += 1
+ Thread.new{
+ }.join
+end
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
new file mode 100644
index 0000000000..5c9f85dfb7
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -0,0 +1,21 @@
+# one thread, one mutex (no contention)
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = max * max
+(1..1).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
new file mode 100644
index 0000000000..10de59054f
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -0,0 +1,21 @@
+# two threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = (max * max)/2
+(1..2).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
new file mode 100644
index 0000000000..7f9a44b39d
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -0,0 +1,20 @@
+# 1000 threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+(1..max).map{
+ Thread.new{
+ i = 0
+ while i<max
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_pass.rb b/benchmark/bm_vm_thread_pass.rb
new file mode 100644
index 0000000000..b5b3c0bc85
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass.rb
@@ -0,0 +1,15 @@
+# Plenty Thtread.pass
+# A performance may depend on GVL implementation.
+
+tmax = (ARGV.shift || 2).to_i
+lmax = 200_000 / tmax
+
+(1..tmax).map{
+ Thread.new{
+ lmax.times{
+ Thread.pass
+ }
+ }
+}.each{|t| t.join}
+
+
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
new file mode 100644
index 0000000000..27157d1a6f
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -0,0 +1,8 @@
+1000.times{
+ Thread.new{loop{Thread.pass}}
+}
+
+i = 0
+while i<10000
+ i += 1
+end
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
new file mode 100644
index 0000000000..272d231eba
--- /dev/null
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -0,0 +1,17 @@
+# Mesure small and plenty pipe read/write.
+# A performance may depend on GVL implementation.
+
+lmax = 100_000
+r, w = IO.pipe
+[Thread.new{
+ lmax.times{
+ w.write('a')
+ }
+ p "w:exit"
+}, Thread.new{
+ lmax.times{
+ r.read(1)
+ }
+ p "r:exit"
+}].each{|t| t.join}
+
diff --git a/benchmark/bm_vm_thread_queue.rb b/benchmark/bm_vm_thread_queue.rb
new file mode 100644
index 0000000000..37381ae62b
--- /dev/null
+++ b/benchmark/bm_vm_thread_queue.rb
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000000..3904e25503
--- /dev/null
+++ b/benchmark/driver.rb
@@ -0,0 +1,321 @@
+#
+# Ruby Benchmark driver
+#
+
+first = true
+
+begin
+ require 'optparse'
+rescue LoadError
+ if first
+ first = false
+ $:.unshift File.join(File.dirname(__FILE__), '../lib')
+ retry
+ else
+ raise
+ end
+end
+
+require 'benchmark'
+require 'pp'
+
+class BenchmarkDriver
+ def self.benchmark(opt)
+ driver = self.new(opt[:execs], opt[:dir], opt)
+ begin
+ driver.run
+ ensure
+ driver.show_results
+ end
+ end
+
+ def output *args
+ puts(*args)
+ @output and @output.puts(*args)
+ end
+
+ def message *args
+ output(*args) if @verbose
+ end
+
+ def message_print *args
+ if @verbose
+ print(*args)
+ STDOUT.flush
+ @output and @output.print(*args)
+ end
+ end
+
+ def progress_message *args
+ unless STDOUT.tty?
+ STDERR.print(*args)
+ STDERR.flush
+ end
+ end
+
+ def initialize execs, dir, opt = {}
+ @execs = execs.map{|e|
+ e.strip!
+ next if e.empty?
+
+ if /(.+)::(.+)/ =~ e
+ # ex) ruby-a::/path/to/ruby-a
+ label = $1.strip
+ path = $2
+ version = `#{path} -v`.chomp
+ else
+ path = e
+ version = label = `#{path} -v`.chomp
+ end
+ [path, label, version]
+ }.compact
+
+ @dir = dir
+ @repeat = opt[:repeat] || 1
+ @repeat = 1 if @repeat < 1
+ @pattern = opt[:pattern] || nil
+ @exclude = opt[:exclude] || nil
+ @verbose = opt[:quiet] ? false : (opt[:verbose] || false)
+ @output = opt[:output] ? open(opt[:output], 'w') : nil
+ @rawdata_output = opt[:rawdata_output] ? open(opt[:rawdata_output], 'w') : nil
+ @loop_wl1 = @loop_wl2 = nil
+ @ruby_arg = opt[:ruby_arg] || nil
+ @opt = opt
+
+ # [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
+ @results = []
+
+ if @verbose
+ @start_time = Time.now
+ message @start_time
+ @execs.each_with_index{|(path, label, version), i|
+ message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at \"#{path}\""
+ }
+ end
+ end
+
+ def adjusted_results name, results
+ s = nil
+ results.each_with_index{|e, i|
+ r = e.min
+ case name
+ when /^vm1_/
+ if @loop_wl1
+ r -= @loop_wl1[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ when /^vm2_/
+ if @loop_wl2
+ r -= @loop_wl2[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ end
+ yield r
+ }
+ s
+ end
+
+ def show_results
+ output
+
+ if @verbose
+ message '-----------------------------------------------------------'
+ message 'raw data:'
+ message
+ message PP.pp(@results, "", 79)
+ message
+ message "Elapsed time: #{Time.now - @start_time} (sec)"
+ end
+
+ if @rawdata_output
+ h = {}
+ h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
+ h[:executables] = @execs
+ h[:results] = @results
+ @rawdata_output.puts h.inspect
+ end
+
+ output '-----------------------------------------------------------'
+ output 'benchmark results:'
+
+ if @verbose and @repeat > 1
+ output "minimum results in each #{@repeat} measurements."
+ end
+
+ output "Execution time (sec)"
+ output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ s = adjusted_results(v, result){|r|
+ rets << sprintf("%.3f", r)
+ }
+ 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 "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ first_value = nil
+ s = adjusted_results(v, result){|r|
+ if first_value
+ if r == 0
+ rets << "Error"
+ else
+ rets << sprintf("%.3f", first_value/r)
+ end
+ else
+ first_value = r
+ end
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+ end
+
+ if @opt[:output]
+ output
+ output "Log file: #{@opt[:output]}"
+ end
+ end
+
+ def files
+ flag = {}
+ @files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file|
+ next if @pattern && /#{@pattern}/ !~ File.basename(file)
+ next if @exclude && /#{@exclude}/ =~ File.basename(file)
+ case file
+ when /bm_(vm[12])_/, /bm_loop_(whileloop2?).rb/
+ flag[$1] = true
+ end
+ file
+ }.compact
+
+ if flag['vm1'] && !flag['whileloop']
+ @files << File.join(@dir, 'bm_loop_whileloop.rb')
+ elsif flag['vm2'] && !flag['whileloop2']
+ @files << File.join(@dir, 'bm_loop_whileloop2.rb')
+ end
+
+ @files.sort!
+ progress_message "total: #{@files.size * @repeat} trial(s) (#{@repeat} trial(s) for #{@files.size} benchmark(s))\n"
+ @files
+ end
+
+ def run
+ files.each_with_index{|file, i|
+ @i = i
+ r = measure_file(file)
+
+ if /bm_loop_whileloop.rb/ =~ file
+ @loop_wl1 = r[1].map{|e| e.min}
+ elsif /bm_loop_whileloop2.rb/ =~ file
+ @loop_wl2 = r[1].map{|e| e.min}
+ end
+ }
+ end
+
+ def measure_file file
+ name = File.basename(file, '.rb').sub(/^bm_/, '')
+ prepare_file = File.join(File.dirname(file), "prepare_#{name}.rb")
+ load prepare_file if FileTest.exist?(prepare_file)
+
+ if @verbose
+ output
+ output '-----------------------------------------------------------'
+ output name
+ output
+ output File.read(file)
+ output
+ end
+
+ result = [name]
+ result << @execs.map{|(e, v)|
+ (0...@repeat).map{
+ message_print "#{v}\t"
+ progress_message '.'
+
+ m = measure(e, file)
+ message "#{m}"
+ m
+ }
+ }
+ @results << result
+ 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)
+ }
+
+ if $? != 0
+ output "\`#{cmd}\' exited with abnormal status (#{$?})"
+ 0
+ else
+ m.real
+ end
+ end
+end
+
+if __FILE__ == $0
+ opt = {
+ :execs => [],
+ :dir => File.dirname(__FILE__),
+ :repeat => 1,
+ :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ :raw_output => nil
+ }
+
+ parser = OptionParser.new{|o|
+ o.on('-e', '--executables [EXECS]',
+ "Specify benchmark one or more targets (e1::path1; e2::path2; e3::path3;...)"){|e|
+ e.split(/;/).each{|path|
+ opt[:execs] << path
+ }
+ }
+ o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
+ opt[:dir] = d
+ }
+ o.on('-p', '--pattern [PATTERN]', "Benchmark name pattern"){|p|
+ opt[:pattern] = p
+ }
+ o.on('-x', '--exclude [PATTERN]', "Benchmark exclude pattern"){|e|
+ opt[:exclude] = e
+ }
+ o.on('-r', '--repeat-count [NUM]', "Repeat count"){|n|
+ opt[:repeat] = n.to_i
+ }
+ o.on('-o', '--output-file [FILE]', "Output file"){|f|
+ opt[:output] = f
+ }
+ 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('-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)
+ BenchmarkDriver.benchmark(opt)
+end
+
diff --git a/benchmark/gc/aobench.rb b/benchmark/gc/aobench.rb
new file mode 100644
index 0000000000..2eed7abc83
--- /dev/null
+++ b/benchmark/gc/aobench.rb
@@ -0,0 +1 @@
+require_relative '../bm_app_aobench.rb'
diff --git a/benchmark/gc/binary_trees.rb b/benchmark/gc/binary_trees.rb
new file mode 100644
index 0000000000..af8ea722aa
--- /dev/null
+++ b/benchmark/gc/binary_trees.rb
@@ -0,0 +1 @@
+require_relative '../bm_so_binary_trees.rb'
diff --git a/benchmark/gc/gcbench.rb b/benchmark/gc/gcbench.rb
new file mode 100644
index 0000000000..09a404466a
--- /dev/null
+++ b/benchmark/gc/gcbench.rb
@@ -0,0 +1,56 @@
+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
new file mode 100644
index 0000000000..cb030d458d
--- /dev/null
+++ b/benchmark/gc/hash1.rb
@@ -0,0 +1,11 @@
+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
new file mode 100644
index 0000000000..e8c943fb21
--- /dev/null
+++ b/benchmark/gc/hash2.rb
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000000..c05a79f561
--- /dev/null
+++ b/benchmark/gc/null.rb
@@ -0,0 +1 @@
+# null
diff --git a/benchmark/gc/pentomino.rb b/benchmark/gc/pentomino.rb
new file mode 100644
index 0000000000..94ba74be89
--- /dev/null
+++ b/benchmark/gc/pentomino.rb
@@ -0,0 +1 @@
+require_relative '../bm_app_pentomino.rb'
diff --git a/benchmark/gc/rdoc.rb b/benchmark/gc/rdoc.rb
new file mode 100644
index 0000000000..14c89f5611
--- /dev/null
+++ b/benchmark/gc/rdoc.rb
@@ -0,0 +1,13 @@
+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
new file mode 100644
index 0000000000..c66290140a
--- /dev/null
+++ b/benchmark/gc/redblack.rb
@@ -0,0 +1,366 @@
+# 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
new file mode 100644
index 0000000000..be2c7b7250
--- /dev/null
+++ b/benchmark/gc/ring.rb
@@ -0,0 +1,29 @@
+# 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/make_fasta_output.rb b/benchmark/make_fasta_output.rb
new file mode 100644
index 0000000000..b6d787ae27
--- /dev/null
+++ b/benchmark/make_fasta_output.rb
@@ -0,0 +1,19 @@
+# prepare 'fasta.output'
+
+def prepare_fasta_output n
+ filebase = File.join(File.dirname($0), 'fasta.output')
+ script = File.join(File.dirname($0), 'bm_so_fasta.rb')
+ file = "#{filebase}.#{n}"
+
+ unless FileTest.exist?(file)
+ STDERR.puts "preparing #{file}"
+
+ open(file, 'w'){|f|
+ ARGV[0] = n
+ $stdout = f
+ load script
+ $stdout = STDOUT
+ }
+ end
+end
+
diff --git a/benchmark/other-lang/ack.pl b/benchmark/other-lang/ack.pl
new file mode 100644
index 0000000000..201e22ddfa
--- /dev/null
+++ b/benchmark/other-lang/ack.pl
@@ -0,0 +1,11 @@
+use integer;
+
+sub Ack {
+ return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1))
+ : Ack($_[0]-1, 1))
+ : $_[1]+1;
+}
+
+my $NUM = 9;
+$NUM = 1 if ($NUM < 1);
+my $ack = Ack(3, $NUM);
diff --git a/benchmark/other-lang/ack.py b/benchmark/other-lang/ack.py
new file mode 100644
index 0000000000..9968e7cfcf
--- /dev/null
+++ b/benchmark/other-lang/ack.py
@@ -0,0 +1,16 @@
+import sys
+sys.setrecursionlimit(5000000)
+
+def Ack(M, N):
+ if (not M):
+ return( N + 1 )
+ if (not N):
+ return( Ack(M-1, 1) )
+ return( Ack(M-1, Ack(M, N-1)) )
+
+def main():
+ NUM = 9
+ sys.setrecursionlimit(10000)
+ Ack(3, NUM)
+
+main()
diff --git a/benchmark/other-lang/ack.rb b/benchmark/other-lang/ack.rb
new file mode 100644
index 0000000000..7451bed6c4
--- /dev/null
+++ b/benchmark/other-lang/ack.rb
@@ -0,0 +1,12 @@
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+NUM = 9
+ack(3, NUM)
diff --git a/benchmark/other-lang/ack.scm b/benchmark/other-lang/ack.scm
new file mode 100644
index 0000000000..a80b73ba55
--- /dev/null
+++ b/benchmark/other-lang/ack.scm
@@ -0,0 +1,7 @@
+(define (ack m n)
+ (cond ((zero? m) (+ n 1))
+ ((zero? n) (ack (- m 1) 1))
+ (else (ack (- m 1) (ack m (- n 1))))))
+
+(ack 3 9)
+
diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb
new file mode 100644
index 0000000000..48a2cea019
--- /dev/null
+++ b/benchmark/other-lang/eval.rb
@@ -0,0 +1,66 @@
+
+Bench = %w(
+ loop
+ ack
+ fib
+ tak
+ fact
+)
+
+Lang = <<EOP.map{|l| l.strip}
+ ruby-cyg
+ ../../../test6/miniruby
+ perl
+ python
+ gosh
+EOP
+
+Bench.replace ['loop2']
+Lang.replace ['ruby-cyg']
+
+Ext = %w(
+ .rb
+ .rb
+ .pl
+ .py
+ .scm
+)
+
+p Bench
+p Lang
+
+require 'benchmark'
+
+def bench cmd
+ m = Benchmark.measure{
+ #p cmd
+ system(cmd)
+ }
+ [m.utime, m.real]
+end
+
+Result = []
+Bench.each{|b|
+ r = []
+ Lang.each_with_index{|l, idx|
+ cmd = "#{l} #{b}#{Ext[idx]}"
+ r << bench(cmd)
+ }
+ Result << r
+}
+
+require 'pp'
+# utime
+puts Lang.join("\t")
+Bench.each_with_index{|b, bi|
+ print b, "\t"
+ puts Result[bi].map{|e| e[0]}.join("\t")
+}
+
+# rtime
+puts Lang.join("\t")
+Bench.each_with_index{|b, bi|
+ print b, "\t"
+ puts Result[bi].map{|e| e[1]}.join("\t")
+}
+
diff --git a/benchmark/other-lang/fact.pl b/benchmark/other-lang/fact.pl
new file mode 100644
index 0000000000..a9b0b69cdf
--- /dev/null
+++ b/benchmark/other-lang/fact.pl
@@ -0,0 +1,13 @@
+sub fact{
+ my $n = @_[0];
+ if($n < 2){
+ return 1;
+ }
+ else{
+ return $n * fact($n-1);
+ }
+}
+
+for($i=0; $i<10000; $i++){
+ &fact(100);
+}
diff --git a/benchmark/other-lang/fact.py b/benchmark/other-lang/fact.py
new file mode 100644
index 0000000000..01593965d9
--- /dev/null
+++ b/benchmark/other-lang/fact.py
@@ -0,0 +1,18 @@
+#import sys
+#sys.setrecursionlimit(1000)
+
+def factL(n):
+ r = 1
+ for x in range(2, n):
+ r *= x
+ return r
+
+def factR(n):
+ if n < 2:
+ return 1
+ else:
+ return n * factR(n-1)
+
+for i in range(10000):
+ factR(100)
+
diff --git a/benchmark/other-lang/fact.rb b/benchmark/other-lang/fact.rb
new file mode 100644
index 0000000000..6cedc752cd
--- /dev/null
+++ b/benchmark/other-lang/fact.rb
@@ -0,0 +1,13 @@
+def fact(n)
+ if n < 2
+ 1
+ else
+ n * fact(n-1)
+ end
+end
+
+i = 0
+while i<10000
+ i += 1
+ fact(100)
+end
diff --git a/benchmark/other-lang/fact.scm b/benchmark/other-lang/fact.scm
new file mode 100644
index 0000000000..c98a7fedd3
--- /dev/null
+++ b/benchmark/other-lang/fact.scm
@@ -0,0 +1,8 @@
+(define (fact n)
+ (if (< n 2)
+ 1
+ (* n (fact (- n 1)))))
+
+(dotimes (i 10000)
+ (fact 100))
+
diff --git a/benchmark/other-lang/fib.pl b/benchmark/other-lang/fib.pl
new file mode 100644
index 0000000000..a46f666d1e
--- /dev/null
+++ b/benchmark/other-lang/fib.pl
@@ -0,0 +1,11 @@
+sub fib{
+ my $n = $_[0];
+ if($n < 3){
+ return 1;
+ }
+ else{
+ return fib($n-1) + fib($n-2);
+ }
+};
+
+&fib(34);
diff --git a/benchmark/other-lang/fib.py b/benchmark/other-lang/fib.py
new file mode 100644
index 0000000000..45f2bceb8d
--- /dev/null
+++ b/benchmark/other-lang/fib.py
@@ -0,0 +1,7 @@
+def fib(n):
+ if n < 3:
+ return 1
+ else:
+ return fib(n-1) + fib(n-2)
+
+fib(34)
diff --git a/benchmark/other-lang/fib.rb b/benchmark/other-lang/fib.rb
new file mode 100644
index 0000000000..ec587eabe0
--- /dev/null
+++ b/benchmark/other-lang/fib.rb
@@ -0,0 +1,9 @@
+def fib n
+ if n < 3
+ 1
+ else
+ fib(n-1) + fib(n-2)
+ end
+end
+
+fib(34)
diff --git a/benchmark/other-lang/fib.scm b/benchmark/other-lang/fib.scm
new file mode 100644
index 0000000000..2fc4e225bd
--- /dev/null
+++ b/benchmark/other-lang/fib.scm
@@ -0,0 +1,7 @@
+(define (fib n)
+ (if (< n 3)
+ 1
+ (+ (fib (- n 1)) (fib (- n 2)))))
+
+(fib 34)
+
diff --git a/benchmark/other-lang/loop.pl b/benchmark/other-lang/loop.pl
new file mode 100644
index 0000000000..2777490aaa
--- /dev/null
+++ b/benchmark/other-lang/loop.pl
@@ -0,0 +1,3 @@
+for($i=0; $i<30000000; $i++){
+}
+
diff --git a/benchmark/other-lang/loop.py b/benchmark/other-lang/loop.py
new file mode 100644
index 0000000000..003749bf3a
--- /dev/null
+++ b/benchmark/other-lang/loop.py
@@ -0,0 +1,2 @@
+for i in xrange(30000000):
+ pass
diff --git a/benchmark/other-lang/loop.rb b/benchmark/other-lang/loop.rb
new file mode 100644
index 0000000000..b367b9dbf3
--- /dev/null
+++ b/benchmark/other-lang/loop.rb
@@ -0,0 +1,4 @@
+i = 0
+while i<30000000
+ i += 1
+end
diff --git a/benchmark/other-lang/loop.scm b/benchmark/other-lang/loop.scm
new file mode 100644
index 0000000000..3364f7e679
--- /dev/null
+++ b/benchmark/other-lang/loop.scm
@@ -0,0 +1 @@
+(dotimes (x 30000000))
diff --git a/benchmark/other-lang/loop2.rb b/benchmark/other-lang/loop2.rb
new file mode 100644
index 0000000000..df8fffc1ff
--- /dev/null
+++ b/benchmark/other-lang/loop2.rb
@@ -0,0 +1 @@
+30000000.times{}
diff --git a/benchmark/other-lang/tak.pl b/benchmark/other-lang/tak.pl
new file mode 100644
index 0000000000..7e748a67c6
--- /dev/null
+++ b/benchmark/other-lang/tak.pl
@@ -0,0 +1,11 @@
+sub tak {
+ local($x, $y, $z) = @_;
+ if (!($y < $x)) {
+ return $z;
+ } else {
+ return &tak(&tak($x - 1, $y, $z),
+ &tak($y - 1, $z, $x),
+ &tak($z - 1, $x, $y));
+ }
+}
+&tak(18, 9, 0);
diff --git a/benchmark/other-lang/tak.py b/benchmark/other-lang/tak.py
new file mode 100644
index 0000000000..04f3f6829c
--- /dev/null
+++ b/benchmark/other-lang/tak.py
@@ -0,0 +1,8 @@
+def tak(x, y, z):
+ if not(y<x):
+ return z
+ else:
+ return tak(tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+tak(18, 9, 0)
diff --git a/benchmark/other-lang/tak.rb b/benchmark/other-lang/tak.rb
new file mode 100644
index 0000000000..efe5380f4e
--- /dev/null
+++ b/benchmark/other-lang/tak.rb
@@ -0,0 +1,13 @@
+
+def tak x, y, z
+ unless y < x
+ z
+ else
+ tak( tak(x-1, y, z),
+ tak(y-1, z, x),
+ tak(z-1, x, y))
+ end
+end
+
+tak(18, 9, 0)
+
diff --git a/benchmark/other-lang/tak.scm b/benchmark/other-lang/tak.scm
new file mode 100644
index 0000000000..52a7629ee5
--- /dev/null
+++ b/benchmark/other-lang/tak.scm
@@ -0,0 +1,10 @@
+(define (tak x y z)
+ (if (not (< y x))
+ z
+ (tak (tak (- x 1) y z)
+ (tak (- y 1) z x)
+ (tak (- z 1) x y))))
+
+(tak 18 9 0)
+
+
diff --git a/benchmark/prepare_so_count_words.rb b/benchmark/prepare_so_count_words.rb
new file mode 100644
index 0000000000..ee2138cdb2
--- /dev/null
+++ b/benchmark/prepare_so_count_words.rb
@@ -0,0 +1,15 @@
+# prepare 'wc.input'
+
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
diff --git a/benchmark/prepare_so_k_nucleotide.rb b/benchmark/prepare_so_k_nucleotide.rb
new file mode 100644
index 0000000000..d83aeb7a7e
--- /dev/null
+++ b/benchmark/prepare_so_k_nucleotide.rb
@@ -0,0 +1,2 @@
+require_relative 'make_fasta_output'
+prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
new file mode 100644
index 0000000000..da3ec2df14
--- /dev/null
+++ b/benchmark/prepare_so_reverse_complement.rb
@@ -0,0 +1,2 @@
+require_relative 'make_fasta_output'
+prepare_fasta_output(2_500_000)
diff --git a/benchmark/report.rb b/benchmark/report.rb
new file mode 100644
index 0000000000..d2dc56b1e1
--- /dev/null
+++ b/benchmark/report.rb
@@ -0,0 +1,79 @@
+#
+# YARV benchmark driver
+#
+
+require 'yarvutil'
+require 'benchmark'
+require 'rbconfig'
+
+def exec_command type, file, w
+ <<-EOP
+ $DRIVER_PATH = '#{File.dirname($0)}'
+ $LOAD_PATH.replace $LOAD_PATH | #{$LOAD_PATH.inspect}
+ require 'benchmark'
+ require 'yarvutil'
+# print '#{type}'
+ begin
+ puts Benchmark.measure{
+ #{w}('#{file}')
+ }.utime
+ rescue Exception => exec_command_error_variable
+ puts "\t" + exec_command_error_variable.message
+ end
+ EOP
+end
+
+def benchmark cmd
+ rubybin = ENV['RUBY'] || RbConfig.ruby
+
+ IO.popen(rubybin, 'r+'){|io|
+ io.write cmd
+ io.close_write
+ return io.gets
+ }
+end
+
+def ruby_exec file
+ prog = exec_command 'ruby', file, 'load'
+ benchmark prog
+end
+
+def yarv_exec file
+ prog = exec_command 'yarv', file, 'YARVUtil.load_bm'
+ benchmark prog
+end
+
+$wr = $wy = nil
+
+def measure bench
+ file = File.dirname($0) + "/bm_#{bench}.rb"
+ r = ruby_exec(file).to_f
+ y = yarv_exec(file).to_f
+ puts "#{bench}\t#{r}\t#{y}"
+end
+
+def measure2
+ r = ruby_exec.to_f
+ y = yarv_exec.to_f
+ puts r/y
+end
+
+if $0 == __FILE__
+ %w{
+ whileloop
+ whileloop2
+ times
+ const
+ method
+ poly_method
+ block
+ rescue
+ rescue2
+ }.each{|bench|
+ measure bench
+ }
+end
+
+
+
+
diff --git a/benchmark/run.rb b/benchmark/run.rb
new file mode 100644
index 0000000000..0cd2363849
--- /dev/null
+++ b/benchmark/run.rb
@@ -0,0 +1,127 @@
+#
+# Ruby benchmark driver
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$matzrubyonly = false
+$rubyonly = false
+
+$results = []
+
+# prepare 'wc.input'
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
+
+def bm file
+ prog = File.readlines(file).map{|e| e.rstrip}.join("\n")
+ return if prog.empty?
+
+ /[a-z]+_(.+)\.rb/ =~ file
+ bm_name = $1
+ puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly
+ puts "#{bm_name}: "
+
+
+puts <<EOS unless $matzrubyonly || $rubyonly
+#{prog}
+--
+EOS
+ begin
+ result = [bm_name]
+ result << matzruby_exec(file) unless $rubyonly
+ result << ruby_exec(file) unless $matzrubyonly
+ $results << result
+
+ rescue Exception => e
+ puts
+ puts "** benchmark failure: #{e}"
+ puts e.backtrace
+ end
+end
+
+def benchmark file, bin
+ m = Benchmark.measure{
+ `#{bin} #{$opts} #{file}`
+ }
+ sec = '%.3f' % m.real
+ puts " #{sec}"
+ sec
+end
+
+def ruby_exec file
+ print 'ruby'
+ benchmark file, $ruby_program
+end
+
+def matzruby_exec file
+ print 'matz'
+ rubylib = ENV['RUBYLIB']
+ ENV['RUBYLIB'] = ''
+ r = benchmark file, $matzruby_program
+ ENV['RUBYLIB'] = rubylib
+ r
+end
+
+if $0 == __FILE__
+ ARGV.each{|arg|
+ case arg
+ when /\A--ruby=(.+)/
+ $ruby_program = $1
+ when /\A--matzruby=(.+)/
+ $matzruby_program = $1
+ when /\A--opts=(.+)/
+ $opts = $1
+ when /\A(-r|--only-ruby)\z/
+ $rubyonly = true
+ when /\A(-m|--only-matzruby)\z/
+ $matzrubyonly = true
+ end
+ }
+ ARGV.delete_if{|arg|
+ /\A-/ =~ arg
+ }
+
+ puts "MatzRuby:"
+ system("#{$matzruby_program} -v")
+ puts "Ruby:"
+ system("#{$ruby_program} -v")
+ puts
+
+ if ARGV.empty?
+ Dir.glob(File.dirname(__FILE__) + '/bm_*.rb').sort.each{|file|
+ bm file
+ }
+ else
+ ARGV.each{|file|
+ Dir.glob(File.join(File.dirname(__FILE__), file + '*')){|ef|
+ # file = "#{File.dirname(__FILE__)}/#{file}.rb"
+ bm ef
+ }
+ }
+ end
+
+ puts
+ puts "-- benchmark summary ---------------------------"
+ $results.each{|res|
+ print res.shift, "\t"
+ (res||[]).each{|result|
+ /([\d\.]+)/ =~ result
+ print $1 + "\t" if $1
+ }
+ puts
+ }
+end
+
diff --git a/benchmark/runc.rb b/benchmark/runc.rb
new file mode 100644
index 0000000000..97c5cef045
--- /dev/null
+++ b/benchmark/runc.rb
@@ -0,0 +1,27 @@
+#
+#
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$rubybin = ENV['RUBY'] || RbConfig.ruby
+
+def runfile file
+ puts file
+ file = File.join(File.dirname($0), 'contrib', file)
+ Benchmark.bm{|x|
+ x.report('ruby'){
+ system("#{$rubybin} #{file}")
+ }
+ x.report('yarv'){
+ system("#{$rubybin} -rite -I.. #{file}")
+ }
+ }
+end
+
+ARGV.each{|file|
+ runfile file
+}
+
+
diff --git a/benchmark/wc.input.base b/benchmark/wc.input.base
new file mode 100644
index 0000000000..41143fbac0
--- /dev/null
+++ b/benchmark/wc.input.base
@@ -0,0 +1,25 @@
+Subject: Re: Who was Izchak Miller?
+From: "Jane D. Anonymous" <nobody@yale.edu>
+Date: 1996/04/28
+Message-Id: <4lv7bc$oh@news.ycc.yale.edu>
+References: <317C405E.5DFA@panix.com> <4lk6vl$gde@ns.oar.net>
+To: 75176.2330@compuserve.com
+Content-Type: text/plain; charset=us-ascii
+Organization: Yale University
+X-Url: news:4lk6vl$gde@ns.oar.net
+Mime-Version: 1.0
+Newsgroups: rec.games.roguelike.nethack
+X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
+
+Hello there, Izchak Miller was my father. When I was younger I spent
+many a night, hunched over the keyboard with a cup of tea, playing
+nethack with him and my brother. my dad was a philosopher with a strong
+weakness for fantasy/sci fi. I remember when he started to get involved
+with the Nethack team- my brother's Dungeons and Dragons monster book
+found a regular place beside my dad's desk. it's nice to see him living
+on in the game he loved so much :-).
+ Tamar Miller
+
+The following is a really long word of 5000 characters:
+
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
diff --git a/bignum.c b/bignum.c
index 7f14aee709..fbf2778f9b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3,385 +3,3966 @@
bignum.c -
$Author$
- $Date$
created at: Fri Jun 10 00:48:55 JST 1994
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
+#include "internal.h"
+#include "ruby/thread.h"
+#include "ruby/util.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <math.h>
#include <float.h>
#include <ctype.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#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
-#if defined __MINGW32__
-#define USHORT _USHORT
+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);
#endif
-#define BDIGITS(x) ((BDIGIT*)RBIGNUM(x)->digits)
-#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
+#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 BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG)
-#define DIGSPERLONG ((unsigned int)(SIZEOF_LONG/SIZEOF_BDIGITS))
-#if HAVE_LONG_LONG
-# define DIGSPERLL ((unsigned int)(SIZEOF_LONG_LONG/SIZEOF_BDIGITS))
+#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)
#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) (RBIGNUM(x)->len == 0 || \
+#define BIGZEROP(x) (BIGNUM_LEN(x) == 0 || \
(BDIGITS(x)[0] == 0 && \
- (RBIGNUM(x)->len == 1 || bigzero_p(x))))
+ (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 roomof(n, m) ((long)(((n)+(m)-1) / (m)))
+#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 scirpt, 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 bigzero_p(VALUE);
static int
-bigzero_p(x)
- VALUE x;
+bary_cmp(const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
- long i;
- for (i = 0; i < RBIGNUM(x)->len; ++i) {
- if (BDIGITS(x)[i]) return 0;
+ 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 VALUE
-bignew_1(klass, len, sign)
- VALUE klass;
- long len;
+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)
{
- NEWOBJ(big, struct RBignum);
- OBJSETUP(big, klass, T_BIGNUM);
- big->sign = sign?1:0;
- big->len = len;
- big->digits = ALLOC_N(BDIGIT, len);
+ 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);
+ }
+}
+
+
+#define BIGNUM_DEBUG 0
+#if BIGNUM_DEBUG
+#define ON_DEBUG(x) do { x; } while (0)
+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(", len=%"PRIuSIZE, BIGNUM_LEN(x));
+ puts("");
+}
+
+static VALUE
+rb_big_dump(VALUE x)
+{
+ dump_bignum(x);
+ return x;
+}
+#else
+#define ON_DEBUG(x)
+#endif
+
+static int
+bigzero_p(VALUE x)
+{
+ return bary_zero_p(BDIGITS(x), BIGNUM_LEN(x));
+}
+
+int
+rb_bigzero_p(VALUE x)
+{
+ return BIGZEROP(x);
+}
+
+int
+rb_cmpint(VALUE val, VALUE a, VALUE b)
+{
+ if (NIL_P(val)) {
+ rb_cmperr(a, b);
+ }
+ if (FIXNUM_P(val)) {
+ long l = FIX2LONG(val);
+ if (l > 0) return 1;
+ if (l < 0) return -1;
+ return 0;
+ }
+ if (RB_BIGNUM_TYPE_P(val)) {
+ if (BIGZEROP(val)) return 0;
+ if (BIGNUM_SIGN(val)) return 1;
+ return -1;
+ }
+ if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
+ if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
+ return 0;
+}
+
+#define BIGNUM_SET_LEN(b,l) \
+ ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
+ (void)(RBASIC(b)->flags = \
+ (RBASIC(b)->flags & ~BIGNUM_EMBED_LEN_MASK) | \
+ ((l) << BIGNUM_EMBED_LEN_SHIFT)) : \
+ (void)(RBIGNUM(b)->as.heap.len = (l)))
+
+static void
+rb_big_realloc(VALUE big, size_t len)
+{
+ BDIGIT *ds;
+ if (RBASIC(big)->flags & BIGNUM_EMBED_FLAG) {
+ if (BIGNUM_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);
+ RBIGNUM(big)->as.heap.digits = ds;
+ RBASIC(big)->flags &= ~BIGNUM_EMBED_FLAG;
+ }
+ }
+ else {
+ if (len <= BIGNUM_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));
+ if (ds) {
+ MEMCPY(RBIGNUM(big)->as.ary, ds, BDIGIT, len);
+ xfree(ds);
+ }
+ }
+ else {
+ if (BIGNUM_LEN(big) == 0) {
+ RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
+ }
+ else {
+ REALLOC_N(RBIGNUM(big)->as.heap.digits, BDIGIT, len);
+ }
+ }
+ }
+}
+
+void
+rb_big_resize(VALUE big, size_t len)
+{
+ rb_big_realloc(big, len);
+ BIGNUM_SET_LEN(big, len);
+}
+
+static VALUE
+bignew_1(VALUE klass, size_t 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));
+ }
+ else {
+ RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
+ RBIGNUM(big)->as.heap.len = len;
+ }
+ OBJ_FREEZE(big);
return (VALUE)big;
}
-#define bignew(len,sign) bignew_1(rb_cBignum,len,sign)
+VALUE
+rb_big_new(size_t len, int sign)
+{
+ return bignew(len, sign != 0);
+}
VALUE
-rb_big_clone(x)
- VALUE x;
+rb_big_clone(VALUE x)
{
- VALUE z = bignew_1(CLASS_OF(x), RBIGNUM(x)->len, RBIGNUM(x)->sign);
+ size_t len = BIGNUM_LEN(x);
+ VALUE z = bignew_1(CLASS_OF(x), len, BIGNUM_SIGN(x));
- MEMCPY(BDIGITS(z), BDIGITS(x), BDIGIT, RBIGNUM(x)->len);
+ 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(x)
- VALUE x;
+get2comp(VALUE x)
{
- long i = RBIGNUM(x)->len;
+ long i = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
- BDIGIT_DBL num;
- 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(x)->len);
- if (num != 0) {
- REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len);
- ds = BDIGITS(x);
- ds[RBIGNUM(x)->len-1] = RBIGNUM(x)->sign ? ~0 : 1;
+ if (bary_2comp(ds, i)) {
+ big_extend_carry(x);
}
}
void
-rb_big_2comp(x) /* get 2's complement */
- VALUE x;
+rb_big_2comp(VALUE x) /* get 2's complement */
{
get2comp(x);
}
-static VALUE
-bigtrunc(x)
- VALUE 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)
{
- long len = RBIGNUM(x)->len;
+ size_t len = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
if (len == 0) return x;
while (--len && !ds[len]);
- RBIGNUM(x)->len = ++len;
+ if (BIGNUM_LEN(x) > len+1) {
+ rb_big_resize(x, len+1);
+ }
return x;
}
-static VALUE
-bigfixize(x)
- VALUE x;
+static inline VALUE
+bigfixize(VALUE x)
{
- long len = RBIGNUM(x)->len;
+ size_t n = BIGNUM_LEN(x);
BDIGIT *ds = BDIGITS(x);
+#if SIZEOF_BDIGIT < SIZEOF_LONG
+ unsigned long u;
+#else
+ BDIGIT u;
+#endif
- if (len*SIZEOF_BDIGITS <= sizeof(VALUE)) {
- long num = 0;
- while (len--) {
- num = BIGUP(num) + ds[len];
- }
- if (num >= 0) {
- if (RBIGNUM(x)->sign) {
- if (POSFIXABLE(num)) return LONG2FIX(num);
- }
- else {
- if (NEGFIXABLE(-(long)num)) return LONG2FIX(-(long)num);
- }
- }
+ 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];
+#endif
+
+ if (BIGNUM_POSITIVE_P(x)) {
+ if (POSFIXABLE(u)) return LONG2FIX((long)u);
+ }
+ else {
+ if (u <= -FIXNUM_MIN) return LONG2FIX(-(long)u);
}
+
+ return_big:
+ rb_big_resize(x, n);
return x;
}
static VALUE
-bignorm(x)
- VALUE x;
+bignorm(VALUE x)
{
- if (!FIXNUM_P(x) && TYPE(x) == T_BIGNUM) {
- x = bigfixize(bigtrunc(x));
+ if (RB_BIGNUM_TYPE_P(x)) {
+ x = bigfixize(x);
}
return x;
}
VALUE
-rb_big_norm(x)
- VALUE x;
+rb_big_norm(VALUE x)
{
return bignorm(x);
}
VALUE
-rb_uint2big(n)
- unsigned long n;
+rb_uint2big(VALUE n)
{
- BDIGIT_DBL num = n;
- long i = 0;
- BDIGIT *digits;
- VALUE big;
+ long i;
+ VALUE big = bignew(bdigit_roomof(SIZEOF_VALUE), 1);
+ BDIGIT *digits = BDIGITS(big);
- big = bignew(DIGSPERLONG, 1);
- digits = BDIGITS(big);
- while (i < DIGSPERLONG) {
- digits[i++] = BIGLO(num);
- num = BIGDN(num);
+#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);
}
+#endif
- i = DIGSPERLONG;
+ i = bdigit_roomof(SIZEOF_VALUE);
while (--i && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+ BIGNUM_SET_LEN(big, i+1);
return big;
}
VALUE
-rb_int2big(n)
- long n;
+rb_int2big(SIGNED_VALUE n)
{
long neg = 0;
+ VALUE u;
VALUE big;
if (n < 0) {
- n = -n;
+ u = 1 + (VALUE)(-(n + 1)); /* u = -n avoiding overflow */
neg = 1;
}
- big = rb_uint2big(n);
+ else {
+ u = n;
+ }
+ big = rb_uint2big(u);
if (neg) {
- RBIGNUM(big)->sign = 0;
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
VALUE
-rb_uint2inum(n)
- unsigned long n;
+rb_uint2inum(VALUE n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_uint2big(n);
}
VALUE
-rb_int2inum(n)
- long n;
+rb_int2inum(SIGNED_VALUE n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_int2big(n);
}
-#ifdef HAVE_LONG_LONG
-
void
-rb_quad_pack(buf, val)
- char *buf;
- VALUE val;
+rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
{
- LONG_LONG q;
+ 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);
+}
+
+/*
+ * 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.
+ *
+ */
+size_t
+rb_absint_size(VALUE val, int *nlz_bits_ret)
+{
+ BDIGIT *dp;
+ BDIGIT *de;
+ BDIGIT fixbuf[bdigit_roomof(sizeof(long))];
+
+ int num_leading_zeros;
val = rb_to_int(val);
+
if (FIXNUM_P(val)) {
- q = FIX2LONG(val);
+ long v = FIX2LONG(val);
+ if (v < 0) {
+ v = -v;
+ }
+#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
+ dp = fixbuf;
+ de = fixbuf + numberof(fixbuf);
}
else {
- long len = RBIGNUM(val)->len;
- BDIGIT *ds;
-
- if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
- rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
- ds = BDIGITS(val);
- q = 0;
- while (len--) {
- q = BIGUP(q);
- q += ds[len];
- }
- if (!RBIGNUM(val)->sign) q = -q;
- }
- memcpy(buf, (char*)&q, SIZEOF_LONG_LONG);
+ 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;
}
-VALUE
-rb_quad_unpack(buf, sign)
- const char *buf;
- int sign;
+static size_t
+absint_numwords_small(size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret)
{
- unsigned LONG_LONG q;
- long neg = 0;
- long i;
- BDIGIT *digits;
- VALUE big;
+ 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;
+}
- 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;
- }
+static size_t
+absint_numwords_generic(size_t numbytes, int nlz_bits_in_msbyte, size_t word_numbits, size_t *nlz_bits_ret)
+{
+ 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 {
- if (POSFIXABLE(q)) return LONG2FIX(q);
+ 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);
- i = 0;
- big = bignew(DIGSPERLL, 1);
- digits = BDIGITS(big);
- while (i < DIGSPERLL) {
- digits[i++] = BIGLO(q);
- q = BIGDN(q);
+ 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;
+}
- i = DIGSPERLL;
- while (i-- && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+/*
+ * 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 (neg) {
- RBIGNUM(big)->sign = 0;
+ 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);
}
- return bignorm(big);
+ 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;
#else
+ {
+ int i;
+ for (i = 0; i < numberof(fixbuf); i++) {
+ fixbuf[i] = BIGLO(v);
+ v = BIGDN(v);
+ }
+ }
+#endif
+ dp = fixbuf;
+ de = fixbuf + numberof(fixbuf);
+ }
+ 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
-void
-rb_quad_pack(buf, val)
- char *buf;
- VALUE val;
+/*
+ * 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.
+ */
+
+int
+rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
{
- long len;
+ int sign;
+ BDIGIT *ds;
+ size_t num_bdigits;
+ BDIGIT fixbuf[bdigit_roomof(sizeof(long))];
+
+ RB_GC_GUARD(val) = rb_to_int(val);
- memset(buf, 0, QUAD_SIZE);
- val = rb_to_int(val);
if (FIXNUM_P(val)) {
- val = rb_int2big(FIX2LONG(val));
- }
- len = RBIGNUM(val)->len * SIZEOF_BDIGITS;
- if (len > QUAD_SIZE) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
- }
- memcpy(buf, (char*)BDIGITS(val), len);
- if (!RBIGNUM(val)->sign) {
- len = QUAD_SIZE;
- while (len--) {
- *buf = ~*buf;
- buf++;
- }
+ 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);
}
+ else {
+ sign = BIGNUM_POSITIVE_P(val) ? 1 : -1;
+ ds = BDIGITS(val);
+ num_bdigits = BIGNUM_LEN(val);
+ }
+
+ return bary_pack(sign, ds, num_bdigits, words, numwords, wordsize, nails, flags);
}
-#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
+/*
+ * 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_quad_unpack(buf, sign)
- const char *buf;
+rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags)
+{
+ 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;
+ }
+ else {
+ val = bignew((long)num_bdigits, 0);
+ ds = BDIGITS(val);
+ }
+ 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);
+ }
+
+ if ((flags & INTEGER_PACK_FORCE_BIGNUM) && sign != 0 &&
+ bary_zero_p(BDIGITS(val), BIGNUM_LEN(val)))
+ sign = 0;
+ BIGNUM_SET_SIGN(val, 0 <= sign);
+
+ if (flags & INTEGER_PACK_FORCE_BIGNUM)
+ return bigtrunc(val);
+ return bignorm(val);
+}
+
+#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])
+
+static void
+str2big_scan_digits(const char *s, const char *str, int base, int badcheck, size_t *num_digits_p, size_t *len_p)
{
- VALUE big = bignew(QUAD_SIZE/SIZEOF_BDIGITS, 1);
+ char nondigit = 0;
+ size_t num_digits = 0;
+ const char *digits_start = str;
+ const char *digits_end = str;
+
+ int c;
- memcpy((char*)BDIGITS(big), buf, QUAD_SIZE);
- if (sign && BNEG(buf)) {
- long len = QUAD_SIZE;
- char *tmp = (char*)BDIGITS(big);
+ if (badcheck && *str == '_') goto bad;
- RBIGNUM(big)->sign = 0;
- while (len--) {
- *tmp = ~*tmp;
- tmp++;
+ 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()");
}
}
+ *num_digits_p = num_digits;
+ *len_p = digits_end - digits_start;
+}
+
+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;
+
+ 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;
+ }
+ }
+ if (numbits) {
+ *dp++ = BIGLO(dd);
+ }
+ 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);
+ }
+
+ 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;
+
+ size_t i;
+ const char *p;
+ int c;
+ VALUE z;
+
+ uds = ALLOCV_N(BDIGIT, tmpuv, 2*num_bdigits);
+ vds = uds + num_bdigits;
+
+ powerv = power_cache_get_power(base, power_level, NULL);
+
+ 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;
+ }
+ }
+ 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 bignorm(big);
+ return z;
}
+#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
VALUE
-rb_cstr_to_inum(str, base, badcheck)
- const char *str;
- int base;
- int badcheck;
+rb_cstr_to_inum(const char *str, int base, int badcheck)
{
const char *s = str;
- char *end;
- char sign = 1, nondigit = 0;
+ char sign = 1;
int c;
- BDIGIT_DBL num;
- long len, blen = 1;
- long i;
VALUE z;
- BDIGIT *zds;
-#define conv_digit(c) \
- (!ISASCII(c) ? -1 : \
- isdigit(c) ? ((c) - '0') : \
- islower(c) ? ((c) - 'a' + 10) : \
- isupper(c) ? ((c) - 'A' + 10) : \
- -1)
+ int bits_per_digit;
+
+ const char *digits_start, *digits_end;
+ size_t num_digits;
+ size_t num_bdigits;
+ size_t len;
if (!str) {
- if (badcheck) goto bad;
+ if (badcheck) {
+ bad:
+ rb_invalid_str(s, "Integer()");
+ }
return INT2FIX(0);
}
- if (badcheck) {
- while (ISSPACE(*str)) str++;
- }
- else {
- while (ISSPACE(*str) || *str == '_') str++;
- }
+ while (ISSPACE(*str)) str++;
if (str[0] == '+') {
str++;
@@ -399,15 +3980,19 @@ rb_cstr_to_inum(str, base, 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;
@@ -420,56 +4005,39 @@ rb_cstr_to_inum(str, base, badcheck)
base = 10;
}
}
- switch (base) {
- case 2:
- len = 1;
+ else if (base == 2) {
if (str[0] == '0' && (str[1] == 'b'||str[1] == 'B')) {
str += 2;
}
- break;
- case 3:
- len = 2;
- break;
- case 8:
+ }
+ else if (base == 8) {
if (str[0] == '0' && (str[1] == 'o'||str[1] == 'O')) {
str += 2;
}
- case 4: case 5: case 6: case 7:
- len = 3;
- break;
- case 10:
+ }
+ else if (base == 10) {
if (str[0] == '0' && (str[1] == 'd'||str[1] == 'D')) {
str += 2;
}
- case 9: case 11: case 12: case 13: case 14: case 15:
- len = 4;
- break;
- case 16:
- len = 4;
+ }
+ else if (base == 16) {
if (str[0] == '0' && (str[1] == 'x'||str[1] == 'X')) {
str += 2;
}
- break;
- default:
- if (base < 2 || 36 < base) {
- rb_raise(rb_eArgError, "illegal radix %d", base);
- }
- if (base <= 32) {
- len = 5;
- }
- else {
- len = 6;
- }
- break;
}
- if (*str == '0') { /* squeeze preceeding 0s */
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
+ }
+ if (*str == '0') { /* squeeze preceding 0s */
int us = 0;
while ((c = *++str) == '0' || c == '_') {
if (c == '_') {
if (++us >= 2)
break;
- } else
+ }
+ else {
us = 0;
+ }
}
if (!(c = *str) || ISSPACE(c)) --str;
}
@@ -479,12 +4047,13 @@ rb_cstr_to_inum(str, base, badcheck)
if (badcheck) goto bad;
return INT2FIX(0);
}
- len *= strlen(str)*sizeof(char);
- if (len <= (sizeof(VALUE)*CHAR_BIT)) {
- unsigned long val = strtoul((char*)str, &end, base);
+ bits_per_digit = bit_length(base-1);
+ if (bits_per_digit * strlen(str) <= sizeof(long) * CHAR_BIT) {
+ char *end;
+ unsigned long val = STRTOUL(str, &end, base);
- if (*end == '_') goto bigparse;
+ if (str < end && *end == '_') goto bigparse;
if (badcheck) {
if (end == str) goto bad; /* no number */
while (*end && ISSPACE(*end)) end++;
@@ -500,141 +4069,282 @@ rb_cstr_to_inum(str, base, badcheck)
}
else {
VALUE big = rb_uint2big(val);
- RBIGNUM(big)->sign = sign;
+ BIGNUM_SET_SIGN(big, sign);
return bignorm(big);
}
}
+
bigparse:
- len = (len/BITSPERDIG)+1;
- if (badcheck && *str == '_') goto bad;
+ digits_start = str;
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
+ digits_end = digits_start + len;
- 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 = 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;
- }
+ if (POW2_P(base)) {
+ z = str2big_poweroftwo(sign, digits_start, digits_end, num_digits,
+ bits_per_digit);
}
- if (badcheck) {
- str--;
- if (s+1 < str && str[-1] == '_') goto bad;
- while (*str && ISSPACE(*str)) str++;
- if (*str) {
- bad:
- rb_invalid_str(s, "Integer");
- }
+ 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);
+ }
}
return bignorm(z);
}
VALUE
-rb_str_to_inum(str, base, badcheck)
- VALUE str;
- int base;
- int badcheck;
+rb_str_to_inum(VALUE str, int base, int badcheck)
{
char *s;
long len;
+ VALUE v = 0;
+ VALUE ret;
StringValue(str);
+ rb_must_asciicompat(str);
if (badcheck) {
s = StringValueCStr(str);
}
else {
- s = RSTRING(str)->ptr;
+ s = RSTRING_PTR(str);
}
if (s) {
- len = RSTRING(str)->len;
+ len = RSTRING_LEN(str);
if (s[len]) { /* no sentinel somehow */
- char *p = ALLOCA_N(char, len+1);
+ char *p = ALLOCV(v, len+1);
MEMCPY(p, s, char, len);
p[len] = '\0';
s = p;
}
}
- return rb_cstr_to_inum(s, base, badcheck);
+ ret = rb_cstr_to_inum(s, base, badcheck);
+ if (v)
+ ALLOCV_END(v);
+ return ret;
}
-#if HAVE_LONG_LONG
+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_ull2big(n)
- unsigned LONG_LONG n;
+rb_str2big_normal(VALUE arg, int base, int badcheck)
{
- BDIGIT_DBL num = n;
- long i = 0;
- BDIGIT *digits;
- VALUE big;
+ int positive_p = 1;
+ const char *s, *str;
+ const char *digits_start, *digits_end;
+ size_t num_digits;
+ size_t len;
+ VALUE z;
- big = bignew(DIGSPERLL, 1);
- digits = BDIGITS(big);
- while (i < DIGSPERLL) {
- digits[i++] = BIGLO(num);
- num = BIGDN(num);
+ 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;
}
- i = DIGSPERLL;
+ 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);
+
+#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);
+ }
+#endif
+
+ i = bdigit_roomof(SIZEOF_LONG_LONG);
while (i-- && !digits[i]) ;
- RBIGNUM(big)->len = i+1;
+ BIGNUM_SET_LEN(big, i+1);
return big;
}
-VALUE
-rb_ll2big(n)
- LONG_LONG n;
+static VALUE
+rb_ll2big(LONG_LONG n)
{
long neg = 0;
+ unsigned LONG_LONG u;
VALUE big;
if (n < 0) {
- n = -n;
+ u = 1 + (unsigned LONG_LONG)(-(n + 1)); /* u = -n avoiding overflow */
neg = 1;
}
- big = rb_ull2big(n);
+ else {
+ u = n;
+ }
+ big = rb_ull2big(u);
if (neg) {
- RBIGNUM(big)->sign = 0;
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
VALUE
-rb_ull2inum(n)
- unsigned LONG_LONG n;
+rb_ull2inum(unsigned LONG_LONG n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_ull2big(n);
}
VALUE
-rb_ll2inum(n)
- LONG_LONG n;
+rb_ll2inum(LONG_LONG n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_ll2big(n);
@@ -643,128 +4353,565 @@ rb_ll2inum(n)
#endif /* HAVE_LONG_LONG */
VALUE
-rb_cstr2inum(str, base)
- const char *str;
- int base;
+rb_cstr2inum(const char *str, int base)
{
return rb_cstr_to_inum(str, base, base==0);
}
VALUE
-rb_str2inum(str, base)
- VALUE str;
- int base;
+rb_str2inum(VALUE str, int base)
{
return rb_str_to_inum(str, base, base==0);
}
-const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-VALUE
-rb_big2str0(x, base, trim)
- VALUE x;
- int base;
- int trim;
+static VALUE
+big_shift3(VALUE x, int lshift_p, size_t shift_numdigits, int shift_numbits)
{
- volatile VALUE t;
- BDIGIT *ds;
- long i, j, hbase;
- VALUE ss;
- char *s;
+ BDIGIT *xds, *zds;
+ long s1;
+ int s2;
+ VALUE z;
+ long xn;
+
+ 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;
+}
- if (FIXNUM_P(x)) {
- return rb_fix2str(x, base);
+static VALUE
+big_shift2(VALUE x, int lshift_p, VALUE y)
+{
+ int sign;
+ size_t lens[2];
+ size_t shift_numdigits;
+ int shift_numbits;
+
+ assert(POW2_P(CHAR_BIT));
+ assert(POW2_P(BITSPERDIG));
+
+ 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;
}
- i = RBIGNUM(x)->len;
- if (BIGZEROP(x)) {
- return rb_str_new2("0");
- }
- if (i >= LONG_MAX/SIZEOF_BDIGITS/CHAR_BIT) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
- }
- j = SIZEOF_BDIGITS*CHAR_BIT*i;
- switch (base) {
- case 2: break;
- case 3:
- j = j * 53L / 84 + 1;
- break;
- case 4: case 5: case 6: case 7:
- j = (j + 1) / 2;
- break;
- case 8: case 9:
- j = (j + 2) / 3;
- break;
- case 10: case 11: case 12: case 13: case 14: case 15:
- j = j * 28L / 93 + 1;
- break;
- case 16: case 17: case 18: case 19: case 20: case 21:
- case 22: case 23: case 24: case 25: case 26: case 27:
- case 28: case 29: case 30: case 31:
- j = (j + 3) / 4;
- break;
- case 32: case 33: case 34: case 35: case 36:
- j = (j + 4) / 5;
- break;
- default:
- rb_raise(rb_eArgError, "illegal radix %d", base);
- break;
- }
- j++; /* space for sign */
-
- hbase = base * base;
-#if SIZEOF_BDIGITS > 2
- hbase *= hbase;
-#endif
-
- t = rb_big_clone(x);
- ds = BDIGITS(t);
- ss = rb_str_new(0, j+1);
- s = RSTRING(ss)->ptr;
-
- s[0] = RBIGNUM(x)->sign ? '+' : '-';
- TRAP_BEG;
- while (i && j > 1) {
- long k = i;
- BDIGIT_DBL num = 0;
-
- while (k--) {
- num = BIGUP(num) + ds[k];
- ds[k] = (BDIGIT)(num / hbase);
- num %= hbase;
+ 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 VALUE
+big_lshift(VALUE x, unsigned long shift)
+{
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ return big_shift3(x, 1, s1, s2);
+}
+
+static VALUE
+big_rshift(VALUE x, unsigned long shift)
+{
+ long s1 = shift/BITSPERDIG;
+ int s2 = (int)(shift%BITSPERDIG);
+ return big_shift3(x, 0, s1, s2);
+}
+
+#define MAX_BASE36_POWER_TABLE_ENTRIES (SIZEOF_SIZE_T * CHAR_BIT + 1)
+
+static VALUE base36_power_cache[35][MAX_BASE36_POWER_TABLE_ENTRIES];
+static size_t base36_numdigits_cache[35][MAX_BASE36_POWER_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;
}
- if (trim && ds[i-1] == 0) i--;
- k = SIZEOF_BDIGITS;
- while (k--) {
- s[--j] = ruby_digitmap[num % base];
- num /= base;
- if (!trim && j <= 1) break;
- if (trim && i == 0 && num == 0) break;
+ }
+}
+
+static inline VALUE
+power_cache_get_power(int base, int power_level, size_t *numdigits_ret)
+{
+ /*
+ * 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 (numdigits_ret)
+ *numdigits_ret = base36_numdigits_cache[base - 2][power_level];
+ return base36_power_cache[base - 2][power_level];
+}
+
+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)
+{
+ VALUE b;
+ size_t half_numdigits, lower_numdigits;
+ int lower_power_level;
+ size_t bn;
+ const BDIGIT *bds;
+ size_t len;
+
+ /*
+ * 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 (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;
+ }
+
+ if (power_level == 0) {
+ big2str_2bdigits(b2s, xds, xn, taillen);
+ return;
+ }
+
+ 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;
+
+ 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 (trim) {while (s[j] == '0') j++;}
- i = RSTRING(ss)->len - j;
- if (RBIGNUM(x)->sign) {
- memmove(s, s+j, i);
- RSTRING(ss)->len = i-1;
+
+ 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);
}
else {
- memmove(s+1, s+j, i);
- RSTRING(ss)->len = i;
+ 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);
}
- s[RSTRING(ss)->len] = '\0';
- TRAP_END;
+}
- return ss;
+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 (LONG_MAX < numwords)
+ rb_raise(rb_eArgError, "too big number");
+ result = rb_usascii_str_new(0, numwords);
+ ptr = RSTRING_PTR(result);
+ }
+ 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);
+}
+
+static VALUE
+big2str_generic(VALUE x, int base)
+{
+ 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++;
+ }
+
+ b2s_data.negative = BIGNUM_NEGATIVE_P(x);
+ b2s_data.base = base;
+ b2s_data.hbase2 = maxpow_in_bdigit_dbl(base, &b2s_data.hbase2_numdigits);
+
+ b2s_data.result = Qnil;
+ b2s_data.ptr = NULL;
+
+ if (power_level == 0) {
+ big2str_2bdigits(&b2s_data, xds, xn, 0);
+ }
+ 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);
+ }
+ 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;
+}
+
+VALUE
+rb_big2str_generic(VALUE x, int base)
+{
+ return big2str_generic(x, base);
+}
+
+#ifdef USE_GMP
+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);
+
+ 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);
+ }
+ 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);
+ }
+
+ RB_GC_GUARD(x);
+ return str;
+}
+
+VALUE
+rb_big2str_gmp(VALUE x, int base)
+{
+ return big2str_gmp(x, base);
+}
+#endif
+
+static VALUE
+rb_big2str1(VALUE x, int base)
+{
+ BDIGIT *xds;
+ size_t xn;
+
+ 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) {
+ 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'");
+ }
+
+ if (POW2_P(base)) {
+ /* base == 2 || base == 4 || base == 8 || base == 16 || base == 32 */
+ return big2str_base_poweroftwo(x, base);
+ }
+
+#ifdef USE_GMP
+ if (GMP_BIG2STR_DIGITS < xn) {
+ return big2str_gmp(x, base);
+ }
+#endif
+
+ return big2str_generic(x, base);
}
VALUE
rb_big2str(VALUE x, int base)
{
- return rb_big2str0(x, base, Qtrue);
+ return rb_big2str1(x, base);
}
/*
* call-seq:
- * big.to_s(base=10) => string
+ * big.to_s(base=10) -> string
*
* Returns a string containing the representation of <i>big</i> radix
* <i>base</i> (2 through 36).
@@ -777,130 +4924,144 @@ rb_big2str(VALUE x, int base)
*/
static VALUE
-rb_big_to_s(argc, argv, x)
- int argc;
- VALUE *argv;
- VALUE x;
+rb_big_to_s(int argc, VALUE *argv, VALUE x)
{
- VALUE b;
int base;
- rb_scan_args(argc, argv, "01", &b);
if (argc == 0) base = 10;
- else base = NUM2INT(b);
+ else {
+ VALUE b;
+
+ rb_scan_args(argc, argv, "01", &b);
+ base = NUM2INT(b);
+ }
return rb_big2str(x, base);
}
static unsigned long
-big2ulong(x, type)
- VALUE x;
- char *type;
+big2ulong(VALUE x, const char *type)
{
- long len = RBIGNUM(x)->len;
- BDIGIT_DBL num;
+ size_t len = BIGNUM_LEN(x);
+ unsigned long num;
BDIGIT *ds;
- if (len > SIZEOF_LONG/SIZEOF_BDIGITS)
- rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ if (len == 0)
+ return 0;
+ if (BIGSIZE(x) > sizeof(long)) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
+ }
ds = BDIGITS(x);
+#if SIZEOF_LONG <= SIZEOF_BDIGIT
+ num = (unsigned long)ds[0];
+#else
num = 0;
while (len--) {
- num = BIGUP(num);
- num += ds[len];
- }
- return num;
-}
-
-unsigned long
-rb_big2ulong_pack(x)
- VALUE x;
-{
- unsigned long num = big2ulong(x, "unsigned long");
- if (!RBIGNUM(x)->sign) {
- return -num;
+ num <<= BITSPERDIG;
+ num += (unsigned long)ds[len]; /* overflow is already checked */
}
+#endif
return num;
}
unsigned long
-rb_big2ulong(x)
- VALUE x;
+rb_big2ulong(VALUE x)
{
unsigned long num = big2ulong(x, "unsigned long");
- if (!RBIGNUM(x)->sign) {
- if ((long)num < 0) {
- rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
- }
- return -num;
+ if (BIGNUM_POSITIVE_P(x)) {
+ return num;
}
- return num;
+ else {
+ if (num <= LONG_MAX)
+ return -(long)num;
+ if (num == 1+(unsigned long)(-(LONG_MIN+1)))
+ return LONG_MIN;
+ }
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
}
long
-rb_big2long(x)
- VALUE x;
+rb_big2long(VALUE x)
{
unsigned long num = big2ulong(x, "long");
- if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
+ if (BIGNUM_POSITIVE_P(x)) {
+ if (num <= LONG_MAX)
+ return num;
}
- if (!RBIGNUM(x)->sign) return -(long)num;
- return num;
+ 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 HAVE_LONG_LONG
static unsigned LONG_LONG
-big2ull(x, type)
- VALUE x;
- char *type;
+big2ull(VALUE x, const char *type)
{
- long len = RBIGNUM(x)->len;
- BDIGIT_DBL num;
- BDIGIT *ds;
+ size_t len = BIGNUM_LEN(x);
+ unsigned LONG_LONG num;
+ BDIGIT *ds = BDIGITS(x);
- if (len > SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
+ if (len == 0)
+ return 0;
+ if (BIGSIZE(x) > SIZEOF_LONG_LONG)
rb_raise(rb_eRangeError, "bignum too big to convert into `%s'", type);
- ds = BDIGITS(x);
+#if SIZEOF_LONG_LONG <= SIZEOF_BDIGIT
+ num = (unsigned LONG_LONG)ds[0];
+#else
num = 0;
while (len--) {
num = BIGUP(num);
num += ds[len];
}
+#endif
return num;
}
unsigned LONG_LONG
-rb_big2ull(x)
- VALUE x;
+rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (!RBIGNUM(x)->sign) return -num;
- return num;
+ 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;
+ }
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
}
LONG_LONG
-rb_big2ll(x)
- VALUE x;
+rb_big2ll(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "long long");
- if ((LONG_LONG)num < 0 && (RBIGNUM(x)->sign
- || (LONG_LONG)num != LLONG_MIN)) {
- rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
+ if (BIGNUM_POSITIVE_P(x)) {
+ if (num <= LLONG_MAX)
+ return num;
}
- if (!RBIGNUM(x)->sign) return -(LONG_LONG)num;
- return num;
+ else {
+ if (num <= LLONG_MAX)
+ return -(LONG_LONG)num;
+ if (num == 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
+ return LLONG_MIN;
+ }
+ rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
#endif /* HAVE_LONG_LONG */
static VALUE
-dbl2big(d)
- double d;
+dbl2big(double d)
{
long i = 0;
BDIGIT c;
@@ -915,7 +5076,7 @@ dbl2big(d)
rb_raise(rb_eFloatDomainError, "NaN");
}
- while (!POSFIXABLE(u) || 0 != (long)u) {
+ while (1.0 <= u) {
u /= (double)(BIGRAD);
i++;
}
@@ -932,36 +5093,72 @@ dbl2big(d)
}
VALUE
-rb_dbl2big(d)
- double d;
+rb_dbl2big(double d)
{
return bignorm(dbl2big(d));
}
static double
-big2dbl(x)
- VALUE x;
+big2dbl(VALUE x)
{
double d = 0.0;
- long i = RBIGNUM(x)->len;
- BDIGIT *ds = BDIGITS(x);
+ long i = (bigtrunc(x), BIGNUM_LEN(x)), lo = 0, bits;
+ BDIGIT *ds = BDIGITS(x), dl;
- while (i--) {
- d = ds[i] + BIGRAD*d;
+ if (i) {
+ bits = i * BITSPERDIG - nlz(ds[i-1]);
+ if (bits > DBL_MANT_DIG+DBL_MAX_EXP) {
+ d = HUGE_VAL;
+ }
+ else {
+ if (bits > DBL_MANT_DIG+1)
+ lo = (bits -= DBL_MANT_DIG+1) / BITSPERDIG;
+ else
+ bits = 0;
+ while (--i > lo) {
+ d = ds[i] + BIGRAD*d;
+ }
+ dl = ds[i];
+ if (bits && (dl & ((BDIGIT)1 << (bits %= BITSPERDIG)))) {
+ int carry = (dl & ~(BDIGMAX << bits)) != 0;
+ if (!carry) {
+ while (i-- > 0) {
+ carry = ds[i] != 0;
+ if (carry) break;
+ }
+ }
+ if (carry) {
+ dl &= BDIGMAX << bits;
+ dl = BIGLO(dl + ((BDIGIT)1 << bits));
+ if (!dl) d += 1;
+ }
+ }
+ d = dl + BIGRAD*d;
+ if (lo) {
+ if (lo > INT_MAX / BITSPERDIG)
+ d = HUGE_VAL;
+ else if (lo < INT_MIN / BITSPERDIG)
+ d = 0.0;
+ else
+ d = ldexp(d, (int)(lo * BITSPERDIG));
+ }
+ }
}
- if (!RBIGNUM(x)->sign) d = -d;
+ if (!BIGNUM_SIGN(x)) d = -d;
return d;
}
double
-rb_big2dbl(x)
- VALUE x;
+rb_big2dbl(VALUE x)
{
double d = big2dbl(x);
if (isinf(d)) {
- rb_warn("Bignum out of Float range");
- d = HUGE_VAL;
+ rb_warning("Bignum out of Float range");
+ if (d < 0.0)
+ d = -HUGE_VAL;
+ else
+ d = HUGE_VAL;
}
return d;
}
@@ -976,60 +5173,242 @@ rb_big2dbl(x)
*/
static VALUE
-rb_big_to_f(x)
- VALUE x;
+rb_big_to_f(VALUE x)
+{
+ return DBL2NUM(rb_big2dbl(x));
+}
+
+VALUE
+rb_integer_float_cmp(VALUE x, VALUE y)
+{
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+ VALUE rel;
+
+ if (isnan(yd))
+ return Qnil;
+ if (isinf(yd)) {
+ if (yd > 0.0) return INT2FIX(-1);
+ else return INT2FIX(1);
+ }
+ yf = modf(yd, &yi);
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd < yd)
+ return INT2FIX(-1);
+ if (xd > yd)
+ return INT2FIX(1);
+ return INT2FIX(0);
+#else
+ long xn, yn;
+ if (yi < FIXNUM_MIN)
+ return INT2FIX(1);
+ if (FIXNUM_MAX+1 <= yi)
+ return INT2FIX(-1);
+ xn = FIX2LONG(x);
+ yn = (long)yi;
+ if (xn < yn)
+ return INT2FIX(-1);
+ if (xn > yn)
+ return INT2FIX(1);
+ if (yf < 0.0)
+ return INT2FIX(1);
+ if (0.0 < yf)
+ return INT2FIX(-1);
+ return INT2FIX(0);
+#endif
+ }
+ y = rb_dbl2big(yi);
+ rel = rb_big_cmp(x, y);
+ if (yf == 0.0 || rel != INT2FIX(0))
+ return rel;
+ if (yf < 0.0)
+ return INT2FIX(1);
+ return INT2FIX(-1);
+}
+
+VALUE
+rb_integer_float_eq(VALUE x, VALUE y)
{
- return rb_float_new(rb_big2dbl(x));
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+
+ if (isnan(yd) || isinf(yd))
+ return Qfalse;
+ yf = modf(yd, &yi);
+ if (yf != 0)
+ return Qfalse;
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd != yd)
+ return Qfalse;
+ return Qtrue;
+#else
+ long xn, yn;
+ if (yi < LONG_MIN || LONG_MAX < yi)
+ return Qfalse;
+ xn = FIX2LONG(x);
+ yn = (long)yi;
+ if (xn != yn)
+ return Qfalse;
+ return Qtrue;
+#endif
+ }
+ y = rb_dbl2big(yi);
+ return rb_big_eq(x, y);
}
/*
* call-seq:
- * big <=> numeric => -1, 0, +1
+ * 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.
*
- * 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>.
+ * +nil+ is returned if the two values are incomparable.
*
*/
-static VALUE
-rb_big_cmp(x, y)
- VALUE x, y;
+VALUE
+rb_big_cmp(VALUE x, VALUE y)
{
- long xlen = RBIGNUM(x)->len;
+ int cmp;
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- break;
+ 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)) {
+ return rb_integer_float_cmp(x, y);
+ }
+ else {
+ 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);
+
+ cmp = bary_cmp(BDIGITS(x), BIGNUM_LEN(x), BDIGITS(y), BIGNUM_LEN(y));
+ if (BIGNUM_SIGN(x))
+ return INT2FIX(cmp);
+ else
+ return INT2FIX(-cmp);
+}
+
+enum big_op_t {
+ big_op_gt,
+ big_op_ge,
+ big_op_lt,
+ big_op_le
+};
+
+static VALUE
+big_op(VALUE x, VALUE y, enum big_op_t op)
+{
+ VALUE rel;
+ int n;
- case T_BIGNUM:
- break;
+ if (FIXNUM_P(y) || RB_BIGNUM_TYPE_P(y)) {
+ rel = rb_big_cmp(x, y);
+ }
+ else if (RB_FLOAT_TYPE_P(y)) {
+ 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;
+ }
+ return rb_num_coerce_relop(x, y, id);
+ }
- case T_FLOAT:
- return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value);
+ if (NIL_P(rel)) return Qfalse;
+ n = FIX2INT(rel);
- default:
- return rb_num_coerce_cmp(x, y);
+ switch (op) {
+ case big_op_gt: return n > 0 ? Qtrue : Qfalse;
+ case big_op_ge: return n >= 0 ? Qtrue : Qfalse;
+ case big_op_lt: return n < 0 ? Qtrue : Qfalse;
+ case big_op_le: return n <= 0 ? Qtrue : Qfalse;
}
+ return Qundef;
+}
- if (RBIGNUM(x)->sign > RBIGNUM(y)->sign) return INT2FIX(1);
- if (RBIGNUM(x)->sign < RBIGNUM(y)->sign) return INT2FIX(-1);
- if (xlen < RBIGNUM(y)->len)
- return (RBIGNUM(x)->sign) ? INT2FIX(-1) : INT2FIX(1);
- if (xlen > RBIGNUM(y)->len)
- return (RBIGNUM(x)->sign) ? INT2FIX(1) : INT2FIX(-1);
+/*
+ * call-seq:
+ * big > real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than that of <code>real</code>.
+ */
- while(xlen-- && (BDIGITS(x)[xlen]==BDIGITS(y)[xlen]));
- if (-1 == xlen) return INT2FIX(0);
- return (BDIGITS(x)[xlen] > BDIGITS(y)[xlen]) ?
- (RBIGNUM(x)->sign ? INT2FIX(1) : INT2FIX(-1)) :
- (RBIGNUM(x)->sign ? INT2FIX(-1) : INT2FIX(1));
+static VALUE
+big_gt(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_gt);
+}
+
+/*
+ * call-seq:
+ * big >= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_ge(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_ge);
+}
+
+/*
+ * call-seq:
+ * big < real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than that of <code>real</code>.
+ */
+
+static VALUE
+big_lt(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_lt);
+}
+
+/*
+ * call-seq:
+ * big <= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_le(VALUE x, VALUE y)
+{
+ return big_op(x, y, big_op_le);
}
/*
* call-seq:
- * big == obj => true or false
+ * big == obj -> true or false
*
* Returns <code>true</code> only if <i>obj</i> has the same value
* as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which
@@ -1038,37 +5417,30 @@ rb_big_cmp(x, y)
* 68719476736 == 68719476736.0 #=> true
*/
-static VALUE
-rb_big_eq(x, y)
- VALUE x, y;
+VALUE
+rb_big_eq(VALUE x, VALUE y)
{
- switch (TYPE(y)) {
- case T_FIXNUM:
+ if (FIXNUM_P(y)) {
+ if (bignorm(x) == y) return Qtrue;
y = rb_int2big(FIX2LONG(y));
- break;
- case T_BIGNUM:
- break;
- case T_FLOAT:
- {
- volatile double a, b;
-
- a = RFLOAT(y)->value;
- if (isnan(a)) return Qfalse;
- b = rb_big2dbl(x);
- return (a == b)?Qtrue:Qfalse;
- }
- default:
+ }
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ }
+ else if (RB_FLOAT_TYPE_P(y)) {
+ return rb_integer_float_eq(x, y);
+ }
+ else {
return rb_equal(y, x);
}
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
- if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) 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;
return Qtrue;
}
/*
* call-seq:
- * big.eql?(obj) => true or false
+ * big.eql?(obj) -> true or false
*
* Returns <code>true</code> only if <i>obj</i> is a
* <code>Bignum</code> with the same value as <i>big</i>. Contrast this
@@ -1077,38 +5449,36 @@ rb_big_eq(x, y)
* 68719476736.eql?(68719476736.0) #=> false
*/
-static VALUE
-rb_big_eql(x, y)
- VALUE x, y;
+VALUE
+rb_big_eql(VALUE x, VALUE y)
{
- if (TYPE(y) != T_BIGNUM) return Qfalse;
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
- if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
- if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM(y)->len) != 0) return Qfalse;
+ 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;
return Qtrue;
}
/*
* call-seq:
- * -big => other_big
+ * -big -> integer
*
- * Unary minus (returns a new Bignum whose value is 0-big)
+ * Unary minus (returns an integer whose value is 0-big)
*/
-static VALUE
-rb_big_uminus(x)
- VALUE x;
+VALUE
+rb_big_uminus(VALUE x)
{
VALUE z = rb_big_clone(x);
- RBIGNUM(z)->sign = !RBIGNUM(x)->sign;
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
return bignorm(z);
}
/*
* call-seq:
- * ~big => integer
+ * ~big -> integer
*
* Inverts the bits in big. As Bignums are conceptually infinite
* length, the result acts as if it had an infinite number of one
@@ -1119,401 +5489,551 @@ rb_big_uminus(x)
*/
static VALUE
-rb_big_neg(x)
- VALUE x;
+rb_big_neg(VALUE x)
{
VALUE z = rb_big_clone(x);
- long i;
- BDIGIT *ds;
+ BDIGIT *ds = BDIGITS(z);
+ long n = BIGNUM_LEN(z);
+
+ if (!n) return INT2FIX(-1);
- if (!RBIGNUM(x)->sign) get2comp(z);
- ds = BDIGITS(z);
- i = RBIGNUM(x)->len;
- if (!i) return INT2FIX(~0);
- while (i--) ds[i] = ~ds[i];
- RBIGNUM(z)->sign = !RBIGNUM(z)->sign;
- if (RBIGNUM(x)->sign) get2comp(z);
+ 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);
+ }
return bignorm(z);
}
static VALUE
-bigsub(x, y)
- VALUE x, y;
+bigsub(VALUE x, VALUE y)
{
- VALUE z = 0;
- BDIGIT *zds;
+ VALUE z;
+ BDIGIT *xds, *yds, *zds;
+ long xn, yn, zn;
+
+ xn = BIGNUM_LEN(x);
+ yn = BIGNUM_LEN(y);
+ zn = xn < yn ? yn : xn;
+
+ z = bignew(zn, 1);
+
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
+ zds = BDIGITS(z);
+
+ if (bary_sub(zds, zn, xds, xn, yds, yn)) {
+ bary_2comp(zds, zn);
+ BIGNUM_SET_NEGATIVE_SIGN(z);
+ }
+
+ return z;
+}
+
+static VALUE bigadd_int(VALUE x, long y);
+
+static VALUE
+bigsub_int(VALUE x, long y0)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
BDIGIT_DBL_SIGNED num;
- long i = RBIGNUM(x)->len;
+ long i, y;
+
+ y = y0;
+ xds = BDIGITS(x);
+ xn = BIGNUM_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));
+ zds = BDIGITS(z);
- /* if x is larger than y, swap */
- if (RBIGNUM(x)->len < RBIGNUM(y)->len) {
- z = x; x = y; y = z; /* swap x y */
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
+ assert(xn == zn);
+ num = (BDIGIT_DBL_SIGNED)xds[0] - y;
+ if (xn == 1 && num < 0) {
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
+ zds[0] = (BDIGIT)-num;
+ RB_GC_GUARD(x);
+ return bignorm(z);
+ }
+ 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;
+ num += (BDIGIT_DBL_SIGNED)xds[i] - BIGLO(y);
+ zds[i] = BIGLO(num);
+ num = BIGDN(num);
+ y = BIGDN(y);
}
- else if (RBIGNUM(x)->len == RBIGNUM(y)->len) {
- while (i > 0) {
- i--;
- if (BDIGITS(x)[i] > BDIGITS(y)[i]) {
- break;
- }
- if (BDIGITS(x)[i] < BDIGITS(y)[i]) {
- z = x; x = y; y = z; /* swap x y */
- break;
- }
- }
+ 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;
+ num += xds[i];
+ 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:
+ zds[i] = xds[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));
+ }
+ RB_GC_GUARD(x);
+ return bignorm(z);
+}
+
+static VALUE
+bigadd_int(VALUE x, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long xn, zn;
+ BDIGIT_DBL num;
+ long i;
+
+ xds = BDIGITS(x);
+ xn = BIGNUM_LEN(x);
+
+ if (xn == 0)
+ return LONG2NUM(y);
+
+ zn = xn;
+#if SIZEOF_BDIGIT < SIZEOF_LONG
+ if (zn < bdigit_roomof(SIZEOF_LONG))
+ zn = bdigit_roomof(SIZEOF_LONG);
+#endif
+ zn++;
- z = bignew(RBIGNUM(x)->len, z==0);
+ z = bignew(zn, BIGNUM_SIGN(x));
zds = BDIGITS(z);
- for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) {
- num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i];
+#if SIZEOF_BDIGIT >= 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;
+ num += (BDIGIT_DBL)xds[i] + BIGLO(y);
zds[i] = BIGLO(num);
num = BIGDN(num);
+ y = BIGDN(y);
}
- while (num && i < RBIGNUM(x)->len) {
- num += BDIGITS(x)[i];
- zds[i++] = BIGLO(num);
+ 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);
}
- while (i < RBIGNUM(x)->len) {
- zds[i] = BDIGITS(x)[i];
- i++;
+ goto finish;
+
+#endif
+
+ 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);
+ num = BIGDN(num);
+ }
+ for (; i < zn; i++) {
+ y_is_zero_z:
+ if (num == 0) goto num_is_zero_z;
+ zds[i] = BIGLO(num);
+ num = BIGDN(num);
}
+ goto finish;
- return z;
+ for (;i < xn; i++) {
+ num_is_zero_x:
+ zds[i] = xds[i];
+ }
+ for (; i < zn; i++) {
+ num_is_zero_z:
+ zds[i] = 0;
+ }
+ goto finish;
+
+ finish:
+ RB_GC_GUARD(x);
+ return bignorm(z);
}
static VALUE
-bigadd(x, y, sign)
- VALUE x, y;
- int sign;
+bigadd(VALUE x, VALUE y, int sign)
{
VALUE z;
- BDIGIT_DBL num;
- long i, len;
+ size_t len;
- sign = (sign == RBIGNUM(y)->sign);
- if (RBIGNUM(x)->sign != sign) {
+ sign = (sign == BIGNUM_SIGN(y));
+ if (BIGNUM_SIGN(x) != sign) {
if (sign) return bigsub(y, x);
return bigsub(x, y);
}
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- len = RBIGNUM(x)->len + 1;
- z = x; x = y; y = z;
+ if (BIGNUM_LEN(x) > BIGNUM_LEN(y)) {
+ len = BIGNUM_LEN(x) + 1;
}
else {
- len = RBIGNUM(y)->len + 1;
+ len = BIGNUM_LEN(y) + 1;
}
z = bignew(len, sign);
- len = RBIGNUM(x)->len;
- for (i = 0, num = 0; i < len; i++) {
- num += (BDIGIT_DBL)BDIGITS(x)[i] + BDIGITS(y)[i];
- BDIGITS(z)[i] = BIGLO(num);
- num = BIGDN(num);
- }
- len = RBIGNUM(y)->len;
- while (num && i < len) {
- num += BDIGITS(y)[i];
- BDIGITS(z)[i++] = BIGLO(num);
- num = BIGDN(num);
- }
- while (i < len) {
- BDIGITS(z)[i] = BDIGITS(y)[i];
- i++;
- }
- BDIGITS(z)[i] = (BDIGIT)num;
+ bary_add(BDIGITS(z), BIGNUM_LEN(z),
+ BDIGITS(x), BIGNUM_LEN(x),
+ BDIGITS(y), BIGNUM_LEN(y));
return z;
}
/*
* call-seq:
- * big + other => Numeric
+ * big + other -> Numeric
*
* Adds big and other, returning the result.
*/
VALUE
-rb_big_plus(x, y)
- VALUE x, y;
+rb_big_plus(VALUE x, VALUE y)
{
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- /* fall through */
- case T_BIGNUM:
- return bignorm(bigadd(x, y, 1));
-
- case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) + RFLOAT(y)->value);
+ long n;
- default:
- return rb_num_coerce_bin(x, y);
+ if (FIXNUM_P(y)) {
+ n = FIX2LONG(y);
+ if ((n > 0) != BIGNUM_SIGN(x)) {
+ if (n < 0) {
+ n = -n;
+ }
+ return bigsub_int(x, n);
+ }
+ if (n < 0) {
+ n = -n;
+ }
+ return bigadd_int(x, n);
+ }
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ return bignorm(bigadd(x, y, 1));
+ }
+ else if (RB_FLOAT_TYPE_P(y)) {
+ return DBL2NUM(rb_big2dbl(x) + RFLOAT_VALUE(y));
+ }
+ else {
+ return rb_num_coerce_bin(x, y, '+');
}
}
/*
* call-seq:
- * big - other => Numeric
+ * big - other -> Numeric
*
* Subtracts other from big, returning the result.
*/
VALUE
-rb_big_minus(x, y)
- VALUE x, y;
+rb_big_minus(VALUE x, VALUE y)
{
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- /* fall through */
- case T_BIGNUM:
- return bignorm(bigadd(x, y, 0));
-
- case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) - RFLOAT(y)->value);
+ long n;
- default:
- return rb_num_coerce_bin(x, y);
+ if (FIXNUM_P(y)) {
+ n = FIX2LONG(y);
+ if ((n > 0) != BIGNUM_SIGN(x)) {
+ if (n < 0) {
+ n = -n;
+ }
+ return bigadd_int(x, n);
+ }
+ if (n < 0) {
+ n = -n;
+ }
+ return bigsub_int(x, n);
+ }
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ return bignorm(bigadd(x, y, 0));
+ }
+ else if (RB_FLOAT_TYPE_P(y)) {
+ return DBL2NUM(rb_big2dbl(x) - RFLOAT_VALUE(y));
+ }
+ else {
+ return rb_num_coerce_bin(x, y, '-');
}
}
-VALUE
-rb_big_mul0(x, y)
- VALUE x, y;
+static VALUE
+bigsq(VALUE x)
{
- long i, j;
- BDIGIT_DBL n = 0;
+ long xn, zn;
VALUE z;
- BDIGIT *zds;
+ BDIGIT *xds, *zds;
- if (FIXNUM_P(x)) x = rb_int2big(FIX2LONG(x));
- switch (TYPE(y)) {
- case T_FIXNUM:
- y = rb_int2big(FIX2LONG(y));
- break;
+ xn = BIGNUM_LEN(x);
+ zn = 2 * xn;
- case T_BIGNUM:
- break;
+ z = bignew(zn, 1);
- case T_FLOAT:
- return rb_float_new(rb_big2dbl(x) * RFLOAT(y)->value);
+ xds = BDIGITS(x);
+ zds = BDIGITS(z);
- default:
- return rb_num_coerce_bin(x, y);
- }
+#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
- j = RBIGNUM(x)->len + RBIGNUM(y)->len + 1;
- z = bignew(j, RBIGNUM(x)->sign==RBIGNUM(y)->sign);
+ RB_GC_GUARD(x);
+ return z;
+}
+
+static VALUE
+bigmul0(VALUE x, VALUE y)
+{
+ long xn, yn, zn;
+ VALUE z;
+ BDIGIT *xds, *yds, *zds;
+
+ if (x == y)
+ return bigsq(x);
+
+ xn = BIGNUM_LEN(x);
+ yn = BIGNUM_LEN(y);
+ zn = xn + yn;
+
+ z = bignew(zn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
+
+ xds = BDIGITS(x);
+ yds = BDIGITS(y);
zds = BDIGITS(z);
- while (j--) zds[j] = 0;
- for (i = 0; i < RBIGNUM(x)->len; i++) {
- BDIGIT_DBL dd = BDIGITS(x)[i];
- if (dd == 0) continue;
- n = 0;
- for (j = 0; j < RBIGNUM(y)->len; j++) {
- BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * BDIGITS(y)[j];
- n = zds[i + j] + ee;
- if (ee) zds[i + j] = BIGLO(n);
- n = BIGDN(n);
- }
- if (n) {
- zds[i + j] = n;
- }
- }
+ bary_mul(zds, zn, xds, xn, yds, yn);
+
+ RB_GC_GUARD(x);
+ RB_GC_GUARD(y);
return z;
}
/*
* call-seq:
- * big * other => Numeric
+ * big * other -> Numeric
*
* Multiplies big and other, returning the result.
*/
VALUE
-rb_big_mul(x, y)
- VALUE x, y;
+rb_big_mul(VALUE x, VALUE y)
{
- return bignorm(rb_big_mul0(x, y));
+ if (FIXNUM_P(y)) {
+ y = rb_int2big(FIX2LONG(y));
+ }
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ }
+ else if (RB_FLOAT_TYPE_P(y)) {
+ return DBL2NUM(rb_big2dbl(x) * RFLOAT_VALUE(y));
+ }
+ else {
+ return rb_num_coerce_bin(x, y, '*');
+ }
+
+ return bignorm(bigmul0(x, y));
}
-static void
-bigdivrem(x, y, divp, modp)
- VALUE x, y;
- VALUE *divp, *modp;
-{
- long nx = RBIGNUM(x)->len, ny = RBIGNUM(y)->len;
- long i, j;
- VALUE yy, z;
- BDIGIT *xds, *yds, *zds, *tds;
- BDIGIT_DBL t2;
- BDIGIT_DBL_SIGNED num;
- BDIGIT dd, q;
+static VALUE
+bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
+{
+ long xn = BIGNUM_LEN(x), yn = BIGNUM_LEN(y);
+ VALUE z;
+ BDIGIT *xds, *yds, *zds;
+ BDIGIT dd;
+
+ VALUE q = Qnil, r = Qnil;
+ BDIGIT *qds, *rds;
+ long qn, rn;
- if (BIGZEROP(y)) rb_num_zerodiv();
yds = BDIGITS(y);
- if (nx < ny || (nx == ny && BDIGITS(x)[nx - 1] < BDIGITS(y)[ny - 1])) {
+ BARY_TRUNC(yds, yn);
+ if (yn == 0)
+ rb_num_zerodiv();
+
+ xds = BDIGITS(x);
+ BARY_TRUNC(xds, xn);
+
+ if (xn < yn || (xn == yn && xds[xn - 1] < yds[yn - 1])) {
if (divp) *divp = rb_int2big(0);
if (modp) *modp = x;
- return;
+ return Qnil;
}
- xds = BDIGITS(x);
- if (ny == 1) {
+ if (yn == 1) {
dd = yds[0];
- z = rb_big_clone(x);
+ z = bignew(xn, BIGNUM_SIGN(x)==BIGNUM_SIGN(y));
zds = BDIGITS(z);
- t2 = 0; i = nx;
- while (i--) {
- t2 = BIGUP(t2) + zds[i];
- zds[i] = (BDIGIT)(t2 / dd);
- t2 %= dd;
- }
- RBIGNUM(z)->sign = RBIGNUM(x)->sign==RBIGNUM(y)->sign;
+ dd = bigdivrem_single(zds, xds, xn, dd);
if (modp) {
- *modp = rb_uint2big((unsigned long)t2);
- RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
+ *modp = rb_uint2big((VALUE)dd);
+ BIGNUM_SET_SIGN(*modp, BIGNUM_SIGN(x));
}
if (divp) *divp = z;
- return;
+ 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(x)->sign==RBIGNUM(y)->sign);
- zds = BDIGITS(z);
- if (nx==ny) zds[nx+1] = 0;
- while (!yds[ny-1]) ny--;
- dd = 0;
- q = yds[ny-1];
- while ((q & (1U<<(BITSPERDIG-1))) == 0) {
- q <<= 1;
- 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;
- j = 0;
- t2 = 0;
- while (j<nx) {
- t2 += (BDIGIT_DBL)xds[j]<<dd;
- zds[j++] = BIGLO(t2);
- t2 = BIGDN(t2);
- }
- zds[j] = (BDIGIT)t2;
+ if (modp) {
+ rn = yn;
+ r = bignew(rn, BIGNUM_SIGN(x));
+ rds = BDIGITS(r);
}
else {
- zds[nx] = 0;
- j = nx;
- while (j--) zds[j] = xds[j];
+ rn = 0;
+ rds = NULL;
}
- j = nx==ny?nx+1:nx;
- do {
- if (zds[j] == yds[ny-1]) q = BIGRAD-1;
- else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
- if (q) {
- i = 0; 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);
- if (divp) { /* move quotient down in z */
- *divp = rb_big_clone(z);
- zds = BDIGITS(*divp);
- j = (nx==ny ? nx+2 : nx+1) - ny;
- for (i = 0;i < j;i++) zds[i] = zds[i+ny];
- RBIGNUM(*divp)->len = i;
- }
- if (modp) { /* normalize remainder */
- *modp = rb_big_clone(z);
- zds = BDIGITS(*modp);
- while (--ny && !zds[ny]); ++ny;
- if (dd) {
- t2 = 0; i = ny;
- while(i--) {
- t2 = (t2 | zds[i]) >> dd;
- q = zds[i];
- zds[i] = BIGLO(t2);
- t2 = BIGUP(q);
- }
- }
- RBIGNUM(*modp)->len = ny;
- RBIGNUM(*modp)->sign = RBIGNUM(x)->sign;
+ bary_divmod_branch(qds, qn, rds, rn, xds, xn, yds, yn);
+
+ if (divp) {
+ bigtrunc(q);
+ *divp = q;
+ }
+ if (modp) {
+ bigtrunc(r);
+ *modp = r;
}
+
+ return Qnil;
}
static void
-bigdivmod(x, y, divp, modp)
- VALUE x, y;
- VALUE *divp, *modp;
+bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
{
VALUE mod;
bigdivrem(x, y, divp, &mod);
- if (RBIGNUM(x)->sign != RBIGNUM(y)->sign && !BIGZEROP(mod)) {
+ if (BIGNUM_SIGN(x) != BIGNUM_SIGN(y) && !BIGZEROP(mod)) {
if (divp) *divp = bigadd(*divp, rb_int2big(1), 0);
if (modp) *modp = bigadd(mod, y, 1);
}
- else {
- if (divp) *divp = *divp;
- if (modp) *modp = mod;
+ else if (modp) {
+ *modp = mod;
}
}
-/*
- * call-seq:
- * big / other => Numeric
- * big.div(other) => Numeric
- *
- * Divides big by other, returning the result.
- */
static VALUE
-rb_big_div(x, y)
- VALUE x, y;
+rb_big_divide(VALUE x, VALUE y, ID op)
{
VALUE z;
- switch (TYPE(y)) {
- case T_FIXNUM:
+ if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- default:
- return rb_num_coerce_bin(x, 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);
+ }
+ }
+ else {
+ return rb_num_coerce_bin(x, y, op);
}
bigdivmod(x, y, &z, 0);
@@ -1522,29 +6042,51 @@ rb_big_div(x, y)
/*
* call-seq:
- * big % other => Numeric
- * big.modulo(other) => Numeric
+ * big / other -> Numeric
+ *
+ * Performs division: the class of the resulting object depends on
+ * the class of <code>numeric</code> and on the magnitude of the
+ * result.
+ */
+
+VALUE
+rb_big_div(VALUE x, VALUE y)
+{
+ return rb_big_divide(x, y, '/');
+}
+
+/*
+ * call-seq:
+ * big.div(other) -> integer
+ *
+ * Performs integer division: returns integer value.
+ */
+
+VALUE
+rb_big_idiv(VALUE x, VALUE y)
+{
+ return rb_big_divide(x, y, rb_intern("div"));
+}
+
+/*
+ * call-seq:
+ * big % other -> Numeric
+ * big.modulo(other) -> Numeric
*
* Returns big modulo other. See Numeric.divmod for more
* information.
*/
-static VALUE
-rb_big_modulo(x, y)
- VALUE x, y;
+VALUE
+rb_big_modulo(VALUE x, VALUE y)
{
VALUE z;
- switch (TYPE(y)) {
- case T_FIXNUM:
+ if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- default:
- return rb_num_coerce_bin(x, y);
+ }
+ else if (!RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bin(x, y, '%');
}
bigdivmod(x, y, 0, &z);
@@ -1553,7 +6095,7 @@ rb_big_modulo(x, y)
/*
* call-seq:
- * big.remainder(numeric) => number
+ * big.remainder(numeric) -> number
*
* Returns the remainder after dividing <i>big</i> by <i>numeric</i>.
*
@@ -1561,207 +6103,144 @@ rb_big_modulo(x, y)
* -1234567890987654321.remainder(13731.24) #=> -9906.22531493148
*/
static VALUE
-rb_big_remainder(x, y)
- VALUE x, y;
+rb_big_remainder(VALUE x, VALUE y)
{
VALUE z;
- switch (TYPE(y)) {
- case T_FIXNUM:
+ if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- default:
- return rb_num_coerce_bin(x, y);
+ }
+ else if (!RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bin(x, y, rb_intern("remainder"));
}
bigdivrem(x, y, 0, &z);
return bignorm(z);
}
-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(x, n)
- VALUE x;
- int n;
-{
- if (n < 0)
- return big_lshift(x, (unsigned int)n);
- else if (n > 0)
- return big_rshift(x, (unsigned int)n);
- return x;
-}
-
/*
* call-seq:
- * big.divmod(numeric) => array
+ * big.divmod(numeric) -> array
*
* See <code>Numeric#divmod</code>.
*
*/
VALUE
-rb_big_divmod(x, y)
- VALUE x, y;
+rb_big_divmod(VALUE x, VALUE y)
{
VALUE div, mod;
- switch (TYPE(y)) {
- case T_FIXNUM:
+ if (FIXNUM_P(y)) {
y = rb_int2big(FIX2LONG(y));
- break;
-
- case T_BIGNUM:
- break;
-
- default:
- return rb_num_coerce_bin(x, y);
+ }
+ else if (!RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
bigdivmod(x, y, &div, &mod);
return rb_assoc_new(bignorm(div), bignorm(mod));
}
+static VALUE
+big_shift(VALUE x, long n)
+{
+ if (n < 0)
+ return big_lshift(x, 1+(unsigned long)(-(n+1)));
+ else if (n > 0)
+ return big_rshift(x, (unsigned long)n);
+ return x;
+}
+
+static VALUE
+big_fdiv(VALUE x, VALUE y, long ey)
+{
+#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
+ VALUE z;
+ long l, ex;
+
+ bigtrunc(x);
+ l = BIGNUM_LEN(x);
+ ex = l * BITSPERDIG - nlz(BDIGITS(x)[l-1]);
+ ex -= 2 * DBL_BIGDIG * BITSPERDIG;
+ if (ex) x = big_shift(x, ex);
+
+ bigdivrem(x, y, &z, 0);
+ l = ex - ey;
+#if SIZEOF_LONG > SIZEOF_INT
+ {
+ /* Visual C++ can't be here */
+ if (l > INT_MAX) return DBL2NUM(INFINITY);
+ if (l < INT_MIN) return DBL2NUM(0.0);
+ }
+#endif
+ 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.quo(numeric) -> float
- * big.fdiv(numeric) -> float
+ * big.fdiv(numeric) -> float
*
* Returns the floating point result of dividing <i>big</i> by
* <i>numeric</i>.
*
- * -1234567890987654321.quo(13731) #=> -89910996357705.5
- * -1234567890987654321.quo(13731.24) #=> -89909424858035.7
+ * -1234567890987654321.fdiv(13731) #=> -89910996357705.5
+ * -1234567890987654321.fdiv(13731.24) #=> -89909424858035.7
*
*/
-static VALUE
-rb_big_quo(x, y)
- VALUE x, y;
+
+VALUE
+rb_big_fdiv(VALUE x, VALUE y)
{
- double dx = big2dbl(x);
- double dy;
+ double dx, dy;
- if (isinf(dx)) {
-#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
- VALUE z;
- int ex, ey;
-
- ex = (RBIGNUM(bigtrunc(x))->len - 1) * BITSPERDIG;
- ex += bdigbitsize(BDIGITS(x)[RBIGNUM(x)->len - 1]);
- 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: {
- ey = (RBIGNUM(bigtrunc(y))->len - 1) * BITSPERDIG;
- ey += bdigbitsize(BDIGITS(y)[RBIGNUM(y)->len - 1]);
- ey -= DBL_BIGDIG * BITSPERDIG;
- if (ey) y = big_shift(y, ey);
- bignum:
- bigdivrem(x, y, &z, 0);
- return rb_float_new(ldexp(big2dbl(z), ex - ey));
- }
- case T_FLOAT:
- y = dbl2big(ldexp(frexp(RFLOAT(y)->value, &ey), DBL_MANT_DIG));
- ey -= DBL_MANT_DIG;
- goto bignum;
- }
- }
- switch (TYPE(y)) {
- case T_FIXNUM:
+ dx = big2dbl(x);
+ if (FIXNUM_P(y)) {
dy = (double)FIX2LONG(y);
- break;
-
- case T_BIGNUM:
+ if (isinf(dx))
+ return big_fdiv_int(x, rb_int2big(FIX2LONG(y)));
+ }
+ else if (RB_BIGNUM_TYPE_P(y)) {
dy = rb_big2dbl(y);
- break;
-
- case T_FLOAT:
- dy = RFLOAT(y)->value;
- break;
-
- default:
- return rb_num_coerce_bin(x, y);
+ if (isinf(dx) || isinf(dy))
+ return big_fdiv_int(x, y);
}
- return rb_float_new(dx / dy);
-}
-
-static VALUE
-bigsqr(x)
- VALUE x;
-{
- long len = RBIGNUM(x)->len, k = len / 2, i;
- VALUE a, b, a2, z;
- BDIGIT_DBL num;
-
- if (len < 4000 / BITSPERDIG) {
- return rb_big_mul0(x, x);
- }
-
- a = bignew(len - k, 1);
- MEMCPY(BDIGITS(a), BDIGITS(x) + k, BDIGIT, len - k);
- b = bignew(k, 1);
- MEMCPY(BDIGITS(b), BDIGITS(x), BDIGIT, k);
-
- a2 = bigtrunc(bigsqr(a));
- z = bigsqr(b);
- REALLOC_N(RBIGNUM(z)->digits, BDIGIT, (len = 2 * k + RBIGNUM(a2)->len) + 1);
- while (RBIGNUM(z)->len < 2 * k) BDIGITS(z)[RBIGNUM(z)->len++] = 0;
- MEMCPY(BDIGITS(z) + 2 * k, BDIGITS(a2), BDIGIT, RBIGNUM(a2)->len);
- RBIGNUM(z)->len = len;
- a2 = bigtrunc(rb_big_mul0(a, b));
- len = RBIGNUM(a2)->len;
- TRAP_BEG;
- for (i = 0, num = 0; i < len; i++) {
- num += (BDIGIT_DBL)BDIGITS(z)[i + k] + ((BDIGIT_DBL)BDIGITS(a2)[i] << 1);
- BDIGITS(z)[i + k] = BIGLO(num);
- num = BIGDN(num);
+ else if (RB_FLOAT_TYPE_P(y)) {
+ dy = RFLOAT_VALUE(y);
+ if (isnan(dy))
+ return y;
+ if (isinf(dx))
+ return big_fdiv_float(x, y);
}
- TRAP_END;
- if (num) {
- len = RBIGNUM(z)->len;
- for (i += k; i < len && num; ++i) {
- num += (BDIGIT_DBL)BDIGITS(z)[i];
- BDIGITS(z)[i] = BIGLO(num);
- num = BIGDN(num);
- }
- if (num) {
- BDIGITS(z)[RBIGNUM(z)->len++] = BIGLO(num);
- }
+ else {
+ return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
- return bigtrunc(z);
+ return DBL2NUM(dx / dy);
}
/*
* call-seq:
- * big ** exponent #=> numeric
+ * big ** exponent -> numeric
*
* Raises _big_ to the _exponent_ power (which may be an integer, float,
* or anything that will coerce to a number). The result may be
@@ -1769,391 +6248,472 @@ bigsqr(x)
*
* 123456789 ** 2 #=> 15241578750190521
* 123456789 ** 1.2 #=> 5126464716.09932
- * 123456789 ** -2 #=> 6.5610001194102e-17
+ * 123456789 ** -2 #=> (1/15241578750190521)
*/
VALUE
-rb_big_pow(x, y)
- VALUE x, y;
+rb_big_pow(VALUE x, VALUE y)
{
double d;
- long yy;
+ SIGNED_VALUE yy;
+ again:
if (y == INT2FIX(0)) return INT2FIX(1);
- switch (TYPE(y)) {
- case T_FLOAT:
- d = RFLOAT(y)->value;
- break;
-
- case T_BIGNUM:
+ if (RB_FLOAT_TYPE_P(y)) {
+ d = RFLOAT_VALUE(y);
+ if ((!BIGNUM_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;
rb_warn("in a**b, b may be too big");
d = rb_big2dbl(y);
- break;
-
- case T_FIXNUM:
+ }
+ else if (FIXNUM_P(y)) {
yy = FIX2LONG(y);
- if (yy > 0) {
+
+ if (yy < 0)
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
+ else {
VALUE z = 0;
- long mask;
- const long BIGLEN_LIMIT = 1024*1024 / SIZEOF_BDIGITS;
+ SIGNED_VALUE mask;
+ const size_t xbits = rb_absint_numwords(x, 1, NULL);
+ const size_t BIGLEN_LIMIT = 32*1024*1024;
- if ((RBIGNUM(x)->len > BIGLEN_LIMIT) ||
- (RBIGNUM(x)->len > BIGLEN_LIMIT / yy)) {
+ if (xbits == (size_t)-1 ||
+ (xbits > BIGLEN_LIMIT) ||
+ (xbits * yy > BIGLEN_LIMIT)) {
rb_warn("in a**b, b may be too big");
d = (double)yy;
- break;
}
- for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
- if (z) z = bigtrunc(bigsqr(z));
- if (yy & mask) {
- z = z ? bigtrunc(rb_big_mul0(z, x)) : x;
+ else {
+ for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
+ if (z) z = bigsq(z);
+ if (yy & mask) {
+ z = z ? bigtrunc(bigmul0(z, x)) : x;
+ }
}
+ return bignorm(z);
}
- return bignorm(z);
}
- d = (double)yy;
- break;
+ }
+ else {
+ return rb_num_coerce_bin(x, y, rb_intern("**"));
+ }
+ return DBL2NUM(pow(rb_big2dbl(x), d));
+}
- default:
- return rb_num_coerce_bin(x, y);
+static VALUE
+bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long zn;
+ long i;
+ BDIGIT hibitsy;
+
+ if (y == 0) return INT2FIX(0);
+ if (xn == 0) return hibitsx ? LONG2NUM(y) : 0;
+ hibitsy = 0 <= y ? 0 : BDIGMAX;
+ xds = BDIGITS(x);
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
+ if (!hibitsy) {
+ 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);
+ zds = BDIGITS(z);
+
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] & BIGLO(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);
}
- return rb_float_new(pow(rb_big2dbl(x), d));
+#endif
+ for (;i < xn; i++) {
+ zds[i] = xds[i] & hibitsy;
+ }
+ for (;i < zn; i++) {
+ zds[i] = hibitsx & hibitsy;
+ }
+ twocomp2abs_bang(z, hibitsx && hibitsy);
+ RB_GC_GUARD(x);
+ return bignorm(z);
}
/*
* call-seq:
- * big & numeric => integer
+ * big & numeric -> integer
*
* Performs bitwise +and+ between _big_ and _numeric_.
*/
VALUE
-rb_big_and(xx, yy)
- VALUE xx, yy;
+rb_big_and(VALUE x, VALUE y)
{
- volatile VALUE x, y, z;
+ VALUE z;
BDIGIT *ds1, *ds2, *zds;
- long i, l1, l2;
- char sign;
+ long i, xn, yn, n1, n2;
+ BDIGIT hibitsx, hibitsy;
+ BDIGIT hibits1, hibits2;
+ VALUE tmpv;
+ BDIGIT tmph;
+ long tmpn;
- x = xx;
- y = rb_to_int(yy);
- if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bit(x, y, '&');
}
- if (!RBIGNUM(y)->sign) {
- y = rb_big_clone(y);
- get2comp(y);
+
+ hibitsx = abs2twocomp(&x, &xn);
+ if (FIXNUM_P(y)) {
+ return bigand_int(x, xn, hibitsx, FIX2LONG(y));
}
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
+ 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(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
- ds1 = BDIGITS(y);
- ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
+ n1 = xn;
+ n2 = yn;
+ ds1 = BDIGITS(x);
+ ds2 = BDIGITS(y);
+ hibits1 = hibitsx;
+ hibits2 = hibitsy;
+
+ if (!hibits1)
+ n2 = n1;
+
+ z = bignew(n2, 0);
+ zds = BDIGITS(z);
+
+ for (i=0; i<n1; i++) {
+ zds[i] = ds1[i] & ds2[i];
}
- else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
+ for (; i<n2; i++) {
+ zds[i] = hibits1 & ds2[i];
}
- z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign);
+ twocomp2abs_bang(z, hibits1 && hibits2);
+ RB_GC_GUARD(x);
+ RB_GC_GUARD(y);
+ return bignorm(z);
+}
+
+static VALUE
+bigor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long zn;
+ long i;
+ BDIGIT hibitsy;
+
+ if (y == -1) return INT2FIX(-1);
+ if (xn == 0) return hibitsx ? INT2FIX(-1) : LONG2FIX(y);
+ hibitsy = 0 <= y ? 0 : BDIGMAX;
+ 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);
zds = BDIGITS(z);
- for (i=0; i<l1; i++) {
- zds[i] = ds1[i] & ds2[i];
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] | BIGLO(y);
+ if (i < zn)
+ goto y_is_fixed_point;
+ goto finish;
+#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
+
+ y_is_fixed_point:
+ if (hibitsy)
+ goto fill_hibits;
+ for (; i < xn; i++) {
+ zds[i] = xds[i];
}
- for (; i<l2; i++) {
- zds[i] = sign?0:ds2[i];
+ if (hibitsx)
+ goto fill_hibits;
+ for (; i < zn; i++) {
+ zds[i] = 0;
}
- if (!RBIGNUM(z)->sign) get2comp(z);
+ goto finish;
+
+ fill_hibits:
+ for (; i < zn; i++) {
+ zds[i] = BDIGMAX;
+ }
+
+ finish:
+ twocomp2abs_bang(z, hibitsx || hibitsy);
+ RB_GC_GUARD(x);
return bignorm(z);
}
/*
* call-seq:
- * big | numeric => integer
+ * big | numeric -> integer
*
* Performs bitwise +or+ between _big_ and _numeric_.
*/
VALUE
-rb_big_or(xx, yy)
- VALUE xx, yy;
+rb_big_or(VALUE x, VALUE y)
{
- volatile VALUE x, y, z;
+ VALUE z;
BDIGIT *ds1, *ds2, *zds;
- long i, l1, l2;
- char sign;
+ long i, xn, yn, n1, n2;
+ BDIGIT hibitsx, hibitsy;
+ BDIGIT hibits1, hibits2;
+ VALUE tmpv;
+ BDIGIT tmph;
+ long tmpn;
- x = xx;
- y = rb_to_int(yy);
- if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
- }
- if (!RBIGNUM(y)->sign) {
- y = rb_big_clone(y);
- get2comp(y);
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bit(x, y, '|');
}
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
- }
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
- ds1 = BDIGITS(y);
- ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
+
+ hibitsx = abs2twocomp(&x, &xn);
+ if (FIXNUM_P(y)) {
+ return bigor_int(x, xn, hibitsx, FIX2LONG(y));
}
- else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
+ 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;
}
- z = bignew(l2, RBIGNUM(x)->sign && RBIGNUM(y)->sign);
+ n1 = xn;
+ n2 = yn;
+ ds1 = BDIGITS(x);
+ ds2 = BDIGITS(y);
+ hibits1 = hibitsx;
+ hibits2 = hibitsy;
+
+ if (hibits1)
+ n2 = n1;
+
+ z = bignew(n2, 0);
zds = BDIGITS(z);
- for (i=0; i<l1; i++) {
+ for (i=0; i<n1; i++) {
zds[i] = ds1[i] | ds2[i];
}
- for (; i<l2; i++) {
- zds[i] = sign?ds2[i]:(BIGRAD-1);
+ for (; i<n2; i++) {
+ zds[i] = hibits1 | ds2[i];
}
- if (!RBIGNUM(z)->sign) get2comp(z);
-
+ twocomp2abs_bang(z, hibits1 || hibits2);
+ RB_GC_GUARD(x);
+ RB_GC_GUARD(y);
return bignorm(z);
}
+static VALUE
+bigxor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
+{
+ VALUE z;
+ BDIGIT *xds, *zds;
+ long zn;
+ long i;
+ BDIGIT hibitsy;
+
+ hibitsy = 0 <= y ? 0 : BDIGMAX;
+ 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);
+ zds = BDIGITS(z);
+
+#if SIZEOF_BDIGIT >= SIZEOF_LONG
+ i = 1;
+ zds[0] = xds[0] ^ BIGLO(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);
+ }
+#endif
+ for (; i < xn; i++) {
+ zds[i] = xds[i] ^ hibitsy;
+ }
+ for (; i < zn; i++) {
+ zds[i] = hibitsx ^ hibitsy;
+ }
+ twocomp2abs_bang(z, (hibitsx ^ hibitsy) != 0);
+ RB_GC_GUARD(x);
+ return bignorm(z);
+}
/*
* call-seq:
- * big ^ numeric => integer
+ * big ^ numeric -> integer
*
* Performs bitwise +exclusive or+ between _big_ and _numeric_.
*/
VALUE
-rb_big_xor(xx, yy)
- VALUE xx, yy;
+rb_big_xor(VALUE x, VALUE y)
{
- volatile VALUE x, y;
VALUE z;
BDIGIT *ds1, *ds2, *zds;
- long i, l1, l2;
- char sign;
+ long i, xn, yn, n1, n2;
+ BDIGIT hibitsx, hibitsy;
+ BDIGIT hibits1, hibits2;
+ VALUE tmpv;
+ BDIGIT tmph;
+ long tmpn;
- x = xx;
- y = rb_to_int(yy);
- if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
- }
- if (!RBIGNUM(y)->sign) {
- y = rb_big_clone(y);
- get2comp(y);
- }
- if (!RBIGNUM(x)->sign) {
- x = rb_big_clone(x);
- get2comp(x);
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
+ return rb_num_coerce_bit(x, y, '^');
}
- if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
- l1 = RBIGNUM(y)->len;
- l2 = RBIGNUM(x)->len;
- ds1 = BDIGITS(y);
- ds2 = BDIGITS(x);
- sign = RBIGNUM(y)->sign;
- }
- else {
- l1 = RBIGNUM(x)->len;
- l2 = RBIGNUM(y)->len;
- ds1 = BDIGITS(x);
- ds2 = BDIGITS(y);
- sign = RBIGNUM(x)->sign;
- }
- RBIGNUM(x)->sign = RBIGNUM(x)->sign?1:0;
- RBIGNUM(y)->sign = RBIGNUM(y)->sign?1:0;
- z = bignew(l2, !(RBIGNUM(x)->sign ^ RBIGNUM(y)->sign));
+
+ hibitsx = abs2twocomp(&x, &xn);
+ if (FIXNUM_P(y)) {
+ return bigxor_int(x, xn, hibitsx, 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);
zds = BDIGITS(z);
- for (i=0; i<l1; i++) {
+ for (i=0; i<n1; i++) {
zds[i] = ds1[i] ^ ds2[i];
}
- for (; i<l2; i++) {
- zds[i] = sign?ds2[i]:~ds2[i];
+ for (; i<n2; i++) {
+ zds[i] = hibitsx ^ ds2[i];
}
- if (!RBIGNUM(z)->sign) get2comp(z);
-
+ twocomp2abs_bang(z, (hibits1 ^ hibits2) != 0);
+ RB_GC_GUARD(x);
+ RB_GC_GUARD(y);
return bignorm(z);
}
-static VALUE
-check_shiftdown(VALUE y, VALUE x)
-{
- if (!RBIGNUM(x)->len) return INT2FIX(0);
- if (RBIGNUM(y)->len > SIZEOF_LONG / SIZEOF_BDIGITS) {
- return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(-1);
- }
- return Qnil;
-}
-
/*
* call-seq:
- * big << numeric => integer
+ * big << numeric -> integer
*
* Shifts big left _numeric_ positions (right if _numeric_ is negative).
*/
VALUE
-rb_big_lshift(x, y)
- VALUE x, y;
+rb_big_lshift(VALUE x, VALUE y)
{
- long shift;
- int neg = 0;
+ int lshift_p;
+ size_t shift_numdigits;
+ int shift_numbits;
for (;;) {
if (FIXNUM_P(y)) {
- shift = FIX2LONG(y);
- if (shift < 0) {
- neg = 1;
- shift = -shift;
+ 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));
}
- break;
+ shift_numbits = (int)(shift & (BITSPERDIG-1));
+ shift_numdigits = shift >> bit_length(BITSPERDIG-1);
+ return bignorm(big_shift3(x, lshift_p, shift_numdigits, shift_numbits));
}
- else if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM(y)->sign) {
- VALUE t = check_shiftdown(y, x);
- if (!NIL_P(t)) return t;
- neg = 1;
- }
- shift = big2ulong(y, "long");
- break;
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ return bignorm(big_shift2(x, 1, y));
}
y = rb_to_int(y);
}
-
- if (neg) return big_rshift(x, shift);
- return big_lshift(x, shift);
}
-static VALUE
-big_lshift(x, shift)
- VALUE x;
- unsigned long shift;
-{
- BDIGIT *xds, *zds;
- long s1 = shift/BITSPERDIG;
- int s2 = shift%BITSPERDIG;
- VALUE z;
- BDIGIT_DBL num = 0;
- long len, i;
-
- len = RBIGNUM(x)->len;
- z = bignew(len+s1+1, RBIGNUM(x)->sign);
- 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 bignorm(z);
-}
/*
* call-seq:
- * big >> numeric => integer
+ * big >> numeric -> integer
*
* Shifts big right _numeric_ positions (left if _numeric_ is negative).
*/
VALUE
-rb_big_rshift(x, y)
- VALUE x, y;
+rb_big_rshift(VALUE x, VALUE y)
{
- long shift;
- int neg = 0;
+ int lshift_p;
+ size_t shift_numdigits;
+ int shift_numbits;
for (;;) {
if (FIXNUM_P(y)) {
- shift = FIX2LONG(y);
- if (shift < 0) {
- neg = 1;
- shift = -shift;
+ 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));
}
- break;
+ shift_numbits = (int)(shift & (BITSPERDIG-1));
+ shift_numdigits = shift >> bit_length(BITSPERDIG-1);
+ return bignorm(big_shift3(x, lshift_p, shift_numdigits, shift_numbits));
}
- else if (TYPE(y) == T_BIGNUM) {
- if (RBIGNUM(y)->sign) {
- VALUE t = check_shiftdown(y, x);
- if (!NIL_P(t)) return t;
- }
- else {
- neg = 1;
- }
- shift = big2ulong(y, "long");
- break;
+ else if (RB_BIGNUM_TYPE_P(y)) {
+ return bignorm(big_shift2(x, 0, y));
}
y = rb_to_int(y);
}
-
- if (neg) return big_lshift(x, shift);
- return big_rshift(x, shift);
-}
-
-static VALUE
-big_rshift(x, shift)
- VALUE x;
- unsigned long shift;
-{
- BDIGIT *xds, *zds;
- long s1 = shift/BITSPERDIG;
- int s2 = shift%BITSPERDIG;
- VALUE z;
- BDIGIT_DBL num = 0;
- long i, j;
- volatile VALUE save_x;
-
- if (s1 > RBIGNUM(x)->len) {
- if (RBIGNUM(x)->sign)
- return INT2FIX(0);
- else
- return INT2FIX(-1);
- }
- if (!RBIGNUM(x)->sign) {
- save_x = x = rb_big_clone(x);
- get2comp(x);
- }
- xds = BDIGITS(x);
- i = RBIGNUM(x)->len; j = i - s1;
- if (j == 0) {
- if (RBIGNUM(x)->sign) return INT2FIX(0);
- else return INT2FIX(-1);
- }
- z = bignew(j, RBIGNUM(x)->sign);
- if (!RBIGNUM(x)->sign) {
- 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(x)->sign) {
- get2comp(z);
- }
- return bignorm(z);
}
/*
@@ -2176,93 +6736,99 @@ big_rshift(x, shift)
*/
static VALUE
-rb_big_aref(x, y)
- VALUE x, y;
+rb_big_aref(VALUE x, VALUE y)
{
BDIGIT *xds;
- BDIGIT_DBL num;
- unsigned long shift;
- long i, s1, s2;
+ size_t shift;
+ size_t i, s1, s2;
+ long l;
+ BDIGIT bit;
- if (TYPE(y) == T_BIGNUM) {
- if (!RBIGNUM(y)->sign)
+ if (RB_BIGNUM_TYPE_P(y)) {
+ if (!BIGNUM_SIGN(y))
return INT2FIX(0);
- if (RBIGNUM(bigtrunc(y))->len > SIZEOF_LONG/SIZEOF_BDIGITS) {
+ bigtrunc(y);
+ if (BIGSIZE(y) > sizeof(size_t)) {
out_of_range:
- return RBIGNUM(x)->sign ? INT2FIX(0) : INT2FIX(1);
+ return BIGNUM_SIGN(x) ? INT2FIX(0) : INT2FIX(1);
}
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
shift = big2ulong(y, "long");
+#else
+ shift = big2ull(y, "long long");
+#endif
}
else {
- i = NUM2LONG(y);
- if (i < 0) return INT2FIX(0);
- shift = (VALUE)i;
+ l = NUM2LONG(y);
+ if (l < 0) return INT2FIX(0);
+ shift = (size_t)l;
}
s1 = shift/BITSPERDIG;
s2 = shift%BITSPERDIG;
+ bit = (BDIGIT)1 << s2;
- if (s1 >= RBIGNUM(x)->len) goto out_of_range;
- if (!RBIGNUM(x)->sign) {
- 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);
+ 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);
}
/*
* call-seq:
- * big.hash => fixnum
+ * big.hash -> fixnum
*
* Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
*/
-static VALUE
-rb_big_hash(x)
- VALUE x;
+VALUE
+rb_big_hash(VALUE x)
{
- long i, len, key;
- BDIGIT *digits;
+ st_index_t hash;
- key = 0; digits = BDIGITS(x); len = RBIGNUM(x)->len;
- for (i=0; i<len; i++) {
- key ^= *digits++;
- }
- return LONG2FIX(key);
+ hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*BIGNUM_LEN(x)) ^ BIGNUM_SIGN(x);
+ return INT2FIX(hash);
}
/*
- * MISSING: documentation
+ * 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]
*/
static VALUE
-rb_big_coerce(x, y)
- VALUE x, y;
+rb_big_coerce(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_assoc_new(rb_int2big(FIX2LONG(y)), x);
- }
- else if (TYPE(y) == T_BIGNUM) {
- return rb_assoc_new(y, x);
+ y = rb_int2big(FIX2LONG(y));
}
- else {
+ else if (!RB_BIGNUM_TYPE_P(y)) {
rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
rb_obj_classname(y));
}
- /* not reached */
- return Qnil;
+ return rb_assoc_new(y, x);
}
/*
* call-seq:
* big.abs -> aBignum
+ * big.magnitude -> aBignum
*
* Returns the absolute value of <i>big</i>.
*
@@ -2270,54 +6836,142 @@ rb_big_coerce(x, y)
*/
static VALUE
-rb_big_abs(x)
- VALUE x;
+rb_big_abs(VALUE x)
{
- if (!RBIGNUM(x)->sign) {
+ if (!BIGNUM_SIGN(x)) {
x = rb_big_clone(x);
- RBIGNUM(x)->sign = 1;
+ BIGNUM_SET_SIGN(x, 1);
}
return x;
}
-VALUE
-rb_big_rand(max, rand_buf)
- VALUE max;
- double *rand_buf;
+/*
+ * call-seq:
+ * big.size -> integer
+ *
+ * Returns the number of bytes in the machine representation of
+ * <i>big</i>.
+ *
+ * (256**10 - 1).size #=> 12
+ * (256**20 - 1).size #=> 20
+ * (256**40 - 1).size #=> 40
+ */
+
+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)
{
- VALUE v;
- long len = RBIGNUM(max)->len;
+ int nlz_bits;
+ size_t numbytes;
- if (BIGZEROP(max)) {
- return rb_float_new(rand_buf[0]);
+ 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--;
+ }
}
- v = bignew(len,1);
- len--;
- BDIGITS(v)[len] = BDIGITS(max)[len] * rand_buf[len];
- while (len--) {
- BDIGITS(v)[len] = ((BDIGIT)~0) * rand_buf[len];
+
+ if (numbytes <= SIZE_MAX / CHAR_BIT) {
+ return SIZET2NUM(numbytes * CHAR_BIT - nlz_bits);
}
- return v;
+ 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);
}
/*
* call-seq:
- * big.size -> integer
+ * big.odd? -> true or false
*
- * Returns the number of bytes in the machine representation of
- * <i>big</i>.
+ * Returns <code>true</code> if <i>big</i> is an odd number.
+ */
+
+static VALUE
+rb_big_odd_p(VALUE num)
+{
+ if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
+/*
+ * call-seq:
+ * big.even? -> true or false
*
- * (256**10 - 1).size #=> 12
- * (256**20 - 1).size #=> 20
- * (256**40 - 1).size #=> 40
+ * Returns <code>true</code> if <i>big</i> is an even number.
*/
static VALUE
-rb_big_size(big)
- VALUE big;
+rb_big_even_p(VALUE num)
{
- return LONG2FIX(RBIGNUM(big)->len*SIZEOF_BDIGITS);
+ if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ return Qfalse;
+ }
+ return Qtrue;
}
/*
@@ -2339,11 +6993,12 @@ rb_big_size(big)
*/
void
-Init_Bignum()
+Init_Bignum(void)
{
rb_cBignum = rb_define_class("Bignum", rb_cInteger);
rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1);
+ rb_define_alias(rb_cBignum, "inspect", "to_s");
rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1);
rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0);
rb_define_method(rb_cBignum, "+", rb_big_plus, 1);
@@ -2351,12 +7006,11 @@ Init_Bignum()
rb_define_method(rb_cBignum, "*", rb_big_mul, 1);
rb_define_method(rb_cBignum, "/", rb_big_div, 1);
rb_define_method(rb_cBignum, "%", rb_big_modulo, 1);
- rb_define_method(rb_cBignum, "div", rb_big_div, 1);
+ rb_define_method(rb_cBignum, "div", rb_big_idiv, 1);
rb_define_method(rb_cBignum, "divmod", rb_big_divmod, 1);
rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1);
rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1);
- rb_define_method(rb_cBignum, "quo", rb_big_quo, 1);
- rb_define_method(rb_cBignum, "fdiv", rb_big_quo, 1);
+ rb_define_method(rb_cBignum, "fdiv", rb_big_fdiv, 1);
rb_define_method(rb_cBignum, "**", rb_big_pow, 1);
rb_define_method(rb_cBignum, "&", rb_big_and, 1);
rb_define_method(rb_cBignum, "|", rb_big_or, 1);
@@ -2368,9 +7022,25 @@ Init_Bignum()
rb_define_method(rb_cBignum, "<=>", rb_big_cmp, 1);
rb_define_method(rb_cBignum, "==", rb_big_eq, 1);
+ rb_define_method(rb_cBignum, ">", big_gt, 1);
+ rb_define_method(rb_cBignum, ">=", big_ge, 1);
+ rb_define_method(rb_cBignum, "<", big_lt, 1);
+ rb_define_method(rb_cBignum, "<=", big_le, 1);
+ rb_define_method(rb_cBignum, "===", rb_big_eq, 1);
rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1);
rb_define_method(rb_cBignum, "hash", rb_big_hash, 0);
rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0);
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();
}
diff --git a/bin/erb b/bin/erb
index a6fcd5370c..1ba49c9dc1 100755
--- a/bin/erb
+++ b/bin/erb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# Tiny eRuby --- ERB2
-# Copyright (c) 1999-2000,2002 Masatoshi SEKI
+# Copyright (c) 1999-2000,2002 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
require 'erb'
@@ -11,19 +11,32 @@ class ERB
return nil if self.empty?
arg = self.shift
return nil if arg == '--'
- if arg =~ /^-(.)(.*)/
- return arg if $1 == '-'
- raise 'unknown switch "-"' if $2.index('-')
- self.unshift "-#{$2}" if $2.size > 0
+ case arg
+ when /\A-(.)(.*)/
+ if $1 == '-'
+ arg, @maybe_arg = arg.split(/=/, 2)
+ return arg
+ end
+ raise 'unknown switch "-"' if $2[0] == ?- and $1 != 'T'
+ if $2.size > 0
+ self.unshift "-#{$2}"
+ @maybe_arg = $2
+ else
+ @maybe_arg = nil
+ end
"-#{$1}"
+ when /\A(\w+)=/
+ arg
else
self.unshift arg
nil
end
end
-
+
def ARGV.req_arg
- self.shift || raise('missing argument')
+ (@maybe_arg || self.shift || raise('missing argument')).tap {
+ @maybe_arg = nil
+ }
end
def trim_mode_opt(trim_mode, disable_percent)
@@ -44,6 +57,7 @@ class ERB
def run(factory=ERB)
trim_mode = 0
disable_percent = false
+ variables = {}
begin
while switch = ARGV.switch
case switch
@@ -62,56 +76,53 @@ class ERB
require ARGV.req_arg
when '-S' # security level
arg = ARGV.req_arg
- raise "invalid safe_level #{arg.dump}" unless arg =~ /^[0-4]$/
+ raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-3]\z/
safe_level = arg.to_i
when '-T' # trim mode
arg = ARGV.req_arg
if arg == '-'
- trim_mode = arg
+ trim_mode = arg
next
end
- raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
+ raise "invalid trim mode #{arg.dump}" unless arg =~ /\A[0-2]\z/
trim_mode = arg.to_i
- when '-K' # KCODE
+ when '-E', '--encoding'
arg = ARGV.req_arg
- case arg.downcase
- when 'e', '-e', 'euc'
- $KCODE = 'EUC'
- when 's', '-s', 'sjis'
- $KCODE = 'SJIS'
- when 'u', '-u', 'utf8'
- $KCODE = 'UTF8'
- when 'n', '-n', 'none'
- $KCODE = 'NONE'
- else
- raise "invalid KCODE #{arg.dump}"
- end
+ set_encoding(*arg.split(/:/, 2))
+ when '-U'
+ set_encoding(Encoding::UTF_8, Encoding::UTF_8)
when '-P'
disable_percent = true
when '--help'
raise "print this help"
- else
+ when /\A-/
raise "unknown switch #{switch.dump}"
+ else
+ var, val = *switch.split('=', 2)
+ (variables ||= {})[var] = val
end
end
rescue # usage
STDERR.puts $!.to_s
- STDERR.puts File.basename($0) +
- " [switches] [inputfile]"
+ STDERR.puts File.basename($0) +
+ " [switches] [var=value...] [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
- -K [kcode] specify KANJI code-set
- -S [safe_level] set $SAFE (0..4)
- -T [trim_mode] specify trim_mode (0..2, -)
+ -r library load a library
+ -S safe_level set $SAFE (0..3)
+ -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
+ $<.set_encoding(Encoding::ASCII_8BIT, nil)
src = $<.read
filename = $FILENAME
exit 2 unless src
@@ -120,19 +131,38 @@ EOU
erb.filename = filename
if output
if number
- l = 1
- for line in erb.src
- puts "%3d %s"%[l, line]
- l += 1
+ erb.src.each_line.with_index do |line, l|
+ puts "%3d %s"%[l+1, line]
end
else
puts erb.src
end
else
- erb.run(TOPLEVEL_BINDING.taint)
+ 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)
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 == ""
+ [$stdin, $stdout, $stderr].each do |io|
+ io.set_encoding(extern, intern)
+ end
+ ensure
+ $VERBOSE = verbose
+ end
+ module_function :set_encoding
+ class << self; private :set_encoding; end
end
end
diff --git a/bin/gem b/bin/gem
new file mode 100755
index 0000000000..a4ec754abb
--- /dev/null
+++ b/bin/gem
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+#--
+# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+# All rights reserved.
+# See LICENSE.txt for permissions.
+#++
+
+require 'rubygems'
+require 'rubygems/gem_runner'
+require 'rubygems/exceptions'
+
+required_version = Gem::Requirement.new ">= 1.8.7"
+
+unless required_version.satisfied_by? Gem.ruby_version then
+ abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
+end
+
+args = ARGV.clone
+
+begin
+ Gem::GemRunner.new.run args
+rescue Gem::SystemExitException => e
+ exit e.exit_code
+end
+
diff --git a/bin/irb b/bin/irb
index f277bc4b69..c64ee85fbd 100644..100755
--- a/bin/irb
+++ b/bin/irb
@@ -1,21 +1,11 @@
#!/usr/bin/env ruby
#
-# irb.rb - intaractive ruby
-# $Release Version: 0.9.5 $
+# irb.rb - interactive ruby
+# $Release Version: 0.9.6 $
# $Revision$
-# $Date$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
require "irb"
-if __FILE__ == $0
- IRB.start(__FILE__)
-else
- # check -e option
- if /^-e$/ =~ $0
- IRB.start(__FILE__)
- else
- IRB.setup(__FILE__)
- end
-end
+IRB.start(__FILE__)
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000000..4e0bbb7b7a
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,33 @@
+#!/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
+
+require 'rake'
+
+Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
index fe619137fd..aaa23292df 100644..100755
--- a/bin/rdoc
+++ b/bin/rdoc
@@ -5,63 +5,40 @@
#
# Copyright (c) 2003 Dave Thomas
# Released under the same terms as Ruby
-#
-# $Revision$
-
-## Transitional Hack ####
-#
-# RDoc was initially distributed independently, and installed
-# itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
-#
-# Now that RDoc is part of the distribution, it's installed into
-# <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
-# search path. This means that if you have previously installed RDoc,
-# and then install from ruby-lang, you'll pick up the old one by
-# default. This hack checks for the condition, and readjusts the
-# search path if necessary.
-
-def adjust_for_existing_rdoc(path)
-
- $stderr.puts %{
- It seems as if you have a previously-installed RDoc in
- the directory #{path}.
-
- Because this is now out-of-date, you might want to consider
- removing the directories:
-
- #{File.join(path, "rdoc")}
-
- and
-
- #{File.join(path, "markup")}
-
- }
- # Move all the site_ruby directories to the end
- p $:
- $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
- p $:
-end
-
-$:.each do |path|
- if /site_ruby/ =~ path
- rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
- if File.exists?(rdoc_path)
- adjust_for_existing_rdoc(path)
- break
- end
- end
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
end
-## End of Transitional Hack ##
-
-
require 'rdoc/rdoc'
begin
r = RDoc::RDoc.new
- r.document(ARGV)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
- exit(1)
+ r.document ARGV
+rescue Errno::ENOSPC
+ $stderr.puts 'Ran out of space creating documentation'
+ $stderr.puts
+ $stderr.puts 'Please free up some space and try again'
+rescue SystemExit
+ raise
+rescue Exception => e
+ if $DEBUG_RDOC then
+ $stderr.puts e.message
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
+ $stderr.puts
+ elsif Interrupt === e then
+ $stderr.puts
+ $stderr.puts 'Interrupted'
+ else
+ $stderr.puts "uh-oh! RDoc had a problem:"
+ $stderr.puts e.message
+ $stderr.puts
+ $stderr.puts "run with --debug for full backtrace"
+ end
+
+ exit 1
end
+
diff --git a/bin/ri b/bin/ri
index fb3e00eda3..7fbed0c099 100755
--- a/bin/ri
+++ b/bin/ri
@@ -1,49 +1,12 @@
#!/usr/bin/env ruby
-# usage:
-#
-# ri name...
-#
-# where name can be
-#
-# Class | Class::method | Class#method | Class.method | method
-#
-# All names may be abbreviated to their minimum unbiguous form. If a name
-# _is_ ambiguous, all valid options will be listed.
-#
-# The form '.' method matches either class or instance methods, while
-# #method matches only instance and ::method matches only class methods.
-#
-#
-# == Installing Documentation
-#
-# 'ri' uses a database of documentation built by the RDoc utility.
-#
-# So, how do you install this documentation on your system?
-# It depends on how you installed Ruby.
-#
-# <em>If you installed Ruby from source files</em> (that is, if it some point
-# you typed 'make' during the process :), you can install the RDoc
-# documentation yourself. Just go back to the place where you have
-# your Ruby source and type
-#
-# make install-doc
-#
-# You'll probably need to do this as a superuser, as the documentation
-# is installed in the Ruby target tree (normally somewhere under
-# <tt>/usr/local</tt>.
-#
-# <em>If you installed Ruby from a binary distribution</em> (perhaps
-# using a one-click installer, or using some other packaging system),
-# then the team that produced the package probably forgot to package
-# the documentation as well. Contact them, and see if they can add
-# it to the next release.
-#
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
+end
-require 'rdoc/ri/ri_driver'
-
-######################################################################
-
-ri = RiDriver.new
-ri.process_args
+require 'rdoc/ri/driver'
+RDoc::RI::Driver.run ARGV
diff --git a/bin/testrb b/bin/testrb
deleted file mode 100755
index ff49cb5466..0000000000
--- a/bin/testrb
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-require 'test/unit'
-(r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
- abort r.options.banner + " tests..."
-exit r.run
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
new file mode 100644
index 0000000000..744c0adac1
--- /dev/null
+++ b/bootstraptest/pending.rb
@@ -0,0 +1,39 @@
+assert_equal 'A', %q{
+ class A
+ @@a = 'A'
+ def a=(x)
+ @@a = x
+ end
+ def a
+ @@a
+ end
+ end
+
+ B = A.dup
+ B.new.a = 'B'
+ A.new.a
+}, '[ruby-core:17019]'
+
+assert_equal 'ok', %q{
+ def m
+ lambda{
+ proc{
+ return :ng1
+ }
+ }.call.call
+ :ng2
+ end
+
+ begin
+ m()
+ rescue LocalJumpError
+ :ok
+ end
+}
+
+assert_normal_exit %q{
+ r = Range.allocate
+ def r.<=>(o) true end
+ r.instance_eval { initialize r, r }
+ r.inspect
+}
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
new file mode 100755
index 0000000000..d58b824386
--- /dev/null
+++ b/bootstraptest/runner.rb
@@ -0,0 +1,505 @@
+"exec" "${RUBY-ruby}" "-x" "$0" "$@" || true # -*- mode: ruby; coding: utf-8 -*-
+#!./ruby
+# $Id$
+
+# NOTE:
+# Never use optparse in this file.
+# Never use test/unit in this file.
+# Never use Ruby extensions in this file.
+
+begin
+ require 'fileutils'
+ require 'tmpdir'
+rescue LoadError
+ $:.unshift File.join(File.dirname(__FILE__), '../lib')
+ retry
+end
+
+if !Dir.respond_to?(:mktmpdir)
+ # copied from lib/tmpdir.rb
+ def Dir.mktmpdir(prefix_suffix=nil, tmpdir=nil)
+ case prefix_suffix
+ when nil
+ prefix = "d"
+ suffix = ""
+ when String
+ prefix = prefix_suffix
+ suffix = ""
+ when Array
+ prefix = prefix_suffix[0]
+ suffix = prefix_suffix[1]
+ else
+ raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
+ end
+ tmpdir ||= Dir.tmpdir
+ t = Time.now.strftime("%Y%m%d")
+ n = nil
+ begin
+ path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
+ path << "-#{n}" if n
+ path << suffix
+ Dir.mkdir(path, 0700)
+ rescue Errno::EEXIST
+ n ||= 0
+ n += 1
+ retry
+ end
+
+ if block_given?
+ begin
+ yield path
+ ensure
+ FileUtils.remove_entry_secure path
+ end
+ else
+ path
+ end
+ end
+end
+
+def main
+ @ruby = File.expand_path('miniruby')
+ @verbose = false
+ $stress = false
+ @color = nil
+ @tty = nil
+ @quiet = false
+ dir = nil
+ quiet = false
+ tests = nil
+ ARGV.delete_if {|arg|
+ case arg
+ when /\A--ruby=(.*)/
+ @ruby = $1
+ @ruby.gsub!(/^([^ ]*)/){File.expand_path($1)}
+ @ruby.gsub!(/(\s+-I\s*)((?!(?:\.\/)*-(?:\s|\z))\S+)/){$1+File.expand_path($2)}
+ @ruby.gsub!(/(\s+-r\s*)(\.\.?\/\S+)/){$1+File.expand_path($2)}
+ true
+ when /\A--sets=(.*)/
+ tests = Dir.glob("#{File.dirname($0)}/test_{#{$1}}*.rb").sort
+ puts tests.map {|path| File.basename(path) }.inspect
+ true
+ when /\A--dir=(.*)/
+ dir = $1
+ true
+ when /\A(--stress|-s)/
+ $stress = true
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ 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
+ true
+ when /\A(-v|--v(erbose))\z/
+ @verbose = true
+ when /\A(-h|--h(elp)?)\z/
+ puts(<<-End)
+Usage: #{File.basename($0, '.*')} --ruby=PATH [--sets=NAME,NAME,...]
+ --sets=NAME,NAME,... Name of test sets.
+ --dir=DIRECTORY Working directory.
+ default: /tmp/bootstraptestXXXXX.tmpwd
+ --color[=WHEN] Colorize the output. WHEN defaults to 'always'
+ or can be 'never' or 'auto'.
+ -s, --stress stress test.
+ -v, --verbose Output test name before exec.
+ -q, --quiet Don\'t print header message.
+ -h, --help Print this message and quit.
+End
+ exit true
+ when /\A-j/
+ true
+ else
+ false
+ end
+ }
+ if tests and not ARGV.empty?
+ $stderr.puts "--tests and arguments are exclusive"
+ exit false
+ end
+ tests ||= ARGV
+ tests = Dir.glob("#{File.dirname($0)}/test_*.rb").sort if tests.empty?
+ pathes = tests.map {|path| File.expand_path(path) }
+
+ @progress = %w[- \\ | /]
+ @progress_bs = "\b" * @progress[0].size
+ @tty = $stderr.tty? if @tty.nil?
+ case @color
+ when nil
+ @color = @tty && /dumb/ !~ ENV["TERM"]
+ end
+ @tty &&= !@verbose
+ if @color
+ # dircolors-like style
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
+ @reset = "\e[m"
+ else
+ @passed = @failed = @reset = ""
+ end
+ unless quiet
+ puts Time.now
+ if defined?(RUBY_DESCRIPTION)
+ puts "Driver is #{RUBY_DESCRIPTION}"
+ elsif defined?(RUBY_PATCHLEVEL)
+ puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}#{RUBY_PLATFORM}) [#{RUBY_PLATFORM}]"
+ else
+ puts "Driver is ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
+ end
+ puts "Target is #{`#{@ruby} -v`.chomp}"
+ puts
+ $stdout.flush
+ end
+
+ in_temporary_working_directory(dir) {
+ exec_test pathes
+ }
+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.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}"
+ else
+ msg = "FAIL #{@error-error}/#{@count-count}"
+ $stderr.print "#{@progress_bs}#{@failed}#{msg}#{@reset}"
+ @columns = 0
+ end
+ end
+ $stderr.puts unless @quiet and @tty and @error == error
+ 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"
+ end
+ exit true
+ else
+ @errbuf.each do |msg|
+ $stderr.puts msg
+ end
+ $stderr.puts "#{@failed}FAIL#{@reset} #{@error}/#{@count} tests failed"
+ exit false
+ end
+end
+
+def show_progress(message = '')
+ if @verbose
+ $stderr.print "\##{@count} #{@location} "
+ 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
+ else
+ $stderr.print "#{@failed}F"
+ $stderr.printf(" %.3f", t) if @verbose
+ $stderr.print "#{@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])
+ end
+ end
+rescue Interrupt
+ raise Interrupt
+rescue Exception => err
+ $stderr.print 'E'
+ $stderr.puts if @verbose
+ error err.message, message
+end
+
+# NativeClient is special. The binary is cross-compiled. But runs on the build environment.
+# So RUBY_PLATFORM in this process is not useful to detect it.
+def nacl?
+ @ruby and File.basename(@ruby.split(/\s/).first)['sel_ldr']
+end
+
+def assert_check(testsrc, message = '', opt = '')
+ show_progress(message) {
+ result = get_result_string(testsrc, opt)
+ check_coredump
+ yield(result)
+ }
+end
+
+def assert_equal(expected, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if expected == result
+ nil
+ else
+ desc = "#{result.inspect} (expected #{expected.inspect})"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_match(expected_pattern, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if expected_pattern =~ result
+ nil
+ else
+ desc = "#{expected_pattern.inspect} expected to be =~\n#{result.inspect}"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_not_match(unexpected_pattern, testsrc, message = '')
+ newtest
+ assert_check(testsrc, message) {|result|
+ if unexpected_pattern !~ result
+ nil
+ else
+ desc = "#{unexpected_pattern.inspect} expected to be !~\n#{result.inspect}"
+ pretty(testsrc, desc, result)
+ end
+ }
+end
+
+def assert_valid_syntax(testsrc, message = '')
+ newtest
+ assert_check(testsrc, message, '-c') {|result|
+ result if /Syntax OK/ !~ result
+ }
+end
+
+def assert_normal_exit(testsrc, *rest)
+ newtest
+ opt = {}
+ opt = rest.pop if Hash === rest.last
+ message, ignore_signals = rest
+ message ||= ''
+ timeout = opt[:timeout]
+ show_progress(message) {
+ faildesc = nil
+ filename = make_srcfile(testsrc)
+ old_stderr = $stderr.dup
+ timeout_signaled = false
+ begin
+ $stderr.reopen("assert_normal_exit.log", "w")
+ io = IO.popen("#{@ruby} -W0 #{filename}")
+ pid = io.pid
+ th = Thread.new {
+ io.read
+ io.close
+ $?
+ }
+ if !th.join(timeout)
+ Process.kill :KILL, pid
+ timeout_signaled = true
+ end
+ status = th.value
+ ensure
+ $stderr.reopen(old_stderr)
+ old_stderr.close
+ end
+ if status && status.signaled?
+ signo = status.termsig
+ signame = Signal.list.invert[signo]
+ unless ignore_signals and ignore_signals.include?(signame)
+ sigdesc = "signal #{signo}"
+ if signame
+ sigdesc = "SIG#{signame} (#{sigdesc})"
+ end
+ if timeout_signaled
+ sigdesc << " (timeout)"
+ end
+ faildesc = pretty(testsrc, "killed by #{sigdesc}", nil)
+ stderr_log = File.read("assert_normal_exit.log")
+ if !stderr_log.empty?
+ faildesc << "\n" if /\n\z/ !~ faildesc
+ stderr_log << "\n" if /\n\z/ !~ stderr_log
+ stderr_log.gsub!(/^.*\n/) { '| ' + $& }
+ faildesc << stderr_log
+ end
+ end
+ end
+ faildesc
+ }
+end
+
+def assert_finish(timeout_seconds, testsrc, message = '')
+ newtest
+ show_progress(message) {
+ faildesc = nil
+ filename = make_srcfile(testsrc)
+ io = IO.popen("#{@ruby} -W0 #{filename}")
+ pid = io.pid
+ waited = false
+ tlimit = Time.now + timeout_seconds
+ while Time.now < tlimit
+ if Process.waitpid pid, Process::WNOHANG
+ waited = true
+ break
+ end
+ sleep 0.1
+ end
+ if !waited
+ Process.kill(:KILL, pid)
+ Process.waitpid pid
+ faildesc = pretty(testsrc, "not finished in #{timeout_seconds} seconds", nil)
+ end
+ io.close
+ faildesc
+ }
+end
+
+def flunk(message = '')
+ newtest
+ show_progress('') { message }
+end
+
+def pretty(src, desc, result)
+ src = src.sub(/\A.*\n/, '')
+ (/\n/ =~ src ? "\n#{adjust_indent(src)}" : src) + " #=> #{desc}"
+end
+
+INDENT = 27
+
+def adjust_indent(src)
+ untabify(src).gsub(/^ {#{INDENT}}/o, '').gsub(/^/, ' ').sub(/\s*\z/, "\n")
+end
+
+def untabify(str)
+ str.gsub(/^\t+/) {' ' * (8 * $&.size) }
+end
+
+def make_srcfile(src)
+ filename = 'bootstraptest.tmp.rb'
+ File.open(filename, 'w') {|f|
+ f.puts "GC.stress = true" if $stress
+ f.puts "print(begin; #{src}; end)"
+ }
+ filename
+end
+
+def get_result_string(src, opt = '')
+ if @ruby
+ filename = make_srcfile(src)
+ begin
+ `#{@ruby} -W0 #{opt} #{filename}`
+ ensure
+ raise Interrupt if $? and $?.signaled? && $?.termsig == Signal.list["INT"]
+ raise CoreDumpError, "core dumped" if $? and $?.coredump?
+ end
+ else
+ eval(src).to_s
+ end
+end
+
+def with_stderr
+ out = err = nil
+ begin
+ r, w = IO.pipe
+ stderr = $stderr.dup
+ $stderr.reopen(w)
+ w.close
+ reader = Thread.start {r.read}
+ begin
+ out = yield
+ ensure
+ $stderr.reopen(stderr)
+ err = reader.value
+ end
+ ensure
+ w.close rescue nil
+ r.close rescue nil
+ end
+ return out, err
+end
+
+def newtest
+ @location = File.basename(caller(2).first)
+ @count += 1
+ cleanup_coredump
+end
+
+def error(msg, additional_message)
+ msg = "#{@failed}\##{@count} #{@location}#{@reset}: #{msg} #{additional_message}"
+ if @tty
+ $stderr.puts "#{erase}#{msg}"
+ else
+ @errbuf.push msg
+ end
+ @error += 1
+end
+
+def in_temporary_working_directory(dir)
+ if dir
+ Dir.mkdir dir
+ Dir.chdir(dir) {
+ yield
+ }
+ else
+ Dir.mktmpdir(["bootstraptest", ".tmpwd"]) {|d|
+ Dir.chdir(d) {
+ yield
+ }
+ }
+ end
+end
+
+def cleanup_coredump
+ FileUtils.rm_f 'core'
+ FileUtils.rm_f Dir.glob('core.*')
+ FileUtils.rm_f @ruby+'.stackdump' if @ruby
+end
+
+class CoreDumpError < StandardError; end
+
+def check_coredump
+ if File.file?('core') or not Dir.glob('core.*').empty? or
+ (@ruby and File.exist?(@ruby+'.stackdump'))
+ raise CoreDumpError, "core dumped"
+ end
+end
+
+main
diff --git a/bootstraptest/test_attr.rb b/bootstraptest/test_attr.rb
new file mode 100644
index 0000000000..721a847145
--- /dev/null
+++ b/bootstraptest/test_attr.rb
@@ -0,0 +1,36 @@
+assert_equal 'ok', %q{
+ module M
+ class A
+ class << self
+ attr_accessor :at
+ def workflow_rule
+ yield self
+ end
+
+ def eval_str(str)
+ eval(str)
+ end
+ end
+ end
+ end
+ begin
+ M::A.eval_str(<<-END)
+ workflow_rule do |r|
+ r.at 1
+ end
+ END
+ rescue ArgumentError => e
+ print "ok"
+ end
+}, '[ruby-core:14641]'
+
+assert_equal %{ok}, %{
+ class A
+ attr :m
+ end
+ begin
+ A.new.m(3)
+ rescue ArgumentError => e
+ print "ok"
+ end
+}, '[ruby-core:15120]'
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb
new file mode 100644
index 0000000000..a9f8e6dacd
--- /dev/null
+++ b/bootstraptest/test_autoload.rb
@@ -0,0 +1,70 @@
+assert_equal 'ok', %q{
+ File.unlink('zzz.rb') if File.file?('zzz.rb')
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ begin
+ ZZZ
+ rescue LoadError
+ :ok
+ end
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open('zzz.rb', 'w') {|f| f.puts '' }
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ begin
+ ZZZ
+ rescue NameError
+ :ok
+ end
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open('zzz.rb', 'w') {|f| f.puts 'class ZZZ; def self.ok;:ok;end;end'}
+ instance_eval do
+ autoload :ZZZ, './zzz.rb'
+ ZZZ.ok
+ end
+}, '[ruby-dev:43816]'
+
+assert_equal 'ok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ 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"
+ require "./zzz.rb"
+ ZZZ.ok
+}
+
+assert_equal 'okok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ t1 = Thread.new {ZZZ.ok}
+ t2 = Thread.new {ZZZ.ok}
+ [t1.value, t2.value].join
+}
+
+assert_finish 5, %q{
+ autoload :ZZZ, File.expand_path(__FILE__)
+ begin
+ ZZZ
+ rescue NameError
+ end
+}, '[ruby-core:21696]'
+
+assert_equal 'A::C', %q{
+ open("zzz.rb", "w") {}
+ class A
+ autoload :C, "./zzz"
+ class C
+ end
+ C
+ end
+}
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
new file mode 100644
index 0000000000..cdc5960a59
--- /dev/null
+++ b/bootstraptest/test_block.rb
@@ -0,0 +1,613 @@
+assert_equal %q{1}, %q{
+ 1.times{
+ begin
+ a = 1
+ ensure
+ foo = nil
+ end
+ }
+}
+assert_equal %q{2}, %q{
+ [1,2,3].find{|x| x == 2}
+}
+assert_equal %q{2}, %q{
+ class E
+ include Enumerable
+ def each(&block)
+ [1, 2, 3].each(&block)
+ end
+ end
+ E.new.find {|x| x == 2 }
+}
+assert_equal %q{6}, %q{
+ sum = 0
+ for x in [1, 2, 3]
+ sum += x
+ end
+ sum
+}
+assert_equal %q{15}, %q{
+ sum = 0
+ for x in (1..5)
+ sum += x
+ end
+ sum
+}
+assert_equal %q{0}, %q{
+ sum = 0
+ for x in []
+ sum += x
+ end
+ sum
+}
+assert_equal %q{1}, %q{
+ ans = []
+ 1.times{
+ for n in 1..3
+ a = n
+ ans << a
+ end
+ }
+}
+assert_equal %q{1..3}, %q{
+ ans = []
+ for m in 1..3
+ for n in 1..3
+ a = [m, n]
+ ans << a
+ end
+ end
+}
+assert_equal %q{[1, 2, 3]}, %q{
+ (1..3).to_a
+}
+assert_equal %q{[4, 8, 12]}, %q{
+ (1..3).map{|e|
+ e * 4
+ }
+}
+assert_equal %q{[1, 2, 3]}, %q{
+ class C
+ include Enumerable
+ def each
+ [1,2,3].each{|e|
+ yield e
+ }
+ end
+ end
+
+ C.new.to_a
+}
+assert_equal %q{[4, 5, 6]}, %q{
+ class C
+ include Enumerable
+ def each
+ [1,2,3].each{|e|
+ yield e
+ }
+ end
+ end
+
+ C.new.map{|e|
+ e + 3
+ }
+}
+assert_equal %q{100}, %q{
+ def m
+ yield
+ end
+ def n
+ yield
+ end
+
+ m{
+ n{
+ 100
+ }
+ }
+}
+assert_equal %q{20}, %q{
+ def m
+ yield 1
+ end
+
+ m{|ib|
+ m{|jb|
+ i = 20
+ }
+ }
+}
+assert_equal %q{2}, %q{
+ def m
+ yield 1
+ end
+
+ m{|ib|
+ m{|jb|
+ ib = 20
+ kb = 2
+ }
+ }
+}
+assert_equal %q{3}, %q{
+ def iter1
+ iter2{
+ yield
+ }
+ end
+
+ def iter2
+ yield
+ end
+
+ iter1{
+ jb = 2
+ iter1{
+ jb = 3
+ }
+ jb
+ }
+}
+assert_equal %q{2}, %q{
+ def iter1
+ iter2{
+ yield
+ }
+ end
+
+ def iter2
+ yield
+ end
+
+ iter1{
+ jb = 2
+ iter1{
+ jb
+ }
+ jb
+ }
+}
+assert_equal %q{2}, %q{
+ def m
+ yield 1
+ end
+ m{|ib|
+ ib*2
+ }
+}
+assert_equal %q{92580}, %q{
+ def m
+ yield 12345, 67890
+ end
+ m{|ib,jb|
+ ib*2+jb
+ }
+}
+assert_equal %q{[10, nil]}, %q{
+ def iter
+ yield 10
+ end
+
+ a = nil
+ [iter{|a|
+ a
+ }, a]
+}
+assert_equal %q{21}, %q{
+ def iter
+ yield 10
+ end
+
+ iter{|a|
+ iter{|a|
+ a + 1
+ } + a
+ }
+}
+assert_equal %q{[10, 20, 30, 40, nil, nil, nil, nil]}, %q{
+ def iter
+ yield 10, 20, 30, 40
+ end
+
+ a = b = c = d = nil
+ iter{|a, b, c, d|
+ [a, b, c, d]
+ } + [a, b, c, d]
+}
+assert_equal %q{[10, 20, 30, 40, nil, nil]}, %q{
+ def iter
+ yield 10, 20, 30, 40
+ end
+
+ a = b = nil
+ iter{|a, b, c, d|
+ [a, b, c, d]
+ } + [a, b]
+}
+assert_equal %q{[1]}, %q{
+ $a = []
+
+ def iter
+ yield 1
+ end
+
+ def m
+ x = iter{|x|
+ $a << x
+ y = 0
+ }
+ end
+ m
+ $a
+}
+assert_equal %q{[1, [2]]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, *b|
+ [a, b]
+ }
+}
+assert_equal %q{[[1, 2]]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|*a|
+ [a]
+ }
+}
+assert_equal %q{[1, 2, []]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, b, *c|
+ [a, b, c]
+ }
+}
+assert_equal %q{[1, 2, nil, []]}, %q{
+ def iter
+ yield 1, 2
+ end
+
+ iter{|a, b, c, *d|
+ [a, b, c, d]
+ }
+}
+assert_equal %q{1}, %q{
+ def m
+ yield
+ end
+ m{
+ 1
+ }
+}
+assert_equal %q{15129}, %q{
+ def m
+ yield 123
+ end
+ m{|ib|
+ m{|jb|
+ ib*jb
+ }
+ }
+}
+assert_equal %q{2}, %q{
+ def m a
+ yield a
+ end
+ m(1){|ib|
+ m(2){|jb|
+ ib*jb
+ }
+ }
+}
+assert_equal %q{9}, %q{
+ sum = 0
+ 3.times{|ib|
+ 2.times{|jb|
+ sum += ib + jb
+ }}
+ sum
+}
+assert_equal %q{10}, %q{
+ 3.times{|bl|
+ break 10
+ }
+}
+assert_equal %q{[1, 2]}, %q{
+ def iter
+ yield 1,2,3
+ end
+
+ iter{|i, j|
+ [i, j]
+ }
+}
+assert_equal %q{[1, nil]}, %q{
+ def iter
+ yield 1
+ end
+
+ iter{|i, j|
+ [i, j]
+ }
+}
+
+assert_equal '0', %q{
+def m()
+end
+m {|(v0,*,(*)),|}
+m {|(*v0,(*)),|}
+m {|(v0,*v1,(*)),|}
+m {|((v0,*v1,v2)),|}
+m {|(v0,*v1,v2),|}
+m {|(v0,*v1,(v2)),|}
+m {|((*),*v0,v1),|}
+m {|((v0),*v1,v2),|}
+m {|(v0,v1,*v2,v3),|}
+m {|v0,(v1,*v2,v3),|}
+m {|(v0,*v1,v2),v3,|}
+m {|(v0,*v1,v2)|}
+m {|(v0,*v1,v2),&v3|}
+m {|(v0,*v1,v2),*|}
+m {|(v0,*v1,v2),*,&v3|}
+m {|*,(v0,*v1,v2)|}
+m {|*,(v0,*v1,v2),&v3|}
+m {|v0,*,(v1,*v2,v3)|}
+m {|v0,*,(v1,*v2,v3),&v4|}
+m {|(v0,*v1,v2),*,v3|}
+m {|(v0,*v1,v2),*,v3,&v4|}
+m {|(v0, *v1, v2)|}
+m {|(*,v)|}
+0
+}, "block parameter (shouldn't SEGV: [ruby-dev:31143])"
+
+assert_equal 'nil', %q{
+ def m
+ yield
+ end
+ m{|&b| b}.inspect
+}, '[ruby-dev:31147]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|(v,(*))|}.inspect
+}, '[ruby-dev:31160]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|(*,a,b)|}.inspect
+}, '[ruby-dev:31153]'
+
+assert_equal 'nil', %q{
+ def m()
+ yield
+ end
+ m {|((*))|}.inspect
+}
+
+assert_equal %q{[1, 1, [1, nil], [1, nil], [1, nil], [1, nil], [1, 1], 1, [1, nil], [1, nil], [1, nil], [1, nil], [[1, 1], [1, 1]], [1, 1], [1, 1], [1, 1], [1, nil], [1, nil], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [1, 1], [1, 1], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]]]}, %q{
+def m(ary = [])
+ yield(ary)
+end
+
+$ans = []
+o = 1
+5.times{
+ v,(*) = o; $ans << o
+ m(o){|(v,(*))| $ans << v}
+ ((x, y)) = o; $ans << [x, y]
+ m(o){|((x, y))| $ans << [x, y]}
+ (((x, y))) = o; $ans << [x, y]
+ m(o){|(((x, y)))| $ans << [x, y]}
+ o = [o, o]
+}; $ans
+}
+
+assert_equal '0', %q{
+ def m()
+ yield [0]
+ end
+ m {|*,v| v}.inspect
+}, '[ruby-dev:31437]'
+assert_equal '[0]', %q{
+ def m
+ yield [0]
+ end
+ m{|v, &b| v}.inspect
+}, '[ruby-dev:31440]'
+assert_equal 'ok', %q{
+ begin
+ lambda{|a|}.call(1, 2)
+ rescue ArgumentError
+ :ok
+ else
+ :ng
+ end
+}, '[ruby-dev:31464]'
+assert_equal 'ok', %q{
+ begin
+ lambda{|&b|}.call(3)
+ rescue ArgumentError
+ :ok
+ else
+ :ng
+ end
+}, '[ruby-dev:31472]'
+assert_equal 'ok', %q{
+ class C
+ def each
+ yield [1,2]
+ yield 1,2
+ end
+ end
+ vs1 = []
+ C.new.each {|*v| vs1 << v }
+ vs2 = []
+ C.new.to_enum.each {|*v| vs2 << v }
+ vs1 == vs2 ? :ok : :ng
+}, '[ruby-dev:32329]'
+
+assert_normal_exit %q{
+ e = [1,2,3].each
+ 10000.times {
+ e = [e].each
+ }
+ Thread.new { GC.start }.join
+}, '[ruby-dev:32604]'
+
+
+assert_equal '[nil, []]', %q{
+ def m() yield nil,[] end
+ l = lambda {|*v| v}
+ GC.stress=true
+ r = m(&l)
+ GC.stress=false
+ r.inspect
+}, '[ruby-dev:32567]'
+
+assert_equal NilClass.to_s, %q{
+ r = false; 1.times{|&b| r = b}; r.class
+}
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:foo) do |arg, &block|
+ if block then block.call else arg end
+ end
+ end
+ C.new.foo("ng") {"ok"}
+}, '[ruby-talk:266422]'
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:xyz) do |o, k, &block|
+ block.call(o, k)
+ end
+ end
+ C.new.xyz("o","k") {|o, k| o+k}
+}, '[ruby-core:20544]'
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:xyz) do |*args, &block|
+ block.call(*args)
+ end
+ end
+ C.new.xyz("o","k") {|*args| args.join("")}
+}, '[ruby-core:20544]'
+
+assert_equal 'ok', %q{
+ STDERR.reopen(STDOUT)
+ class C
+ define_method(:foo) do |&block|
+ block.call if block
+ end
+ result = "ng"
+ new.foo() {result = "ok"}
+ result
+ end
+}
+
+assert_equal "ok", %q{
+ class Bar
+ def bar; :ok; end
+ end
+ def foo
+ yield(Bar.new) if block_given?
+ end
+ foo(&:bar)
+}, '[ruby-core:14279]'
+
+assert_normal_exit %q{
+ class Controller
+ def respond_to(&block)
+ responder = Responder.new
+ block.call(responder)
+ responder.respond
+ end
+ def test_for_bug
+ respond_to{|format|
+ format.js{
+ puts "in test"
+ render{|obj|
+ puts obj
+ }
+ }
+ }
+ end
+ def render(&block)
+ puts "in render"
+ end
+ end
+
+ class Responder
+ def method_missing(symbol, &block)
+ puts "enter method_missing"
+ @response = Proc.new{
+ puts 'in method missing'
+ block.call
+ }
+ puts "leave method_missing"
+ end
+ def respond
+ @response.call
+ end
+ end
+ t = Controller.new
+ t.test_for_bug
+}, '[ruby-core:14395]'
+
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super
+ end
+ end
+
+ C1.new.foo{}
+}
+
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super()
+ end
+ end
+
+ 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
new file mode 100644
index 0000000000..b7fe0a1acd
--- /dev/null
+++ b/bootstraptest/test_class.rb
@@ -0,0 +1,169 @@
+# class
+assert_equal 'true', %q( class C; end
+ Object.const_defined?(:C) )
+assert_equal 'Class', %q( class C; end
+ C.class )
+assert_equal 'C', %q( class C; end
+ C.name )
+assert_equal 'C', %q( class C; end
+ C.new.class )
+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
+ class C < A; end
+ Object.const_defined?(:C) )
+assert_equal 'Class', %q( class A; end
+ class C < A; end
+ C.class )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.name )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.new.class )
+assert_equal 'C', %q( class A; end
+ class C < A; end
+ C.new.class.name )
+assert_equal 'Class', %q( class A; end
+ class C < A; end
+ C.new.class.class )
+
+# module
+assert_equal 'true', %q( module M; end
+ Object.const_defined?(:M) )
+assert_equal 'Module', %q( module M; end
+ M.class )
+assert_equal 'M', %q( module M; end
+ M.name )
+assert_equal 'C', %q( module M; end
+ class C; include M; end
+ C.new.class )
+
+# nested class
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B )
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B.name )
+assert_equal 'A::B', %q( class A; end
+ class A::B; end
+ A::B.new.class )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ A::B.new.class.class )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.name )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.class )
+assert_equal 'A::B::C', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.new.class )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B::C; end
+ A::B::C.new.class.class )
+assert_equal 'A::B2', %q( class A; end
+ class A::B; end
+ class A::B2 < A::B; end
+ A::B2 )
+assert_equal 'Class', %q( class A; end
+ class A::B; end
+ class A::B2 < A::B; end
+ A::B2.class )
+
+# reopen
+assert_equal 'true', %q( class C; end; c1 = ::C
+ class C; end; c2 = ::C
+ c1.equal?(c2) )
+assert_equal '1', %q( class C; end
+ class A; end
+ begin class C < A; end; rescue TypeError; 1 end )
+assert_equal '1', %q( class C; end
+ begin module C; end; rescue TypeError; 1 end )
+assert_equal '1', %q( C = 1 # [yarv-dev:782]
+ begin class C; end; rescue TypeError; 1 end )
+assert_equal '1', %q( C = 1 # [yarv-dev:800]
+ begin module C; end; rescue TypeError; 1 end )
+
+# colon2, colon3
+assert_equal '1', %q( class A; end; A::C = 1; A::C )
+assert_equal '1', %q( A = 7; begin A::C = 7; rescue TypeError; 1 end )
+assert_equal '1', %q( begin 7::C = 7; rescue TypeError; 1 end )
+assert_equal 'C', %q( class A; class ::C; end end; C )
+assert_equal 'Class', %q( class A; class ::C; end end; C.class )
+assert_equal 'OK', %q( class A; ::C = "OK"; end; C )
+assert_equal 'String', %q( class A; ::C = "OK"; end; C.class )
+
+# class/module dup
+assert_equal 'Class', %q( class C; end; C.dup.class )
+assert_equal 'Module', %q( module M; end; M.dup.class )
+
+
+assert_equal "ok", %q{
+ module Foo
+ end
+
+ begin
+ def foo(&b)
+ Foo.module_eval &b
+ end
+ foo{
+ def bar
+ end
+ }
+ bar()
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:14378]'
+
+assert_equal '3', %q{
+ $i = 0
+ class C
+ def self.const_missing *args
+ $i+=1
+ end
+ end
+
+ 3.times{
+ C::FOO
+ }
+ $i
+}
+
+assert_match /::C\z/, %q{
+ c = nil
+ Module.new{|m| c = class m::C; name; end}
+ c
+}, '[ruby-dev:38456]'
+
+assert_normal_exit %q{
+ s = Symbol.dup
+ class << s
+ end
+ s.allocate.to_s
+}, '[ruby-core:30843]'
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
new file mode 100644
index 0000000000..bf7478006d
--- /dev/null
+++ b/bootstraptest/test_eval.rb
@@ -0,0 +1,324 @@
+assert_equal %q{ok}, %q{
+ def m
+ a = :ok
+ $b = binding
+ end
+ m
+ eval('a', $b)
+}
+assert_equal %q{[:ok, :ok2]}, %q{
+ def m
+ a = :ok
+ $b = binding
+ end
+ m
+ eval('b = :ok2', $b)
+ eval('[a, b]', $b)
+}
+assert_equal %q{[nil, 1]}, %q{
+ $ans = []
+ def m
+ $b = binding
+ end
+ m
+ $ans << eval(%q{
+ $ans << eval(%q{
+ a
+ }, $b)
+ a = 1
+ }, $b)
+ $ans
+}
+assert_equal %q{C}, %q{
+ Const = :top
+ class C
+ Const = :C
+ def m
+ binding
+ end
+ end
+ eval('Const', C.new.m)
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ a = 1
+ class C
+ Const = :C
+ def m
+ eval('Const', TOPLEVEL_BINDING)
+ end
+ end
+ C.new.m
+}
+assert_equal %q{:ok
+ok}, %q{
+ class C
+ $b = binding
+ end
+ eval %q{
+ def m
+ :ok
+ end
+ }, $b
+ p C.new.m
+}
+assert_equal %q{ok}, %q{
+ b = proc{
+ a = :ok
+ binding
+ }.call
+ a = :ng
+ eval("a", b)
+}
+assert_equal %q{C}, %q{
+ class C
+ def foo
+ binding
+ end
+ end
+ C.new.foo.eval("self.class.to_s")
+}
+assert_equal %q{1}, %q{
+ eval('1')
+}
+assert_equal %q{1}, %q{
+ eval('a=1; a')
+}
+assert_equal %q{1}, %q{
+ a = 1
+ eval('a')
+}
+assert_equal %q{ok}, %q{
+ __send__ :eval, %{
+ :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ 1.__send__ :instance_eval, %{
+ :ok
+ }
+}
+assert_equal %q{1}, %q{
+ 1.instance_eval{
+ self
+ }
+}
+assert_equal %q{foo}, %q{
+ 'foo'.instance_eval{
+ self
+ }
+}
+assert_equal %q{1}, %q{
+ class Fixnum
+ Const = 1
+ end
+ 1.instance_eval %{
+ Const
+ }
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.module_eval{
+ Const
+ }
+}
+assert_equal %q{C}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.class_eval %{
+ def m
+ Const
+ end
+ }
+ C.new.m
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ C.class_eval{
+ def m
+ Const
+ end
+ }
+ C.new.m
+}
+assert_equal %q{[:top, :C, :top, :C]}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ $nest = false
+ $ans = []
+ def m
+ $ans << Const
+ C.module_eval %{
+ $ans << Const
+ Boo = false unless defined? Boo
+ unless $nest
+ $nest = true
+ m
+ end
+ }
+ end
+ m
+ $ans
+}
+assert_equal %q{[10, main]}, %q{
+ $nested = false
+ $ans = []
+ $pr = proc{
+ $ans << self
+ unless $nested
+ $nested = true
+ $pr.call
+ end
+ }
+ class C
+ def initialize &b
+ 10.instance_eval(&b)
+ end
+ end
+ C.new(&$pr)
+ $ans
+}
+
+%w[break next redo].each do |keyword|
+ assert_match %r"Can't escape from eval with #{keyword}\z", %{
+ begin
+ eval "0 rescue #{keyword}"
+ rescue SyntaxError => e
+ e.message
+ end
+ }, '[ruby-dev:31372]'
+end
+
+assert_normal_exit %q{
+ STDERR.reopen(STDOUT)
+ class Foo
+ def self.add_method
+ class_eval("def some-bad-name; puts 'hello' unless @some_variable.some_function(''); end")
+ end
+ end
+ Foo.add_method
+}, '[ruby-core:14556] reported by Frederick Cheung'
+
+assert_equal 'ok', %q{
+ class Module
+ def my_module_eval(&block)
+ module_eval(&block)
+ end
+ end
+ class String
+ Integer.my_module_eval do
+ def hoge; end
+ end
+ end
+ if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
+ !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
+ :ok
+ else
+ :ng
+ end
+}, "[ruby-dev:34236]"
+
+assert_equal 'ok', %q{
+ begin
+ eval("class nil::Foo; end")
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ begin
+ 0.instance_eval { def m() :m end }
+ 1.m
+ :ng
+ rescue Exception
+ :ok
+ end
+}, '[ruby-dev:34579]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_eval { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_exec { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ nil.instance_eval {
+ def defd_using_instance_eval() :ok end
+ }
+ nil.defd_using_instance_eval
+}, '[ruby-core:28324]'
+
+assert_equal 'ok', %q{
+ nil.instance_exec {
+ def defd_using_instance_exec() :ok end
+ }
+ nil.defd_using_instance_exec
+}, '[ruby-core:28324]'
+
+assert_normal_exit %q{
+ eval("", method(:proc).call {}.binding)
+}
+
+assert_equal "", %q{
+ b = binding
+ 10.times{
+ eval('', b)
+ }
+ begin
+ eval('1.times{raise}', b)
+ rescue => e
+ e.message
+ end
+}, '[ruby-dev:35392]'
+
+assert_equal "[:x]", %q{
+ def kaboom!
+ yield.eval("local_variables")
+ end
+
+ for x in enum_for(:kaboom!)
+ binding
+ end
+}, '[ruby-core:25125]'
+
+assert_normal_exit %q{
+ hash = {}
+ ("aaaa".."matz").each_with_index do |s, i|
+ hash[s] = i
+ end
+ begin
+ eval "class C; @@h = #{hash.inspect}; end"
+ end
+}, '[ruby-core:25714]'
+
+assert_normal_exit %q{
+ begin
+ eval("# encoding:utf-16le\nfoo")
+ rescue Exception => e
+ p e
+ RubyVM::InstructionSequence.compile("p:hello")
+ end
+}, 'check escaping the internal value th->base_block'
+
diff --git a/bootstraptest/test_exception.rb b/bootstraptest/test_exception.rb
new file mode 100644
index 0000000000..35c8d25e37
--- /dev/null
+++ b/bootstraptest/test_exception.rb
@@ -0,0 +1,432 @@
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ ensure
+ 2+2
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ ensure
+ 3+3
+ end
+ ensure
+ 4+4
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ ensure
+ 3+3
+ end
+ ensure
+ 4+4
+ begin
+ 5+5
+ ensure
+ 6+6
+ end
+ end
+}
+assert_equal %q{NilClass}, %q{
+ a = nil
+ 1.times{|e|
+ begin
+ rescue => err
+ end
+ a = err.class
+ }
+ a
+}
+assert_equal %q{RuntimeError}, %q{
+ a = nil
+ 1.times{|e|
+ begin
+ raise
+ rescue => err
+ end
+ a = err.class
+ }
+ a
+}
+assert_equal %q{}, %q{
+ $!
+}
+assert_equal %q{FOO}, %q{
+ begin
+ raise "FOO"
+ rescue
+ $!
+ end
+}
+assert_equal %q{FOO}, %q{
+ def m
+ $!
+ end
+ begin
+ raise "FOO"
+ rescue
+ m()
+ end
+}
+assert_equal %q{[#<RuntimeError: BAR>, #<RuntimeError: FOO>]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+ begin
+ raise "FOO"
+ rescue
+ begin
+ raise "BAR"
+ rescue
+ $ans << m()
+ end
+ $ans << m()
+ end
+ $ans
+}
+assert_equal %q{[#<RuntimeError: FOO>, #<RuntimeError: FOO>]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+
+ begin
+ begin
+ raise "FOO"
+ ensure
+ $ans << m()
+ end
+ rescue
+ $ans << m()
+ end
+}
+assert_equal %q{[nil]}, %q{
+ $ans = []
+ def m
+ $!
+ end
+ def m2
+ 1.times{
+ begin
+ return
+ ensure
+ $ans << m
+ end
+ }
+ end
+ m2
+ $ans
+}
+assert_equal %q{ok}, %q{
+ begin
+ raise
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ begin
+ raise
+ rescue
+ :ok
+ ensure
+ :ng
+ end
+}
+assert_equal %q{RuntimeError}, %q{
+ begin
+ raise
+ rescue => e
+ e.class
+ end
+}
+assert_equal %q{ng}, %q{
+ begin
+ raise
+ rescue StandardError
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+assert_equal %q{c}, %q{
+ begin
+ begin
+ raise "a"
+ rescue
+ raise "b"
+ ensure
+ raise "c"
+ end
+ rescue => e
+ e.message
+ end
+}
+assert_equal %q{33}, %q{
+ def m a, b
+ a + b
+ end
+ m(1, begin
+ raise
+ rescue
+ 2
+ end) +
+ m(10, begin
+ raise
+ rescue
+ 20
+ ensure
+ 30
+ end)
+}
+assert_equal %q{3}, %q{
+ def m a, b
+ a + b
+ end
+ m(begin
+ raise
+ rescue
+ 1
+ end,
+ begin
+ raise
+ rescue
+ 2
+ end)
+}
+assert_equal %q{ok3}, %q{
+ class E1 < Exception
+ end
+
+ def m
+ yield
+ end
+
+ begin
+ begin
+ begin
+ m{
+ raise
+ }
+ rescue E1
+ :ok2
+ ensure
+ end
+ rescue
+ :ok3
+ ensure
+ end
+ rescue E1
+ :ok
+ ensure
+ end
+}
+assert_equal %q{7}, %q{
+ $i = 0
+ def m
+ iter{
+ begin
+ $i += 1
+ begin
+ $i += 2
+ break
+ ensure
+
+ end
+ ensure
+ $i += 4
+ end
+ $i = 0
+ }
+ end
+
+ def iter
+ yield
+ end
+ m
+ $i
+}
+assert_equal %q{10}, %q{
+ $i = 0
+ def m
+ begin
+ $i += 1
+ begin
+ $i += 2
+ return
+ ensure
+ $i += 3
+ end
+ ensure
+ $i += 4
+ end
+ p :end
+ end
+ m
+ $i
+}
+assert_equal %q{1}, %q{
+ begin
+ 1
+ rescue
+ 2
+ end
+}
+assert_equal %q{4}, %q{
+ begin
+ 1
+ begin
+ 2
+ rescue
+ 3
+ end
+ 4
+ rescue
+ 5
+ end
+}
+assert_equal %q{3}, %q{
+ begin
+ 1
+ rescue
+ 2
+ else
+ 3
+ end
+}
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ ensure
+ 3+3
+ end
+ }
+assert_equal %q{2}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ ensure
+ 3+3
+ end
+ }
+assert_equal %q{6}, %q{
+ begin
+ 1+1
+ rescue
+ 2+2
+ else
+ 3+3
+ ensure
+ 4+4
+ end
+ }
+assert_equal %q{12}, %q{
+ begin
+ 1+1
+ begin
+ 2+2
+ rescue
+ 3+3
+ else
+ 4+4
+ end
+ rescue
+ 5+5
+ else
+ 6+6
+ ensure
+ 7+7
+ end
+ }
+assert_equal %q{ok}, %q{ #
+ proc{
+ begin
+ raise
+ break
+ rescue
+ :ok
+ end
+ }.call
+}
+assert_equal %q{}, %q{
+ proc do
+ begin
+ raise StandardError
+ redo
+ rescue StandardError
+ end
+ end.call
+}
+
+##
+assert_match /undefined method `foo\'/, %q{#`
+ STDERR.reopen(STDOUT)
+ class C
+ def inspect
+ bar {}
+ end
+
+ def bar
+ raise
+ ensure
+ end
+ end
+ C.new.foo
+}, "[ruby-dev:31407]"
+
+assert_equal 'nil', %q{
+ doit = false
+ exc = nil
+ t = Thread.new {
+ begin
+ doit = true
+ sleep 10
+ ensure
+ exc = $!
+ end
+ }
+ Thread.pass until doit
+ t.kill
+ t.join
+ exc.inspect
+}, '[ruby-dev:32608]'
+
+assert_equal 'exception class/object expected', %q{
+ class ZeroDivisionError
+ def self.new(message)
+ 42
+ end
+ end
+ begin
+ 1/0
+ rescue Exception => e
+ e.message
+ end
+}, '[ruby-core:24767]'
+
+assert_equal 'ok', %q{
+ class C
+ def ===(o)
+ true
+ end
+ end
+ begin
+ begin
+ raise
+ rescue C.new
+ end
+ rescue TypeError
+ :ok
+ end
+}
diff --git a/bootstraptest/test_finalizer.rb b/bootstraptest/test_finalizer.rb
new file mode 100644
index 0000000000..22a16b1220
--- /dev/null
+++ b/bootstraptest/test_finalizer.rb
@@ -0,0 +1,8 @@
+assert_normal_exit %q{
+a1,a2,b1,b2=Array.new(4){""}
+ObjectSpace.define_finalizer(b2,proc{})
+ObjectSpace.define_finalizer(b1,proc{b1.inspect})
+
+ObjectSpace.define_finalizer(a2,proc{a1.inspect})
+ObjectSpace.define_finalizer(a1,proc{})
+}, '[ruby-dev:35778]'
diff --git a/bootstraptest/test_flip.rb b/bootstraptest/test_flip.rb
new file mode 100644
index 0000000000..ff194868b2
--- /dev/null
+++ b/bootstraptest/test_flip.rb
@@ -0,0 +1 @@
+assert_equal %q{E}, %q{$_ = "E"; eval("nil if true..~/^E/",nil,"-e"); $_}
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
new file mode 100644
index 0000000000..0390062a24
--- /dev/null
+++ b/bootstraptest/test_flow.rb
@@ -0,0 +1,591 @@
+assert_equal %q{[1, 2, 4, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each{; $a << 2
+ break; $a << 3
+ }; $a << 4
+ begin; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 6, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ [1,2].each do; $a << 3
+ break; $a << 4
+ end; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{ok}, %q{
+ ["a"].inject("ng"){|x,y|
+ break :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ unless ''.respond_to? :lines
+ class String
+ def lines
+ self
+ end
+ end
+ end
+
+ ('a').lines.map{|e|
+ break :ok
+ }
+}
+assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
+ ["a"].inject("ng"){|x,y|; $a << 2
+ break :ok; $a << 3
+ }; $a << 4
+; $a << 5
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 4, 5]}, %q{$a = []; begin; ; $a << 1
+ ('a'..'b').map{|e|; $a << 2
+ break :ok; $a << 3
+ }; $a << 4
+; $a << 5
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 9, 10]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ ensure; $a << 6
+ break; $a << 7
+ end; $a << 8
+ end; $a << 9
+; $a << 10
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ raise; $a << 6
+ ensure; $a << 7
+ break; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 7, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ begin; $a << 5
+ raise; $a << 6
+ rescue; $a << 7
+ break; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ raise StandardError; $a << 4
+ ensure; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ raise StandardError; $a << 4
+ rescue; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 6, 8, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ begin; $a << 4
+ break; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+ ensure; $a << 8
+ end; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ begin; $a << 8
+ raise; $a << 9
+ rescue; $a << 10
+ break; $a << 11
+ end; $a << 12
+ end; $a << 13
+ end; $a << 14
+; $a << 15
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ 1.times{; $a << 8
+ begin; $a << 9
+ raise; $a << 10
+ rescue; $a << 11
+ break; $a << 12
+ end; $a << 13
+ }; $a << 14
+ end; $a << 15
+ end; $a << 16
+; $a << 17
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 3, 4, 5, 6, 7, 8, 10, 13, 14, 15]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ begin; $a << 8
+ raise; $a << 9
+ ensure; $a << 10
+ break; $a << 11
+ end; $a << 12
+ end; $a << 13
+ end; $a << 14
+; $a << 15
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 3, 4, 5, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 6, 7, 8, 9, 11, 14, 15, 16, 17]}, %q{$a = []; begin; ; $a << 1
+ i = 0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ j = 0; $a << 5
+ while j<3; $a << 6
+ j+=1; $a << 7
+ 1.times{; $a << 8
+ begin; $a << 9
+ raise; $a << 10
+ ensure; $a << 11
+ break; $a << 12
+ end; $a << 13
+ }; $a << 14
+ end; $a << 15
+ end; $a << 16
+; $a << 17
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ break; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 99]}, %q{
+$a = [];
+begin; ; $a << 1
+ while true; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ raise; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 6, 8, 9, 10, 11]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ [1,2].each do; $a << 3
+ begin; $a << 4
+ break; $a << 5
+ ensure; $a << 6
+ end; $a << 7
+ end; $a << 8
+ ensure; $a << 9
+ end; $a << 10
+; $a << 11
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 4, 99]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ raise StandardError; $a << 3
+ ensure; $a << 4
+ end; $a << 5
+; $a << 6
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4]}, %q{$a = []; begin; ; $a << 1
+ begin; $a << 2
+ ensure; $a << 3
+ end ; $a << 4
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 5, 99]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ break; $a << 4
+ ensure; $a << 5
+ raise StandardError; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{3}, %q{
+ def m a, b
+ a + b
+ end
+ m(1,
+ while true
+ break 2
+ end
+ )
+}
+assert_equal %q{4}, %q{
+ def m a, b
+ a + b
+ end
+ m(1,
+ (i=0; while i<2
+ i+=1
+ class C
+ next 2
+ end
+ end; 3)
+ )
+}
+assert_equal %q{34}, %q{
+ def m a, b
+ a+b
+ end
+ m(1, 1.times{break 3}) +
+ m(10, (1.times{next 3}; 20))
+}
+assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ break; $a << 4
+ end; $a << 5
+ }; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class A; $a << 3
+ class B; $a << 4
+ break; $a << 5
+ end; $a << 6
+ end; $a << 7
+ }; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 2, 3, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ next; $a << 4
+ end; $a << 5
+ }; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ 3.times{; $a << 2
+ class C; $a << 3
+ class D; $a << 4
+ next; $a << 5
+ end; $a << 6
+ end; $a << 7
+ }; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 6, 7]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ class C; $a << 3
+ break; $a << 4
+ end; $a << 5
+ end; $a << 6
+; $a << 7
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ while true; $a << 2
+ class C; $a << 3
+ class D; $a << 4
+ break; $a << 5
+ end; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ i=0; $a << 2
+ while i<3; $a << 3
+ i+=1; $a << 4
+ class C; $a << 5
+ next 10; $a << 6
+ end; $a << 7
+ end; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{1}, %q{
+ 1.times{
+ while true
+ class C
+ begin
+ break
+ ensure
+ break
+ end
+ end
+ end
+ }
+}
+assert_equal %q{[1, 2, 3, 5, 2, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ [1,2].each do; $a << 2
+ begin; $a << 3
+ next; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ end; $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 2, 6, 3, 5, 7, 8]}, %q{$a = []; begin; ; $a << 1
+ o = "test"; $a << 2
+ def o.test(a); $a << 3
+ return a; $a << 4
+ ensure; $a << 5
+ end; $a << 6
+ o.test(123); $a << 7
+; $a << 8
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 4, 7, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
+ def m1 *args; $a << 2
+ ; $a << 3
+ end; $a << 4
+ def m2; $a << 5
+ m1(:a, :b, (return 1; :c)); $a << 6
+ end; $a << 7
+ m2; $a << 8
+; $a << 9
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 8, 2, 3, 4, 5, 9, 10]}, %q{$a = []; begin; ; $a << 1
+ def m(); $a << 2
+ begin; $a << 3
+ 2; $a << 4
+ ensure; $a << 5
+ return 3; $a << 6
+ end; $a << 7
+ end; $a << 8
+ m; $a << 9
+; $a << 10
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 3, 11, 4, 5, 6, 7, 12, 13]}, %q{$a = []; begin; ; $a << 1
+ def m2; $a << 2
+ end; $a << 3
+ def m(); $a << 4
+ m2(begin; $a << 5
+ 2; $a << 6
+ ensure; $a << 7
+ return 3; $a << 8
+ end); $a << 9
+ 4; $a << 10
+ end; $a << 11
+ m(); $a << 12
+; $a << 13
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[1, 16, 2, 3, 4, 5, 6, 7, 10, 11, 17, 18]}, %q{$a = []; begin; ; $a << 1
+ def m; $a << 2
+ 1; $a << 3
+ 1.times{; $a << 4
+ 2; $a << 5
+ begin; $a << 6
+ 3; $a << 7
+ return; $a << 8
+ 4; $a << 9
+ ensure; $a << 10
+ 5; $a << 11
+ end; $a << 12
+ 6; $a << 13
+ }; $a << 14
+ 7; $a << 15
+ end; $a << 16
+ m(); $a << 17
+; $a << 18
+; rescue Exception; $a << 99; end; $a}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ i+=1
+ begin
+ begin
+ next
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ i+=1
+ begin
+ begin
+ break
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %q{[:ok, :ok2, :last]}, %q{
+ a = []
+ i = 0
+ begin
+ while i < 1
+ if i>0
+ break
+ end
+ i+=1
+ begin
+ begin
+ redo
+ ensure
+ a << :ok
+ end
+ ensure
+ a << :ok2
+ end
+ end
+ ensure
+ a << :last
+ end
+ a
+}
+assert_equal %Q{ENSURE\n}, %q{
+ def test
+ while true
+ return
+ end
+ ensure
+ puts("ENSURE")
+ end
+ test
+}, '[ruby-dev:37967]'
+
+[['[ruby-core:28129]', %q{
+ class Bug2728
+ include Enumerable
+ define_method(:dynamic_method) do
+ "dynamically defined method"
+ end
+ def each
+ begin
+ yield :foo
+ ensure
+ dynamic_method
+ end
+ end
+ end
+ e = Bug2728.new
+}],
+ ['[ruby-core:28132]', %q{
+ class Bug2729
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc {}.call
+ end
+ end
+ end
+ e = Bug2729.new
+}],
+ ['[ruby-core:39125]', %q{
+ class Bug5234
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc
+ end
+ end
+ end
+ e = Bug5234.new
+}],
+ ['[ruby-dev:45656]', %q{
+ class Bug6460
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ 1.times { Proc.new }
+ end
+ end
+ end
+ e = Bug6460.new
+}]].each do |bug, src|
+ assert_equal "foo", src + %q{e.detect {true}}, bug
+ assert_equal "true", src + %q{e.any? {true}}, bug
+ assert_equal "false", src + %q{e.all? {false}}, bug
+ assert_equal "true", src + %q{e.include?(:foo)}, bug
+end
+
+assert_equal "foo", %q{
+ class Bug6460
+ def m1
+ m2 {|e|
+ return e
+ }
+ end
+
+ def m2
+ begin
+ yield :foo
+ ensure
+ begin
+ begin
+ yield :foo
+ ensure
+ Proc.new
+ raise ''
+ end
+ rescue
+ end
+ end
+ end
+ end
+ Bug6460.new.m1
+}, '[ruby-dev:46372]'
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
new file mode 100644
index 0000000000..5de6ee1b12
--- /dev/null
+++ b/bootstraptest/test_fork.rb
@@ -0,0 +1,75 @@
+assert_equal '0', %q{
+ begin
+ GC.stress = true
+ pid = fork {}
+ Process.wait pid
+ $?.to_i
+ rescue NotImplementedError
+ 0
+ end
+}, '[ruby-dev:32404]'
+
+assert_finish 10, %q{
+ begin
+ children = (1..10).map{
+ Thread.start{fork{}}.value
+ }
+ while !children.empty? and pid = Process.wait
+ children.delete(pid)
+ end
+ rescue NotImplementedError
+ end
+}, '[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)
+ fork {}
+End
+
+assert_equal 'ok', %q{
+ begin
+ r, w = IO.pipe
+ if pid1 = fork
+ w.close
+ r.read(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
+ Process.wait2(pid2)
+ else
+ w.close
+ sleep 0.2
+ end
+ exit true
+ end
+ rescue NotImplementedError
+ :ok
+ end
+}, '[ruby-core:28924]'
+
+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 }
+ pid = $$
+ begin
+ pid = fork do
+ Process.kill(:INT, pid)
+ Process.kill(:TERM, pid)
+ end
+ Process.wait(pid)
+ 100.times {break if a.size > 1; sleep 0.001}
+ a.sort
+ rescue NotImplementedError
+ [1, 2]
+ end
+}, '[ruby-dev:44005] [Ruby 1.9 - Bug #4950]'
+
diff --git a/bootstraptest/test_gc.rb b/bootstraptest/test_gc.rb
new file mode 100644
index 0000000000..eb68c9845e
--- /dev/null
+++ b/bootstraptest/test_gc.rb
@@ -0,0 +1,34 @@
+assert_normal_exit %q{
+a = []
+ms = "a".."k"
+("A".."Z").each do |mod|
+ mod = eval("module #{mod}; self; end")
+ ms.each do |meth|
+ iseq = RubyVM::InstructionSequence.compile("module #{mod}; def #{meth}; end; end")
+ GC.stress = true
+ iseq.eval
+ GC.stress = false
+ end
+ o = Object.new.extend(mod)
+ ms.each do |meth|
+ o.send(meth)
+ end
+end
+}, '[ruby-dev:39453]'
+
+assert_normal_exit %q{
+a = []
+ms = "a".."k"
+("A".."Z").each do |mod|
+ mod = eval("module #{mod}; self; end")
+ ms.each do |meth|
+ GC.stress = true
+ mod.module_eval {define_method(meth) {}}
+ GC.stress = false
+ end
+ o = Object.new.extend(mod)
+ ms.each do |meth|
+ o.send(meth)
+ end
+end
+}, '[ruby-dev:39453]'
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
new file mode 100644
index 0000000000..1d2b19368a
--- /dev/null
+++ b/bootstraptest/test_io.rb
@@ -0,0 +1,112 @@
+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?
+ w.write "a"
+ w.write "a"
+}, '[ruby-dev:31866]'
+
+assert_finish 10, %q{
+ begin
+ require "io/nonblock"
+ require "timeout"
+ timeout(3) do
+ r, w = IO.pipe
+ w.nonblock?
+ w.nonblock = true
+ w.write_nonblock("a" * 100000)
+ w.nonblock = false
+ t1 = Thread.new { w.write("b" * 4096) }
+ t2 = Thread.new { w.write("c" * 4096) }
+ sleep 0.5
+ r.sysread(4096).length
+ sleep 0.5
+ r.sysread(4096).length
+ t1.join
+ t2.join
+ end
+ rescue LoadError, Timeout::Error, NotImplementedError
+ end
+}, '[ruby-dev:32566]'
+
+assert_finish 1, %q{
+ r, w = IO.pipe
+ Thread.new {
+ w << "ab"
+ sleep 0.01
+ w << "ab"
+ }
+ r.gets("abab")
+}
+
+assert_equal 'ok', %q{
+ require 'tmpdir'
+ begin
+ tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
+ rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
+ rescue Errno::EEXIST
+ retry
+ end
+ save = STDIN.dup
+ STDIN.reopen(rw)
+ STDIN.reopen(save)
+ rw.close
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
+ :ok
+}
+
+assert_equal 'ok', %q{
+ require 'tmpdir'
+ begin
+ tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
+ rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
+ rescue Errno::EEXIST
+ retry
+ end
+ save = STDIN.dup
+ STDIN.reopen(rw)
+ STDIN.print "a"
+ STDIN.reopen(save)
+ rw.close
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
+ :ok
+}
+
+assert_equal 'ok', %q{
+ dup = STDIN.dup
+ dupfd = dup.fileno
+ dupfd == STDIN.dup.fileno ? :ng : :ok
+}, '[ruby-dev:46834]'
+
+assert_normal_exit %q{
+ ARGF.set_encoding "foo"
+}
+
+10.times do
+ assert_normal_exit %q{
+ at_exit { p :foo }
+
+ megacontent = "abc" * 12345678
+ #File.open("megasrc", "w") {|f| f << megacontent }
+
+ t0 = Thread.main
+ Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) }
+
+ r1, w1 = IO.pipe
+ r2, w2 = IO.pipe
+ t1 = Thread.new { w1 << megacontent; w1.close }
+ t2 = Thread.new { r2.read; r2.close }
+ IO.copy_stream(r1, w2) rescue nil
+ w2.close
+ r1.close
+ t1.join
+ t2.join
+ }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break
+end
+
+assert_normal_exit %q{
+ r, w = IO.pipe
+ STDOUT.reopen(w)
+ STDOUT.reopen(__FILE__, "r")
+}, '[ruby-dev:38131]'
diff --git a/bootstraptest/test_jump.rb b/bootstraptest/test_jump.rb
new file mode 100644
index 0000000000..595aaa7c4b
--- /dev/null
+++ b/bootstraptest/test_jump.rb
@@ -0,0 +1,308 @@
+assert_equal %q{ok}, %q{
+ def m
+ :ng1
+ mm{
+ yield
+ }
+ :ng2
+ end
+
+ def mm
+ :ng3
+ yield
+ :ng4
+ end
+
+ m{
+ break :ok
+ }
+}
+assert_equal %q{ok}, %q{
+ 3.times{
+ break :ok
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ throw :foo
+ }
+}
+assert_equal %q{false}, %q{
+ catch(:foo){
+ throw :foo, false
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ throw :foo, nil
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ throw :foo, :ok
+ }
+}
+assert_equal %q{}, %q{
+ catch(:foo){
+ 1.times{
+ throw :foo
+ }
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ 1.times{
+ throw :foo, :ok
+ }
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ catch(:bar){
+ throw :foo, :ok
+ }
+ :ng
+ }
+}
+assert_equal %q{ok}, %q{
+ catch(:foo){
+ catch(:bar){
+ 1.times{
+ throw :foo, :ok
+ }
+ }
+ :ng
+ }
+}
+assert_equal %q{2}, %q{
+ module Enumerable
+ def all_?
+ self.each{|e|
+ unless yield(e)
+ return false
+ end
+ }
+ true
+ end
+ end
+
+ xxx = 0
+ [1,2].each{|bi|
+ [3,4].each{|bj|
+ [true, nil, true].all_?{|be| be}
+ break
+ }
+ xxx += 1
+ }
+ xxx
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ end
+
+ m{
+ begin
+ ensure
+ break :ok
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ :ok
+ end
+ i=0
+ m{
+ if i>10
+ i*i
+ else
+ i+=1
+ next
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+ def m
+ yield
+ end
+
+ m{
+ next :ok
+ }
+}
+assert_equal %q{131}, %q{
+ def m
+ yield + 10
+ end
+ i=0
+ m{
+ if i>10
+ i*i
+ else
+ i+=1
+ redo
+ end
+ }
+}
+assert_equal %q{ok}, %q{
+begin
+ eval %q{
+ 1.times{
+ retry
+ }
+ }
+rescue SyntaxError
+ :ok
+end
+}
+assert_equal %q{3}, %q{
+ def m
+ return 3
+ end
+ m
+}
+assert_equal %q{ok}, %q{
+ def m
+ :ng1
+ mm{
+ return :ok
+ }
+ :ng2
+ end
+
+ def mm
+ :ng3
+ yield
+ :ng4
+ end
+ m
+}
+assert_equal %q{100}, %q{
+ $i = 0
+ def m
+ begin
+ iter{
+ return
+ }
+ ensure
+ $i = 100
+ end
+ end
+
+ def iter
+ yield
+ end
+ m
+ $i
+}
+assert_equal %q{ok}, %q{
+ def m
+ begin
+ raise
+ rescue
+ return :ok
+ end
+ :ng
+ end
+ m
+}
+assert_equal %q{1}, %q{
+ def m
+ begin
+ raise
+ rescue
+ return 1
+ end
+ end
+
+ m
+}
+assert_equal %q{1}, %q{
+ def m
+ begin
+ #
+ ensure
+ return 1
+ end
+ end
+
+ m
+}
+assert_equal 'ok', %q{
+ begin
+ catch {|t| throw t, :ok }
+ rescue ArgumentError
+ :ng
+ end
+}, '[ruby-dev:31609]'
+
+assert_equal "1", %q{
+ catch do |t|
+ begin
+ throw t, 1
+ 2
+ ensure
+ 3
+ end
+ end
+}, "[ruby-dev:31698]"
+
+assert_normal_exit %q{
+ f = 0
+ 1.times do
+ begin
+ f += 1
+ ensure
+ redo unless f > 2
+ end
+ end
+}
+
+assert_normal_exit %q{
+ -> do
+ 1.times do
+ begin
+ raise
+ rescue
+ return
+ end
+ end
+ end.call
+}
+
+assert_normal_exit %q{
+ while true
+ begin
+ raise
+ next
+ rescue
+ end
+ break
+ end
+}, '[ruby-core:28172]'
+
+assert_equal "true", %q{
+ class Object
+ def return_eigenclass
+ class << self
+ return self
+ end
+ end
+ end
+ s = "foo"
+ s.return_eigenclass == class << s; self; end
+}, '[ruby-core:21379]'
+
+assert_equal "true", %q{
+ class Object
+ def yield_eigenclass
+ class << self
+ yield self
+ end
+ end
+ end
+ s = "foo"
+ s.yield_eigenclass {|c| c == class << s; self; end }
+}, '[ruby-dev:40975]'
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
new file mode 100644
index 0000000000..aa65bddae1
--- /dev/null
+++ b/bootstraptest/test_literal.rb
@@ -0,0 +1,231 @@
+# empty program
+assert_equal '', ''
+assert_equal '', ' '
+assert_equal '', "\n"
+
+# special const
+assert_equal 'true', 'true'
+assert_equal 'TrueClass', 'true.class'
+assert_equal 'false', 'false'
+assert_equal 'FalseClass', 'false.class'
+assert_equal '', 'nil'
+assert_equal 'nil', 'nil.inspect'
+assert_equal 'NilClass', 'nil.class'
+assert_equal 'sym', ':sym'
+assert_equal ':sym', ':sym.inspect'
+assert_equal 'Symbol', ':sym.class'
+assert_equal '1234', '1234'
+assert_equal 'Fixnum', '1234.class'
+assert_equal '1234', '1_2_3_4'
+assert_equal 'Fixnum', '1_2_3_4.class'
+assert_equal '18', '0x12'
+assert_equal 'Fixnum', '0x12.class'
+assert_equal '15', '0o17'
+assert_equal 'Fixnum', '0o17.class'
+assert_equal '5', '0b101'
+assert_equal 'Fixnum', '0b101.class'
+assert_equal '123456789012345678901234567890', '123456789012345678901234567890'
+assert_equal 'Bignum', '123456789012345678901234567890.class'
+assert_equal '2.0', '2.0'
+assert_equal 'Float', '1.3.class'
+
+# self
+assert_equal 'main', 'self'
+assert_equal 'Object', 'self.class'
+
+# string literal
+assert_equal 'a', '?a'
+assert_equal 'String', '?a.class'
+assert_equal 'A', '?A'
+assert_equal 'String', '?A.class'
+assert_equal "\n", '?\n'
+assert_equal 'String', '?\n.class'
+assert_equal ' ', '?\ '
+assert_equal 'String', '?\ .class'
+assert_equal 'string', "'string'"
+assert_equal 'string', '"string"'
+assert_equal 'string', '%(string)'
+assert_equal 'string', '%q(string)'
+assert_equal 'string', '%Q(string)'
+assert_equal 'string string', '"string string"'
+assert_equal ' ', '" "'
+assert_equal "\0", '"\0"'
+assert_equal "\1", '"\1"'
+assert_equal "3", '"\x33"'
+assert_equal "\n", '"\n"'
+
+# dynamic string literal
+assert_equal '2', '"#{1 + 1}"'
+assert_equal '16', '"#{2 ** 4}"'
+assert_equal 'string', 's = "string"; "#{s}"'
+
+# dynamic symbol literal
+assert_equal 'a3c', ':"a#{1+2}c"'
+assert_equal ':a3c', ':"a#{1+2}c".inspect'
+assert_equal 'Symbol', ':"a#{1+2}c".class'
+
+# xstring
+unless nacl?
+ assert_equal "foo\n", %q(`echo foo`)
+ assert_equal "foo\n", %q(s = "foo"; `echo #{s}`)
+end
+
+# regexp
+assert_equal '', '//.source'
+assert_equal 'Regexp', '//.class'
+assert_equal '0', '// =~ "a"'
+assert_equal '0', '// =~ ""'
+assert_equal 'a', '/a/.source'
+assert_equal 'Regexp', '/a/.class'
+assert_equal '0', '/a/ =~ "a"'
+assert_equal '0', '/test/ =~ "test"'
+assert_equal '', '/test/ =~ "tes"'
+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
+assert_equal 'regexp', %q(/re#{'ge'}xp/.source)
+assert_equal 'Regexp', %q(/re#{'ge'}xp/.class)
+
+# array
+assert_equal 'Array', '[].class'
+assert_equal '0', '[].size'
+assert_equal '0', '[].length'
+assert_equal '[]', '[].inspect'
+assert_equal 'Array', '[0].class'
+assert_equal '1', '[3].size'
+assert_equal '[3]', '[3].inspect'
+assert_equal '3', 'a = [3]; a[0]'
+assert_equal 'Array', '[1,2].class'
+assert_equal '2', '[1,2].size'
+assert_equal '[1, 2]', '[1,2].inspect'
+assert_equal 'Array', '[1,2,3,4,5].class'
+assert_equal '5', '[1,2,3,4,5].size'
+assert_equal '[1, 2, 3, 4, 5]', '[1,2,3,4,5].inspect'
+assert_equal '1', 'a = [1,2]; a[0]'
+assert_equal '2', 'a = [1,2]; a[1]'
+assert_equal 'Array', 'a = [1 + 2, 3 + 4, 5 + 6]; a.class'
+assert_equal '[3, 7, 11]', 'a = [1 + 2, 3 + 4, 5 + 6]; a.inspect'
+assert_equal '7', 'a = [1 + 2, 3 + 4, 5 + 6]; a[1]'
+assert_equal '1', '([0][0] += 1)'
+assert_equal '1', '([2][0] -= 1)'
+assert_equal 'Array', 'a = [obj = Object.new]; a.class'
+assert_equal '1', 'a = [obj = Object.new]; a.size'
+assert_equal 'true', 'a = [obj = Object.new]; a[0] == obj'
+assert_equal '5', 'a = [1,2,3]; a[1] = 5; a[1]'
+assert_equal 'bar', '[*:foo];:bar'
+assert_equal '[1, 2]', 'def nil.to_a; [2]; end; [1, *nil]'
+assert_equal '[1, 2]', 'def nil.to_a; [1, 2]; end; [*nil]'
+assert_equal '[0, 1, {2=>3}]', '[0, *[1], 2=>3]', "[ruby-dev:31592]"
+
+
+# hash
+assert_equal 'Hash', '{}.class'
+assert_equal '{}', '{}.inspect'
+assert_equal 'Hash', '{1=>2}.class'
+assert_equal '{1=>2}', '{1=>2}.inspect'
+assert_equal '2', 'h = {1 => 2}; h[1]'
+assert_equal '0', 'h = {1 => 2}; h.delete(1); h.size'
+assert_equal '', 'h = {1 => 2}; h.delete(1); h[1]'
+assert_equal '2', 'h = {"string" => "literal", "goto" => "hell"}; h.size'
+assert_equal 'literal', 'h = {"string"=>"literal", "goto"=>"hell"}; h["string"]'
+assert_equal 'hell', 'h = {"string"=>"literal", "goto"=>"hell"}; h["goto"]'
+
+# range
+assert_equal 'Range', '(1..2).class'
+assert_equal '1..2', '(1..2).inspect'
+assert_equal '1', '(1..2).begin'
+assert_equal '2', '(1..2).end'
+assert_equal 'false', '(1..2).exclude_end?'
+assert_equal 'Range', 'r = 1..2; r.class'
+assert_equal '1..2', 'r = 1..2; r.inspect'
+assert_equal '1', 'r = 1..2; r.begin'
+assert_equal '2', 'r = 1..2; r.end'
+assert_equal 'false', 'r = 1..2; r.exclude_end?'
+assert_equal 'Range', '(1...3).class'
+assert_equal '1...3', '(1...3).inspect'
+assert_equal '1', '(1...3).begin'
+assert_equal '3', '(1...3).end'
+assert_equal 'true', '(1...3).exclude_end?'
+assert_equal 'Range', 'r = (1...3); r.class'
+assert_equal '1...3', 'r = (1...3); r.inspect'
+assert_equal '1', 'r = (1...3); r.begin'
+assert_equal '3', 'r = (1...3); r.end'
+assert_equal 'true', 'r = (1...3); r.exclude_end?'
+assert_equal 'Range', 'r = (1+2 .. 3+4); r.class'
+assert_equal '3..7', 'r = (1+2 .. 3+4); r.inspect'
+assert_equal '3', 'r = (1+2 .. 3+4); r.begin'
+assert_equal '7', 'r = (1+2 .. 3+4); r.end'
+assert_equal 'false', 'r = (1+2 .. 3+4); r.exclude_end?'
+assert_equal 'Range', 'r = (1+2 ... 3+4); r.class'
+assert_equal '3...7', 'r = (1+2 ... 3+4); r.inspect'
+assert_equal '3', 'r = (1+2 ... 3+4); r.begin'
+assert_equal '7', 'r = (1+2 ... 3+4); r.end'
+assert_equal 'true', 'r = (1+2 ... 3+4); r.exclude_end?'
+assert_equal 'Range', 'r = ("a".."c"); r.class'
+assert_equal '"a".."c"', 'r = ("a".."c"); r.inspect'
+assert_equal 'a', 'r = ("a".."c"); r.begin'
+assert_equal 'c', 'r = ("a".."c"); r.end'
+
+assert_equal 'String', '__FILE__.class'
+assert_equal 'Fixnum', '__LINE__.class'
+
+###
+
+assert_equal 'ok', %q{
+ # this cause "called on terminated object".
+ ObjectSpace.each_object(Module) {|m| m.name.inspect }
+ :ok
+}
+
+assert_normal_exit %q{
+ begin
+ r = 0**-1
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34524]'
+
+assert_normal_exit %q{
+ begin
+ r = Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34536]'
+
+assert_equal 'ok', %q{
+ "#{}""#{}ok"
+}, '[ruby-dev:38968]'
+
+assert_equal 'ok', %q{
+ "#{}o""#{}k""#{}"
+}, '[ruby-core:25284]'
+
+assert_equal 'ok', %q{ # long array literal
+ x = nil
+ eval "a = [#{(1..10_000).map{'x'}.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long array literal (optimized)
+ eval "a = [#{(1..10_000).to_a.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long hash literal
+ x = nil
+ eval "a = {#{(1..10_000).map{|n| "#{n} => x"}.join(', ')}}"
+ :ok
+}
+
+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
new file mode 100644
index 0000000000..4316c9e040
--- /dev/null
+++ b/bootstraptest/test_literal_suffix.rb
@@ -0,0 +1,54 @@
+# 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_load.rb b/bootstraptest/test_load.rb
new file mode 100644
index 0000000000..e63c93a8f4
--- /dev/null
+++ b/bootstraptest/test_load.rb
@@ -0,0 +1,27 @@
+assert_equal 'ok', %q{
+ open("require-lock-test.rb", "w") {|f|
+ f.puts "sleep 0.1"
+ f.puts "module M"
+ f.puts "end"
+ }
+ $:.unshift Dir.pwd
+ vs = (1..2).map {|i|
+ Thread.start {
+ require "require-lock-test"
+ M
+ }
+ }.map {|t| t.value }
+ vs[0] == M && vs[1] == M ? :ok : :ng
+}, '[ruby-dev:32048]'
+
+assert_equal 'ok', %q{
+ %w[a a/foo b].each {|d| Dir.mkdir(d)}
+ open("b/foo", "w") {|f| f.puts "$ok = :ok"}
+ $:.replace(%w[a b])
+ begin
+ load "foo"
+ $ok
+ rescue => e
+ e.message
+ end
+}, '[ruby-dev:38097]'
diff --git a/bootstraptest/test_marshal.rb b/bootstraptest/test_marshal.rb
new file mode 100644
index 0000000000..7e34176169
--- /dev/null
+++ b/bootstraptest/test_marshal.rb
@@ -0,0 +1,5 @@
+
+assert_normal_exit %q{
+ Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| v})
+}
+
diff --git a/bootstraptest/test_massign.rb b/bootstraptest/test_massign.rb
new file mode 100644
index 0000000000..0f63dd424a
--- /dev/null
+++ b/bootstraptest/test_massign.rb
@@ -0,0 +1,183 @@
+assert_equal '[[1], 2, 3]', '*v1, (a, b) = [1,[2, 3]]; [v1, a, b]'
+assert_equal '[[1], 2, 3]', '*v1,(*), (a, b) = [1,:x,[2, 3]]; [v1, a, b]'
+
+assert_equal '[]', '*a = *nil; a'
+assert_equal '[nil]', '*a = nil; a'
+assert_equal '2', 'a, a = 1, 2; a', "[ruby-dev:31522]"
+assert_equal '[1, 2]', 'a, b = 1, 2'
+assert_equal '[1, 2]', %q{
+ ans = []
+ trace_var(:$a){|v| ans << v}
+ trace_var(:$b){|v| ans << v}
+ $a, $b = 1, 2
+ ans
+}
+
+assert_equal 'ok', %q{
+ r = :ok
+ :ng.tap {|(r)|}
+ r
+}, '[ruby-dev:31507]'
+
+=begin
+# generated by this script:
+
+3.times{|i|
+ 8.times{|e|
+ ary = (0...e).to_a
+ a,b,c,d,e,f = nil
+ vals = %w(a b c d e f)
+ vals[i] = '*' + vals[i]
+ program = "#{vals.join(", ")} = *ary"
+ eval(program)
+ ans = [a,b,c,d,e,f]
+ puts %Q{
+ assert_equal "#{ans.inspect}", %q{
+ ary = #{ary.inspect}
+ #{program}; [a, b, c, d, e, f]
+ }}
+ }
+}
+=end
+
+ assert_equal "[[], nil, nil, nil, nil, nil]", %q{
+ ary = []
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, nil, nil, nil, nil]", %q{
+ ary = [0]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, nil, nil, nil]", %q{
+ ary = [0, 1]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[], 0, 1, 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[0], 1, 2, 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[[0, 1], 2, 3, 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ *a, b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[nil, [], nil, nil, nil, nil]", %q{
+ ary = []
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], nil, nil, nil, nil]", %q{
+ ary = [0]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, nil, nil, nil]", %q{
+ ary = [0, 1]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [], 1, 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [1], 2, 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, [1, 2], 3, 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ a, *b, c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[nil, nil, [], nil, nil, nil]", %q{
+ ary = []
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, nil, [], nil, nil, nil]", %q{
+ ary = [0]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], nil, nil, nil]", %q{
+ ary = [0, 1]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, nil, nil]", %q{
+ ary = [0, 1, 2]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, 3, nil]", %q{
+ ary = [0, 1, 2, 3]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [], 2, 3, 4]", %q{
+ ary = [0, 1, 2, 3, 4]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [2], 3, 4, 5]", %q{
+ ary = [0, 1, 2, 3, 4, 5]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+ assert_equal "[0, 1, [2, 3], 4, 5, 6]", %q{
+ ary = [0, 1, 2, 3, 4, 5, 6]
+ a, b, *c, d, e, f = *ary; [a, b, c, d, e, f]
+ }
+
+
+#
+assert_equal 'ok', %q{
+ a,s=[],"aaa"
+ 300.times { a<<s; s=s.succ }
+ eval <<-END__
+ GC.stress=true
+ Fiber.new do
+ #{ a.join(",") },*zzz=1
+ end.resume
+ END__
+ :ok
+}, '[ruby-dev:32581]'
+
+assert_equal 'ok', %q{
+ while true
+ *, z = 1
+ break
+ end
+ :ok
+}, '[ruby-dev:32892]'
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
new file mode 100644
index 0000000000..0a7cb0a577
--- /dev/null
+++ b/bootstraptest/test_method.rb
@@ -0,0 +1,1220 @@
+# regular argument
+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_equal 'wrong number of arguments (1 for 0)', %q{
+ def m; end
+ begin
+ m(1)
+ rescue => e
+ e.message
+ end
+}
+
+assert_equal 'wrong number of arguments (0 for 1)', %q{
+ def m a; end
+ begin
+ m
+ rescue => e
+ e.message
+ end
+}
+
+# default argument
+assert_equal '1', 'def m(x=1) x end; m()'
+assert_equal '1', 'def m(x=7) x end; m(1)'
+assert_equal '1', 'def m(a,x=1) x end; m(7)'
+assert_equal '1', 'def m(a,x=7) x end; m(7,1)'
+assert_equal '1', 'def m(a,b,x=1) x end; m(7,7)'
+assert_equal '1', 'def m(a,b,x=7) x end; m(7,7,1)'
+assert_equal '1', 'def m(a,x=1,y=1) x end; m(7)'
+assert_equal '1', 'def m(a,x=1,y=1) y end; m(7)'
+assert_equal '1', 'def m(a,x=7,y=1) x end; m(7,1)'
+assert_equal '1', 'def m(a,x=7,y=1) y end; m(7,1)'
+assert_equal '1', 'def m(a,x=7,y=7) x end; m(7,1,1)'
+assert_equal '1', 'def m(a,x=7,y=7) y end; m(7,1,1)'
+
+# rest argument
+assert_equal '[]', 'def m(*a) a end; m().inspect'
+assert_equal '[1]', 'def m(*a) a end; m(1).inspect'
+assert_equal '[1, 2]', 'def m(*a) a end; m(1,2).inspect'
+assert_equal '[]', 'def m(x,*a) a end; m(7).inspect'
+assert_equal '[1]', 'def m(x,*a) a end; m(7,1).inspect'
+assert_equal '[1, 2]', 'def m(x,*a) a end; m(7,1,2).inspect'
+assert_equal '[]', 'def m(x,y,*a) a end; m(7,7).inspect'
+assert_equal '[1]', 'def m(x,y,*a) a end; m(7,7,1).inspect'
+assert_equal '[1, 2]', 'def m(x,y,*a) a end; m(7,7,1,2).inspect'
+assert_equal '[]', 'def m(x,y=7,*a) a end; m(7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,*a) a end; m(7,7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7).inspect'
+assert_equal '[]', 'def m(x,y,z=7,zz=7,*a) a end; m(7,7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=1,*a) zz end; m(7,7,7).inspect'
+assert_equal '1', 'def m(x,y,z=7,zz=7,*a) zz end; m(7,7,7,1).inspect'
+
+# block argument
+assert_equal 'Proc', 'def m(&block) block end; m{}.class'
+assert_equal 'nil', 'def m(&block) block end; m().inspect'
+assert_equal 'Proc', 'def m(a,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,&block) block end; m(7).inspect'
+assert_equal '1', 'def m(a,&block) a end; m(1){}'
+assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,b=nil,&block) block end; m(7).inspect'
+assert_equal 'Proc', 'def m(a,b=nil,&block) block end; m(7,7){}.class'
+assert_equal '1', 'def m(a,b=nil,&block) b end; m(7,1){}'
+assert_equal 'Proc', 'def m(a,b=nil,*c,&block) block end; m(7){}.class'
+assert_equal 'nil', 'def m(a,b=nil,*c,&block) block end; m(7).inspect'
+assert_equal '1', 'def m(a,b=nil,*c,&block) a end; m(1).inspect'
+assert_equal '1', 'def m(a,b=1,*c,&block) b end; m(7).inspect'
+assert_equal '1', 'def m(a,b=7,*c,&block) b end; m(7,1).inspect'
+assert_equal '[1]', 'def m(a,b=7,*c,&block) c end; m(7,7,1).inspect'
+
+# splat
+assert_equal '1', 'def m(a) a end; m(*[1])'
+assert_equal '1', 'def m(x,a) a end; m(7,*[1])'
+assert_equal '1', 'def m(x,y,a) a end; m(7,7,*[1])'
+assert_equal '1', 'def m(a,b) a end; m(*[1,7])'
+assert_equal '1', 'def m(a,b) b end; m(*[7,1])'
+assert_equal '1', 'def m(x,a,b) b end; m(7,*[7,1])'
+assert_equal '1', 'def m(x,y,a,b) b end; m(7,7,*[7,1])'
+assert_equal '1', 'def m(a,b,c) a end; m(*[1,7,7])'
+assert_equal '1', 'def m(a,b,c) b end; m(*[7,1,7])'
+assert_equal '1', 'def m(a,b,c) c end; m(*[7,7,1])'
+assert_equal '1', 'def m(x,a,b,c) a end; m(7,*[1,7,7])'
+assert_equal '1', 'def m(x,y,a,b,c) a end; m(7,7,*[1,7,7])'
+
+# hash argument
+assert_equal '1', 'def m(h) h end; m(7=>1)[7]'
+assert_equal '1', 'def m(h) h end; m(7=>1).size'
+assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7)[7]'
+assert_equal '2', 'def m(h) h end; m(7=>1, 8=>7).size'
+assert_equal '1', 'def m(h) h end; m(7=>1, 8=>7, 9=>7)[7]'
+assert_equal '3', 'def m(h) h end; m(7=>1, 8=>7, 9=>7).size'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1)[7]'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7)[7]'
+assert_equal '1', 'def m(x,h) h end; m(7, 7=>1, 8=>7, 9=>7)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7)[7]'
+assert_equal '1', 'def m(x,y,h) h end; m(7,7, 7=>1, 8=>7, 9=>7)[7]'
+
+# block argument
+assert_equal '1', %q(def m(&block) mm(&block) end
+ def mm() yield 1 end
+ m {|a| a })
+assert_equal '1', %q(def m(x,&block) mm(x,&block) end
+ def mm(x) yield 1 end
+ m(7) {|a| a })
+assert_equal '1', %q(def m(x,y,&block) mm(x,y,&block) end
+ def mm(x,y) yield 1 end
+ m(7,7) {|a| a })
+
+# recursive call
+assert_equal '1', %q(def m(n) n == 0 ? 1 : m(n-1) end; m(5))
+
+# instance method
+assert_equal '1', %q(class C; def m() 1 end end; C.new.m)
+assert_equal '1', %q(class C; def m(a) a end end; C.new.m(1))
+assert_equal '1', %q(class C; def m(a = 1) a end end; C.new.m)
+assert_equal '[1]', %q(class C; def m(*a) a end end; C.new.m(1).inspect)
+assert_equal '1', %q( class C
+ def m() mm() end
+ def mm() 1 end
+ end
+ C.new.m )
+
+# singleton method (const)
+assert_equal '1', %q(class C; def C.m() 1 end end; C.m)
+assert_equal '1', %q(class C; def C.m(a) a end end; C.m(1))
+assert_equal '1', %q(class C; def C.m(a = 1) a end end; C.m)
+assert_equal '[1]', %q(class C; def C.m(*a) a end end; C.m(1).inspect)
+assert_equal '1', %q(class C; end; def C.m() 1 end; C.m)
+assert_equal '1', %q(class C; end; def C.m(a) a end; C.m(1))
+assert_equal '1', %q(class C; end; def C.m(a = 1) a end; C.m)
+assert_equal '[1]', %q(class C; end; def C.m(*a) a end; C.m(1).inspect)
+assert_equal '1', %q(class C; def m() 7 end end; def C.m() 1 end; C.m)
+assert_equal '1', %q( class C
+ def C.m() mm() end
+ def C.mm() 1 end
+ end
+ C.m )
+
+# singleton method (lvar)
+assert_equal '1', %q(obj = Object.new; def obj.m() 1 end; obj.m)
+assert_equal '1', %q(obj = Object.new; def obj.m(a) a end; obj.m(1))
+assert_equal '1', %q(obj = Object.new; def obj.m(a=1) a end; obj.m)
+assert_equal '[1]', %q(obj = Object.new; def obj.m(*a) a end; obj.m(1))
+assert_equal '1', %q(class C; def m() 7 end; end
+ obj = C.new
+ def obj.m() 1 end
+ obj.m)
+
+# inheritance
+assert_equal '1', %q(class A; def m(a) a end end
+ class B < A; end
+ B.new.m(1))
+assert_equal '1', %q(class A; end
+ class B < A; def m(a) a end end
+ B.new.m(1))
+assert_equal '1', %q(class A; def m(a) a end end
+ class B < A; end
+ class C < B; end
+ C.new.m(1))
+
+# include
+assert_equal '1', %q(class A; def m(a) a end end
+ module M; end
+ class B < A; include M; end
+ B.new.m(1))
+assert_equal '1', %q(class A; end
+ module M; def m(a) a end end
+ class B < A; include M; end
+ B.new.m(1))
+
+# alias
+assert_equal '1', %q( def a() 1 end
+ alias m a
+ m() )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias :m a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m :a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias :m :a
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def a() 1 end
+ alias m a
+ undef a
+ end
+ C.new.m )
+
+# undef
+assert_equal '1', %q( class C
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A
+ def m() end
+ end
+ class C < A
+ def m() end
+ undef m
+ end
+ begin C.new.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.a; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class A; def a() end end # [yarv-dev:999]
+ class B < A
+ def b() end
+ undef a, b
+ end
+ begin B.new.b; rescue NoMethodError; 1 end )
+
+assert_equal '3', %q{
+ def m1
+ 1
+ end
+ alias m2 m1
+ alias :"#{'m3'}" m1
+ m1 + m2 + m3
+}, '[ruby-dev:32308]'
+assert_equal '1', %q{
+ def foobar
+ end
+ undef :"foo#{:bar}"
+ 1
+}, '[ruby-dev:32308]'
+assert_equal '1', %q{
+ def foobar
+ 1
+ end
+ alias :"bar#{:baz}" :"foo#{:bar}"
+ barbaz
+}, '[ruby-dev:32308]'
+
+# private
+assert_equal '1', %q( class C
+ def m() mm() end
+ def mm() 1 end
+ private :mm
+ end
+ C.new.m )
+assert_equal '1', %q( class C
+ def m() 7 end
+ private :m
+ end
+ begin C.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C
+ def C.m() mm() end
+ def C.mm() 1 end
+ private_class_method :mm
+ end
+ C.m )
+assert_equal '1', %q( class C
+ def C.m() 7 end
+ private_class_method :m
+ end
+ begin C.m; rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C; def m() 1 end end
+ C.new.m # cache
+ class C
+ alias mm m; private :mm
+ end
+ C.new.m
+ begin C.new.mm; 7; rescue NoMethodError; 1 end )
+
+# nested method
+assert_equal '1', %q( class C
+ def m
+ def mm() 1 end
+ end
+ end
+ C.new.m
+ C.new.mm )
+assert_equal '1', %q( class C
+ def m
+ def mm() 1 end
+ end
+ end
+ instance_eval "C.new.m; C.new.mm" )
+
+# method_missing
+assert_equal ':m', %q( class C
+ def method_missing(mid, *args) mid end
+ end
+ C.new.m.inspect )
+assert_equal ':mm', %q( class C
+ def method_missing(mid, *args) mid end
+ end
+ C.new.mm.inspect )
+assert_equal '[1, 2]', %q( class C
+ def method_missing(mid, *args) args end
+ end
+ C.new.m(1,2).inspect )
+assert_equal '1', %q( class C
+ def method_missing(mid, *args) yield 1 end
+ end
+ C.new.m {|a| a })
+assert_equal 'nil', %q( class C
+ def method_missing(mid, *args, &block) block end
+ end
+ C.new.m.inspect )
+
+# send
+assert_equal '1', %q( class C; def m() 1 end end;
+ C.new.__send__(:m) )
+assert_equal '1', %q( class C; def m() 1 end end;
+ C.new.send(:m) )
+assert_equal '1', %q( class C; def m(a) a end end;
+ C.new.send(:m,1) )
+assert_equal '1', %q( class C; def m(a,b) a end end;
+ C.new.send(:m,1,7) )
+assert_equal '1', %q( class C; def m(x,a=1) a end end;
+ C.new.send(:m,7) )
+assert_equal '1', %q( class C; def m(x,a=7) a end end;
+ C.new.send(:m,7,1) )
+assert_equal '[1, 2]', %q( class C; def m(*a) a end end;
+ C.new.send(:m,1,2).inspect )
+assert_equal '1', %q( class C; def m() 7 end; private :m end
+ begin C.new.public_send(:m); rescue NoMethodError; 1 end )
+assert_equal '1', %q( class C; def m() 1 end; private :m end
+ C.new.send(:m) )
+
+# with block
+assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]',
+%q{
+ class C
+ def [](a)
+ $ary << [yield, a]
+ end
+ def []=(a, b)
+ $ary << [yield, a, b]
+ end
+ end
+
+ $ary = []
+ C.new[:foo, &lambda{:ok1}]
+ C.new[:foo, &lambda{:ok2}] = :bar
+ $ary
+}
+
+# with
+assert_equal '[:ok1, [:ok2, 11]]', %q{
+ class C
+ def []
+ $ary << :ok1
+ 10
+ end
+ def []=(a)
+ $ary << [:ok2, a]
+ end
+ end
+ $ary = []
+ C.new[]+=1
+ $ary
+}
+
+# splat and block arguments
+assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{
+def m(*args, &b)
+ $result << [args, b.class]
+end
+$result = []
+ary = [:x, :y, :z]
+obj = :obj
+b = Proc.new{}
+
+m(*ary)
+m(1,*ary)
+m(1,2,*ary)
+m(*obj)
+m(1,*obj)
+m(1,2,*obj)
+m(){}
+m(1){}
+m(1,2){}
+m(&b)
+m(1,&b)
+m(1,2,&b)
+m(*ary,&b)
+m(1,*ary,&b)
+m(1,2,*ary,&b)
+$result
+}
+
+# aset and splat
+assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;Foo.new[1,*a=[2,3]]=4}
+assert_equal '4', %q{class Foo;def []=(a,b,c,d);end;end;def m(&blk)Foo.new[1,*a=[2,3],&blk]=4;end;m{}}
+
+# post test
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4)}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5)}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6)}
+
+assert_equal %q{[1, 2, 3, 4, [5], 6, 7, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, NilClass, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)}
+
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4){}}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5){}}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6){}}
+
+assert_equal %q{[1, 2, 3, 4, [5], 6, 7, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6], 7, 8, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7], 8, 9, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10){}}
+
+assert_equal %q{[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, Proc, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, b.class, x, y]
+end
+; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11){}}
+
+assert_equal %q{[1, 2, :o1, :o2, [], 3, 4, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4)}
+
+assert_equal %q{[1, 2, 3, :o2, [], 4, 5, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4, 5)}
+
+assert_equal %q{[1, 2, 3, 4, [], 5, 6, nil, nil]}, %q{
+def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)
+ x, y = :x, :y if $foo
+ [m1, m2, o1, o2, r, p1, p2, x, y]
+end
+; m(1, 2, 3, 4, 5, 6)}
+
+
+#
+# super
+#
+=begin
+# below programs are generated by this program:
+
+BASE = <<EOS__
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; <TEST>; super; end; end
+EOS__
+
+tests = {
+%q{
+ def m
+} => %q{
+ C1.new.m
+},
+#
+%q{
+ def m a
+} => %q{
+ C1.new.m 1
+},
+%q{
+ def m a
+ a = :a
+} => %q{
+ C1.new.m 1
+},
+#
+%q{
+ def m a, o=:o
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+%q{
+ def m a, o=:o
+ a = :a
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+%q{
+ def m a, o=:o
+ o = :x
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+},
+#
+%q{
+ def m a, *r
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+},
+%q{
+ def m a, *r
+ r = [:x, :y]
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+},
+#
+%q{
+ def m a, o=:o, *r
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+ C1.new.m 1, 2, 3, 4
+},
+#
+%q{
+ def m a, o=:o, *r, &b
+} => %q{
+ C1.new.m 1
+ C1.new.m 1, 2
+ C1.new.m 1, 2, 3
+ C1.new.m 1, 2, 3, 4
+ C1.new.m(1){}
+ C1.new.m(1, 2){}
+ C1.new.m(1, 2, 3){}
+ C1.new.m(1, 2, 3, 4){}
+},
+#
+"def m(m1, m2, o1=:o1, o2=:o2, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+},
+#
+"def m(m1, m2, *r, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+C1.new.m(1,2,3,4,5,6,7)
+C1.new.m(1,2,3,4,5,6,7,8)
+},
+#
+"def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2)" =>
+%q{
+C1.new.m(1,2,3,4)
+C1.new.m(1,2,3,4,5)
+C1.new.m(1,2,3,4,5,6)
+C1.new.m(1,2,3,4,5,6,7)
+C1.new.m(1,2,3,4,5,6,7,8)
+C1.new.m(1,2,3,4,5,6,7,8,9)
+},
+
+###
+}
+
+
+tests.each{|setup, methods| setup = setup.dup; setup.strip!
+ setup = BASE.gsub(/<TEST>/){setup}
+ methods.split(/\n/).each{|m| m = m.dup; m.strip!
+ next if m.empty?
+ expr = "#{setup}; #{m}"
+ result = eval(expr)
+ puts "assert_equal %q{#{result.inspect}}, %q{\n#{expr}}"
+ puts
+ }
+}
+
+=end
+
+assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r; super; end; end
+; C1.new.m 1, 2, 3, 4}
+
+assert_equal %q{[:C0_m, [:a]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a
+ a = :a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8)}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m 1, 2, 3, 4}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1){}}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2){}}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2, 3){}}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o, *r, &b; super; end; end
+; C1.new.m(1, 2, 3, 4){}}
+
+assert_equal %q{[:C0_m, [1, :x]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ o = :x; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ o = :x; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [:a, :o]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ a = :a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [:a, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, o=:o
+ a = :a; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, :x, :y]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r
+ r = [:x, :y]; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, [1, 2, :o1, :o2, 3, 4]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, :o2, 4, 5]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8)}
+
+assert_equal %q{[:C0_m, [1, 2, 3, 4, 5, 6, 7, 8, 9]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2); super; end; end
+; C1.new.m(1,2,3,4,5,6,7,8,9)}
+
+assert_equal %q{[:C0_m, [1]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1, 2}
+
+assert_equal %q{[:C0_m, [1, 2, 3]]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m a, *r; super; end; end
+; C1.new.m 1, 2, 3}
+
+assert_equal %q{[:C0_m, []]}, %q{
+class C0; def m *args; [:C0_m, args]; end; end
+class C1 < C0; def m; super; end; end
+; C1.new.m}
+
+assert_equal %q{[:C0_m, [1, :o]]}, %q{
+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}
+
+assert_equal %q{[:C0_m, [1, 2]]}, %q{
+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 'ok', %q{
+ class C
+ def x=(n)
+ end
+ def m
+ self.x = :ok
+ end
+ end
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ proc{
+ $SAFE = 1
+ class C
+ def m
+ :ok
+ end
+ end
+ }.call
+ C.new.m
+}, '[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
+ class C < B
+ undef m
+ begin
+ remove_method :m
+ rescue NameError
+ end
+ end
+ begin
+ C.new.m
+ rescue NameError
+ :ok
+ end
+}, '[ruby-dev:31816], [ruby-dev:31817]'
+
+assert_normal_exit %q{
+ begin
+ Process.setrlimit(Process::RLIMIT_STACK, 4_206_592)
+ # FreeBSD SEGVs this less than 4M + 12K bytes.
+ rescue Exception
+ exit
+ end
+ class C
+ attr "a" * (10*1024*1024)
+ end
+}, '[ruby-dev:31818]'
+
+assert_equal 'ok', %q{
+ class Module
+ def define_method2(name, &block)
+ define_method(name, &block)
+ end
+ end
+ class C
+ define_method2(:m) {|x, y| :fail }
+ end
+ begin
+ C.new.m([1,2])
+ rescue ArgumentError
+ :ok
+ end
+}
+
+assert_not_match /method_missing/, %q{
+ STDERR.reopen(STDOUT)
+ variable_or_mehtod_not_exist
+}
+
+assert_equal '[false, false, false, false, true, true]', %q{
+ class C
+ define_method(:foo) {
+ block_given?
+ }
+ end
+
+ C.new.foo {}
+
+ class D
+ def foo
+ D.module_eval{
+ define_method(:m1){
+ block_given?
+ }
+ }
+ end
+ def bar
+ D.module_eval{
+ define_method(:m2){
+ block_given?
+ }
+ }
+ end
+ end
+
+ D.new.foo
+ D.new.bar{}
+ [C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}]
+}, '[ruby-core:14813]'
+
+assert_equal 'ok', %q{
+ class Foo
+ define_method(:foo) do |&b|
+ b.call
+ end
+ end
+ Foo.new.foo do
+ break :ok
+ end
+}, '[ruby-dev:36028]'
+
+assert_equal '[1, 2, [3, 4]]', %q{
+ def regular(a, b, *c)
+ [a, b, c]
+ end
+ regular(*[], 1, *[], *[2, 3], *[], 4)
+}, '[ruby-core:19413]'
+
+assert_equal '[1, [:foo, 3, 4, :foo]]', %q{
+ def regular(a, *b)
+ [a, b]
+ end
+ a = b = [:foo]
+ regular(1, *a, *[3, 4], *b)
+}
+
+assert_equal '["B", "A"]', %q{
+ class A
+ def m
+ 'A'
+ end
+ end
+
+ class B < A
+ define_method(:m) do
+ ['B', super()]
+ end
+ end
+
+ class C < B
+ end
+
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ module Foo
+ def foo
+ begin
+ super
+ rescue NoMethodError
+ :ok
+ end
+ end
+ module_function :foo
+ end
+ Foo.foo
+}, '[ruby-dev:37587]'
+
+assert_equal 'Object#foo', %q{
+ class Object
+ def self.foo
+ "Object.foo"
+ end
+ def foo
+ "Object#foo"
+ end
+ end
+
+ module Foo
+ def foo
+ begin
+ super
+ rescue NoMethodError
+ :ok
+ end
+ end
+ module_function :foo
+ end
+ Foo.foo
+}, '[ruby-dev:37587]'
+
+assert_normal_exit %q{
+ class BasicObject
+ remove_method :method_missing
+ end
+ begin
+ "a".lalala!
+ rescue NoMethodError => e
+ e.message == "undefined method `lalala!' for \"a\":String" ? :ok : :ng
+ end
+}, '[ruby-core:22298]'
+
+assert_equal 'ok', %q{
+ "hello"[0] ||= "H"
+ "ok"
+}
+
+assert_equal 'ok', %q{
+ "hello"[0, 1] ||= "H"
+ "ok"
+}
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:foo) do
+ C.class_eval { remove_method(:foo) }
+ super()
+ end
+ end
+ begin
+ C.new.foo
+ rescue NoMethodError
+ 'ok'
+ end
+}
+assert_equal 'ok', %q{
+ [0][0, &proc{}] += 21
+ 'ok'
+}, '[ruby-core:30534]'
+
+# should not cache when splat
+assert_equal 'ok', %q{
+ class C
+ attr_reader :a
+ def initialize
+ @a = 1
+ end
+ end
+
+ def m *args
+ C.new.a(*args)
+ end
+
+ m()
+ begin
+ m(1)
+ rescue ArgumentError
+ 'ok'
+ end
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ args = Object.new
+ def args.to_a
+ test1 $o2, nil
+ []
+ end
+ def test1 o, args
+ o.foo(*args)
+ end
+ test1 o1, args
+ $result.join
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ block = Object.new
+ def block.to_proc
+ test2 $o2, %w(a, b, c), nil
+ Proc.new{}
+ end
+ def test2 o, args, block
+ o.foo(*args, &block)
+ end
+ test2 o1, [], block
+ $result.join
+}
diff --git a/bootstraptest/test_objectspace.rb b/bootstraptest/test_objectspace.rb
new file mode 100644
index 0000000000..862a94e376
--- /dev/null
+++ b/bootstraptest/test_objectspace.rb
@@ -0,0 +1,46 @@
+assert_normal_exit %q{
+ eval("", TOPLEVEL_BINDING)
+ minobj = ObjectSpace.to_enum(:each_object).min_by {|a| a.object_id }
+ maxobj = ObjectSpace.to_enum(:each_object).max_by {|a| a.object_id }
+ (((minobj.object_id-100)..(minobj.object_id+100))+
+ ((maxobj.object_id-100)..(maxobj.object_id+100))).each {|id|
+ begin
+ o = ObjectSpace._id2ref(id)
+ rescue RangeError
+ next
+ end
+ o.inspect if defined?(o.inspect)
+ }
+}, '[ruby-dev:31911]'
+
+assert_normal_exit %q{
+ ary = (1..10).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(String) {|s|
+ s.clear if !s.frozen? && (s.length == 40 || s.length == 80)
+ }
+ end
+ }
+}, '[ruby-dev:31982]'
+
+assert_normal_exit %q{
+ ary = (1..100).to_a
+ ary.permutation(2) {|x|
+ if x == [1,2]
+ ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
+ end
+ }
+}, '[ruby-dev:31985]'
+
+assert_normal_exit %q{
+ ObjectSpace.define_finalizer("") do
+ Mutex.new.lock
+ end
+}, '[ruby-dev:44049]'
+
+assert_normal_exit %q{
+ ObjectSpace.define_finalizer("") do
+ Thread.new {}
+ end
+}, '[ruby-core:37858]'
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
new file mode 100644
index 0000000000..c23394e8d2
--- /dev/null
+++ b/bootstraptest/test_proc.rb
@@ -0,0 +1,483 @@
+assert_equal %q{[1, 2, 3]}, %q{
+ def getproc &b
+ b
+ end
+
+ def m
+ yield
+ end
+
+ m{
+ i = 1
+ m{
+ j = 2
+ m{
+ k = 3
+ getproc{
+ [i, j, k]
+ }
+ }
+ }
+ }.call
+}
+assert_equal %q{7}, %q{
+ def make_proc(&b)
+ b
+ end
+
+ def make_closure
+ a = 0
+ make_proc{
+ a+=1
+ }
+ end
+
+ cl = make_closure
+ cl.call + cl.call * cl.call
+}
+assert_equal %q{ok}, %q{
+ class C
+ def foo
+ :ok
+ end
+ end
+
+ def block
+ C.method(:new).to_proc
+ end
+ b = block()
+ b.call.foo
+}
+assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{
+ def proc &b
+ b
+ end
+
+ pr = []
+ proc{|i_b|
+ p3 = proc{|j_b|
+ pr << proc{|k_b|
+ [i_b, j_b, k_b]
+ }
+ }
+ p3.call(1)
+ p3.call(2)
+ }.call(0)
+
+ pr[0].call(:last).concat pr[1].call(:last)
+}
+assert_equal %q{12}, %q{
+ def iter
+ yield
+ end
+
+ def getproc &b
+ b
+ end
+
+ iter{
+ bvar = 3
+ getproc{
+ bvar2 = 4
+ bvar * bvar2
+ }
+ }.call
+}
+assert_equal %q{200}, %q{
+ def iter
+ yield
+ end
+
+ def getproc &b
+ b
+ end
+
+ loc1 = 0
+ pr1 = iter{
+ bl1 = 1
+ getproc{
+ loc1 += 1
+ bl1 += 1
+ loc1 + bl1
+ }
+ }
+
+ pr2 = iter{
+ bl1 = 1
+ getproc{
+ loc1 += 1
+ bl1 += 1
+ loc1 + bl1
+ }
+ }
+
+ pr1.call; pr2.call
+ pr1.call; pr2.call
+ pr1.call; pr2.call
+ (pr1.call + pr2.call) * loc1
+}
+assert_equal %q{[1, 2]}, %q{
+ def proc(&pr)
+ pr
+ end
+
+ def m
+ a = 1
+ m2{
+ a
+ }
+ end
+
+ def m2
+ b = 2
+ proc{
+ [yield, b]
+ }
+ end
+
+ pr = m
+ x = ['a', 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,
+ 1,2,3,4,5,6,7,8,9,0,]
+ pr.call
+}
+assert_equal %q{1}, %q{
+ def proc(&pr)
+ pr
+ end
+
+ def m
+ a = 1
+ m2{
+ a
+ }
+ end
+
+ def m2
+ b = 2
+ proc{
+ [yield, b]
+ }
+ 100000.times{|x|
+ "#{x}"
+ }
+ yield
+ end
+ m
+}
+assert_equal %q{[:C, :C]}, %q{
+ Const = :top
+ class C
+ Const = :C
+ $pr = proc{
+ (1..2).map{
+ Const
+ }
+ }
+ end
+ $pr.call
+}
+assert_equal %q{top}, %q{
+ Const = :top
+ class C
+ Const = :C
+ end
+ pr = proc{
+ Const
+ }
+ C.class_eval %q{
+ pr.call
+ }
+}
+assert_equal %q{1}, %q{
+ def m(&b)
+ b
+ end
+
+ m{|e_proctest| e_proctest}.call(1)
+}
+assert_equal %q{12}, %q{
+ def m(&b)
+ b
+ end
+
+ m{|e_proctest1, e_proctest2|
+ a = e_proctest1 * e_proctest2 * 2
+ a * 3
+ }.call(1, 2)
+}
+assert_equal %q{[[], [1], [1, 2], [1, 2, 3]]}, %q{
+ [
+ Proc.new{|*args| args}.call(),
+ Proc.new{|*args| args}.call(1),
+ Proc.new{|*args| args}.call(1, 2),
+ Proc.new{|*args| args}.call(1, 2, 3),
+ ]
+}
+assert_equal %q{[[nil, []], [1, []], [1, [2]], [1, [2, 3]]]}, %q{
+ [
+ Proc.new{|a, *b| [a, b]}.call(),
+ Proc.new{|a, *b| [a, b]}.call(1),
+ Proc.new{|a, *b| [a, b]}.call(1, 2),
+ Proc.new{|a, *b| [a, b]}.call(1, 2, 3),
+ ]
+}
+assert_equal %q{0}, %q{
+ pr = proc{
+ $SAFE
+ }
+ $SAFE = 1
+ pr.call
+}
+assert_equal %q{[1, 0]}, %q{
+ pr = proc{
+ $SAFE += 1
+ }
+ [pr.call, $SAFE]
+}
+assert_equal %q{1}, %q{
+ def m(&b)
+ b
+ end
+ m{1}.call
+}
+assert_equal %q{3}, %q{
+ def m(&b)
+ b
+ end
+
+ m{
+ a = 1
+ a + 2
+ }.call
+}
+assert_equal %Q{ok\n}, %q{
+ class A; def get_block; proc {puts "ok"} end end
+ block = A.new.get_block
+ GC.start
+ block.call
+}, '[ruby-core:14885]'
+
+assert_equal 'ok', %q{
+ a = lambda {|x, y, &b| b }
+ b = a.curry[1]
+ if b.call(2){} == nil
+ :ng
+ else
+ :ok
+ end
+}, '[ruby-core:15551]'
+
+assert_equal 'ok', %q{
+ lambda {
+ break :ok
+ :ng
+ }.call
+}, '[ruby-dev:34646]'
+
+assert_equal %q{[:bar, :foo]}, %q{
+ def foo
+ klass = Class.new do
+ define_method(:bar) do
+ return :bar
+ end
+ end
+ [klass.new.bar, :foo]
+ end
+ foo
+}, "[ ruby-Bugs-19304 ]"
+
+assert_equal 'ok', %q{
+ $x = :ok
+ def def7(x, y)
+ x[y]
+ $x = :ng
+ end
+ def test_def7
+ def7(lambda {|x| x.call}, Proc.new {return})
+ $x = :ng
+ end
+ test_def7
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ lambda { a = lambda { return }; $x = :ng; a[]; $x = :ok }.call
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ lambda { a = lambda { break }; $x = :ng; a[]; $x = :ok }.call
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def8
+ $x = :ng
+ lambda { a = Proc.new { return }; a[]}.call
+ $x = :ok
+ end
+ def8
+ $x
+}, '[ruby-core:17164]'
+
+
+assert_equal 'ok', %q{
+ def def9
+ lambda {|a| $x = :ok; a[]; $x = :ng }.call(Proc.new { return })
+ $x = :ng
+ end
+ def9
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def10
+ $x = :ng
+ lambda { 1.times { return } }.call
+ $x = :ok
+ end
+ $x = :ok
+ def10
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def11
+ yield
+ end
+ begin
+ lambda { def11 { return } }.call
+ rescue LocalJumpError
+ :ng
+ else
+ :ok
+ end
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def def12
+ b = Proc.new { $x = :ng; lambda { return }.call; $x = :ok }.call
+ end
+ def12
+ $x
+}, '[ruby-core:17164]'
+
+assert_equal 'ok', %q{
+ def m
+ pr = proc{
+ proc{
+ return :ok
+ }
+ }.call
+ pr.call
+ :ng
+ end
+ m()
+}
+
+assert_equal 'ok', %q{
+ class Foo
+ def call_it
+ p = Proc.new
+ p.call
+ end
+ end
+
+ def give_it
+ proc { :ok }
+ end
+
+ f = Foo.new
+ a_proc = give_it
+ f.call_it(&give_it())
+}, '[ruby-core:15711]'
+
+assert_equal 'foo!', %q{
+ class FooProc < Proc
+ def initialize
+ @foo = "foo!"
+ end
+
+ def bar
+ @foo
+ end
+ end
+
+ def bar
+ FooProc.new &lambda{
+ p 1
+ }
+ end
+
+ fp = bar(&lambda{
+ p 2
+ })
+
+ fp.bar
+}, 'Subclass of Proc'
+
+assert_equal 'ok', %q{
+ o = Object.new
+ def o.write(s); end
+ $stderr = o
+ at_exit{
+ print $!.message
+ }
+ raise "ok"
+}
+
+assert_equal 'ok', %q{
+ lambda do
+ class A
+ class B
+ proc{return :ng}.call
+ end
+ end
+ end.call
+ :ok
+}
+
+assert_equal 'ok', %q{
+ $proc = proc{return}
+ begin
+ lambda do
+ class A
+ class B
+ $proc.call
+ end
+ end
+ end.call
+ :ng
+ rescue LocalJumpError
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ b = x{|a| a }
+ b.eval('yield("ok")')
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ eval("x { 'ok' }").eval "yield"
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ def m
+ x{ 'ok' }
+ end
+ eval('yield', m)
+}, '[Bug #5634]'
+
diff --git a/bootstraptest/test_string.rb b/bootstraptest/test_string.rb
new file mode 100644
index 0000000000..849dcd45b0
--- /dev/null
+++ b/bootstraptest/test_string.rb
@@ -0,0 +1,3 @@
+assert_normal_exit %q{
+ inspect.clear
+}, '[ruby-core:68110]'
diff --git a/bootstraptest/test_struct.rb b/bootstraptest/test_struct.rb
new file mode 100644
index 0000000000..a65964d5f9
--- /dev/null
+++ b/bootstraptest/test_struct.rb
@@ -0,0 +1,5 @@
+assert_equal 'Struct::Foo', %q{
+ Struct.instance_eval { const_set(:Foo, nil) }
+ Struct.new("Foo")
+ Struct::Foo
+}
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
new file mode 100644
index 0000000000..80eaa6416d
--- /dev/null
+++ b/bootstraptest/test_syntax.rb
@@ -0,0 +1,902 @@
+assert_equal %q{4}, %q{1 && 2 && 3 && 4}
+assert_equal %q{}, %q{1 && nil && 3 && 4}
+assert_equal %q{}, %q{1 && 2 && 3 && nil}
+assert_equal %q{false}, %q{1 && 2 && 3 && false}
+assert_equal %q{4}, %q{1 and 2 and 3 and 4}
+assert_equal %q{}, %q{1 and nil and 3 and 4}
+assert_equal %q{}, %q{1 and 2 and 3 and nil}
+assert_equal %q{false}, %q{1 and 2 and 3 and false}
+assert_equal %q{}, %q{nil && true}
+assert_equal %q{false}, %q{false && true}
+assert_equal %q{}, %q{
+ case 1
+ when 2
+ :ng
+ end}
+assert_equal %q{ok}, %q{
+ case 1
+ when 10,20,30
+ :ng1
+ when 1,2,3
+ :ok
+ when 100,200,300
+ :ng2
+ else
+ :elseng
+ end}
+assert_equal %q{elseok}, %q{
+ case 123
+ when 10,20,30
+ :ng1
+ when 1,2,3
+ :ng2
+ when 100,200,300
+ :ng3
+ else
+ :elseok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when /testx/
+ :ng1
+ when /test/
+ :ok
+ when /tetxx/
+ :ng2
+ else
+ :ng_else
+ end
+}
+assert_equal %q{ok}, %q{
+ case Object.new
+ when Object
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case Object
+ when Object.new
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when 'te'
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when 'te'
+ :ng
+ when 'test'
+ :ok
+ end
+}
+assert_equal %q{ng}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when /te/
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ case 'test'
+ when 'tes'
+ :ng
+ when /test/
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{100}, %q{
+ def test(arg)
+ case 1
+ when 2
+ 3
+ end
+ return arg
+ end
+
+ test(100)
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 1
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 3
+ when *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 1
+ when :x, *ary
+ :ok
+ when :z
+ :ng1
+ else
+ :ng2
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [1, 2]
+ case 3
+ when :x, *ary
+ :ng1
+ when :z
+ :ng2
+ else
+ :ok
+ end
+}
+assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep]}, %q{
+
+ def make_perm ary, num
+ if num == 1
+ ary.map{|e| [e]}
+ else
+ base = make_perm(ary, num-1)
+ res = []
+ base.each{|b|
+ ary.each{|e|
+ res << [e] + b
+ }
+ }
+ res
+ end
+ end
+
+ def each_test
+ conds = make_perm(['fv', 'tv'], 3)
+ bangs = make_perm(['', '!'], 3)
+ exprs = make_perm(['and', 'or'], 3)
+ ['if', 'unless'].each{|syn|
+ conds.each{|cs|
+ bangs.each{|bs|
+ exprs.each{|es|
+ yield(syn, cs, bs, es)
+ }
+ }
+ }
+ }
+ end
+
+ fv = false
+ tv = true
+
+ $ans = []
+ each_test{|syn, conds, bangs, exprs|
+ c1, c2, c3 = conds
+ bang1, bang2, bang3 = bangs
+ e1, e2 = exprs
+ eval %Q{
+ #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
+ $ans << :then
+ else
+ $ans << :false
+ end
+ }
+ }
+
+ each_test{|syn, conds, bangs, exprs|
+ c1, c2, c3 = conds
+ bang1, bang2, bang3 = bangs
+ e1, e2 = exprs
+ eval %Q{
+ #{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3}
+ $ans << :then
+ end
+ $ans << :sep
+ }
+ }
+ $ans
+}
+assert_equal %q{}, %q{
+ defined?(m)
+}
+assert_equal %q{method}, %q{
+ def m
+ end
+ defined?(m)
+}
+assert_equal %q{}, %q{
+ defined?(a.class)
+}
+assert_equal %q{method}, %q{
+ a = 1
+ defined?(a.class)
+}
+assert_equal %q{["method", "method", "method", "method", nil, nil, "method", "method", "method", nil]}, %q{
+ class C
+ def test
+ [defined?(m1()), defined?(self.m1), defined?(C.new.m1),
+ defined?(m2()), defined?(self.m2), defined?(C.new.m2),
+ defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
+ end
+ def m1
+ end
+ private
+ def m2
+ end
+ protected
+ def m3
+ end
+ end
+ C.new.test + [defined?(C.new.m3)]
+}
+assert_equal %q{[nil, nil, nil, nil, "global-variable", "global-variable", nil, nil]}, %q{
+ $ans = [defined?($1), defined?($2), defined?($3), defined?($4)]
+ /(a)(b)/ =~ 'ab'
+ $ans + [defined?($1), defined?($2), defined?($3), defined?($4)]
+}
+assert_equal %q{nilselftruefalse}, %q{
+ defined?(nil) + defined?(self) +
+ defined?(true) + defined?(false)
+}
+assert_equal %q{}, %q{
+ defined?(@a)
+}
+assert_equal %q{instance-variable}, %q{
+ @a = 1
+ defined?(@a)
+}
+assert_equal %q{}, %q{
+ defined?(@@a)
+}
+assert_equal %q{class variable}, %q{
+ @@a = 1
+ defined?(@@a)
+}
+assert_equal %q{}, %q{
+ defined?($a)
+}
+assert_equal %q{global-variable}, %q{
+ $a = 1
+ defined?($a)
+}
+assert_equal %q{}, %q{
+ defined?(C_definedtest)
+}
+assert_equal %q{constant}, %q{
+ C_definedtest = 1
+ defined?(C_definedtest)
+}
+assert_equal %q{}, %q{
+ defined?(::C_definedtest)
+}
+assert_equal %q{constant}, %q{
+ C_definedtest = 1
+ defined?(::C_definedtest)
+}
+assert_equal %q{}, %q{
+ defined?(C_definedtestA::C_definedtestB::C_definedtestC)
+}
+assert_equal %q{constant}, %q{
+ class C_definedtestA
+ class C_definedtestB
+ C_definedtestC = 1
+ end
+ end
+ defined?(C_definedtestA::C_definedtestB::C_definedtestC)
+}
+assert_equal %q{30}, %q{
+ sum = 0
+ 30.times{|ib|
+ if ib % 10 == 0 .. true
+ sum += ib
+ end
+ }
+ sum
+}
+assert_equal %q{63}, %q{
+ sum = 0
+ 30.times{|ib|
+ if ib % 10 == 0 ... true
+ sum += ib
+ end
+ }
+ sum
+}
+assert_equal %q{[["NUM", "Type: NUM\n"], ["NUM", "123\n"], ["NUM", "456\n"], ["NUM", "Type: ARP\n"], ["NUM", "aaa\n"], ["NUM", "bbb\n"], ["NUM", "\f\n"], ["ARP", "Type: ARP\n"], ["ARP", "aaa\n"], ["ARP", "bbb\n"]]}, %q{
+ t = nil
+ unless ''.respond_to? :lines
+ class String
+ def lines
+ self
+ end
+ end
+ end
+ ary = []
+"this must not print
+Type: NUM
+123
+456
+Type: ARP
+aaa
+bbb
+\f
+this must not print
+hoge
+Type: ARP
+aaa
+bbb
+".lines.each{|l|
+ if (t = l[/^Type: (.*)/, 1])..(/^\f/ =~ l)
+ ary << [t, l]
+ end
+ }
+ ary
+}
+assert_equal %q{1}, %q{if true then 1 ; end}
+assert_equal %q{}, %q{if false then 1 ; end}
+assert_equal %q{1}, %q{if true then 1 ; else; 2; end}
+assert_equal %q{2}, %q{if false then 1 ; else; 2; end}
+assert_equal %q{}, %q{if true then ; elsif true then ; 1 ; end}
+assert_equal %q{1}, %q{if false then ; elsif true then ; 1 ; end}
+assert_equal %q{}, %q{unless true then 1 ; end}
+assert_equal %q{1}, %q{unless false then 1 ; end}
+assert_equal %q{2}, %q{unless true then 1 ; else; 2; end}
+assert_equal %q{1}, %q{unless false then 1 ; else; 2; end}
+assert_equal %q{1}, %q{1 if true}
+assert_equal %q{}, %q{1 if false}
+assert_equal %q{}, %q{1 if nil}
+assert_equal %q{}, %q{1 unless true}
+assert_equal %q{1}, %q{1 unless false}
+assert_equal %q{1}, %q{1 unless nil}
+assert_equal %q{1}, %q{1 || 2 || 3 || 4}
+assert_equal %q{1}, %q{1 || false || 3 || 4}
+assert_equal %q{2}, %q{nil || 2 || 3 || 4}
+assert_equal %q{2}, %q{false || 2 || 3 || 4}
+assert_equal %q{false}, %q{nil || false || nil || false}
+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{false}, %q{nil or false or nil or false}
+assert_equal %q{elseng}, %q{
+ case
+ when 1==2, 2==3
+ :ng1
+ when false, 4==5
+ :ok
+ when false
+ :ng2
+ else
+ :elseng
+ end
+}
+assert_equal %q{ok}, %q{
+ case
+ when nil, nil
+ :ng1
+ when 1,2,3
+ :ok
+ when false, false
+ :ng2
+ else
+ :elseng
+ end
+}
+assert_equal %q{elseok}, %q{
+ case
+ when nil
+ :ng1
+ when false
+ :ng2
+ else
+ :elseok
+ end}
+assert_equal %q{}, %q{
+ case
+ when 1
+ end
+}
+assert_equal %q{ok}, %q{
+ r = nil
+ ary = []
+ case
+ when false
+ r = :ng1
+ when false, false
+ r = :ng2
+ when *ary
+ r = :ng3
+ when false, *ary
+ r = :ng4
+ when true, *ary
+ r = :ok
+ end
+ r
+}
+assert_equal %q{ok}, %q{
+ ary = []
+ case
+ when false, *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ng
+ else
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ng
+ when true
+ :ok
+ else
+ :ng2
+ end
+}
+assert_equal %q{ng}, %q{
+ ary = [false, nil]
+ case
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, true]
+ case
+ when *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{ok}, %q{
+ ary = [false, true]
+ case
+ when false, false
+ when false, *ary
+ :ok
+ else
+ :ng
+ end
+}
+assert_equal %q{}, %q{
+ i = 0
+ while i < 10
+ i+=1
+ end}
+assert_equal %q{10}, %q{
+ i = 0
+ while i < 10
+ i+=1
+ end; i}
+assert_equal %q{}, %q{
+ i = 0
+ until i > 10
+ i+=1
+ end}
+assert_equal %q{11}, %q{
+ i = 0
+ until i > 10
+ i+=1
+ end; i}
+assert_equal %q{1}, %q{
+ i = 0
+ begin
+ i+=1
+ end while false
+ i
+}
+assert_equal %q{1}, %q{
+ i = 0
+ begin
+ i+=1
+ end until true
+ i
+}
+def assert_syntax_error expected, code, message = ''
+ assert_equal "#{expected}",
+ "begin eval(%q{#{code}}, nil, '', 0)"'; rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end', message
+end
+assert_syntax_error "unterminated string meets end of file", '().."', '[ruby-dev:29732]'
+assert_equal %q{[]}, %q{$&;[]}, '[ruby-dev:31068]'
+assert_syntax_error "syntax error, unexpected *, expecting '}'", %q{{*0}}, '[ruby-dev:31072]'
+assert_syntax_error "`@0' is not allowed as an instance variable name", %q{@0..0}, '[ruby-dev:31095]'
+assert_syntax_error "identifier $00 is not valid to get", %q{$00..0}, '[ruby-dev:31100]'
+assert_syntax_error "identifier $00 is not valid to set", %q{0..$00=1}
+assert_equal %q{0}, %q{[*0];0}, '[ruby-dev:31102]'
+assert_syntax_error "syntax error, unexpected ')'", %q{v0,(*,v1,) = 0}, '[ruby-dev:31104]'
+assert_equal %q{1}, %q{
+ class << (ary=[]); def []; 0; end; def []=(x); super(0,x);end;end; ary[]+=1
+}, '[ruby-dev:31110]'
+assert_syntax_error "Can't set variable $1", %q{0..$1=1}, '[ruby-dev:31118]'
+assert_valid_syntax %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
+assert_valid_syntax %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
+assert_syntax_error %q{syntax error, unexpected end-of-input}, %q{!}, '[ruby-dev:31243]'
+assert_equal %q{[nil]}, %q{[()]}, '[ruby-dev:31252]'
+assert_equal %q{true}, %q{!_=()}, '[ruby-dev:31263]'
+assert_equal 'ok', %q{while true; redo; end if 1 == 2; :ok}, '[ruby-dev:31360]'
+assert_equal 'ok', %q{
+ 1.times {
+ begin
+ ensure
+ next
+ end
+ }; :ok
+}, '[ruby-dev:31373]'
+assert_equal 'ok', %q{
+ flag = false
+ 1.times {
+ next if flag
+ flag = true
+ begin
+ ensure
+ redo
+ end
+ }; :ok
+}, '[ruby-dev:31373]'
+
+assert_equal 'ok', %q{
+ 1.times{
+ p(1, (next; 2))
+ }; :ok
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ next
+ end)
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ p(1, (next; 2))
+ end)
+}
+# redo
+assert_equal 'ok', %q{
+ i = 0
+ 1.times{
+ break if i>1
+ i+=1
+ p(1, (redo; 2))
+ }; :ok
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ redo
+ end)
+}
+assert_equal '3', %q{
+ i = 0
+ 1 + (while true
+ break 2 if (i+=1) > 1
+ p(1, (redo; 2))
+ end)
+}
+assert_equal '1', %q{
+ a = [0]
+ a[*a]+=1
+}
+assert_equal '2', %q{
+ ary = [0]
+ case 1
+ when *ary, 1
+ 1
+ end +
+ case
+ when *ary
+ 1
+ end
+}
+
+assert_match /invalid multibyte char/, %q{
+ STDERR.reopen(STDOUT)
+ eval("\"\xf0".force_encoding("utf-8"))
+}, '[ruby-dev:32429]'
+
+# method ! and !=
+assert_equal 'true', %q{!false}
+assert_equal 'true', %q{1 == 1}
+assert_equal 'true', %q{1 != 2}
+assert_equal 'true', %q{
+ class C; def !=(obj); true; end; end
+ C.new != 1
+}
+assert_equal 'true', %q{
+ class C; def !@; true; end; end
+ !C.new
+}
+assert_normal_exit %q{
+ eval "while true; return; end rescue p $!"
+}, '[ruby-dev:31663]'
+assert_equal '1', %q{
+ def bar
+ raise
+ end
+
+ def foo
+ 1.times{
+ begin
+ return bar
+ rescue
+ :ok
+ end
+ }
+ end
+
+ foo
+}
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ break
+ end
+ :ok
+}, '[ruby-core:14385]'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ break :ok
+ end # direct
+}, '[ruby-core:14385]'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ "#{next}"
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ redo
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ "#{ redo }"
+ end
+ :ok
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ begin
+ raise
+ rescue
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ retry
+ end
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ counter = 2
+ while true
+ counter -= 1
+ break if counter == 0
+ next
+ "#{ break }"
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_normal_exit %q{
+ counter = 2
+ while true
+ counter -= 1
+ next if counter != 0
+ "#{ break }"
+ end
+}, 'reported by Yusuke ENDOH'
+
+assert_equal 'ok', %q{
+ 1.times do
+ [
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ begin
+ false ? next : p
+ break while true
+ end
+ ]
+ end
+ :ok
+}, '[ruby-dev:32882]'
+
+assert_equal "1\n2\n", %q{
+ i = 0
+ while i<2
+ i += 1
+ next p(i)
+ end
+}
+
+assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
+
+assert_equal 'ok', %q{
+ def a() end
+ begin
+ if defined?(a(1).a)
+ :ng
+ else
+ :ok
+ end
+ rescue
+ :ng
+ end
+}, '[ruby-core:16010]'
+
+assert_equal 'ok', %q{
+ def a() end
+ begin
+ if defined?(a::B)
+ :ng
+ else
+ :ok
+ end
+ rescue
+ :ng
+ end
+}, '[ruby-core:16010]'
+
+assert_normal_exit %q{
+ defined? C && 0
+}
+
+assert_normal_exit %q{
+ class C
+ def m
+ defined?(super())
+ end
+ end
+ C.new.m
+}
+
+assert_equal 'ok', %q{
+ class X < RuntimeError;end
+ x = [X]
+ begin
+ raise X
+ rescue *x
+ :ok
+ end
+}, '[ruby-core:14537]'
+
+assert_equal 'ok', %q{
+ a = [false]
+ (a[0] &&= true) == false ? :ok : :ng
+}, '[ruby-dev:34679]'
+
+assert_normal_exit %q{
+ a = []
+ 100.times {|i| a << i << nil << nil }
+ p a.compact!
+}
+
+assert_equal 'ok', %q{
+ "#{}""#{}ok"
+}, '[ruby-dev:38968]'
+
+
+assert_equal 'ok', %q{
+ "o" "#{}k"
+}, '[ruby-dev:38980]'
+
+bug2415 = '[ruby-core:26961]'
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a=1, b, *rest); nil end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x@; nil end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a = 0.times do
+ def y(a=1, b, *rest); nil; end
+ end)
+ nil
+ end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ 0.times do
+ 0.times do
+ def x(a = 0.times do
+ def x@; nil; end
+ end)
+ nil
+ end
+ end
+ end
+}, bug2415
+
+assert_normal_exit %q{
+ a {
+ b {|c.d| }
+ e
+ }
+}, '[ruby-dev:39861]'
+
+bug1240 = '[ruby-core:22637]'
+assert_valid_syntax('x y { "#{}".z { } }', bug1240)
+assert_valid_syntax('x y { "#{}".z do end }', bug1240)
+
+assert_valid_syntax('y "#{a 1}" do end', '[ruby-core:29579]')
+assert_normal_exit %q{
+ def foo(&block)
+ yield
+ end
+
+ foo do
+ s = defined?(raise + 1)
+ Class
+ end
+}, '[ruby-core:30293]'
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
new file mode 100644
index 0000000000..d64f44be49
--- /dev/null
+++ b/bootstraptest/test_thread.rb
@@ -0,0 +1,476 @@
+# Thread and Fiber
+
+assert_equal %q{ok}, %q{
+ Thread.new{
+ }.join
+ :ok
+}
+assert_equal %q{ok}, %q{
+ Thread.new{
+ :ok
+ }.value
+}
+assert_equal %q{ok}, %q{
+begin
+ v = 0
+ (1..200).map{|i|
+ Thread.new{
+ i
+ }
+ }.each{|t|
+ v += t.value
+ }
+ v == 20100 ? :ok : v
+rescue ThreadError => e
+ :ok if /can't create Thread/ =~ e.message
+end
+}
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
+ (1..2).map{
+ Thread.new{
+ }
+ }.each{|e|
+ e.join()
+ }
+ }
+}
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
+ (1..2).map{
+ Thread.new{
+ }
+ }.each{|e|
+ e.join(1000000000)
+ }
+ }
+}
+assert_equal %q{ok}, %q{
+begin
+ :ok if 5000 == 5000.times{
+ t = Thread.new{}
+ while t.alive?
+ Thread.pass
+ end
+ }
+rescue NoMemoryError
+ :ok
+end
+}
+assert_equal %q{100}, %q{
+ 100.times{
+ Thread.new{loop{Thread.pass}}
+ }
+}
+assert_equal %q{ok}, %q{
+ Thread.new{
+ :ok
+ }.join.value
+}
+assert_equal %q{ok}, %q{
+ begin
+ Thread.new{
+ raise "ok"
+ }.join
+ rescue => e
+ e
+ end
+}
+assert_equal %q{ok}, %q{
+ ans = nil
+ t = Thread.new{
+ begin
+ sleep 0.5
+ ensure
+ ans = :ok
+ end
+ }
+ Thread.pass until t.stop?
+ t.kill
+ t.join
+ ans
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ sleep
+ }
+ sleep 0.1
+ t.raise
+ begin
+ t.join
+ :ng
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ loop{}
+ }
+ Thread.pass
+ t.raise
+ begin
+ t.join
+ :ng
+ rescue
+ :ok
+ end
+}
+assert_equal %q{ok}, %q{
+ t = Thread.new{
+ }
+ Thread.pass
+ t.join
+ t.raise # raise to exited thread
+ begin
+ t.join
+ :ok
+ rescue
+ :ng
+ end
+}
+assert_equal %q{run}, %q{
+ t = Thread.new{
+ loop{}
+ }
+ st = t.status
+ t.kill
+ st
+}
+assert_equal %q{sleep}, %q{
+ t = Thread.new{
+ sleep
+ }
+ sleep 0.1
+ st = t.status
+ t.kill
+ st
+}
+assert_equal %q{false}, %q{
+ t = Thread.new{
+ }
+ t.kill
+ sleep 0.1
+ t.status
+}
+assert_equal %q{[ThreadGroup, true]}, %q{
+ ptg = Thread.current.group
+ Thread.new{
+ ctg = Thread.current.group
+ [ctg.class, ctg == ptg]
+ }.value
+}
+assert_equal %q{[1, 1]}, %q{
+ thg = ThreadGroup.new
+
+ t = Thread.new{
+ thg.add Thread.current
+ sleep
+ }
+ sleep 0.1
+ [thg.list.size, ThreadGroup::Default.list.size]
+}
+assert_equal %q{true}, %q{
+ thg = ThreadGroup.new
+
+ t = Thread.new{sleep 5}
+ thg.add t
+ thg.list.include?(t)
+}
+assert_equal %q{[true, nil, true]}, %q{
+ /a/ =~ 'a'
+ $a = $~
+ Thread.new{
+ $b = $~
+ /b/ =~ 'b'
+ $c = $~
+ }.join
+ $d = $~
+ [$a == $d, $b, $c != $d]
+}
+assert_equal %q{11}, %q{
+ Thread.current[:a] = 1
+ Thread.new{
+ Thread.current[:a] = 10
+ Thread.pass
+ Thread.current[:a]
+ }.value + Thread.current[:a]
+}
+assert_normal_exit %q{
+ begin
+ 100.times do |i|
+ begin
+ th = Thread.start(Thread.current) {|u| u.raise }
+ raise
+ rescue
+ ensure
+ th.join
+ end
+ end
+ rescue
+ end
+}, '[ruby-dev:31371]'
+
+assert_equal 'true', %{
+ t = Thread.new { loop {} }
+ begin
+ pid = fork {
+ exit t.status != "run"
+ }
+ Process.wait pid
+ $?.success?
+ rescue NotImplementedError
+ true
+ end
+}
+
+assert_equal 'ok', %{
+ open("zzz.rb", "w") do |f|
+ f.puts <<-END
+ begin
+ Thread.new { fork { GC.start } }.join
+ pid, status = Process.wait2
+ $result = status.success? ? :ok : :ng
+ rescue NotImplementedError
+ $result = :ok
+ end
+ END
+ end
+ require "./zzz.rb"
+ $result
+}
+
+assert_finish 3, %{
+ th = Thread.new {sleep 0.2}
+ th.join(0.1)
+ th.join
+}
+
+assert_finish 3, %{
+ require 'timeout'
+ th = Thread.new {sleep 0.2}
+ begin
+ Timeout.timeout(0.1) {th.join}
+ rescue Timeout::Error
+ end
+ th.join
+}
+
+assert_normal_exit %q{
+ STDERR.reopen(STDOUT)
+ exec "/"
+}
+
+assert_normal_exit %q{
+ (0..10).map {
+ Thread.new {
+ 10000.times {
+ Object.new.to_s
+ }
+ }
+ }.each {|t|
+ t.join
+ }
+}
+
+assert_equal 'ok', %q{
+ def m
+ t = Thread.new { while true; // =~ "" end }
+ sleep 0.01
+ 10.times {
+ if /((ab)*(ab)*)*(b)/ =~ "ab"*7
+ return :ng if !$4
+ return :ng if $~.size != 5
+ end
+ }
+ :ok
+ ensure
+ Thread.kill t
+ end
+ m
+}, '[ruby-dev:34492]'
+
+assert_normal_exit %q{
+ at_exit { Fiber.new{}.resume }
+}
+
+assert_normal_exit %q{
+ g = enum_for(:local_variables)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:block_given?)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:binding)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = "abc".enum_for(:scan, /./)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = Module.enum_for(:new)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Fiber.new(&Object.method(:class_eval)).resume("foo")
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Thread.new("foo", &Object.method(:class_eval)).join
+}, '[ruby-dev:34128]'
+
+assert_equal 'ok', %q{
+ begin
+ Thread.new { Thread.stop }
+ Thread.stop
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+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
+ :ng
+ rescue Exception
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }; sleep 0.1; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock }.join; m.lock
+ :ok
+}
+
+assert_equal 'ok', %q{
+ m = Mutex.new
+ Thread.new { m.lock; sleep 0.2 }
+ sleep 0.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
+ :ok
+}
+
+assert_equal 'ok', %q{
+ t = Thread.new {`echo`}
+ t.join
+ $? ? :ng : :ok
+}, '[ruby-dev:35414]'
+
+assert_equal 'ok', %q{
+ begin
+ 100.times{
+ (1..100).map{ Thread.new(true) {|x| x == false } }.each{|th| th.join}
+ }
+ rescue NoMemoryError, StandardError
+ end
+ :ok
+}
+
+assert_equal 'ok', %{
+ open("zzz.rb", "w") do |f|
+ f.puts <<-'end;' # do
+ begin
+ m = Mutex.new
+ parent = Thread.current
+ th1 = Thread.new { m.lock; sleep }
+ sleep 0.01 until th1.stop?
+ Thread.new do
+ sleep 0.01 until parent.stop?
+ begin
+ fork { GC.start }
+ rescue Exception
+ parent.raise $!
+ end
+ th1.run
+ end
+ m.lock
+ pid, status = Process.wait2
+ $result = status.success? ? :ok : :ng
+ rescue NotImplementedError
+ $result = :ok
+ end
+ end;
+ end
+ require "./zzz.rb"
+ $result
+}
+
+assert_finish 3, %q{
+ require 'thread'
+
+ lock = Mutex.new
+ cond = ConditionVariable.new
+ t = Thread.new do
+ lock.synchronize do
+ cond.wait(lock)
+ end
+ end
+
+ begin
+ pid = fork do
+ # Child
+ STDOUT.write "This is the child process.\n"
+ STDOUT.write "Child process exiting.\n"
+ end
+ Process.waitpid(pid)
+ rescue NotImplementedError
+ end
+}, '[ruby-core:23572]'
+
+assert_equal 'ok', %q{
+ begin
+ Process.waitpid2(fork {})[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 }
+ GC.start
+ f.call.source
+}
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
new file mode 100644
index 0000000000..a04d1d4709
--- /dev/null
+++ b/ccan/build_assert/build_assert.h
@@ -0,0 +1,40 @@
+/* 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
new file mode 100644
index 0000000000..1f77a535e4
--- /dev/null
+++ b/ccan/check_type/check_type.h
@@ -0,0 +1,63 @@
+/* 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
new file mode 100644
index 0000000000..ae3e1fc81f
--- /dev/null
+++ b/ccan/container_of/container_of.h
@@ -0,0 +1,142 @@
+/* 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
new file mode 100644
index 0000000000..89de354795
--- /dev/null
+++ b/ccan/licenses/BSD-MIT
@@ -0,0 +1,17 @@
+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
new file mode 100644
index 0000000000..feb9b118e6
--- /dev/null
+++ b/ccan/licenses/CC0
@@ -0,0 +1,28 @@
+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
new file mode 100644
index 0000000000..749db7849a
--- /dev/null
+++ b/ccan/list/list.h
@@ -0,0 +1,635 @@
+/* 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) (h)
+#define list_debug_node(n, 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 - 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)
+{
+ n->next = h->n.next;
+ n->prev = &h->n;
+ h->n.next->prev = n;
+ h->n.next = 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)
+{
+ n->next = &h->n;
+ n->prev = h->n.prev;
+ h->n.prev->next = n;
+ h->n.prev = n;
+ (void)list_debug(h, 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_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) \
+ for (i = container_of_var(list_debug(h, LIST_LOC)->n.prev, i, member); \
+ &i->member != &(h)->n; \
+ i = container_of_var(i->member.prev, 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:
+ * struct child *next;
+ * 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);
+}
+
+/**
+ * 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) \
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next, \
+ (off)); \
+ list_node_from_off_((void *)i, (off)) != &(h)->n; \
+ i = list_node_to_off_(list_node_from_off_((void *)i, (off))->next, \
+ (off)))
+
+/**
+ * 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) \
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next, \
+ (off)), \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->next, \
+ (off)); \
+ list_node_from_off_(i, (off)) != &(h)->n; \
+ i = nxt, \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->next, \
+ (off)))
+
+
+/* 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
new file mode 100644
index 0000000000..9a9da9cd3f
--- /dev/null
+++ b/ccan/str/str.h
@@ -0,0 +1,16 @@
+/* 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 80f57a1622..f142f4472a 100644
--- a/class.c
+++ b/class.c
@@ -3,123 +3,355 @@
class.c -
$Author$
- $Date$
created at: Tue Aug 10 15:05:44 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
-#include "node.h"
-#include "st.h"
+/*!
+ * \defgroup class Classes and their hierarchy.
+ * \par Terminology
+ * - class: same as in Ruby.
+ * - singleton class: class for a particular object
+ * - eigenclass: = singleton class
+ * - metaclass: class of a class. metaclass is a kind of singleton class.
+ * - metametaclass: class of a metaclass.
+ * - meta^(n)-class: class of a meta^(n-1)-class.
+ * - attached object: A singleton class knows its unique instance.
+ * The instance is called the attached object for the singleton class.
+ * \{
+ */
+
+#include "internal.h"
+#include "ruby/st.h"
+#include "method.h"
+#include "constant.h"
+#include "vm_core.h"
#include <ctype.h>
-extern st_table *rb_class_tbl;
+#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))
+{
+ 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);
+ }
+}
+
+void
+rb_class_detach_subclasses(VALUE klass)
+{
+ rb_class_foreach_subclass(klass, rb_class_remove_from_super_subclasses);
+}
+
+void
+rb_class_detach_module_subclasses(VALUE klass)
+{
+ rb_class_foreach_subclass(klass, rb_class_remove_from_module_subclasses);
+}
+
+/**
+ * Allocates a struct RClass for a new class.
+ *
+ * \param flags initial value for basic.flags of the returned class.
+ * \param klass the class of the returned class.
+ * \return an uninitialized Class object.
+ * \pre \p klass must refer \c Class class or an ancestor of Class.
+ * \pre \code (flags | T_CLASS) != 0 \endcode
+ * \post the returned class can safely be \c #initialize 'd.
+ *
+ * \note this function is not Class#allocate.
+ */
+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 = ALLOC(rb_classext_t);
+ RCLASS_IV_TBL(obj) = 0;
+ RCLASS_CONST_TBL(obj) = 0;
+ RCLASS_M_TBL_WRAPPER(obj) = 0;
+ RCLASS_SET_SUPER((VALUE)obj, 0);
+ RCLASS_ORIGIN(obj) = (VALUE)obj;
+ RCLASS_IV_INDEX_TBL(obj) = 0;
+
+ RCLASS_EXT(obj)->subclasses = NULL;
+ RCLASS_EXT(obj)->parent_subclasses = NULL;
+ RCLASS_EXT(obj)->module_subclasses = NULL;
+ RCLASS_SERIAL(obj) = rb_next_class_serial();
+
+ RCLASS_REFINED_CLASS(obj) = Qnil;
+ RCLASS_EXT(obj)->allocator = 0;
+ return (VALUE)obj;
+}
+
+
+/*!
+ * A utility function that wraps class_alloc.
+ *
+ * allocates a class and initializes safely.
+ * \param super a class from which the new class derives.
+ * \return a class object.
+ * \pre \a super must be a class.
+ * \post the metaclass of the new class is Class.
+ */
VALUE
-rb_class_boot(super)
- VALUE super;
+rb_class_boot(VALUE super)
{
- NEWOBJ(klass, struct RClass);
- OBJSETUP(klass, rb_cClass, T_CLASS);
+ VALUE klass = class_alloc(T_CLASS, rb_cClass);
- klass->super = super;
- klass->iv_tbl = 0;
- klass->m_tbl = 0; /* safe GC */
- klass->m_tbl = st_init_numtable();
+ RCLASS_SET_SUPER(klass, super);
+ RCLASS_M_TBL_INIT(klass);
OBJ_INFECT(klass, super);
return (VALUE)klass;
}
-VALUE
-rb_class_new(super)
- VALUE super;
+
+/*!
+ * Ensures a class can be derived from super.
+ *
+ * \param super a reference to an object.
+ * \exception TypeError if \a super is not a Class or \a super is a singleton class.
+ */
+void
+rb_check_inheritable(VALUE super)
{
- Check_Type(super, T_CLASS);
+ if (!RB_TYPE_P(super, T_CLASS)) {
+ 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");
+ }
if (super == rb_cClass) {
rb_raise(rb_eTypeError, "can't make subclass of Class");
}
- if (FL_TEST(super, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't make subclass of virtual class");
- }
+}
+
+
+/*!
+ * Creates a new class.
+ * \param super a class from which the new class derives.
+ * \exception TypeError \a super is not inheritable.
+ * \exception TypeError \a super is the Class class.
+ */
+VALUE
+rb_class_new(VALUE super)
+{
+ Check_Type(super, T_CLASS);
+ rb_check_inheritable(super);
return rb_class_boot(super);
}
-struct clone_method_data {
- st_table *tbl;
+static void
+clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
+{
+ VALUE newiseqval;
+ if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) {
+ rb_iseq_t *iseq;
+ NODE *new_cref;
+ newiseqval = rb_iseq_clone(me->def->body.iseq->self, klass);
+ GetISeqPtr(newiseqval, iseq);
+ rb_vm_rewrite_cref_stack(me->def->body.iseq->cref_stack, me->klass, klass, &new_cref);
+ RB_OBJ_WRITE(iseq->self, &iseq->cref_stack, new_cref);
+ rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
+ RB_GC_GUARD(newiseqval);
+ }
+ else {
+ rb_method_entry_set(klass, mid, me, me->flag);
+ }
+}
+
+static int
+clone_method_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ 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_method(mid, body, data)
- ID mid;
- NODE *body;
- struct clone_method_data *data;
+clone_const(ID key, const rb_const_entry_t *ce, struct clone_const_arg *arg)
{
- NODE *fbody = body->nd_body;
+ 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);
- if (fbody && nd_type(fbody) == NODE_SCOPE) {
- NODE *cref = (NODE*)fbody->nd_rval;
+ st_insert(arg->tbl, key, (st_data_t)nce);
+ return ST_CONTINUE;
+}
- if (cref) cref = cref->nd_next;
- fbody = rb_copy_node_scope(fbody, NEW_CREF(data->klass, cref));
+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);
+}
+
+static void
+class_init_copy_check(VALUE clone, VALUE orig)
+{
+ if (orig == rb_cBasicObject) {
+ rb_raise(rb_eTypeError, "can't copy the root class");
+ }
+ if (RCLASS_SUPER(clone) != 0 || clone == rb_cBasicObject) {
+ rb_raise(rb_eTypeError, "already initialized class");
+ }
+ if (FL_TEST(orig, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "can't copy singleton class");
}
- st_insert(data->tbl, mid, (st_data_t)NEW_METHOD(fbody, body->nd_noex));
- return ST_CONTINUE;
}
/* :nodoc: */
VALUE
-rb_mod_init_copy(clone, orig)
- VALUE clone, orig;
+rb_mod_init_copy(VALUE clone, VALUE orig)
{
- rb_obj_init_copy(clone, orig);
+ if (RB_TYPE_P(clone, T_CLASS)) {
+ class_init_copy_check(clone, orig);
+ }
+ if (!OBJ_INIT_COPY(clone, orig)) return clone;
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
- RBASIC(clone)->klass = RBASIC(orig)->klass;
- RBASIC(clone)->klass = rb_singleton_class_clone(clone);
+ RBASIC_SET_CLASS(clone, rb_singleton_class_clone(orig));
+ rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
- RCLASS(clone)->super = RCLASS(orig)->super;
- if (RCLASS(orig)->iv_tbl) {
- ID id;
-
- RCLASS(clone)->iv_tbl = st_copy(RCLASS(orig)->iv_tbl);
- id = rb_intern("__classpath__");
- st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
- id = rb_intern("__classid__");
- st_delete(RCLASS(clone)->iv_tbl, (st_data_t*)&id, 0);
+ RCLASS_SET_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(orig)->m_tbl) {
- struct clone_method_data data;
-
- data.tbl = RCLASS(clone)->m_tbl = st_init_numtable();
- data.klass = (VALUE)clone;
+ if (RCLASS_CONST_TBL(clone)) {
+ rb_free_const_table(RCLASS_CONST_TBL(clone));
+ RCLASS_CONST_TBL(clone) = 0;
+ }
+ if (RCLASS_M_TBL_WRAPPER(clone)) {
+ rb_free_m_tbl_wrapper(RCLASS_M_TBL_WRAPPER(clone));
+ RCLASS_M_TBL_WRAPPER(clone) = 0;
+ }
+ if (RCLASS_IV_TBL(orig)) {
+ st_data_t id;
+
+ RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(orig));
+ CONST_ID(id, "__tmp_classpath__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ CONST_ID(id, "__classpath__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ CONST_ID(id, "__classid__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
+ }
+ if (RCLASS_CONST_TBL(orig)) {
+ struct clone_const_arg arg;
- st_foreach(RCLASS(orig)->m_tbl, clone_method, (st_data_t)&data);
+ 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);
+ }
+ if (RCLASS_M_TBL(orig)) {
+ RCLASS_M_TBL_INIT(clone);
+ st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
}
return clone;
}
-/* :nodoc: */
VALUE
-rb_class_init_copy(clone, orig)
- VALUE clone, orig;
+rb_singleton_class_clone(VALUE obj)
{
- if (RCLASS(clone)->super != 0) {
- rb_raise(rb_eTypeError, "already initialized class");
- }
- if (FL_TEST(orig, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "can't copy singleton class");
- }
- return rb_mod_init_copy(clone, orig);
+ return rb_singleton_class_clone_and_attach(obj, Qundef);
}
VALUE
-rb_singleton_class_clone(obj)
- VALUE obj;
+rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
{
VALUE klass = RBASIC(obj)->klass;
@@ -127,84 +359,205 @@ rb_singleton_class_clone(obj)
return klass;
else {
/* copy singleton(unnamed) class */
- NEWOBJ(clone, struct RClass);
- OBJSETUP(clone, 0, RBASIC(klass)->flags);
+ VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
if (BUILTIN_TYPE(obj) == T_CLASS) {
- RBASIC(clone)->klass = (VALUE)clone;
+ RBASIC_SET_CLASS(clone, clone);
}
else {
- RBASIC(clone)->klass = rb_singleton_class_clone(klass);
+ RBASIC_SET_CLASS(clone, rb_singleton_class_clone(klass));
}
- clone->super = RCLASS(klass)->super;
- clone->iv_tbl = 0;
- clone->m_tbl = 0;
- if (RCLASS(klass)->iv_tbl) {
- clone->iv_tbl = st_copy(RCLASS(klass)->iv_tbl);
+ RCLASS_SET_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));
}
- {
- struct clone_method_data data;
-
- data.tbl = clone->m_tbl = st_init_numtable();
- switch (TYPE(obj)) {
- case T_CLASS:
- case T_MODULE:
- data.klass = obj;
- break;
- default:
- data.klass = 0;
- break;
- }
-
- st_foreach(RCLASS(klass)->m_tbl, clone_method, (st_data_t)&data);
+ 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);
}
- rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
+ if (attach != Qundef) {
+ rb_singleton_class_attached(clone, attach);
+ }
+ RCLASS_M_TBL_INIT(clone);
+ 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 (VALUE)clone;
+
+ return clone;
}
}
+/*!
+ * Attach a object to a singleton class.
+ * @pre \a klass is the singleton class of \a obj.
+ */
void
-rb_singleton_class_attached(klass, obj)
- VALUE klass, obj;
+rb_singleton_class_attached(VALUE klass, VALUE obj)
{
if (FL_TEST(klass, FL_SINGLETON)) {
- if (!RCLASS(klass)->iv_tbl) {
- RCLASS(klass)->iv_tbl = st_init_numtable();
+ if (!RCLASS_IV_TBL(klass)) {
+ RCLASS_IV_TBL(klass) = st_init_numtable();
}
- st_insert(RCLASS(klass)->iv_tbl, rb_intern("__attached__"), obj);
+ rb_st_insert_id_and_value(klass, RCLASS_IV_TBL(klass), id_attached, obj);
}
}
-VALUE
-rb_make_metaclass(obj, super)
- VALUE obj, super;
+
+
+#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
+ * @retval 1 if \a k is a meta^(n)-class of Class class (n >= 0)
+ * @retval 0 otherwise
+ */
+#define META_CLASS_OF_CLASS_CLASS_P(k) (METACLASS_OF(k) == (k))
+
+/*!
+ * 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_ivar_get(METACLASS_OF(k), id_attached) == (k))
+
+/*!
+ * ensures \a klass belongs to its own eigenclass.
+ * @return the eigenclass of \a klass
+ * @post \a klass belongs to the returned eigenclass.
+ * i.e. the attached object of the eigenclass is \a klass.
+ * @note this macro creates a new eigenclass if necessary.
+ */
+#define ENSURE_EIGENCLASS(klass) \
+ (HAVE_METACLASS_P(klass) ? METACLASS_OF(klass) : make_metaclass(klass))
+
+
+/*!
+ * Creates a metaclass of \a klass
+ * \param klass a class
+ * \return created metaclass for the class
+ * \pre \a klass is a Class object
+ * \pre \a klass has no singleton class.
+ * \post the class of \a klass is the returned class.
+ * \post the returned class is meta^(n+1)-class when \a klass is a meta^(n)-klass for n >= 0
+ */
+static inline VALUE
+make_metaclass(VALUE klass)
{
- VALUE klass = rb_class_boot(super);
- FL_SET(klass, FL_SINGLETON);
- RBASIC(obj)->klass = klass;
- rb_singleton_class_attached(klass, obj);
- if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
- RBASIC(klass)->klass = klass;
- RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass;
+ VALUE super;
+ VALUE metaclass = rb_class_boot(Qundef);
+
+ FL_SET(metaclass, FL_SINGLETON);
+ rb_singleton_class_attached(metaclass, klass);
+
+ if (META_CLASS_OF_CLASS_CLASS_P(klass)) {
+ SET_METACLASS_OF(klass, metaclass);
+ SET_METACLASS_OF(metaclass, metaclass);
}
else {
- VALUE metasuper = RBASIC(rb_class_real(super))->klass;
-
- /* metaclass of a superclass may be NULL at boot time */
- if (metasuper) {
- RBASIC(klass)->klass = metasuper;
- }
+ 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));
}
+ 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);
+
+ OBJ_INFECT(metaclass, RCLASS_SUPER(metaclass));
+
+ return metaclass;
+}
+
+/*!
+ * Creates a singleton class for \a obj.
+ * \pre \a obj must not a immediate nor a special const.
+ * \pre \a obj must not a Class object.
+ * \pre \a obj has no singleton class.
+ */
+static inline VALUE
+make_singleton_class(VALUE obj)
+{
+ VALUE orig_class = RBASIC(obj)->klass;
+ VALUE klass = rb_class_boot(orig_class);
+
+ FL_SET(klass, FL_SINGLETON);
+ RBASIC_SET_CLASS(obj, klass);
+ rb_singleton_class_attached(klass, obj);
+
+ SET_METACLASS_OF(klass, METACLASS_OF(rb_class_real(orig_class)));
return klass;
}
+
+static VALUE
+boot_defclass(const char *name, VALUE super)
+{
+ VALUE obj = rb_class_boot(super);
+ ID id = rb_intern(name);
+
+ rb_name_class(obj, id);
+ rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
+ return obj;
+}
+
+void
+Init_class_hierarchy(void)
+{
+ 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);
+}
+
+
+/*!
+ * \internal
+ * Creates a new *singleton class* for an object.
+ *
+ * \pre \a obj has no singleton class.
+ * \note DO NOT USE the function in an extension libraries. Use \ref rb_singleton_class.
+ * \param obj An object.
+ * \param unused ignored.
+ * \return The singleton class of the object.
+ */
VALUE
-rb_define_class_id(id, super)
- ID id;
- VALUE super;
+rb_make_metaclass(VALUE obj, VALUE unused)
+{
+ if (BUILTIN_TYPE(obj) == T_CLASS) {
+ return make_metaclass(obj);
+ }
+ else {
+ return make_singleton_class(obj);
+ }
+}
+
+
+/*!
+ * Defines a new class.
+ * \param id ignored
+ * \param super A class from which the new class will derive. NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if super is not a \c Class object.
+ *
+ * \note the returned class will not be associated with \a id.
+ * You must explicitly set a class name if necessary.
+ */
+VALUE
+rb_define_class_id(ID id, VALUE super)
{
VALUE klass;
@@ -215,31 +568,43 @@ rb_define_class_id(id, super)
return klass;
}
-void
-rb_check_inheritable(super)
- VALUE super;
-{
- if (TYPE(super) != T_CLASS) {
- 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 virtual class");
- }
-}
+/*!
+ * Calls Class#inherited.
+ * \param super A class which will be called #inherited.
+ * NULL means Object class.
+ * \param klass A Class object which derived from \a super
+ * \return the value \c Class#inherited's returns
+ * \pre Each of \a super and \a klass must be a \c Class object.
+ */
VALUE
-rb_class_inherited(super, klass)
- VALUE super, klass;
+rb_class_inherited(VALUE super, VALUE klass)
{
+ ID inherited;
if (!super) super = rb_cObject;
- return rb_funcall(super, rb_intern("inherited"), 1, klass);
+ CONST_ID(inherited, "inherited");
+ return rb_funcall(super, inherited, 1, klass);
}
+
+
+/*!
+ * Defines a top-level class.
+ * \param name name of the class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \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.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
VALUE
-rb_define_class(name, super)
- const char *name;
- VALUE super;
+rb_define_class(const char *name, VALUE super)
{
VALUE klass;
ID id;
@@ -247,11 +612,11 @@ rb_define_class(name, super)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
- if (TYPE(klass) != T_CLASS) {
+ if (!RB_TYPE_P(klass, T_CLASS)) {
rb_raise(rb_eTypeError, "%s is not a class", name);
}
- if (rb_class_real(RCLASS(klass)->super) != super) {
- rb_name_error(id, "%s is already defined", name);
+ if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ rb_raise(rb_eTypeError, "superclass mismatch for class %s", name);
}
return klass;
}
@@ -259,7 +624,7 @@ rb_define_class(name, super)
rb_warn("no super class for `%s', Object assumed", name);
}
klass = rb_define_class_id(id, super);
- st_add_direct(rb_class_tbl, id, klass);
+ rb_vm_add_root_module(id, klass);
rb_name_class(klass, id);
rb_const_set(rb_cObject, id, klass);
rb_class_inherited(super, klass);
@@ -267,55 +632,84 @@ rb_define_class(name, super)
return klass;
}
+
+/*!
+ * Defines a class under the namespace of \a outer.
+ * \param outer a class which contains the new class.
+ * \param name name of the new class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \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.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
+VALUE
+rb_define_class_under(VALUE outer, const char *name, VALUE super)
+{
+ return rb_define_class_id_under(outer, rb_intern(name), super);
+}
+
+
+/*!
+ * Defines a class under the namespace of \a outer.
+ * \param outer a class which contains the new class.
+ * \param id name of the new class
+ * \param super a class from which the new class will derive.
+ * NULL means \c Object class.
+ * \return the created class
+ * \throw TypeError if the constant name \a name is already taken but
+ * the constant is not a \c Class.
+ * \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.
+ *
+ * \note if a class named \a name is already defined and its superclass is
+ * \a super, the function just returns the defined class.
+ */
VALUE
-rb_define_class_under(outer, name, super)
- VALUE outer;
- const char *name;
- VALUE super;
+rb_define_class_id_under(VALUE outer, ID id, VALUE super)
{
VALUE klass;
- ID id;
- id = rb_intern(name);
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get_at(outer, id);
- if (TYPE(klass) != T_CLASS) {
- rb_raise(rb_eTypeError, "%s is not a class", name);
+ if (!RB_TYPE_P(klass, T_CLASS)) {
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(id));
}
- if (rb_class_real(RCLASS(klass)->super) != super) {
- rb_name_error(id, "%s is already defined", name);
+ if (rb_class_real(RCLASS_SUPER(klass)) != super) {
+ rb_name_error(id, "%"PRIsVALUE" is already defined", rb_id2str(id));
}
return klass;
}
if (!super) {
- rb_warn("no super class for `%s::%s', Object assumed",
- rb_class2name(outer), name);
+ rb_warn("no super class for `%"PRIsVALUE"::%"PRIsVALUE"', Object assumed",
+ rb_class_path(outer), rb_id2str(id));
}
klass = rb_define_class_id(id, super);
- rb_set_class_path(klass, outer, name);
+ rb_set_class_path_string(klass, outer, rb_id2str(id));
rb_const_set(outer, id, klass);
rb_class_inherited(super, klass);
+ rb_gc_register_mark_object(klass);
return klass;
}
VALUE
-rb_module_new()
+rb_module_new(void)
{
- NEWOBJ(mdl, struct RClass);
- OBJSETUP(mdl, rb_cModule, T_MODULE);
-
- mdl->super = 0;
- mdl->iv_tbl = 0;
- mdl->m_tbl = 0;
- mdl->m_tbl = st_init_numtable();
-
+ VALUE mdl = class_alloc(T_MODULE, rb_cModule);
+ RCLASS_M_TBL_INIT(mdl);
return (VALUE)mdl;
}
VALUE
-rb_define_module_id(id)
- ID id;
+rb_define_module_id(ID id)
{
VALUE mdl;
@@ -326,8 +720,7 @@ rb_define_module_id(id)
}
VALUE
-rb_define_module(name)
- const char *name;
+rb_define_module(const char *name)
{
VALUE module;
ID id;
@@ -335,61 +728,69 @@ rb_define_module(name)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
module = rb_const_get(rb_cObject, id);
- if (TYPE(module) == T_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);
- st_add_direct(rb_class_tbl, id, module);
+ rb_vm_add_root_module(id, module);
rb_const_set(rb_cObject, id, module);
return module;
}
VALUE
-rb_define_module_under(outer, name)
- VALUE outer;
- const char *name;
+rb_define_module_under(VALUE outer, const char *name)
+{
+ return rb_define_module_id_under(outer, rb_intern(name));
+}
+
+VALUE
+rb_define_module_id_under(VALUE outer, ID id)
{
VALUE module;
- ID id;
- id = rb_intern(name);
if (rb_const_defined_at(outer, id)) {
module = rb_const_get_at(outer, id);
- if (TYPE(module) == T_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);
- rb_set_class_path(module, outer, name);
+ rb_set_class_path_string(module, outer, rb_id2str(id));
+ rb_gc_register_mark_object(module);
return module;
}
-static VALUE
-include_class_new(module, super)
- VALUE module, super;
+VALUE
+rb_include_class_new(VALUE module, VALUE super)
{
- NEWOBJ(klass, struct RClass);
- OBJSETUP(klass, rb_cClass, T_ICLASS);
+ VALUE klass = class_alloc(T_ICLASS, rb_cClass);
if (BUILTIN_TYPE(module) == T_ICLASS) {
module = RBASIC(module)->klass;
}
- if (!RCLASS(module)->iv_tbl) {
- RCLASS(module)->iv_tbl = st_init_numtable();
+ if (!RCLASS_IV_TBL(module)) {
+ RCLASS_IV_TBL(module) = st_init_numtable();
}
- klass->iv_tbl = RCLASS(module)->iv_tbl;
- klass->m_tbl = RCLASS(module)->m_tbl;
- klass->super = super;
- if (TYPE(module) == T_ICLASS) {
- RBASIC(klass)->klass = RBASIC(module)->klass;
+ if (!RCLASS_CONST_TBL(module)) {
+ RCLASS_CONST_TBL(module) = st_init_numtable();
+ }
+ RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
+ RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
+
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(klass)) =
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module)));
+
+ RCLASS_SET_SUPER(klass, super);
+ if (RB_TYPE_P(module, T_ICLASS)) {
+ RBASIC_SET_CLASS(klass, RBASIC(module)->klass);
}
else {
- RBASIC(klass)->klass = module;
+ RBASIC_SET_CLASS(klass, module);
}
OBJ_INFECT(klass, module);
OBJ_INFECT(klass, super);
@@ -397,80 +798,183 @@ include_class_new(module, super)
return (VALUE)klass;
}
+static int include_modules_at(const VALUE klass, VALUE c, VALUE module);
+
void
-rb_include_module(klass, module)
- VALUE klass, module;
+rb_include_module(VALUE klass, VALUE module)
{
- VALUE p, c;
int changed = 0;
rb_frozen_class_p(klass);
- if (!OBJ_TAINTED(klass)) {
- rb_secure(4);
- }
-
- if (TYPE(module) != T_MODULE) {
+
+ if (!RB_TYPE_P(module, T_MODULE)) {
Check_Type(module, T_MODULE);
}
OBJ_INFECT(klass, module);
- c = klass;
+
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
+ if (changed < 0)
+ rb_raise(rb_eArgError, "cyclic include detected");
+}
+
+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, (ID) key);
+ return ST_CONTINUE;
+}
+
+static int
+include_modules_at(const VALUE klass, VALUE c, VALUE module)
+{
+ VALUE p, iclass;
+ int method_changed = 0, constant_changed = 0;
+ const st_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
+
while (module) {
- int superclass_seen = Qfalse;
+ int superclass_seen = FALSE;
- if (RCLASS(klass)->m_tbl == RCLASS(module)->m_tbl)
- rb_raise(rb_eArgError, "cyclic include detected");
+ if (RCLASS_ORIGIN(module) != module)
+ goto skip;
+ if (klass_m_tbl && klass_m_tbl == RCLASS_M_TBL(module))
+ return -1;
/* ignore if the module included already in superclasses */
- for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
+ for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
switch (BUILTIN_TYPE(p)) {
case T_ICLASS:
- if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
+ if (RCLASS_M_TBL_WRAPPER(p) == RCLASS_M_TBL_WRAPPER(module)) {
if (!superclass_seen) {
- c = p; /* move insertion point */
+ c = p; /* move insertion point */
}
goto skip;
}
break;
case T_CLASS:
- superclass_seen = Qtrue;
+ superclass_seen = TRUE;
break;
}
}
- c = RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);
- changed = 1;
+ iclass = rb_include_class_new(module, RCLASS_SUPER(c));
+ c = RCLASS_SET_SUPER(c, iclass);
+
+ if (BUILTIN_TYPE(module) == T_ICLASS) {
+ rb_module_add_to_subclasses_list(RBASIC(module)->klass, iclass);
+ }
+ else {
+ rb_module_add_to_subclasses_list(module, iclass);
+ }
+
+ if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
+ VALUE refined_class =
+ rb_refinement_module_get_refined_class(klass);
+
+ 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) && RMODULE_M_TBL(module)->num_entries)
+ method_changed = 1;
+ if (RMODULE_CONST_TBL(module) && RMODULE_CONST_TBL(module)->num_entries)
+ constant_changed = 1;
skip:
- module = RCLASS(module)->super;
+ module = RCLASS_SUPER(module);
+ }
+
+ if (method_changed) rb_clear_method_cache_by_class(klass);
+ if (constant_changed) rb_clear_constant_cache();
+
+ return method_changed;
+}
+
+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;
+ st_table *tbl = (st_table *) data;
+
+ if (me->def->type == VM_METHOD_TYPE_REFINED) {
+ 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 {
+ st_add_direct(tbl, key, (st_data_t) me);
+ return ST_DELETE;
+ }
+ }
+ else {
+ return ST_CONTINUE;
+ }
+}
+
+void
+rb_prepend_module(VALUE klass, VALUE module)
+{
+ VALUE origin;
+ int changed = 0;
+
+ rb_frozen_class_p(klass);
+
+ Check_Type(module, T_MODULE);
+
+ OBJ_INFECT(klass, 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);
+ RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
+ RCLASS_M_TBL_WRAPPER(origin) = RCLASS_M_TBL_WRAPPER(klass);
+ RCLASS_M_TBL_INIT(klass);
+ st_foreach(RCLASS_M_TBL(origin), move_refined_method,
+ (st_data_t) RCLASS_M_TBL(klass));
+ }
+ 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();
}
/*
* call-seq:
* mod.included_modules -> array
- *
+ *
* Returns the list of modules included in <i>mod</i>.
- *
+ *
* module Mixin
* end
- *
+ *
* module Outer
* include Mixin
* end
- *
+ *
* Mixin.included_modules #=> []
* Outer.included_modules #=> [Mixin]
*/
VALUE
-rb_mod_included_modules(mod)
- VALUE mod;
+rb_mod_included_modules(VALUE mod)
{
VALUE ary = rb_ary_new();
VALUE p;
+ VALUE origin = RCLASS_ORIGIN(mod);
- for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
- if (BUILTIN_TYPE(p) == T_ICLASS) {
- rb_ary_push(ary, RBASIC(p)->klass);
+ 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);
}
}
return ary;
@@ -478,11 +982,11 @@ rb_mod_included_modules(mod)
/*
* call-seq:
- * mod.include?(module) => true or false
- *
+ * mod.include?(module) -> true or false
+ *
* Returns <code>true</code> if <i>module</i> is included in
* <i>mod</i> or one of <i>mod</i>'s ancestors.
- *
+ *
* module A
* end
* class B
@@ -496,14 +1000,12 @@ rb_mod_included_modules(mod)
*/
VALUE
-rb_mod_include_p(mod, mod2)
- VALUE mod;
- VALUE mod2;
+rb_mod_include_p(VALUE mod, VALUE mod2)
{
VALUE p;
Check_Type(mod2, T_MODULE);
- for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
+ for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
if (RBASIC(p)->klass == mod2) return Qtrue;
}
@@ -514,32 +1016,31 @@ rb_mod_include_p(mod, mod2)
/*
* call-seq:
* mod.ancestors -> array
- *
- * Returns a list of modules included in <i>mod</i> (including
- * <i>mod</i> itself).
- *
+ *
+ * Returns a list of modules included/prepended in <i>mod</i>
+ * (including <i>mod</i> itself).
+ *
* module Mod
* include Math
* include Comparable
+ * prepend Enumerable
* end
- *
- * Mod.ancestors #=> [Mod, Comparable, Math]
- * Math.ancestors #=> [Math]
+ *
+ * Mod.ancestors #=> [Enumerable, Mod, Comparable, Math]
+ * Math.ancestors #=> [Math]
+ * Enumerable.ancestors #=> [Enumerable]
*/
VALUE
-rb_mod_ancestors(mod)
- VALUE mod;
+rb_mod_ancestors(VALUE mod)
{
VALUE p, ary = rb_ary_new();
- for (p = mod; p; p = RCLASS(p)->super) {
- if (FL_TEST(p, FL_SINGLETON))
- continue;
+ for (p = mod; p; p = RCLASS_SUPER(p)) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
- else {
+ else if (p == RCLASS_ORIGIN(p)) {
rb_ary_push(ary, p);
}
}
@@ -550,13 +1051,10 @@ rb_mod_ancestors(mod)
#define VISI_CHECK(x,f) (VISI(x) == (f))
static int
-ins_methods_push(name, type, ary, visi)
- ID name;
- long type;
- VALUE ary;
- long visi;
+ins_methods_push(ID name, long type, VALUE ary, long visi)
{
if (type == -1) return ST_CONTINUE;
+
switch (visi) {
case NOEX_PRIVATE:
case NOEX_PROTECTED:
@@ -568,77 +1066,74 @@ ins_methods_push(name, type, ary, visi)
break;
}
if (visi) {
- rb_ary_push(ary, rb_str_new2(rb_id2name(name)));
+ rb_ary_push(ary, ID2SYM(name));
}
return ST_CONTINUE;
}
static int
-ins_methods_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, -1); /* everything but private */
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, -1); /* everything but private */
}
static int
-ins_methods_prot_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PROTECTED);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PROTECTED);
}
static int
-ins_methods_priv_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PRIVATE);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PRIVATE);
}
static int
-ins_methods_pub_i(name, type, ary)
- ID name;
- long type;
- VALUE ary;
+ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
{
- return ins_methods_push(name, type, ary, NOEX_PUBLIC);
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PUBLIC);
}
-static int
-method_entry(key, body, list)
- ID key;
- NODE *body;
+struct method_entry_arg {
st_table *list;
+ int recur;
+};
+
+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;
long type;
- if (key == ID_ALLOCATOR) return ST_CONTINUE;
- if (!st_lookup(list, key, 0)) {
- if (!body->nd_body) type = -1; /* none */
- else type = VISI(body->nd_noex);
- st_add_direct(list, key, type);
+ if (me && me->def->type == VM_METHOD_TYPE_REFINED) {
+ VALUE klass = me->klass;
+ me = rb_resolve_refined_method(Qnil, me, NULL);
+ if (!me) return ST_CONTINUE;
+ if (!arg->recur && me->klass != klass) return ST_CONTINUE;
+ }
+ if (!st_lookup(arg->list, key, 0)) {
+ if (UNDEFINED_METHOD_ENTRY_P(me)) {
+ type = -1; /* none */
+ }
+ else {
+ type = VISI(me->flag);
+ }
+ st_add_direct(arg->list, key, type);
}
return ST_CONTINUE;
}
static VALUE
-class_instance_method_list(argc, argv, mod, func)
- int argc;
- VALUE *argv;
- VALUE mod;
- int (*func) _((ID, long, 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))
{
VALUE ary;
- int recur;
- st_table *list;
+ int recur, prepended = 0;
+ struct method_entry_arg me_arg;
if (argc == 0) {
- recur = Qtrue;
+ recur = TRUE;
}
else {
VALUE r;
@@ -646,415 +1141,842 @@ class_instance_method_list(argc, argv, mod, func)
recur = RTEST(r);
}
- list = st_init_numtable();
- for (; mod; mod = RCLASS(mod)->super) {
- st_foreach(RCLASS(mod)->m_tbl, method_entry, (st_data_t)list);
- if (BUILTIN_TYPE(mod) == T_ICLASS) continue;
- if (FL_TEST(mod, FL_SINGLETON)) continue;
+ if (!recur && RCLASS_ORIGIN(mod) != mod) {
+ mod = RCLASS_ORIGIN(mod);
+ prepended = 1;
+ }
+
+ me_arg.list = st_init_numtable();
+ me_arg.recur = recur;
+ for (; mod; mod = RCLASS_SUPER(mod)) {
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)&me_arg);
+ 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(list, func, ary);
- st_free_table(list);
+ st_foreach(me_arg.list, func, ary);
+ st_free_table(me_arg.list);
return ary;
}
/*
* call-seq:
- * mod.instance_methods(include_super=true) => array
- *
- * Returns an array containing the names of public instance methods in
- * the receiver. For a module, these are the public methods; 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.
- *
+ * mod.instance_methods(include_super=true) -> array
+ *
+ * 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.
+ *
* module A
* def method1() end
* end
* class B
+ * include A
* def method2() end
* end
* class C < B
* def method3() end
* end
- *
- * A.instance_methods #=> ["method1"]
- * B.instance_methods(false) #=> ["method2"]
- * C.instance_methods(false) #=> ["method3"]
- * C.instance_methods(true).length #=> 43
+ *
+ * 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
*/
VALUE
-rb_class_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_i);
}
/*
* call-seq:
- * mod.protected_instance_methods(include_super=true) => array
- *
+ * 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 not <code>false</code>, the
- * methods of any ancestors are included.
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
*/
VALUE
-rb_class_protected_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_protected_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_prot_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_prot_i);
}
/*
* call-seq:
- * mod.private_instance_methods(include_super=true) => array
- *
+ * 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 not <code>false</code>, the
- * methods of any ancestors are included.
- *
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
+ *
* module Mod
* def method1() end
* private :method1
* def method2() end
* end
- * Mod.instance_methods #=> ["method2"]
- * Mod.private_instance_methods #=> ["method1"]
+ * Mod.instance_methods #=> [:method2]
+ * Mod.private_instance_methods #=> [:method1]
*/
VALUE
-rb_class_private_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_class_private_instance_methods(int argc, const VALUE *argv, VALUE mod)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_priv_i);
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_priv_i);
}
/*
* call-seq:
- * mod.public_instance_methods(include_super=true) => array
- *
+ * 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 not <code>false</code>, the methods of
- * any ancestors are included.
+ * If the optional parameter is <code>false</code>, the methods of
+ * any ancestors are not included.
+ */
+
+VALUE
+rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
+{
+ return class_instance_method_list(argc, argv, mod, 0, ins_methods_pub_i);
+}
+
+/*
+ * call-seq:
+ * obj.methods(regular=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>.
+ *
+ * class Klass
+ * def klass_method()
+ * end
+ * end
+ * k = Klass.new
+ * 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]
+ */
+
+VALUE
+rb_obj_methods(int argc, const VALUE *argv, VALUE obj)
+{
+ rb_check_arity(argc, 0, 1);
+ if (argc > 0 && !RTEST(argv[0])) {
+ return rb_obj_singleton_methods(argc, argv, obj);
+ }
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
+}
+
+/*
+ * call-seq:
+ * obj.protected_methods(all=true) -> array
+ *
+ * Returns the list of protected methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ */
+
+VALUE
+rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj)
+{
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_prot_i);
+}
+
+/*
+ * call-seq:
+ * obj.private_methods(all=true) -> array
+ *
+ * Returns the list of private methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
*/
VALUE
-rb_class_public_instance_methods(argc, argv, mod)
- int argc;
- VALUE *argv;
- VALUE mod;
+rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj)
{
- return class_instance_method_list(argc, argv, mod, ins_methods_pub_i);
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_priv_i);
}
/*
* call-seq:
- * obj.singleton_methods(all=true) => array
- *
+ * obj.public_methods(all=true) -> array
+ *
+ * Returns the list of public methods accessible to <i>obj</i>. If
+ * the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
+ */
+
+VALUE
+rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
+{
+ return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i);
+}
+
+/*
+ * call-seq:
+ * obj.singleton_methods(all=true) -> array
+ *
* Returns an array of the names of singleton methods for <i>obj</i>.
* If the optional <i>all</i> parameter is true, the list will include
* methods in modules included in <i>obj</i>.
- *
+ * Only public and protected singleton methods are returned.
+ *
* module Other
* def three() end
* end
- *
+ *
* class Single
* def Single.four() end
* end
- *
+ *
* a = Single.new
- *
+ *
* def a.one()
* end
- *
+ *
* class << a
* include Other
* def two()
* end
* end
- *
- * Single.singleton_methods #=> ["four"]
- * a.singleton_methods(false) #=> ["two", "one"]
- * a.singleton_methods #=> ["two", "one", "three"]
+ *
+ * Single.singleton_methods #=> [:four]
+ * a.singleton_methods(false) #=> [:two, :one]
+ * a.singleton_methods #=> [:two, :one, :three]
*/
VALUE
-rb_obj_singleton_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
{
- VALUE recur, ary, klass;
- st_table *list;
+ VALUE recur, ary, klass, origin;
+ struct method_entry_arg me_arg;
+ st_table *mtbl;
- rb_scan_args(argc, argv, "01", &recur);
if (argc == 0) {
recur = Qtrue;
}
+ else {
+ rb_scan_args(argc, argv, "01", &recur);
+ }
klass = CLASS_OF(obj);
- list = st_init_numtable();
+ origin = RCLASS_ORIGIN(klass);
+ me_arg.list = st_init_numtable();
+ me_arg.recur = RTEST(recur);
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
- klass = RCLASS(klass)->super;
+ if ((mtbl = RCLASS_M_TBL(origin)) != 0)
+ st_foreach(mtbl, method_entry_i, (st_data_t)&me_arg);
+ klass = RCLASS_SUPER(klass);
}
if (RTEST(recur)) {
- while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) {
- st_foreach(RCLASS(klass)->m_tbl, method_entry, (st_data_t)list);
- klass = RCLASS(klass)->super;
+ while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) {
+ if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0)
+ st_foreach(mtbl, method_entry_i, (st_data_t)&me_arg);
+ klass = RCLASS_SUPER(klass);
}
}
ary = rb_ary_new();
- st_foreach(list, ins_methods_i, ary);
- st_free_table(list);
+ st_foreach(me_arg.list, ins_methods_i, ary);
+ st_free_table(me_arg.list);
return ary;
}
+/*!
+ * \}
+ */
+/*!
+ * \defgroup defmethod Defining methods
+ * There are some APIs to define a method from C.
+ * These API takes a C function as a method body.
+ *
+ * \par Method body functions
+ * Method body functions must return a VALUE and
+ * can be one of the following form:
+ * <dl>
+ * <dt>Fixed number of parameters</dt>
+ * <dd>
+ * This form is a normal C function, excepting it takes
+ * a receiver object as the first argument.
+ *
+ * \code
+ * static VALUE my_method(VALUE self, VALUE x, VALUE y);
+ * \endcode
+ * </dd>
+ * <dt>argc and argv style</dt>
+ * <dd>
+ * This form takes three parameters: \a argc, \a argv and \a self.
+ * \a self is the receiver. \a argc is the number of arguments.
+ * \a argv is a pointer to an array of the arguments.
+ *
+ * \code
+ * static VALUE my_method(int argc, VALUE *argv, VALUE self);
+ * \endcode
+ * </dd>
+ * <dt>Ruby array style</dt>
+ * <dd>
+ * This form takes two parameters: self and args.
+ * \a self is the receiver. \a args is an Array object which
+ * contains the arguments.
+ *
+ * \code
+ * static VALUE my_method(VALUE self, VALUE args);
+ * \endcode
+ * </dd>
+ *
+ * \par Number of parameters
+ * Method defining APIs takes the number of parameters which the
+ * method will takes. This number is called \a argc.
+ * \a argc can be:
+ * <dl>
+ * <dt>zero or positive number</dt>
+ * <dd>This means the method body function takes a fixed number of parameters</dd>
+ * <dt>-1</dt>
+ * <dd>This means the method body function is "argc and argv" style.</dd>
+ * <dt>-2</dt>
+ * <dd>This means the method body function is "self and args" style.</dd>
+ * </dl>
+ * \{
+ */
+
void
-rb_define_method_id(klass, name, func, argc)
- VALUE klass;
- ID name;
- VALUE (*func)();
- int argc;
+rb_define_method_id(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, name, NEW_CFUNC(func,argc), NOEX_PUBLIC);
+ rb_add_method_cfunc(klass, mid, func, argc, NOEX_PUBLIC);
}
void
-rb_define_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- ID id = rb_intern(name);
- int ex = NOEX_PUBLIC;
-
-
- rb_add_method(klass, id, NEW_CFUNC(func, argc), ex);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PUBLIC);
}
void
-rb_define_protected_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PROTECTED);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PROTECTED);
}
void
-rb_define_private_method(klass, name, func, argc)
- VALUE klass;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
}
void
-rb_undef_method(klass, name)
- VALUE klass;
- const char *name;
+rb_undef_method(VALUE klass, const char *name)
{
- rb_add_method(klass, rb_intern(name), 0, NOEX_UNDEF);
+ rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
}
+/*!
+ * \}
+ */
+/*!
+ * \addtogroup class
+ * \{
+ */
+
#define SPECIAL_SINGLETON(x,c) do {\
if (obj == (x)) {\
- return c;\
+ return (c);\
}\
} while (0)
+static inline VALUE
+special_singleton_class_of(VALUE obj)
+{
+ SPECIAL_SINGLETON(Qnil, rb_cNilClass);
+ SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
+ SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
+ return Qnil;
+}
+
VALUE
-rb_singleton_class(obj)
- VALUE obj;
+rb_special_singleton_class(VALUE obj)
+{
+ return special_singleton_class_of(obj);
+}
+
+/*!
+ * \internal
+ * Returns the singleton class of \a obj. Creates it if necessary.
+ *
+ * \note DO NOT expose the returned singleton class to
+ * outside of class.c.
+ * Use \ref rb_singleton_class instead for
+ * consistency of the metaclass hierarchy.
+ */
+static VALUE
+singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || STATIC_SYM_P(obj)) {
+ no_singleton:
rb_raise(rb_eTypeError, "can't define singleton");
}
- if (rb_special_const_p(obj)) {
- SPECIAL_SINGLETON(Qnil, rb_cNilClass);
- SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
- SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
- rb_bug("unknown immediate %ld", obj);
- }
-
- DEFER_INTS;
- if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
- rb_iv_get(RBASIC(obj)->klass, "__attached__") == obj) {
- klass = RBASIC(obj)->klass;
+ if (SPECIAL_CONST_P(obj)) {
+ klass = special_singleton_class_of(obj);
+ if (NIL_P(klass))
+ rb_bug("unknown immediate %p", (void *)obj);
+ return klass;
}
else {
- klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
+ switch (BUILTIN_TYPE(obj)) {
+ case T_FLOAT: case T_BIGNUM: case T_SYMBOL:
+ goto no_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 (OBJ_TAINTED(obj)) {
OBJ_TAINT(klass);
}
else {
FL_UNSET(klass, FL_TAINT);
}
- if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass);
- ALLOW_INTS;
+ 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);
+ }
+ }
+}
+
+/*!
+ * 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);
+ }
+ klass = RBASIC(obj)->klass;
+ if (!FL_TEST(klass, FL_SINGLETON)) return Qnil;
+ if (rb_ivar_get(klass, id_attached) != obj) return Qnil;
+ return klass;
+}
+
+/*!
+ * Returns the singleton class of \a obj. Creates it if necessary.
+ *
+ * \param obj an arbitrary object.
+ * \throw TypeError if \a obj is a Fixnum or a Symbol.
+ * \return the singleton class.
+ *
+ * \post \a obj has its own singleton class.
+ * \post if \a obj is a class,
+ * the returned singleton class also has its own
+ * singleton class in order to keep consistency of the
+ * inheritance structure of metaclasses.
+ * \note a new singleton class will be created
+ * if \a obj does not have it.
+ * \note the singleton classes for nil, true and false are:
+ * NilClass, TrueClass and FalseClass.
+ */
+VALUE
+rb_singleton_class(VALUE obj)
+{
+ VALUE klass = singleton_class_of(obj);
+
+ /* ensures an exposed class belongs to its own eigenclass */
+ if (RB_TYPE_P(obj, T_CLASS)) (void)ENSURE_EIGENCLASS(klass);
return klass;
}
+/*!
+ * \}
+ */
+
+/*!
+ * \addtogroup defmethod
+ * \{
+ */
+
+/*!
+ * Defines a singleton method for \a obj.
+ * \param obj an arbitrary object
+ * \param name name of the singleton method
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_singleton_method(obj, name, func, argc)
- VALUE obj;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc)
{
- rb_define_method(rb_singleton_class(obj), name, func, argc);
+ rb_define_method(singleton_class_of(obj), name, func, argc);
}
+
+
+/*!
+ * Defines a module function for \a module.
+ * \param module an module or a class.
+ * \param name name of the function
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_module_function(module, name, func, argc)
- VALUE module;
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
{
rb_define_private_method(module, name, func, argc);
rb_define_singleton_method(module, name, func, argc);
}
+
+/*!
+ * Defines a global function
+ * \param name name of the function
+ * \param func the method body
+ * \param argc the number of parameters, or -1 or -2. see \ref defmethod.
+ */
void
-rb_define_global_function(name, func, argc)
- const char *name;
- VALUE (*func)();
- int argc;
+rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), int argc)
{
rb_define_module_function(rb_mKernel, name, func, argc);
}
+
+/*!
+ * Defines an alias of a method.
+ * \param klass the class which the original method belongs to
+ * \param name1 a new name for the method
+ * \param name2 the original name of the method
+ */
void
-rb_define_alias(klass, name1, name2)
- VALUE klass;
- const char *name1, *name2;
+rb_define_alias(VALUE klass, const char *name1, const char *name2)
{
rb_alias(klass, rb_intern(name1), rb_intern(name2));
}
+/*!
+ * Defines (a) public accessor method(s) for an attribute.
+ * \param klass the class which the attribute will belongs to
+ * \param name name of the attribute
+ * \param read a getter method for the attribute will be defined if \a read is non-zero.
+ * \param write a setter method for the attribute will be defined if \a write is non-zero.
+ */
void
-rb_define_attr(klass, name, read, write)
- VALUE klass;
- const char *name;
- int read, write;
+rb_define_attr(VALUE klass, const char *name, int read, int write)
{
- rb_attr(klass, rb_intern(name), read, write, Qfalse);
+ rb_attr(klass, rb_intern(name), read, write, FALSE);
+}
+
+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"), 0);
+ if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
+ me->def->body.cfunc.func == rb_any_to_s)
+ return 1;
+ return 0;
}
-#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
int
-#ifdef HAVE_STDARG_PROTOTYPES
rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
-#else
-rb_scan_args(argc, argv, fmt, va_alist)
- int argc;
- const VALUE *argv;
- const char *fmt;
- va_dcl
-#endif
-{
- int n, i = 0;
+{
+ int i;
const char *p = fmt;
VALUE *var;
va_list vargs;
-
- va_init_list(vargs, fmt);
-
- if (*p == '*') goto rest_arg;
+ int f_var = 0, f_hash = 0, f_block = 0;
+ int n_lead = 0, n_opt = 0, n_trail = 0, n_mand;
+ int argi = 0;
+ VALUE hash = Qnil;
if (ISDIGIT(*p)) {
- n = *p - '0';
- if (n > argc)
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
- for (i=0; i<n; i++) {
- var = va_arg(vargs, VALUE*);
- if (var) *var = argv[i];
+ n_lead = *p - '0';
+ p++;
+ if (ISDIGIT(*p)) {
+ n_opt = *p - '0';
+ p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ goto block_arg;
+ }
}
+ }
+ if (*p == '*') {
+ f_var = 1;
p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ }
}
- else {
- goto error;
+ block_arg:
+ if (*p == ':') {
+ f_hash = 1;
+ p++;
+ }
+ if (*p == '&') {
+ f_block = 1;
+ p++;
+ }
+ if (*p != '\0') {
+ rb_fatal("bad scan arg format: %s", fmt);
}
+ n_mand = n_lead + n_trail;
- if (ISDIGIT(*p)) {
- n = i + *p - '0';
- for (; i<n; i++) {
- var = va_arg(vargs, VALUE*);
- if (argc > i) {
- if (var) *var = argv[i];
- }
- else {
- if (var) *var = Qnil;
+ if (argc < n_mand)
+ goto argc_error;
+
+ va_start(vargs, fmt);
+
+ /* capture an option hash - phase 1: pop */
+ if (f_hash && n_mand < argc) {
+ VALUE last = argv[argc - 1];
+
+ if (NIL_P(last)) {
+ /* nil is taken as an empty option hash only if it is not
+ ambiguous; i.e. '*' is not specified and arguments are
+ given more than sufficient */
+ if (!f_var && n_mand + n_opt < argc)
+ argc--;
+ }
+ else {
+ hash = rb_check_hash_type(last);
+ if (!NIL_P(hash)) {
+ VALUE opts = rb_extract_keywords(&hash);
+ if (!hash) argc--;
+ hash = opts ? opts : Qnil;
}
}
- p++;
}
-
- if(*p == '*') {
- rest_arg:
- var = va_arg(vargs, VALUE*);
- if (argc > i) {
- if (var) *var = rb_ary_new4(argc-i, argv+i);
- i = argc;
+ /* capture leading mandatory arguments */
+ for (i = n_lead; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ /* capture optional arguments */
+ for (i = n_opt; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (argi < argc - n_trail) {
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ else {
+ if (var) *var = Qnil;
+ }
+ }
+ /* capture variable length arguments */
+ if (f_var) {
+ int n_var = argc - argi - n_trail;
+
+ var = va_arg(vargs, VALUE *);
+ if (0 < n_var) {
+ if (var) *var = rb_ary_new4(n_var, &argv[argi]);
+ argi += n_var;
}
else {
if (var) *var = rb_ary_new();
}
- p++;
}
-
- if (*p == '&') {
- var = va_arg(vargs, VALUE*);
+ /* capture trailing mandatory arguments */
+ for (i = n_trail; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ /* capture an option hash - phase 2: assignment */
+ if (f_hash) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = hash;
+ }
+ /* capture iterator block */
+ if (f_block) {
+ var = va_arg(vargs, VALUE *);
if (rb_block_given_p()) {
*var = rb_block_proc();
}
else {
*var = Qnil;
}
- p++;
}
va_end(vargs);
- if (*p != '\0') {
- goto error;
+ if (argi < argc) {
+ argc_error:
+ rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
}
- if (argc > i) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
+ 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";
}
- return argc;
+ error_message = rb_sprintf("%s keyword%s: %"PRIsVALUE, error, msg, keys);
- error:
- rb_fatal("bad scan arg format: %s", fmt);
- return 0;
+ 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_funcall(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
+}
+
+/*!
+ * \}
+ */
diff --git a/common.mk b/common.mk
index bf49aade4a..a5ce202910 100644
--- a/common.mk
+++ b/common.mk
@@ -2,35 +2,59 @@ bin: $(PROGRAM) $(WPROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
-RUBYLIB = -
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
+
+# V=0 quiet, V=1 verbose. other values don't work.
+V = 0
+Q1 = $(V:1=)
+Q = $(Q1:0=@)
+ECHO0 = $(ECHO1:0=echo)
+ECHO = @$(ECHO0)
+
+UNICODE_VERSION = 7.0.0
+
+RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
+RUN_OPTS = --disable-gems
-SPEC_GIT_BASE = git://github.com/rubyspec
+SPEC_GIT_BASE = git://github.com/ruby
MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git
RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git
+SIMPLECOV_GIT_URL = git://github.com/hsbt/simplecov.git
+
STATIC_RUBY = static-ruby
EXTCONF = extconf.rb
-RBCONFIG = ./.rbconfig.time
LIBRUBY_EXTS = ./.libruby-with-ext.time
+REVISION_H = ./.revision.time
+PLATFORM_D = ./$(PLATFORM_DIR)/.time
RDOCOUT = $(EXTOUT)/rdoc
+HTMLOUT = $(EXTOUT)/html
+CAPIOUT = doc/capi
-DMYEXT = dmyext.$(OBJEXT)
-MAINOBJ = main.$(OBJEXT)
-EXTOBJS =
-DLDOBJS = $(DMYEXT)
+INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
+NORMALMAINOBJ = main.$(OBJEXT)
+MAINOBJ = $(NORMALMAINOBJ)
+DLDOBJS = $(INITOBJS)
+EXTSOLIBS =
+MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) miniprelude.$(OBJEXT)
+ENC_MK = enc.mk
-OBJS = array.$(OBJEXT) \
+COMMONOBJS = array.$(OBJEXT) \
bignum.$(OBJEXT) \
class.$(OBJEXT) \
compar.$(OBJEXT) \
+ complex.$(OBJEXT) \
dir.$(OBJEXT) \
- dln.$(OBJEXT) \
+ dln_find.$(OBJEXT) \
+ encoding.$(OBJEXT) \
enum.$(OBJEXT) \
enumerator.$(OBJEXT) \
error.$(OBJEXT) \
eval.$(OBJEXT) \
+ load.$(OBJEXT) \
+ proc.$(OBJEXT) \
file.$(OBJEXT) \
gc.$(OBJEXT) \
hash.$(OBJEXT) \
@@ -38,37 +62,79 @@ OBJS = array.$(OBJEXT) \
io.$(OBJEXT) \
marshal.$(OBJEXT) \
math.$(OBJEXT) \
+ node.$(OBJEXT) \
numeric.$(OBJEXT) \
object.$(OBJEXT) \
pack.$(OBJEXT) \
parse.$(OBJEXT) \
process.$(OBJEXT) \
- prec.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
+ rational.$(OBJEXT) \
re.$(OBJEXT) \
- regex.$(OBJEXT) \
+ regcomp.$(OBJEXT) \
+ regenc.$(OBJEXT) \
+ regerror.$(OBJEXT) \
+ regexec.$(OBJEXT) \
+ regparse.$(OBJEXT) \
+ regsyntax.$(OBJEXT) \
ruby.$(OBJEXT) \
+ safe.$(OBJEXT) \
signal.$(OBJEXT) \
sprintf.$(OBJEXT) \
st.$(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) \
+ vm.$(OBJEXT) \
+ vm_dump.$(OBJEXT) \
+ vm_backtrace.$(OBJEXT) \
+ vm_trace.$(OBJEXT) \
+ thread.$(OBJEXT) \
+ cont.$(OBJEXT) \
+ $(DTRACE_OBJ) \
+ $(BUILTIN_ENCOBJS) \
+ $(BUILTIN_TRANSOBJS) \
$(MISSING)
+EXPORTOBJS = $(DLNOBJ) \
+ localeinit.$(OBJEXT) \
+ loadpath.$(OBJEXT) \
+ $(COMMONOBJS)
+
+OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
+
+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
+
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
-EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) --
+EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
+ --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --gnumake=$(gnumake) \
+ --
+INSTRUBY = $(SUDO) $(RUNRUBY) -r./$(arch)-fake $(srcdir)/tool/rbinstall.rb
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
--prog-mode=$(INSTALL_PROG_MODE) \
- --installed-list $(INSTALLED_LIST)
+ --installed-list $(INSTALLED_LIST) \
+ --mantype="$(MANTYPE)"
INSTALL_PROG_MODE = 0755
INSTALL_DATA_MODE = 0644
@@ -78,254 +144,513 @@ PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil'
TESTSDIR = $(srcdir)/test
TESTWORKDIR = testwork
-all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS)
-prog: $(PROGRAM) $(WPROGRAM)
+TESTRUN_SCRIPT = $(srcdir)/test.rb
+
+BOOTSTRAPRUBY = $(BASERUBY)
+
+COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
+
+all: showflags main docs
+
+main: showflags exts $(ENCSTATIC:static=lib)encs
+ @$(NULLCMD)
+
+.PHONY: showflags
+exts enc trans: showflags
+showflags:
+ $(MESSAGE_BEGIN) \
+ " CC = $(CC)" \
+ " LD = $(LD)" \
+ " LDSHARED = $(LDSHARED)" \
+ " CFLAGS = $(CFLAGS)" \
+ " XCFLAGS = $(XCFLAGS)" \
+ " CPPFLAGS = $(CPPFLAGS)" \
+ " DLDFLAGS = $(DLDFLAGS)" \
+ " SOLIBS = $(SOLIBS)" \
+ $(MESSAGE_END)
+ -@$(CC_VERSION)
+
+.PHONY: showconfig
+showconfig:
+ @$(ECHO_BEGIN) \
+ $(configure_args) \
+ $(ECHO_END)
+
+exts: build-ext
+
+EXTS_MK = exts.mk
+$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(ECHO) generating makefile $@
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
+
+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)
+
+prog: program wprogram
-miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT)
+$(PREP): $(MKFILES)
-$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
-$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
+objs: $(ALLOBJS)
-$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE)
+GORUBY = go$(RUBY_INSTALL_NAME)
+golf: $(LIBRUBY) $(GOLFOBJS) PHONY
+ $(Q) $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
+capi: $(CAPIOUT)/.timestamp PHONY
+
+$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
+ $(Q) $(MAKEDIRS) "$(@D)"
+ $(ECHO) generating capi
+ -$(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)
+ $(ECHO) generating $@
+ $(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) $(WPROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
+
+$(LIBRUBY_A): $(LIBRUBY_A_OBJS) $(MAINOBJ) $(INITOBJS) $(ARCHFILE)
+
+$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
$(LIBRUBY_EXTS):
@exit > $@
$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
- @$(RM) $@
+ $(Q)$(RM) $@
$(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
-ruby.imp: $(OBJS)
- @$(NM) -Pgp $(OBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
+ruby.imp: $(COMMONOBJS)
+ $(Q)$(NM) -Pgp $(COMMONOBJS) | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
+ sort -u -o $@
+
+install: install-$(INSTALLDOC)
+docs: $(DOCTARGETS)
+pkgconfig-data: $(ruby_pc)
+$(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
-install: install-nodoc $(RDOCTARGET)
-install-all: install-nodoc install-doc
+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
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+do-install-nodoc: main pre-install-nodoc
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
-loadpath: $(PREP)
- $(MINIRUBY) -e 'p $$:'
-
+do-install-local: $(PROGRAM) pre-install-local
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+do-install-ext: exts pre-install-ext
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+do-install-arch: main do-install-arch
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+do-install-comm: $(PREP) pre-install-comm
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+do-install-bin: $(PROGRAM) pre-install-bin
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+do-install-lib: $(PREP) pre-install-lib
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+do-install-ext-comm: exts pre-install-ext-comm
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+do-install-ext-arch: exts pre-install-ext-arch
+ $(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:
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+do-install-man: $(PREP) pre-install-man
+ $(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
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=capi
+post-install-capi::
+ @$(NULLCMD)
+
what-where: no-install
-no-install: no-install-nodoc no-install-doc
+no-install: no-install-$(INSTALLDOC)
what-where-all: no-install-all
-no-install-all: no-install-nodoc
+no-install-all: pre-no-install-all dont-install-all post-no-install-all
+pre-no-install-all:: pre-no-install-local pre-no-install-ext pre-no-install-doc
+dont-install-all: $(PROGRAM)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
+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
-dont-install-nodoc:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+dont-install-nodoc: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS)
post-no-install-nodoc:: post-no-install-local post-no-install-ext
what-where-local: no-install-local
no-install-local: pre-no-install-local dont-install-local post-no-install-local
pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
-dont-install-local:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+dont-install-local: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
what-where-ext: no-install-ext
no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
-dont-install-ext:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
+dont-install-ext: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
what-where-arch: no-install-arch
no-install-arch: pre-no-install-arch dont-install-arch post-no-install-arch
pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
-dont-install-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
+dont-install-arch: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-no-install-arch:: post-no-install-lib post-no-install-man post-no-install-ext-arch
what-where-comm: no-install-comm
no-install-comm: pre-no-install-comm dont-install-comm post-no-install-comm
pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm pre-no-install-man
-dont-install-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
+dont-install-comm: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
post-no-install-comm:: post-no-install-lib post-no-install-ext-comm post-no-install-man
what-where-bin: no-install-bin
no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
pre-no-install-bin:: install-prereq
-dont-install-bin:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
+dont-install-bin: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-no-install-bin::
@$(NULLCMD)
what-where-lib: no-install-lib
no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
pre-no-install-lib:: install-prereq
-dont-install-lib:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
+dont-install-lib: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=lib
post-no-install-lib::
@$(NULLCMD)
what-where-ext-comm: no-install-ext-comm
no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm post-no-install-ext-comm
pre-no-install-ext-comm:: install-prereq
-dont-install-ext-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
+dont-install-ext-comm: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
post-no-install-ext-comm::
@$(NULLCMD)
what-where-ext-arch: no-install-ext-arch
no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch post-no-install-ext-arch
pre-no-install-ext-arch:: install-prereq
-dont-install-ext-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
+dont-install-ext-arch: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-no-install-ext-arch::
@$(NULLCMD)
what-where-man: no-install-man
no-install-man: pre-no-install-man dont-install-man post-no-install-man
pre-no-install-man:: install-prereq
-dont-install-man:
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+dont-install-man: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
post-no-install-man::
@$(NULLCMD)
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
-do-install-doc: $(PROGRAM)
- $(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
+do-install-doc: $(PROGRAM) pre-install-doc
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
-rdoc: $(PROGRAM) PHONY
+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
- $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" "$(srcdir)"
+ $(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
no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc
pre-no-install-doc:: install-prereq
-dont-install-doc::
- $(MINIRUBY) $(srcdir)/instruby.rb -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
+dont-install-doc:: $(PREP)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-no-install-doc::
@$(NULLCMD)
CLEAR_INSTALLED_LIST = clear-installed-list
-install-prereq: $(CLEAR_INSTALLED_LIST)
+install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake sudo-precheck PHONY
-clear-installed-list:
- @exit > $(INSTALLED_LIST)
+clear-installed-list: PHONY
+ @> $(INSTALLED_LIST) set MAKE="$(MAKE)"
-clean: clean-ext clean-local
-clean-local::
- @$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
- @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
- @$(RM) y.tab.c y.output
-clean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) clean
+clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-platform
+clean-local:: clean-runnable
+ $(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
+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
+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
-distclean: distclean-ext distclean-local
+distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
distclean-local:: clean-local
- @$(RM) $(MKFILES) config.h rbconfig.rb
- @$(RM) config.cache config.log config.status
- @$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
-distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) distclean
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(arch)-fake.rb
+ $(Q)$(RM) config.cache config.status config.status.lineno
+ $(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
+distclean-ext:: PHONY
+distclean-golf: clean-golf
+distclean-rdoc: PHONY
+distclean-html: PHONY
+distclean-capi: PHONY
+distclean-extout: clean-extout
+distclean-platform: clean-platform
-realclean:: realclean-ext realclean-local
+realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
realclean-local:: distclean-local
- @$(RM) parse.c lex.c
-realclean-ext::
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) realclean
+ $(Q)$(RM) parse.c parse.h lex.c newline.c $(PRELUDES) revision.h
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c newline.c $(PRELUDES) revision.h
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure tool/config.guess tool/config.sub gems/*.gem
+realclean-ext:: PHONY
+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-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-all
+ $(ECHO) check succeeded
+check-ruby: test test-ruby
-check: test test-all
+fake: $(CROSS_COMPILING)-fake
+yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY
+no-fake: PHONY
-test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
- @$(MINIRUBY) $(srcdir)/rubytest.rb
+btest: $(TEST_RUNNABLE)-btest
+no-btest: PHONY
+yes-btest: fake miniruby$(EXEEXT) PHONY
+ $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS)
-test-all:
- $(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)" --runner=$(TESTUI) $(TESTS)
+btest-ruby: $(TEST_RUNNABLE)-btest-ruby
+no-btest-ruby: PHONY
+yes-btest-ruby: prog PHONY
+ $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
-extconf:
- $(MINIRUBY) -run -e mkdir -- -p "$(EXTCONFDIR)"
+test-sample: $(TEST_RUNNABLE)-test-sample
+no-test-sample: PHONY
+yes-test-sample: prog PHONY
+ $(Q)$(RUNRUBY) $(srcdir)/tool/rubytest.rb --run-opt=$(RUN_OPTS) $(OPTS) $(TESTOPTS)
+
+test-knownbugs: test-knownbug
+test-knownbug: $(TEST_RUNNABLE)-test-knownbug
+no-test-knownbug: PHONY
+yes-test-knownbug: prog PHONY
+ -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
+
+test: test-sample btest-ruby test-knownbug
+
+test-all: $(TEST_RUNNABLE)-test-all
+yes-test-all: prog PHONY
+ $(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-ruby: $(TEST_RUNNABLE)-test-ruby
+no-test-ruby: PHONY
+yes-test-ruby: prog encs PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
+
+extconf: $(PREP)
+ $(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
- @$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
+$(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)
+
+RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
+runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
+ $(Q) $(MINIRUBY) $(srcdir)/tool/mkrunnable.rb -v $(EXTOUT)
+yes-runnable: PHONY
+
+encs: enc trans
+libencs: libenc libtrans
+encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP) PHONY
+ $(ECHO) making $@
+ $(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
+ RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
+ $(MFLAGS) $@
+
+
+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)
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $@ $(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: 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
+.PHONY: run runruby parse benchmark benchmark-each tbench gdb gdb-ruby
+.PHONY: update-mspec update-rubyspec test-rubyspec
PHONY:
-{$(VPATH)}parse.c: parse.y
+{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed {$(VPATH)}id.h
+{$(VPATH)}parse.h: {$(VPATH)}parse.c
+
+{$(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)$(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
+ $(Q)$(MV) $@.new $@
+ $(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 > $@
+
+###
+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
+alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
crypt.$(OBJEXT): {$(VPATH)}crypt.c
dup2.$(OBJEXT): {$(VPATH)}dup2.c
erf.$(OBJEXT): {$(VPATH)}erf.c
@@ -334,135 +659,1741 @@ flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
-vsnprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
-strcasecmp.$(OBJEXT): {$(VPATH)}strcasecmp.c
-strncasecmp.$(OBJEXT): {$(VPATH)}strncasecmp.c
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
-strftime.$(OBJEXT): {$(VPATH)}strftime.c
+strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
+strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
-strtoul.$(OBJEXT): {$(VPATH)}strtoul.c
nt.$(OBJEXT): {$(VPATH)}nt.c
-x68.$(OBJEXT): {$(VPATH)}x68.c
os2.$(OBJEXT): {$(VPATH)}os2.c
dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
-# when I use -I., there is confliction at "OpenFile"
-# so, set . into environment varible "include"
-win32.$(OBJEXT): {$(VPATH)}win32.c
-
###
-array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}util.h {$(VPATH)}st.h
-bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h
-class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}st.h
-compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}util.h
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}dln.h
-dmydln.$(OBJEXT): {$(VPATH)}dmydln.c dln.$(OBJEXT)
+# dependencies for generated C sources.
+parse.$(OBJEXT): {$(VPATH)}parse.c
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
+prelude.$(OBJEXT): {$(VPATH)}prelude.c
+
+# dependencies for optional sources.
+compile.$(OBJEXT): {$(VPATH)}opt_sc.inc {$(VPATH)}optunifs.inc
+
+win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c {$(VPATH)}dln.h {$(VPATH)}dln_find.c \
+ {$(VPATH)}internal.h $(RUBY_H_INCLUDES) $(PLATFORM_D)
+win32/file.$(OBJEXT): {$(VPATH)}win32/file.c {$(VPATH)}thread.h \
+ $(RUBY_H_INCLUDES) $(PLATFORM_D)
+
+$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
+ $(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
+newline.$(OBJEXT): $(NEWLINE_C)
+
+verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb
+ $(ECHO) creating $@
+ $(Q) $(MINIRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
+
+ruby-glommed.$(OBJEXT): $(OBJS)
+
+$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
+
+INSNS2VMOPT = --srcdir="$(srcdir)"
+
+{$(VPATH)}minsns.inc: $(srcdir)/template/minsns.inc.tmpl
+
+{$(VPATH)}opt_sc.inc: $(srcdir)/template/opt_sc.inc.tmpl
+
+{$(VPATH)}optinsn.inc: $(srcdir)/template/optinsn.inc.tmpl
+
+{$(VPATH)}optunifs.inc: $(srcdir)/template/optunifs.inc.tmpl
+
+{$(VPATH)}insns.inc: $(srcdir)/template/insns.inc.tmpl
+
+{$(VPATH)}insns_info.inc: $(srcdir)/template/insns_info.inc.tmpl
+
+{$(VPATH)}vmtc.inc: $(srcdir)/template/vmtc.inc.tmpl
+
+{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
+
+common-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c \
+ srcs-lib srcs-ext
+
+srcs: common-srcs srcs-enc
+
+EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \
+ $(srcdir)/ext/rbconfig/sizeof/sizes.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 \
+ $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h enc/jis/props.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
+
+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
+
+node_name.inc: {$(VPATH)}node.h
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
+
+encdb.h: $(PREP) $(srcdir)/tool/generic_erb.rb $(srcdir)/template/encdb.h.tmpl
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/encdb.h.tmpl $(srcdir)/enc enc
+
+transdb.h: $(PREP) srcs-enc $(srcdir)/tool/generic_erb.rb $(srcdir)/template/transdb.h.tmpl
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/transdb.h.tmpl $(srcdir)/enc/trans enc/trans
+
+enc/encinit.c: $(ENC_MK) $(srcdir)/enc/encinit.c.erb
+
+known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
+
+$(MINIPRELUDE_C): $(COMPILE_PRELUDE)
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
+ $(srcdir)/template/prelude.c.tmpl
+
+$(PRELUDE_C): $(COMPILE_PRELUDE) \
+ {$(srcdir)}lib/rubygems/defaults.rb \
+ {$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(LIB_SRCS)
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
+
+{$(VPATH)}golf_prelude.c: $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(srcdir)/template/prelude.c.tmpl golf_prelude.rb
+
+probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
+ $(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
+
+probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
+
+prereq: incs srcs preludes PHONY
+
+preludes: {$(VPATH)}prelude.c
+preludes: {$(VPATH)}miniprelude.c
+preludes: {$(srcdir)}golf_prelude.c
+
+$(srcdir)/revision.h:
+ @exit > $@
+
+$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
+ -$(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
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) RM="$(RM)" VPATH="$(PWD)" \
+ top_srcdir=../.. srcdir=. \
+ RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
+
+$(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)"
+
+$(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
+ $(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
+ $(ECHO) generating $@
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)"
+
+##
+
+run: fake miniruby$(EXEEXT) PHONY
+ $(BTESTRUBY) $(TESTRUN_SCRIPT) $(RUNOPT)
+
+runruby: $(PROGRAM) PHONY
+ $(RUNRUBY) $(TESTRUN_SCRIPT)
+
+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 =
+
+benchmark: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
+
+benchmark-each: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
+
+tbench: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
+
+run.gdb:
+ echo set breakpoint pending on > 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
+ echo source $(srcdir)/breakpoints.gdb >> run.gdb
+ echo source $(srcdir)/.gdbinit >> run.gdb
+ echo 'set $$_exitcode = -999' >> run.gdb
+ echo run >> run.gdb
+ echo 'if $$_exitcode != -999' >> run.gdb
+ echo ' quit' >> run.gdb
+ echo end >> run.gdb
+
+
+gdb: miniruby$(EXEEXT) run.gdb PHONY
+ gdb -x run.gdb --quiet --args $(MINIRUBY) $(TESTRUN_SCRIPT)
+
+gdb-ruby: $(PROGRAM) run.gdb PHONY
+ $(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
+
+dist:
+ $(BASERUBY) $(srcdir)/tool/make-snapshot -srcdir=$(srcdir) 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
+
+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_CACHE = clean-extlibs
+
+info: info-program info-libruby_a info-libruby_so info-arch
+info-program: PHONY
+ @echo PROGRAM=$(PROGRAM)
+info-libruby_a: PHONY
+ @echo LIBRUBY_A=$(LIBRUBY_A)
+info-libruby_so: PHONY
+ @echo LIBRUBY_SO=$(LIBRUBY_SO)
+info-arch: PHONY
+ @echo arch=$(arch)
+
+change: PHONY
+ $(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
+
+love: sudo-precheck up all test install test-all
+ @echo love is all you need
+
+yes-test-all: sudo-precheck
+
+sudo-precheck: PHONY
+ @$(SUDO) echo > $(NULL)
+
+help: PHONY
+ $(MESSAGE_BEGIN) \
+ " Makefile of Ruby" \
+ "" \
+ "targets:" \
+ " all (default): builds all of below" \
+ " miniruby: builds only miniruby" \
+ " encs: builds encodings" \
+ " exts: builds extensions" \
+ " main: builds encodings, extensions and ruby" \
+ " docs: builds documents" \
+ " run: runs test.rb by miniruby" \
+ " runruby: runs test.rb by ruby you just built" \
+ " gdb: runs test.rb by miniruby under gdb" \
+ " gdb-ruby: runs test.rb by ruby under gdb" \
+ " check: equals make test test-all" \
+ " test: ruby core tests" \
+ " test-all: all ruby tests [TESTS=<test files>]" \
+ " 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" \
+ " install: install all ruby distributions" \
+ " install-nodoc: install without rdoc" \
+ " install-cross: install cross compiling staff" \
+ " clean: clean for tarball" \
+ " distclean: clean for repository" \
+ " change: make change log template" \
+ " golf: for golfers" \
+ "" \
+ "see DeveloperHowto for more detail: " \
+ " https://bugs.ruby-lang.org/projects/ruby/wiki/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
+ascii.$(OBJEXT): {$(VPATH)}ascii.c
+ascii.$(OBJEXT): {$(VPATH)}config.h
+ascii.$(OBJEXT): {$(VPATH)}defines.h
+ascii.$(OBJEXT): {$(VPATH)}missing.h
+ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+ascii.$(OBJEXT): {$(VPATH)}regenc.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)}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)}encoding.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)}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)}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
-enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}node.h {$(VPATH)}util.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}st.h
-eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}node.h {$(VPATH)}env.h {$(VPATH)}util.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h
-file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
- {$(VPATH)}dln.h
-gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}node.h \
- {$(VPATH)}env.h {$(VPATH)}re.h {$(VPATH)}regex.h
-hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}rubysig.h
-inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
- {$(VPATH)}env.h
-main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}st.h {$(VPATH)}util.h
-math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}env.h {$(VPATH)}defines.h {$(VPATH)}intern.h \
- {$(VPATH)}missing.h
-object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}util.h
-pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h \
- {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c
-prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h
-random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}re.h {$(VPATH)}regex.h
-regex.$(OBJEXT): {$(VPATH)}regex.c config.h {$(VPATH)}regex.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}dln.h {$(VPATH)}node.h {$(VPATH)}util.h
-signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h
-sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-st.$(OBJEXT): {$(VPATH)}st.c config.h {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}re.h {$(VPATH)}regex.h
-struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}env.h {$(VPATH)}node.h {$(VPATH)}st.h {$(VPATH)}util.h
-version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}version.h
-
-dist: $(PROGRAM)
- $(RUNRUBY) $(srcdir)/distruby.rb
+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)}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)}node.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)}node.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)}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)}thread.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)}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)}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)}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)}encoding.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
+newline.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+newline.$(OBJEXT): {$(VPATH)}config.h
+newline.$(OBJEXT): {$(VPATH)}defines.h
+newline.$(OBJEXT): {$(VPATH)}intern.h
+newline.$(OBJEXT): {$(VPATH)}missing.h
+newline.$(OBJEXT): {$(VPATH)}newline.c
+newline.$(OBJEXT): {$(VPATH)}st.h
+newline.$(OBJEXT): {$(VPATH)}subst.h
+newline.$(OBJEXT): {$(VPATH)}transcode_data.h
+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)}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)}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_$(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): $(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)}encoding.h
+string.$(OBJEXT): {$(VPATH)}gc.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)}node.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)}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)}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
+unicode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+unicode.$(OBJEXT): {$(VPATH)}config.h
+unicode.$(OBJEXT): {$(VPATH)}defines.h
+unicode.$(OBJEXT): {$(VPATH)}intern.h
+unicode.$(OBJEXT): {$(VPATH)}missing.h
+unicode.$(OBJEXT): {$(VPATH)}oniguruma.h
+unicode.$(OBJEXT): {$(VPATH)}regenc.h
+unicode.$(OBJEXT): {$(VPATH)}regint.h
+unicode.$(OBJEXT): {$(VPATH)}st.h
+unicode.$(OBJEXT): {$(VPATH)}subst.h
+unicode.$(OBJEXT): {$(VPATH)}unicode.c
+unicode.$(OBJEXT): {$(VPATH)}unicode/casefold.h
+unicode.$(OBJEXT): {$(VPATH)}unicode/name2ctype.h
+us_ascii.$(OBJEXT): {$(VPATH)}config.h
+us_ascii.$(OBJEXT): {$(VPATH)}defines.h
+us_ascii.$(OBJEXT): {$(VPATH)}missing.h
+us_ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+us_ascii.$(OBJEXT): {$(VPATH)}regenc.h
+us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c
+utf_8.$(OBJEXT): {$(VPATH)}config.h
+utf_8.$(OBJEXT): {$(VPATH)}defines.h
+utf_8.$(OBJEXT): {$(VPATH)}missing.h
+utf_8.$(OBJEXT): {$(VPATH)}oniguruma.h
+utf_8.$(OBJEXT): {$(VPATH)}regenc.h
+utf_8.$(OBJEXT): {$(VPATH)}utf_8.c
+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)}node.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)}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_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_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 1488b2c65d..3d0a3e81dc 100644
--- a/compar.c
+++ b/compar.c
@@ -3,84 +3,92 @@
compar.c -
$Author$
- $Date$
created at: Thu Aug 26 14:39:48 JST 1993
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_mComparable;
static ID cmp;
-int
-rb_cmpint(val, a, b)
- VALUE val, a, b;
+void
+rb_cmperr(VALUE x, VALUE y)
{
- if (NIL_P(val)) {
- rb_cmperr(a, b);
+ VALUE classname;
+
+ if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
+ classname = rb_inspect(y);
}
- if (FIXNUM_P(val)) return FIX2INT(val);
- if (TYPE(val) == T_BIGNUM) {
- if (RBIGNUM(val)->sign) return 1;
- return -1;
+ else {
+ classname = rb_obj_class(y);
}
- if (RTEST(rb_funcall(val, '>', 1, INT2FIX(0)))) return 1;
- if (RTEST(rb_funcall(val, '<', 1, INT2FIX(0)))) return -1;
- return 0;
+ rb_raise(rb_eArgError, "comparison of %"PRIsVALUE" with %"PRIsVALUE" failed",
+ rb_obj_class(x), classname);
}
-void
-rb_cmperr(x, y)
- VALUE x, y;
+static VALUE
+invcmp_recursive(VALUE x, VALUE y, int recursive)
{
- const char *classname;
+ if (recursive) return Qnil;
+ return rb_check_funcall(y, cmp, 1, &x);
+}
- if (SPECIAL_CONST_P(y)) {
- y = rb_inspect(y);
- classname = StringValuePtr(y);
+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 {
- classname = rb_obj_classname(y);
+ int result = -rb_cmpint(invcmp, x, y);
+ return INT2FIX(result);
}
- rb_raise(rb_eArgError, "comparison of %s with %s failed",
- rb_obj_classname(x), classname);
}
-#define cmperr() (rb_cmperr(x, y), Qnil)
+static VALUE
+cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
+{
+ if (recursive) return Qnil;
+ return rb_funcallv(arg1, cmp, 1, &arg2);
+}
static VALUE
-cmp_eq(a)
- VALUE *a;
+cmp_eq(VALUE *a)
{
- VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
+ VALUE c = rb_exec_recursive_paired_outer(cmp_eq_recursive, a[0], a[1], a[1]);
- if (NIL_P(c)) return Qnil;
+ if (NIL_P(c)) return Qfalse;
if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;
return Qfalse;
}
static VALUE
-cmp_failed()
+cmp_failed(void)
{
- return Qnil;
+ rb_warn("Comparable#== will no more rescue exceptions of #<=> in the next release.");
+ rb_warn("Return nil in #<=> if the comparison is inappropriate or avoid such comparison.");
+ return Qfalse;
}
/*
* call-seq:
- * obj == other => true or false
- *
+ * obj == other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0. Also returns true if
* _obj_ and _other_ are the same object.
+ *
+ * Even if _obj_ <=> _other_ raised an exception, the exception
+ * is ignored and returns false.
*/
static VALUE
-cmp_equal(x, y)
- VALUE x, y;
+cmp_equal(VALUE x, VALUE y)
{
VALUE a[2];
@@ -92,99 +100,89 @@ cmp_equal(x, y)
/*
* call-seq:
- * obj > other => true or false
- *
+ * obj > other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 1.
*/
static VALUE
-cmp_gt(x, y)
- VALUE x, y;
+cmp_gt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) > 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj >= other => true or false
- *
+ * obj >= other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0 or 1.
*/
static VALUE
-cmp_ge(x, y)
- VALUE x, y;
+cmp_ge(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) >= 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj < other => true or false
- *
+ * obj < other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1.
*/
static VALUE
-cmp_lt(x, y)
- VALUE x, y;
+cmp_lt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) < 0) return Qtrue;
return Qfalse;
}
-
/*
* call-seq:
- * obj <= other => true or false
- *
+ * obj <= other -> true or false
+ *
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1 or 0.
*/
static VALUE
-cmp_le(x, y)
- VALUE x, y;
+cmp_le(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
- if (NIL_P(c)) return cmperr();
if (rb_cmpint(c, x, y) <= 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * obj.between?(min, max) => true or false
- *
+ * obj.between?(min, max) -> true or false
+ *
* Returns <code>false</code> if <i>obj</i> <code><=></code>
* <i>min</i> is less than zero or if <i>anObject</i> <code><=></code>
* <i>max</i> is greater than zero, <code>true</code> otherwise.
- *
+ *
* 3.between?(1, 5) #=> true
* 6.between?(1, 5) #=> false
* 'cat'.between?('ant', 'dog') #=> true
* 'gnu'.between?('ant', 'dog') #=> false
- *
+ *
*/
static VALUE
-cmp_between(x, min, max)
- VALUE x, min, max;
+cmp_between(VALUE x, VALUE min, VALUE max)
{
if (RTEST(cmp_lt(x, min))) return Qfalse;
if (RTEST(cmp_gt(x, max))) return Qfalse;
@@ -196,11 +194,13 @@ cmp_between(x, min, max)
* may be ordered. The class must define the <code><=></code> operator,
* which compares the receiver against another object, returning -1, 0,
* or +1 depending on whether the receiver is less than, equal to, or
- * greater than the other object. <code>Comparable</code> uses
+ * greater than the other object. If the other object is not comparable
+ * then the <code><=></code> operator should return nil.
+ * <code>Comparable</code> uses
* <code><=></code> to implement the conventional comparison operators
* (<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>,
* and <code>></code>) and the method <code>between?</code>.
- *
+ *
* class SizeMatters
* include Comparable
* attr :str
@@ -214,23 +214,26 @@ cmp_between(x, min, max)
* @str
* end
* end
- *
+ *
* s1 = SizeMatters.new("Z")
* s2 = SizeMatters.new("YY")
* s3 = SizeMatters.new("XXX")
* s4 = SizeMatters.new("WWWW")
* s5 = SizeMatters.new("VVVVV")
- *
+ *
* s1 < s2 #=> true
* s4.between?(s1, s3) #=> false
* s4.between?(s3, s5) #=> true
* [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV]
- *
+ *
*/
void
-Init_Comparable()
+Init_Comparable(void)
{
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
rb_mComparable = rb_define_module("Comparable");
rb_define_method(rb_mComparable, "==", cmp_equal, 1);
rb_define_method(rb_mComparable, ">", cmp_gt, 1);
diff --git a/compile.c b/compile.c
new file mode 100644
index 0000000000..36db683c4a
--- /dev/null
+++ b/compile.c
@@ -0,0 +1,6415 @@
+/**********************************************************************
+
+ compile.c - ruby node tree -> VM instruction sequence
+
+ $Author$
+ created at: 04/01/01 03:42:15 JST
+
+ Copyright (C) 2004-2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "internal.h"
+#include <math.h>
+
+#define USE_INSN_STACK_INCREASE 1
+#include "vm_core.h"
+#include "iseq.h"
+#include "insns.inc"
+#include "insns_info.inc"
+
+#ifdef HAVE_DLADDR
+# include <dlfcn.h>
+#endif
+
+#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
+#define FIXNUM_OR(n, i) ((n)|INT2FIX(i))
+
+typedef struct iseq_link_element {
+ enum {
+ ISEQ_ELEMENT_NONE,
+ ISEQ_ELEMENT_LABEL,
+ ISEQ_ELEMENT_INSN,
+ ISEQ_ELEMENT_ADJUST
+ } type;
+ struct iseq_link_element *next;
+ struct iseq_link_element *prev;
+} LINK_ELEMENT;
+
+typedef struct iseq_link_anchor {
+ LINK_ELEMENT 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;
+ int position;
+ int sc_state;
+ int set;
+ int sp;
+ unsigned int rescued: 2;
+} LABEL;
+
+typedef struct iseq_insn_data {
+ LINK_ELEMENT link;
+ enum ruby_vminsn_type insn_id;
+ unsigned int line_no;
+ int operand_size;
+ int sc_state;
+ VALUE *operands;
+} INSN;
+
+typedef struct iseq_adjust_data {
+ LINK_ELEMENT link;
+ LABEL *label;
+ int line_no;
+} ADJUST;
+
+struct ensure_range {
+ LABEL *begin;
+ LABEL *end;
+ struct ensure_range *next;
+};
+
+struct iseq_compile_data_ensure_node_stack {
+ NODE *ensure_node;
+ struct iseq_compile_data_ensure_node_stack *prev;
+ struct ensure_range *erange;
+};
+
+/**
+ * debug function(macro) interface depend on CPDEBUG
+ * if it is less than 0, runtime option is in effect.
+ *
+ * debug level:
+ * 0: no debug output
+ * 1: show node type
+ * 2: show node important parameters
+ * ...
+ * 5: show other parameters
+ * 10: show every AST array
+ */
+
+#ifndef CPDEBUG
+#define CPDEBUG 0
+#endif
+
+#if CPDEBUG >= 0
+#define compile_debug CPDEBUG
+#else
+#define compile_debug iseq->compile_data->option->debug_level
+#endif
+
+#if CPDEBUG
+
+#define compile_debug_print_indent(level) \
+ ruby_debug_print_indent((level), compile_debug, gl_node_level * 2)
+
+#define debugp(header, value) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_value(1, compile_debug, (header), (value)))
+
+#define debugi(header, id) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_id(1, compile_debug, (header), (id)))
+
+#define debugp_param(header, value) (void) \
+ (compile_debug_print_indent(1) && \
+ ruby_debug_print_value(1, compile_debug, (header), (value)))
+
+#define debugp_verbose(header, value) (void) \
+ (compile_debug_print_indent(2) && \
+ ruby_debug_print_value(2, compile_debug, (header), (value)))
+
+#define debugp_verbose_node(header, value) (void) \
+ (compile_debug_print_indent(10) && \
+ ruby_debug_print_value(10, compile_debug, (header), (value)))
+
+#define debug_node_start(node) ((void) \
+ (compile_debug_print_indent(1) && \
+ (ruby_debug_print_node(1, CPDEBUG, "", (NODE *)(node)), gl_node_level)), \
+ gl_node_level++)
+
+#define debug_node_end() gl_node_level --
+
+#else
+
+static inline ID
+r_id(ID id)
+{
+ return id;
+}
+
+static inline VALUE
+r_value(VALUE value)
+{
+ return value;
+}
+
+#define debugi(header, id) r_id(id)
+#define debugp(header, value) r_value(value)
+#define debugp_verbose(header, value) r_value(value)
+#define debugp_verbose_node(header, value) r_value(value)
+#define debugp_param(header, value) r_value(value)
+#define debug_node_start(node) ((void)0)
+#define debug_node_end() ((void)0)
+#endif
+
+#if CPDEBUG > 1 || CPDEBUG < 0
+#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
+#define debugs if(0)printf
+#define debug_compile(msg, v) (v)
+#endif
+
+
+/* create new label */
+#define NEW_LABEL(l) new_label_body(iseq, (l))
+
+#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_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))
+
+#define NEW_CHILD_ISEQVAL(node, name, type, line_no) \
+ new_child_iseq(iseq, (node), rb_fstring(name), iseq->self, (type), (line_no))
+
+/* add instructions */
+#define ADD_SEQ(seq1, seq2) \
+ APPEND_LIST((seq1), (seq2))
+
+/* add an instruction */
+#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)))
+
+/* add an instruction with label operand (alias of ADD_INSN1) */
+#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 *) \
+ new_insn_body(iseq, (line), BIN(insn), 2, (VALUE)(op1), (VALUE)(op2)))
+
+#define ADD_INSN3(seq, line, insn, op1, op2, op3) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_body(iseq, (line), BIN(insn), 3, (VALUE)(op1), (VALUE)(op2), (VALUE)(op3)))
+
+/* Specific Insn factory */
+#define ADD_SEND(seq, line, id, argc) \
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0), NULL)
+
+#define ADD_SEND_WITH_FLAG(seq, line, id, argc, flag) \
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)(flag), NULL)
+
+#define ADD_SEND_WITH_BLOCK(seq, line, id, argc, block) \
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)(block), (VALUE)INT2FIX(0), NULL)
+
+#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), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+
+#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+
+#define ADD_SEND_R(seq, line, id, argc, block, flag, keywords) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag), (keywords)))
+
+#define ADD_TRACE(seq, line, event) \
+ do { \
+ if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
+ (line) > 0 && \
+ (line) != iseq->compile_data->last_coverable_line) { \
+ RARRAY_ASET(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->option->trace_instruction) { \
+ ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
+ } \
+ } while (0)
+
+/* add label */
+#define ADD_LABEL(seq, label) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) (label))
+
+#define APPEND_LABEL(seq, before, label) \
+ APPEND_ELEM((seq), (before), (LINK_ELEMENT *) (label))
+
+#define ADD_ADJUST(seq, line, label) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), (line)))
+
+#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) \
+ (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) \
+ (debug_compile("== " desc "\n", \
+ iseq_compile_each(iseq, (anchor), (node), 0)))
+
+/* compile node, this node's value will be popped */
+#define COMPILE_POPED(anchor, desc, node) \
+ (debug_compile("== " desc "\n", \
+ iseq_compile_each(iseq, (anchor), (node), 1)))
+
+/* compile node, which is popped when 'poped' is true */
+#define COMPILE_(anchor, desc, node, poped) \
+ (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)])
+
+#define INSN_OF(insn) \
+ (((INSN*)(insn))->insn_id)
+
+/* error */
+#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; \
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->err_info, GET_THREAD()->errinfo); \
+ GET_THREAD()->errinfo = tmp; \
+ ret = 0; \
+ break; \
+}
+
+#define ERROR_ARGS ruby_sourcefile, nd_line(node),
+
+
+#define COMPILE_OK 1
+#define COMPILE_NG 0
+
+
+/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
+ * missing */
+#define DECL_ANCHOR(name) \
+ LINK_ANCHOR *name, name##_body__ = {{0,},}
+#define INIT_ANCHOR(name) \
+ (name##_body__.last = &name##_body__.anchor, name = &name##_body__)
+
+#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC_CLEAR_CLASS(obj);} while (0)
+
+#include "optinsn.inc"
+#if OPT_INSTRUCTIONS_UNIFICATION
+#include "optunifs.inc"
+#endif
+
+/* for debug */
+#if CPDEBUG < 0
+#define ISEQ_ARG iseq,
+#define ISEQ_ARG_DECLARE rb_iseq_t *iseq,
+#else
+#define ISEQ_ARG
+#define ISEQ_ARG_DECLARE
+#endif
+
+#if CPDEBUG
+#define gl_node_level iseq->compile_data->node_level
+#endif
+
+static void dump_disasm_list(LINK_ELEMENT *elem);
+
+static int insn_data_length(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 LABEL *new_label_body(rb_iseq_t *iseq, long line);
+static ADJUST *new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line);
+
+static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * n, int);
+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_exception_local_table(rb_iseq_t *iseq);
+static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
+
+static int iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_set_exception_table(rb_iseq_t *iseq);
+static int iseq_set_optargs_table(rb_iseq_t *iseq);
+
+/*
+ * To make Array to LinkedList, use link_anchor
+ */
+
+static void
+verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *anchor)
+{
+#if CPDEBUG
+ int flag = 0;
+ LINK_ELEMENT *list, *plist;
+
+ if (!compile_debug) return;
+
+ list = anchor->anchor.next;
+ plist = &anchor->anchor;
+ while (list) {
+ if (plist != list->prev) {
+ flag += 1;
+ }
+ plist = list;
+ list = list->next;
+ }
+
+ if (anchor->last != plist && anchor->last != 0) {
+ flag |= 0x70000;
+ }
+
+ if (flag != 0) {
+ rb_bug("list verify error: %08x (%s)", flag, info);
+ }
+#endif
+}
+#if CPDEBUG < 0
+#define verify_list(info, anchor) verify_list(iseq, (info), (anchor))
+#endif
+
+/*
+ * elem1, elem2 => elem1, elem2, elem
+ */
+static void
+ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem)
+{
+ elem->prev = anchor->last;
+ anchor->last->next = elem;
+ anchor->last = elem;
+ verify_list("add", anchor);
+}
+
+/*
+ * elem1, before, elem2 => elem1, before, elem, elem2
+ */
+static void
+APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
+{
+ elem->prev = before;
+ elem->next = before->next;
+ elem->next->prev = elem;
+ before->next = elem;
+ if (before == anchor->last) anchor->last = elem;
+ verify_list("add", anchor);
+}
+#if CPDEBUG < 0
+#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, (anchor), (elem))
+#define APPEND_ELEM(anchor, before, elem) ADD_ELEM(iseq, (anchor), (before), (elem))
+#endif
+
+static int
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_iseq_add_mark_object(iseq, v);
+ }
+ return COMPILE_OK;
+}
+
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
+
+static int
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_ary_push(iseq->compile_data->mark_ary, v);
+ }
+ return COMPILE_OK;
+}
+
+static int
+validate_label(st_data_t name, st_data_t label, st_data_t arg)
+{
+ rb_iseq_t *iseq = (rb_iseq_t *)arg;
+ LABEL *lobj = (LABEL *)label;
+ if (!lobj->link.next) {
+ do {
+ int ret;
+ COMPILE_ERROR((ruby_sourcefile, lobj->position,
+ "%"PRIsVALUE": undefined label",
+ rb_id2str((ID)name)));
+ if (ret) break;
+ } while (0);
+ }
+ return ST_CONTINUE;
+}
+
+static void
+validate_labels(rb_iseq_t *iseq, st_table *labels_table)
+{
+ st_foreach(labels_table, validate_label, (st_data_t)iseq);
+ if (!NIL_P(iseq->compile_data->err_info)) {
+ rb_exc_raise(iseq->compile_data->err_info);
+ }
+}
+
+VALUE
+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);
+ iseq_set_local_table(iseq, 0);
+ }
+ else if (nd_type(node) == NODE_SCOPE) {
+ /* iseq type of top, method, class, block */
+ iseq_set_local_table(iseq, node->nd_tbl);
+ iseq_set_arguments(iseq, ret, node->nd_args);
+
+ switch (iseq->type) {
+ case ISEQ_TYPE_BLOCK:
+ {
+ 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->location.first_lineno), RUBY_EVENT_B_CALL);
+ ADD_LABEL(ret, start);
+ COMPILE(ret, "block body", node->nd_body);
+ ADD_LABEL(ret, end);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
+
+ /* wide range catch handler must put at last */
+ ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
+ ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
+ break;
+ }
+ case ISEQ_TYPE_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->location.first_lineno), RUBY_EVENT_CALL);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
+ break;
+ }
+ default: {
+ COMPILE(ret, "scoped node", node->nd_body);
+ break;
+ }
+ }
+ }
+ else if (nd_type(node) == NODE_IFUNC) {
+ /* user callback */
+ (*node->nd_cfnc)(iseq, ret, node->nd_tval);
+ }
+ else {
+ 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:
+ 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);
+ break;
+ case ISEQ_TYPE_ENSURE:
+ iseq_set_exception_local_table(iseq);
+ COMPILE_POPED(ret, "ensure", node);
+ break;
+ case ISEQ_TYPE_DEFINED_GUARD:
+ iseq_set_local_table(iseq, 0);
+ COMPILE(ret, "defined guard", node);
+ break;
+ default:
+ rb_bug("unknown scope");
+ }
+ }
+
+ 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->last_line, leave);
+ }
+
+#if SUPPORT_JOKE
+ if (iseq->compile_data->labels_table) {
+ validate_labels(iseq, iseq->compile_data->labels_table);
+ }
+#endif
+ return iseq_setup(iseq, ret);
+}
+
+int
+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;
+
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ int insn = (int)iseq->iseq_encoded[i];
+ int len = insn_len(insn);
+ iseq->iseq_encoded[i] = (VALUE)table[insn];
+ i += len;
+ }
+#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(rb_iseq_t *iseq) /* cold path */
+{
+ if (iseq->iseq) return iseq->iseq;
+
+ iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
+
+ MEMCPY(iseq->iseq, iseq->iseq_encoded, VALUE, iseq->iseq_size);
+
+#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
+ {
+ unsigned int i;
+
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ const void *addr = (const void *)iseq->iseq[i];
+ const int insn = rb_vm_insn_addr2insn(addr);
+
+ iseq->iseq[i] = insn;
+ i += insn_len(insn);
+ }
+ }
+#endif
+ return iseq->iseq;
+}
+
+/*********************************************/
+/* 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 accesss 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->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 */
+
+ if (size >= INT_MAX - padding) rb_memerror();
+ if (storage->pos + size + padding > storage->size) {
+ unsigned int alloc_size = storage->size;
+
+ while (alloc_size < size + PADDING_SIZE_MAX) {
+ if (alloc_size >= INT_MAX / 2) rb_memerror();
+ alloc_size *= 2;
+ }
+ storage->next = (void *)ALLOC_N(char, alloc_size +
+ SIZEOF_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 */
+ }
+
+#ifdef STRICT_ALIGNMENT
+ storage->pos += (int)padding;
+#endif /* STRICT_ALIGNMENT */
+
+ ptr = (void *)&storage->buff[storage->pos];
+ storage->pos += (int)size;
+ return ptr;
+}
+
+static INSN *
+compile_data_alloc_insn(rb_iseq_t *iseq)
+{
+ return (INSN *)compile_data_alloc(iseq, sizeof(INSN));
+}
+
+static LABEL *
+compile_data_alloc_label(rb_iseq_t *iseq)
+{
+ return (LABEL *)compile_data_alloc(iseq, sizeof(LABEL));
+}
+
+static ADJUST *
+compile_data_alloc_adjust(rb_iseq_t *iseq)
+{
+ return (ADJUST *)compile_data_alloc(iseq, sizeof(ADJUST));
+}
+
+/*
+ * elem1, elemX => elemX, elem2, elem1
+ */
+static void
+INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->prev = elem1->prev;
+ elem2->next = elem1;
+ elem1->prev = elem2;
+ if (elem2->prev) {
+ elem2->prev->next = elem2;
+ }
+}
+
+/*
+ * elem1, elemX => elem1, elem2, elemX
+ */
+static void
+INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->next = elem1->next;
+ elem2->prev = elem1;
+ elem1->next = elem2;
+ if (elem2->next) {
+ elem2->next->prev = elem2;
+ }
+}
+
+/*
+ * elemX, elem1, elemY => elemX, elem2, elemY
+ */
+static void
+REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+{
+ elem2->prev = elem1->prev;
+ elem2->next = elem1->next;
+ if (elem1->prev) {
+ elem1->prev->next = elem2;
+ }
+ if (elem1->next) {
+ elem1->next->prev = elem2;
+ }
+}
+
+static void
+REMOVE_ELEM(LINK_ELEMENT *elem)
+{
+ elem->prev->next = elem->next;
+ if (elem->next) {
+ elem->next->prev = elem->prev;
+ }
+}
+
+static LINK_ELEMENT *
+FIRST_ELEMENT(LINK_ANCHOR *anchor)
+{
+ return anchor->anchor.next;
+}
+
+static LINK_ELEMENT *
+LAST_ELEMENT(LINK_ANCHOR *anchor)
+{
+ return anchor->last;
+}
+
+static LINK_ELEMENT *
+POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *elem = anchor->last;
+ anchor->last = anchor->last->prev;
+ anchor->last->next = 0;
+ verify_list("pop", anchor);
+ return elem;
+}
+#if CPDEBUG < 0
+#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
+#endif
+
+static int
+LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
+{
+ if (anchor->anchor.next == 0) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e1, e2, e3, e4, e5
+ * anc2: e4, e5 (broken)
+ */
+static void
+APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ if (anc2->anchor.next) {
+ anc1->last->next = anc2->anchor.next;
+ anc2->anchor.next->prev = anc1->last;
+ anc1->last = anc2->last;
+ }
+ verify_list("append", anc1);
+}
+#if CPDEBUG < 0
+#define APPEND_LIST(anc1, anc2) APPEND_LIST(iseq, (anc1), (anc2))
+#endif
+
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e4, e5, e1, e2, e3
+ * anc2: e4, e5 (broken)
+ */
+static void
+INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ if (anc2->anchor.next) {
+ LINK_ELEMENT *first = anc1->anchor.next;
+ anc1->anchor.next = anc2->anchor.next;
+ anc1->anchor.next->prev = &anc1->anchor;
+ anc2->last->next = first;
+ if (first) {
+ first->prev = anc2->last;
+ }
+ else {
+ anc1->last = anc2->last;
+ }
+ }
+
+ verify_list("append", anc1);
+}
+#if CPDEBUG < 0
+#define INSERT_LIST(anc1, anc2) INSERT_LIST(iseq, (anc1), (anc2))
+#endif
+
+#if CPDEBUG && 0
+static void
+debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
+{
+ LINK_ELEMENT *list = FIRST_ELEMENT(anchor);
+ printf("----\n");
+ printf("anch: %p, frst: %p, last: %p\n", &anchor->anchor,
+ anchor->anchor.next, anchor->last);
+ while (list) {
+ printf("curr: %p, next: %p, prev: %p, type: %d\n", list, list->next,
+ list->prev, FIX2INT(list->type));
+ list = list->next;
+ }
+ printf("----\n");
+
+ dump_disasm_list(anchor->anchor.next);
+ verify_list("debug list", anchor);
+}
+#if CPDEBUG < 0
+#define debug_list(anc) debug_list(iseq, (anc))
+#endif
+#endif
+
+static LABEL *
+new_label_body(rb_iseq_t *iseq, long line)
+{
+ LABEL *labelobj = compile_data_alloc_label(iseq);
+
+ labelobj->link.type = ISEQ_ELEMENT_LABEL;
+ labelobj->link.next = 0;
+
+ labelobj->label_no = iseq->compile_data->label_no++;
+ labelobj->sc_state = 0;
+ labelobj->sp = -1;
+ labelobj->set = 0;
+ labelobj->rescued = LABEL_RESCUE_NONE;
+ return labelobj;
+}
+
+static ADJUST *
+new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line)
+{
+ ADJUST *adjust = compile_data_alloc_adjust(iseq);
+ adjust->link.type = ISEQ_ELEMENT_ADJUST;
+ adjust->link.next = 0;
+ adjust->label = label;
+ adjust->line_no = line;
+ return adjust;
+}
+
+static INSN *
+new_insn_core(rb_iseq_t *iseq, int line_no,
+ int insn_id, int argc, VALUE *argv)
+{
+ INSN *iobj = compile_data_alloc_insn(iseq);
+ /* printf("insn_id: %d, line: %d\n", insn_id, line_no); */
+
+ iobj->link.type = ISEQ_ELEMENT_INSN;
+ iobj->link.next = 0;
+ iobj->insn_id = insn_id;
+ iobj->line_no = line_no;
+ iobj->operands = argv;
+ iobj->operand_size = argc;
+ iobj->sc_state = 0;
+ return iobj;
+}
+
+static INSN *
+new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int argc, ...)
+{
+ VALUE *operands = 0;
+ va_list argv;
+ if (argc > 0) {
+ int i;
+ va_init_list(argv, argc);
+ operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ for (i = 0; i < argc; i++) {
+ VALUE v = va_arg(argv, VALUE);
+ operands[i] = v;
+ }
+ va_end(argv);
+ }
+ return new_insn_core(iseq, line_no, insn_id, argc, operands);
+}
+
+static rb_call_info_t *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned int flag, rb_call_info_kw_arg_t *kw_arg)
+{
+ 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;
+ ci->kw_arg = kw_arg;
+
+ if (kw_arg) {
+ ci->argc += kw_arg->keyword_len;
+ ci->orig_argc += kw_arg->keyword_len;
+ }
+
+ if (block) {
+ GetISeqPtr(block, ci->blockiseq);
+ }
+ else {
+ ci->blockiseq = 0;
+ }
+
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG)) &&
+ ci->blockiseq == NULL && ci->kw_arg == NULL) {
+ ci->flag |= VM_CALL_ARGS_SIMPLE;
+ }
+
+ ci->method_state = 0;
+ ci->class_serial = 0;
+ ci->blockptr = 0;
+ ci->recv = Qundef;
+ ci->call = 0; /* TODO: should set default function? */
+
+ ci->aux.index = iseq->callinfo_size++;
+
+ return ci;
+}
+
+static INSN *
+new_insn_send(rb_iseq_t *iseq, int line_no, ID id, VALUE argc, VALUE block, VALUE flag, rb_call_info_kw_arg_t *keywords)
+{
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), block, FIX2INT(flag), keywords);
+ return new_insn_core(iseq, line_no, BIN(send), 1, operands);
+}
+
+static VALUE
+new_child_iseq(rb_iseq_t *iseq, NODE *node,
+ VALUE name, VALUE parent, enum iseq_type type, int line_no)
+{
+ VALUE ret;
+
+ debugs("[new_child_iseq]> ---------------------------------------\n");
+ 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, ret);
+ return ret;
+}
+
+static int
+iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+ /* debugs("[compile step 2] (iseq_array_to_linkedlist)\n"); */
+
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+
+ debugs("[compile step 3.1 (iseq_optimize)]\n");
+ iseq_optimize(iseq, anchor);
+
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+
+ 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->option->stack_caching) {
+ debugs("[compile step 3.3 (iseq_set_sequence_stackcaching)]\n");
+ iseq_set_sequence_stackcaching(iseq, anchor);
+ if (compile_debug > 5)
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+ }
+
+ debugs("[compile step 4.1 (iseq_set_sequence)]\n");
+ 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");
+ iseq_set_exception_table(iseq);
+
+ debugs("[compile step 4.3 (set_optargs_table)] \n");
+ iseq_set_optargs_table(iseq);
+
+ debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
+ rb_iseq_translate_threaded_code(iseq);
+
+ if (compile_debug > 1) {
+ VALUE str = rb_iseq_disasm(iseq->self);
+ printf("%s\n", StringValueCStr(str));
+ fflush(stdout);
+ }
+ debugs("[compile step: finish]\n");
+
+ return 0;
+}
+
+static int
+iseq_set_exception_local_table(rb_iseq_t *iseq)
+{
+ ID id_dollar_bang;
+
+ CONST_ID(id_dollar_bang, "#$!");
+ 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(rb_iseq_t *iseq)
+{
+ int lev = 0;
+ while (iseq != iseq->local_iseq) {
+ lev++;
+ iseq = iseq->parent_iseq;
+ }
+ return lev;
+}
+
+static int
+get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
+{
+ 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(rb_iseq_t *iseq, ID id)
+{
+ int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
+
+ if (idx < 0) {
+ rb_bug("get_local_var_idx: %d", idx);
+ }
+
+ return idx;
+}
+
+static int
+get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
+{
+ int lv = 0, idx = -1;
+
+ while (iseq) {
+ idx = get_dyna_var_idx_at_raw(iseq, id);
+ if (idx >= 0) {
+ break;
+ }
+ iseq = iseq->parent_iseq;
+ lv++;
+ }
+
+ if (idx < 0) {
+ rb_bug("get_dyna_var_idx: -1");
+ }
+
+ *level = lv;
+ *ls = iseq->local_size;
+ return idx;
+}
+
+static void
+iseq_calc_param_size(rb_iseq_t *iseq)
+{
+ if (iseq->param.flags.has_opt ||
+ iseq->param.flags.has_post ||
+ iseq->param.flags.has_rest ||
+ iseq->param.flags.has_block ||
+ iseq->param.flags.has_kw ||
+ iseq->param.flags.has_kwrest) {
+
+ if (iseq->param.flags.has_block) {
+ iseq->param.size = iseq->param.block_start + 1;
+ }
+ else if (iseq->param.flags.has_kwrest) {
+ iseq->param.size = iseq->param.keyword->rest_start + 1;
+ }
+ else if (iseq->param.flags.has_kw) {
+ iseq->param.size = iseq->param.keyword->bits_start + 1;
+ }
+ else if (iseq->param.flags.has_post) {
+ iseq->param.size = iseq->param.post_start + iseq->param.post_num;
+ }
+ else if (iseq->param.flags.has_rest) {
+ iseq->param.size = iseq->param.rest_start + 1;
+ }
+ else if (iseq->param.flags.has_opt) {
+ iseq->param.size = iseq->param.lead_num + iseq->param.opt_num;
+ }
+ else {
+ rb_bug("unreachable");
+ }
+ }
+ else {
+ iseq->param.size = iseq->param.lead_num;
+ }
+}
+
+static int
+iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
+{
+ debugs("iseq_set_arguments: %s\n", node_args ? "" : "0");
+
+ if (node_args) {
+ struct rb_args_info *args = node_args->nd_ainfo;
+ ID rest_id = 0;
+ int last_comma = 0;
+ ID block_id = 0;
+
+ 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->param.lead_num = (int)args->pre_args_num;
+ if (iseq->param.lead_num > 0) iseq->param.flags.has_lead = TRUE;
+ debugs(" - argc: %d\n", iseq->param.lead_num);
+
+ rest_id = args->rest_arg;
+ if (rest_id == 1) {
+ last_comma = 1;
+ rest_id = 0;
+ }
+ block_id = args->block_arg;
+
+ if (args->first_post_arg) {
+ iseq->param.post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->param.post_num = args->post_args_num;
+ iseq->param.flags.has_post = TRUE;
+ }
+
+ if (args->opt_args) {
+ NODE *node = args->opt_args;
+ LABEL *label;
+ VALUE labels = rb_ary_tmp_new(1);
+ int i = 0, j;
+
+ while (node) {
+ label = NEW_LABEL(nd_line(node));
+ rb_ary_push(labels, (VALUE)label | 1);
+ ADD_LABEL(optargs, label);
+ COMPILE_POPED(optargs, "optarg", node->nd_body);
+ node = node->nd_next;
+ i += 1;
+ }
+
+ /* last label */
+ label = NEW_LABEL(nd_line(node_args));
+ rb_ary_push(labels, (VALUE)label | 1);
+ ADD_LABEL(optargs, label);
+
+ iseq->param.opt_num = i;
+ iseq->param.opt_table = ALLOC_N(VALUE, i+1);
+ MEMCPY(iseq->param.opt_table, RARRAY_CONST_PTR(labels), VALUE, i+1);
+ for (j = 0; j < i+1; j++) {
+ iseq->param.opt_table[j] &= ~1;
+ }
+ rb_ary_clear(labels);
+
+ iseq->param.flags.has_opt = TRUE;
+ }
+
+ if (args->kw_args) {
+ NODE *node = args->kw_args;
+ 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->param.flags.has_kw = TRUE;
+ iseq->param.keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ iseq->param.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;
+ }
+
+ iseq->param.keyword->num = ++di;
+ rb_ary_push(default_values, dv);
+ }
+
+ kw++;
+ node = node->nd_next;
+ }
+
+ iseq->param.keyword->num = kw;
+
+ if (args->kw_rest_arg->nd_cflag != 0) {
+ iseq->param.keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
+ iseq->param.flags.has_kwrest = TRUE;
+ }
+ iseq->param.keyword->required_num = rkw;
+ iseq->param.keyword->table = &iseq->local_table[iseq->param.keyword->bits_start - iseq->param.keyword->num];
+ iseq->param.keyword->default_values = 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;
+ iseq->param.keyword->default_values[i] = dv;
+ }
+ }
+ else if (args->kw_rest_arg) {
+ iseq->param.flags.has_kwrest = TRUE;
+ iseq->param.keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ iseq->param.keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ }
+
+ if (args->pre_init) { /* m_init */
+ COMPILE_POPED(optargs, "init arguments (m)", args->pre_init);
+ }
+ if (args->post_init) { /* p_init */
+ COMPILE_POPED(optargs, "init arguments (p)", args->post_init);
+ }
+
+ if (rest_id) {
+ iseq->param.rest_start = get_dyna_var_idx_at_raw(iseq, rest_id);
+ iseq->param.flags.has_rest = TRUE;
+ assert(iseq->param.rest_start != -1);
+
+ if (iseq->param.post_start == 0) { /* TODO: why that? */
+ iseq->param.post_start = iseq->param.rest_start + 1;
+ }
+ }
+
+ if (block_id) {
+ iseq->param.block_start = get_dyna_var_idx_at_raw(iseq, block_id);
+ iseq->param.flags.has_block = TRUE;
+ }
+
+ iseq_calc_param_size(iseq);
+
+ if (iseq->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->param.flags.has_opt == FALSE &&
+ iseq->param.flags.has_post == FALSE &&
+ iseq->param.flags.has_rest == FALSE &&
+ iseq->param.flags.has_kw == FALSE &&
+ iseq->param.flags.has_kwrest == FALSE) {
+
+ if (iseq->param.lead_num == 1 && last_comma == 0) {
+ /* {|a|} */
+ iseq->param.flags.ambiguous_param0 = TRUE;
+ }
+ }
+ }
+ }
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
+{
+ int size;
+
+ if (tbl) {
+ size = (int)*tbl;
+ tbl++;
+ }
+ else {
+ size = 0;
+ }
+
+ if (size > 0) {
+ iseq->local_table = (ID *)ALLOC_N(ID, size);
+ MEMCPY(iseq->local_table, tbl, ID, size);
+ }
+
+ iseq->local_size = iseq->local_table_size = size;
+ iseq->local_size += 1;
+ /*
+ if (lfp == dfp ) { // top, class, method
+ dfp[-1]: svar
+ else { // block
+ dfp[-1]: cref
+ }
+ */
+
+ debugs("iseq_set_local_table: %d, %d\n", iseq->local_size, iseq->local_table_size);
+ return COMPILE_OK;
+}
+
+static int
+cdhash_cmp(VALUE val, VALUE lit)
+{
+ if (val == lit) return 0;
+ if (SPECIAL_CONST_P(lit)) {
+ return val != lit;
+ }
+ if (SPECIAL_CONST_P(val) || BUILTIN_TYPE(val) != BUILTIN_TYPE(lit)) {
+ return -1;
+ }
+ if (BUILTIN_TYPE(lit) == T_STRING) {
+ return rb_str_hash_cmp(lit, val);
+ }
+ return !rb_eql(lit, val);
+}
+
+static st_index_t
+cdhash_hash(VALUE a)
+{
+ if (SPECIAL_CONST_P(a)) return (st_index_t)a;
+ if (RB_TYPE_P(a, T_STRING)) return rb_str_hash(a);
+ {
+ VALUE hval = rb_hash(a);
+ return (st_index_t)FIX2LONG(hval);
+ }
+}
+
+static const struct st_hash_type cdhash_type = {
+ cdhash_cmp,
+ cdhash_hash,
+};
+
+struct cdhash_set_label_struct {
+ VALUE hash;
+ int pos;
+ int len;
+};
+
+static int
+cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
+{
+ struct cdhash_set_label_struct *data = (struct cdhash_set_label_struct *)ptr;
+ LABEL *lobj = (LABEL *)(val & ~1);
+ rb_hash_aset(data->hash, key, INT2FIX(lobj->position - (data->pos+data->len)));
+ return ST_CONTINUE;
+}
+
+/**
+ ruby insn object list -> raw instruction sequence
+ */
+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 k, pos, sp, stack_max = 0, line = 0;
+
+ /* set label position */
+ list = FIRST_ELEMENT(anchor);
+ k = pos = 0;
+ while (list) {
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ iobj = (INSN *)list;
+ line = iobj->line_no;
+ pos += insn_data_length(iobj);
+ k++;
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)list;
+ lobj->position = pos;
+ lobj->set = TRUE;
+ break;
+ }
+ case ISEQ_ELEMENT_NONE:
+ {
+ /* ignore */
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)list;
+ if (adjust->line_no != -1) {
+ pos += 2 /* insn + 1 operand */;
+ k++;
+ }
+ break;
+ }
+ default:
+ dump_disasm_list(FIRST_ELEMENT(anchor));
+ dump_disasm_list(list);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line,
+ "error: set_sequence");
+ break;
+ }
+ list = list->next;
+ }
+
+ /* make instruction sequence */
+ generated_iseq = ALLOC_N(VALUE, pos);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
+ iseq->is_entries = ZALLOC_N(union iseq_inline_storage_entry, iseq->is_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);
+ k = pos = sp = 0;
+
+ while (list) {
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ int j, len, insn;
+ const char *types;
+ VALUE *operands;
+
+ iobj = (INSN *)list;
+
+ /* update sp */
+ sp = calc_sp_depth(sp, iobj);
+ if (sp > stack_max) {
+ stack_max = sp;
+ }
+
+ /* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
+ operands = iobj->operands;
+ insn = iobj->insn_id;
+ generated_iseq[pos] = insn;
+ types = insn_op_types(insn);
+ len = insn_len(insn);
+
+ /* operand check */
+ 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);
+ return 0;
+ }
+
+ for (j = 0; types[j]; j++) {
+ char type = types[j];
+ /* printf("--> [%c - (%d-%d)]\n", type, k, j); */
+ switch (type) {
+ case TS_OFFSET:
+ {
+ /* label(destination position) */
+ lobj = (LABEL *)operands[j];
+ if (!lobj->set) {
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown label");
+ }
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
+ break;
+ }
+ case TS_CDHASH:
+ {
+ VALUE map = operands[j];
+ struct cdhash_set_label_struct data;
+ data.hash = map;
+ data.pos = pos;
+ data.len = len;
+ rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
+
+ hide_obj(map);
+ generated_iseq[pos + 1 + j] = map;
+ break;
+ }
+ case TS_LINDEX:
+ case TS_NUM: /* ulong */
+ generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
+ break;
+ case TS_ISEQ: /* iseq */
+ {
+ VALUE v = operands[j];
+ 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[pos + 1 + j] = v;
+ /* to mark ruby object */
+ iseq_add_mark_object(iseq, v);
+ break;
+ }
+ case TS_IC: /* inline cache */
+ {
+ int ic_index = FIX2INT(operands[j]);
+ IC ic = (IC)&iseq->is_entries[ic_index];
+ if (UNLIKELY(ic_index >= iseq->is_size)) {
+ rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->is_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ic;
+ break;
+ }
+ case TS_CALLINFO: /* call info */
+ {
+ 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;
+
+ 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[pos + 1 + j] = SYM2ID(operands[j]);
+ break;
+ case TS_GENTRY:
+ {
+ struct rb_global_entry *entry =
+ (struct rb_global_entry *)(operands[j] & (~1));
+ generated_iseq[pos + 1 + j] = (VALUE)entry;
+ }
+ break;
+ case TS_FUNCPTR:
+ generated_iseq[pos + 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);
+ return 0;
+ }
+ }
+ if (last_line != iobj->line_no) {
+ line_info_table[k].line_no = last_line = iobj->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ pos += len;
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)list;
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ else {
+ sp = lobj->sp;
+ }
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)list;
+ int orig_sp = sp;
+
+ if (adjust->label) {
+ sp = adjust->label->sp;
+ }
+ else {
+ sp = 0;
+ }
+
+ if (adjust->line_no != -1) {
+ if (orig_sp - sp > 0) {
+ if (last_line != (unsigned int)adjust->line_no) {
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ 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[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ generated_iseq[pos++] = BIN(nop);
+ generated_iseq[pos++] = BIN(nop);
+ }
+ else {
+ rb_bug("iseq_set_sequence: adjust bug");
+ }
+ }
+ break;
+ }
+ default:
+ /* ignore */
+ break;
+ }
+ list = list->next;
+ }
+
+ iseq->iseq_encoded = (void *)generated_iseq;
+ iseq->iseq_size = pos;
+ iseq->stack_max = stack_max;
+
+ REALLOC_N(line_info_table, struct iseq_line_info_entry, k);
+ iseq->line_info_table = line_info_table;
+ iseq->line_info_size = k;
+
+ return COMPILE_OK;
+}
+
+static int
+label_get_position(LABEL *lobj)
+{
+ return lobj->position;
+}
+
+static int
+label_get_sp(LABEL *lobj)
+{
+ return lobj->sp;
+}
+
+static int
+iseq_set_exception_table(rb_iseq_t *iseq)
+{
+ const VALUE *tptr, *ptr;
+ int tlen, i;
+ struct iseq_catch_table_entry *entry;
+
+ tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
+ tptr = RARRAY_CONST_PTR(iseq->compile_data->catch_table_ary);
+
+ iseq->catch_table = 0;
+ if (tlen > 0) {
+ iseq->catch_table = xmalloc(iseq_catch_table_bytes(tlen));
+ iseq->catch_table->size = tlen;
+ }
+
+ if (iseq->catch_table) for (i = 0; i < iseq->catch_table->size; i++) {
+ ptr = RARRAY_CONST_PTR(tptr[i]);
+ entry = &iseq->catch_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 = ptr[3];
+
+ /* 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;
+ }
+ }
+
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, 0); /* free */
+ return COMPILE_OK;
+}
+
+/*
+ * set optional argument table
+ * def foo(a, b=expr1, c=expr2)
+ * =>
+ * b:
+ * expr1
+ * c:
+ * expr2
+ */
+static int
+iseq_set_optargs_table(rb_iseq_t *iseq)
+{
+ int i;
+
+ if (iseq->param.flags.has_opt) {
+ for (i = 0; i < iseq->param.opt_num + 1; i++) {
+ iseq->param.opt_table[i] = label_get_position((LABEL *)iseq->param.opt_table[i]);
+ }
+ }
+ return COMPILE_OK;
+}
+
+static LINK_ELEMENT *
+get_destination_insn(INSN *iobj)
+{
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
+ LINK_ELEMENT *list;
+
+ list = lobj->link.next;
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ break;
+ }
+ list = list->next;
+ }
+ return list;
+}
+
+static LINK_ELEMENT *
+get_next_insn(INSN *iobj)
+{
+ LINK_ELEMENT *list = iobj->link.next;
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ return list;
+ }
+ list = list->next;
+ }
+ return 0;
+}
+
+static LINK_ELEMENT *
+get_prev_insn(INSN *iobj)
+{
+ LINK_ELEMENT *list = iobj->link.prev;
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
+ return list;
+ }
+ list = list->prev;
+ }
+ return 0;
+}
+
+static int
+iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
+{
+ INSN *iobj = (INSN *)list;
+ again:
+ if (iobj->insn_id == BIN(jump)) {
+ INSN *niobj, *diobj, *piobj;
+ /*
+ * useless jump elimination:
+ * jump LABEL1
+ * ...
+ * LABEL1:
+ * jump LABEL2
+ *
+ * => in this case, first jump instruction should jump to
+ * LABEL2 directly
+ */
+ diobj = (INSN *)get_destination_insn(iobj);
+ niobj = (INSN *)get_next_insn(iobj);
+
+ if (diobj == niobj) {
+ /*
+ * jump LABEL
+ * LABEL:
+ * =>
+ * LABEL:
+ */
+ REMOVE_ELEM(&iobj->link);
+ }
+ 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)) {
+ /*
+ * jump LABEL
+ * ...
+ * LABEL:
+ * leave
+ * =>
+ * leave
+ * ...
+ * 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 */
+ 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):
+ * if L1
+ * jump L2
+ * L1:
+ * ...
+ * L2:
+ *
+ * ==>
+ * unless L2
+ * L1:
+ * ...
+ * L2:
+ */
+ else if ((piobj = (INSN *)get_prev_insn(iobj)) != 0 &&
+ (piobj->insn_id == BIN(branchif) ||
+ piobj->insn_id == BIN(branchunless))) {
+ if (niobj == (INSN *)get_destination_insn(piobj)) {
+ piobj->insn_id = (piobj->insn_id == BIN(branchif))
+ ? BIN(branchunless) : BIN(branchif);
+ OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
+ REMOVE_ELEM(&iobj->link);
+ }
+ }
+ }
+
+ if (iobj->insn_id == BIN(branchif) ||
+ iobj->insn_id == BIN(branchunless)) {
+ /*
+ * if L1
+ * ...
+ * L1:
+ * jump L2
+ * =>
+ * if L2
+ */
+ INSN *nobj = (INSN *)get_destination_insn(iobj);
+ if (nobj->insn_id == BIN(jump)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
+ }
+ }
+
+ if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
+ /*
+ * send ...
+ * leave
+ * =>
+ * send ..., ... | VM_CALL_TAILCALL, ...
+ * leave # unreachable
+ */
+ INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
+ enum ruby_vminsn_type previ = piobj->insn_id;
+
+ if (previ == BIN(send) || previ == BIN(opt_send_without_block) || previ == BIN(invokesuper)) {
+ rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
+ if (ci->blockiseq == 0) {
+ ci->flag |= VM_CALL_TAILCALL;
+ }
+ }
+ }
+ return COMPILE_OK;
+}
+
+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 (iobj->operand_size > old_opsize) {
+ VALUE *old_operands = iobj->operands;
+ 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] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0, NULL);
+ }
+
+ return COMPILE_OK;
+}
+
+static int
+iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
+{
+ if (iobj->insn_id == BIN(send)) {
+ 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) {
+ switch (ci->orig_argc) {
+ case 0:
+ switch (ci->mid) {
+ case idLength: SP_INSN(length); return COMPILE_OK;
+ case idSize: SP_INSN(size); return COMPILE_OK;
+ case idEmptyP: SP_INSN(empty_p);return COMPILE_OK;
+ case idSucc: SP_INSN(succ); return COMPILE_OK;
+ case idNot: SP_INSN(not); return COMPILE_OK;
+ }
+ break;
+ case 1:
+ switch (ci->mid) {
+ case idPLUS: SP_INSN(plus); return COMPILE_OK;
+ case idMINUS: SP_INSN(minus); return COMPILE_OK;
+ case idMULT: SP_INSN(mult); return COMPILE_OK;
+ case idDIV: SP_INSN(div); return COMPILE_OK;
+ case idMOD: SP_INSN(mod); return COMPILE_OK;
+ case idEq: SP_INSN(eq); return COMPILE_OK;
+ case idNeq: SP_INSN(neq); return COMPILE_OK;
+ case idLT: SP_INSN(lt); return COMPILE_OK;
+ case idLE: SP_INSN(le); return COMPILE_OK;
+ case idGT: SP_INSN(gt); return COMPILE_OK;
+ case idGE: SP_INSN(ge); return COMPILE_OK;
+ case idLTLT: SP_INSN(ltlt); return COMPILE_OK;
+ 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 && ci->blockiseq == NULL) {
+ iobj->insn_id = BIN(opt_send_without_block);
+ }
+ }
+#undef SP_INSN
+
+ return COMPILE_OK;
+}
+
+static inline int
+tailcallable_p(rb_iseq_t *iseq)
+{
+ switch (iseq->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->option->peephole_optimization;
+ const int do_tailcallopt = tailcallable_p(iseq) &&
+ 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;
+ int rescue_level = 0;
+ int tailcallopt = do_tailcallopt;
+
+ list = FIRST_ELEMENT(anchor);
+
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
+ if (do_peepholeopt) {
+ iseq_peephole_optimize(iseq, list, tailcallopt);
+ }
+ if (do_si) {
+ iseq_specialized_instruction(iseq, (INSN *)list);
+ }
+ if (do_ou) {
+ 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;
+}
+
+#if OPT_INSTRUCTIONS_UNIFICATION
+static INSN *
+new_unified_insn(rb_iseq_t *iseq,
+ int insn_id, int size, LINK_ELEMENT *seq_list)
+{
+ INSN *iobj = 0;
+ LINK_ELEMENT *list = seq_list;
+ int i, argc = 0;
+ VALUE *operands = 0, *ptr = 0;
+
+
+ /* count argc */
+ for (i = 0; i < size; i++) {
+ iobj = (INSN *)list;
+ argc += iobj->operand_size;
+ list = list->next;
+ }
+
+ if (argc > 0) {
+ ptr = operands =
+ (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ }
+
+ /* copy operands */
+ list = seq_list;
+ for (i = 0; i < size; i++) {
+ iobj = (INSN *)list;
+ MEMCPY(ptr, iobj->operands, VALUE, iobj->operand_size);
+ ptr += iobj->operand_size;
+ list = list->next;
+ }
+
+ return new_insn_core(iseq, iobj->line_no, insn_id, argc, operands);
+}
+#endif
+
+/*
+ * This scheme can get more performance if do this optimize with
+ * label address resolving.
+ * It's future work (if compile time was bottle neck).
+ */
+static int
+iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+#if OPT_INSTRUCTIONS_UNIFICATION
+ LINK_ELEMENT *list;
+ INSN *iobj, *niobj;
+ int id, k;
+ intptr_t j;
+
+ list = FIRST_ELEMENT(anchor);
+ while (list) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
+ iobj = (INSN *)list;
+ id = iobj->insn_id;
+ if (unified_insns_data[id] != 0) {
+ const int *const *entry = unified_insns_data[id];
+ for (j = 1; j < (intptr_t)entry[0]; j++) {
+ const int *unified = entry[j];
+ LINK_ELEMENT *li = list->next;
+ for (k = 2; k < unified[1]; k++) {
+ if (li->type != ISEQ_ELEMENT_INSN ||
+ ((INSN *)li)->insn_id != unified[k]) {
+ goto miss;
+ }
+ li = li->next;
+ }
+ /* matched */
+ niobj =
+ new_unified_insn(iseq, unified[0], unified[1] - 1,
+ list);
+
+ /* insert to list */
+ niobj->link.prev = (LINK_ELEMENT *)iobj->link.prev;
+ niobj->link.next = li;
+ if (li) {
+ li->prev = (LINK_ELEMENT *)niobj;
+ }
+
+ list->prev->next = (LINK_ELEMENT *)niobj;
+ list = (LINK_ELEMENT *)niobj;
+ break;
+ miss:;
+ }
+ }
+ }
+ list = list->next;
+ }
+#endif
+ return COMPILE_OK;
+}
+
+#if OPT_STACK_CACHING
+
+#define SC_INSN(insn, stat) sc_insn_info[(insn)][(stat)]
+#define SC_NEXT(insn) sc_insn_next[(insn)]
+
+#include "opt_sc.inc"
+
+static int
+insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
+{
+ int nstate;
+ int insn_id;
+
+ insn_id = iobj->insn_id;
+ iobj->insn_id = SC_INSN(insn_id, state);
+ nstate = SC_NEXT(iobj->insn_id);
+
+ if (insn_id == BIN(jump) ||
+ insn_id == BIN(branchif) || insn_id == BIN(branchunless)) {
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
+
+ if (lobj->sc_state != 0) {
+ if (lobj->sc_state != nstate) {
+ dump_disasm_list((LINK_ELEMENT *)iobj);
+ dump_disasm_list((LINK_ELEMENT *)lobj);
+ printf("\n-- %d, %d\n", lobj->sc_state, nstate);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "insn_set_sc_state error\n");
+ return 0;
+ }
+ }
+ else {
+ lobj->sc_state = nstate;
+ }
+ if (insn_id == BIN(jump)) {
+ nstate = SCS_XX;
+ }
+ }
+ else if (insn_id == BIN(leave)) {
+ nstate = SCS_XX;
+ }
+
+ return nstate;
+}
+
+static int
+label_set_sc_state(LABEL *lobj, int state)
+{
+ if (lobj->sc_state != 0) {
+ if (lobj->sc_state != state) {
+ state = lobj->sc_state;
+ }
+ }
+ else {
+ lobj->sc_state = state;
+ }
+
+ return state;
+}
+
+
+#endif
+
+static int
+iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
+{
+#if OPT_STACK_CACHING
+ LINK_ELEMENT *list;
+ int state, insn_id;
+
+ /* initialize */
+ state = SCS_XX;
+ list = FIRST_ELEMENT(anchor);
+ /* dump_disasm_list(list); */
+
+ /* for each list element */
+ while (list) {
+ redo_point:
+ switch (list->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ INSN *iobj = (INSN *)list;
+ insn_id = iobj->insn_id;
+
+ /* dump_disasm_list(list); */
+
+ switch (insn_id) {
+ case BIN(nop):
+ {
+ /* exception merge point */
+ if (state != SCS_AX) {
+ INSN *rpobj =
+ new_insn_body(iseq, 0, BIN(reput), 0);
+
+ /* replace this insn */
+ REPLACE_ELEM(list, (LINK_ELEMENT *)rpobj);
+ list = (LINK_ELEMENT *)rpobj;
+ goto redo_point;
+ }
+ break;
+ }
+ case BIN(swap):
+ {
+ if (state == SCS_AB || state == SCS_BA) {
+ state = (state == SCS_AB ? SCS_BA : SCS_AB);
+
+ REMOVE_ELEM(list);
+ list = list->next;
+ goto redo_point;
+ }
+ break;
+ }
+ case BIN(pop):
+ {
+ switch (state) {
+ case SCS_AX:
+ case SCS_BX:
+ state = SCS_XX;
+ break;
+ case SCS_AB:
+ state = SCS_AX;
+ break;
+ case SCS_BA:
+ state = SCS_BX;
+ break;
+ case SCS_XX:
+ goto normal_insn;
+ default:
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unreachable");
+ }
+ /* remove useless pop */
+ REMOVE_ELEM(list);
+ list = list->next;
+ goto redo_point;
+ }
+ default:;
+ /* none */
+ } /* end of switch */
+ normal_insn:
+ state = insn_set_sc_state(iseq, iobj, state);
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ LABEL *lobj;
+ lobj = (LABEL *)list;
+
+ state = label_set_sc_state(lobj, state);
+ }
+ default:
+ break;
+ }
+ list = list->next;
+ }
+#endif
+ return COMPILE_OK;
+}
+
+static int
+compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
+{
+ NODE *list = node->nd_next;
+ VALUE lit = node->nd_lit;
+ int cnt = 0;
+
+ debugp_param("nd_lit", lit);
+ if (!NIL_P(lit)) {
+ cnt++;
+ if (RB_TYPE_P(lit, T_STRING))
+ lit = node->nd_lit = rb_fstring(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, lit);
+ }
+
+ while (list) {
+ node = list->nd_head;
+ if (nd_type(node) == NODE_STR) {
+ node->nd_lit = rb_fstring(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ }
+ else {
+ COMPILE(ret, "each string", node);
+ }
+ cnt++;
+ list = list->nd_next;
+ }
+ *cntp = cnt;
+
+ return COMPILE_OK;
+}
+
+static int
+compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
+{
+ int cnt;
+ compile_dstr_fragments(iseq, ret, node, &cnt);
+ ADD_INSN1(ret, nd_line(node), concatstrings, INT2FIX(cnt));
+ return COMPILE_OK;
+}
+
+static int
+compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
+{
+ int cnt;
+ compile_dstr_fragments(iseq, ret, node, &cnt);
+ ADD_INSN2(ret, nd_line(node), toregexp, INT2FIX(node->nd_cflag), INT2FIX(cnt));
+ return COMPILE_OK;
+}
+
+static int
+compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
+ LABEL *then_label, LABEL *else_label)
+{
+ switch (nd_type(cond)) {
+ case NODE_AND:
+ {
+ LABEL *label = NEW_LABEL(nd_line(cond));
+ compile_branch_condition(iseq, ret, cond->nd_1st, label,
+ else_label);
+ ADD_LABEL(ret, label);
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
+ }
+ case NODE_OR:
+ {
+ LABEL *label = NEW_LABEL(nd_line(cond));
+ compile_branch_condition(iseq, ret, cond->nd_1st, then_label,
+ label);
+ ADD_LABEL(ret, label);
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
+ }
+ case NODE_LIT: /* NODE_LIT is always not true */
+ case NODE_TRUE:
+ case NODE_STR:
+ /* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
+ ADD_INSNL(ret, nd_line(cond), jump, then_label);
+ break;
+ case NODE_FALSE:
+ case NODE_NIL:
+ /* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
+ ADD_INSNL(ret, nd_line(cond), jump, else_label);
+ break;
+ default:
+ COMPILE(ret, "branch condition", cond);
+ ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
+ ADD_INSNL(ret, nd_line(cond), jump, then_label);
+ break;
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE * const root_node, rb_call_info_kw_arg_t ** 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;
+ rb_call_info_kw_arg_t *kw_arg = (rb_call_info_kw_arg_t *)ruby_xmalloc(sizeof(rb_call_info_kw_arg_t) + 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,
+ COMPILE_ARRAY_TYPE_ARGS
+};
+
+static int
+compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
+ enum compile_array_type_t type, rb_call_info_kw_arg_t **keywords_ptr, int poped)
+{
+ NODE *node = node_root;
+ int line = (int)nd_line(node);
+ int len = 0;
+
+ if (nd_type(node) == NODE_ZARRAY) {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY: ADD_INSN1(ret, line, newarray, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_HASH: ADD_INSN1(ret, line, newhash, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_ARGS: /* do nothing */ break;
+ }
+ }
+ }
+ else {
+ int opt_p = 1;
+ int first = 1, i;
+
+ while (node) {
+ NODE *start_node = node, *end_node;
+ NODE *kw = 0;
+ const int max = 0x100;
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+
+ for (i=0; i<max && node; i++, len++, node = node->nd_next) {
+ 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) {
+ kw = node->nd_next;
+ node = 0;
+ if (kw) {
+ opt_p = 0;
+ 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);
+ }
+ }
+
+ if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
+ if (!poped) {
+ VALUE ary = rb_ary_tmp_new(i);
+
+ end_node = node;
+ node = start_node;
+
+ while (node != end_node) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ }
+ while (node && nd_type(node->nd_head) == NODE_LIT &&
+ node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ len++;
+ }
+
+ OBJ_FREEZE(ary);
+
+ iseq_add_mark_object_compile_time(iseq, ary);
+
+ if (first) {
+ first = 0;
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, duparray, ary);
+ }
+ 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));
+ }
+ }
+ else {
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_INSN(ret, line, concatarray);
+ }
+ 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));
+ }
+ }
+ }
+ }
+ else {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY:
+ ADD_INSN1(anchor, line, newarray, INT2FIX(i));
+
+ if (first) {
+ first = 0;
+ }
+ 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 (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);
+ 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));
+ }
+ first = 0;
+ break;
+ case COMPILE_ARRAY_TYPE_ARGS:
+ APPEND_LIST(ret, anchor);
+ break;
+ }
+ }
+ else {
+ /* poped */
+ APPEND_LIST(ret, anchor);
+ }
+ }
+ }
+ }
+ return len;
+}
+
+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);
+}
+
+static VALUE
+case_when_optimizable_literal(NODE * node)
+{
+ switch (nd_type(node)) {
+ case NODE_LIT: {
+ VALUE v = node->nd_lit;
+ double ival;
+ if (RB_TYPE_P(v, T_FLOAT) &&
+ modf(RFLOAT_VALUE(v), &ival) == 0.0) {
+ return FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
+ }
+ if (SYMBOL_P(v) || rb_obj_is_kind_of(v, rb_cNumeric)) {
+ return v;
+ }
+ break;
+ }
+ case NODE_STR:
+ return node->nd_lit = rb_fstring(node->nd_lit);
+ }
+ return Qundef;
+}
+
+static int
+when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int only_special_literals, VALUE literals)
+{
+ while (vals) {
+ NODE* val = vals->nd_head;
+ VALUE lit = case_when_optimizable_literal(val);
+
+ if (lit == Qundef) {
+ only_special_literals = 0;
+ }
+ else {
+ if (rb_hash_lookup(literals, lit) != Qnil) {
+ 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);
+ }
+ }
+
+ 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);
+ ADD_INSN1(cond_seq, nd_line(val), putobject, val->nd_lit);
+ }
+ else {
+ COMPILE(cond_seq, "when cond", val);
+ }
+
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
+ ADD_INSNL(cond_seq, nd_line(val), branchif, l1);
+ vals = vals->nd_next;
+ }
+ return only_special_literals;
+}
+
+static int
+compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
+{
+ switch (nd_type(node)) {
+ case NODE_ATTRASGN: {
+ INSN *iobj;
+ 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 = (rb_call_info_t *)iobj->operands[0];
+ ci->orig_argc += 1;
+ 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 */
+ break;
+ }
+ case NODE_MASGN: {
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+ COMPILE_POPED(anchor, "nest masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
+ ADD_SEQ(ret, anchor);
+ break;
+ }
+ default: {
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+ COMPILE_POPED(anchor, "masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
+ ADD_SEQ(ret, anchor);
+ }
+ }
+
+ return COMPILE_OK;
+}
+
+static void
+compile_massign_opt_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *lhsn)
+{
+ if (lhsn) {
+ compile_massign_opt_lhs(iseq, ret, lhsn->nd_next);
+ compile_massign_lhs(iseq, ret, lhsn->nd_head);
+ }
+}
+
+static int
+compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *rhsn, NODE *orig_lhsn)
+{
+ VALUE mem[64];
+ const int memsize = numberof(mem);
+ int memindex = 0;
+ int llen = 0, rlen = 0;
+ int i;
+ NODE *lhsn = orig_lhsn;
+
+#define MEMORY(v) { \
+ int i; \
+ if (memindex == memsize) return 0; \
+ for (i=0; i<memindex; i++) { \
+ if (mem[i] == (v)) return 0; \
+ } \
+ mem[memindex++] = (v); \
+}
+
+ if (rhsn == 0 || nd_type(rhsn) != NODE_ARRAY) {
+ return 0;
+ }
+
+ while (lhsn) {
+ NODE *ln = lhsn->nd_head;
+ switch (nd_type(ln)) {
+ case NODE_LASGN:
+ MEMORY(ln->nd_vid);
+ break;
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_IASGN:
+ case NODE_IASGN2:
+ case NODE_CVASGN:
+ MEMORY(ln->nd_vid);
+ break;
+ default:
+ return 0;
+ }
+ lhsn = lhsn->nd_next;
+ llen++;
+ }
+
+ while (rhsn) {
+ if (llen <= rlen) {
+ COMPILE_POPED(ret, "masgn val (popped)", rhsn->nd_head);
+ }
+ else {
+ COMPILE(ret, "masgn val", rhsn->nd_head);
+ }
+ rhsn = rhsn->nd_next;
+ rlen++;
+ }
+
+ if (llen > rlen) {
+ for (i=0; i<llen-rlen; i++) {
+ ADD_INSN(ret, nd_line(orig_lhsn), putnil);
+ }
+ }
+
+ compile_massign_opt_lhs(iseq, ret, orig_lhsn);
+ return 1;
+}
+
+static int
+compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
+{
+ NODE *rhsn = node->nd_value;
+ NODE *splatn = node->nd_args;
+ NODE *lhsn = node->nd_head;
+ int lhs_splat = (splatn && (VALUE)splatn != (VALUE)-1) ? 1 : 0;
+
+ if (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
+ int llen = 0;
+ DECL_ANCHOR(lhsseq);
+
+ INIT_ANCHOR(lhsseq);
+
+ while (lhsn) {
+ compile_massign_lhs(iseq, lhsseq, lhsn->nd_head);
+ llen += 1;
+ lhsn = lhsn->nd_next;
+ }
+
+ COMPILE(ret, "normal masgn rhs", rhsn);
+
+ if (!poped) {
+ ADD_INSN(ret, nd_line(node), dup);
+ }
+
+ ADD_INSN2(ret, nd_line(node), expandarray,
+ INT2FIX(llen), INT2FIX(lhs_splat));
+ ADD_SEQ(ret, lhsseq);
+
+ if (lhs_splat) {
+ if (nd_type(splatn) == NODE_POSTARG) {
+ /*a, b, *r, p1, p2 */
+ NODE *postn = splatn->nd_2nd;
+ NODE *restn = splatn->nd_1st;
+ int num = (int)postn->nd_alen;
+ int flag = 0x02 | (((VALUE)restn == (VALUE)-1) ? 0x00 : 0x01);
+
+ ADD_INSN2(ret, nd_line(splatn), expandarray,
+ INT2FIX(num), INT2FIX(flag));
+
+ if ((VALUE)restn != (VALUE)-1) {
+ compile_massign_lhs(iseq, ret, restn);
+ }
+ while (postn) {
+ compile_massign_lhs(iseq, ret, postn->nd_head);
+ postn = postn->nd_next;
+ }
+ }
+ else {
+ /* a, b, *r */
+ compile_massign_lhs(iseq, ret, splatn);
+ }
+ }
+ }
+ return COMPILE_OK;
+}
+
+static int
+compile_colon2(rb_iseq_t *iseq, NODE * node,
+ LINK_ANCHOR *pref, LINK_ANCHOR *body)
+{
+ switch (nd_type(node)) {
+ case NODE_CONST:
+ debugi("compile_colon2 - colon", node->nd_vid);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
+ break;
+ case NODE_COLON3:
+ debugi("compile_colon2 - colon3", node->nd_mid);
+ ADD_INSN(body, nd_line(node), pop);
+ ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+ break;
+ case NODE_COLON2:
+ compile_colon2(iseq, node->nd_head, pref, body);
+ debugi("compile_colon2 - colon2", node->nd_mid);
+ ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+ break;
+ default:
+ COMPILE(pref, "const colon2 prefix", node);
+ break;
+ }
+ return COMPILE_OK;
+}
+
+static VALUE
+compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
+{
+ if (nd_type(cpath) == NODE_COLON3) {
+ /* toplevel class ::Foo */
+ ADD_INSN1(ret, nd_line(cpath), putobject, rb_cObject);
+ return Qfalse;
+ }
+ else if (cpath->nd_head) {
+ /* Bar::Foo */
+ COMPILE(ret, "nd_else->nd_head", cpath->nd_head);
+ return Qfalse;
+ }
+ else {
+ /* class at cbase Foo */
+ ADD_INSN1(ret, nd_line(cpath), putspecialobject,
+ INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
+ return Qtrue;
+ }
+}
+
+#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,
+ NODE *node, LABEL **lfinish, VALUE needstr)
+{
+ enum defined_type expr_type = 0;
+ enum node_type type;
+
+ switch (type = nd_type(node)) {
+
+ /* easy literals */
+ case NODE_NIL:
+ expr_type = DEFINED_NIL;
+ break;
+ case NODE_SELF:
+ expr_type = DEFINED_SELF;
+ break;
+ case NODE_TRUE:
+ expr_type = DEFINED_TRUE;
+ break;
+ case NODE_FALSE:
+ expr_type = DEFINED_FALSE;
+ break;
+
+ case NODE_ARRAY:{
+ NODE *vals = node;
+
+ do {
+ defined_expr(iseq, ret, vals->nd_head, lfinish, Qfalse);
+
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+ } while ((vals = vals->nd_next) != NULL);
+ }
+ case NODE_STR:
+ case NODE_LIT:
+ case NODE_ZARRAY:
+ case NODE_AND:
+ case NODE_OR:
+ default:
+ expr_type = DEFINED_EXPR;
+ break;
+
+ /* variables */
+ case NODE_LVAR:
+ case NODE_DVAR:
+ expr_type = DEFINED_LVAR;
+ break;
+
+ case NODE_IVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_IVAR),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+
+ case NODE_GVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_GVAR),
+ ID2SYM(node->nd_entry->id), needstr);
+ return 1;
+
+ case NODE_CVAR:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CVAR),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+
+ case NODE_CONST:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(node->nd_vid), needstr);
+ return 1;
+ case NODE_COLON2:
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+
+ if (rb_is_const_id(node->nd_mid)) {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ else {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ return 1;
+ case NODE_COLON3:
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ ADD_INSN3(ret, nd_line(node), defined,
+ INT2FIX(DEFINED_CONST), ID2SYM(node->nd_mid), needstr);
+ return 1;
+
+ /* method dispatch */
+ case NODE_CALL:
+ case NODE_VCALL:
+ case NODE_FCALL:
+ case NODE_ATTRASGN:{
+ const int explicit_receiver =
+ (type == NODE_CALL ||
+ (type == NODE_ATTRASGN && !private_recv_p(node)));
+
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
+ }
+ if (node->nd_args) {
+ defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
+ }
+ if (explicit_receiver) {
+ 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);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ else {
+ ADD_INSN(ret, nd_line(node), putself);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_FUNC),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ return 1;
+ }
+
+ case NODE_YIELD:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_YIELD), 0,
+ needstr);
+ return 1;
+
+ case NODE_BACK_REF:
+ case NODE_NTH_REF:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_REF),
+ INT2FIX((node->nd_nth << 1) | (type == NODE_BACK_REF)),
+ needstr);
+ return 1;
+
+ case NODE_SUPER:
+ case NODE_ZSUPER:
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_ZSUPER), 0,
+ needstr);
+ return 1;
+
+ case NODE_OP_ASGN1:
+ case NODE_OP_ASGN2:
+ case NODE_OP_ASGN_OR:
+ case NODE_OP_ASGN_AND:
+ case NODE_MASGN:
+ case NODE_LASGN:
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_GASGN:
+ case NODE_IASGN:
+ case NODE_CDECL:
+ case NODE_CVDECL:
+ case NODE_CVASGN:
+ expr_type = DEFINED_ASGN;
+ break;
+ }
+
+ if (expr_type) {
+ if (needstr != Qfalse) {
+ VALUE str = rb_iseq_defined_string(expr_type);
+ ADD_INSN1(ret, nd_line(node), putobject, str);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
+ }
+ return 1;
+ }
+ return 0;
+}
+#undef defined_expr
+
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
+{
+ LINK_ELEMENT *lcur = ret->last;
+ int done = defined_expr0(iseq, ret, node, lfinish, needstr);
+ if (lfinish[1]) {
+ int line = nd_line(node);
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
+ lstart->rescued = LABEL_RESCUE_BEG;
+ lend->rescued = LABEL_RESCUE_END;
+ APPEND_LABEL(ret, lcur, lstart);
+ ADD_LABEL(ret, lend);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
+ }
+ return done;
+}
+
+static VALUE
+make_name_for_block(rb_iseq_t *iseq)
+{
+ int level = 1;
+ rb_iseq_t *ip = iseq;
+
+ if (iseq->parent_iseq != 0) {
+ while (ip->local_iseq != ip) {
+ if (ip->type == ISEQ_TYPE_BLOCK) {
+ level++;
+ }
+ ip = ip->parent_iseq;
+ }
+ }
+
+ if (level == 1) {
+ return rb_sprintf("block in %"PRIsVALUE, ip->location.label);
+ }
+ else {
+ return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, ip->location.label);
+ }
+}
+
+static void
+push_ensure_entry(rb_iseq_t *iseq,
+ struct iseq_compile_data_ensure_node_stack *enl,
+ struct ensure_range *er, NODE *node)
+{
+ enl->ensure_node = node;
+ enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
+ enl->erange = er;
+ iseq->compile_data->ensure_node_stack = enl;
+}
+
+static void
+add_ensure_range(rb_iseq_t *iseq, struct ensure_range *erange,
+ LABEL *lstart, LABEL *lend)
+{
+ struct ensure_range *ne =
+ compile_data_alloc(iseq, sizeof(struct ensure_range));
+
+ while (erange->next != 0) {
+ erange = erange->next;
+ }
+ ne->next = 0;
+ ne->begin = lend;
+ ne->end = erange->end;
+ erange->end = lstart;
+
+ erange->next = ne;
+}
+
+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->ensure_node_stack;
+ struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
+ DECL_ANCHOR(ensure);
+
+ INIT_ANCHOR(ensure);
+ while (enlp) {
+ if (enlp->erange != 0) {
+ DECL_ANCHOR(ensure_part);
+ LABEL *lstart = NEW_LABEL(0);
+ LABEL *lend = NEW_LABEL(0);
+ INIT_ANCHOR(ensure_part);
+
+ add_ensure_range(iseq, enlp->erange, lstart, lend);
+
+ 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);
+ ADD_SEQ(ensure, ensure_part);
+ }
+ else {
+ if (!is_return) {
+ break;
+ }
+ }
+ enlp = enlp->prev;
+ }
+ 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, rb_call_info_kw_arg_t **keywords)
+{
+ VALUE argc = INT2FIX(0);
+ int nsplat = 0;
+ DECL_ANCHOR(arg_block);
+ DECL_ANCHOR(args_splat);
+
+ INIT_ANCHOR(arg_block);
+ INIT_ANCHOR(args_splat);
+ if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
+ COMPILE(arg_block, "block", argn->nd_body);
+ *flag |= VM_CALL_ARGS_BLOCKARG;
+ argn = argn->nd_head;
+ }
+
+ setup_argn:
+ if (argn) {
+ 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;
+ break;
+ }
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH: {
+ int next_is_array = (nd_type(argn->nd_head) == NODE_ARRAY);
+ DECL_ANCHOR(tmp);
+
+ 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);
+ }
+ else {
+ ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ }
+ INSERT_LIST(args_splat, tmp);
+ nsplat++;
+ *flag |= VM_CALL_ARGS_SPLAT;
+
+ if (next_is_array) {
+ argc = INT2FIX(compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS) + 1);
+ }
+ else {
+ argn = argn->nd_head;
+ goto setup_argn;
+ }
+ break;
+ }
+ case NODE_ARRAY:
+ {
+ argc = INT2FIX(compile_array_(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS, keywords, FALSE));
+ break;
+ }
+ default: {
+ rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
+ }
+ }
+ }
+
+ if (nsplat > 1) {
+ int i;
+ for (i=1; i<nsplat; i++) {
+ ADD_INSN(args_splat, nd_line(args), concatarray);
+ }
+ }
+
+ if (!LIST_SIZE_ZERO(args_splat)) {
+ ADD_SEQ(args, args_splat);
+ }
+
+ if (*flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_SEQ(args, arg_block);
+ }
+ 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);
+ VALUE block = NEW_CHILD_ISEQVAL(body, make_name_for_block(iseq->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
+
+ self: InstructionSequence
+ node: Ruby compiled node
+ poped: This node will be poped
+ */
+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->last_line, putnil);
+ }
+ return COMPILE_OK;
+ }
+
+ line = (int)nd_line(node);
+
+ if (iseq->compile_data->last_line == line) {
+ /* ignore */
+ }
+ else {
+ if (node->flags & NODE_FL_NEWLINE) {
+ iseq->compile_data->last_line = line;
+ ADD_TRACE(ret, line, RUBY_EVENT_LINE);
+ saved_last_element = ret->last;
+ }
+ }
+
+ debug_node_start(node);
+
+ type = nd_type(node);
+
+ switch (type) {
+ case NODE_BLOCK:{
+ while (node && nd_type(node) == NODE_BLOCK) {
+ COMPILE_(ret, "BLOCK body", node->nd_head,
+ (node->nd_next == 0 && poped == 0) ? 0 : 1);
+ node = node->nd_next;
+ }
+ if (node) {
+ COMPILE_(ret, "BLOCK next", node->nd_next, poped);
+ }
+ break;
+ }
+ case NODE_IF:{
+ DECL_ANCHOR(cond_seq);
+ DECL_ANCHOR(then_seq);
+ DECL_ANCHOR(else_seq);
+ LABEL *then_label, *else_label, *end_label;
+
+ 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);
+
+ compile_branch_condition(iseq, cond_seq, node->nd_cond,
+ then_label, else_label);
+ COMPILE_(then_seq, "then", node->nd_body, poped);
+ COMPILE_(else_seq, "else", node->nd_else, poped);
+
+ ADD_SEQ(ret, cond_seq);
+
+ ADD_LABEL(ret, then_label);
+ ADD_SEQ(ret, then_seq);
+ ADD_INSNL(ret, line, jump, end_label);
+
+ ADD_LABEL(ret, else_label);
+ ADD_SEQ(ret, else_seq);
+
+ ADD_LABEL(ret, end_label);
+
+ break;
+ }
+ case NODE_CASE:{
+ NODE *vals;
+ NODE *tempnode = node;
+ LABEL *endlabel, *elselabel;
+ DECL_ANCHOR(head);
+ DECL_ANCHOR(body_seq);
+ DECL_ANCHOR(cond_seq);
+ int only_special_literals = 1;
+ VALUE literals = rb_hash_new();
+
+ INIT_ANCHOR(head);
+ INIT_ANCHOR(body_seq);
+ INIT_ANCHOR(cond_seq);
+
+ rb_hash_tbl_raw(literals)->type = &cdhash_type;
+
+ if (node->nd_head == 0) {
+ COMPILE_(ret, "when", node->nd_body, poped);
+ break;
+ }
+ COMPILE(head, "case base", node->nd_head);
+
+ 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)));
+ }
+
+ endlabel = NEW_LABEL(line);
+ elselabel = NEW_LABEL(line);
+
+ ADD_SEQ(ret, head); /* case VAL */
+
+ while (type == NODE_WHEN) {
+ LABEL *l1;
+
+ l1 = NEW_LABEL(line);
+ ADD_LABEL(body_seq, l1);
+ ADD_INSN(body_seq, line, pop);
+ COMPILE_(body_seq, "when body", node->nd_body, poped);
+ ADD_INSNL(body_seq, line, jump, endlabel);
+
+ vals = node->nd_head;
+ if (vals) {
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ only_special_literals = 0;
+ ADD_INSN (cond_seq, nd_line(vals), dup);
+ COMPILE(cond_seq, "when/cond splat", vals);
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
+ break;
+ default:
+ rb_bug("NODE_CASE: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ }
+ else {
+ rb_bug("NODE_CASE: must be NODE_ARRAY, but 0");
+ }
+
+ node = node->nd_next;
+ if (!node) {
+ break;
+ }
+ type = nd_type(node);
+ line = nd_line(node);
+ }
+ /* else */
+ if (node) {
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, line, pop);
+ COMPILE_(cond_seq, "else", node, poped);
+ ADD_INSNL(cond_seq, line, jump, endlabel);
+ }
+ else {
+ debugs("== else (implicit)\n");
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, nd_line(tempnode), pop);
+ if (!poped) {
+ ADD_INSN(cond_seq, nd_line(tempnode), putnil);
+ }
+ ADD_INSNL(cond_seq, nd_line(tempnode), jump, endlabel);
+ }
+
+ if (only_special_literals) {
+ iseq_add_mark_object(iseq, literals);
+
+ ADD_INSN(ret, nd_line(tempnode), dup);
+ ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
+ }
+
+ ADD_SEQ(ret, cond_seq);
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
+ break;
+ }
+ case NODE_WHEN:{
+ NODE *vals;
+ NODE *val;
+ NODE *orig_node = node;
+ LABEL *endlabel;
+ DECL_ANCHOR(body_seq);
+
+ INIT_ANCHOR(body_seq);
+ endlabel = NEW_LABEL(line);
+
+ while (node && nd_type(node) == NODE_WHEN) {
+ LABEL *l1 = NEW_LABEL(line = nd_line(node));
+ ADD_LABEL(body_seq, l1);
+ COMPILE_(body_seq, "when", node->nd_body, poped);
+ ADD_INSNL(body_seq, line, jump, endlabel);
+
+ vals = node->nd_head;
+ if (!vals) {
+ rb_bug("NODE_WHEN: must be NODE_ARRAY, but 0");
+ }
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ while (vals) {
+ val = vals->nd_head;
+ COMPILE(ret, "when2", val);
+ ADD_INSNL(ret, nd_line(val), branchif, l1);
+ vals = vals->nd_next;
+ }
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ ADD_INSN(ret, nd_line(vals), putnil);
+ COMPILE(ret, "when2/cond splat", vals);
+ ADD_INSN1(ret, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_WHEN | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(ret, nd_line(vals), branchif, l1);
+ break;
+ default:
+ rb_bug("NODE_WHEN: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ node = node->nd_next;
+ }
+ /* else */
+ COMPILE_(ret, "else", node, poped);
+ ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
+
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
+
+ break;
+ }
+ case NODE_OPT_N:
+ case NODE_WHILE:
+ case NODE_UNTIL:{
+ 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->start_label = NEW_LABEL(line); /* next */
+ LABEL *redo_label = iseq->compile_data->redo_label = NEW_LABEL(line); /* redo */
+ LABEL *break_label = iseq->compile_data->end_label = NEW_LABEL(line); /* break */
+ LABEL *end_label = NEW_LABEL(line);
+
+ LABEL *next_catch_label = NEW_LABEL(line);
+ LABEL *tmp_label = NULL;
+
+ 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);
+ }
+ else {
+ tmp_label = NEW_LABEL(line);
+ ADD_INSNL(ret, line, jump, tmp_label);
+ }
+ ADD_INSN(ret, line, putnil);
+ ADD_LABEL(ret, next_catch_label);
+ ADD_INSN(ret, line, pop);
+ ADD_INSNL(ret, line, jump, next_label);
+ if (tmp_label) ADD_LABEL(ret, tmp_label);
+
+ ADD_LABEL(ret, redo_label);
+ COMPILE_POPED(ret, "while body", node->nd_body);
+ ADD_LABEL(ret, next_label); /* next */
+
+ if (type == NODE_WHILE) {
+ compile_branch_condition(iseq, ret, node->nd_cond,
+ redo_label, end_label);
+ }
+ else if (type == NODE_UNTIL) {
+ /* until */
+ 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);
+ /* opt_n */
+ }
+
+ ADD_LABEL(ret, end_label);
+
+ if (node->nd_state == Qundef) {
+ /* ADD_INSN(ret, line, putundef); */
+ rb_bug("unsupported: putundef");
+ }
+ else {
+ ADD_INSN(ret, line, putnil);
+ }
+
+ ADD_LABEL(ret, break_label); /* break */
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label,
+ 0, break_label);
+ 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->redo_label);
+
+ 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_ITER:
+ case NODE_FOR:{
+ VALUE prevblock = iseq->compile_data->current_block;
+ LABEL *retry_label = NEW_LABEL(line);
+ LABEL *retry_end_l = NEW_LABEL(line);
+
+ ADD_LABEL(ret, retry_label);
+ if (nd_type(node) == NODE_FOR) {
+ COMPILE(ret, "iter caller (for)", node->nd_iter);
+
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
+
+ ADD_SEND_WITH_BLOCK(ret, line, idEach, INT2FIX(0), iseq->compile_data->current_block);
+ }
+ else {
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
+ COMPILE(ret, "iter caller", node->nd_iter);
+ }
+ ADD_LABEL(ret, retry_end_l);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+
+ iseq->compile_data->current_block = prevblock;
+
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
+
+ break;
+ }
+ case NODE_BREAK:{
+ unsigned long level = 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->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->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ 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 | 0x02) /* TAG_BREAK */ );
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ break_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
+ }
+ else {
+ rb_iseq_t *ip = iseq->parent_iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ level++;
+ 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->type == ISEQ_TYPE_BLOCK) {
+ level <<= 16;
+ goto break_by_insn;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto break_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ COMPILE_ERROR((ERROR_ARGS "Invalid break"));
+ }
+ break;
+ }
+ case NODE_NEXT:{
+ unsigned long level = 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->redo_label);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->start_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ 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->start_label);
+ COMPILE(ret, "next val", node->nd_stts);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ next_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
+ }
+ else {
+ rb_iseq_t *ip;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ level = 0x8000 | 0x4000;
+ if (ip->compile_data->redo_label != 0) {
+ /* while loop */
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto next_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ if (ip != 0) {
+ COMPILE(ret, "next val", node->nd_stts);
+ ADD_INSN1(ret, line, throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid next"));
+ }
+ }
+ break;
+ }
+ case NODE_REDO:{
+ 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->redo_label);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->redo_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ redo_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
+ }
+ 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->start_label);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->start_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ else {
+ rb_iseq_t *ip;
+ unsigned long level;
+ level = 0x8000 | 0x4000;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
+
+ if (ip->compile_data->redo_label != 0) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto redo_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ if (ip != 0) {
+ ADD_INSN(ret, line, putnil);
+ ADD_INSN1(ret, line, throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
+ }
+ }
+ break;
+ }
+ case NODE_RETRY:{
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN(ret, line, putnil);
+ ADD_INSN1(ret, line, throw, INT2FIX(0x04) /* TAG_RETRY */ );
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
+ }
+ break;
+ }
+ case NODE_BEGIN:{
+ COMPILE_(ret, "NODE_BEGIN", node->nd_body, poped);
+ break;
+ }
+ case NODE_RESCUE:{
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ LABEL *lcont = NEW_LABEL(line);
+ VALUE rescue = NEW_CHILD_ISEQVAL(
+ node->nd_resq,
+ rb_str_concat(rb_str_new2("rescue in "), iseq->location.label),
+ ISEQ_TYPE_RESCUE, line);
+
+ 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);
+ COMPILE(ret, "rescue else", node->nd_else);
+ }
+ ADD_INSN(ret, line, nop);
+ ADD_LABEL(ret, lcont);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+
+ /* register catch entry */
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lcont);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RETRY, lend, lcont, 0, lstart);
+ break;
+ }
+ case NODE_RESBODY:{
+ NODE *resq = node;
+ NODE *narg;
+ LABEL *label_miss, *label_hit;
+
+ while (resq) {
+ label_miss = NEW_LABEL(line);
+ label_hit = NEW_LABEL(line);
+
+ narg = resq->nd_args;
+ if (narg) {
+ switch (nd_type(narg)) {
+ case NODE_ARRAY:
+ while (narg) {
+ ADD_INSN2(ret, line, 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);
+ narg = narg->nd_next;
+ }
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ ADD_INSN2(ret, line, 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);
+ break;
+ default:
+ 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_INSNL(ret, line, jump, label_miss);
+ ADD_LABEL(ret, label_hit);
+ COMPILE(ret, "resbody body", resq->nd_body);
+ if (iseq->compile_data->option->tailcall_optimization) {
+ ADD_INSN(ret, line, nop);
+ }
+ ADD_INSN(ret, line, leave);
+ ADD_LABEL(ret, label_miss);
+ resq = resq->nd_head;
+ }
+ break;
+ }
+ case NODE_ENSURE:{
+ DECL_ANCHOR(ensr);
+ VALUE ensure = NEW_CHILD_ISEQVAL(node->nd_ensr,
+ rb_str_concat(rb_str_new2
+ ("ensure in "),
+ iseq->location.label),
+ ISEQ_TYPE_ENSURE, line);
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ LABEL *lcont = NEW_LABEL(line);
+ struct ensure_range er;
+ struct iseq_compile_data_ensure_node_stack enl;
+ struct ensure_range *erange;
+
+ INIT_ANCHOR(ensr);
+ COMPILE_POPED(ensr, "ensure ensr", node->nd_ensr);
+
+ er.begin = lstart;
+ er.end = lend;
+ er.next = 0;
+ push_ensure_entry(iseq, &enl, &er, node->nd_ensr);
+
+ ADD_LABEL(ret, lstart);
+ COMPILE_(ret, "ensure head", node->nd_head, poped);
+ ADD_LABEL(ret, lend);
+ if (ensr->anchor.next == 0) {
+ ADD_INSN(ret, line, nop);
+ }
+ else {
+ ADD_SEQ(ret, ensr);
+ }
+ ADD_LABEL(ret, lcont);
+
+ 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->ensure_node_stack = enl.prev;
+ break;
+ }
+
+ case NODE_AND:
+ case NODE_OR:{
+ LABEL *end_label = NEW_LABEL(line);
+ COMPILE(ret, "nd_1st", node->nd_1st);
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+ if (type == NODE_AND) {
+ ADD_INSNL(ret, line, branchunless, end_label);
+ }
+ else {
+ ADD_INSNL(ret, line, branchif, end_label);
+ }
+ if (!poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ COMPILE_(ret, "nd_2nd", node->nd_2nd, poped);
+ ADD_LABEL(ret, end_label);
+ break;
+ }
+
+ case NODE_MASGN:{
+ compile_massign(iseq, ret, node, poped);
+ break;
+ }
+
+ case NODE_LASGN:{
+ ID id = node->nd_vid;
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+
+ debugs("lvar: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
+ COMPILE(ret, "rvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+ ADD_INSN2(ret, line, setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+
+ break;
+ }
+ case NODE_DASGN:
+ 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 : '*');
+
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+
+ idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
+
+ if (idx < 0) {
+ rb_bug("NODE_DASGN(_CURR): unknown id (%"PRIsVALUE")", rb_id2str(node->nd_vid));
+ }
+
+ ADD_INSN2(ret, line, setlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ break;
+ }
+ case NODE_GASGN:{
+ COMPILE(ret, "lvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+ ADD_INSN1(ret, line, setglobal,
+ ((VALUE)node->nd_entry | 1));
+ break;
+ }
+ case NODE_IASGN:
+ case NODE_IASGN2:{
+ COMPILE(ret, "lvalue", node->nd_value);
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+ ADD_INSN2(ret, line, setinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
+ break;
+ }
+ case NODE_CDECL:{
+ COMPILE(ret, "lvalue", node->nd_value);
+
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
+
+ if (node->nd_vid) {
+ ADD_INSN1(ret, line, putspecialobject,
+ INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
+ ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_vid));
+ }
+ else {
+ compile_cpath(ret, iseq, node->nd_else);
+ ADD_INSN1(ret, line, 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_INSN1(ret, line, setclassvariable,
+ ID2SYM(node->nd_vid));
+ break;
+ }
+ case NODE_OP_ASGN1: {
+ DECL_ANCHOR(args);
+ VALUE argc;
+ unsigned int flag = 0;
+ unsigned int asgnflag = 0;
+ ID id = node->nd_mid;
+ int boff = 0;
+
+ /*
+ * a[x] (op)= y
+ *
+ * nil # nil
+ * eval a # nil a
+ * eval x # nil a x
+ * dupn 2 # nil a x a x
+ * send :[] # nil a x a[x]
+ * eval y # nil a x a[x] y
+ * send op # nil a x ret
+ * setn 3 # ret a x ret
+ * send []= # ret ?
+ * pop # ret
+ */
+
+ /*
+ * nd_recv[nd_args->nd_body] (nd_mid)= nd_args->nd_head;
+ * NODE_OP_ASGN nd_recv
+ * nd_args->nd_head
+ * nd_args->nd_body
+ * nd_mid
+ */
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
+ switch (nd_type(node->nd_args->nd_head)) {
+ case NODE_ZARRAY:
+ argc = INT2FIX(0);
+ break;
+ case NODE_BLOCK_PASS:
+ boff = 1;
+ default:
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
+ ADD_SEQ(ret, args);
+ }
+ ADD_INSN1(ret, line, dupn, FIXNUM_INC(argc, 1 + boff));
+ flag |= asgnflag;
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, argc, INT2FIX(flag));
+
+ if (id == 0 || id == 1) {
+ /* 0: or, 1: and
+ a[x] ||= y
+
+ unless/if a[x]
+ a[x]= y
+ else
+ nil
+ end
+ */
+ LABEL *label = NEW_LABEL(line);
+ LABEL *lfin = NEW_LABEL(line);
+
+ ADD_INSN(ret, line, dup);
+ if (id == 0) {
+ /* or */
+ ADD_INSNL(ret, line, branchif, label);
+ }
+ else {
+ /* and */
+ ADD_INSNL(ret, line, branchunless, label);
+ }
+ ADD_INSN(ret, line, 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));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, line, newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, line, dupn, INT2FIX(3));
+ ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, line, pop);
+ }
+ ADD_INSN(ret, line, concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, line, setn, INT2FIX(3));
+ ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, line, pop);
+ }
+ ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(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, line, pop);
+ ADD_INSNL(ret, line, jump, lfin);
+ ADD_LABEL(ret, label);
+ if (!poped) {
+ ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
+ }
+ ADD_INSN1(ret, line, 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));
+ if (!poped) {
+ ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
+ }
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, line, newarray, INT2FIX(1));
+ if (boff > 0) {
+ ADD_INSN1(ret, line, dupn, INT2FIX(3));
+ ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, line, pop);
+ }
+ ADD_INSN(ret, line, concatarray);
+ if (boff > 0) {
+ ADD_INSN1(ret, line, setn, INT2FIX(3));
+ ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, line, pop);
+ }
+ ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(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, line, pop);
+ }
+
+ break;
+ }
+ case NODE_OP_ASGN2:{
+ ID atype = node->nd_next->nd_mid;
+ VALUE asgnflag;
+ LABEL *lfin = NEW_LABEL(line);
+ LABEL *lcfin = NEW_LABEL(line);
+ /*
+ class C; attr_accessor :c; end
+ r = C.new
+ r.a &&= v # asgn2
+
+ eval r # r
+ dup # r r
+ eval r.a # r o
+
+ # or
+ dup # r o o
+ if lcfin # r o
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ lcfin: # r o
+ swap # o r
+
+ lfin: # o ?
+ pop # o
+
+ # and
+ dup # r o o
+ unless lcfin
+ pop # r
+ eval v # r v
+ swap # v r
+ topn 1 # v r v
+ send a= # v ?
+ jump lfin # v ?
+
+ # others
+ eval v # r o v
+ send ?? # r w
+ send a= # w
+
+ */
+
+ asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
+ ADD_INSN(ret, line, dup);
+ ADD_SEND_WITH_FLAG(ret, line, node->nd_next->nd_vid, INT2FIX(0), INT2FIX(asgnflag));
+
+ if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
+ ADD_INSN(ret, line, dup);
+ if (atype == 0) {
+ ADD_INSNL(ret, line, branchif, lcfin);
+ }
+ else {
+ ADD_INSNL(ret, line, branchunless, lcfin);
+ }
+ ADD_INSN(ret, line, 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, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_INSNL(ret, line, jump, lfin);
+
+ ADD_LABEL(ret, lcfin);
+ ADD_INSN(ret, line, swap);
+
+ ADD_LABEL(ret, lfin);
+ ADD_INSN(ret, line, pop);
+ if (poped) {
+ /* we can apply more optimize */
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ else {
+ COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
+ ADD_SEND(ret, line, 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, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_OP_CDECL: {
+ LABEL *lfin = 0;
+ LABEL *lassign = 0;
+ ID mid;
+
+ switch (nd_type(node->nd_head)) {
+ case NODE_COLON3:
+ ADD_INSN1(ret, line, putobject, rb_cObject);
+ break;
+ case NODE_COLON2:
+ COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
+ break;
+ default:
+ 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),
+ ID2SYM(mid), Qfalse); /* cref bool */
+ ADD_INSNL(ret, line, branchunless, lassign); /* cref */
+ }
+ ADD_INSN(ret, line, dup); /* cref cref */
+ ADD_INSN1(ret, line, 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 */
+ if (node->nd_aid == 0)
+ ADD_INSNL(ret, line, branchif, lfin);
+ else
+ ADD_INSNL(ret, line, branchunless, lfin);
+ /* cref [obj] */
+ if (!poped) ADD_INSN(ret, line, 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 */
+ else {
+ ADD_INSN1(ret, line, dupn, INT2FIX(2)); /* cref value cref value */
+ ADD_INSN(ret, line, swap); /* cref value value cref */
+ }
+ ADD_INSN1(ret, line, 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] */
+ }
+ else {
+ COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
+ /* cref obj value */
+ ADD_CALL(ret, line, node->nd_aid, INT2FIX(1));
+ /* cref value */
+ ADD_INSN(ret, line, 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, line, setconstant, ID2SYM(mid));
+ }
+ break;
+ }
+ case NODE_OP_ASGN_AND:
+ case NODE_OP_ASGN_OR:{
+ LABEL *lfin = NEW_LABEL(line);
+ LABEL *lassign;
+
+ if (nd_type(node) == NODE_OP_ASGN_OR) {
+ LABEL *lfinish[2];
+ lfinish[0] = lfin;
+ lfinish[1] = 0;
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ lassign = lfinish[1];
+ if (!lassign) {
+ lassign = NEW_LABEL(line);
+ }
+ ADD_INSNL(ret, line, branchunless, lassign);
+ }
+ else {
+ lassign = NEW_LABEL(line);
+ }
+
+ COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head);
+ ADD_INSN(ret, line, dup);
+
+ if (nd_type(node) == NODE_OP_ASGN_AND) {
+ ADD_INSNL(ret, line, branchunless, lfin);
+ }
+ else {
+ ADD_INSNL(ret, line, branchif, lfin);
+ }
+
+ ADD_INSN(ret, line, 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);
+ }
+ 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->current_block == Qfalse &&
+ iseq->compile_data->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->current_block == Qfalse &&
+ iseq->compile_data->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_INSN2(ret, line, opt_aref_with,
+ new_callinfo(iseq, idAREF, 1, 0, 0, NULL), str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_FCALL:
+ case NODE_VCALL:{ /* VCALL: variable or call */
+ /*
+ call: obj.method(...)
+ fcall: func(...)
+ vcall: func
+ */
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ ID mid = node->nd_mid;
+ VALUE argc;
+ unsigned int flag = 0;
+ rb_call_info_kw_arg_t *keywords = NULL;
+ VALUE parent_block = iseq->compile_data->current_block;
+ iseq->compile_data->current_block = Qfalse;
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+#if SUPPORT_JOKE
+ if (nd_type(node) == NODE_VCALL) {
+ ID id_bitblt;
+ ID id_answer;
+
+ CONST_ID(id_bitblt, "bitblt");
+ CONST_ID(id_answer, "the_answer_to_life_the_universe_and_everything");
+
+ if (mid == id_bitblt) {
+ ADD_INSN(ret, line, bitblt);
+ break;
+ }
+ else if (mid == id_answer) {
+ ADD_INSN(ret, line, answer);
+ break;
+ }
+ }
+ /* only joke */
+ {
+ ID goto_id;
+ ID label_id;
+
+ CONST_ID(goto_id, "__goto__");
+ CONST_ID(label_id, "__label__");
+
+ if (nd_type(node) == NODE_FCALL &&
+ (mid == goto_id || mid == label_id)) {
+ LABEL *label;
+ st_data_t data;
+ st_table *labels_table = iseq->compile_data->labels_table;
+ ID label_name;
+
+ if (!labels_table) {
+ labels_table = st_init_numtable();
+ 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;
+ st_insert(labels_table, (st_data_t)label_name, (st_data_t)label);
+ }
+ else {
+ label = (LABEL *)data;
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
+ }
+
+
+ if (mid == goto_id) {
+ ADD_INSNL(ret, line, jump, label);
+ }
+ else {
+ ADD_LABEL(ret, label);
+ }
+ break;
+ }
+ }
+#endif
+ /* receiver */
+ if (type == NODE_CALL) {
+ COMPILE(recv, "recv", node->nd_recv);
+ }
+ else if (type == NODE_FCALL || type == NODE_VCALL) {
+ ADD_CALL_RECEIVER(recv, line);
+ }
+
+ /* args */
+ if (nd_type(node) != NODE_VCALL) {
+ argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ debugp_param("call args argc", argc);
+ debugp_param("call method", ID2SYM(mid));
+
+ switch (nd_type(node)) {
+ case NODE_VCALL:
+ flag |= VM_CALL_VCALL;
+ /* VCALL is funcall, so fall through */
+ case NODE_FCALL:
+ flag |= VM_CALL_FCALL;
+ }
+
+ ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_SUPER:
+ case NODE_ZSUPER:{
+ DECL_ANCHOR(args);
+ int argc;
+ unsigned int flag = 0;
+ rb_call_info_kw_arg_t *keywords = NULL;
+ VALUE parent_block = iseq->compile_data->current_block;
+
+ INIT_ANCHOR(args);
+ 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);
+ }
+ else {
+ /* NODE_ZSUPER */
+ int i;
+ rb_iseq_t *liseq = iseq->local_iseq;
+ int lvar_level = get_lvar_level(iseq);
+
+ argc = liseq->param.lead_num;
+
+ /* normal arguments */
+ for (i = 0; i < liseq->param.lead_num; i++) {
+ int idx = liseq->local_size - i;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+
+ if (liseq->param.flags.has_opt) {
+ /* optional arguments */
+ int j;
+ for (j = 0; j < liseq->param.opt_num; j++) {
+ int idx = liseq->local_size - (i + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ i += j;
+ argc = i;
+ }
+ if (liseq->param.flags.has_rest) {
+ /* rest argument */
+ int idx = liseq->local_size - liseq->param.rest_start;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ argc = liseq->param.rest_start + 1;
+ flag |= VM_CALL_ARGS_SPLAT;
+ }
+ if (liseq->param.flags.has_post) {
+ /* post arguments */
+ int post_len = liseq->param.post_num;
+ int post_start = liseq->param.post_start;
+
+ if (liseq->param.flags.has_rest) {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ ADD_INSN1(args, line, newarray, INT2FIX(j));
+ ADD_INSN (args, line, concatarray);
+ /* argc is settled at above */
+ }
+ else {
+ int j;
+ for (j=0; j<post_len; j++) {
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ argc = post_len + post_start;
+ }
+ }
+
+ if (liseq->param.flags.has_kw) { /* TODO: support keywords */
+ int local_size = liseq->local_size;
+ argc++;
+
+ ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+
+ if (liseq->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->local_size - liseq->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->param.keyword->num; ++i) {
+ ID id = liseq->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->param.flags.has_rest) {
+ ADD_INSN1(args, line, newarray, INT2FIX(1));
+ ADD_INSN (args, line, concatarray);
+ --argc;
+ }
+ }
+ else if (liseq->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->local_size - liseq->param.keyword->rest_start), INT2FIX(lvar_level));
+ ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
+ if (liseq->param.flags.has_rest) {
+ ADD_INSN1(args, line, newarray, INT2FIX(1));
+ ADD_INSN (args, line, concatarray);
+ }
+ else {
+ argc++;
+ }
+ }
+ }
+
+ /* dummy receiver */
+ ADD_INSN1(ret, line, putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
+ ADD_SEQ(ret, args);
+ ADD_INSN1(ret, line, invokesuper, new_callinfo(iseq, 0, argc, parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL, keywords));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_ARRAY:{
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, NULL, poped);
+ break;
+ }
+ case NODE_ZARRAY:{
+ if (!poped) {
+ ADD_INSN1(ret, line, newarray, INT2FIX(0));
+ }
+ break;
+ }
+ case NODE_VALUES:{
+ NODE *n = node;
+ while (n) {
+ COMPILE(ret, "values item", n->nd_head);
+ n = n->nd_next;
+ }
+ ADD_INSN1(ret, line, newarray, INT2FIX(node->nd_alen));
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_HASH:{
+ DECL_ANCHOR(list);
+ int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
+
+ INIT_ANCHOR(list);
+ switch (type) {
+ case NODE_ARRAY:
+ compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
+ ADD_SEQ(ret, list);
+ break;
+
+ case NODE_ZARRAY:
+ ADD_INSN1(ret, line, newhash, INT2FIX(0));
+ break;
+
+ default:
+ rb_bug("can't make hash with this node: %s", ruby_node_name(type));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_RETURN:{
+ rb_iseq_t *is = iseq;
+
+ if (is) {
+ if (is->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid return"));
+ }
+ else {
+ LABEL *splabel = 0;
+
+ if (is->type == ISEQ_TYPE_METHOD) {
+ splabel = NEW_LABEL(0);
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, line, 0);
+ }
+
+ COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
+
+ 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_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ else {
+ ADD_INSN1(ret, line, throw, INT2FIX(0x01) /* TAG_RETURN */ );
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ }
+ }
+ break;
+ }
+ case NODE_YIELD:{
+ DECL_ANCHOR(args);
+ VALUE argc;
+ unsigned int flag = 0;
+ rb_call_info_kw_arg_t *keywords = NULL;
+
+ INIT_ANCHOR(args);
+ 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);
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, args);
+ ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag, keywords));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_LVAR:{
+ if (!poped) {
+ ID id = node->nd_vid;
+ 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)));
+ }
+ break;
+ }
+ case NODE_DVAR:{
+ int lv, idx, ls;
+ debugi("nd_vid", node->nd_vid);
+ if (!poped) {
+ idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
+ if (idx < 0) {
+ rb_bug("unknown dvar (%"PRIsVALUE")", rb_id2str(node->nd_vid));
+ }
+ ADD_INSN2(ret, line, getlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ }
+ break;
+ }
+ case NODE_GVAR:{
+ ADD_INSN1(ret, line, getglobal,
+ ((VALUE)node->nd_entry | 1));
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_IVAR:{
+ debugi("nd_vid", node->nd_vid);
+ if (!poped) {
+ ADD_INSN2(ret, line, getinstancevariable,
+ ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
+ }
+ break;
+ }
+ case NODE_CONST:{
+ debugi("nd_vid", node->nd_vid);
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ LABEL *lend = NEW_LABEL(line);
+ int ic_index = iseq->is_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_LABEL(ret, lend);
+ }
+ else {
+ ADD_INSN(ret, line, putnil);
+ ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_CVAR:{
+ if (!poped) {
+ ADD_INSN1(ret, line, 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) /* '~' */,
+ INT2FIX(node->nd_nth << 1));
+ }
+ break;
+ }
+ case NODE_BACK_REF:{
+ if (!poped) {
+ ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
+ INT2FIX(0x01 | (node->nd_nth << 1)));
+ }
+ break;
+ }
+ case NODE_MATCH:
+ case NODE_MATCH2:
+ case NODE_MATCH3:{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(val);
+
+ INIT_ANCHOR(recv);
+ 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),
+ INT2FIX(0));
+ break;
+ case NODE_MATCH2:
+ COMPILE(recv, "receiver", node->nd_recv);
+ COMPILE(val, "value", node->nd_value);
+ break;
+ case NODE_MATCH3:
+ COMPILE(recv, "receiver", node->nd_value);
+ COMPILE(val, "value", node->nd_recv);
+ break;
+ }
+
+ 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,
+ OPERAND_AT(recv->last, 0));
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_INSN1(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, 0, NULL));
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_LIT:{
+ debugp_param("lit", node->nd_lit);
+ if (!poped) {
+ ADD_INSN1(ret, line, putobject, node->nd_lit);
+ }
+ break;
+ }
+ case NODE_STR:{
+ node->nd_lit = rb_fstring(node->nd_lit);
+ debugp_param("nd_lit", node->nd_lit);
+ if (!poped) {
+ ADD_INSN1(ret, line, putstring, node->nd_lit);
+ }
+ break;
+ }
+ case NODE_DSTR:{
+ compile_dstr(iseq, ret, node);
+
+ if (poped) {
+ ADD_INSN(ret, line, 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));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_DXSTR:{
+ ADD_CALL_RECEIVER(ret, line);
+ compile_dstr(iseq, ret, node);
+ ADD_CALL(ret, line, idBackquote, INT2FIX(1));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_EVSTR:{
+ COMPILE(ret, "nd_body", node->nd_body);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ else {
+ ADD_INSN(ret, line, tostring);
+ }
+ break;
+ }
+ case NODE_DREGX:{
+ compile_dregx(iseq, ret, node);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_DREGX_ONCE:{
+ int ic_index = iseq->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);
+ VALUE block_iseq = NEW_CHILD_ISEQVAL(block_node, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+
+ ADD_INSN2(ret, line, once, block_iseq, INT2FIX(ic_index));
+
+ if (poped) {
+ ADD_INSN(ret, line, 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);
+ COMPILE(ret, "argscat body", node->nd_body);
+ ADD_INSN1(ret, line, splatarray, Qfalse);
+ ADD_INSN(ret, line, pop);
+ }
+ else {
+ COMPILE(ret, "argscat head", node->nd_head);
+ COMPILE(ret, "argscat body", node->nd_body);
+ ADD_INSN(ret, line, 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);
+ 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);
+ }
+ break;
+ }
+ case NODE_SPLAT:{
+ COMPILE(ret, "splat", node->nd_head);
+ ADD_INSN1(ret, line, splatarray, Qtrue);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_DEFN:{
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
+
+ debugp_param("defn/iseq", iseqval);
+
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, line, putiseq, iseqval);
+ ADD_SEND (ret, line, id_core_define_method, INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+
+ debugp_param("defn", iseqval);
+ break;
+ }
+ case NODE_DEFS:{
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
+
+ debugp_param("defs/iseq", iseqval);
+
+ ADD_INSN1(ret, line, 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, iseqval);
+ ADD_SEND (ret, line, id_core_define_singleton_method, INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, line, 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));
+ 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));
+
+ if (poped) {
+ ADD_INSN(ret, line, 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));
+
+ if (poped) {
+ ADD_INSN(ret, line, 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));
+ COMPILE(ret, "undef arg", node->u2.node);
+ ADD_SEND(ret, line, id_core_undef_method, INT2FIX(2));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_CLASS:{
+ VALUE iseqval =
+ NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<class:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
+ 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), iseqval, INT2FIX(flags));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_MODULE:{
+ VALUE iseqval = NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<module:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
+
+ 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), iseqval, INT2FIX(flags));
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_SCLASS:{
+ ID singletonclass;
+ VALUE iseqval =
+ NEW_ISEQVAL(node->nd_body, rb_str_new2("singleton class"),
+ ISEQ_TYPE_CLASS, line);
+
+ COMPILE(ret, "sclass#recv", node->nd_recv);
+ ADD_INSN (ret, line, putnil);
+ CONST_ID(singletonclass, "singletonclass");
+ ADD_INSN3(ret, line, defineclass,
+ ID2SYM(singletonclass), iseqval,
+ INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_COLON2:{
+ if (rb_is_const_id(node->nd_mid)) {
+ /* constant */
+ LABEL *lend = NEW_LABEL(line);
+ int ic_index = iseq->is_size++;
+
+ DECL_ANCHOR(pref);
+ DECL_ANCHOR(body);
+
+ INIT_ANCHOR(pref);
+ INIT_ANCHOR(body);
+ compile_colon2(iseq, node, pref, body);
+ if (LIST_SIZE_ZERO(pref)) {
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
+ }
+ else {
+ ADD_INSN(ret, line, putnil);
+ }
+
+ ADD_SEQ(ret, body);
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+ }
+ else {
+ ADD_SEQ(ret, pref);
+ ADD_SEQ(ret, body);
+ }
+ }
+ else {
+ /* function call */
+ ADD_CALL_RECEIVER(ret, line);
+ COMPILE(ret, "colon2#nd_head", node->nd_head);
+ ADD_CALL(ret, line, node->nd_mid, INT2FIX(1));
+ }
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_COLON3:{
+ LABEL *lend = NEW_LABEL(line);
+ int ic_index = iseq->is_size++;
+
+ debugi("colon3#nd_mid", node->nd_mid);
+
+ /* add cache insn */
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN(ret, line, pop);
+ }
+
+ ADD_INSN1(ret, line, putobject, rb_cObject);
+ ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
+
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
+ ADD_LABEL(ret, lend);
+ }
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_DOT2:
+ case NODE_DOT3:{
+ VALUE flag = type == NODE_DOT2 ? INT2FIX(0) : INT2FIX(1);
+ 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);
+ }
+ else {
+ ADD_INSN1(ret, line, 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->local_iseq;
+ rb_num_t cnt;
+ VALUE key;
+
+ cnt = local_iseq->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
+ key = INT2FIX(cnt);
+
+ ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));
+ ADD_INSNL(ret, line, branchif, lend);
+
+ /* *flip == 0 */
+ COMPILE(ret, "flip2 beg", node->nd_beg);
+ ADD_INSN(ret, line, dup);
+ ADD_INSNL(ret, line, 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);
+ }
+ else {
+ ADD_INSN1(ret, line, 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_LABEL(ret, ltrue);
+ ADD_INSN1(ret, line, putobject, Qtrue);
+
+ ADD_LABEL(ret, lfin);
+ break;
+ }
+ case NODE_SELF:{
+ if (!poped) {
+ ADD_INSN(ret, line, putself);
+ }
+ break;
+ }
+ case NODE_NIL:{
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ break;
+ }
+ case NODE_TRUE:{
+ if (!poped) {
+ ADD_INSN1(ret, line, putobject, Qtrue);
+ }
+ break;
+ }
+ case NODE_FALSE:{
+ if (!poped) {
+ ADD_INSN1(ret, line, putobject, Qfalse);
+ }
+ break;
+ }
+ case NODE_ERRINFO:{
+ if (!poped) {
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ }
+ else {
+ rb_iseq_t *ip = iseq;
+ int level = 0;
+ while (ip) {
+ if (ip->type == ISEQ_TYPE_RESCUE) {
+ break;
+ }
+ ip = ip->parent_iseq;
+ level++;
+ }
+ if (ip) {
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(level));
+ }
+ else {
+ ADD_INSN(ret, line, 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 {
+ LABEL *lfinish[2];
+ lfinish[0] = NEW_LABEL(line);
+ lfinish[1] = 0;
+ ADD_INSN(ret, line, putnil);
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
+ ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, line, pop);
+ if (lfinish[1]) {
+ ADD_LABEL(ret, lfinish[1]);
+ }
+ ADD_LABEL(ret, lfinish[0]);
+ }
+ break;
+ }
+ case NODE_POSTEXE:{
+ /* compiled to:
+ * ONCE{ rb_mRubyVMFrozenCore::core#set_postexe{ ... } }
+ */
+ int is_index = iseq->is_size++;
+ VALUE once_iseq = NEW_CHILD_ISEQVAL(
+ NEW_IFUNC(build_postexe_iseq, node->nd_body),
+ make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+
+ ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index));
+
+ if (poped) {
+ ADD_INSN(ret, line, 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_bug("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_bug("unreachable");
+ }
+ else {
+ /* if keywordcheck(_kw_bits, nth_keyword)
+ * kw = default_value
+ * end
+ */
+ int kw_bits_idx = iseq->local_size - iseq->param.keyword->bits_start;
+ int keyword_idx = iseq->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);
+ }
+
+ break;
+ }
+ case NODE_DSYM:{
+ compile_dstr(iseq, ret, node);
+ if (!poped) {
+ ADD_SEND(ret, line, idIntern, INT2FIX(0));
+ }
+ else {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_ATTRASGN:{
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ unsigned int flag = 0;
+ VALUE argc;
+ int asgnflag;
+
+ /* optimization shortcut
+ * obj["literal"] = value -> opt_aset_with(obj, "literal", value)
+ */
+ if (node->nd_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->current_block == Qfalse &&
+ iseq->compile_data->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_INSN2(ret, line, opt_aset_with,
+ new_callinfo(iseq, idASET, 2, 0, 0, NULL), str);
+ ADD_INSN(ret, line, pop);
+ break;
+ }
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
+
+ flag |= (asgnflag = COMPILE_RECV(recv, "recv", node));
+
+ debugp_param("argc", argc);
+ debugp_param("nd_mid", ID2SYM(node->nd_mid));
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ if (flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_INSN1(ret, line, topn, INT2FIX(1));
+ if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN1(ret, line, putobject, INT2FIX(-1));
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ }
+ ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 3));
+ ADD_INSN (ret, line, pop);
+ }
+ else if (flag & VM_CALL_ARGS_SPLAT) {
+ ADD_INSN(ret, line, dup);
+ ADD_INSN1(ret, line, putobject, INT2FIX(-1));
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2));
+ ADD_INSN (ret, line, pop);
+ }
+ else {
+ ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 1));
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+ }
+ ADD_SEND_WITH_FLAG(ret, line, node->nd_mid, argc, INT2FIX(flag));
+ ADD_INSN(ret, line, pop);
+
+ break;
+ }
+ case NODE_PRELUDE:{
+ COMPILE_POPED(ret, "prelude", node->nd_head);
+ COMPILE_(ret, "body", node->nd_body, poped);
+ break;
+ }
+ case NODE_LAMBDA:{
+ /* compile same as lambda{...} */
+ VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ VALUE argc = INT2FIX(0);
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_CALL_WITH_BLOCK(ret, line, idLambda, argc, block);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ default:
+ 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;
+}
+
+/***************************/
+/* instruction information */
+/***************************/
+
+static int
+insn_data_length(INSN *iobj)
+{
+ return insn_len(iobj->insn_id);
+}
+
+static int
+calc_sp_depth(int depth, INSN *insn)
+{
+ return insn_stack_increase(depth, insn->insn_id, insn->operands);
+}
+
+static VALUE
+opobj_inspect(VALUE obj)
+{
+ 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);
+}
+
+
+
+static VALUE
+insn_data_to_s_detail(INSN *iobj)
+{
+ VALUE str = rb_sprintf("%-20s ", insn_name(iobj->insn_id));
+
+ if (iobj->operands) {
+ const char *types = insn_op_types(iobj->insn_id);
+ int j;
+
+ for (j = 0; types[j]; j++) {
+ char type = types[j];
+
+ switch (type) {
+ case TS_OFFSET: /* label(destination position) */
+ {
+ LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<L%03d>", lobj->label_no);
+ break;
+ }
+ break;
+ case TS_ISEQ: /* iseq */
+ {
+ rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
+ VALUE val = Qnil;
+ if (0 && iseq) { /* TODO: invalidate now */
+ val = iseq->self;
+ }
+ rb_str_concat(str, opobj_inspect(val));
+ }
+ break;
+ case TS_LINDEX:
+ case TS_NUM: /* ulong */
+ case TS_VALUE: /* VALUE */
+ {
+ VALUE v = OPERAND_AT(iobj, j);
+ rb_str_concat(str, opobj_inspect(v));
+ break;
+ }
+ case TS_ID: /* ID */
+ rb_str_concat(str, opobj_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));
+ break;
+ }
+ case TS_IC: /* inline cache */
+ rb_str_catf(str, "<ic:%d>", FIX2INT(OPERAND_AT(iobj, j)));
+ break;
+ case TS_CALLINFO: /* call info */
+ {
+ rb_call_info_t *ci = (rb_call_info_t *)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_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);
+ }
+ }
+ if (types[j + 1]) {
+ rb_str_cat2(str, ", ");
+ }
+ }
+ }
+ return str;
+}
+
+static void
+dump_disasm_list(struct iseq_link_element *link)
+{
+ int pos = 0;
+ INSN *iobj;
+ LABEL *lobj;
+ VALUE str;
+
+ printf("-- raw disasm--------\n");
+
+ while (link) {
+ switch (link->type) {
+ case ISEQ_ELEMENT_INSN:
+ {
+ iobj = (INSN *)link;
+ str = insn_data_to_s_detail(iobj);
+ printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), iobj->line_no);
+ pos += insn_data_length(iobj);
+ break;
+ }
+ case ISEQ_ELEMENT_LABEL:
+ {
+ lobj = (LABEL *)link;
+ printf("<L%03d>\n", lobj->label_no);
+ break;
+ }
+ case ISEQ_ELEMENT_NONE:
+ {
+ printf("[none]\n");
+ break;
+ }
+ case ISEQ_ELEMENT_ADJUST:
+ {
+ ADJUST *adjust = (ADJUST *)link;
+ printf("adjust: [label: %d]\n", adjust->label ? adjust->label->label_no : -1);
+ break;
+ }
+ default:
+ /* ignore */
+ rb_raise(rb_eSyntaxError, "dump_disasm_list error: %ld\n", FIX2LONG(link->type));
+ }
+ link = link->next;
+ }
+ printf("---------------------\n");
+}
+
+const char *
+rb_insns_name(int i)
+{
+ return insn_name_info[i];
+}
+
+VALUE
+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])));
+ }
+ return rb_obj_freeze(ary);
+}
+
+static LABEL *
+register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
+{
+ LABEL *label = 0;
+ st_data_t tmp;
+ obj = rb_convert_type(obj, T_SYMBOL, "Symbol", "to_sym");
+
+ if (st_lookup(labels_table, obj, &tmp) == 0) {
+ label = NEW_LABEL(0);
+ st_insert(labels_table, obj, (st_data_t)label);
+ }
+ else {
+ label = (LABEL *)tmp;
+ }
+ return label;
+}
+
+static VALUE
+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;
+
+ if (symRescue == 0) {
+ symRescue = ID2SYM(rb_intern("rescue"));
+ symEnsure = ID2SYM(rb_intern("ensure"));
+ symRetry = ID2SYM(rb_intern("retry"));
+ symBreak = ID2SYM(rb_intern("break"));
+ symRedo = ID2SYM(rb_intern("redo"));
+ symNext = ID2SYM(rb_intern("next"));
+ }
+
+ if (sym == symRescue) return CATCH_TYPE_RESCUE;
+ if (sym == symEnsure) return CATCH_TYPE_ENSURE;
+ if (sym == symRetry) return CATCH_TYPE_RETRY;
+ if (sym == symBreak) return CATCH_TYPE_BREAK;
+ if (sym == symRedo) return CATCH_TYPE_REDO;
+ if (sym == symNext) return CATCH_TYPE_NEXT;
+ sym_inspect = rb_inspect(sym);
+ rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
+ StringValuePtr(sym_inspect));
+ return 0;
+}
+
+static int
+iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
+ VALUE exception)
+{
+ int i;
+
+ for (i=0; i<RARRAY_LEN(exception); i++) {
+ VALUE v, type, eiseqval;
+ const VALUE *ptr;
+ LABEL *lstart, *lend, *lcont;
+ unsigned int sp;
+
+ v = rb_convert_type(RARRAY_AREF(exception, i), T_ARRAY,
+ "Array", "to_ary");
+ if (RARRAY_LEN(v) != 6) {
+ rb_raise(rb_eSyntaxError, "wrong exception entry");
+ }
+ ptr = RARRAY_CONST_PTR(v);
+ type = get_exception_sym2type(ptr[0]);
+ if (ptr[1] == Qnil) {
+ eiseqval = 0;
+ }
+ else {
+ 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]);
+
+ (void)sp;
+
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
+
+ RB_GC_GUARD(v);
+ }
+ return COMPILE_OK;
+}
+
+static struct st_table *
+insn_make_insn_table(void)
+{
+ struct st_table *table;
+ int i;
+ table = st_init_numtable();
+
+ for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
+ st_insert(table, ID2SYM(rb_intern(insn_name(i))), i);
+ }
+
+ return table;
+}
+
+static VALUE
+iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
+{
+ VALUE iseqval;
+ if (RB_TYPE_P(op, T_ARRAY)) {
+ iseqval = rb_iseq_load(op, iseq->self, Qnil);
+ }
+ else if (CLASS_OF(op) == rb_cISeq) {
+ iseqval = op;
+ }
+ else {
+ rb_raise(rb_eSyntaxError, "ISEQ is required");
+ }
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
+}
+
+static VALUE
+iseq_build_callinfo_from_hash(rb_iseq_t *iseq, VALUE op)
+{
+ ID mid = 0;
+ int orig_argc = 0;
+ VALUE block = 0;
+ unsigned int flag = 0;
+ rb_call_info_kw_arg_t *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 vblock = rb_hash_aref(op, ID2SYM(rb_intern("blockptr")));
+ 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(vblock)) block = iseq_build_load_iseq(iseq, vblock);
+
+ if (!NIL_P(vkw_arg)) {
+ int i;
+ int len = RARRAY_LENINT(vkw_arg);
+ size_t n = sizeof(rb_call_info_kw_arg_t) + sizeof(VALUE) * (len - 1);
+
+ 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, block, flag, kw_arg);
+}
+static int
+iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
+ VALUE body, struct st_table *labels_table)
+{
+ /* TODO: body should be frozen */
+ const VALUE *ptr = RARRAY_CONST_PTR(body);
+ long i, len = RARRAY_LEN(body);
+ int j;
+ int line_no = 0;
+
+ /*
+ * index -> LABEL *label
+ */
+ static struct st_table *insn_table;
+
+ if (insn_table == 0) {
+ insn_table = insn_make_insn_table();
+ }
+
+ for (i=0; i<len; i++) {
+ VALUE obj = ptr[i];
+
+ if (SYMBOL_P(obj)) {
+ LABEL *label = register_label(iseq, labels_table, obj);
+ ADD_LABEL(anchor, label);
+ }
+ else if (FIXNUM_P(obj)) {
+ line_no = NUM2INT(obj);
+ }
+ else if (RB_TYPE_P(obj, T_ARRAY)) {
+ VALUE *argv = 0;
+ int argc = RARRAY_LENINT(obj) - 1;
+ st_data_t insn_id;
+ VALUE insn;
+
+ insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
+ if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
+ /* TODO: exception */
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "unknown instruction: %"PRIsVALUE,
+ rb_inspect(insn));
+ }
+
+ if (argc != insn_len((VALUE)insn_id)-1) {
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "operand size mismatch");
+ }
+
+ if (argc > 0) {
+ argv = compile_data_alloc(iseq, sizeof(VALUE) * argc);
+ for (j=0; j<argc; j++) {
+ VALUE op = rb_ary_entry(obj, j+1);
+ switch (insn_op_type((VALUE)insn_id, j)) {
+ case TS_OFFSET: {
+ LABEL *label = register_label(iseq, labels_table, op);
+ argv[j] = (VALUE)label;
+ break;
+ }
+ case TS_LINDEX:
+ case TS_NUM:
+ (void)NUM2INT(op);
+ argv[j] = op;
+ break;
+ case TS_VALUE:
+ argv[j] = op;
+ iseq_add_mark_object(iseq, op);
+ break;
+ case TS_ISEQ:
+ {
+ if (op != Qnil) {
+ argv[j] = iseq_build_load_iseq(iseq, op);
+ }
+ else {
+ argv[j] = 0;
+ }
+ }
+ break;
+ case TS_GENTRY:
+ op = rb_convert_type(op, T_SYMBOL, "Symbol", "to_sym");
+ argv[j] = (VALUE)rb_global_entry(SYM2ID(op));
+ break;
+ case TS_IC:
+ argv[j] = op;
+ if (NUM2INT(op) >= iseq->is_size) {
+ iseq->is_size = NUM2INT(op) + 1;
+ }
+ break;
+ case TS_CALLINFO:
+ argv[j] = iseq_build_callinfo_from_hash(iseq, op);
+ break;
+ case TS_ID:
+ argv[j] = rb_convert_type(op, T_SYMBOL,
+ "Symbol", "to_sym");
+ break;
+ 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);
+ LABEL *label =
+ register_label(iseq, labels_table, sym);
+ rb_hash_aset(map, key, (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;
+ }
+ break;
+ default:
+ rb_raise(rb_eSyntaxError, "unknown operand: %c", insn_op_type((VALUE)insn_id, j));
+ }
+ }
+ }
+ ADD_ELEM(anchor,
+ (LINK_ELEMENT*)new_insn_core(iseq, line_no,
+ (enum ruby_vminsn_type)insn_id, argc, argv));
+ }
+ else {
+ rb_raise(rb_eTypeError, "unexpected object for instruction");
+ }
+ }
+ validate_labels(iseq, labels_table);
+ 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_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
+
+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 void
+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;
+
+ iseq->param.flags.has_kw = TRUE;
+
+ iseq->param.keyword = ZALLOC(struct rb_iseq_param_keyword);
+ iseq->param.keyword->num = len;
+#define SYM(s) ID2SYM(rb_intern(#s))
+ (void)int_param(&iseq->param.keyword->bits_start, params, SYM(kwbits));
+ i = iseq->param.keyword->bits_start - iseq->param.keyword->num;
+ iseq->param.keyword->table = &iseq->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;
+ }
+ iseq->param.keyword->table[i] = SYM2ID(val);
+ iseq->param.keyword->required_num++;
+ }
+
+default_values: /* note: we intentionally preserve `i' from previous loop */
+ default_len = len - i;
+ if (default_len == 0) {
+ return;
+ }
+
+ iseq->param.keyword->default_values = 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);
+ }
+ iseq->param.keyword->table[i] = SYM2ID(sym);
+ iseq->param.keyword->default_values[j] = default_val;
+ }
+}
+
+VALUE
+rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
+ VALUE exception, VALUE body)
+{
+#define SYM(s) ID2SYM(rb_intern(#s))
+ int i, len;
+ ID *tbl;
+ struct st_table *labels_table = st_init_numtable();
+ 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->local_table_size = len;
+ 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);
+
+ if (sym_arg_rest == lv) {
+ tbl[i] = 0;
+ }
+ else {
+ tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ }
+ }
+
+ /*
+ * we currently ignore misc params,
+ * local_size, stack_size and param.size are all calculated
+ */
+
+#define INT_PARAM(F) int_param(&iseq->param.F, params, SYM(F))
+ if (INT_PARAM(lead_num)) {
+ iseq->param.flags.has_lead = TRUE;
+ }
+ if (INT_PARAM(post_num)) iseq->param.flags.has_post = TRUE;
+ if (INT_PARAM(post_start)) iseq->param.flags.has_post = TRUE;
+ if (INT_PARAM(rest_start)) iseq->param.flags.has_rest = TRUE;
+ if (INT_PARAM(block_start)) iseq->param.flags.has_block = TRUE;
+#undef INT_PARAM
+
+ switch (TYPE(arg_opt_labels)) {
+ case T_ARRAY:
+ len = RARRAY_LENINT(arg_opt_labels);
+ iseq->param.flags.has_opt = !!(len - 1 >= 0);
+
+ if (iseq->param.flags.has_opt) {
+ iseq->param.opt_num = len - 1;
+ iseq->param.opt_table = (VALUE *)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);
+
+ iseq->param.opt_table[i] = (VALUE)label;
+ }
+ }
+ 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_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->param.flags.ambiguous_param0 = TRUE;
+ }
+
+ if (int_param(&i, params, SYM(kwrest))) {
+ if (!iseq->param.keyword) {
+ iseq->param.keyword = ZALLOC(struct rb_iseq_param_keyword);
+ }
+ iseq->param.keyword->rest_start = i;
+ iseq->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_table);
+ return iseq->self;
+}
+
+/* for parser */
+
+int
+rb_dvar_defined(ID id)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *iseq;
+ if (th->base_block && (iseq = th->base_block->iseq)) {
+ 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
+ ) {
+ int i;
+
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return 1;
+ }
+ }
+ iseq = iseq->parent_iseq;
+ }
+ }
+ return 0;
+}
+
+int
+rb_local_defined(ID id)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *iseq;
+
+ if (th->base_block && th->base_block->iseq) {
+ int i;
+ iseq = th->base_block->iseq->local_iseq;
+
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+int
+rb_parse_in_eval(void)
+{
+ return GET_THREAD()->parse_in_eval > 0;
+}
+
+int
+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->location.path;
+ *absolute_path = cfp->iseq->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 VALUE
+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(NEW_IFUNC(build, (VALUE)&acc),
+ 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->param.lead_num = 0;
+ iseq->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->param.lead_num = 1;
+ iseq->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)
+ */
+VALUE
+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)
+ */
+VALUE
+rb_method_for_self_aset(VALUE name, VALUE arg, rb_insn_func_t func)
+{
+ return method_for_self(name, arg, func, for_self_aset);
+}
diff --git a/complex.c b/complex.c
new file mode 100644
index 0000000000..4548c5e2a5
--- /dev/null
+++ b/complex.c
@@ -0,0 +1,2217 @@
+/*
+ complex.c: Coded by Tadayoshi Funaba 2008-2012
+
+ This implementation is based on Keiju Ishitsuka's Complex library
+ which is written in ruby.
+*/
+
+#include "internal.h"
+#include <math.h>
+
+#define NDEBUG
+#include <assert.h>
+
+#define ZERO INT2FIX(0)
+#define ONE INT2FIX(1)
+#define TWO INT2FIX(2)
+
+VALUE rb_cComplex;
+
+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,
+ id_i_real, id_i_imag;
+
+#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
+
+#define binop(n,op) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, (op), 1, y);\
+}
+
+#define fun1(n) \
+inline static VALUE \
+f_##n(VALUE x)\
+{\
+ return rb_funcall(x, id_##n, 0);\
+}
+
+#define fun2(n) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, id_##n, 1, y);\
+}
+
+#define math1(n) \
+inline static VALUE \
+m_##n(VALUE x)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 1, x);\
+}
+
+#define math2(n) \
+inline static VALUE \
+m_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 2, x, y);\
+}
+
+#define PRESERVE_SIGNEDZERO
+
+inline static VALUE
+f_add(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
+ return x;
+ else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
+ return y;
+#endif
+ return rb_funcall(x, '+', 1, y);
+}
+
+inline static VALUE
+f_div(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(y) && FIX2LONG(y) == 1)
+ return x;
+ return rb_funcall(x, '/', 1, y);
+}
+
+inline static VALUE
+f_gt_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);
+}
+
+inline static VALUE
+f_mul(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y)) {
+ long iy = FIX2LONG(y);
+ if (iy == 0) {
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
+ return ZERO;
+ }
+ else if (iy == 1)
+ return x;
+ }
+ else if (FIXNUM_P(x)) {
+ long ix = FIX2LONG(x);
+ if (ix == 0) {
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
+ return ZERO;
+ }
+ else if (ix == 1)
+ return y;
+ }
+#endif
+ return rb_funcall(x, '*', 1, y);
+}
+
+inline static VALUE
+f_sub(VALUE x, VALUE y)
+{
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
+ return x;
+#endif
+ return rb_funcall(x, '-', 1, y);
+}
+
+fun1(abs)
+fun1(arg)
+fun1(denominator)
+fun1(negate)
+fun1(numerator)
+fun1(real_p)
+
+inline static VALUE
+f_to_i(VALUE x)
+{
+ if (RB_TYPE_P(x, T_STRING))
+ return rb_str_to_inum(x, 10, 0);
+ return rb_funcall(x, id_to_i, 0);
+}
+inline static VALUE
+f_to_f(VALUE x)
+{
+ if (RB_TYPE_P(x, T_STRING))
+ return DBL2NUM(rb_str_to_dbl(x, 0));
+ return rb_funcall(x, id_to_f, 0);
+}
+
+fun1(to_r)
+
+inline static VALUE
+f_eqeq_p(VALUE x, VALUE y)
+{
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
+ return rb_funcall(x, id_eqeq_p, 1, y);
+}
+
+fun2(expt)
+fun2(fdiv)
+fun2(quo)
+
+inline static VALUE
+f_negative_p(VALUE x)
+{
+ if (FIXNUM_P(x))
+ return f_boolcast(FIX2LONG(x) < 0);
+ return rb_funcall(x, '<', 1, ZERO);
+}
+
+#define f_positive_p(x) (!f_negative_p(x))
+
+inline static VALUE
+f_zero_p(VALUE x)
+{
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 0);
+ }
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
+ }
+ else if (RB_TYPE_P(x, T_RATIONAL)) {
+ VALUE num = RRATIONAL(x)->num;
+
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
+ }
+ return rb_funcall(x, id_eqeq_p, 1, ZERO);
+}
+
+#define f_nonzero_p(x) (!f_zero_p(x))
+
+inline static VALUE
+f_one_p(VALUE x)
+{
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 1);
+ }
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
+ }
+ else if (RB_TYPE_P(x, 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 rb_funcall(x, id_eqeq_p, 1, ONE);
+}
+
+inline static VALUE
+f_kind_of_p(VALUE x, VALUE c)
+{
+ return rb_obj_is_kind_of(x, c);
+}
+
+inline static VALUE
+k_numeric_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cNumeric);
+}
+
+inline static VALUE
+k_fixnum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFixnum);
+}
+
+inline static VALUE
+k_bignum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cBignum);
+}
+
+inline static VALUE
+k_float_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFloat);
+}
+
+inline static VALUE
+k_rational_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cRational);
+}
+
+inline static VALUE
+k_complex_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cComplex);
+}
+
+#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;\
+ dat = ((struct RComplex *)(x))
+
+#define get_dat2(x,y) \
+ struct RComplex *adat, *bdat;\
+ adat = ((struct RComplex *)(x));\
+ bdat = ((struct RComplex *)(y))
+
+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));
+
+ RCOMPLEX_SET_REAL(obj, real);
+ RCOMPLEX_SET_IMAG(obj, imag);
+
+ return (VALUE)obj;
+}
+
+static VALUE
+nucomp_s_alloc(VALUE klass)
+{
+ return nucomp_s_new_internal(klass, ZERO, ZERO);
+}
+
+#if 0
+static VALUE
+nucomp_s_new_bang(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE real, imag;
+
+ switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
+ case 1:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ imag = ZERO;
+ break;
+ default:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ if (!k_numeric_p(imag))
+ imag = f_to_i(imag);
+ break;
+ }
+
+ return nucomp_s_new_internal(klass, real, imag);
+}
+#endif
+
+inline static VALUE
+f_complex_new_bang1(VALUE klass, VALUE x)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_new_internal(klass, x, ZERO);
+}
+
+inline static VALUE
+f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
+ return nucomp_s_new_internal(klass, x, y);
+}
+
+#ifdef CANONICALIZATION_FOR_MATHN
+#define CANON
+#endif
+
+#ifdef CANON
+static int canonicalization = 0;
+
+RUBY_FUNC_EXPORTED void
+nucomp_canonicalization(int f)
+{
+ canonicalization = f;
+}
+#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)) {
+ if (!k_numeric_p(num) || !f_real_p(num))
+ rb_raise(rb_eTypeError, "not a real");
+ }
+}
+
+inline static VALUE
+nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
+{
+#ifdef CANON
+#define CL_CANON
+#ifdef CL_CANON
+ if (k_exact_zero_p(imag) && canonicalization)
+ return real;
+#else
+ if (f_zero_p(imag) && canonicalization)
+ return real;
+#endif
+#endif
+ if (f_real_p(real) && f_real_p(imag))
+ return nucomp_s_new_internal(klass, real, imag);
+ else if (f_real_p(real)) {
+ get_dat1(imag);
+
+ return nucomp_s_new_internal(klass,
+ f_sub(real, dat->imag),
+ f_add(ZERO, dat->real));
+ }
+ else if (f_real_p(imag)) {
+ get_dat1(real);
+
+ return nucomp_s_new_internal(klass,
+ dat->real,
+ f_add(dat->imag, imag));
+ }
+ else {
+ get_dat2(real, imag);
+
+ return nucomp_s_new_internal(klass,
+ f_sub(adat->real, bdat->imag),
+ f_add(adat->imag, bdat->real));
+ }
+}
+
+/*
+ * call-seq:
+ * Complex.rect(real[, imag]) -> complex
+ * Complex.rectangular(real[, imag]) -> complex
+ *
+ * Returns a complex object which denotes the given rectangular form.
+ *
+ * Complex.rectangular(1, 2) #=> (1+2i)
+ */
+static VALUE
+nucomp_s_new(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE real, imag;
+
+ switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
+ case 1:
+ nucomp_real_check(real);
+ imag = ZERO;
+ break;
+ default:
+ nucomp_real_check(real);
+ nucomp_real_check(imag);
+ break;
+ }
+
+ return nucomp_s_canonicalize_internal(klass, real, imag);
+}
+
+inline static VALUE
+f_complex_new2(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ return nucomp_s_canonicalize_internal(klass, x, y);
+}
+
+/*
+ * call-seq:
+ * Complex(x[, y]) -> numeric
+ *
+ * Returns x+i*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)
+{
+ return rb_funcall2(rb_cComplex, id_convert, argc, argv);
+}
+
+#define imp1(n) \
+inline static VALUE \
+m_##n##_bang(VALUE x)\
+{\
+ return rb_math_##n(x);\
+}
+
+#define imp2(n) \
+inline static VALUE \
+m_##n##_bang(VALUE x, VALUE y)\
+{\
+ return rb_math_##n(x, y);\
+}
+
+imp2(atan2)
+imp1(cos)
+imp1(cosh)
+imp1(exp)
+imp2(hypot)
+
+#define m_hypot(x,y) m_hypot_bang((x),(y))
+
+static VALUE
+m_log_bang(VALUE x)
+{
+ return rb_math_log(1, &x);
+}
+
+imp1(sin)
+imp1(sinh)
+
+static VALUE
+m_cos(VALUE x)
+{
+ if (f_real_p(x))
+ return m_cos_bang(x);
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_cos_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(f_negate(m_sin_bang(dat->real)),
+ m_sinh_bang(dat->imag)));
+ }
+}
+
+static VALUE
+m_sin(VALUE x)
+{
+ if (f_real_p(x))
+ return m_sin_bang(x);
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_sin_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(m_cos_bang(dat->real),
+ m_sinh_bang(dat->imag)));
+ }
+}
+
+#if 0
+imp1(sqrt)
+
+static VALUE
+m_sqrt(VALUE x)
+{
+ if (f_real_p(x)) {
+ if (f_positive_p(x))
+ return m_sqrt_bang(x);
+ return f_complex_new2(rb_cComplex, ZERO, m_sqrt_bang(f_negate(x)));
+ }
+ else {
+ get_dat1(x);
+
+ if (f_negative_p(dat->imag))
+ return f_conj(m_sqrt(f_conj(x)));
+ else {
+ VALUE a = f_abs(x);
+ return f_complex_new2(rb_cComplex,
+ m_sqrt_bang(f_div(f_add(a, dat->real), TWO)),
+ m_sqrt_bang(f_div(f_sub(a, dat->real), TWO)));
+ }
+ }
+}
+#endif
+
+inline static VALUE
+f_complex_polar(VALUE klass, VALUE x, VALUE y)
+{
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
+ return nucomp_s_canonicalize_internal(klass,
+ f_mul(x, m_cos(y)),
+ f_mul(x, m_sin(y)));
+}
+
+/*
+ * call-seq:
+ * Complex.polar(abs[, arg]) -> complex
+ *
+ * Returns a complex object which denotes the given polar form.
+ *
+ * Complex.polar(3, 0) #=> (3.0+0.0i)
+ * Complex.polar(3, Math::PI/2) #=> (1.836909530733566e-16+3.0i)
+ * Complex.polar(3, Math::PI) #=> (-3.0+3.673819061467132e-16i)
+ * Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)
+ */
+static VALUE
+nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE abs, arg;
+
+ switch (rb_scan_args(argc, argv, "11", &abs, &arg)) {
+ case 1:
+ nucomp_real_check(abs);
+ arg = ZERO;
+ break;
+ default:
+ nucomp_real_check(abs);
+ nucomp_real_check(arg);
+ break;
+ }
+ return f_complex_polar(klass, abs, arg);
+}
+
+/*
+ * call-seq:
+ * cmp.real -> real
+ *
+ * Returns the real part.
+ *
+ * Complex(7).real #=> 7
+ * Complex(9, -4).real #=> 9
+ */
+static VALUE
+nucomp_real(VALUE self)
+{
+ get_dat1(self);
+ return dat->real;
+}
+
+/*
+ * call-seq:
+ * cmp.imag -> real
+ * cmp.imaginary -> real
+ *
+ * Returns the imaginary part.
+ *
+ * Complex(7).imaginary #=> 0
+ * Complex(9, -4).imaginary #=> -4
+ */
+static VALUE
+nucomp_imag(VALUE self)
+{
+ get_dat1(self);
+ return dat->imag;
+}
+
+/*
+ * call-seq:
+ * -cmp -> complex
+ *
+ * Returns negation of the value.
+ *
+ * -Complex(1, 2) #=> (-1-2i)
+ */
+static VALUE
+nucomp_negate(VALUE self)
+{
+ get_dat1(self);
+ return f_complex_new2(CLASS_OF(self),
+ f_negate(dat->real), f_negate(dat->imag));
+}
+
+inline static VALUE
+f_addsub(VALUE self, VALUE other,
+ VALUE (*func)(VALUE, VALUE), ID id)
+{
+ if (k_complex_p(other)) {
+ VALUE real, imag;
+
+ get_dat2(self, other);
+
+ real = (*func)(adat->real, bdat->real);
+ imag = (*func)(adat->imag, bdat->imag);
+
+ return f_complex_new2(CLASS_OF(self), real, imag);
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(dat->real, other), dat->imag);
+ }
+ return rb_num_coerce_bin(self, other, id);
+}
+
+/*
+ * call-seq:
+ * cmp + numeric -> complex
+ *
+ * Performs addition.
+ *
+ * Complex(2, 3) + Complex(2, 3) #=> (4+6i)
+ * Complex(900) + Complex(1) #=> (901+0i)
+ * Complex(-2, 9) + Complex(-9, 2) #=> (-11+11i)
+ * Complex(9, 8) + 4 #=> (13+8i)
+ * Complex(20, 9) + 9.8 #=> (29.8+9i)
+ */
+static VALUE
+nucomp_add(VALUE self, VALUE other)
+{
+ return f_addsub(self, other, f_add, '+');
+}
+
+/*
+ * call-seq:
+ * cmp - numeric -> complex
+ *
+ * Performs subtraction.
+ *
+ * Complex(2, 3) - Complex(2, 3) #=> (0+0i)
+ * Complex(900) - Complex(1) #=> (899+0i)
+ * Complex(-2, 9) - Complex(-9, 2) #=> (7+7i)
+ * Complex(9, 8) - 4 #=> (5+8i)
+ * Complex(20, 9) - 9.8 #=> (10.2+9i)
+ */
+static VALUE
+nucomp_sub(VALUE self, VALUE other)
+{
+ return f_addsub(self, other, f_sub, '-');
+}
+
+/*
+ * call-seq:
+ * cmp * numeric -> complex
+ *
+ * Performs multiplication.
+ *
+ * Complex(2, 3) * Complex(2, 3) #=> (-5+12i)
+ * Complex(900) * Complex(1) #=> (900+0i)
+ * Complex(-2, 9) * Complex(-9, 2) #=> (0-85i)
+ * Complex(9, 8) * 4 #=> (36+32i)
+ * Complex(20, 9) * 9.8 #=> (196.0+88.2i)
+ */
+static VALUE
+nucomp_mul(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ VALUE real, imag;
+
+ get_dat2(self, other);
+
+ 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);
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ f_mul(dat->real, other),
+ f_mul(dat->imag, other));
+ }
+ return rb_num_coerce_bin(self, other, '*');
+}
+
+inline static VALUE
+f_divide(VALUE self, VALUE other,
+ VALUE (*func)(VALUE, VALUE), ID id)
+{
+ if (k_complex_p(other)) {
+ int flo;
+ get_dat2(self, other);
+
+ flo = (k_float_p(adat->real) || k_float_p(adat->imag) ||
+ k_float_p(bdat->real) || k_float_p(bdat->imag));
+
+ if (f_gt_p(f_abs(bdat->real), f_abs(bdat->imag))) {
+ VALUE r, n;
+
+ r = (*func)(bdat->imag, bdat->real);
+ n = f_mul(bdat->real, f_add(ONE, f_mul(r, r)));
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(self, n),
+ (*func)(f_negate(f_mul(self, r)), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(adat->real,
+ f_mul(adat->imag, r)), n),
+ (*func)(f_sub(adat->imag,
+ f_mul(adat->real, r)), n));
+ }
+ else {
+ VALUE r, n;
+
+ r = (*func)(bdat->real, bdat->imag);
+ n = f_mul(bdat->imag, f_add(ONE, f_mul(r, r)));
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_mul(self, r), n),
+ (*func)(f_negate(self), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(f_mul(adat->real, r),
+ adat->imag), n),
+ (*func)(f_sub(f_mul(adat->imag, r),
+ adat->real), n));
+ }
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(dat->real, other),
+ (*func)(dat->imag, other));
+ }
+ return rb_num_coerce_bin(self, other, id);
+}
+
+#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
+
+/*
+ * call-seq:
+ * cmp / numeric -> complex
+ * cmp.quo(numeric) -> complex
+ *
+ * Performs division.
+ *
+ * Complex(2, 3) / Complex(2, 3) #=> ((1/1)+(0/1)*i)
+ * Complex(900) / Complex(1) #=> ((900/1)+(0/1)*i)
+ * Complex(-2, 9) / Complex(-9, 2) #=> ((36/85)-(77/85)*i)
+ * Complex(9, 8) / 4 #=> ((9/4)+(2/1)*i)
+ * Complex(20, 9) / 9.8 #=> (2.0408163265306123+0.9183673469387754i)
+ */
+static VALUE
+nucomp_div(VALUE self, VALUE other)
+{
+ return f_divide(self, other, f_quo, id_quo);
+}
+
+#define nucomp_quo nucomp_div
+
+/*
+ * call-seq:
+ * cmp.fdiv(numeric) -> complex
+ *
+ * Performs division as each part is a float, never returns a float.
+ *
+ * Complex(11, 22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
+ */
+static VALUE
+nucomp_fdiv(VALUE self, VALUE other)
+{
+ return f_divide(self, other, f_fdiv, id_fdiv);
+}
+
+inline static VALUE
+f_reciprocal(VALUE x)
+{
+ return f_quo(ONE, x);
+}
+
+/*
+ * call-seq:
+ * cmp ** numeric -> complex
+ *
+ * Performs exponentiation.
+ *
+ * Complex('i') ** 2 #=> (-1+0i)
+ * Complex(-8) ** Rational(1, 3) #=> (1.0000000000000002+1.7320508075688772i)
+ */
+static VALUE
+nucomp_expt(VALUE self, VALUE other)
+{
+ if (k_numeric_p(other) && k_exact_zero_p(other))
+ return f_complex_new_bang1(CLASS_OF(self), ONE);
+
+ if (k_rational_p(other) && f_one_p(f_denominator(other)))
+ other = f_numerator(other); /* c14n */
+
+ if (k_complex_p(other)) {
+ get_dat1(other);
+
+ if (k_exact_zero_p(dat->imag))
+ other = dat->real; /* c14n */
+ }
+
+ if (k_complex_p(other)) {
+ VALUE r, theta, nr, ntheta;
+
+ get_dat1(other);
+
+ r = f_abs(self);
+ theta = f_arg(self);
+
+ nr = m_exp_bang(f_sub(f_mul(dat->real, m_log_bang(r)),
+ f_mul(dat->imag, theta)));
+ ntheta = f_add(f_mul(theta, dat->real),
+ f_mul(dat->imag, m_log_bang(r)));
+ return f_complex_polar(CLASS_OF(self), nr, ntheta);
+ }
+ if (k_fixnum_p(other)) {
+ if (f_gt_p(other, ZERO)) {
+ VALUE x, z;
+ long n;
+
+ x = self;
+ z = x;
+ n = FIX2LONG(other) - 1;
+
+ while (n) {
+ long q, r;
+
+ while (1) {
+ get_dat1(x);
+
+ q = n / 2;
+ r = n % 2;
+
+ if (r)
+ break;
+
+ x = nucomp_s_new_internal(CLASS_OF(self),
+ f_sub(f_mul(dat->real, dat->real),
+ f_mul(dat->imag, dat->imag)),
+ f_mul(f_mul(TWO, dat->real), dat->imag));
+ n = q;
+ }
+ z = f_mul(z, x);
+ n--;
+ }
+ return z;
+ }
+ return f_expt(f_reciprocal(self), f_negate(other));
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ VALUE r, theta;
+
+ if (k_bignum_p(other))
+ rb_warn("in a**b, b may be too big");
+
+ r = f_abs(self);
+ theta = f_arg(self);
+
+ return f_complex_polar(CLASS_OF(self), f_expt(r, other),
+ f_mul(theta, other));
+ }
+ return rb_num_coerce_bin(self, other, id_expt);
+}
+
+/*
+ * call-seq:
+ * cmp == object -> true or false
+ *
+ * Returns true if cmp equals object numerically.
+ *
+ * Complex(2, 3) == Complex(2, 3) #=> true
+ * Complex(5) == 5 #=> true
+ * Complex(0) == 0.0 #=> true
+ * Complex('1/3') == 0.33 #=> false
+ * Complex('1/2') == '1/2' #=> false
+ */
+static VALUE
+nucomp_eqeq_p(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ get_dat2(self, other);
+
+ return f_boolcast(f_eqeq_p(adat->real, bdat->real) &&
+ f_eqeq_p(adat->imag, bdat->imag));
+ }
+ if (k_numeric_p(other) && f_real_p(other)) {
+ get_dat1(self);
+
+ return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
+ }
+ return f_eqeq_p(other, self);
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_coerce(VALUE self, VALUE other)
+{
+ if (k_numeric_p(other) && f_real_p(other))
+ return rb_assoc_new(f_complex_new_bang1(CLASS_OF(self), other), self);
+ if (RB_TYPE_P(other, T_COMPLEX))
+ return rb_assoc_new(other, self);
+
+ rb_raise(rb_eTypeError, "%s can't be coerced into %s",
+ rb_obj_classname(other), rb_obj_classname(self));
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * cmp.abs -> real
+ * cmp.magnitude -> real
+ *
+ * Returns the absolute part of its polar form.
+ *
+ * Complex(-1).abs #=> 1
+ * Complex(3.0, -4.0).abs #=> 5.0
+ */
+static VALUE
+nucomp_abs(VALUE self)
+{
+ get_dat1(self);
+
+ if (f_zero_p(dat->real)) {
+ VALUE a = f_abs(dat->imag);
+ if (k_float_p(dat->real) && !k_float_p(dat->imag))
+ a = f_to_f(a);
+ return a;
+ }
+ if (f_zero_p(dat->imag)) {
+ VALUE a = f_abs(dat->real);
+ if (!k_float_p(dat->real) && k_float_p(dat->imag))
+ a = f_to_f(a);
+ return a;
+ }
+ return m_hypot(dat->real, dat->imag);
+}
+
+/*
+ * call-seq:
+ * cmp.abs2 -> real
+ *
+ * Returns square of the absolute value.
+ *
+ * Complex(-1).abs2 #=> 1
+ * Complex(3.0, -4.0).abs2 #=> 25.0
+ */
+static VALUE
+nucomp_abs2(VALUE self)
+{
+ get_dat1(self);
+ return f_add(f_mul(dat->real, dat->real),
+ f_mul(dat->imag, dat->imag));
+}
+
+/*
+ * call-seq:
+ * cmp.arg -> float
+ * cmp.angle -> float
+ * cmp.phase -> float
+ *
+ * Returns the angle part of its polar form.
+ *
+ * Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
+ */
+static VALUE
+nucomp_arg(VALUE self)
+{
+ get_dat1(self);
+ return m_atan2_bang(dat->imag, dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.rect -> array
+ * cmp.rectangular -> array
+ *
+ * Returns an array; [cmp.real, cmp.imag].
+ *
+ * Complex(1, 2).rectangular #=> [1, 2]
+ */
+static VALUE
+nucomp_rect(VALUE self)
+{
+ get_dat1(self);
+ return rb_assoc_new(dat->real, dat->imag);
+}
+
+/*
+ * call-seq:
+ * cmp.polar -> array
+ *
+ * Returns an array; [cmp.abs, cmp.arg].
+ *
+ * Complex(1, 2).polar #=> [2.23606797749979, 1.1071487177940904]
+ */
+static VALUE
+nucomp_polar(VALUE self)
+{
+ return rb_assoc_new(f_abs(self), f_arg(self));
+}
+
+/*
+ * call-seq:
+ * cmp.conj -> complex
+ * cmp.conjugate -> complex
+ *
+ * Returns the complex conjugate.
+ *
+ * Complex(1, 2).conjugate #=> (1-2i)
+ */
+static VALUE
+nucomp_conj(VALUE self)
+{
+ get_dat1(self);
+ return f_complex_new2(CLASS_OF(self), dat->real, f_negate(dat->imag));
+}
+
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_true(VALUE self)
+{
+ return Qtrue;
+}
+#endif
+
+/*
+ * call-seq:
+ * cmp.real? -> false
+ *
+ * Returns false.
+ */
+static VALUE
+nucomp_false(VALUE self)
+{
+ return Qfalse;
+}
+
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_exact_p(VALUE self)
+{
+ get_dat1(self);
+ return f_boolcast(k_exact_p(dat->real) && k_exact_p(dat->imag));
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_inexact_p(VALUE self)
+{
+ return f_boolcast(!nucomp_exact_p(self));
+}
+#endif
+
+/*
+ * call-seq:
+ * cmp.denominator -> integer
+ *
+ * Returns the denominator (lcm of both denominator - real and imag).
+ *
+ * See numerator.
+ */
+static VALUE
+nucomp_denominator(VALUE self)
+{
+ get_dat1(self);
+ return rb_lcm(f_denominator(dat->real), f_denominator(dat->imag));
+}
+
+/*
+ * call-seq:
+ * cmp.numerator -> numeric
+ *
+ * Returns the numerator.
+ *
+ * 1 2 3+4i <- numerator
+ * - + -i -> ----
+ * 2 3 6 <- denominator
+ *
+ * c = Complex('1/2+2/3i') #=> ((1/2)+(2/3)*i)
+ * n = c.numerator #=> (3+4i)
+ * d = c.denominator #=> 6
+ * n / d #=> ((1/2)+(2/3)*i)
+ * Complex(Rational(n.real, d), Rational(n.imag, d))
+ * #=> ((1/2)+(2/3)*i)
+ * See denominator.
+ */
+static VALUE
+nucomp_numerator(VALUE self)
+{
+ VALUE cd;
+
+ get_dat1(self);
+
+ cd = f_denominator(self);
+ return f_complex_new2(CLASS_OF(self),
+ f_mul(f_numerator(dat->real),
+ f_div(cd, f_denominator(dat->real))),
+ f_mul(f_numerator(dat->imag),
+ f_div(cd, f_denominator(dat->imag))));
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_hash(VALUE self)
+{
+ st_index_t v, h[2];
+ VALUE n;
+
+ get_dat1(self);
+ n = rb_hash(dat->real);
+ h[0] = NUM2LONG(n);
+ n = rb_hash(dat->imag);
+ h[1] = NUM2LONG(n);
+ v = rb_memhash(h, sizeof(h));
+ return LONG2FIX(v);
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_eql_p(VALUE self, VALUE other)
+{
+ if (k_complex_p(other)) {
+ get_dat2(self, other);
+
+ return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
+ (CLASS_OF(adat->imag) == CLASS_OF(bdat->imag)) &&
+ f_eqeq_p(self, other));
+
+ }
+ return Qfalse;
+}
+
+inline static VALUE
+f_signbit(VALUE x)
+{
+#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
+ !defined(signbit)
+ extern int signbit(double);
+#endif
+ if (RB_TYPE_P(x, T_FLOAT)) {
+ double f = RFLOAT_VALUE(x);
+ return f_boolcast(!isnan(f) && signbit(f));
+ }
+ return f_negative_p(x);
+}
+
+inline static VALUE
+f_tpositive_p(VALUE x)
+{
+ return f_boolcast(!f_signbit(x));
+}
+
+static VALUE
+f_format(VALUE self, VALUE (*func)(VALUE))
+{
+ VALUE s, impos;
+
+ get_dat1(self);
+
+ impos = f_tpositive_p(dat->imag);
+
+ s = (*func)(dat->real);
+ rb_str_cat2(s, !impos ? "-" : "+");
+
+ rb_str_concat(s, (*func)(f_abs(dat->imag)));
+ if (!rb_isdigit(RSTRING_PTR(s)[RSTRING_LEN(s) - 1]))
+ rb_str_cat2(s, "*");
+ rb_str_cat2(s, "i");
+
+ return s;
+}
+
+/*
+ * call-seq:
+ * cmp.to_s -> string
+ *
+ * Returns the value as a string.
+ *
+ * Complex(2).to_s #=> "2+0i"
+ * Complex('-8/6').to_s #=> "-4/3+0i"
+ * Complex('1/2i').to_s #=> "0+1/2i"
+ * Complex(0, Float::INFINITY).to_s #=> "0+Infinity*i"
+ * Complex(Float::NAN, Float::NAN).to_s #=> "NaN+NaN*i"
+ */
+static VALUE
+nucomp_to_s(VALUE self)
+{
+ return f_format(self, rb_String);
+}
+
+/*
+ * call-seq:
+ * cmp.inspect -> string
+ *
+ * Returns the value as a string for inspection.
+ *
+ * Complex(2).inspect #=> "(2+0i)"
+ * Complex('-8/6').inspect #=> "((-4/3)+0i)"
+ * Complex('1/2i').inspect #=> "(0+(1/2)*i)"
+ * Complex(0, Float::INFINITY).inspect #=> "(0+Infinity*i)"
+ * Complex(Float::NAN, Float::NAN).inspect #=> "(NaN+NaN*i)"
+ */
+static VALUE
+nucomp_inspect(VALUE self)
+{
+ VALUE s;
+
+ s = rb_usascii_str_new2("(");
+ rb_str_concat(s, f_format(self, rb_inspect));
+ rb_str_cat2(s, ")");
+
+ return s;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_dumper(VALUE self)
+{
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
+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));
+
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_marshal_dump(VALUE self)
+{
+ VALUE a;
+ get_dat1(self);
+
+ a = rb_assoc_new(dat->real, dat->imag);
+ rb_copy_generic_ivar(a, self);
+ return a;
+}
+
+/* :nodoc: */
+static VALUE
+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));
+ return self;
+}
+
+/* --- */
+
+VALUE
+rb_complex_raw(VALUE x, VALUE y)
+{
+ return nucomp_s_new_internal(rb_cComplex, x, y);
+}
+
+VALUE
+rb_complex_new(VALUE x, VALUE y)
+{
+ return nucomp_s_canonicalize_internal(rb_cComplex, x, y);
+}
+
+VALUE
+rb_complex_polar(VALUE x, VALUE y)
+{
+ return f_complex_polar(rb_cComplex, x, y);
+}
+
+static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
+
+VALUE
+rb_Complex(VALUE x, VALUE y)
+{
+ VALUE a[2];
+ a[0] = x;
+ a[1] = 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
+ *
+ * Returns the value as an integer if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_i #=> 1
+ * Complex(1, 0.0).to_i # RangeError
+ * Complex(1, 2).to_i # RangeError
+ */
+static VALUE
+nucomp_to_i(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Integer",
+ self);
+ }
+ return f_to_i(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.to_f -> float
+ *
+ * Returns the value as a float if possible (the imaginary part should
+ * be exactly zero).
+ *
+ * Complex(1, 0).to_f #=> 1.0
+ * Complex(1, 0.0).to_f # RangeError
+ * Complex(1, 2).to_f # RangeError
+ */
+static VALUE
+nucomp_to_f(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
+ self);
+ }
+ return f_to_f(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.to_r -> rational
+ *
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_r #=> (1/1)
+ * Complex(1, 0.0).to_r # RangeError
+ * Complex(1, 2).to_r # RangeError
+ *
+ * See rationalize.
+ */
+static VALUE
+nucomp_to_r(VALUE self)
+{
+ get_dat1(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
+ self);
+ }
+ return f_to_r(dat->real);
+}
+
+/*
+ * call-seq:
+ * cmp.rationalize([eps]) -> rational
+ *
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1.0/3, 0).rationalize #=> (1/3)
+ * Complex(1, 0.0).rationalize # RangeError
+ * Complex(1, 2).rationalize # RangeError
+ *
+ * See to_r.
+ */
+static VALUE
+nucomp_rationalize(int argc, VALUE *argv, VALUE self)
+{
+ get_dat1(self);
+
+ rb_scan_args(argc, argv, "01", NULL);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
+ self);
+ }
+ return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
+}
+
+/*
+ * call-seq:
+ * complex.to_c -> self
+ *
+ * Returns self.
+ *
+ * Complex(2).to_c #=> (2+0i)
+ * Complex(-8, 6).to_c #=> (-8+6i)
+ */
+static VALUE
+nucomp_to_c(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * nil.to_c -> (0+0i)
+ *
+ * Returns zero as a complex.
+ */
+static VALUE
+nilclass_to_c(VALUE self)
+{
+ return rb_complex_new1(INT2FIX(0));
+}
+
+/*
+ * call-seq:
+ * num.to_c -> complex
+ *
+ * Returns the value as a complex.
+ */
+static VALUE
+numeric_to_c(VALUE self)
+{
+ return rb_complex_new1(self);
+}
+
+#include <ctype.h>
+
+inline static int
+issign(int c)
+{
+ return (c == '-' || c == '+');
+}
+
+static int
+read_sign(const char **s,
+ char **b)
+{
+ int sign = '?';
+
+ if (issign(**s)) {
+ sign = **b = **s;
+ (*s)++;
+ (*b)++;
+ }
+ return sign;
+}
+
+inline static int
+isdecimal(int c)
+{
+ return isdigit((unsigned char)c);
+}
+
+static int
+read_digits(const char **s, int strict,
+ char **b)
+{
+ int us = 1;
+
+ if (!isdecimal(**s))
+ return 0;
+
+ while (isdecimal(**s) || **s == '_') {
+ if (**s == '_') {
+ if (strict) {
+ if (us)
+ return 0;
+ }
+ us = 1;
+ }
+ else {
+ **b = **s;
+ (*b)++;
+ us = 0;
+ }
+ (*s)++;
+ }
+ if (us)
+ do {
+ (*s)--;
+ } while (**s == '_');
+ return 1;
+}
+
+inline static int
+islettere(int c)
+{
+ return (c == 'e' || c == 'E');
+}
+
+static int
+read_num(const char **s, int strict,
+ char **b)
+{
+ if (**s != '.') {
+ if (!read_digits(s, strict, b))
+ return 0;
+ }
+
+ if (**s == '.') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+
+ if (islettere(**s)) {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ read_sign(s, b);
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+inline static int
+read_den(const char **s, int strict,
+ char **b)
+{
+ if (!read_digits(s, strict, b))
+ return 0;
+ return 1;
+}
+
+static int
+read_rat_nos(const char **s, int strict,
+ char **b)
+{
+ if (!read_num(s, strict, b))
+ return 0;
+ if (**s == '/') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_den(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+read_rat(const char **s, int strict,
+ char **b)
+{
+ read_sign(s, b);
+ if (!read_rat_nos(s, strict, b))
+ return 0;
+ return 1;
+}
+
+inline static int
+isimagunit(int c)
+{
+ return (c == 'i' || c == 'I' ||
+ c == 'j' || c == 'J');
+}
+
+static VALUE
+str2num(char *s)
+{
+ if (strchr(s, '/'))
+ return rb_cstr_to_rat(s, 0);
+ if (strpbrk(s, ".eE"))
+ return DBL2NUM(rb_cstr_to_dbl(s, 0));
+ return rb_cstr_to_inum(s, 10, 0);
+}
+
+static int
+read_comp(const char **s, int strict,
+ VALUE *ret, char **b)
+{
+ char *bb;
+ int sign;
+ VALUE num, num2;
+
+ bb = *b;
+
+ sign = read_sign(s, b);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ num = INT2FIX((sign == '-') ? -1 : + 1);
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "i" */
+ }
+
+ if (!read_rat_nos(s, strict, b)) {
+ **b = '\0';
+ num = str2num(bb);
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "-" */
+ }
+ **b = '\0';
+ num = str2num(bb);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "3i" */
+ }
+
+ if (**s == '@') {
+ int st;
+
+ (*s)++;
+ bb = *b;
+ st = read_rat(s, strict, b);
+ **b = '\0';
+ if (strlen(bb) < 1 ||
+ !isdecimal(*(bb + strlen(bb) - 1))) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1@-" */
+ }
+ num2 = str2num(bb);
+ *ret = rb_complex_polar(num, num2);
+ if (!st)
+ return 0; /* e.g. "1@2." */
+ else
+ return 1; /* e.g. "1@2" */
+ }
+
+ if (issign(**s)) {
+ bb = *b;
+ sign = read_sign(s, b);
+ if (isimagunit(**s))
+ num2 = INT2FIX((sign == '-') ? -1 : + 1);
+ else {
+ if (!read_rat_nos(s, strict, b)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+xi" */
+ }
+ **b = '\0';
+ num2 = str2num(bb);
+ }
+ if (!isimagunit(**s)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+3x" */
+ }
+ (*s)++;
+ *ret = rb_complex_new2(num, num2);
+ return 1; /* e.g. "1+2i" */
+ }
+ /* !(@, - or +) */
+ {
+ *ret = rb_complex_new2(num, ZERO);
+ return 1; /* e.g. "3" */
+ }
+}
+
+inline static void
+skip_ws(const char **s)
+{
+ while (isspace((unsigned char)**s))
+ (*s)++;
+}
+
+static int
+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);
+ 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);
+
+ return ret;
+}
+
+static VALUE
+string_to_c_strict(VALUE self)
+{
+ char *s;
+ VALUE num;
+
+ rb_must_asciicompat(self);
+
+ s = RSTRING_PTR(self);
+
+ if (!s || memchr(s, '\0', RSTRING_LEN(self)))
+ rb_raise(rb_eArgError, "string contains null byte");
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ if (!parse_comp(s, 1, &num)) {
+ rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
+ self);
+ }
+
+ return num;
+}
+
+/*
+ * call-seq:
+ * str.to_c -> complex
+ *
+ * Returns a complex which denotes the string form. The parser
+ * ignores leading whitespaces and trailing garbage. Any digit
+ * sequences can be separated by an underscore. Returns zero for null
+ * or garbage string.
+ *
+ * '9'.to_c #=> (9+0i)
+ * '2.5'.to_c #=> (2.5+0i)
+ * '2.5/1'.to_c #=> ((5/2)+0i)
+ * '-3/2'.to_c #=> ((-3/2)+0i)
+ * '-i'.to_c #=> (0-1i)
+ * '45i'.to_c #=> (0+45i)
+ * '3-4i'.to_c #=> (3-4i)
+ * '-4e2-4e-2i'.to_c #=> (-400.0-0.04i)
+ * '-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)
+{
+ char *s;
+ VALUE num;
+
+ rb_must_asciicompat(self);
+
+ s = RSTRING_PTR(self);
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ (void)parse_comp(s, 0, &num);
+
+ return num;
+}
+
+static VALUE
+nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE a1, a2, backref;
+
+ rb_scan_args(argc, argv, "11", &a1, &a2);
+
+ if (NIL_P(a1) || (argc == 2 && NIL_P(a2)))
+ rb_raise(rb_eTypeError, "can't convert nil into Complex");
+
+ backref = rb_backref_get();
+ rb_match_busy(backref);
+
+ if (RB_TYPE_P(a1, T_STRING)) {
+ a1 = string_to_c_strict(a1);
+ }
+
+ if (RB_TYPE_P(a2, T_STRING)) {
+ a2 = string_to_c_strict(a2);
+ }
+
+ rb_backref_set(backref);
+
+ if (RB_TYPE_P(a1, T_COMPLEX)) {
+ {
+ get_dat1(a1);
+
+ if (k_exact_zero_p(dat->imag))
+ a1 = dat->real;
+ }
+ }
+
+ if (RB_TYPE_P(a2, T_COMPLEX)) {
+ {
+ get_dat1(a2);
+
+ if (k_exact_zero_p(dat->imag))
+ a2 = dat->real;
+ }
+ }
+
+ if (RB_TYPE_P(a1, T_COMPLEX)) {
+ if (argc == 1 || (k_exact_zero_p(a2)))
+ return a1;
+ }
+
+ if (argc == 1) {
+ if (k_numeric_p(a1) && !f_real_p(a1))
+ return a1;
+ /* should raise exception for consistency */
+ if (!k_numeric_p(a1))
+ return rb_convert_type(a1, T_COMPLEX, "Complex", "to_c");
+ }
+ else {
+ if ((k_numeric_p(a1) && k_numeric_p(a2)) &&
+ (!f_real_p(a1) || !f_real_p(a2)))
+ return f_add(a1,
+ f_mul(a2,
+ f_complex_new_bang2(rb_cComplex, ZERO, ONE)));
+ }
+
+ {
+ VALUE argv2[2];
+ argv2[0] = a1;
+ argv2[1] = a2;
+ return nucomp_s_new(argc, argv2, klass);
+ }
+}
+
+/* --- */
+
+/*
+ * call-seq:
+ * num.real -> self
+ *
+ * Returns self.
+ */
+static VALUE
+numeric_real(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * num.imag -> 0
+ * num.imaginary -> 0
+ *
+ * Returns zero.
+ */
+static VALUE
+numeric_imag(VALUE self)
+{
+ return INT2FIX(0);
+}
+
+/*
+ * call-seq:
+ * num.abs2 -> real
+ *
+ * Returns square of self.
+ */
+static VALUE
+numeric_abs2(VALUE self)
+{
+ return f_mul(self, self);
+}
+
+#define id_PI rb_intern("PI")
+
+/*
+ * call-seq:
+ * num.arg -> 0 or float
+ * num.angle -> 0 or float
+ * num.phase -> 0 or float
+ *
+ * Returns 0 if the value is positive, pi otherwise.
+ */
+static VALUE
+numeric_arg(VALUE self)
+{
+ if (f_positive_p(self))
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
+}
+
+/*
+ * call-seq:
+ * num.rect -> array
+ * num.rectangular -> array
+ *
+ * Returns an array; [num, 0].
+ */
+static VALUE
+numeric_rect(VALUE self)
+{
+ return rb_assoc_new(self, INT2FIX(0));
+}
+
+/*
+ * call-seq:
+ * num.polar -> array
+ *
+ * Returns an array; [num.abs, num.arg].
+ */
+static VALUE
+numeric_polar(VALUE self)
+{
+ return rb_assoc_new(f_abs(self), f_arg(self));
+}
+
+/*
+ * call-seq:
+ * num.conj -> self
+ * num.conjugate -> self
+ *
+ * Returns self.
+ */
+static VALUE
+numeric_conj(VALUE self)
+{
+ return self;
+}
+
+/*
+ * call-seq:
+ * flo.arg -> 0 or float
+ * flo.angle -> 0 or float
+ * flo.phase -> 0 or float
+ *
+ * Returns 0 if the value is positive, pi otherwise.
+ */
+static VALUE
+float_arg(VALUE self)
+{
+ if (isnan(RFLOAT_VALUE(self)))
+ return self;
+ if (f_tpositive_p(self))
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
+}
+
+/*
+ * A complex number can be represented as a paired real number with
+ * imaginary unit; a+bi. Where a is real part, b is imaginary part
+ * and i is imaginary unit. Real a equals complex a+0i
+ * mathematically.
+ *
+ * In ruby, you can create complex object with Complex, Complex::rect,
+ * Complex::polar or to_c method.
+ *
+ * Complex(1) #=> (1+0i)
+ * Complex(2, 3) #=> (2+3i)
+ * Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
+ * 3.to_c #=> (3+0i)
+ *
+ * You can also create complex object from floating-point numbers or
+ * strings.
+ *
+ * Complex(0.3) #=> (0.3+0i)
+ * Complex('0.3-0.5i') #=> (0.3-0.5i)
+ * Complex('2/3+3/4i') #=> ((2/3)+(3/4)*i)
+ * Complex('1@2') #=> (-0.4161468365471424+0.9092974268256817i)
+ *
+ * 0.3.to_c #=> (0.3+0i)
+ * '0.3-0.5i'.to_c #=> (0.3-0.5i)
+ * '2/3+3/4i'.to_c #=> ((2/3)+(3/4)*i)
+ * '1@2'.to_c #=> (-0.4161468365471424+0.9092974268256817i)
+ *
+ * A complex object is either an exact or an inexact number.
+ *
+ * Complex(1, 1) / 2 #=> ((1/2)+(1/2)*i)
+ * Complex(1, 1) / 2.0 #=> (0.5+0.5i)
+ */
+void
+Init_Complex(void)
+{
+ VALUE compat;
+#undef rb_intern
+#define rb_intern(str) rb_intern_const(str)
+
+ assert(fprintf(stderr, "assert() is now active\n"));
+
+ id_abs = rb_intern("abs");
+ id_arg = rb_intern("arg");
+ id_convert = rb_intern("convert");
+ id_denominator = rb_intern("denominator");
+ id_eqeq_p = rb_intern("==");
+ id_expt = rb_intern("**");
+ id_fdiv = rb_intern("fdiv");
+ id_negate = rb_intern("-@");
+ id_numerator = rb_intern("numerator");
+ id_quo = rb_intern("quo");
+ 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_i_real = rb_intern("@real");
+ id_i_imag = rb_intern("@image"); /* @image, not @imag */
+
+ rb_cComplex = rb_define_class("Complex", rb_cNumeric);
+
+ rb_define_alloc_func(rb_cComplex, nucomp_s_alloc);
+ rb_undef_method(CLASS_OF(rb_cComplex), "allocate");
+
+#if 0
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new!", nucomp_s_new_bang, -1);
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new", nucomp_s_new, -1);
+#else
+ rb_undef_method(CLASS_OF(rb_cComplex), "new");
+#endif
+
+ rb_define_singleton_method(rb_cComplex, "rectangular", nucomp_s_new, -1);
+ rb_define_singleton_method(rb_cComplex, "rect", nucomp_s_new, -1);
+ rb_define_singleton_method(rb_cComplex, "polar", nucomp_s_polar, -1);
+
+ rb_define_global_function("Complex", nucomp_f_complex, -1);
+
+ rb_undef_method(rb_cComplex, "%");
+ rb_undef_method(rb_cComplex, "<");
+ rb_undef_method(rb_cComplex, "<=");
+ rb_undef_method(rb_cComplex, "<=>");
+ rb_undef_method(rb_cComplex, ">");
+ rb_undef_method(rb_cComplex, ">=");
+ rb_undef_method(rb_cComplex, "between?");
+ rb_undef_method(rb_cComplex, "div");
+ rb_undef_method(rb_cComplex, "divmod");
+ rb_undef_method(rb_cComplex, "floor");
+ rb_undef_method(rb_cComplex, "ceil");
+ rb_undef_method(rb_cComplex, "modulo");
+ rb_undef_method(rb_cComplex, "remainder");
+ rb_undef_method(rb_cComplex, "round");
+ rb_undef_method(rb_cComplex, "step");
+ 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);
+
+ rb_define_method(rb_cComplex, "-@", nucomp_negate, 0);
+ rb_define_method(rb_cComplex, "+", nucomp_add, 1);
+ rb_define_method(rb_cComplex, "-", nucomp_sub, 1);
+ rb_define_method(rb_cComplex, "*", nucomp_mul, 1);
+ rb_define_method(rb_cComplex, "/", nucomp_div, 1);
+ rb_define_method(rb_cComplex, "quo", nucomp_quo, 1);
+ rb_define_method(rb_cComplex, "fdiv", nucomp_fdiv, 1);
+ rb_define_method(rb_cComplex, "**", nucomp_expt, 1);
+
+ rb_define_method(rb_cComplex, "==", nucomp_eqeq_p, 1);
+ rb_define_method(rb_cComplex, "coerce", nucomp_coerce, 1);
+
+ rb_define_method(rb_cComplex, "abs", nucomp_abs, 0);
+ rb_define_method(rb_cComplex, "magnitude", nucomp_abs, 0);
+ rb_define_method(rb_cComplex, "abs2", nucomp_abs2, 0);
+ rb_define_method(rb_cComplex, "arg", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "angle", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "phase", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "rectangular", nucomp_rect, 0);
+ rb_define_method(rb_cComplex, "rect", nucomp_rect, 0);
+ rb_define_method(rb_cComplex, "polar", nucomp_polar, 0);
+ rb_define_method(rb_cComplex, "conjugate", nucomp_conj, 0);
+ rb_define_method(rb_cComplex, "conj", nucomp_conj, 0);
+#if 0
+ rb_define_method(rb_cComplex, "~", nucomp_conj, 0); /* gcc */
+#endif
+
+ rb_define_method(rb_cComplex, "real?", nucomp_false, 0);
+#if 0
+ rb_define_method(rb_cComplex, "complex?", nucomp_true, 0);
+ rb_define_method(rb_cComplex, "exact?", nucomp_exact_p, 0);
+ rb_define_method(rb_cComplex, "inexact?", nucomp_inexact_p, 0);
+#endif
+
+ rb_define_method(rb_cComplex, "numerator", nucomp_numerator, 0);
+ rb_define_method(rb_cComplex, "denominator", nucomp_denominator, 0);
+
+ rb_define_method(rb_cComplex, "hash", nucomp_hash, 0);
+ rb_define_method(rb_cComplex, "eql?", nucomp_eql_p, 1);
+
+ rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
+ rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
+
+ rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject); /* :nodoc: */
+ rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
+ rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
+
+ /* --- */
+
+ rb_define_method(rb_cComplex, "to_i", nucomp_to_i, 0);
+ rb_define_method(rb_cComplex, "to_f", nucomp_to_f, 0);
+ rb_define_method(rb_cComplex, "to_r", nucomp_to_r, 0);
+ rb_define_method(rb_cComplex, "rationalize", nucomp_rationalize, -1);
+ rb_define_method(rb_cComplex, "to_c", nucomp_to_c, 0);
+ rb_define_method(rb_cNilClass, "to_c", nilclass_to_c, 0);
+ rb_define_method(rb_cNumeric, "to_c", numeric_to_c, 0);
+
+ rb_define_method(rb_cString, "to_c", string_to_c, 0);
+
+ rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
+
+ /* --- */
+
+ rb_define_method(rb_cNumeric, "real", numeric_real, 0);
+ rb_define_method(rb_cNumeric, "imaginary", numeric_imag, 0);
+ rb_define_method(rb_cNumeric, "imag", numeric_imag, 0);
+ rb_define_method(rb_cNumeric, "abs2", numeric_abs2, 0);
+ rb_define_method(rb_cNumeric, "arg", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "angle", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "phase", numeric_arg, 0);
+ rb_define_method(rb_cNumeric, "rectangular", numeric_rect, 0);
+ rb_define_method(rb_cNumeric, "rect", numeric_rect, 0);
+ rb_define_method(rb_cNumeric, "polar", numeric_polar, 0);
+ rb_define_method(rb_cNumeric, "conjugate", numeric_conj, 0);
+ rb_define_method(rb_cNumeric, "conj", numeric_conj, 0);
+
+ rb_define_method(rb_cFloat, "arg", float_arg, 0);
+ rb_define_method(rb_cFloat, "angle", float_arg, 0);
+ rb_define_method(rb_cFloat, "phase", float_arg, 0);
+
+ /*
+ * The imaginary unit.
+ */
+ rb_define_const(rb_cComplex, "I",
+ f_complex_new_bang2(rb_cComplex, ZERO, ONE));
+
+ rb_provide("complex.so"); /* for backward compatibility */
+}
+
+/*
+Local variables:
+c-file-style: "ruby"
+End:
+*/
diff --git a/config.guess b/config.guess
deleted file mode 100644
index dd1688b7b5..0000000000
--- a/config.guess
+++ /dev/null
@@ -1,1459 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-06-11'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amd64:OpenBSD:*:*)
- echo x86_64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- cats:OpenBSD:*:*)
- echo arm-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- luna88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/config.sub b/config.sub
deleted file mode 100644
index 506d3ab77f..0000000000
--- a/config.sub
+++ /dev/null
@@ -1,1537 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2004-06-11'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=-linux
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/configure.in b/configure.in
index d922bd20da..0470d5cc0a 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,62 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
+{
+AC_CONFIG_AUX_DIR(tool)
+
+AC_PREREQ(2.67)
+
+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_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 "[$]@"
+}
+])])])
-AC_PREREQ(2.58)
+{ # environment section
+
+AC_ARG_WITH(baseruby,
+ AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
+ [
+ AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
+ ],
+ [
+ BASERUBY="ruby"
+ ])
+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],
-[case "$host_os" in
-cygwin*)
+[AS_CASE(["$host_os"],
+[cygwin*], [
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
[AC_TRY_CPP([
#ifndef __MINGW32__
@@ -13,16 +64,141 @@ AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
#endif
], rb_cv_mingw32=yes,rb_cv_mingw32=no)
rm -f conftest*])
-test "$rb_cv_mingw32" = yes && target_os="mingw32"
- ;;
-esac])
+if test "$rb_cv_mingw32" = yes; then
+ target_os="mingw32"
+ : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
+fi
+])
+AS_CASE(["$target_os"], [mingw*msvc], [
+target_os="`echo ${target_os} | sed 's/msvc$//'`"
+])
+AS_CASE(["$target_cpu-$target_os"], [x86_64-mingw*], [
+target_cpu=x64
+])
+])
+
+AC_DEFUN([RUBY_NACL],
+[
+ AS_CASE(["${host_os}"],
+[nacl], [
+ ac_cv_exeext=.nexe
+ host_vendor=chromium
+ ac_cv_host=chromium
+ AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set])
+ if test x"${NACL_SDK_ROOT}" = x; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient])
+ fi
+ AC_MSG_RESULT([yes])
+
+ nacl_cv_build_variant=glibc
+ AC_ARG_WITH(newlib,
+ AS_HELP_STRING([--with-newlib], [uses newlib version of NativeClient SDK]),
+ [AS_CASE([$withval],
+ [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_os"],
+ [linux*], [nacl_cv_os_nick=linux],
+ [darwin*], [nacl_cv_os_nick=mac],
+ [cygwin*|mingw*], [nacl_cv_os_nick=win],
+ [nacl_cv_os_nick=$build_os])
+
+ host="$host_cpu-chromium-$host_os-"
+ 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 \
+ "${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}"],
+ [glibc], [if test \
+ -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \
+ -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"
+ fi],
+ [newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ])
+ fi
+ if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then
+ if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl-
+ fi
+ if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl64-
+ fi
+ fi
+ if test -z "${NACL_TOOLCHAIN}"; then
+ AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed])
+ fi
+ AC_MSG_RESULT(${NACL_TOOLCHAIN})
+
+ AC_MSG_CHECKING([path to SDK])
+ 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_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
+[AS_CASE(["${host_os}"],
+[nacl], [
+ AC_CHECK_TYPES([struct PPB_Core, struct PPB_Messaging, struct PPB_Var,
+ struct PPB_URLLoader, struct PPB_URLRequestInfo,
+ struct PPB_URLResponseInfo, struct PPB_FileRef,
+ struct PPP_Instance])
+])
+])
AC_DEFUN([RUBY_CPPOUTFILE],
[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
-[cppflags=$CPPFLAGS
-CPPFLAGS='-o conftest.i'
-AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
-CPPFLAGS=$cppflags
+[save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS='-o conftest-1.i'
+rb_cv_cppoutfile=no
+AC_TRY_CPP([test-for-cppout],
+ [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
+CPPFLAGS="$save_CPPFLAGS"
rm -f conftest*])
if test "$rb_cv_cppoutfile" = yes; then
CPPOUTFILE='-o conftest.i'
@@ -44,125 +220,287 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)])
-unset GREP_OPTIONS
-rb_version=`grep RUBY_VERSION $srcdir/version.h`
-MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
-MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
-TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
-if test "$MAJOR" = ""; then
- AC_MSG_ERROR(could not determine MAJOR number from version.h)
-fi
-if test "$MINOR" = ""; then
- AC_MSG_ERROR(could not determine MINOR number from version.h)
-fi
-if test "$TEENY" = ""; then
- AC_MSG_ERROR(could not determine TEENY number from version.h)
-fi
+eval `sed -n 's/^#define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/include/ruby/version.h`
+for v in MAJOR MINOR TEENY; do
+ if eval "test \"\$$v\" = ''"; then
+ AC_MSG_ERROR(could not determine $v number from version.h)
+ fi
+done
AC_SUBST(MAJOR)
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`
+AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
-AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
- case $withval in
- no) : ${CC=cc}
- ;;
- yes) : ${CC=gcc}
- ;;
- *) CC=$withval
- ;;
- esac])
+AC_CANONICAL_BUILD
+RUBY_RM_RECURSIVE
+AC_ARG_WITH(gcc,
+ AS_HELP_STRING([--without-gcc], [never use gcc]),
+ [
+ AS_CASE([$withval],
+ [no], [: ${CC=cc}],
+ [yes], [: ${CC=gcc}],
+ [CC=$withval])])
dnl If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
+AS_CASE(["$build_os"],
+ [darwin1*.*], [
+ 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++}],
+ [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.
-ifelse(currently,disabled, [
-dnl checks for fat-binary
-AC_ARG_ENABLE(fat-binary,
- [ --enable-fat-binary=ARCHS
- build an Apple/NeXT Multi Architecture Binary (MAB);
- ARCHS is a comma-delimited list of architectures for
- which to build; if ARCHS is omitted, then the package
- will be built for all architectures supported by the
- platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
- for Rhapsody; "m68k,i386,sparc" for OpenStep;
- "m68k,i386,sparc,hppa" for NextStep); if this option
- is disabled or omitted entirely, then the package
- will be built only for the target platform],
- [fat_binary=$enableval], [fat_binary=no])
-if test "$fat_binary" != no; then
+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_MSG_CHECKING([target architectures])
+AC_DEFUN([RUBY_APPEND_OPTION],
+ [# RUBY_APPEND_OPTION($1)
+ AS_CASE([" [$]{$1-} "],
+ [*' $2 '*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
+AC_DEFUN([RUBY_APPEND_OPTIONS],
+ [# RUBY_APPEND_OPTIONS($1)
+ for rb_opt in $2; do
+ AS_CASE([" [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
+ done])
+AC_DEFUN([RUBY_PREPEND_OPTION],
+ [# RUBY_PREPEND_OPTION($1)
+ 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
+ AS_CASE([" [$]{rb_opts} [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
+ done
+ $1="[$]{rb_opts}[$]$1"])
- # Respect TARGET_ARCHS setting from environment if available.
- if test -z "$TARGET_ARCHS"; then
- # Respect ARCH given to --enable-fat-binary if present.
- if test "$fat_binary" != yes; then
- TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
- else
- # Choose a default set of architectures based upon platform.
- case "$target_os" in
- darwin*)
- TARGET_ARCHS="ppc"
- ;;
- rhapsody*)
- TARGET_ARCHS="ppc i386"
- ;;
- openstep*)
- TARGET_ARCHS="m68k i386 sparc"
- ;;
- nextstep*)
- TARGET_ARCHS="m68k i386 sparc hppa"
- ;;
- *)
- TARGET_ARCHS=`arch`
- esac
- fi
- fi
+AC_ARG_WITH(arch,
+ AS_HELP_STRING([--with-arch=ARCHS],
+ [build an Apple/NeXT Multi Architecture Binary (MAB);
+ ARCHS is a comma-delimited list of architectures for
+ which to build; if this option is disabled or omitted
+ entirely, then the package will be built only for the
+ target platform]),
+ [target_archs="$withval"], [unset target_archs])
- AC_MSG_RESULT([$TARGET_ARCHS])
+AC_DEFUN([RUBY_DEFAULT_ARCH], [
+AC_MSG_CHECKING([arch option])
+AS_CASE([$1],
+ [*64], [ARCH_FLAG=-m64],
+ [[i[3-6]86]], [ARCH_FLAG=-m32],
+ [AC_MSG_ERROR(unknown target architecture: $target_archs)]
+ )
+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']`
+unset universal_binary universal_archnames
+if test ${target_archs+set}; then
+ AC_MSG_CHECKING([target architectures])
+ target_archs=`echo $target_archs | tr , ' '`
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- ARCH_FLAG=
- for archs in $TARGET_ARCHS
+ for archs in $target_archs
do
- ARCH_FLAG="$ARCH_FLAG -arch $archs"
+ AS_CASE([",$universal_binary,"],[*",$archs,"*], [],[
+ cpu=`$SHELL "$ac_aux_dir/config.sub" "${archs}-${target_os}" 2>&1` || {
+ AC_MSG_RESULT([failed])
+ AC_MSG_ERROR([$cpu])
+ }
+ cpu=`echo $cpu | sed 's/-.*-.*//'`
+ universal_binary="${universal_binary+$universal_binary,}$cpu"
+ universal_archnames="${universal_archnames} ${archs}=${cpu}"
+ ARCH_FLAG="${ARCH_FLAG+$ARCH_FLAG }-arch $archs"
+ ])
done
- AC_DEFINE(NEXT_FAT_BINARY)
-fi
-], [fat_binary=no])
+ target_archs="$universal_binary"
+ unset universal_binary
+ AS_CASE(["$target_archs"],
+ [*,*], [universal_binary=yes],
+ [unset universal_archnames])
+ AC_MSG_RESULT([$target_archs])
-case $target_cpu in
- i?86) frame_address=yes;;
- *) frame_address=no;;
-esac
-AC_ARG_ENABLE(frame-address,
- [ --enable-frame-address use GCC __builtin_frame_address(). ],
- [frame_address=$enableval])
-if test $frame_address = yes; then
- AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
+ if test "${universal_binary-no}" = yes; then
+ AC_SUBST(try_header,try_compile)
+ target_cpu=universal
+ real_cross_compiling=$cross_compiling
+ else
+ if test x"$target_cpu" != x"${target_archs}"; then
+ echo 'int main(){return 0;}' > conftest.c
+ if $CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1; then
+ rm -fr conftest.*
+ else
+ RUBY_DEFAULT_ARCH("$target_archs")
+ fi
+ fi
+ target_cpu=${target_archs}
+ fi
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+else
+ if test x"$target_alias" = x; then
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ AC_MSG_CHECKING([for real target cpu])
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_cpu=`$CC -E - 2>/dev/null <<EOF |
+#ifdef __x86_64__
+"processor-name=x86_64"
+#endif
+#ifdef __i386__
+"processor-name=i386"
+#endif
+#ifdef __ppc__
+"processor-name=powerpc"
+#endif
+#ifdef __ppc64__
+"processor-name=powerpc64"
+#endif
+EOF
+ sed -n 's/^"processor-name=\(.*\)"/\1/p'`
+ target="$target_cpu${target}"
+ AC_MSG_RESULT([$target_cpu])
+ ])
+ fi
+ target_archs="$target_cpu"
+fi
+if test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"; then
+ AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}])
+else
+ rb_cv_target_archs=${target_archs}
+fi
+if test "x${ARCH_FLAG}" != x; then
+ CFLAGS="$CFLAGS ${ARCH_FLAG}"
+ LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
fi
+# RUBY_UNIVERSAL_ARCH end
+])
+
+AC_ARG_ENABLE(load-relative,
+ AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
+ [load_relative=$enableval])
AC_ARG_PROGRAM
dnl Checks for programs.
+cflagspat=
+test -z "$optflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "$debugflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "warnflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+if test -z "${CFLAGS+set}"; then
+ cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cflags="$cflags"
+ cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
+fi
+if test -z "${CXXFLAGS+set}"; then
+ cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cxxflags="$cxxflags"
+ cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
+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
+])
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
+
AC_PROG_CC
+AC_PROG_CXX
+RUBY_MINGW32
AC_PROG_GCC_TRADITIONAL
+AC_SUBST(GCC)
+AS_CASE(["$target_os"],
+[solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])],
+[AC_CHECK_TOOL([LD], [ld], [ld])])
+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"])
else
linker_flag=
fi
@@ -171,15 +509,48 @@ RUBY_PROG_GNU_LD
RUBY_CPPOUTFILE
: ${OUTFLAG='-o '}
+: ${COUTFLAG=${OUTFLAG}}
AC_SUBST(OUTFLAG)
+AC_SUBST(COUTFLAG)
-RUBY_MINGW32
+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)
-AC_PROG_YACC
-if test "$YACC" = "yacc"; then
- AC_DEFINE([OLD_YACC])
+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
@@ -190,60 +561,684 @@ AC_CHECK_TOOL(AS, as)
ASFLAGS=$ASFLAGS
AC_SUBST(ASFLAGS)
-case "$target_os" in
-cygwin*|mingw*)
- AC_CHECK_TOOL(NM, nm)
+AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
+
+# BSD's ports and MacPorts prefix GNU binutils with 'g'
+AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
+AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
+
+AS_CASE(["$target_os"],
+[cygwin*|mingw*], [
AC_CHECK_TOOL(WINDRES, windres)
AC_CHECK_TOOL(DLLWRAP, dllwrap)
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
- case "$target_os" in
- mingw*)
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+ AS_CASE(["$target_os"],
+ [mingw*], [
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
- AC_CHECK_TOOL(OBJDUMP, objdump)
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
- AC_TRY_LINK([#include <stdio.h>],
+ AC_TRY_LINK([@%:@include <stdio.h>],
[FILE* volatile f = stdin; return 0;],
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
tr A-Z a-z |
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
[rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
- AC_ARG_WITH(winsock2,
- [ --with-winsock2 link winsock2 (MinGW only)], [
- case $withval in
- yes) with_winsock2=yes;;
- *) with_winsock2=no;;
- esac], [with_winsock2=no])
- if test "$with_winsock2" = yes; then
- AC_DEFINE(USE_WINSOCK2)
- fi
- esac
+ RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
+ test "$RT_VER" = "" && RT_VER=60
+ AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
+ ])
: ${enable_shared=yes}
- ;;
-aix*)
- AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
- ;;
-hiuxmpp*)
- # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
- AC_DEFINE(__HIUX_MPP__)
- ;;
-esac
+ ],
+[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
+[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
+AC_CHECK_TOOL(NM, nm)
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
+AC_PROG_MKDIR_P
+if test "x$MKDIR_P" = "x -d"; then
+ if test x"$as_mkdir_p" != xfalse; then
+ MKDIR_P='mkdir -p'
+ echo "use 'mkdir -p' as MKDIR_P"
+ else
+ AC_MSG_ERROR([mkdir -p is required])
+ fi
+fi
+MAKEDIRS="$MKDIR_P"
+AC_SUBST(MAKEDIRS)
+
+AC_DEFUN([RUBY_DTRACE_AVAILABLE],
+[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_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
+ # 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
+ rb_cv_dtrace_available=no
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
+[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
+[
+ 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 &&
+ cat >conftest.c <<_CONF &&
+ @%:@include "conftest_provider.h"
+ int main(void){ CONFTEST_FIRE(); return 0; }
+_CONF
+ $CC $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c &&
+ cp -p conftest.o conftest.oo &&
+ $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null
+ }; then
+ rb_cv_prog_dtrace_g=yes
+ cmp -b conftest.o conftest.oo || rb_cv_prog_dtrace_g=rebuild
+ else
+ rb_cv_prog_dtrace_g=no
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
+if test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
+fi
+
+AC_CHECK_PROGS(DOT, dot)
+AC_CHECK_PROGS(DOXYGEN, doxygen)
+AS_CASE(["${host_os}"], [nacl], [AC_PATH_PROG(PYTHON, python)])
+
+AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
+ [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
# checks for UNIX variants that set C preprocessor variables
-AC_AIX
-AC_MINIX
+AC_USE_SYSTEM_EXTENSIONS
AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp'])
-if $as_mkdir_p; then
- AC_SUBST(MAKEDIRS, ['mkdir -p'])
+RMDIRS='$(top_srcdir)/tool/rmdirs'
+RMDIR=rmdir
+mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
+rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
+RMDIR='rmdir --ignore-fail-on-non-empty'
+$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
+{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
+rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
+AC_SUBST(RMDIR)
+AC_SUBST(RMDIRS)
+AC_SUBST(RMALL, ['rm -fr'])
+
+AC_MSG_CHECKING([for cd using physical directory])
+rm -fr conf$$.dir
+mkdir conf$$.dir &&
+(cd conf$$.dir && mkdir src build && cd src &&
+$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
+for chdir in 'cd -P' 'PWD= cd'; do
+ /bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
+done)
+if test -f conf$$.dir/src/cdcmd; then
+ read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
else
- AC_SUBST(MAKEDIRS, ['install -d'])
+ CHDIR=cd
+fi
+rm -fr conf$$.dir
+AC_MSG_RESULT([$CHDIR])
+AC_SUBST(CHDIR)
+
+}
+{ # compiler section
+
+AC_DEFUN([RUBY_WERROR_FLAG], [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $rb_cv_warnflags"
+if test "${ac_c_werror_flag+set}"; then
+ rb_c_werror_flag="$ac_c_werror_flag"
+else
+ unset rb_c_werror_flag
+fi
+ac_c_werror_flag=yes
+$1
+CFLAGS="$save_CFLAGS"
+save_CFLAGS=
+if test "${rb_c_werror_flag+set}"; then
+ ac_c_werror_flag="$rb_c_werror_flag"
+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([faild 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_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
+ RUBY_WERROR_FLAG([
+ CFLAGS="[$]CFLAGS $1"
+ AC_TRY_COMPILE([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+])
+
+AC_DEFUN([RUBY_TRY_LDFLAGS], [
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="[$]LDFLAGS $1"
+ AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
+ RUBY_WERROR_FLAG([
+ AC_TRY_LINK([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+ LDFLAGS="$save_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
+ for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
+ -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 \
+ ; do
+ if test "$particular_werror_flags" != yes; then
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
+ fi
+ ok=no
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ ok=yes
+ ])
+ AS_CASE([$ok:$wflag], [no:-Werror=*], [
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ particular_werror_flags=no
+ ])
+ ])
+ done
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
+ [wflag=-Wall])
+ RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
+ # Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
+ rb_cv_warnflags="$warnflags"
+ warnflags=
+fi
+RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
+
+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)])
+ ])
+
+ # -fstack-protector
+ AS_CASE(["$target_os"],
+ [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)
+ RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
+ fi
+
+ AS_CASE(["$target_os"],[mingw*], [
+ # 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.
+ ],
+ [cygwin*|darwin*|netbsd*|nacl], [
+ # 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
+ ])
+
+ # 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}
+
+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
+ 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
+ test "$visibility_option" = no -o "$host_os" = nacl || OBJCOPY=:
+fi
+
+if test "$GCC" = yes; then
+ # optflags
+
+ AS_CASE(["$target_os"], [mingw*], [
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
+ ])
+
+ # disable fast-math
+ 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
+ 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],
+[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 -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_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_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_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
+ ],
+[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( \
+ limits.h \
+ sys/file.h \
+ sys/ioctl.h \
+ sys/syscall.h \
+ fcntl.h \
+ sys/fcntl.h \
+ sys/param.h \
+ sys/select.h \
+ sys/time.h \
+ sys/times.h \
+ syscall.h \
+ pwd.h \
+ grp.h \
+ a.out.h \
+ utime.h \
+ direct.h \
+ sys/resource.h \
+ sys/mkdev.h \
+ sys/utime.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 \
+ sys/uio.h \
+ atomic.h \
+ malloc.h \
+ malloc_np.h \
+ malloc/malloc.h \
+ setjmpex.h \
+ sys/attr.h \
+ sys/id.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
@@ -253,23 +1248,247 @@ 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
+ ])
+ ])
+
+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)])
+
AC_CHECK_TYPES([long long, off_t])
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 0)
-AC_CHECK_SIZEOF(__int64, 0)
-AC_CHECK_SIZEOF(off_t, 0)
-AC_CHECK_SIZEOF(void*, 4)
-AC_CHECK_SIZEOF(float, 4)
-AC_CHECK_SIZEOF(double, 8)
-AC_CHECK_SIZEOF(time_t, 0)
-
-for id in pid_t gid_t uid_t; do
- AC_CHECK_TYPE($id, [typ=$id], [typ=int])
- AC_DEFINE_UNQUOTED(rb_$id, $typ)
-done
+AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
+ [test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
+ [AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
+
+dnl RUBY_CHECK_SIZEOF [typename], [maybe same size types], [macros], [include]
+AC_DEFUN([RUBY_CHECK_SIZEOF],
+[m4_bmatch([$1], [\.], [], [if test "$universal_binary" = yes; then])
+AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [
+ unset AS_TR_SH(ac_cv_sizeof_$1)
+ rbcv_var="
+typedef m4_bpatsubst([$1], [\..*]) ac__type_sizeof_;
+static ac__type_sizeof_ *rbcv_ptr;
+@%:@define AS_TR_CPP(SIZEOF_$1) sizeof((*rbcv_ptr)[]m4_bmatch([$1], [\.], .m4_bpatsubst([$1], [^[^.]*\.])))
+"
+ m4_ifval([$2], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for t in $2; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([$4]
+ [$rbcv_var]),
+ [AS_TR_CPP(SIZEOF_$1) == sizeof($t)])], [
+ AS_TR_SH(ac_cv_sizeof_$1)=AS_TR_CPP([SIZEOF_]$t)
+ break])
+ done
+ }])
+ unset cond
+ m4_ifval([$3], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for s in 32 64 128; do
+ for t in $3; do
+ cond="${cond}
+@%:@${cond+el}if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})"
+ hdr="AC_INCLUDES_DEFAULT([$4
+@%:@if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})
+@%:@ define AS_TR_CPP(HAVE_$1) 1
+@%:@else
+@%:@ define AS_TR_CPP(HAVE_$1) 0
+@%:@endif])"
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr], [!AS_TR_CPP(HAVE_$1)])], [continue])
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
+ [$rbcv_var],
+ [AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == ([$[s / rb_cv_char_bit]]))])],
+ [AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}"])
+ done
+ done
+ }])
+ m4_ifval([$2][$3],
+ [test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
+ test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
+[${cond+$cond
+@%:@else}
+$rbcv_var
+${cond+@%:@endif}
+@%:@ifndef AS_TR_CPP(SIZEOF_$1)
+@%:@define AS_TR_CPP(SIZEOF_$1) 0
+@%:@endif], [t=0])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling
+ if test ${t-0} != 0; then
+ AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
+ fi
+ }
+ : ${AS_TR_SH(ac_cv_sizeof_$1)=0}
+])
+{
+ unset cond
+ for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
+ AS_CASE(["$t"],
+ [[[0-9]*|SIZEOF_*]], [
+ ${cond+echo "@%:@else"}
+ echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) [$t]"
+ break
+ ],
+ [
+ s=`expr $t : ['.*[^0-9]\([0-9][0-9]*\)$']`
+ echo "@%:@${cond+el}if defined(__${t}__) || defined(__${t}) || defined(_${t}) || defined($t)"
+ echo "@%:@define AS_TR_CPP(SIZEOF_$1) [$[s / rb_cv_char_bit]]"
+ cond=1
+ ])
+ done
+ ${cond+echo "@%:@endif"}
+} >> confdefs.h
+m4_bmatch([$1], [\.], [], [else
+AC_CHECK_SIZEOF([$1], 0, [$4])
+fi])
+])
+
+RUBY_CHECK_SIZEOF(int, [], [ILP])
+RUBY_CHECK_SIZEOF(short)
+RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
+RUBY_CHECK_SIZEOF(long long)
+RUBY_CHECK_SIZEOF(__int64)
+RUBY_CHECK_SIZEOF(__int128)
+RUBY_CHECK_SIZEOF(off_t)
+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
+ AC_TRY_COMPILE(
+ [@%:@include <stdio.h>
+ @%:@include <stddef.h>
+ @%:@ifdef __GNUC__
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
+ decl __attribute__((format(printf, string_index, first_to_check)))
+ @%:@else
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
+ @%:@endif
+ PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);],
+ [printf("%]${pri}[d", (]$1[)42);
+ test_sprintf("%]${pri}[d", (]$1[)42);],
+ [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
+ done)])
+if test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE; then
+ AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
+ "[$rb_cv_pri_prefix_]AS_TR_SH($1)")
+fi
+])
+
+if test "x$ac_cv_type_long_long" = xyes; then
+ RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
+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],
+ [n="patsubst([$1],["],[\\"])"],
+ [n="patsubst([$2],["],[\\"])"],
+ [$4])
+ AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
+ u= t=
+ AS_CASE(["$n "],
+ [*" signed "*], [ ],
+ [*" unsigned "*], [
+ u=U],
+ [RUBY_CHECK_SIGNEDNESS($n, [], [u=U], [$4])])
+ if test x"$t" = x; then
+ for t in "long long" long int short; do
+ test -n "$u" && t="unsigned $t"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])]
+ [typedef $n rbcv_conftest_target_type;
+ typedef $t rbcv_conftest_replace_type;
+ extern rbcv_conftest_target_type rbcv_conftest_var;
+ extern rbcv_conftest_replace_type rbcv_conftest_var;
+ extern rbcv_conftest_target_type rbcv_conftest_func(void);
+ extern rbcv_conftest_replace_type rbcv_conftest_func(void);
+ ], [sizeof(rbcv_conftest_target_type) == sizeof(rbcv_conftest_replace_type)])],
+ [n="$t"; break])
+ done
+ fi
+ AS_CASE([" $n "],
+ [*" long long "*], [
+ t=LL],
+ [*" long "*], [
+ t=LONG],
+ [
+ t=INT])
+ rb_cv_[$1]_convertible=${u}${t}])
+ test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
+ AS_CASE("${rb_cv_[$1]_convertible}", [U*], [u=+1], [u=-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,
+ [PRI_`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//']`_PREFIX])
+])
+RUBY_REPLACE_TYPE(pid_t, int, PIDT)
+RUBY_REPLACE_TYPE(uid_t, int, UIDT)
+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)
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
@@ -280,16 +1499,51 @@ if test "$rb_cv_have_prototypes" = yes; then
fi
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
- [AC_TRY_COMPILE([#define paste(a,b) a##b],
+ [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
[int xy = 1; return paste(x,y);],
rb_cv_tokenpaste=ansi,
rb_cv_tokenpaste=knr)])
if test "$rb_cv_tokenpaste" = ansi; then
- AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
+ AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
else
AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
fi
+AC_CACHE_CHECK(stringization, rb_cv_stringization, [
+ rb_cv_stringization=no
+ for string in "#expr" '"expr"'; do
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+#define STRINGIZE0(expr) $string
+#define STRINGIZE(expr) STRINGIZE0(expr)
+#undef real_test_for_stringization
+#define test_for_stringization -.real_test_for_stringization.-
+const char stringized[[]] = STRINGIZE(test_for_stringization);
+], [sizeof(stringized) == 32])],
+ [rb_cv_stringization="$string"; break],
+ [rb_cv_stringization=no])
+ done]
+)
+AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
+if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
+ AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
+ AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
+fi
+
+AC_CACHE_CHECK([string literal concatenation],
+ rb_cv_string_literal_concatenation, [
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+const char concatenated_literal[[]] = "literals" "to"
+ "be" "concatenated.";
+], [sizeof(concatenated_literal) == 26])],
+ [rb_cv_string_literal_concatenation=yes],
+ [rb_cv_string_literal_concatenation=no])]
+)
+if test "$rb_cv_string_literal_concatenation" = no; then
+ AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
+fi
+
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
[AC_TRY_COMPILE([
#include <stdarg.h>
@@ -308,6 +1562,30 @@ if test "$rb_cv_stdarg" = yes; then
AC_DEFINE(HAVE_STDARG_PROTOTYPES)
fi
+AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
+ [AC_TRY_COMPILE([
+int foo(int x, ...);
+@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)
+], [FOO(1);FOO(1,2);FOO(1,2,3);],
+ rb_cv_va_args_macro=yes,
+ rb_cv_va_args_macro=no)])
+if test "$rb_cv_va_args_macro" = yes; then
+ AC_DEFINE(HAVE_VA_ARGS_MACRO)
+fi
+
+AC_DEFUN([RUBY_DEFINE_IF], [dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@if $1
+EOH
+])dnl
+AC_DEFINE_UNQUOTED($2, $3)dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@endif /* $1 */
+EOH
+])dnl
+])dnl
+
+dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
[AS_VAR_PUSHDEF([attrib],[$2])], dnl
@@ -317,249 +1595,360 @@ m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
[AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
-AC_CACHE_CHECK(for [$1] function attribute, rbcv,
+m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])
+m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
+AC_CACHE_CHECK(for m4_ifval([$2],[$2],[$1]) function attribute, rbcv,
[rbcv=x
-if test "${ac_c_werror_flag+set}"; then
- rb_c_werror_flag="$ac_c_werror_flag"
-else
- unset rb_c_werror_flag
-fi
-ac_c_werror_flag=yes
-for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
+RUBY_WERROR_FLAG([
+for mac in \
+ "__attribute__ ((attrib_code)) x" \
+ "x __attribute__ ((attrib_code))" \
+ "__declspec(attrib_code) x" \
+ x; do
+ m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE(
- [#define ]attrib[(x) $mac
- ]attrib[(void conftest_attribute_check(void));], [],
+ m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
+[@%:@define ]attrib[(x) $mac]
+m4_ifval([$4],${rbcv_cond+[@%:@else]}
+${rbcv_cond+[@%:@define ]attrib[(x) x]}
+${rbcv_cond+[@%:@endif]})
+ attrib[(void conftest_attribute_check(void));], [],
[rbcv="$mac"; break])
done
-if test "${rb_c_werror_flag+set}"; then
- ac_c_werror_flag="$rb_c_werror_flag"
-else
- unset ac_c_werror_flag
+])])
+if test "$rbcv" != x; then
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
fi
-])
-AC_DEFINE_UNQUOTED(attrib[(x)], $rbcv)
-AS_VAR_POPDEF([attrib])
-AS_VAR_POPDEF([rbcv])
+m4_ifval([$4], [unset rbcv_cond]) dnl
+AS_VAR_POPDEF([attrib])dnl
+AS_VAR_POPDEF([rbcv])dnl
])
RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
+RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
-AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
-[rb_cv_ruby_extern=no
-for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
- AC_TRY_COMPILE(
- [extern $mac void conftest(void);],
- [rb_cv_ruby_extern="extern $mac"; break])
-done])
-test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
+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("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
-XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
+if test "$GCC" = yes; then
+ AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
+ [rb_cv_gcc_function_alias=no
+ for a in alias weak,alias; do
+ AC_TRY_LINK([void foo(void) {}
+ void bar(void) __attribute__(($a("foo")));], [bar()],
+ [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
-dnl Check whether we need to define sys_nerr locally
-AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
-#include <errno.h>])
+ 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
-dnl whether link libc_r or not
-AC_ARG_WITH(libc_r,
- [ --with-libc_r link libc_r if possible (FreeBSD only)], [
- case $withval in
- yes) with_libc_r=yes;;
- *) with_libc_r=no;;
- esac], [with_libc_r=no])
+ AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_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)
+ fi
-AC_ARG_ENABLE(pthread,
- [ --enable-pthread use pthread library.],
- [enable_pthread=$enableval], [enable_pthread=no])
+ AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
+ [RUBY_WERROR_FLAG(
+ [AC_TRY_LINK([volatile int zero;],
+ [if (zero) __builtin_unreachable();],
+ [rb_cv_func___builtin_unreachable=yes],
+ [rb_cv_func___builtin_unreachable=no])
+ ])
+ ])
+ if test "$rb_cv_func___builtin_unreachable" = yes; then
+ AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
+ fi
+fi
-AC_ARG_ENABLE(fastthread,
- [ --disable-fastthread do not use the fastthread mutex], [
- : handled by ext/thread/extconf.rb
- ])
+AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
+rb_cv_func_exported=no
+RUBY_WERROR_FLAG([
+for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
+ AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
+ RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
+ [rb_cv_func_exported="$mac"; break])
+done
+])])
+if test "$rb_cv_func_exported" != no; then
+ AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
+fi
-dnl Checks for libraries.
-case "$target_os" in
-nextstep*) ;;
-openstep*) ;;
-rhapsody*) ;;
-darwin*) LIBS="-lobjc $LIBS"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE"
- 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
- ],
- [
- test "x$target_cpu" = xpowerpc && ac_cv_header_ucontext_h=no
- ],
- [
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ])
- ;;
-hpux*) LIBS="-lm $LIBS"
- ac_cv_c_inline=no;;
-human*) ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ;;
-beos*) ac_cv_func_link=no;;
-cygwin*) ;;
-mingw*) if test "$with_winsock2" = yes; then
- LIBS="-lws2_32 $LIBS"
- else
- LIBS="-lwsock32 $LIBS"
- fi
- LIBS="-lshell32 $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_func_times=yes
- ac_cv_func_waitpid=yes
- ac_cv_func_fsync=yes
- ac_cv_func_vsnprintf=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_lib_crypt_crypt=no
- ac_cv_func_getpgrp_void=no
- ac_cv_func_setpgrp_void=yes
- ac_cv_func_memcmp_working=yes
- ac_cv_lib_dl_dlopen=no
- rb_cv_binary_elf=no
- rb_cv_negative_time_t=no
- enable_pthread=no
- ac_cv_func_fcntl=yes
- ;;
-os2-emx*) LIBS="-lm $LIBS"
- ac_cv_lib_dir_opendir=no;;
-msdosdjgpp*) LIBS="-lm $LIBS"
- ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ac_cv_sizeof_rlim_t=4
- ac_cv_func_setrlimit=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_CACHE_CHECK([whether -lxpg4 has to be linked],
- rb_cv_lib_xpg4_needed,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 400020 || \
- (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
-#error needs libxpg4
-#endif
- ],
- rb_cv_lib_xpg4_needed=no,
- rb_cv_lib_xpg4_needed=yes,
- rb_cv_lib_xpg4_needed=yes)])
- if test "$rb_cv_lib_xpg4_needed" = yes; then
- AC_CHECK_LIB(xpg4, setlocale)
- fi
- if test "$with_libc_r" = yes; then
- AC_CACHE_CHECK([whether libc_r is supplementary to libc],
- rb_cv_supplementary_lib_c_r,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if 500016 <= __FreeBSD_version
-#error libc_r is supplementary to libc
-#endif
- ],
- rb_cv_supplementary_lib_c_r=no,
- rb_cv_supplementary_lib_c_r=yes,
- rb_cv_supplementary_lib_c_r=yes)])
- if test "$rb_cv_supplementary_lib_c_r" = yes; then
- MAINLIBS="-lc_r $MAINLIBS"
- fi
- fi
- ;;
-dragonfly*) LIBS="-lm $LIBS"
- ;;
-bow) ac_cv_func_setitimer=no
- ;;
-superux*) ac_cv_func_setitimer=no
- ;;
-solaris*2.1*) if test -z "$GCC"; then
- ac_cv_func_isinf=yes
- fi
- LIBS="-lm $LIBS"
- ;;
-*) LIBS="-lm $LIBS";;
-esac
-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(rt, clock_gettime) # GNU/Linux
+RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-case "$target_cpu" in
-alpha*) case "$target_os"::"$GCC" in
- *::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
- osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
- esac ;;
-esac
+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
+
+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])
+
+AS_CASE(["$target_cpu"],
+[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
+ [*::yes], # gcc
+ [CFLAGS="-mieee $CFLAGS"],
+ [osf*], # ccc
+ [CFLAGS="-ieee $CFLAGS"],
+ )],
+[sparc*], [AC_LIBOBJ([sparc])])
+
+ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
+if test "$ac_cv_header_net_socket_h" = yes; then
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
+else
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
+fi
-dnl Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(stdlib.h string.h unistd.h 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 memory.h direct.h sys/resource.h \
- sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
- ucontext.h intrinsics.h)
-
-dnl Check additional types.
-AC_CHECK_SIZEOF(rlim_t, 0, [
- #ifdef HAVE_SYS_TYPES_H
- # include <sys/types.h>
- #endif
- #ifdef HAVE_SYS_TIME_H
- # include <sys/time.h>
- #endif
- #ifdef HAVE_SYS_RESOURCE_H
- # include <sys/resource.h>
- #endif
- #ifdef HAVE_UNISTD_H
- # include <unistd.h>
- #endif
- #include <stdio.h>
-])
-dnl Checks for typedefs, structures, and compiler characteristics.
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)
+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>])
+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>])
+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])
+AC_CHECK_MEMBERS([struct stat.st_mtim])
+AC_CHECK_MEMBERS([struct stat.st_mtimespec])
+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>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CACHE_VAL([rb_cv_large_fd_select],
+ [AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no])])
+if test "$rb_cv_large_fd_select" = yes; then
+ AC_DEFINE(HAVE_RB_FD_INIT, 1)
+fi
+
+dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
+AC_DEFUN([RUBY_DEFINT], [dnl
+AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
+typedef $1 t; int s = sizeof(t) == 42;])],
+ [rb_cv_type_$1=yes],
+ [AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
+ ["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
+ ["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
+ ["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
+ ["$ac_cv_sizeof_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long"],
+ ["$ac_cv_sizeof_long_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long"],
+ ["$ac_cv_sizeof___int64"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64"],
+ ["$ac_cv_sizeof___int128"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int128"],
+ [ rb_cv_type_$1=no])])])
+if test "${rb_cv_type_$1}" != no; then
+ AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
+ if test "${rb_cv_type_$1}" = yes; then
+ m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
+ [RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
+ else
+ AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
+ AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$rb_cv_type_$1]))
+ fi
+fi
+])
+
+RUBY_DEFINT(int8_t, 1)
+RUBY_DEFINT(uint8_t, 1, unsigned)
+RUBY_DEFINT(int16_t, 2)
+RUBY_DEFINT(uint16_t, 2, unsigned)
+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.
+
+RUBY_NACL_CHECK_PEPPER_TYPES
+
+AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
+[rb_cv_stack_end_address=no
+ AC_TRY_LINK(
+ [extern void *__libc_stack_end;],
+ [if (!__libc_stack_end) return 1;],
+ [rb_cv_stack_end_address="__libc_stack_end"])
+])
+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*], [
+ 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
+ AC_TRY_RUN([
+#include <math.h>
+#include <unistd.h>
+
+int
+main() {
+ if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
+ return 0;
+}
+ ],
+ rb_cv_page_size_log="$page_log"; break)
+ done])
+ if test $rb_cv_page_size_log != no; then
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
+ else
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
+ fi
+])
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
-case "${target_cpu}-${target_os}" in
-powerpc-darwin*)
+AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
+[powerpc-darwin*], [
AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
AC_DEFINE(C_ALLOCA)
AC_DEFINE_UNQUOTED(alloca, alloca)
- ;;
-*)
+ ],
+[universal-darwin*:*ppc*], [
+ AC_LIBSOURCES(alloca.c)
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
+ RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
+ RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
+ ],
+[
AC_FUNC_ALLOCA
- ;;
-esac
+ ])
+if test "x$ALLOCA" = "x"; then
+ AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
+ for chk in ok __chkstk; do
+ AC_TRY_LINK([
+ @%:@ifdef HAVE_ALLOCA_H
+ @%:@include <alloca.h>
+ @%:@endif
+ void $chk() {}
+ int dynamic_alloca_test;
+ int dynamic_alloca_result;],
+ [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
+ [rb_cv_dynamic_alloca=$chk; break])
+ done])
+ if test "x$rb_cv_dynamic_alloca" = "x__chkstk"; then
+ AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
+ AS_CASE("$target_cpu",
+ [x64|x86_64], [
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
+ ],)
+ fi
+fi
AC_FUNC_MEMCMP
-AC_FUNC_FSEEKO
-AC_CHECK_FUNCS(ftello)
# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
# Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
@@ -577,75 +1966,418 @@ main()
rb_cv_broken_glibc_ia64_erfc=no,
rb_cv_broken_glibc_ia64_erfc=yes,
rb_cv_broken_glibc_ia64_erfc=no)])
-case $rb_cv_broken_glibc_ia64_erfc in
- yes) ac_cv_func_erf=no;;
-esac
-
-AC_REPLACE_FUNCS(dup2 memmove strcasecmp strncasecmp strerror strftime\
- strchr strstr strtoul crypt flock vsnprintf\
- isnan finite isinf hypot acosh erf)
-AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
- truncate ftruncate chsize times utimes fcntl lockf lstat symlink link\
- readlink setitimer setruid seteuid setreuid setresuid\
- setproctitle setrgid setegid setregid setresgid issetugid pause\
- lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
- getgroups setgroups getpriority getrlimit setrlimit sysconf\
- group_member dlopen sigprocmask\
- sigaction sigsetjmp _setjmp _longjmp setsid telldir seekdir fchmod\
- mktime timegm gettimeofday\
- cosh sinh tanh round setuid setgid setenv unsetenv)
+AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no])
+
+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(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)
+
+# 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)
+
+
+AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
+ [AC_TRY_LINK([
+#include <math.h>
+], [int v = signbit(-0.0);],
+ rb_cv_have_signbit=yes,
+ rb_cv_have_signbit=no)])
+if test "$rb_cv_have_signbit" = yes; then
+ AC_DEFINE(HAVE_SIGNBIT)
+else
+ AC_LIBOBJ([signbit])
+fi
+AC_FUNC_FORK
+
+AC_CHECK_FUNCS(__syscall)
+AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
+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(writev)
+AC_CHECK_FUNCS(memrchr)
+AC_CHECK_FUNCS(memmem)
+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_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, [__builtin_choose_expr(0, 0, 0)])
+RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [__builtin_choose_expr(__builtin_constant_p(foo), 0, 0)])
+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)
+ ])
+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_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
+ [AC_TRY_COMPILE([
+#include <stdlib.h>
+], [int v = unsetenv("foo");],
+ rb_cv_unsetenv_return_value=yes,
+ rb_cv_unsetenv_return_value=no)])
+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_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_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])
])
+# we don't use _setjmp if _longjmp doesn't exist.
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
+AC_DEFUN([RUBY_SETJMP_TYPE], [
+RUBY_CHECK_BUILTIN_SETJMP
AC_MSG_CHECKING(for setjmp type)
-AC_ARG_WITH(setjmp-type,
- [ --with-setjmp-type select setjmp type], [
- case $withval in
- __builtin_setjmp) setjmp_prefix=__builtin_;;
- _setjmp) setjmp_prefix=_;;
- sigsetjmp) setjmp_prefix=sig;;
- setjmp) setjmp_prefix=;;
- '') unset setjmp_prefix;;
- *) AC_MSG_ERROR(invalid setjmp type: $withval);;
- esac], [unset setjmp_prefix])
+setjmp_suffix=
+AC_ARG_WITH(setjmp-type,
+ AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
+ [
+ AS_CASE([$withval],
+ [__builtin_setjmp], [setjmp=__builtin_setjmp],
+ [_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 = no; then
- AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
+ 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)
fi
-elif test "$ac_cv_func___builtin_setjmp" = yes; then
+elif { AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]) }; then
+ setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
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
- case $target_os in
- solaris*|cygwin*)
- setjmp_prefix=;;
- *)
- setjmp_prefix=sig;;
- esac
+ 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)
-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_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_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
+])
+# End of setjmp check.
AC_ARG_ENABLE(setreuid,
- [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
+ AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
[use_setreuid=$enableval])
if test "$use_setreuid" = yes; then
AC_DEFINE(USE_SETREUID)
@@ -653,7 +2385,7 @@ if test "$use_setreuid" = yes; then
fi
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
- [AC_TRY_COMPILE([#include <time.h>],
+ [AC_TRY_COMPILE([@%:@include <time.h>],
[struct tm t; t.tm_gmtoff = 3600;],
[rb_cv_member_struct_tm_tm_gmtoff=yes],
[rb_cv_member_struct_tm_tm_gmtoff=no])])
@@ -663,15 +2395,15 @@ fi
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
[AC_TRY_LINK([#include <time.h>
int i;],
- [i = daylight;],
+ [i = daylight;],
rb_cv_have_daylight=yes,
rb_cv_have_daylight=no)])
if test "$rb_cv_have_daylight" = yes; then
AC_DEFINE(HAVE_DAYLIGHT)
fi
AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
-AC_CACHE_CHECK([for external $1], rb_cv_var_$1,
- [rb_cv_var_$1=no
+AC_CACHE_CHECK([for external $1], AS_TR_SH(rb_cv_var_$1),
+ [AS_TR_SH(rb_cv_var_$1)=no
AC_TRY_COMPILE([
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 1
@@ -690,31 +2422,30 @@ $2
extern $t $1;
const volatile void *volatile t;],
[t = &(&$1)[0];],
- [rb_cv_var_$1=$t; break])
+ [AS_TR_SH(rb_cv_var_$1)=$t; break])
done])])
-if test "[$rb_cv_var_]$1" != no; then
- AC_DEFINE([HAVE_VAR_]m4_toupper($1))
- AC_DEFINE_UNQUOTED([TYPEOF_VAR_]m4_toupper($1), $rb_cv_var_$1)
+if test "${AS_TR_SH(rb_cv_var_$1)}" != no; then
+ AC_DEFINE(AS_TR_CPP(HAVE_VAR_$1))
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(TYPEOF_VAR_$1), ${AS_TR_SH(rb_cv_var_$1)})
fi])
RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
-if test "$rb_cv_var_timezone" = no; then
- AC_CHECK_FUNCS(timezone)
- if test "$ac_cv_func_timezone" = yes; then
- AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
- [AC_TRY_COMPILE([@%:@include <time.h>],
- [(void)timezone(0, 0);],
- [rb_cv_func_timezone_void=no],
- [rb_cv_func_timezone_void=yes])]
- )
- if test $rb_cv_func_timezone_void = yes; then
- AC_DEFINE(TIMEZONE_VOID)
- fi
+AC_CHECK_FUNCS(timezone)
+if test "$ac_cv_func_timezone" = yes; then
+ AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
+ [AC_TRY_COMPILE([@%:@include <time.h>],
+ [(void)timezone(0, 0);],
+ [rb_cv_func_timezone_void=no],
+ [rb_cv_func_timezone_void=yes])]
+ )
+ if test $rb_cv_func_timezone_void = yes; then
+ AC_DEFINE(TIMEZONE_VOID)
fi
fi
AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
[AC_TRY_RUN([
+#include <stdlib.h>
#include <time.h>
void
@@ -751,6 +2482,49 @@ if test "$rb_cv_negative_time_t" = yes; then
AC_DEFINE(NEGATIVE_TIME_T)
fi
+# [ruby-dev:40910] overflow of time on FreeBSD
+# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
+AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
+ [AC_TRY_RUN([
+#include <stdlib.h>
+#include <time.h>
+
+void
+check(time_t t1)
+{
+ struct tm *tm;
+ time_t t2;
+ tm = localtime(&t1);
+ if (!tm)
+ return; /* overflow detected. ok. */
+ t2 = mktime(tm);
+ if (t1 == t2)
+ return; /* round-trip. ok. */
+ exit(1);
+}
+
+int
+main()
+{
+ time_t t;
+ if (~(time_t)0 <= 0) {
+ t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
+ t |= t - 1;
+ }
+ else {
+ t = ~(time_t)0;
+ }
+ check(t);
+ return 0;
+}
+],
+ rb_cv_localtime_overflow=yes,
+ rb_cv_localtime_overflow=no,
+ rb_cv_localtime_overflow=no)])
+if test "$rb_cv_localtime_overflow" = no; then
+ AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
+fi
+
if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
AC_DEFINE(POSIX_SIGNAL)
else
@@ -783,14 +2557,19 @@ main()
fi
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
-AC_FUNC_SETPGRP
-
-AC_C_BIGENDIAN
-AC_C_CONST
-AC_C_CHAR_UNSIGNED
-AC_C_INLINE
-AC_C_VOLATILE
+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"$target_cpu" = xia64; then
AC_LIBOBJ([ia64])
@@ -808,162 +2587,17 @@ if test x"$target_cpu" = xia64; then
fi
AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
- [AC_TRY_RUN([
-int
-main()
-{
- if (-1==(-1>>1))
- return 0;
- return 1;
-}
-],
+ [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
rb_cv_rshift_sign=yes,
- rb_cv_rshift_sign=no,
- rb_cv_rshift_sign=yes)])
+ rb_cv_rshift_sign=no)])
if test "$rb_cv_rshift_sign" = yes; then
- AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
-else
- AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
-fi
-
-AC_MSG_CHECKING(read count field in FILE structures)
-AC_CACHE_VAL(rb_cv_fcnt,
-[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,
- rb_cv_fcnt="not found")
-done])
-if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_RESULT([not found(OK if using GNU libc)])
+ AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
else
- AC_MSG_RESULT($rb_cv_fcnt)
- AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
-fi
-
-AC_MSG_CHECKING(read buffer ptr field in FILE structures)
-AC_CACHE_VAL(rb_cv_frptr,
-[for frptr in dnl
- _IO_read_ptr dnl
- _ptr dnl
- __ptr dnl
- bufpos dnl
- _p 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_MSG_RESULT([not found])
-else
- AC_MSG_RESULT($rb_cv_frptr)
- AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
-
- if test "$rb_cv_fcnt" = "not found"; then
- AC_MSG_CHECKING(read buffer end field in FILE structures)
- AC_CACHE_VAL(rb_cv_frend,
- [for frend in dnl
- _IO_read_end 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_MSG_RESULT([not found])
- else
- AC_MSG_RESULT($rb_cv_frend)
- AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
- fi
- fi
+ AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
fi
-AC_DEFUN([RUBY_CHECK_IO_NEED],
-[AC_CACHE_CHECK(whether need to [$1], [$2],
- [AC_TRY_RUN([
-#include <stdio.h>
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-#define before_seek(f) ]ifelse(index($2,flush_before_seek),-1,[fflush(f)],[(f,0)])[
-#define reset_rw(f) ]ifelse(index($2,seek_between_rw),-1,[do_seek(f,SEEK_CUR)],[(f,0)])[
-#define do_seek(f, w) (before_seek(f), fseek(f,0,w))
-
-char *fn = "conftest.dat";
-char *wombat = "wombat\n";
-char *koara = "koara\n";
-char *kangaroo = "kangaroo\n";
-
-int main()
-{
- char buf[BUFSIZ];
- FILE *f;
- int r = 1;
-
- if (!(f = fopen(fn, "w+"))) return 1;
- fputs(wombat, f);
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- reset_rw(f);
- fputs(koara, f);
- fputs(kangaroo, f);
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- reset_rw(f);
- fputc('X', f);
- reset_rw(f);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara+1)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- do_seek(f, SEEK_SET);
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || buf[0] != 'X' || strcmp(buf+1, koara+1)) goto fail;
- if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
- r = 0;
- fail:
- fclose(f);
- unlink(fn);
- return r;
-}
-], [$2]=no, [$2]=yes, [$2]=[$3])])])
-RUBY_CHECK_IO_NEED(seek between R/W, rb_cv_need_io_seek_between_rw, yes)
-if test "$rb_cv_need_io_seek_between_rw" = yes; then
- AC_DEFINE(NEED_IO_SEEK_BETWEEN_RW, 1)
-fi
-dnl RUBY_CHECK_IO_NEED(flush before seek, rb_cv_need_io_flush_before_seek, no)
-dnl if test "$rb_cv_need_io_flush_before_seek" = yes; then
-dnl AC_DEFINE(NEED_IO_FLUSH_BEFORE_SEEK, 1)
-dnl fi
-
-AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
-[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
-#include <sys/stat.h>
-struct stat test_stat;
-], [sizeof(test_stat.st_ino)>sizeof(long)])],
-rb_cv_huge_st_ino=yes,
-rb_cv_huge_st_ino=no)
-])
-if test $rb_cv_huge_st_ino = yes; then
- AC_DEFINE(HUGE_ST_INO)
+if test x"$ac_cv_func_gettimeofday" != xyes; then
+ AC_MSG_ERROR(gettimeofday() must exist)
fi
if test "$ac_cv_func_sysconf" = yes; then
@@ -982,12 +2616,14 @@ if test "$ac_cv_func_sysconf" = yes; then
RUBY_CHECK_SYSCONF(CLK_TCK)
fi
-case "$target_cpu" in
-m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
-hppa*) rb_cv_stack_grow_dir=+1;;
-esac
-AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
- [AC_TRY_RUN([
+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"],
+[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
+[hppa*], [ $2=+1],
+[
+ AC_TRY_RUN([
/* recurse to get rid of inlining */
static int
stack_growup_p(addr, n)
@@ -1004,12 +2640,45 @@ int main()
int x;
return stack_growup_p(&x, 10);
}
-], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
-AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
+], $2=-1, $2=+1, $2=0)
+ ])
+eval stack_grow_dir=\$$2])
+eval $2=\$stack_grow_dir
+AS_VAR_POPDEF([stack_grow_dir])])
+if test "${universal_binary-no}" = yes ; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
+ stack_dir=
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ CFLAGS="$new_cflags -arch $archs"
+ LDFLAGS="$new_ldflags -arch $archs"
+ RUBY_STACK_GROW_DIRECTION($archs, dir)
+ if test x$stack_dir = x; then
+ stack_dir=$dir
+ elif test x$stack_dir != x$dir; then
+ stack_dir=no
+ fi
+ done
+ CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
+ if test x$stack_dir = xno; then
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
+ RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
+ done
+ else
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
+ fi
+else
+ RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
+fi
if test x"$enable_pthread" = xyes; then
- for pthread_lib in pthread pthreads c c_r; do
- AC_CHECK_LIB($pthread_lib, pthread_kill,
+ for pthread_lib in thr pthread pthreads c c_r root; do
+ AC_CHECK_LIB($pthread_lib, pthread_kill,
rb_with_pthread=yes, rb_with_pthread=no)
if test "$rb_with_pthread" = "yes"; then break; fi
done
@@ -1017,89 +2686,197 @@ if test x"$enable_pthread" = xyes; then
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(HAVE_LIBPTHREAD)
- case $pthread_lib in
- c)
- ;;
- c_r)
- MAINLIBS="-pthread $MAINLIBS"
- ;;
- *)
- LIBS="-l$pthread_lib $LIBS"
- ;;
- esac
+ AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
+ AS_CASE([$pthread_lib],
+ [c], [],
+ [root], [],
+ [c_r], [MAINLIBS="-pthread $MAINLIBS"],
+ [AS_CASE(["$target_os"],
+ [openbsd*|mirbsd*], [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_CHECK_FUNCS(nanosleep)
- if test x"$ac_cv_func_nanosleep" = xno; then
- AC_CHECK_LIB(rt, nanosleep)
- if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
- AC_DEFINE(HAVE_NANOSLEEP)
- 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_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)
+ AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
+ if test "${host_os}" = "nacl"; then
+ ac_cv_func_pthread_attr_init=no
+ else
+ AC_CHECK_FUNCS(pthread_attr_init)
+ fi
+ 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
+ AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), pthread_setname_np${rb_cv_func_pthread_setname_np_arguments})
+ else
+ AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), (void)0)
+ fi
fi
fi
if test x"$ac_cv_header_ucontext_h" = xyes; then
+ AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
+ [AC_TRY_COMPILE([@%:@include <ucontext.h>
+ 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"$rb_with_pthread" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
fi
fi
-dnl default value for $KANJI
-DEFAULT_KCODE="KCODE_NONE"
+if test "$ac_cv_func_fork_works" = "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>
+#include <unistd.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
-AC_ARG_WITH(default-kcode,
- [ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
- [case $withval in
- utf8) DEFAULT_KCODE="KCODE_UTF8";;
- euc) DEFAULT_KCODE="KCODE_EUC";;
- sjis) DEFAULT_KCODE="KCODE_SJIS";;
- none) DEFAULT_KCODE="KCODE_NONE";;
- *) AC_MSG_WARN($withval is not valid kcode; ignored);;
- esac])
-AC_DEFINE_UNQUOTED(DEFAULT_KCODE, $DEFAULT_KCODE)
+void *
+thread_func(void *dmy)
+{
+ return dmy;
+}
+
+int
+use_threads(void)
+{
+ pthread_t tid;
+ if (pthread_create(&tid, 0, thread_func, 0) != 0) {
+ return -1;
+ }
+ if (pthread_join(tid, 0) != 0) {
+ return -1;
+ }
+ return 0;
+}
+
+int
+main(int argc, char *argv[])
+{
+ pid_t pid;
+ if (use_threads()) return EXIT_FAILURE;
+ pid = fork();
+
+ if (pid) {
+ int loc;
+ sleep(1);
+ if (waitpid(pid, &loc, WNOHANG) == 0) {
+ kill(pid, SIGKILL);
+ return EXIT_FAILURE;
+ }
+ if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
+ return EXIT_FAILURE;
+ }
+ else {
+ if (use_threads()) return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}],
+ rb_cv_fork_with_pthread=yes,
+ rb_cv_fork_with_pthread=no,
+ rb_cv_fork_with_pthread=yes)])
+ test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
+fi
+
+
+}
+{ # runtime section
dnl wheather use dln_a_out or not
-AC_ARG_WITH(dln-a-out,
- [ --with-dln-a-out use dln_a_out if possible], [
- case $withval in
- yes) with_dln_a_out=yes;;
- *) with_dln_a_out=no;;
- esac], [with_dln_a_out=no])
+AC_ARG_WITH(dln-a-out,
+ AS_HELP_STRING([--with-dln-a-out], [use dln_a_out if possible]),
+ [
+ AS_CASE([$withval],
+ [yes], [
+ if test "$enable_shared" = yes; then
+ AC_MSG_ERROR(dln_a_out can not make shared library)
+ fi
+ with_dln_a_out=yes],
+ [
+ with_dln_a_out=no])], [with_dln_a_out=no])
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
-[AC_TRY_RUN([
-/* Test for whether ELF binaries are produced */
-#include <fcntl.h>
-#include <stdlib.h>
-main() {
- char buffer[4];
- int i=open("conftest",O_RDONLY);
- if(i==-1)
- exit(1); /* fail */
- if(read(i,&buffer[0],4)<4)
- exit(1); /* fail */
- if(buffer[0] != 127 || buffer[1] != 'E' ||
- buffer[2] != 'L' || buffer[3] != 'F')
- exit(1); /* fail */
- exit(0); /* succeed (yes, it's ELF) */
-}
-],
-rb_cv_binary_elf=yes,
-rb_cv_binary_elf=no,
-rb_cv_binary_elf=yes)])
+[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])],
+rb_cv_binary_elf=no)])
if test "$rb_cv_binary_elf" = yes; then
AC_DEFINE(USE_ELF)
+ if test "$with_dln_a_out" = yes; then
+ AC_MSG_ERROR(dln_a_out does not work with ELF)
+ fi
+ AC_CHECK_HEADERS([elf.h elf_abi.h])
+ if test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes; then
+ AC_LIBOBJ([addr2line])
+ fi
fi
-case "$target_os" in
-linux* | gnu* | k*bsd*-gnu | bsdi*)
+AS_CASE(["$target_os"],
+[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu | nacl], [
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
else
LDFLAGS="$LDFLAGS -rdynamic"
- fi;;
-esac
+ fi])
LIBEXT=a
AC_SUBST(DLDFLAGS)dnl
@@ -1108,169 +2885,329 @@ AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(STATIC)dnl
AC_SUBST(CCDLFLAGS)dnl
AC_SUBST(LDSHARED)dnl
+AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
+AC_SUBST(ASMEXT, S)dnl
STATIC=
-: ${LIBPATHFLAG=' -L%s'}
: ${PATHFLAG=''}
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
AC_MSG_CHECKING(whether OS depend dynamic link works)
if test "$GCC" = yes; then
- case "$target_os" in
- nextstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- openstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- rhapsody*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- darwin*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
- human*|bsdi*|beos*|cygwin*|mingw*|aix*|interix*) ;;
- *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
- esac
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ # The -fno-common is needed if we wish to embed the Ruby interpreter
+ # into a plugin module of some project (as opposed to embedding it
+ # within the project's application). The -I/usr/local/include is
+ # needed because CPP as discovered by configure (cc -E -traditional)
+ # fails to consult /usr/local/include by default. This causes
+ # 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*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
+ [
+ RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
else
- case "$target_os" in
- hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
- solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
- esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
- *) : ${CCDLFLAGS=""} ;;
- esac
+ AS_CASE(["$target_os"],
+ [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"],
+ [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
+ [esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [: ${CCDLFLAGS=""}])
fi
AC_ARG_ENABLE(rpath,
- [ --disable-rpath embed run path into extension libraries.],
+ 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
- LIBPATHFLAG=" -L%1\$-s"
- RPATHFLAG=" ${linker_flag}-R%1\$-s"
- fi
- case "$target_os" in
- hpux*) DLDFLAGS="$DLDFLAGS -E"
- : ${LDSHARED='ld -b'}
+ AS_CASE(["$target_os"],
+ [hpux*], [ DLDFLAGS="$DLDFLAGS -E"
+ : ${LDSHARED='$(LD) -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
if test "$rb_cv_prog_gnu_ld" = no; then
RPATHFLAG=' +b %1$-s'
fi
- rb_cv_dlopen=yes;;
- solaris*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- if test "$rb_cv_prog_gnu_ld" = yes; then
- LDFLAGS="$LDFLAGS -Wl,-E"
- fi
+ rb_cv_dlopen=yes],
+ [solaris*], [ if test "$GCC" = yes; then
+ : ${LDSHARED='$(CC) -shared'}
+ if test "$rb_cv_prog_gnu_ld" = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ fi
else
- : ${LDSHARED='ld -G'}
+ : ${LDSHARED='$(CC) -G'}
+ fi
+ if test "$ac_cv_sizeof_voidp" = 8; then
+ : ${LIBPATHENV=LD_LIBRARY_PATH_64}
fi
- rb_cv_dlopen=yes;;
- sunos*) : ${LDSHARED='ld -assert nodefinitions'}
- rb_cv_dlopen=yes;;
- irix*) : ${LDSHARED='ld -shared'}
- rb_cv_dlopen=yes;;
- sysv4*) : ${LDSHARED='ld -G'}
- rb_cv_dlopen=yes;;
- nto-qnx*) : ${LDSHARED="qcc -shared"}
- rb_cv_dlopen=yes ;;
- esix*|uxpds*) : ${LDSHARED="ld -G"}
- rb_cv_dlopen=yes ;;
- osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
- rb_cv_dlopen=yes ;;
- bsdi3*) case "$CC" in
- *shlicc*) : ${LDSHARED="$CC -r"}
- rb_cv_dlopen=yes ;;
- esac ;;
- linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
- : ${LDSHARED='${CC} -shared'}
+ rb_cv_dlopen=yes],
+ [sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
+ rb_cv_dlopen=yes],
+ [irix*], [ : ${LDSHARED='$(LD) -shared'}
+ rb_cv_dlopen=yes],
+ [sysv4*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
+ rb_cv_dlopen=yes],
+ [esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
+ rb_cv_dlopen=yes],
+ [bsdi3*], [ AS_CASE(["$CC"],
+ [*shlicc*], [ : ${LDSHARED='$(CC) -r'}
+ rb_cv_dlopen=yes])],
+ [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"
fi
- rb_cv_dlopen=yes ;;
- interix*) : ${LDSHARED="$CC -shared"}
+ rb_cv_dlopen=yes],
+ [interix*], [ : ${LDSHARED='$(CC) -shared'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
LIBPATHFLAG=" -L%1\$-s"
- rb_cv_dlopen=yes ;;
- freebsd*|dragonfly*) : ${LDSHARED="$CC -shared"}
+ rb_cv_dlopen=yes],
+ [freebsd*|dragonfly*], [
+ : ${LDSHARED='$(CC) -shared'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
+ DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
else
- test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
+ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
fi
- rb_cv_dlopen=yes ;;
- openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
+ rb_cv_dlopen=yes],
+ [openbsd*|mirbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
- rb_cv_dlopen=yes ;;
- nextstep*) : ${LDSHARED='cc -r -nostdlib'}
- LDFLAGS="$LDFLAGS -u libsys_s"
- rb_cv_dlopen=yes ;;
- openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes ;;
- darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
+ rb_cv_dlopen=yes],
+ [darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
- rb_cv_dlopen=yes ;;
- aix*) if test "$GCC" = yes; then
- : ${LDSHARED='$(CC) -shared'}
- else
- : ${LDSHARED='$(CC)'}
+ # /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"
- DLDFLAGS='-eInit_$(TARGET)'
- XLDFLAGS="${linker_flag}-bE:ruby.imp ${linker_flag}-brtl"
- : ${ARCHFILE="ruby.imp"}
+ EXTDLDFLAGS='-e$(TARGET_ENTRY)'
+ XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
+ XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
+ : ${ARCHFILE="ruby.imp"}
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=SHLIB_PATH}
- rb_cv_dlopen=yes ;;
- human*) : ${DLDFLAGS=''}
- : ${LDSHARED=''}
- : ${LDFLAGS=''}
- : ${LINK_SO='ar cru $@ $(OBJS)'}
- rb_cv_dlopen=yes ;;
- beos*) case "$target_cpu" in
- powerpc*)
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- i586*)
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
- ;;
- esac
+ : ${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 ;;
- nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- : ${LDSHARED='ld -Bshareable -x'}
+ 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='$(CC) -shared'}
+ ])
+ : ${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"
- rb_cv_dlopen=yes;;
- cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
- XLDFLAGS="$XLDFLAGS -Wl,--stack,0x02000000"
- DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
+ rb_cv_dlopen=yes],
+ [cygwin*|mingw*], [
+ : ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'}
+ XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
- rb_cv_dlopen=yes ;;
- hiuxmpp) : ${LDSHARED='ld -r'} ;;
- atheos*) : ${LDSHARED="$CC -shared"}
- rb_cv_dlopen=yes ;;
- os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
- ;;
- *) : ${LDSHARED='ld'} ;;
- esac
+ 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)'}])
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}"],
+ [*'$(CC)'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
+ ],
+ [*'${CC}'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
+ ],
+ [*$CC*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
+ ],
+ [ld" "*], [
+ ])
fi
+AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
+
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
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' ' '`
+ test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
+ LDFLAGS="$LDFLAGS$val"
+ test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
+ DLDFLAGS="$DLDFLAGS$val"
+ LDFLAGS_OPTDIR="$val"
+fi
+
+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])
+ 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)
+AS_IF([test x$with_valgrind != xno],
+ [AC_CHECK_HEADERS(valgrind/memcheck.h)])
+
dln_a_out_works=no
if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
@@ -1280,7 +3217,7 @@ if test "$ac_cv_header_a_out_h" = yes; then
#define USE_DLN_A_OUT
#include "dln.c"
],
- [],
+ [],
rb_cv_dln_a_out=yes,
rb_cv_dln_a_out=no)])
if test "$rb_cv_dln_a_out" = yes; then
@@ -1299,139 +3236,171 @@ if test "$dln_a_out_works" = yes; then
DLEXT=so
CCDLFLAGS=
else
- case "$target_os" in
- hpux*) DLEXT=sl;;
- nextstep*|openstep*|rhapsody*|darwin*)
- DLEXT=bundle;;
- os2-emx*) DLEXT=dll;;
- cygwin*|mingw*)
- DLEXT=so DLEXT2=dll;;
- *) DLEXT=so;;
- esac
+ AS_CASE(["$target_os"],
+ [hpux*], [
+ DLEXT=sl],
+ [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],
+ [
+ DLEXT=so])
fi
+if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
+ if test "$ac_cv_func_dladdr" = yes; then
+ LOAD_RELATIVE=1
+ fi
+fi
+if test x"$LOAD_RELATIVE" = x1; then
+ load_relative=yes
+else
+ unset load_relative
+fi
+
len=2 # .rb
n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
+AC_SUBST(DLEXT)
-AC_SUBST(STRIP)dnl
if test "$with_dln_a_out" = yes; then
STRIP=true
else
- STRIP=strip
-fi
-
-case "$target_os" in
- linux* | gnu* | k*bsd*-gnu)
- STRIP='strip -S -x';;
- nextstep*)
- STRIP='strip -A -n';;
- openstep*)
- STRIP='strip -A -n';;
- rhapsody*)
- STRIP='strip -A -n';;
- darwin*)
- STRIP='strip -A -n';;
-esac
+ AC_CHECK_TOOL(STRIP, strip, :)dnl
+fi
+
+AS_CASE(["$target_os"],
+ [linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
+ STRIP="$STRIP -S -x"],
+ [darwin*], [
+ STRIP="$STRIP -A -n"])
+AC_ARG_WITH(ext,
+ AC_HELP_STRING([--with-ext=EXTS],
+ [pass to --with-ext option of extmk.rb]))
+AC_ARG_WITH(out-ext,
+ AC_HELP_STRING([--with-out-ext=EXTS],
+ [pass to --without-ext option of extmk.rb]))
EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
- [ --with-static-linked-ext link external modules statically],
- [case $withval in
- yes) STATIC=
- EXTSTATIC=static;;
- *) ;;
- esac])
-
-case "$target_os" in
- human*)
- AC_CHECK_LIB(signal, _harderr)
- AC_CHECK_LIB(hmem, hmemset)
- AC_CHECK_FUNCS(select)
- AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
- rb_cv_missing__dtos18,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%g", 1e+300);
- exit (strcmp (buf, "1e+300") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
- if test "$rb_cv_missing__dtos18" = yes; then
- AC_DEFINE(MISSING__DTOS18)
- fi
- AC_CACHE_CHECK(whether PD libc fconvert fail to round,
- rb_cv_missing_fconvert,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-#include <stdio.h>
-#include <math.h>
-main ()
-{
- char buf[256];
- sprintf (buf, "%f", log(exp(1.0)));
- exit (strcmp (buf, "1.000000") ? 0 : 1);
-}
->>,
-changequote([, ])dnl
-rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
- if test "$rb_cv_missing_fconvert" = yes; then
- AC_DEFINE(MISSING_FCONVERT)
- fi
- AC_LIBOBJ([x68.o])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
- OBJEXT=o
- setup=Setup.x68
- ;;
- dnl OS/2 environment w/ Autoconf 2.1x for EMX
- os2-emx)
- AC_LIBOBJ([os2])
- setup=Setup.emx
- ;;
- *djgpp*)
- setup=Setup.dj
- ;;
- *)
- setup=Setup
- ;;
-esac
+ 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,*], [
+ 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)'
+])
+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)
-if test "$prefix" = NONE; then
- prefix=$ac_default_prefix
-fi
+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)
-#if test "$fat_binary" != no ; then
-# CFLAGS="$CFLAGS $ARCH_FLAG"
-#fi
+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
+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
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
- PREP=fake.rb
- RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
+ XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
+ XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
+ XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
+ AC_SUBST(XRUBY_LIBDIR)
+ AC_SUBST(XRUBY_RUBYLIBDIR)
+ AC_SUBST(XRUBY_RUBYHDRDIR)
+ PREP='$(arch)-fake.rb'
+ RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
+ RUNRUBY='$(RUNRUBY_COMMAND)'
+ XRUBY='$(MINIRUBY)'
+ TEST_RUNNABLE=no
+ CROSS_COMPILING=yes
+
+ if test "$host_os" = "nacl"; then
+ if test "$build_cpu" = "$host_cpu" || test "${nacl_cv_cpu_nick}" = "x86" -a "$host_cpu" = "i686"; then
+ nacl_cv_sel_ldr='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb sel_ldr`'
+ nacl_cv_irt_core='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb irt_core`'
+ nacl_cv_runnable_ld='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb runnable_ld`'
+ nacl_cv_host_lib='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb host_lib`'
+ TEST_RUNNABLE=yes
+ BTESTRUBY="${nacl_cv_sel_ldr} -a -B ${nacl_cv_irt_core} -w 1:3 -w 2:4"
+ BTESTRUBY="$BTESTRUBY -- ${nacl_cv_runnable_ld} --library-path ${nacl_cv_host_lib}"
+ BTESTRUBY="$BTESTRUBY `pwd`/"'miniruby$(EXEEXT) -I`cd $(srcdir)/lib; pwd` -I.'
+ BTESTRUBY="$BTESTRUBY"' -I$(EXTOUT)/common 3>&1 4>&2 1>/dev/null 2>/dev/null '
+ fi
+ fi
else
- MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib'
- MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common -I./- -r$(srcdir)/ext/purelib.rb'
+ MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
+ MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
PREP='miniruby$(EXEEXT)'
- RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT)'
+ RUNRUBY_COMMAND='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
+ RUNRUBY='$(RUNRUBY_COMMAND) --'
+ XRUBY='$(RUNRUBY)'
+ TEST_RUNNABLE=yes
+ CROSS_COMPILING=no
fi
+AC_SUBST(TEST_RUNNABLE)
+AC_SUBST(CROSS_COMPILING)
AC_SUBST(MINIRUBY)
+AC_SUBST(BTESTRUBY)
AC_SUBST(PREP)
+AC_SUBST(RUNRUBY_COMMAND)
AC_SUBST(RUNRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
+AC_SUBST(XRUBY)
+AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
@@ -1440,16 +3409,30 @@ LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
-case "$target_os" in
- cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
: ${DLDLIBS=""}
- ;;
- *)
+ ],
+ [
DLDLIBS="$DLDLIBS -lc"
- ;;
-esac
+ ])
+
+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)'])
-RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
@@ -1457,214 +3440,534 @@ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
ENABLE_SHARED=no
AC_ARG_ENABLE(shared,
- [ --enable-shared build a shared library for Ruby. ],
+ AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
-if test "$enable_shared" = 'yes'; then
+libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
+LIBRUBY_RELATIVE=${load_relative-no}
+AS_CASE("$enable_shared", [yes], [
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
- CFLAGS="$CFLAGS $CCDLFLAGS"
+ LIBRUBY_RELATIVE=no
+ test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
ENABLE_SHARED=yes
if test "$rb_cv_binary_elf" = yes; then
SOLIBS='$(LIBS)'
fi
- case "$target_os" in
- sunos4*)
+
+ # libdir can be overridden in config.site file (on OpenSUSE at least).
+ libdir_basename=lib
+ if test "$bindir" = '${exec_prefix}/bin'; then
+ 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*], [],
+ [
+ if test "$GCC" = yes; then
+ RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
+ if test "no_undefined" = yes; then
+ RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
+ fi
+ fi
+ ])
+
+ AS_CASE(["$target_os"],
+ [sunos4*], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- linux* | gnu* | k*bsd*-gnu | atheos*)
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
+ ],
+ [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'" $LDFLAGS_OPTDIR"
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
- ;;
- freebsd*|dragonfly*)
+ if test "$load_relative" = yes; then
+ libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
+ LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
+ LIBRUBY_RELATIVE=yes
+ fi
+ ],
+ [freebsd*|dragonfly*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
if test "$rb_cv_binary_elf" != "yes" ; then
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
fi
- ;;
- netbsd*)
+ ],
+ [netbsd*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
- LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'" $LDFLAGS_OPTDIR"
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*)
+ ],
+ [openbsd*|mirbsd*], [
SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
- ;;
- solaris*)
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
+ ],
+ [solaris*], [
SOLIBS='$(LIBS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
if test "$GCC" = yes; then
LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
+ else
+ LIBRUBY_DLDFLAGS="$DLDFLAGS "'-h $(@F)'
fi
XLDFLAGS="$XLDFLAGS "'-R${libdir}'
- ;;
- hpux*)
+ ],
+ [hpux*], [
XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
- ;;
- aix*)
- LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
+ ],
+ [aix*], [
+ LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS $LDFLAGS_OPTDIR"
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
SOLIBS='-lm -lc'
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
- LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
- ;;
- esac
- ;;
- darwin*)
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
- LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
- LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
- LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
- ;;
- interix*)
+ ],
+ [beos*], [
+ AS_CASE(["$target_cpu"],
+ [powerpc*], [
+ LIBRUBY_DLDFLAGS="-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o $LDFLAGS_OPTDIR"
+ ])
+ ],
+ [darwin*], [
+ RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
+ LIBRUBY_LDSHARED='$(CC) -dynamiclib'
+ if test "$load_relative" = yes; then
+ libprefix="@executable_path/../${libdir_basename}"
+ LIBRUBY_RELATIVE=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_version)'
+ if test "$visibility_option" = ld; then
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+ 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)'
- ;;
- *)
- ;;
- esac
-fi
+ ],
+ [mingw*|cygwin*|mswin*], [
+ LIBRUBY_RELATIVE=yes
+ ])
+], [
+ LIBRUBYARG_SHARED=
+
+ # enable PIE if possible
+ AC_ARG_ENABLE(pie,
+ AS_HELP_STRING([--disable-pie], [disable PIE feature]),
+ [pie=$enableval], [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
+ ])
+ if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
+ RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
+ if test "$pie" = yes; then
+ # Use -fPIE when testing -pie. RUBY_TRY_LDFLAGS sets
+ # $save_CFLAGS internally, so set other name here.
+ save_CFLAGS_before_pie="$CFLAGS"
+ CFLAGS="$CFLAGS -fPIE"
+
+ # gcc need -pie but clang need -Wl,-pie.
+ for pie in -pie -Wl,-pie; do
+ RUBY_TRY_LDFLAGS([$pie], [], [pie=])
+ if test "x$pie" != x; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
+ RUBY_APPEND_OPTION(XLDFLAGS, $pie)
+ break
+ fi
+ done
+ CFLAGS="$save_CFLAGS_before_pie"
+ fi
+ fi
+])
if test "$enable_rpath" = yes; then
- LIBRUBYARG_SHARED="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir) $LIBRUBYARG_SHARED"
+ 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}"
+ LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
+ LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi
+AC_SUBST(LIBRUBY_RELATIVE)
LDFLAGS="-L. $LDFLAGS"
AC_SUBST(ARCHFILE)
+if test "$EXEEXT" = .exe; then
+ EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
+ AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
+ EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
+ AC_SUBST(EXECUTABLE_EXTS)
+fi
+
+AC_ARG_ENABLE(dtrace,
+ AS_HELP_STRING([--enable-dtrace],
+ [enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
+ [enable_dtrace=$enableval], [enable_dtrace=auto])
+
+if test "${enable_dtrace}" = "auto"; then
+ if test x"$DTRACE" != x -a x"$cross_compiling" != xyes; then
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ else
+ enable_dtrace=no
+ fi
+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])
+ elif test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
+ else
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ if test "${enable_dtrace}" = "no"; then
+ AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
+ fi
+ RUBY_DTRACE_POSTPROCESS()
+ if test "$rb_cv_prog_dtrace_g" != 'no'; then
+ DTRACE_OBJ='probes.$(OBJEXT)'
+ fi
+ if test "$rb_cv_prog_dtrace_g" = 'rebuild'; then
+ DTRACE_REBUILD=yes
+ LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
+ fi
+ AS_CASE("${target_os}", [freebsd*], [
+ # FreeBSD's dtrace requires libelf
+ LIBS="-lelf $LIBS"
+ ])
+ fi
+ DTRACE_EXT=d
+else
+ DTRACE_EXT=dmyh
+fi
+AC_SUBST(DTRACE_EXT)
+AC_SUBST(DTRACE_OBJ)
+AC_SUBST(DTRACE_REBUILD)
+AC_SUBST(LIBRUBY_A_OBJS)
+
+RUBY_SETJMP_TYPE
+}
+{ # build section
+
dnl build rdoc index if requested
RDOCTARGET=""
+CAPITARGET=""
AC_ARG_ENABLE(install-doc,
- [ --enable-install-doc build and install rdoc indexes during install ],
- [install_doc=$enableval], [install_doc=no])
+ 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])
+
if test "$install_doc" != no; then
- RDOCTARGET="install-doc"
+ if test "$install_rdoc" != no; then
+ RDOCTARGET="rdoc"
+ else
+ RDOCTARGET="nodoc"
+ fi
+ if test "$install_capi" != no -a -n "$DOXYGEN"; then
+ CAPITARGET="capi"
+ else
+ CAPITARGET="nodoc"
+ fi
+else
+ RDOCTARGET="nodoc"
+ CAPITARGET="nodoc"
fi
+
AC_SUBST(RDOCTARGET)
+AC_SUBST(CAPITARGET)
+
+AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
+AC_SUBST(INSTALLDOC)
+
+if test "$rb_with_pthread" = "yes"; then
+ THREAD_MODEL=pthread
+fi
+AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
+ AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [
+ rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
+ sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
+ ],
+ [rb_cv_symbol_prefix=''])
+ test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
+])
+SYMBOL_PREFIX="$rb_cv_symbol_prefix"
+test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
+DLNOBJ=dln.o
+AC_ARG_ENABLE(dln,
+ AC_HELP_STRING([--disable-dln], [disable dynamic link feature]),
+ [test "$enableval" = yes || DLNOBJ=dmydln.o])
+AC_SUBST(DLNOBJ)
+MINIDLNOBJ=dmydln.o
-case "$target_os" in
- linux*)
- XCFLAGS="$XCFLAGS -D_GNU_SOURCE=1"
- ;;
- netbsd*)
- CFLAGS="$CFLAGS -pipe"
- ;;
- nextstep*|openstep*)
- # The -fno-common is needed if we wish to embed the Ruby interpreter
- # into a plugin module of some project (as opposed to embedding it
- # within the project's application). The -I/usr/local/include is
- # needed because CPP as discovered by configure (cc -E -traditional)
- # fails to consult /usr/local/include by default. This causes
- # mkmf.rb's have_header() to fail if the desired resource happens to be
- # installed in the /usr/local tree.
- CFLAGS="$CFLAGS -pipe -fno-common"
- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
- ;;
- rhapsody*)
- CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
- ;;
- darwin*)
- CFLAGS="$CFLAGS -pipe -fno-common"
- MINIOBJS=dmydln.o
- ;;
- os2-emx)
- CFLAGS="$CFLAGS -DOS2 -Zmts"
+AS_CASE(["$target_os"],
+ [linux*], [
+ ],
+ [netbsd*], [
+ RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ ],
+ [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*)
+ ],
+ [osf*], [
if test "$GCC" != "yes" ; then
# compile something small: taint.c is fine for this.
# the main point is the '-v' flag of 'cc'.
- case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
- */gemc_cc*) # we have the new DEC GEM CC
+ AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
+ [*/gemc_cc*], [ # we have the new DEC GEM CC
CFLAGS="$CFLAGS -oldc"
- ;;
- *) # we have the old MIPS CC
- ;;
- esac
+ ],
+ [ # we have the old MIPS CC
+ ])
# cleanup
rm -f /tmp/main.o
CFLAGS="$CFLAGS -std"
fi
- ;;
- beos*)
- case "$target_cpu" in
- powerpc*)
- CFLAGS="$CFLAGS -relax_pointers"
- ;;
- esac
- ;;
- cygwin*|mingw*)
- case "$target_os" in
- cygwin*)
+ ],
+ [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)'
+ AS_CASE(["$target_os"],
+ [cygwin*], [
if test x"$enable_shared" = xyes; then
- LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}.dll
- LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
+ LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ fi
+ ],
+ [mingw*], [
+ RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
+ if test x"${target_cpu}" != xi386; then
+ RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
fi
- ;;
- mingw*)
- RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
if test x"$enable_shared" = xyes; then
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
- LIBRUBY='lib$(LIBRUBY_SO).a'
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
fi
- AC_LIBOBJ([win32])
+ EXPORT_PREFIX=' '
+ DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
+ AC_LIBOBJ([win32/win32])
+ AC_LIBOBJ([win32/file])
COMMON_LIBS=m
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="windows.h winsock.h"
- ;;
- esac
- LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
+ COMMON_HEADERS="winsock2.h windows.h"
+ THREAD_MODEL=win32
+ PLATFORM_DIR=win32
+ ])
LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
SOLIBS='$(LIBS)'
- if test x"$enable_shared" = xno; then
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
+ else
LIBRUBY_SO=dummy
LIBRUBY='lib$(RUBY_SO_NAME).a'
LIBRUBYARG='-l$(RUBY_SO_NAME)'
fi
- MINIOBJS=dmydln.o
- ;;
- hpux*)
- case "$YACC" in
- *yacc*)
+ ],
+ [hpux*], [
+ AS_CASE(["$YACC"],[*yacc*], [
XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
YACC="$YACC -Nl40000 -Nm40000"
- ;;
- esac
- MINIOBJS=dmydln.o
- ;;
- *)
- ;;
-esac
-
-case "$build_os" in
- *msdosdjgpp*) FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in;;
-esac
+ ])],
+ [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"],
+[pthread], [AC_CHECK_HEADERS(pthread.h)],
+[win32], [],
+[""], [AC_MSG_ERROR(thread model is missing)],
+ [AC_MSG_ERROR(unknown thread model $THREAD_MODEL)])
+
+AC_ARG_ENABLE(debug-env,
+ AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
+ [AC_DEFINE(RUBY_DEBUG_ENV)])
+
+AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
+ AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
+ mkdir conftest.dir
+ echo "all:; @echo yes" > conftest.dir/GNUmakefile
+ echo "all:; @echo no" > conftest.dir/Makefile
+ gnumake=`(cd conftest.dir; ${MAKE-make})`
+ rm -fr conftest.dir
+ AS_CASE(["$gnumake"],
+ [*yes*], [
+ FIRSTMAKEFILE=GNUmakefile:template/GNUmakefile.in
+ gnumake=yes],
+ [
+ gnumake=no])
+ AC_MSG_RESULT($gnumake)
+])
+AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
+ AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
+ mkdir conftest.dir
+ NULLCMD=
+ for cmd in : true; do
+ echo 'A=1' > conftest.dir/Makefile
+ echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
+ echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
+ if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
+ NULLCMD=$cmd
+ break
+ fi
+ done
+ rm -fr conftest.dir
+ if test -z "$NULLCMD"; then
+ AC_MSG_ERROR(no candidate for safe null command)
+ fi
+ AC_MSG_RESULT($NULLCMD)
+])
+AC_SUBST(NULLCMD)
+
+if test "${universal_binary-no}" = yes ; then
+ AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
+ mv confdefs.h confdefs1.h
+ : > confdefs.h
+ AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} |
+ sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
+@%:@else
+@%:@error
+>>>>>><<<<<<
+@%:@endif], [],
+[
+ rb_cv_architecture_macros=yes
+ mv -f confdefs1.h confdefs.h
+], [
+ rb_cv_architecture_macros=no
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ for archs in ${universal_archnames}; do
+ cpu=${archs@%:@*=}
+ archs=${archs%=*}
+ CFLAGS="$new_cflags -arch $archs"
+ archs="__${archs}__"
+ AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
+ AC_TRY_COMPILE([@%:@ifndef ${archs}
+@%:@error
+@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ done
+ 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
+
+if test "$ac_cv_func_memmem" = yes; then
+ 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)
+ ])
+ test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no
+fi
+
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
-test -z "$CFLAGS" || CFLAGS="$CFLAGS "; CFLAGS="$CFLAGS"'${cflags}'
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
-AC_SUBST(cppflags, [])dnl
-AC_SUBST(cflags, ['${optflags} ${debugflags}'])dnl
+if test -n "${cflags+set}"; then
+ cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
+fi
+if test -n "${cxxflags+set}"; then
+ cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
+fi
+if test "${ARCH_FLAG}"; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
+ LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
+fi
+warnflags="$rb_cv_warnflags"
+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
AC_SUBST(debugflags)dnl
+AC_SUBST(warnflags)dnl
+AC_SUBST(strict_warnflags)dnl
AC_SUBST(XCFLAGS)dnl
AC_SUBST(XLDFLAGS)dnl
+AC_SUBST(EXTLDFLAGS)dnl
+AC_SUBST(EXTDLDFLAGS)dnl
AC_SUBST(LIBRUBY_LDSHARED)
AC_SUBST(LIBRUBY_DLDFLAGS)
AC_SUBST(RUBY_INSTALL_NAME)
@@ -1686,9 +3989,14 @@ AC_SUBST(COMMON_LIBS)
AC_SUBST(COMMON_MACROS)
AC_SUBST(COMMON_HEADERS)
AC_SUBST(EXPORT_PREFIX)
+AC_SUBST(SYMBOL_PREFIX)
AC_SUBST(MINIOBJS)
+AC_SUBST(THREAD_MODEL)
+AC_SUBST(PLATFORM_DIR)
-MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
+firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
+firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
+MAKEFILES="Makefile $firstmf"
MAKEFILES="`echo $MAKEFILES`"
AC_SUBST(MAKEFILES)
@@ -1700,111 +4008,202 @@ ri_suffix=
test "$program_suffix" != NONE &&
ri_suffix=$program_suffix
-RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
-case "$target_os" in
- cygwin*|mingw*)
- RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
- rubyw_install_name="$RUBYW_INSTALL_NAME"
- ;;
-esac
-RUBY_LIB_PREFIX=`eval echo \\"${libdir}/ruby\\"`
+RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*], [
+ RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
+ 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)
+
+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])
+AC_SUBST(ridir)
+AC_SUBST(RI_BASE_NAME)
+
+AC_ARG_WITH(ruby-version,
+ AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
+ [ruby_version=$withval],
+ [ruby_version=full])
+unset RUBY_LIB_VERSION
+unset RUBY_LIB_VERSION_STYLE
+AS_CASE(["$ruby_version"],
+ [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
+ [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
+if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ {
+ echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
+ echo '#define STRINGIZE(x) x'
+ test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
+ echo '#include "verconf.h"'
+ echo '#include "version.h"'
+ echo 'ruby_version=RUBY_LIB_VERSION'
+ } > conftest.c
+ 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}"
+fi
+AC_SUBST(RUBY_LIB_VERSION_STYLE)
+AC_SUBST(RUBY_LIB_VERSION)
AC_ARG_WITH(sitedir,
- [ --with-sitedir=DIR site libraries in DIR [[LIBDIR/ruby/site_ruby]]],
+ AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
[sitedir=$withval],
- [sitedir='${libdir}/ruby/site_ruby'])
-SITE_DIR=`eval echo \\"${sitedir}\\"`
-
-case "$target_os" in
- cygwin*|mingw*|*djgpp*|os2-emx*)
- 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_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- ;;
-esac
-RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
-RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
-
-AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
+ [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}'}])
AC_ARG_WITH(vendordir,
- [ --with-vendordir=DIR vendor libraries in DIR [[LIBDIR/ruby/vendor_ruby]]],
+ AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
[vendordir=$withval],
- [vendordir='${libdir}/ruby/vendor_ruby'])
-VENDOR_DIR=`eval echo \\"${vendordir}\\"`
-case "$target_os" in
- cygwin*|mingw*|*djgpp*|os2-emx*)
- RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
- ;;
- *)
- RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
- ;;
-esac
-RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
-
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
+ [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}'}])
+if test "${LOAD_RELATIVE+set}"; then
+ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+ RUBY_EXEC_PREFIX=''
+fi
+
+AC_SUBST(RUBY_EXEC_PREFIX)
+
+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
-configure_args=$ac_configure_args
-AC_SUBST(configure_args)dnl
-
-if test "$fat_binary" != no ; then
- arch="fat-${target_os}"
+AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
- AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-
- AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
- "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
- "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
+if test "${universal_binary-no}" = yes ; then
+ arch="universal-${target_os}"
+ if test "${rb_cv_architecture_available}" = yes; then
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
+ else
+ for archs in ${universal_archnames}; do
+ cpu=`echo $archs | sed 's/.*=//'`
+ archs=`echo $archs | sed 's/=.*//'`
+ RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
+ done
+ fi
+ ints='long int short'
+ 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)
else
arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ AS_CASE(["$arch"], [le32-nacl], [arch="pnacl"])
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
fi
-case "$target_os" in
- mingw*) sitearch="$target_cpu-$rb_cv_msvcrt" ;;
- *) sitearch="${arch}" ;;
-esac
-
-AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
-AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
-AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
+unset sitearch
+AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
+: ${sitearch='${arch}'}
AC_ARG_WITH(search-path,
- [ --with-search-path=DIR specify the additional search path],
+ AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
[search_path=$withval])
if test "$search_path" != ""; then
- AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
+ AC_SUBST(RUBY_SEARCH_PATH, $search_path)
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}'}])
+
+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,
- [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
+ AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
[
- case "$withval" in
- man|doc)
- MANTYPE=$withval
- ;;
- *)
- AC_MSG_ERROR(invalid man type: $withval)
- ;;
- esac
+ AS_CASE(["$withval"],
+ [man|doc], [MANTYPE=$withval],
+ [AC_MSG_ERROR(invalid man type: $withval)])
])
if test -z "$MANTYPE"; then
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
- if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
+ if ${NROFF} -mdoc ${srcdir}/man/ruby.1 >/dev/null 2>&1; then
MANTYPE=doc
else
MANTYPE=man
@@ -1812,21 +4211,130 @@ if test -z "$MANTYPE"; then
fi
AC_SUBST(MANTYPE)
-if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
- echo "config.h unchanged"
+AC_ARG_ENABLE(rubygems,
+ AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
+ [enable_rubygems="$enableval"], [enable_rubygems=yes])
+if test x"$enable_rubygems" = xno; then
+ AC_DEFINE(DISABLE_RUBYGEMS, 1)
+ USE_RUBYGEMS=NO
else
- echo "creating config.h"
- tr -d '\015' < confdefs.h > config.h
+ USE_RUBYGEMS=YES
fi
+AC_SUBST(USE_RUBYGEMS)
+
+arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
+AS_MKDIR_P("${arch_hdrdir}")
+config_h="${arch_hdrdir}/config.h"
+guard=INCLUDE_RUBY_CONFIG_H
+{
+ echo "#ifndef $guard"
+ echo "#define $guard 1"
+ grep -v "^#define PACKAGE_" confdefs.h
+ echo "#endif /* $guard */"
+} | tr -d '\015' |
+${srcdir}/tool/ifchange "${config_h}" -
tr -d '\015' < largefile.h > confdefs.h
rm largefile.h
-AC_CONFIG_FILES($FIRSTMAKEFILE)
-AC_CONFIG_FILES(Makefile, [{
- sed '/^MISSING/s/\$U\././g' Makefile
+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 `basename $e .c`"'.$(OBJEXT)'; done
+AC_SUBST(BUILTIN_ENCOBJS)
+
+BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
+ -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
+ -e '}' "${srcdir}/enc/Makefile.in"`"]
+BUILTIN_TRANSSRCS=
+BUILTIN_TRANSOBJS=
+for e in $BUILTIN_TRANSES; do
+ 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)
+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(Makefile, [
+ tmpmk=confmk$$.tmp
+ {
+ if test ${VCS+set}; then
+ :
+ elif svn info "$srcdir" > /dev/null 2>&1; then
+ VCS='svn'
+ elif test -d "$srcdir/.git/svn"; then
+ VCS='git svn'
+ elif test -d "$srcdir/.git"; then
+ VCS='git'
+ else
+ VCS='echo cannot'
+ fi
+ AS_CASE("$VCS",
+ [svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
+ ["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)'
- test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
- sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
- } >> confmk$$.tmp && mv -f confmk$$.tmp Makefile],
-[RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
+ if test "$gnumake" != yes; then
+ echo ['$(MKFILES): $(srcdir)/common.mk']
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
+ else
+ echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
+ fi
+ } > $tmpmk && if ! grep '^ruby:' $tmpmk > /dev/null; then
+ if test "${gnumake}" = yes; then
+ tmpgmk=confgmk$$.tmp
+ {
+ echo "include $tmpmk"
+ echo "-include uncommon.mk"
+ } > $tmpgmk
+ else
+ tmpgmk=$tmpmk
+ fi &&
+ test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
+ echo 'ruby: $(PROGRAM);' >> $tmpmk
+ test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
+ fi && mv -f $tmpmk Makefile],
+[EXEEXT='$EXEEXT' gnumake='$gnumake'])
+
+AC_ARG_WITH([ruby-pc],
+ 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 &&
+ {
+ test -z "$PKG_CONFIG" ||
+ PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
+ }
+ then
+ mv -f ruby.tmp.pc $ruby_pc
+ else
+ exit 1
+ fi
+ ],
+ [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
+
AC_OUTPUT
+}
+}
diff --git a/constant.h b/constant.h
new file mode 100644
index 0000000000..c7de5da533
--- /dev/null
+++ b/constant.h
@@ -0,0 +1,43 @@
+/**********************************************************************
+
+ constant.h -
+
+ $Author$
+ created at: Sun Nov 15 00:09:33 2009
+
+ Copyright (C) 2009 Yusuke Endoh
+
+**********************************************************************/
+#ifndef CONSTANT_H
+#define CONSTANT_H
+
+typedef enum {
+ CONST_PUBLIC = 0x00,
+ CONST_PRIVATE,
+ CONST_VISIBILITY_MAX
+} rb_const_flag_t;
+
+#define RB_CONST_PRIVATE_P(ce) \
+ ((ce)->flag == CONST_PRIVATE)
+#define RB_CONST_PUBLIC_P(ce) \
+ ((ce)->flag == CONST_PUBLIC)
+
+typedef struct rb_const_entry_struct {
+ rb_const_flag_t flag;
+ 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);
+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);
+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
new file mode 100644
index 0000000000..bfa37d1a87
--- /dev/null
+++ b/cont.c
@@ -0,0 +1,1699 @@
+/**********************************************************************
+
+ cont.c -
+
+ $Author$
+ created at: Thu May 23 09:03:43 2007
+
+ Copyright (C) 2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "internal.h"
+#include "vm_core.h"
+#include "gc.h"
+#include "eval_intern.h"
+
+/* FIBER_USE_NATIVE enables Fiber performance improvement using system
+ * dependent method such as make/setcontext on POSIX system or
+ * CreateFiber() API on Windows.
+ * This hack make Fiber context switch faster (x2 or more).
+ * However, it decrease maximum number of Fiber. For example, on the
+ * 32bit POSIX OS, ten or twenty thousands Fiber can be created.
+ *
+ * Details is reported in the paper "A Fast Fiber Implementation for Ruby 1.9"
+ * 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)
+#define FIBER_USE_NATIVE 0
+#endif
+
+#if FIBER_USE_NATIVE
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/mman.h>
+#include <ucontext.h>
+#endif
+#define RB_PAGE_SIZE (pagesize)
+#define RB_PAGE_MASK (~(RB_PAGE_SIZE - 1))
+static long pagesize;
+#endif /*FIBER_USE_NATIVE*/
+
+#define CAPTURE_JUST_VALID_VM_STACK 1
+
+enum context_type {
+ CONTINUATION_CONTEXT = 0,
+ FIBER_CONTEXT = 1,
+ ROOT_FIBER_CONTEXT = 2
+};
+
+typedef struct rb_context_struct {
+ enum context_type type;
+ int argc;
+ VALUE self;
+ 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;
+#ifdef __ia64
+ VALUE *register_stack;
+ VALUE *register_stack_src;
+ int register_stack_size;
+#endif
+ } machine;
+ rb_thread_t saved_thread; /* selected properties of GET_THREAD() (see cont_save_thread) */
+ rb_jmpbuf_t jmpbuf;
+ rb_ensure_entry_t *ensure_array;
+ rb_ensure_list_t *ensure_list;
+} rb_context_t;
+
+enum fiber_status {
+ CREATED,
+ RUNNING,
+ TERMINATED
+};
+
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+#define MAX_MACHINE_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 terminated_machine_stack;
+#endif
+
+struct rb_fiber_struct {
+ rb_context_t cont;
+ struct rb_fiber_struct *prev;
+ enum fiber_status status;
+ /* If a fiber invokes "transfer",
+ * then this fiber can't "resume" any more after that.
+ * You shouldn't mix "transfer" and "resume".
+ */
+ int transferred;
+
+#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
+};
+
+static const rb_data_type_t cont_data_type, fiber_data_type;
+static VALUE rb_cContinuation;
+static VALUE rb_cFiber;
+static VALUE rb_eFiberError;
+
+#define GetContPtr(obj, ptr) \
+ TypedData_Get_Struct((obj), rb_context_t, &cont_data_type, (ptr))
+
+#define GetFiberPtr(obj, ptr) do {\
+ TypedData_Get_Struct((obj), rb_fiber_t, &fiber_data_type, (ptr)); \
+ if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
+} while (0)
+
+NOINLINE(static VALUE cont_capture(volatile int *stat));
+
+#define THREAD_MUST_BE_RUNNING(th) do { \
+ if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
+ } while (0)
+
+static void
+cont_mark(void *ptr)
+{
+ RUBY_MARK_ENTER("cont");
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ rb_gc_mark(cont->value);
+ rb_thread_mark(&cont->saved_thread);
+ rb_gc_mark(cont->saved_thread.self);
+
+ if (cont->vm_stack) {
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ 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,
+ cont->vm_stack, cont->saved_thread.stack_size);
+#endif
+ }
+
+ if (cont->machine.stack) {
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* cont */
+ 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);
+ }
+ }
+ }
+#ifdef __ia64
+ if (cont->machine.register_stack) {
+ rb_gc_mark_locations(cont->machine.register_stack,
+ cont->machine.register_stack + cont->machine.register_stack_size);
+ }
+#endif
+ }
+ RUBY_MARK_LEAVE("cont");
+}
+
+static void
+cont_free(void *ptr)
+{
+ RUBY_FREE_ENTER("cont");
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ 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);
+ }
+ else {
+ /* fiber */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+#ifdef _WIN32
+ if (GET_THREAD()->fiber != fib && 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 (GET_THREAD()->fiber != fib) {
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->ss_sp) {
+ if (cont->type == ROOT_FIBER_CONTEXT) {
+ rb_bug("Illegal root fiber parameter");
+ }
+ munmap((void*)fib->ss_sp, fib->ss_size);
+ }
+ }
+ else {
+ /* It may reached here when finalize */
+ /* TODO examine whether it is a bug */
+ /* rb_bug("cont_free: release self"); */
+ }
+#endif
+ }
+#else /* not FIBER_USE_NATIVE */
+ ruby_xfree(cont->ensure_array);
+ RUBY_FREE_UNLESS_NULL(cont->machine.stack);
+#endif
+#ifdef __ia64
+ RUBY_FREE_UNLESS_NULL(cont->machine.register_stack);
+#endif
+ RUBY_FREE_UNLESS_NULL(cont->vm_stack);
+
+ /* free rb_cont_t or rb_fiber_t */
+ ruby_xfree(ptr);
+ }
+ RUBY_FREE_LEAVE("cont");
+}
+
+static size_t
+cont_memsize(const void *ptr)
+{
+ const rb_context_t *cont = ptr;
+ size_t size = 0;
+ 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);
+#else
+ size_t n = cont->saved_thread.stack_size;
+#endif
+ size += n * sizeof(*cont->vm_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);
+ }
+#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);
+ cont_mark(&fib->cont);
+ }
+ RUBY_MARK_LEAVE("cont");
+}
+
+static void
+fiber_free(void *ptr)
+{
+ RUBY_FREE_ENTER("fiber");
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ if (fib->cont.type != ROOT_FIBER_CONTEXT &&
+ fib->cont.saved_thread.local_storage) {
+ st_free_table(fib->cont.saved_thread.local_storage);
+ }
+
+ cont_free(&fib->cont);
+ }
+ RUBY_FREE_LEAVE("fiber");
+}
+
+static size_t
+fiber_memsize(const void *ptr)
+{
+ const rb_fiber_t *fib = ptr;
+ size_t size = 0;
+ if (ptr) {
+ 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);
+ }
+ size += cont_memsize(&fib->cont);
+ }
+ return size;
+}
+
+VALUE
+rb_obj_is_fiber(VALUE obj)
+{
+ if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
+ return Qtrue;
+ }
+ else {
+ return Qfalse;
+ }
+}
+
+static void
+cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
+{
+ size_t size;
+
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
+#ifdef __ia64
+ 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;
+ }
+ else {
+ 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);
+ }
+ else {
+ cont->machine.stack = ALLOC_N(VALUE, size);
+ }
+
+ FLUSH_REGISTER_WINDOWS;
+ 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);
+ }
+ else {
+ cont->machine.register_stack = ALLOC_N(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
+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 */
+ /* because it may happen GC afterward */
+ sth->machine.stack_start = 0;
+ sth->machine.stack_end = 0;
+#ifdef __ia64
+ sth->machine.register_stack_start = 0;
+ sth->machine.register_stack_end = 0;
+#endif
+}
+
+static void
+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 *
+cont_new(VALUE klass)
+{
+ rb_context_t *cont;
+ volatile VALUE contval;
+ rb_thread_t *th = GET_THREAD();
+
+ THREAD_MUST_BE_RUNNING(th);
+ contval = TypedData_Make_Struct(klass, rb_context_t, &cont_data_type, cont);
+ cont->self = contval;
+ cont_init(cont, th);
+ return cont;
+}
+
+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();
+ volatile VALUE contval;
+
+ THREAD_MUST_BE_RUNNING(th);
+ rb_vm_stack_to_heap(th);
+ cont = cont_new(rb_cContinuation);
+ contval = cont->self;
+
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ cont->vm_stack_slen = th->cfp->sp - 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);
+ MEMCPY(cont->vm_stack + cont->vm_stack_slen, (VALUE*)th->cfp, VALUE, cont->vm_stack_clen);
+#else
+ 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;
+
+ 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)) {
+ volatile VALUE value;
+
+ VAR_INITIALIZED(cont);
+ value = cont->value;
+ if (cont->argc == -1) rb_exc_raise(value);
+ cont->value = Qnil;
+ *stat = 1;
+ return value;
+ }
+ else {
+ *stat = 0;
+ return contval;
+ }
+}
+
+static inline void
+cont_restore_thread(rb_context_t *cont)
+{
+ rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
+
+ /* restore thread context */
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* continuation */
+ rb_fiber_t *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;
+ }
+#ifdef CAPTURE_JUST_VALID_VM_STACK
+ MEMCPY(th->stack, cont->vm_stack, VALUE, cont->vm_stack_slen);
+ MEMCPY(th->stack + sth->stack_size - cont->vm_stack_clen,
+ cont->vm_stack + cont->vm_stack_slen, VALUE, cont->vm_stack_clen);
+#else
+ MEMCPY(th->stack, cont->vm_stack, VALUE, sth->stack_size);
+#endif
+ }
+ else {
+ /* fiber */
+ 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->cfp = sth->cfp;
+ th->safe_level = sth->safe_level;
+ th->raised_flag = sth->raised_flag;
+ th->state = sth->state;
+ th->status = sth->status;
+ th->tag = sth->tag;
+ 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
+#ifdef _WIN32
+static void
+fiber_set_stack_location(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ 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));
+}
+
+static VOID CALLBACK
+fiber_entry(void *arg)
+{
+ fiber_set_stack_location();
+ rb_fiber_start();
+}
+#else /* _WIN32 */
+
+/*
+ * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
+ * if MAP_STACK is passed.
+ * http://www.FreeBSD.org/cgi/query-pr.cgi?pr=158755
+ */
+#if defined(MAP_STACK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_STACK)
+#else
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON)
+#endif
+
+static char*
+fiber_machine_stack_alloc(size_t size)
+{
+ char *ptr;
+
+ if (machine_stack_cache_index > 0) {
+ if (machine_stack_cache[machine_stack_cache_index - 1].size == (size / sizeof(VALUE))) {
+ ptr = machine_stack_cache[machine_stack_cache_index - 1].ptr;
+ machine_stack_cache_index--;
+ machine_stack_cache[machine_stack_cache_index].ptr = NULL;
+ machine_stack_cache[machine_stack_cache_index].size = 0;
+ }
+ else{
+ /* TODO handle multiple machine stack size */
+ rb_bug("machine_stack_cache size is not canonicalized");
+ }
+ }
+ else {
+ 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));
+ }
+
+ /* guard page setup */
+ page = ptr + STACK_DIR_UPPER(size - RB_PAGE_SIZE, 0);
+ if (mprotect(page, RB_PAGE_SIZE, PROT_NONE) < 0) {
+ rb_raise(rb_eFiberError, "mprotect failed");
+ }
+ }
+
+ return ptr;
+}
+#endif
+
+static void
+fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
+{
+ rb_thread_t *sth = &fib->cont.saved_thread;
+
+#ifdef _WIN32
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ /* try to release unnecessary fibers & retry to create */
+ rb_gc();
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ rb_raise(rb_eFiberError, "can't create fiber");
+ }
+ }
+ sth->machine.stack_maxsize = size;
+#else /* not WIN32 */
+ ucontext_t *context = &fib->context;
+ char *ptr;
+ STACK_GROW_DIR_DETECTION;
+
+ getcontext(context);
+ ptr = fiber_machine_stack_alloc(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;
+#endif
+#ifdef __ia64
+ sth->machine.register_stack_maxsize = sth->machine.stack_maxsize;
+#endif
+}
+
+NOINLINE(static void fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib));
+
+static void
+fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
+{
+ rb_thread_t *th = GET_THREAD(), *sth = &newfib->cont.saved_thread;
+
+ if (newfib->status != RUNNING) {
+ fiber_initialize_machine_stack_context(newfib, th->vm->default_params.fiber_machine_stack_size);
+ }
+
+ /* 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");
+ }
+
+ /* save oldfib's machine stack */
+ if (oldfib->status != TERMINATED) {
+ STACK_GROW_DIR_DETECTION;
+ 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;
+ }
+ else {
+ 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;
+#ifndef _WIN32
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib) {
+ rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
+ }
+#endif
+
+ /* swap machine context */
+#ifdef _WIN32
+ SwitchToFiber(newfib->fib_handle);
+#else
+ swapcontext(&oldfib->context, &newfib->context);
+#endif
+}
+#endif
+
+NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));
+
+static void
+cont_restore_1(rb_context_t *cont)
+{
+ cont_restore_thread(cont);
+
+ /* restore machine stack */
+#ifdef _M_AMD64
+ {
+ /* workaround for x64 SEH */
+ jmp_buf buf;
+ setjmp(buf);
+ ((_JUMP_BUFFER*)(&cont->jmpbuf))->Frame =
+ ((_JUMP_BUFFER*)(&buf))->Frame;
+ }
+#endif
+ if (cont->machine.stack_src) {
+ FLUSH_REGISTER_WINDOWS;
+ 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);
+ }
+#endif
+
+ ruby_longjmp(cont->jmpbuf, 1);
+}
+
+NORETURN(NOINLINE(static void cont_restore_0(rb_context_t *, VALUE *)));
+
+#ifdef __ia64
+#define C(a) rse_##a##0, rse_##a##1, rse_##a##2, rse_##a##3, rse_##a##4
+#define E(a) rse_##a##0= rse_##a##1= rse_##a##2= rse_##a##3= rse_##a##4
+static volatile int C(a), C(b), C(c), C(d), C(e);
+static volatile int C(f), C(g), C(h), C(i), C(j);
+static volatile int C(k), C(l), C(m), C(n), C(o);
+static volatile int C(p), C(q), C(r), C(s), C(t);
+#if 0
+{/* the above lines make cc-mode.el confused so much */}
+#endif
+int rb_dummy_false = 0;
+NORETURN(NOINLINE(static void register_stack_extend(rb_context_t *, VALUE *, VALUE *)));
+static void
+register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
+{
+ if (rb_dummy_false) {
+ /* use registers as much as possible */
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ E(k) = E(l) = E(m) = E(n) = E(o) =
+ E(p) = E(q) = E(r) = E(s) = E(t) = 0;
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ 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) {
+ register_stack_extend(cont, vp, (VALUE*)rb_ia64_bsp());
+ }
+ cont_restore_0(cont, vp);
+}
+#undef C
+#undef E
+#endif
+
+static void
+cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
+{
+ if (cont->machine.stack_src) {
+#ifdef HAVE_ALLOCA
+#define STACK_PAD_SIZE 1
+#else
+#define STACK_PAD_SIZE 1024
+#endif
+ VALUE space[STACK_PAD_SIZE];
+
+#if !STACK_GROW_DIRECTION
+ if (addr_in_prev_frame > &space[0]) {
+ /* Stack grows downward */
+#endif
+#if STACK_GROW_DIRECTION <= 0
+ volatile VALUE *const end = cont->machine.stack_src;
+ if (&space[0] > end) {
+# ifdef HAVE_ALLOCA
+ volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
+ space[0] = *sp;
+# else
+ cont_restore_0(cont, &space[0]);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+ else {
+ /* Stack grows upward */
+#endif
+#if STACK_GROW_DIRECTION >= 0
+ 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]);
+ space[0] = *sp;
+# else
+ cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
+# endif
+ }
+#endif
+#if !STACK_GROW_DIRECTION
+ }
+#endif
+ }
+ cont_restore_1(cont);
+}
+#ifdef __ia64
+#define cont_restore_0(cont, vp) register_stack_extend((cont), (vp), (VALUE*)rb_ia64_bsp())
+#endif
+
+/*
+ * Document-class: Continuation
+ *
+ * Continuation objects are generated by Kernel#callcc,
+ * after having +require+d <i>continuation</i>. They hold
+ * a return address and execution context, allowing a nonlocal return
+ * to the end of the <code>callcc</code> block from anywhere within a
+ * program. Continuations are somewhat analogous to a structured
+ * version of C's <code>setjmp/longjmp</code> (although they contain
+ * more state, so you might consider them closer to threads).
+ *
+ * For instance:
+ *
+ * require "continuation"
+ * arr = [ "Freddie", "Herbie", "Ron", "Max", "Ringo" ]
+ * callcc{|cc| $cc = cc}
+ * puts(message = arr.shift)
+ * $cc.call unless message =~ /Max/
+ *
+ * <em>produces:</em>
+ *
+ * Freddie
+ * Herbie
+ * Ron
+ * Max
+ *
+ * This (somewhat contrived) example allows the inner loop to abandon
+ * processing early:
+ *
+ * require "continuation"
+ * callcc {|cont|
+ * for i in 0..4
+ * print "\n#{i}: "
+ * for j in i*5...(i+1)*5
+ * cont.call() if j == 17
+ * printf "%3d", j
+ * end
+ * end
+ * }
+ * puts
+ *
+ * <em>produces:</em>
+ *
+ * 0: 0 1 2 3 4
+ * 1: 5 6 7 8 9
+ * 2: 10 11 12 13 14
+ * 3: 15 16
+ */
+
+/*
+ * call-seq:
+ * callcc {|cont| block } -> obj
+ *
+ * Generates a Continuation object, which it passes to
+ * the associated block. You need to <code>require
+ * 'continuation'</code> before using this method. Performing a
+ * <em>cont</em><code>.call</code> will cause the #callcc
+ * to return (as will falling through the end of the block). The
+ * value returned by the #callcc is the value of the
+ * block, or the value passed to <em>cont</em><code>.call</code>. See
+ * class Continuation for more details. Also see
+ * Kernel#throw for an alternative mechanism for
+ * unwinding a call stack.
+ */
+
+static VALUE
+rb_callcc(VALUE self)
+{
+ volatile int called;
+ volatile VALUE val = cont_capture(&called);
+
+ if (called) {
+ return val;
+ }
+ else {
+ return rb_yield(val);
+ }
+}
+
+static VALUE
+make_passing_arg(int argc, const VALUE *argv)
+{
+ switch (argc) {
+ case 0:
+ return Qnil;
+ case 1:
+ return argv[0];
+ default:
+ return rb_ary_new4(argc, 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, ...)
+ * cont[args, ...]
+ *
+ * Invokes the continuation. The program continues from the end of the
+ * <code>callcc</code> block. If no arguments are given, the original
+ * <code>callcc</code> returns <code>nil</code>. If one argument is
+ * given, <code>callcc</code> returns it. Otherwise, an array
+ * containing <i>args</i> is returned.
+ *
+ * callcc {|cont| cont.call } #=> nil
+ * callcc {|cont| cont.call 1 } #=> 1
+ * callcc {|cont| cont.call 1, 2, 3 } #=> [1, 2, 3]
+ */
+
+static VALUE
+rb_cont_call(int argc, VALUE *argv, VALUE contval)
+{
+ rb_context_t *cont;
+ rb_thread_t *th = GET_THREAD();
+ GetContPtr(contval, cont);
+
+ if (cont->saved_thread.self != th->self) {
+ rb_raise(rb_eRuntimeError, "continuation called across threads");
+ }
+ if (cont->saved_thread.protect_tag != th->protect_tag) {
+ rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
+ }
+ if (cont->saved_thread.fiber) {
+ 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);
+
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
+
+ cont_restore_0(cont, &contval);
+ return Qnil; /* unreachable */
+}
+
+/*********/
+/* fiber */
+/*********/
+
+/*
+ * Document-class: Fiber
+ *
+ * Fibers are primitives for implementing light weight cooperative
+ * concurrency in Ruby. Basically they are a means of creating code blocks
+ * that can be paused and resumed, much like threads. The main difference
+ * is that they are never preempted and that the scheduling must be done by
+ * the programmer and not the VM.
+ *
+ * As opposed to other stackless light weight concurrency models, each fiber
+ * 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
+ * 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
+ * (the caller of the <code>Fiber#resume</code>).
+ *
+ * Upon yielding or termination the Fiber returns the value of the last
+ * executed expression
+ *
+ * For instance:
+ *
+ * fiber = Fiber.new do
+ * Fiber.yield 1
+ * 2
+ * end
+ *
+ * puts fiber.resume
+ * puts fiber.resume
+ * puts fiber.resume
+ *
+ * <em>produces</em>
+ *
+ * 1
+ * 2
+ * FiberError: dead fiber called
+ *
+ * The <code>Fiber#resume</code> method accepts an arbitrary number of
+ * parameters, if it is the first call to <code>resume</code> then they
+ * will be passed as block arguments. Otherwise they will be the return
+ * value of the call to <code>Fiber.yield</code>
+ *
+ * Example:
+ *
+ * fiber = Fiber.new do |first|
+ * second = Fiber.yield first + 2
+ * end
+ *
+ * puts fiber.resume 10
+ * puts fiber.resume 14
+ * puts fiber.resume 18
+ *
+ * <em>produces</em>
+ *
+ * 12
+ * 14
+ * FiberError: dead fiber called
+ *
+ */
+
+static const rb_data_type_t fiber_data_type = {
+ "fiber",
+ {fiber_mark, fiber_free, fiber_memsize,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static VALUE
+fiber_alloc(VALUE klass)
+{
+ return TypedData_Wrap_Struct(klass, &fiber_data_type, 0);
+}
+
+static rb_fiber_t*
+fiber_t_alloc(VALUE fibval)
+{
+ rb_fiber_t *fib;
+ rb_thread_t *th = GET_THREAD();
+
+ if (DATA_PTR(fibval) != 0) {
+ rb_raise(rb_eRuntimeError, "cannot initialize twice");
+ }
+
+ THREAD_MUST_BE_RUNNING(th);
+ fib = ZALLOC(rb_fiber_t);
+ fib->cont.self = fibval;
+ fib->cont.type = FIBER_CONTEXT;
+ cont_init(&fib->cont, th);
+ fib->prev = NULL;
+ fib->status = CREATED;
+
+ DATA_PTR(fibval) = fib;
+
+ return fib;
+}
+
+static VALUE
+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;
+
+ th->stack = 0;
+ th->stack_size = 0;
+
+ th->stack_size = cth->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 + 1;
+#if VM_DEBUG_BP_CHECK
+ th->cfp->bp_check = 0;
+#endif
+ th->cfp->ep = th->stack;
+ *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->self = Qnil;
+ 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);
+#endif
+
+ return fibval;
+}
+
+/* :nodoc: */
+static VALUE
+rb_fiber_init(VALUE fibval)
+{
+ return fiber_init(fibval, rb_block_proc());
+}
+
+VALUE
+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);
+
+void
+rb_fiber_start(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_fiber_t *fib = th->fiber;
+ rb_proc_t *proc;
+ int state;
+
+ 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;
+ GetProcPtr(cont->saved_thread.first_proc, proc);
+ argv = (argc = cont->argc) > 1 ? RARRAY_CONST_PTR(args) : &args;
+ cont->value = Qnil;
+ th->errinfo = Qnil;
+ th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
+ th->root_svar = Qnil;
+
+ fib->status = RUNNING;
+ cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
+ }
+ TH_POP_TAG();
+
+ if (state) {
+ if (state == TAG_RAISE || state == TAG_FATAL) {
+ rb_threadptr_pending_interrupt_enque(th, th->errinfo);
+ }
+ else {
+ VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ if (!NIL_P(err))
+ rb_threadptr_pending_interrupt_enque(th, err);
+ }
+ RUBY_VM_SET_INTERRUPT(th);
+ }
+
+ rb_fiber_terminate(fib);
+ rb_bug("rb_fiber_start: unreachable");
+}
+
+static rb_fiber_t *
+root_fiber_alloc(rb_thread_t *th)
+{
+ rb_fiber_t *fib;
+ /* no need to allocate vm stack */
+ fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
+ fib->cont.type = ROOT_FIBER_CONTEXT;
+#if FIBER_USE_NATIVE
+#ifdef _WIN32
+ fib->fib_handle = ConvertThreadToFiber(0);
+#endif
+#endif
+ fib->status = RUNNING;
+
+ return fib;
+}
+
+static inline rb_fiber_t*
+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;
+ }
+ 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)
+{
+ rb_fiber_t *fib;
+
+ if (th->fiber) {
+ fib = th->fiber;
+ cont_save_thread(&fib->cont, th);
+ }
+ else {
+ /* create current fiber */
+ fib = root_fiber_alloc(th);
+ th->root_fiber = th->fiber = fib;
+ }
+
+#if FIBER_USE_NATIVE
+ fiber_setcontext(next_fib, fib);
+ /* restored */
+#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));
+ }
+ else {
+ rb_bug("terminated fiber resumed");
+ }
+ }
+ 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)) {
+ /* restored */
+ fib = th->fiber;
+ 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;
+ }
+ else {
+ VALUE undef = Qundef;
+ cont_restore_0(&next_fib->cont, &undef);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+#endif /* FIBER_USE_NATIVE */
+}
+
+static inline VALUE
+fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
+{
+ VALUE value;
+ rb_context_t *cont = &fib->cont;
+ rb_thread_t *th = GET_THREAD();
+
+ if (th->fiber == fib) {
+ /* ignore fiber context switch
+ * because destination fiber is same as current fiber
+ */
+ return make_passing_arg(argc, argv);
+ }
+
+ if (cont->saved_thread.self != th->self) {
+ rb_raise(rb_eFiberError, "fiber called across threads");
+ }
+ else if (cont->saved_thread.protect_tag != th->protect_tag) {
+ rb_raise(rb_eFiberError, "fiber called across stack rewinding barrier");
+ }
+ 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;
+ cont->argc = -1;
+ cont->value = value;
+#if FIBER_USE_NATIVE
+ fiber_setcontext(th->root_fiber, th->fiber);
+#else
+ cont_restore_0(cont, &value);
+#endif
+ /* unreachable */
+ }
+
+ if (is_resume) {
+ fib->prev = fiber_current();
+ }
+ else {
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
+ }
+
+ cont->argc = argc;
+ cont->value = make_passing_arg(argc, argv);
+
+ value = fiber_store(fib, th);
+ RUBY_VM_CHECK_INTS(th);
+
+ return value;
+}
+
+VALUE
+rb_fiber_transfer(VALUE fibval, int argc, const 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_t *fib;
+ GetFiberPtr(fibval, fib);
+
+ if (fib->prev != 0 || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ rb_raise(rb_eFiberError, "double resume");
+ }
+ if (fib->transferred != 0) {
+ rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
+ }
+
+ return fiber_switch(fib, argc, argv, 1);
+}
+
+VALUE
+rb_fiber_yield(int argc, const VALUE *argv)
+{
+ return fiber_switch(return_fiber(), argc, argv, 0);
+}
+
+void
+rb_fiber_reset_root_local_storage(VALUE thval)
+{
+ rb_thread_t *th;
+
+ GetThreadPtr(thval, th);
+ if (th->root_fiber && th->root_fiber != th->fiber) {
+ th->local_storage = th->root_fiber->cont.saved_thread.local_storage;
+ }
+}
+
+/*
+ * call-seq:
+ * fiber.alive? -> true or false
+ *
+ * Returns true if the fiber can still be resumed (or transferred
+ * to). After finishing execution of the fiber block this method will
+ * always return false. You need to <code>require 'fiber'</code>
+ * before using this method.
+ */
+VALUE
+rb_fiber_alive_p(VALUE fibval)
+{
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ return fib->status != TERMINATED ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * fiber.resume(args, ...) -> obj
+ *
+ * Resumes the fiber from the point at which the last <code>Fiber.yield</code>
+ * was called, or starts running it if it is the first call to
+ * <code>resume</code>. Arguments passed to resume will be the value of
+ * the <code>Fiber.yield</code> expression or will be passed as block
+ * parameters to the fiber's block if this is the first <code>resume</code>.
+ *
+ * Alternatively, when resume is called it evaluates to the arguments passed
+ * to the next <code>Fiber.yield</code> statement inside the fiber's block
+ * or to the block value if it runs to completion without any
+ * <code>Fiber.yield</code>
+ */
+static VALUE
+rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
+{
+ return rb_fiber_resume(fib, argc, argv);
+}
+
+/*
+ * call-seq:
+ * fiber.transfer(args, ...) -> obj
+ *
+ * Transfer control to another fiber, resuming it from where it last
+ * stopped or starting it if it was not resumed before. The calling
+ * fiber will be suspended much like in a call to
+ * <code>Fiber.yield</code>. You need to <code>require 'fiber'</code>
+ * before using this method.
+ *
+ * The fiber which receives the transfer call is treats it much like
+ * a resume call. Arguments passed to transfer are treated like those
+ * passed to resume.
+ *
+ * You cannot resume a fiber that transferred control to another one.
+ * This will cause a double resume error. You need to transfer control
+ * back to this fiber before it can yield and resume.
+ *
+ * Example:
+ *
+ * fiber1 = Fiber.new do
+ * puts "In Fiber 1"
+ * Fiber.yield
+ * end
+ *
+ * fiber2 = Fiber.new do
+ * puts "In Fiber 2"
+ * fiber1.transfer
+ * puts "Never see this message"
+ * end
+ *
+ * fiber3 = Fiber.new do
+ * puts "In Fiber 3"
+ * end
+ *
+ * fiber2.resume
+ * fiber3.resume
+ *
+ * <em>produces</em>
+ *
+ * In fiber 2
+ * In fiber 1
+ * In fiber 3
+ *
+ */
+static VALUE
+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);
+}
+
+/*
+ * call-seq:
+ * Fiber.yield(args, ...) -> obj
+ *
+ * Yields control back to the context that resumed the fiber, passing
+ * along any arguments that were passed to it. The fiber will resume
+ * processing at this point when <code>resume</code> is called next.
+ * Any arguments passed to the next <code>resume</code> will be the
+ * value that this <code>Fiber.yield</code> expression evaluates to.
+ */
+static VALUE
+rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass)
+{
+ return rb_fiber_yield(argc, argv);
+}
+
+/*
+ * call-seq:
+ * Fiber.current() -> fiber
+ *
+ * Returns the current fiber. You need to <code>require 'fiber'</code>
+ * before using this method. If you are not running in the context of
+ * a fiber this method will return the root fiber.
+ */
+static VALUE
+rb_fiber_s_current(VALUE klass)
+{
+ return rb_fiber_current();
+}
+
+
+
+/*
+ * Document-class: FiberError
+ *
+ * Raised when an invalid operation is attempted on a Fiber, in
+ * particular when attempting to call/resume a dead fiber,
+ * attempting to yield from the root fiber, or calling a fiber across
+ * threads.
+ *
+ * fiber = Fiber.new{}
+ * fiber.resume #=> nil
+ * fiber.resume #=> FiberError: dead fiber called
+ */
+
+void
+Init_Cont(void)
+{
+#if FIBER_USE_NATIVE
+ rb_thread_t *th = GET_THREAD();
+
+#ifdef _WIN32
+ SYSTEM_INFO info;
+ GetSystemInfo(&info);
+ pagesize = info.dwPageSize;
+#else /* not WIN32 */
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
+#endif
+
+ rb_cFiber = rb_define_class("Fiber", rb_cObject);
+ rb_define_alloc_func(rb_cFiber, fiber_alloc);
+ rb_eFiberError = rb_define_class("FiberError", rb_eStandardError);
+ rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1);
+ rb_define_method(rb_cFiber, "initialize", rb_fiber_init, 0);
+ rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
+}
+
+RUBY_SYMBOL_EXPORT_BEGIN
+
+void
+ruby_Init_Continuation_body(void)
+{
+ rb_cContinuation = rb_define_class("Continuation", rb_cObject);
+ rb_undef_alloc_func(rb_cContinuation);
+ rb_undef_method(CLASS_OF(rb_cContinuation), "new");
+ rb_define_method(rb_cContinuation, "call", rb_cont_call, -1);
+ rb_define_method(rb_cContinuation, "[]", rb_cont_call, -1);
+ rb_define_global_function("callcc", rb_callcc, 0);
+}
+
+void
+ruby_Init_Fiber_as_Coroutine(void)
+{
+ rb_define_method(rb_cFiber, "transfer", rb_fiber_m_transfer, -1);
+ rb_define_method(rb_cFiber, "alive?", rb_fiber_alive_p, 0);
+ rb_define_singleton_method(rb_cFiber, "current", rb_fiber_s_current, 0);
+}
+
+RUBY_SYMBOL_EXPORT_END
diff --git a/coverage/README b/coverage/README
new file mode 100644
index 0000000000..7e4ff59e2a
--- /dev/null
+++ b/coverage/README
@@ -0,0 +1,17 @@
+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 03208df11c..768a1b6b7f 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -1,14 +1,18 @@
include Makefile
ENABLE_SHARED=@ENABLE_SHARED@
-DLLWRAP = @DLLWRAP@ --target=@target_os@
+DLLWRAP = @DLLWRAP@ --target=@target_os@ --driver-name="$(CC)"
+WINDRES = @WINDRES@ --preprocessor="$(CPP) -xc" -DRC_INVOKED
ifeq (@target_os@,cygwin)
- DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
+ DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
- VPATH += $(srcdir)/win32
+ VPATH := $(VPATH):$(srcdir)/win32
+ STUBPROGRAM = rubystub$(EXEEXT)
+ IGNOREDPATTERNS = %~ .% %.orig %.rej \#%\#
+ SCRIPTPROGRAMS = $(addsuffix $(EXEEXT),$(filter-out $(IGNOREDPATTERNS),$(notdir $(wildcard $(srcdir)/bin/*))))
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -25,21 +29,34 @@ else
endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
+
+-include uncommon.mk
+
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
-EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
+override 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
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
+stub: $(STUBPROGRAM)
+scriptbin: $(SCRIPTPROGRAMS)
+
+%$(EXEEXT): bin/% $(STUBPROGRAM)
+ $(ECHO) generating $@
+ $(Q) { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
+ $(Q) chmod +x $@
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
$(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
%.res.@OBJEXT@: %.rc
- @WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
+ $(ECHO) compiling $@
+ $(Q) $(WINDRES) --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-$(RCFILES): $(RBCONFIG)
- @$(MINIRUBY) $(srcdir)/win32/resource.rb \
+$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(DLL_BASE_NAME) \
. $(icondirs) $(srcdir)/win32
@@ -47,32 +64,46 @@ $(RCFILES): $(RBCONFIG)
$(PROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@
$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
@rm -f $@
- $(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) -mwindows -e $(SYMBOL_PREFIX)mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
+ @rm -f $@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
+ stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
- $(DLLWRAP) \
+ $(ECHO) creating $@
+ $(Q) $(DLLWRAP) \
--output-exp=$(RUBY_EXP) \
--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
- $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
@rm -f $(PROGRAM)
GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
-$(OBJS) $(MAINOBJ): win32/win32.h
+$(OBJS) $(MAINOBJ): win32.h
+
+dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
endif
+$(LIBRUBY_SO): $(RUBYDEF)
+
+$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
+ $(ECHO) generating $@
+ $(Q) $(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
+
+clean-local::
+ @$(RM) $(RUBYDEF)
+
ifeq (@target_os@,cygwin)
-cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR).dll: $(LIBRUBY_A)
- @NM@ --extern --defined $(LIBRUBY_A) | \
- $(MINIRUBY) -ne 'BEGIN{puts "EXPORTS"}; puts $$1+"=cyg$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
- @DLLWRAP@ -s --def=rubydll.def -o $@
- @rm -f rubydll.def
+cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
+ $(ECHO) generating $@
+ $(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
clean-local::
@$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@)
-
-distclean-local::
@$(RM) $(RCFILES)
diff --git a/debug.c b/debug.c
new file mode 100644
index 0000000000..b526ab9523
--- /dev/null
+++ b/debug.c
@@ -0,0 +1,165 @@
+/**********************************************************************
+
+ debug.c -
+
+ $Author$
+ created at: 04/08/25 02:31:54 JST
+
+ Copyright (C) 2004-2007 Koichi Sasada
+
+**********************************************************************/
+
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
+#include "ruby/util.h"
+#include "vm_debug.h"
+#include "eval_intern.h"
+#include "vm_core.h"
+#include "id.h"
+
+/* for gdb */
+const union {
+ enum ruby_special_consts special_consts;
+ enum ruby_value_type value_type;
+ 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_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_PROMOTED0 = FL_PROMOTED0,
+ RUBY_FL_PROMOTED1 = FL_PROMOTED1,
+ RUBY_FL_PROMOTED = FL_PROMOTED0|FL_PROMOTED1,
+ RUBY_FL_FINALIZE = FL_FINALIZE,
+ RUBY_FL_TAINT = FL_TAINT,
+ 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,
+ RUBY_NODE_FL_NEWLINE = NODE_FL_NEWLINE
+ } 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)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "%*s", indent_level, "");
+ fflush(stderr);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void
+ruby_debug_printf(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+
+VALUE
+ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
+{
+ if (level < debug_level) {
+ VALUE str;
+ str = rb_inspect(obj);
+ fprintf(stderr, "DBG> %s: %s\n", header,
+ obj == (VALUE)(SIGNED_VALUE)-1 ? "" : StringValueCStr(str));
+ fflush(stderr);
+ }
+ return obj;
+}
+
+void
+ruby_debug_print_v(VALUE v)
+{
+ ruby_debug_print_value(0, 1, "", v);
+}
+
+ID
+ruby_debug_print_id(int level, int debug_level, const char *header, ID id)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "DBG> %s: %"PRIsVALUE"\n", header, rb_id2str(id));
+ fflush(stderr);
+ }
+ return id;
+}
+
+NODE *
+ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
+{
+ if (level < debug_level) {
+ fprintf(stderr, "DBG> %s: %s (%u)\n", header,
+ ruby_node_name(nd_type(node)), nd_line(node));
+ }
+ return (NODE *)node;
+}
+
+void
+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 { \
+ if (len == sizeof(name) - 1 && \
+ strncmp(str, (name), len) == 0) { \
+ (var) = (val); \
+ 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);
+#endif
+ fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
+}
+
+void
+ruby_set_debug_option(const char *str)
+{
+ ruby_each_words(str, set_debug_option, 0);
+}
diff --git a/defines.h b/defines.h
deleted file mode 100644
index f39097fea4..0000000000
--- a/defines.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/************************************************
-
- defines.h -
-
- $Author$
- $Date$
- created at: Wed May 18 00:21:44 JST 1994
-
-************************************************/
-#ifndef DEFINES_H
-#define DEFINES_H
-
-#define RUBY
-
-#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-#undef _
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-
-#undef __
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-
-#ifdef __cplusplus
-#define ANYARGS ...
-#else
-#define ANYARGS
-#endif
-
-#define xmalloc ruby_xmalloc
-#define xcalloc ruby_xcalloc
-#define xrealloc ruby_xrealloc
-#define xfree ruby_xfree
-
-void *xmalloc _((long));
-void *xcalloc _((long,long));
-void *xrealloc _((void*,long));
-void xfree _((void*));
-
-#if SIZEOF_LONG_LONG > 0
-# define LONG_LONG long long
-#elif SIZEOF___INT64 > 0
-# define HAVE_LONG_LONG 1
-# define LONG_LONG __int64
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF___INT64
-#endif
-
-#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned LONG_LONG
-# define BDIGIT_DBL_SIGNED LONG_LONG
-#elif SIZEOF_INT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned int
-# define SIZEOF_BDIGITS SIZEOF_INT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS SIZEOF_SHORT
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#else
-# define BDIGIT unsigned short
-# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
-# define BDIGIT_DBL unsigned long
-# define BDIGIT_DBL_SIGNED long
-#endif
-
-#ifdef __CYGWIN__
-#undef _WIN32
-#endif
-
-#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
-#define DOSISH 1
-#ifndef _WIN32_WCE
-# define DOSISH_DRIVE_LETTER
-#endif
-#endif
-
-/* define RUBY_USE_EUC/SJIS for default kanji-code */
-#ifndef DEFAULT_KCODE
-#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2)
-#define DEFAULT_KCODE KCODE_SJIS
-#else
-#define DEFAULT_KCODE KCODE_EUC
-#endif
-#endif
-
-#if defined(__NeXT__) || defined(__APPLE__)
-/* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
- result in a different endian. Instead trust __BIG_ENDIAN__ and
- __LITTLE_ENDIAN__ which are set correctly by -arch. */
-#undef WORDS_BIGENDIAN
-#ifdef __BIG_ENDIAN__
-#define WORDS_BIGENDIAN
-#endif
-#endif
-
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400 /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040 /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004 /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200 /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020 /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002 /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001 /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070 /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007 /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
-#ifdef _WIN32
-#include "win32/win32.h"
-#endif
-
-#if defined(__VMS)
-#include "vms.h"
-#endif
-
-#if defined(__BEOS__)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#endif
-
-#ifdef RUBY_EXPORT
-#undef RUBY_EXTERN
-#endif
-
-#ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
-#endif
-
-#ifndef EXTERN
-#define EXTERN RUBY_EXTERN /* deprecated */
-#endif
-
-#ifndef RUBY_MBCHAR_MAXSIZE
-#define RUBY_MBCHAR_MAXSIZE INT_MAX
- /* MB_CUR_MAX will not work well in C locale */
-#endif
-
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
- asm
-#ifdef __GNUC__
- volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
- ("flushw")
-# else
- ("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
- ;
-}
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#elif defined(__ia64)
-void *rb_ia64_bsp(void);
-void rb_ia64_flushrs(void);
-# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
-#else
-# define FLUSH_REGISTER_WINDOWS ((void)0)
-#endif
-
-#if defined(DOSISH)
-#define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
-#else
-#define PATH_SEP ":"
-#endif
-#define PATH_SEP_CHAR PATH_SEP[0]
-
-#if defined(__human68k__)
-#define PATH_ENV "path"
-#else
-#define PATH_ENV "PATH"
-#endif
-
-#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
-#define ENV_IGNORECASE
-#endif
-
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH || defined __VMS
-# define CASEFOLD_FILESYSTEM 1
-# else
-# define CASEFOLD_FILESYSTEM 0
-# endif
-#endif
-
-#ifndef DLEXT_MAXLEN
-#define DLEXT_MAXLEN 4
-#endif
-
-#ifndef RUBY_PLATFORM
-#define RUBY_PLATFORM "unknown-unknown"
-#endif
-
-#endif
diff --git a/defs/default_gems b/defs/default_gems
new file mode 100644
index 0000000000..ce9010910a
--- /dev/null
+++ b/defs/default_gems
@@ -0,0 +1,4 @@
+# gem base directory versioning file [executable files under bin]
+rake lib/rake lib/rake.rb [rake]
+rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
+json ext/json ext/json/lib/json/version.rb
diff --git a/defs/gmake.mk b/defs/gmake.mk
new file mode 100644
index 0000000000..f5033b2245
--- /dev/null
+++ b/defs/gmake.mk
@@ -0,0 +1,63 @@
+# -*- makefile-gmake -*-
+gnumake = yes
+
+TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
+TEST_TARGETS += $(subst check,test-all,$(patsubst check-%,test-%,$(TEST_TARGETS)))
+TEST_TARGETS := $(patsubst test-%,yes-test-%,$(patsubst btest-%,yes-btest-%,$(TEST_TARGETS)))
+TEST_DEPENDS := $(if $(TEST_TARGETS),$(filter all main exts,$(MAKECMDGOALS)))
+TEST_DEPENDS += $(TEST_DEPENDS) $(if $(filter check%,$(MAKECMDGOALS)),main)
+TEST_DEPENDS += $(if $(filter all,$(INSTALLDOC)),docs)
+
+ifneq ($(filter -O0 -Od,$(optflags)),)
+override XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=%,$(XCFLAGS))
+endif
+
+ifneq ($(filter universal-%,$(arch)),)
+define archcmd
+%.$(1).S: %.c
+ @$$(ECHO) translating $$< with $(2)
+ $$(Q) $$(CC) $$(CFLAGS_NO_ARCH) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -S $$<
+
+%.S: %.$(1).S
+
+%.$(1).i: %.c
+ @$$(ECHO) preprocessing $$< with $(2)
+ $$(Q) $$(CPP) $$(warnflags) $(2) $$(XCFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$@ -E $$< > $$@
+
+%.i: %.$(1).i
+endef
+
+$(foreach arch,$(filter -arch=%,$(subst -arch ,-arch=,$(ARCH_FLAG))),\
+ $(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
+endif
+
+ifneq ($(filter love check% test,$(MAKECMDGOALS)),)
+yes-test-knownbug: $(TEST_DEPENDS) yes-btest-ruby
+yes-btest-ruby: $(TEST_DEPENDS) yes-test-sample
+yes-test-sample: $(TEST_DEPENDS)
+endif
+ifneq ($(filter love check%,$(MAKECMDGOALS)) $(filter test-all,$(TEST_TARGETS)),)
+yes-test-all yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS))
+endif
+ifneq ($(filter love check%,$(MAKECMDGOALS))$(if $(filter test-all,$(MAKECMDGOALS)),$(filter test-knownbug,$(MAKECMDGOALS))),)
+yes-test-all yes-test-ruby: yes-test-knownbug
+endif
+
+$(TEST_TARGETS): $(TEST_DEPENDS)
+
+ifneq ($(if $(filter install,$(MAKECMDGOALS)),$(filter uninstall,$(MAKECMDGOALS))),)
+install-targets := $(filter install uninstall,$(MAKECMDGOALS))
+$(word 1,$(install-targets)): $(word 0,$(install-targets))
+endif
+
+ifneq ($(filter reinstall,$(MAKECMDGOALS)),)
+install-prereq: uninstall
+uninstall sudo-precheck: all $(if $(filter all,$(INSTALLDOC)),docs)
+endif
+
+ifneq ($(filter love,$(MAKECMDGOALS)),)
+showflags: up
+sudo-precheck: test
+install-prereq: sudo-precheck
+yes-test-all no-test-all: install
+endif
diff --git a/defs/id.def b/defs/id.def
new file mode 100644
index 0000000000..d4cd5e77de
--- /dev/null
+++ b/defs/id.def
@@ -0,0 +1,122 @@
+# -*- mode: ruby; coding: us-ascii -*-
+firstline, predefined = __LINE__+1, %[\
+ freeze
+ inspect
+ intern
+ object_id
+ const_missing
+ method_missing MethodMissing
+ method_added
+ singleton_method_added
+ method_removed
+ singleton_method_removed
+ method_undefined
+ singleton_method_undefined
+ length
+ size
+ gets
+ succ
+ each
+ proc
+ lambda
+ send
+ __send__
+ __attached__
+ initialize
+ initialize_copy
+ initialize_clone
+ initialize_dup
+ to_int
+ to_ary
+ to_str
+ to_sym
+ to_hash
+ to_proc
+ to_io
+ to_a
+ to_s
+ to_i
+ bt
+ bt_locations
+ call
+ mesg
+ exception
+
+ _ UScore
+ "/*NULL*/" NULL
+ empty?
+ eql?
+ respond_to? Respond_to
+ respond_to_missing? Respond_to_missing
+ <IFUNC>
+ <CFUNC>
+ core#set_method_alias
+ core#set_variable_alias
+ core#undef_method
+ core#define_method
+ core#define_singleton_method
+ core#set_postexe
+ core#hash_from_ary
+ core#hash_merge_ary
+ core#hash_merge_ptr
+ core#hash_merge_kwd
+]
+
+class KeywordError < RuntimeError
+ def self.raise(mesg, line)
+ super(self, mesg, ["#{__FILE__}:#{line}", *caller])
+ end
+end
+
+predefined_ids = {}
+preserved_ids = []
+local_ids = []
+instance_ids = []
+global_ids = []
+const_ids = []
+class_ids = []
+attrset_ids = []
+names = {}
+predefined.split(/^/).each_with_index do |line, num|
+ next if /^#/ =~ line
+ line.sub!(/\s+#.*/, '')
+ name, token = line.split
+ next unless name
+ token ||= name
+ if /#/ =~ token
+ token = "_#{token.gsub(/\W+/, '_')}"
+ else
+ token = token.sub(/\?/, 'P').sub(/\A[a-z]/) {$&.upcase}
+ token.sub!(/\A\$/, "_G_")
+ token.sub!(/\A@@/, "_C_")
+ token.sub!(/\A@/, "_I_")
+ token.gsub!(/\W+/, "")
+ end
+ if prev = names[name]
+ KeywordError.raise("#{name} is already registered at line #{prev+firstline}", firstline+num)
+ end
+ if prev = predefined_ids[token]
+ KeywordError.raise("#{token} is already used for #{prev} at line #{names[prev]+firstline}", firstline+num)
+ end
+ names[name] = num
+ case name
+ when /\A[A-Z]\w*\z/; const_ids
+ when /\A(?!\d)\w+\z/; local_ids
+ when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
+ when /\A@@(?!\d)\w+\z/; class_ids
+ when /\A@(?!\d)\w+\z/; instance_ids
+ when /\A((?!\d)\w+)=\z/; attrset_ids
+ else preserved_ids
+ end << token
+ predefined_ids[token] = name
+end
+{
+ "LOCAL" => local_ids,
+ "INSTANCE" => instance_ids,
+ "GLOBAL" => global_ids,
+ "CONST" => const_ids,
+ "CLASS" => class_ids,
+ "ATTRSET" => attrset_ids,
+ :preserved => preserved_ids,
+ :predefined => predefined_ids,
+}
diff --git a/defs/keywords b/defs/keywords
new file mode 100644
index 0000000000..0d4d70b8cf
--- /dev/null
+++ b/defs/keywords
@@ -0,0 +1,53 @@
+%{
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+const struct kwtable *rb_reserved_word(const char *, unsigned int);
+#ifndef RIPPER
+static const struct kwtable *reserved_word(const char *, unsigned int);
+#define rb_reserved_word(str, len) reserved_word(str, len)
+%}
+
+struct kwtable;
+%%
+__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
+__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
+__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
+BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
+END, {keyword_END, keyword_END}, EXPR_END
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM
+and, {keyword_and, keyword_and}, EXPR_VALUE
+begin, {keyword_begin, keyword_begin}, EXPR_BEG
+break, {keyword_break, keyword_break}, EXPR_MID
+case, {keyword_case, keyword_case}, EXPR_VALUE
+class, {keyword_class, keyword_class}, EXPR_CLASS
+def, {keyword_def, keyword_def}, EXPR_FNAME
+defined?, {keyword_defined, keyword_defined}, EXPR_ARG
+do, {keyword_do, keyword_do}, EXPR_BEG
+else, {keyword_else, keyword_else}, EXPR_BEG
+elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
+end, {keyword_end, keyword_end}, EXPR_END
+ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
+false, {keyword_false, keyword_false}, EXPR_END
+for, {keyword_for, keyword_for}, EXPR_VALUE
+if, {keyword_if, modifier_if}, EXPR_VALUE
+in, {keyword_in, keyword_in}, EXPR_VALUE
+module, {keyword_module, keyword_module}, EXPR_VALUE
+next, {keyword_next, keyword_next}, EXPR_MID
+nil, {keyword_nil, keyword_nil}, EXPR_END
+not, {keyword_not, keyword_not}, EXPR_ARG
+or, {keyword_or, keyword_or}, EXPR_VALUE
+redo, {keyword_redo, keyword_redo}, EXPR_END
+rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
+retry, {keyword_retry, keyword_retry}, EXPR_END
+return, {keyword_return, keyword_return}, EXPR_MID
+self, {keyword_self, keyword_self}, EXPR_END
+super, {keyword_super, keyword_super}, EXPR_ARG
+then, {keyword_then, keyword_then}, EXPR_BEG
+true, {keyword_true, keyword_true}, EXPR_END
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM
+unless, {keyword_unless, modifier_unless}, EXPR_VALUE
+until, {keyword_until, modifier_until}, EXPR_VALUE
+when, {keyword_when, keyword_when}, EXPR_VALUE
+while, {keyword_while, modifier_while}, EXPR_VALUE
+yield, {keyword_yield, keyword_yield}, EXPR_ARG
+%%
+#endif
diff --git a/defs/known_errors.def b/defs/known_errors.def
new file mode 100644
index 0000000000..b9c490d3a2
--- /dev/null
+++ b/defs/known_errors.def
@@ -0,0 +1,148 @@
+EPERM
+ENOENT
+ESRCH
+EINTR
+EIO
+ENXIO
+E2BIG
+ENOEXEC
+EBADF
+ECHILD
+EAGAIN
+ENOMEM
+EACCES
+EFAULT
+ENOTBLK
+EBUSY
+EEXIST
+EXDEV
+ENODEV
+ENOTDIR
+EISDIR
+EINVAL
+ENFILE
+EMFILE
+ENOTTY
+ETXTBSY
+EFBIG
+ENOSPC
+ESPIPE
+EROFS
+EMLINK
+EPIPE
+EDOM
+ERANGE
+EDEADLK
+ENAMETOOLONG
+ENOLCK
+ENOSYS
+ENOTEMPTY
+ELOOP
+EWOULDBLOCK
+ENOMSG
+EIDRM
+ECHRNG
+EL2NSYNC
+EL3HLT
+EL3RST
+ELNRNG
+EUNATCH
+ENOCSI
+EL2HLT
+EBADE
+EBADR
+EXFULL
+ENOANO
+EBADRQC
+EBADSLT
+EDEADLOCK
+EBFONT
+ENOSTR
+ENODATA
+ETIME
+ENOSR
+ENONET
+ENOPKG
+EREMOTE
+ENOLINK
+EADV
+ESRMNT
+ECOMM
+EPROTO
+EMULTIHOP
+EDOTDOT
+EBADMSG
+EOVERFLOW
+ENOTUNIQ
+EBADFD
+EREMCHG
+ELIBACC
+ELIBBAD
+ELIBSCN
+ELIBMAX
+ELIBEXEC
+EILSEQ
+ERESTART
+ESTRPIPE
+EUSERS
+ENOTSOCK
+EDESTADDRREQ
+EMSGSIZE
+EPROTOTYPE
+ENOPROTOOPT
+EPROTONOSUPPORT
+ESOCKTNOSUPPORT
+EOPNOTSUPP
+EPFNOSUPPORT
+EAFNOSUPPORT
+EADDRINUSE
+EADDRNOTAVAIL
+ENETDOWN
+ENETUNREACH
+ENETRESET
+ECONNABORTED
+ECONNRESET
+ENOBUFS
+EISCONN
+ENOTCONN
+ESHUTDOWN
+ETOOMANYREFS
+ETIMEDOUT
+ECONNREFUSED
+EHOSTDOWN
+EHOSTUNREACH
+EALREADY
+EINPROGRESS
+ESTALE
+EUCLEAN
+ENOTNAM
+ENAVAIL
+EISNAM
+EREMOTEIO
+EDQUOT
+ECANCELED
+EKEYEXPIRED
+EKEYREJECTED
+EKEYREVOKED
+EMEDIUMTYPE
+ENOKEY
+ENOMEDIUM
+ENOTRECOVERABLE
+EOWNERDEAD
+ERFKILL
+EAUTH
+EBADRPC
+EDOOFUS
+EFTYPE
+ENEEDAUTH
+ENOATTR
+ENOTSUP
+EPROCLIM
+EPROCUNAVAIL
+EPROGMISMATCH
+EPROGUNAVAIL
+ERPCMISMATCH
+EIPSEC
+EHWPOISON
+ECAPMODE
+ENOTCAPABLE
diff --git a/defs/lex.c.src b/defs/lex.c.src
new file mode 100644
index 0000000000..0d4d70b8cf
--- /dev/null
+++ b/defs/lex.c.src
@@ -0,0 +1,53 @@
+%{
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
+const struct kwtable *rb_reserved_word(const char *, unsigned int);
+#ifndef RIPPER
+static const struct kwtable *reserved_word(const char *, unsigned int);
+#define rb_reserved_word(str, len) reserved_word(str, len)
+%}
+
+struct kwtable;
+%%
+__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END
+__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END
+__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END
+BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END
+END, {keyword_END, keyword_END}, EXPR_END
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM
+and, {keyword_and, keyword_and}, EXPR_VALUE
+begin, {keyword_begin, keyword_begin}, EXPR_BEG
+break, {keyword_break, keyword_break}, EXPR_MID
+case, {keyword_case, keyword_case}, EXPR_VALUE
+class, {keyword_class, keyword_class}, EXPR_CLASS
+def, {keyword_def, keyword_def}, EXPR_FNAME
+defined?, {keyword_defined, keyword_defined}, EXPR_ARG
+do, {keyword_do, keyword_do}, EXPR_BEG
+else, {keyword_else, keyword_else}, EXPR_BEG
+elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE
+end, {keyword_end, keyword_end}, EXPR_END
+ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG
+false, {keyword_false, keyword_false}, EXPR_END
+for, {keyword_for, keyword_for}, EXPR_VALUE
+if, {keyword_if, modifier_if}, EXPR_VALUE
+in, {keyword_in, keyword_in}, EXPR_VALUE
+module, {keyword_module, keyword_module}, EXPR_VALUE
+next, {keyword_next, keyword_next}, EXPR_MID
+nil, {keyword_nil, keyword_nil}, EXPR_END
+not, {keyword_not, keyword_not}, EXPR_ARG
+or, {keyword_or, keyword_or}, EXPR_VALUE
+redo, {keyword_redo, keyword_redo}, EXPR_END
+rescue, {keyword_rescue, modifier_rescue}, EXPR_MID
+retry, {keyword_retry, keyword_retry}, EXPR_END
+return, {keyword_return, keyword_return}, EXPR_MID
+self, {keyword_self, keyword_self}, EXPR_END
+super, {keyword_super, keyword_super}, EXPR_ARG
+then, {keyword_then, keyword_then}, EXPR_BEG
+true, {keyword_true, keyword_true}, EXPR_END
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM
+unless, {keyword_unless, modifier_unless}, EXPR_VALUE
+until, {keyword_until, modifier_until}, EXPR_VALUE
+when, {keyword_when, keyword_when}, EXPR_VALUE
+while, {keyword_while, modifier_while}, EXPR_VALUE
+yield, {keyword_yield, keyword_yield}, EXPR_ARG
+%%
+#endif
diff --git a/defs/opt_insn_unif.def b/defs/opt_insn_unif.def
new file mode 100644
index 0000000000..1ac613dbea
--- /dev/null
+++ b/defs/opt_insn_unif.def
@@ -0,0 +1,29 @@
+#
+# a definition of instruction unification
+#
+#
+
+__END__
+
+putobject putobject
+putobject putstring
+putobject setlocal
+putobject setdynamic
+
+putstring putstring
+putstring putobject
+putstring setlocal
+putstring setdynamic
+
+# putnil end
+
+dup setlocal
+
+# from tarai
+getlocal getlocal
+# getlocal send
+
+# from tak, ackermann
+getlocal putobject
+
+
diff --git a/defs/opt_operand.def b/defs/opt_operand.def
new file mode 100644
index 0000000000..887e3da49a
--- /dev/null
+++ b/defs/opt_operand.def
@@ -0,0 +1,22 @@
+#
+# configuration file for operand union optimization
+#
+# format:
+# [insn name] op1, op2 ...
+#
+# wildcard: *
+#
+
+getlocal *, 0
+getlocal *, 1
+setlocal *, 0
+setlocal *, 1
+
+putobject INT2FIX(0)
+putobject INT2FIX(1)
+
+__END__
+
+putobject Qtrue
+putobject Qfalse
+
diff --git a/dir.c b/dir.c
index 710299e7b6..84413c6b57 100644
--- a/dir.c
+++ b/dir.c
@@ -3,16 +3,15 @@
dir.c -
$Author$
- $Date$
created at: Wed Jan 5 09:51:01 JST 1994
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby.h"
+#include "internal.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -29,12 +28,7 @@
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
-# if !defined __NeXT__
-# define NAMLEN(dirent) (dirent)->d_namlen
-# else
-# /* On some versions of NextStep, d_namlen is always zero, so avoid it. */
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-# endif
+# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -48,6 +42,10 @@
# include "win32/dir.h"
# endif
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/dirent.h"
+# include "nacl/stat.h"
+#endif
#include <errno.h>
@@ -56,29 +54,104 @@ char *getenv();
#endif
#ifndef HAVE_STRING_H
-char *strchr _((char*,char));
+char *strchr(char*,char);
#endif
#include <ctype.h>
-#include "util.h"
+#include "ruby/util.h"
+
+/* define system APIs */
+#ifdef _WIN32
+#undef chdir
+#define chdir(p) rb_w32_uchdir(p)
+#undef mkdir
+#define mkdir(p, m) rb_w32_umkdir((p), (m))
+#undef rmdir
+#define rmdir(p) rb_w32_urmdir(p)
+#undef opendir
+#define opendir(p) rb_w32_uopendir(p)
+#define IS_WIN32 1
+#else
+#define IS_WIN32 0
+#endif
-#if !defined HAVE_LSTAT && !defined lstat
-#define lstat stat
+#ifdef HAVE_SYS_ATTR_H
+#include <sys/attr.h>
+#endif
+
+#ifdef HAVE_GETATTRLIST
+# define USE_NAME_ON_FS 1
+# define RUP32(size) ((size)+3/4)
+# define SIZEUP32(type) RUP32(sizeof(type))
+#elif defined _WIN32
+# define USE_NAME_ON_FS 1
+#elif defined DOSISH
+# define USE_NAME_ON_FS 2 /* by fnmatch */
+#else
+# define USE_NAME_ON_FS 0
+#endif
+
+#ifdef __APPLE__
+# define NORMALIZE_UTF8PATH 1
+#else
+# define NORMALIZE_UTF8PATH 0
#endif
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH || defined __VMS
-# define CASEFOLD_FILESYSTEM 1
+#if NORMALIZE_UTF8PATH
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <sys/vnode.h>
+
+# if defined HAVE_FGETATTRLIST || !defined HAVE_GETATTRLIST
+# define need_normalization(dirp, path) need_normalization(dirp)
# else
-# define CASEFOLD_FILESYSTEM 0
+# define need_normalization(dirp, path) need_normalization(path)
# endif
+static inline int
+need_normalization(DIR *dirp, const char *path)
+{
+# if defined HAVE_FGETATTRLIST || defined HAVE_GETATTRLIST
+ u_int32_t attrbuf[SIZEUP32(fsobj_tag_t)];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_OBJTAG,};
+# if defined HAVE_FGETATTRLIST
+ int ret = fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), 0);
+# else
+ int ret = getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0);
+# endif
+ if (!ret) {
+ const fsobj_tag_t *tag = (void *)(attrbuf+1);
+ switch (*tag) {
+ case VT_HFS:
+ case VT_CIFS:
+ return TRUE;
+ }
+ }
+# endif
+ return FALSE;
+}
+
+static inline int
+has_nonascii(const char *ptr, size_t len)
+{
+ while (len > 0) {
+ if (!ISASCII(*ptr)) return 1;
+ ptr++;
+ --len;
+ }
+ return 0;
+}
+
+# define IF_NORMALIZE_UTF8PATH(something) something
+#else
+# define IF_NORMALIZE_UTF8PATH(something) /* nothing */
#endif
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_DOTMATCH 0x04
#define FNM_CASEFOLD 0x08
+#define FNM_EXTGLOB 0x10
#if CASEFOLD_FILESYSTEM
#define FNM_SYSCASE FNM_CASEFOLD
#else
@@ -88,102 +161,25 @@ char *strchr _((char*,char));
#define FNM_NOMATCH 1
#define FNM_ERROR 2
-#define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c))
-#define compare(c1, c2) (((unsigned char)(c1)) - ((unsigned char)(c2)))
-
-/* caution: in case *p == '\0'
- Next(p) == p + 1 in single byte environment
- Next(p) == p in multi byte environment
-*/
-#if defined(CharNext)
-# define Next(p) CharNext(p)
-#elif defined(DJGPP)
-# define Next(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
-#elif defined(__EMX__)
-# define Next(p) ((p) + emx_mblen(p))
-static inline int
-emx_mblen(const char *p)
-{
- int n = mblen(p, RUBY_MBCHAR_MAXSIZE);
- return (n < 0) ? 1 : n;
-}
-#endif
-
-#ifndef Next /* single byte environment */
-# define Next(p) ((p) + 1)
-# define Inc(p) (++(p))
-# define Compare(p1, p2) (compare(downcase(*(p1)), downcase(*(p2))))
-#else /* multi byte environment */
-# define Inc(p) ((p) = Next(p))
-# define Compare(p1, p2) (CompareImpl(p1, p2, nocase))
-static int
-CompareImpl(const char *p1, const char *p2, int nocase)
-{
- const int len1 = Next(p1) - p1;
- const int len2 = Next(p2) - p2;
-#ifdef _WIN32
- char buf1[10], buf2[10]; /* large enough? */
-#endif
-
- if (len1 < 0 || len2 < 0) {
- rb_fatal("CompareImpl: negative len");
- }
-
- if (len1 == 0) return len2;
- if (len2 == 0) return -len1;
-
-#ifdef _WIN32
- if (nocase && rb_w32_iswinnt()) {
- if (len1 > 1) {
- if (len1 >= sizeof(buf1)) {
- rb_fatal("CompareImpl: too large len");
- }
- memcpy(buf1, p1, len1);
- buf1[len1] = '\0';
- CharLower(buf1);
- p1 = buf1; /* trick */
- }
- if (len2 > 1) {
- if (len2 >= sizeof(buf2)) {
- rb_fatal("CompareImpl: too large len");
- }
- memcpy(buf2, p2, len2);
- buf2[len2] = '\0';
- CharLower(buf2);
- p2 = buf2; /* trick */
- }
- }
-#endif
- if (len1 == 1)
- if (len2 == 1)
- return compare(downcase(*p1), downcase(*p2));
- else {
- const int ret = compare(downcase(*p1), *p2);
- return ret ? ret : -1;
- }
- else
- if (len2 == 1) {
- const int ret = compare(*p1, downcase(*p2));
- return ret ? ret : 1;
- }
- else {
- const int ret = memcmp(p1, p2, len1 < len2 ? len1 : len2);
- return ret ? ret : len1 - len2;
- }
-}
-#endif /* environment */
+# define Next(p, e, enc) ((p)+ rb_enc_mbclen((p), (e), (enc)))
+# define Inc(p, e, enc) ((p) = Next((p), (e), (enc)))
static char *
-bracket(p, s, flags)
- const char *p; /* pattern (next to '[') */
- const char *s; /* string */
- int flags;
+bracket(
+ const char *p, /* pattern (next to '[') */
+ const char *pend,
+ const char *s, /* string */
+ const char *send,
+ int flags,
+ rb_encoding *enc)
{
const int nocase = flags & FNM_CASEFOLD;
const int escape = !(flags & FNM_NOESCAPE);
-
+ unsigned int c1, c2;
+ int r;
int ok = 0, not = 0;
+ if (p >= pend) return NULL;
if (*p == '!' || *p == '^') {
not = 1;
p++;
@@ -195,20 +191,43 @@ bracket(p, s, flags)
t1++;
if (!*t1)
return NULL;
- p = Next(t1);
+ p = t1 + (r = rb_enc_mbclen(t1, pend, enc));
+ if (p >= pend) return NULL;
if (p[0] == '-' && p[1] != ']') {
const char *t2 = p + 1;
+ int r2;
if (escape && *t2 == '\\')
t2++;
if (!*t2)
return NULL;
- p = Next(t2);
- if (!ok && Compare(t1, s) <= 0 && Compare(s, t2) <= 0)
+ p = t2 + (r2 = rb_enc_mbclen(t2, pend, enc));
+ if (ok) continue;
+ if ((r <= (send-s) && memcmp(t1, s, r) == 0) ||
+ (r2 <= (send-s) && memcmp(t2, s, r2) == 0)) {
ok = 1;
+ continue;
+ }
+ c1 = rb_enc_codepoint(s, send, enc);
+ if (nocase) c1 = rb_enc_toupper(c1, enc);
+ c2 = rb_enc_codepoint(t1, pend, enc);
+ if (nocase) c2 = rb_enc_toupper(c2, enc);
+ if (c1 < c2) continue;
+ c2 = rb_enc_codepoint(t2, pend, enc);
+ if (nocase) c2 = rb_enc_toupper(c2, enc);
+ if (c1 > c2) continue;
}
- else
- if (!ok && Compare(t1, s) == 0)
+ else {
+ if (ok) continue;
+ if (r <= (send-s) && memcmp(t1, s, r) == 0) {
ok = 1;
+ continue;
+ }
+ if (!nocase) continue;
+ c1 = rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc);
+ c2 = rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc);
+ if (c1 != c2) continue;
+ }
+ ok = 1;
}
return ok == not ? NULL : (char *)p + 1;
@@ -224,10 +243,11 @@ bracket(p, s, flags)
#define RETURN(val) return *pcur = p, *scur = s, (val);
static int
-fnmatch_helper(pcur, scur, flags)
- const char **pcur; /* pattern */
- const char **scur; /* string */
- int flags;
+fnmatch_helper(
+ const char **pcur, /* pattern */
+ const char **scur, /* string */
+ int flags,
+ rb_encoding *enc)
{
const int period = !(flags & FNM_DOTMATCH);
const int pathname = flags & FNM_PATHNAME;
@@ -238,7 +258,11 @@ fnmatch_helper(pcur, scur, flags)
const char *stmp = 0;
const char *p = *pcur;
+ const char *pend = p + strlen(p);
const char *s = *scur;
+ const char *send = s + strlen(s);
+
+ int r;
if (period && *s == '.' && *UNESCAPE(p) != '.') /* leading period */
RETURN(FNM_NOMATCH);
@@ -261,16 +285,16 @@ fnmatch_helper(pcur, scur, flags)
if (ISEND(s))
RETURN(FNM_NOMATCH);
p++;
- Inc(s);
+ Inc(s, send, enc);
continue;
case '[': {
const char *t;
if (ISEND(s))
RETURN(FNM_NOMATCH);
- if ((t = bracket(p + 1, s, flags)) != 0) {
+ if ((t = bracket(p + 1, pend, s, send, flags, enc)) != 0) {
p = t;
- Inc(s);
+ Inc(s, send, enc);
continue;
}
goto failed;
@@ -283,16 +307,26 @@ fnmatch_helper(pcur, scur, flags)
RETURN(ISEND(p) ? 0 : FNM_NOMATCH);
if (ISEND(p))
goto failed;
- if (Compare(p, s) != 0)
+ r = rb_enc_precise_mbclen(p, pend, enc);
+ if (!MBCLEN_CHARFOUND_P(r))
+ goto failed;
+ if (r <= (send-s) && memcmp(p, s, r) == 0) {
+ p += r;
+ s += r;
+ continue;
+ }
+ if (!nocase) goto failed;
+ if (rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc) !=
+ rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc))
goto failed;
- Inc(p);
- Inc(s);
+ p += r;
+ Inc(s, send, enc);
continue;
failed: /* try next '*' position */
if (ptmp && stmp) {
p = ptmp;
- Inc(stmp); /* !ISEND(*stmp) */
+ Inc(stmp, send, enc); /* !ISEND(*stmp) */
s = stmp;
continue;
}
@@ -301,11 +335,15 @@ fnmatch_helper(pcur, scur, flags)
}
static int
-fnmatch(p, s, flags)
- const char *p; /* pattern */
- const char *s; /* string */
- int flags;
+fnmatch(
+ const char *pattern,
+ rb_encoding *enc,
+ const char *string,
+ int flags)
{
+ const char *p = pattern;
+ const char *s = string;
+ const char *send = s + strlen(string);
const int period = !(flags & FNM_DOTMATCH);
const int pathname = flags & FNM_PATHNAME;
@@ -319,8 +357,8 @@ fnmatch(p, s, flags)
ptmp = p;
stmp = s;
}
- if (fnmatch_helper(&p, &s, flags) == 0) {
- while (*s && *s != '/') Inc(s);
+ if (fnmatch_helper(&p, &s, flags, enc) == 0) {
+ while (*s && *s != '/') Inc(s, send, enc);
if (*p && *s) {
p++;
s++;
@@ -331,7 +369,7 @@ fnmatch(p, s, flags)
}
/* failed : try next recursion */
if (ptmp && stmp && !(period && *stmp == '.')) {
- while (*stmp && *stmp != '/') Inc(stmp);
+ while (*stmp && *stmp != '/') Inc(stmp, send, enc);
if (*stmp) {
p = ptmp;
stmp++;
@@ -343,39 +381,66 @@ fnmatch(p, s, flags)
}
}
else
- return fnmatch_helper(&p, &s, flags);
+ return fnmatch_helper(&p, &s, flags, enc);
}
VALUE rb_cDir;
struct dir_data {
DIR *dir;
- char *path;
+ VALUE path;
+ rb_encoding *enc;
};
static void
-free_dir(dir)
- struct dir_data *dir;
+dir_mark(void *ptr)
{
+ struct dir_data *dir = ptr;
+ rb_gc_mark(dir->path);
+}
+
+static void
+dir_free(void *ptr)
+{
+ struct dir_data *dir = ptr;
if (dir) {
if (dir->dir) closedir(dir->dir);
- if (dir->path) free(dir->path);
}
- free(dir);
+ xfree(dir);
+}
+
+static size_t
+dir_memsize(const void *ptr)
+{
+ return ptr ? sizeof(struct dir_data) : 0;
}
-static VALUE dir_close _((VALUE));
+static const rb_data_type_t dir_data_type = {
+ "dir",
+ {dir_mark, dir_free, dir_memsize,},
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+};
+
+static VALUE dir_close(VALUE);
+
+#define GlobPathValue(str, safe) \
+ /* can contain null bytes as separators */ \
+ (!RB_TYPE_P((str), T_STRING) ? \
+ (void)FilePathValue(str) : \
+ (void)(check_safe_glob((str), (safe)), \
+ check_glob_encoding(str), (str)))
+#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0)
+#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding()))
-static VALUE dir_s_alloc _((VALUE));
static VALUE
-dir_s_alloc(klass)
- VALUE klass;
+dir_s_alloc(VALUE klass)
{
struct dir_data *dirp;
- VALUE obj = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dirp);
+ VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp);
dirp->dir = NULL;
- dirp->path = NULL;
+ dirp->path = Qnil;
+ dirp->enc = NULL;
return obj;
}
@@ -383,40 +448,83 @@ dir_s_alloc(klass)
/*
* call-seq:
* Dir.new( string ) -> aDir
+ * Dir.new( string, encoding: enc ) -> aDir
*
* Returns a new directory object for the named directory.
+ *
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
+ * If not specified, the filesystem encoding is used.
*/
static VALUE
-dir_initialize(dir, dirname)
- VALUE dir, dirname;
+dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
+ rb_encoding *fsenc;
+ VALUE dirname, opt, orig;
+ static ID keyword_ids[1];
+ const char *path;
+
+ if (!keyword_ids[0]) {
+ keyword_ids[0] = rb_intern("encoding");
+ }
+
+ fsenc = rb_filesystem_encoding();
+
+ rb_scan_args(argc, argv, "1:", &dirname, &opt);
- SafeStringValue(dirname);
- Data_Get_Struct(dir, struct dir_data, dp);
+ if (!NIL_P(opt)) {
+ VALUE enc;
+ rb_get_kwargs(opt, keyword_ids, 0, 1, &enc);
+ if (enc != Qundef && !NIL_P(enc)) {
+ fsenc = rb_to_encoding(enc);
+ }
+ }
+
+ GlobPathValue(dirname, FALSE);
+ orig = rb_str_dup_frozen(dirname);
+ dirname = rb_str_encode_ospath(dirname);
+ dirname = rb_str_dup_frozen(dirname);
+
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dp);
if (dp->dir) closedir(dp->dir);
- if (dp->path) free(dp->path);
dp->dir = NULL;
- dp->path = NULL;
- dp->dir = opendir(RSTRING(dirname)->ptr);
+ dp->path = Qnil;
+ dp->enc = fsenc;
+ path = RSTRING_PTR(dirname);
+ dp->dir = opendir(path);
if (dp->dir == NULL) {
if (errno == EMFILE || errno == ENFILE) {
rb_gc();
- dp->dir = opendir(RSTRING(dirname)->ptr);
+ dp->dir = opendir(path);
+ }
+#ifdef HAVE_GETATTRLIST
+ else if (errno == EIO) {
+ u_int32_t attrbuf[1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0};
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW) == 0) {
+ dp->dir = opendir(path);
+ }
}
+#endif
if (dp->dir == NULL) {
- rb_sys_fail(RSTRING(dirname)->ptr);
+ RB_GC_GUARD(dirname);
+ rb_sys_fail_path(orig);
}
}
- dp->path = strdup(RSTRING(dirname)->ptr);
+ dp->path = orig;
return dir;
}
/*
* call-seq:
- * Dir.open( string ) => aDir
- * Dir.open( string ) {| aDir | block } => anObject
+ * Dir.open( string ) -> aDir
+ * Dir.open( string, encoding: enc ) -> aDir
+ * Dir.open( string ) {| aDir | block } -> anObject
+ * Dir.open( string, encoding: enc ) {| aDir | block } -> anObject
+ *
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
+ * If not specified, the filesystem encoding is used.
*
* With no block, <code>open</code> is a synonym for
* <code>Dir::new</code>. If a block is present, it is passed
@@ -424,15 +532,13 @@ dir_initialize(dir, dirname)
* the block, and <code>Dir::open</code> returns the value of the
* block.
*/
-
static VALUE
-dir_s_open(klass, dirname)
- VALUE klass, dirname;
+dir_s_open(int argc, VALUE *argv, VALUE klass)
{
struct dir_data *dp;
- VALUE dir = Data_Make_Struct(klass, struct dir_data, 0, free_dir, dp);
+ VALUE dir = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dp);
- dir_initialize(dir, dirname);
+ dir_initialize(argc, argv, dir);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, dir, dir_close, dir);
}
@@ -441,52 +547,82 @@ dir_s_open(klass, dirname)
}
static void
-dir_closed()
+dir_closed(void)
{
rb_raise(rb_eIOError, "closed directory");
}
-static void
-dir_check(dir)
- VALUE dir;
+static struct dir_data *
+dir_check(VALUE dir)
{
- if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir");
+ struct dir_data *dirp;
rb_check_frozen(dir);
+ dirp = rb_check_typeddata(dir, &dir_data_type);
+ if (!dirp->dir) dir_closed();
+ return dirp;
}
-#define GetDIR(obj, dirp) do {\
- dir_check(dir);\
- Data_Get_Struct(obj, struct dir_data, dirp);\
- if (dirp->dir == NULL) dir_closed();\
-} while (0)
+#define GetDIR(obj, dirp) ((dirp) = dir_check(obj))
+
/*
* call-seq:
- * dir.inspect => string
+ * dir.inspect -> string
*
* Return a string describing this Dir object.
*/
static VALUE
-dir_inspect(dir)
- VALUE dir;
+dir_inspect(VALUE dir)
{
struct dir_data *dirp;
- Data_Get_Struct(dir, struct dir_data, dirp);
- if (dirp->path) {
- const char *c = rb_obj_classname(dir);
- int len = strlen(c) + strlen(dirp->path) + 4;
- VALUE s = rb_str_new(0, len);
- snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
- return s;
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
+ if (!NIL_P(dirp->path)) {
+ VALUE str = rb_str_new_cstr("#<");
+ rb_str_append(str, rb_class_name(CLASS_OF(dir)));
+ rb_str_cat2(str, ":");
+ rb_str_append(str, dirp->path);
+ rb_str_cat2(str, ">");
+ return str;
}
return rb_funcall(dir, rb_intern("to_s"), 0, 0);
}
+#ifdef HAVE_DIRFD
+/*
+ * call-seq:
+ * dir.fileno -> integer
+ *
+ * Returns the file descriptor used in <em>dir</em>.
+ *
+ * d = Dir.new("..")
+ * d.fileno #=> 8
+ *
+ * This method uses dirfd() function defined by POSIX 2008.
+ * NotImplementedError is raised on other platforms, such as Windows,
+ * which doesn't provide the function.
+ *
+ */
+static VALUE
+dir_fileno(VALUE dir)
+{
+ struct dir_data *dirp;
+ int fd;
+
+ GetDIR(dir, dirp);
+ fd = dirfd(dirp->dir);
+ if (fd == -1)
+ rb_sys_fail("dirfd");
+ return INT2NUM(fd);
+}
+#else
+#define dir_fileno rb_f_notimplement
+#endif
+
/*
* call-seq:
- * dir.path => string or nil
+ * dir.path -> string or nil
+ * dir.to_path -> string or nil
*
* Returns the path parameter passed to <em>dir</em>'s constructor.
*
@@ -494,19 +630,24 @@ dir_inspect(dir)
* d.path #=> ".."
*/
static VALUE
-dir_path(dir)
- VALUE dir;
+dir_path(VALUE dir)
{
struct dir_data *dirp;
- Data_Get_Struct(dir, struct dir_data, dirp);
- if (!dirp->path) return Qnil;
- return rb_str_new2(dirp->path);
+ TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
+ if (NIL_P(dirp->path)) return Qnil;
+ return rb_str_dup(dirp->path);
}
+#if defined _WIN32
+# define READDIR(dir, enc) rb_w32_readdir((dir), (enc))
+#else
+# define READDIR(dir, enc) readdir((dir))
+#endif
+
/*
* call-seq:
- * dir.read => string or nil
+ * dir.read -> string or nil
*
* Reads the next entry from <em>dir</em> and returns it as a string.
* Returns <code>nil</code> at the end of the stream.
@@ -517,34 +658,32 @@ dir_path(dir)
* d.read #=> "config.h"
*/
static VALUE
-dir_read(dir)
- VALUE dir;
+dir_read(VALUE dir)
{
struct dir_data *dirp;
struct dirent *dp;
GetDIR(dir, dirp);
errno = 0;
- dp = readdir(dirp->dir);
- if (dp) {
- return rb_tainted_str_new(dp->d_name, NAMLEN(dp));
- }
- else if (errno == 0) { /* end of stream */
- return Qnil;
+ if ((dp = READDIR(dirp->dir, dirp->enc)) != NULL) {
+ return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc);
}
else {
- rb_sys_fail(0);
+ if (errno != 0) rb_sys_fail(0);
+ return Qnil; /* end of stream */
}
- return Qnil; /* not reached */
}
/*
* call-seq:
- * dir.each { |filename| block } => dir
+ * dir.each { |filename| block } -> dir
+ * dir.each -> an_enumerator
*
* Calls the block once for each entry in this directory, passing the
* filename of each entry as a parameter to the block.
*
+ * If no block is given, an enumerator is returned instead.
+ *
* d = Dir.new("testdir")
* d.each {|x| puts "Got #{x}" }
*
@@ -556,26 +695,39 @@ dir_read(dir)
* Got main.rb
*/
static VALUE
-dir_each(dir)
- VALUE dir;
+dir_each(VALUE dir)
{
struct dir_data *dirp;
struct dirent *dp;
+ IF_NORMALIZE_UTF8PATH(int norm_p);
RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
- for (dp = readdir(dirp->dir); dp != NULL; dp = readdir(dirp->dir)) {
- rb_yield(rb_tainted_str_new(dp->d_name, NAMLEN(dp)));
+ IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir, RSTRING_PTR(dirp->path)));
+ while ((dp = READDIR(dirp->dir, dirp->enc)) != NULL) {
+ const char *name = dp->d_name;
+ size_t namlen = NAMLEN(dp);
+ VALUE path;
+#if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, namlen) &&
+ !NIL_P(path = rb_str_normalize_ospath(name, namlen))) {
+ path = rb_external_str_with_enc(path, dirp->enc);
+ }
+ else
+#endif
+ path = rb_external_str_new_with_enc(name, namlen, dirp->enc);
+ rb_yield(path);
if (dirp->dir == NULL) dir_closed();
}
return dir;
}
+#ifdef HAVE_TELLDIR
/*
* call-seq:
- * dir.pos => integer
- * dir.tell => integer
+ * dir.pos -> integer
+ * dir.tell -> integer
*
* Returns the current position in <em>dir</em>. See also
* <code>Dir#seek</code>.
@@ -586,24 +738,23 @@ dir_each(dir)
* d.tell #=> 12
*/
static VALUE
-dir_tell(dir)
- VALUE dir;
+dir_tell(VALUE dir)
{
-#ifdef HAVE_TELLDIR
struct dir_data *dirp;
long pos;
GetDIR(dir, dirp);
pos = telldir(dirp->dir);
return rb_int2inum(pos);
+}
#else
- rb_notimplement();
+#define dir_tell rb_f_notimplement
#endif
-}
+#ifdef HAVE_SEEKDIR
/*
* call-seq:
- * dir.seek( integer ) => dir
+ * dir.seek( integer ) -> dir
*
* Seeks to a particular location in <em>dir</em>. <i>integer</i>
* must be a value returned by <code>Dir#tell</code>.
@@ -616,24 +767,23 @@ dir_tell(dir)
* d.read #=> ".."
*/
static VALUE
-dir_seek(dir, pos)
- VALUE dir, pos;
+dir_seek(VALUE dir, VALUE pos)
{
struct dir_data *dirp;
- off_t p = NUM2OFFT(pos);
+ long p = NUM2LONG(pos);
GetDIR(dir, dirp);
-#ifdef HAVE_SEEKDIR
seekdir(dirp->dir, p);
return dir;
+}
#else
- rb_notimplement();
+#define dir_seek rb_f_notimplement
#endif
-}
+#ifdef HAVE_SEEKDIR
/*
* call-seq:
- * dir.pos( integer ) => integer
+ * dir.pos = integer -> integer
*
* Synonym for <code>Dir#seek</code>, but returns the position
* parameter.
@@ -646,16 +796,18 @@ dir_seek(dir, pos)
* d.read #=> ".."
*/
static VALUE
-dir_set_pos(dir, pos)
- VALUE dir, pos;
+dir_set_pos(VALUE dir, VALUE pos)
{
dir_seek(dir, pos);
return pos;
}
+#else
+#define dir_set_pos rb_f_notimplement
+#endif
/*
* call-seq:
- * dir.rewind => dir
+ * dir.rewind -> dir
*
* Repositions <em>dir</em> to the first entry.
*
@@ -665,14 +817,10 @@ dir_set_pos(dir, pos)
* d.read #=> "."
*/
static VALUE
-dir_rewind(dir)
- VALUE dir;
+dir_rewind(VALUE dir)
{
struct dir_data *dirp;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) {
- rb_raise(rb_eSecurityError, "Insecure: can't close");
- }
GetDIR(dir, dirp);
rewinddir(dirp->dir);
return dir;
@@ -680,7 +828,7 @@ dir_rewind(dir)
/*
* call-seq:
- * dir.close => nil
+ * dir.close -> nil
*
* Closes the directory stream. Any further attempts to access
* <em>dir</em> will raise an <code>IOError</code>.
@@ -689,8 +837,7 @@ dir_rewind(dir)
* d.close #=> nil
*/
static VALUE
-dir_close(dir)
- VALUE dir;
+dir_close(VALUE dir)
{
struct dir_data *dirp;
@@ -702,11 +849,10 @@ dir_close(dir)
}
static void
-dir_chdir(path)
- VALUE path;
+dir_chdir(VALUE path)
{
- if (chdir(RSTRING(path)->ptr) < 0)
- rb_sys_fail(RSTRING(path)->ptr);
+ if (chdir(RSTRING_PTR(path)) < 0)
+ rb_sys_fail_path(path);
}
static int chdir_blocking = 0;
@@ -718,11 +864,10 @@ struct chdir_data {
};
static VALUE
-chdir_yield(args)
- struct chdir_data *args;
+chdir_yield(struct chdir_data *args)
{
dir_chdir(args->new_path);
- args->done = Qtrue;
+ args->done = TRUE;
chdir_blocking++;
if (chdir_thread == Qnil)
chdir_thread = rb_thread_current();
@@ -730,8 +875,7 @@ chdir_yield(args)
}
static VALUE
-chdir_restore(args)
- struct chdir_data *args;
+chdir_restore(struct chdir_data *args)
{
if (args->done) {
chdir_blocking--;
@@ -744,8 +888,8 @@ chdir_restore(args)
/*
* call-seq:
- * Dir.chdir( [ string] ) => 0
- * Dir.chdir( [ string] ) {| path | block } => anObject
+ * Dir.chdir( [ string] ) -> 0
+ * Dir.chdir( [ string] ) {| path | block } -> anObject
*
* Changes the current working directory of the process to the given
* string. When called without an argument, changes the directory to
@@ -782,16 +926,14 @@ chdir_restore(args)
* /var/spool/mail
*/
static VALUE
-dir_s_chdir(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+dir_s_chdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path = Qnil;
rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
- SafeStringValue(path);
+ FilePathValue(path);
+ path = rb_str_encode_ospath(path);
}
else {
const char *dist = getenv("HOME");
@@ -809,11 +951,10 @@ dir_s_chdir(argc, argv, obj)
if (rb_block_given_p()) {
struct chdir_data args;
- char *cwd = my_getcwd();
- args.old_path = rb_tainted_str_new2(cwd); free(cwd);
+ args.old_path = rb_str_encode_ospath(rb_dir_getwd());
args.new_path = path;
- args.done = Qfalse;
+ args.done = FALSE;
return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args);
}
dir_chdir(path);
@@ -821,50 +962,62 @@ dir_s_chdir(argc, argv, obj)
return INT2FIX(0);
}
+VALUE
+rb_dir_getwd(void)
+{
+ char *path;
+ VALUE cwd;
+
+ path = my_getcwd();
+ cwd = rb_tainted_str_new2(path);
+ rb_enc_associate(cwd, rb_filesystem_encoding());
+
+ xfree(path);
+ return cwd;
+}
+
/*
* call-seq:
- * Dir.getwd => string
- * Dir.pwd => string
+ * Dir.getwd -> string
+ * Dir.pwd -> string
*
* Returns the path to the current working directory of this process as
* a string.
*
* Dir.chdir("/tmp") #=> 0
* Dir.getwd #=> "/tmp"
+ * Dir.pwd #=> "/tmp"
*/
static VALUE
-dir_s_getwd(dir)
- VALUE dir;
+dir_s_getwd(VALUE dir)
{
- char *path;
- VALUE cwd;
-
- rb_secure(4);
- path = my_getcwd();
- cwd = rb_tainted_str_new2(path);
-
- free(path);
- return cwd;
+ return rb_dir_getwd();
}
-static void check_dirname _((volatile VALUE *));
static void
-check_dirname(dir)
- volatile VALUE *dir;
+check_dirname(volatile VALUE *dir)
{
+ VALUE d = *dir;
char *path, *pend;
+ long len;
+ rb_encoding *enc;
- SafeStringValue(*dir);
rb_secure(2);
- path = RSTRING(*dir)->ptr;
- if (path && *(pend = rb_path_end(rb_path_skip_prefix(path)))) {
- *dir = rb_str_new(path, pend - path);
+ FilePathValue(d);
+ enc = rb_enc_get(d);
+ RSTRING_GETMEM(d, path, len);
+ pend = path + len;
+ pend = rb_enc_path_end(rb_enc_path_skip_prefix(path, pend, enc), pend, enc);
+ if (pend - path < len) {
+ d = rb_str_subseq(d, 0, pend - path);
}
+ *dir = rb_str_encode_ospath(d);
}
+#if defined(HAVE_CHROOT)
/*
* call-seq:
- * Dir.chroot( string ) => 0
+ * Dir.chroot( string ) -> 0
*
* Changes this process's idea of the file system root. Only a
* privileged process may make this call. Not available on all
@@ -872,25 +1025,21 @@ check_dirname(dir)
* information.
*/
static VALUE
-dir_s_chroot(dir, path)
- VALUE dir, path;
+dir_s_chroot(VALUE dir, VALUE path)
{
-#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
check_dirname(&path);
-
- if (chroot(RSTRING(path)->ptr) == -1)
- rb_sys_fail(RSTRING(path)->ptr);
+ if (chroot(RSTRING_PTR(path)) == -1)
+ rb_sys_fail_path(path);
return INT2FIX(0);
+}
#else
- rb_notimplement();
- return Qnil; /* not reached */
+#define dir_s_chroot rb_f_notimplement
#endif
-}
/*
* call-seq:
- * Dir.mkdir( string [, integer] ) => 0
+ * Dir.mkdir( string [, integer] ) -> 0
*
* Makes a new directory named by <i>string</i>, with permissions
* specified by the optional parameter <i>anInteger</i>. The
@@ -900,12 +1049,11 @@ dir_s_chroot(dir, path)
* also the discussion of permissions in the class documentation for
* <code>File</code>.
*
+ * Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0
+ *
*/
static VALUE
-dir_s_mkdir(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path, vmode;
int mode;
@@ -918,46 +1066,76 @@ dir_s_mkdir(argc, argv, obj)
}
check_dirname(&path);
- if (mkdir(RSTRING(path)->ptr, mode) == -1)
- rb_sys_fail(RSTRING(path)->ptr);
+ if (mkdir(RSTRING_PTR(path), mode) == -1)
+ rb_sys_fail_path(path);
return INT2FIX(0);
}
/*
* call-seq:
- * Dir.delete( string ) => 0
- * Dir.rmdir( string ) => 0
- * Dir.unlink( string ) => 0
+ * Dir.delete( string ) -> 0
+ * Dir.rmdir( string ) -> 0
+ * Dir.unlink( string ) -> 0
*
* Deletes the named directory. Raises a subclass of
* <code>SystemCallError</code> if the directory isn't empty.
*/
static VALUE
-dir_s_rmdir(obj, dir)
- VALUE obj, dir;
+dir_s_rmdir(VALUE obj, VALUE dir)
{
check_dirname(&dir);
- if (rmdir(RSTRING(dir)->ptr) < 0)
- rb_sys_fail(RSTRING(dir)->ptr);
+ if (rmdir(RSTRING_PTR(dir)) < 0)
+ rb_sys_fail_path(dir);
return INT2FIX(0);
}
+struct warning_args {
+#ifdef RUBY_FUNCTION_NAME_STRING
+ const char *func;
+#endif
+ const char *mesg;
+ rb_encoding *enc;
+};
+
+#ifndef RUBY_FUNCTION_NAME_STRING
+#define sys_enc_warning_in(func, mesg, enc) sys_enc_warning(mesg, enc)
+#endif
+
+static VALUE
+sys_warning_1(VALUE mesg)
+{
+ const struct warning_args *arg = (struct warning_args *)mesg;
+#ifdef RUBY_FUNCTION_NAME_STRING
+ rb_sys_enc_warning(arg->enc, "%s: %s", arg->func, arg->mesg);
+#else
+ rb_sys_enc_warning(arg->enc, "%s", arg->mesg);
+#endif
+ return Qnil;
+}
+
static void
-sys_warning_1(mesg)
- const char* mesg;
+sys_enc_warning_in(const char *func, const char *mesg, rb_encoding *enc)
{
- rb_sys_warning("%s", mesg);
+ struct warning_args arg;
+#ifdef RUBY_FUNCTION_NAME_STRING
+ arg.func = func;
+#endif
+ arg.mesg = mesg;
+ arg.enc = enc;
+ rb_protect(sys_warning_1, (VALUE)&arg, 0);
}
-#define GLOB_VERBOSE (1UL << (sizeof(int) * CHAR_BIT - 1))
-#define sys_warning(val) \
- (void)((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)_((VALUE)))sys_warning_1, (VALUE)(val), 0))
+#define GLOB_VERBOSE (1U << (sizeof(int) * CHAR_BIT - 1))
+#define sys_warning(val, enc) \
+ ((flags & GLOB_VERBOSE) ? sys_enc_warning_in(RUBY_FUNCTION_NAME_STRING, (val), (enc)) :(void)0)
-#define GLOB_ALLOC(type) (type *)malloc(sizeof(type))
-#define GLOB_ALLOC_N(type, n) (type *)malloc(sizeof(type) * (n))
-#define GLOB_JUMP_TAG(status) ((status == -1) ? rb_memerror() : rb_jump_tag(status))
+#define GLOB_ALLOC(type) ((type *)malloc(sizeof(type)))
+#define GLOB_ALLOC_N(type, n) ((type *)malloc(sizeof(type) * (n)))
+#define GLOB_REALLOC(ptr, size) realloc((ptr), (size))
+#define GLOB_FREE(ptr) free(ptr)
+#define GLOB_JUMP_TAG(status) (((status) == -1) ? rb_memerror() : rb_jump_tag(status))
/*
* ENOTDIR can be returned by stat(2) if a non-leaf element of the path
@@ -965,80 +1143,112 @@ sys_warning_1(mesg)
*/
#define to_be_ignored(e) ((e) == ENOENT || (e) == ENOTDIR)
+#ifdef _WIN32
+#define STAT(p, s) rb_w32_ustati64((p), (s))
+#else
+#define STAT(p, s) stat((p), (s))
+#endif
+
/* System call with warning */
static int
-do_stat(const char *path, struct stat *pst, int flags)
-
+do_stat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
- int ret = stat(path, pst);
+ int ret = STAT(path, pst);
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
return ret;
}
+#if defined HAVE_LSTAT || defined lstat
static int
-do_lstat(const char *path, struct stat *pst, int flags)
+do_lstat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
int ret = lstat(path, pst);
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
return ret;
}
+#else
+#define do_lstat do_stat
+#endif
static DIR *
-do_opendir(const char *path, int flags)
+do_opendir(const char *path, int flags, rb_encoding *enc)
{
- DIR *dirp = opendir(path);
+ DIR *dirp;
+#ifdef _WIN32
+ VALUE tmp = 0;
+ if (enc != rb_usascii_encoding() &&
+ enc != rb_ascii8bit_encoding() &&
+ enc != rb_utf8_encoding()) {
+ tmp = rb_enc_str_new(path, strlen(path), enc);
+ tmp = rb_str_encode_ospath(tmp);
+ path = RSTRING_PTR(tmp);
+ }
+#endif
+ dirp = opendir(path);
if (dirp == NULL && !to_be_ignored(errno))
- sys_warning(path);
+ sys_warning(path, enc);
+#ifdef _WIN32
+ if (tmp) rb_str_resize(tmp, 0); /* GC guard */
+#endif
return dirp;
}
+/* Globing pattern */
+enum glob_pattern_type { PLAIN, ALPHA, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
+
/* Return nonzero if S has any special globbing chars in it. */
-static int
-has_magic(s, flags)
- const char *s;
- int flags;
+static enum glob_pattern_type
+has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
- const int nocase = flags & FNM_CASEFOLD;
+ int hasalpha = 0;
- register const char *p = s;
register char c;
- while ((c = *p++) != 0) {
+ while (p < pend && (c = *p++) != 0) {
switch (c) {
case '*':
case '?':
case '[':
- return 1;
+ return MAGICAL;
case '\\':
- if (escape && !(c = *p++))
- return 0;
- continue;
+ if (escape && p++ >= pend)
+ continue;
+ break;
+#ifdef _WIN32
+ case '.':
+ break;
+
+ case '~':
+ hasalpha = 1;
+ break;
+#endif
default:
- if (!FNM_SYSCASE && ISALPHA(c) && nocase)
- return 1;
+ if (IS_WIN32 || ISALPHA(c)) {
+ hasalpha = 1;
+ }
+ break;
}
- p = Next(p-1);
+ p = Next(p-1, pend, enc);
}
- return 0;
+ return hasalpha ? ALPHA : PLAIN;
}
/* Find separator in globbing pattern. */
static char *
-find_dirsep(const char *s, int flags)
+find_dirsep(const char *p, const char *pend, int flags, rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
- register const char *p = s;
register char c;
int open = 0;
@@ -1062,16 +1272,15 @@ find_dirsep(const char *s, int flags)
continue;
}
- p = Next(p-1);
+ p = Next(p-1, pend, enc);
}
return (char *)p-1;
}
/* Remove escaping backslashes */
-static void
-remove_backslashes(p)
- char *p;
+static char *
+remove_backslashes(char *p, register const char *pend, rb_encoding *enc)
{
char *t = p;
char *s = p;
@@ -1084,17 +1293,16 @@ remove_backslashes(p)
s = ++p;
if (!*p) break;
}
- Inc(p);
+ Inc(p, pend, enc);
}
while (*p++);
if (t != s)
memmove(t, s, p - s); /* move '\0' too */
-}
-/* Globing pattern */
-enum glob_pattern_type { PLAIN, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
+ return p;
+}
struct glob_pattern {
char *str;
@@ -1105,31 +1313,44 @@ struct glob_pattern {
static void glob_free_pattern(struct glob_pattern *list);
static struct glob_pattern *
-glob_make_pattern(const char *p, int flags)
+glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
{
struct glob_pattern *list, *tmp, **tail = &list;
int dirsep = 0; /* pattern is terminated with '/' */
+ int recursive = 0;
- while (*p) {
+ while (p < e && *p) {
tmp = GLOB_ALLOC(struct glob_pattern);
if (!tmp) goto error;
- if (p[0] == '*' && p[1] == '*' && p[2] == '/') {
+ if (p + 2 < e && p[0] == '*' && p[1] == '*' && p[2] == '/') {
/* fold continuous RECURSIVEs (needed in glob_helper) */
- do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
+ do { p += 3; while (*p == '/') p++; } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
tmp->type = RECURSIVE;
tmp->str = 0;
dirsep = 1;
+ recursive = 1;
}
else {
- const char *m = find_dirsep(p, flags);
- char *buf = GLOB_ALLOC_N(char, m-p+1);
+ const char *m = find_dirsep(p, e, flags, enc);
+ const enum glob_pattern_type magic = has_magic(p, m, flags, enc);
+ const enum glob_pattern_type non_magic = (USE_NAME_ON_FS || FNM_SYSCASE) ? PLAIN : ALPHA;
+ char *buf;
+
+ if (!(FNM_SYSCASE || magic > non_magic) && !recursive && *m) {
+ const char *m2;
+ while (has_magic(m+1, m2 = find_dirsep(m+1, e, flags, enc), flags, enc) <= non_magic &&
+ *m2) {
+ m = m2;
+ }
+ }
+ buf = GLOB_ALLOC_N(char, m-p+1);
if (!buf) {
- free(tmp);
+ GLOB_FREE(tmp);
goto error;
}
memcpy(buf, p, m-p);
buf[m-p] = '\0';
- tmp->type = has_magic(buf, flags) ? MAGICAL : PLAIN;
+ tmp->type = magic > MAGICAL ? MAGICAL : magic > non_magic ? magic : PLAIN;
tmp->str = buf;
if (*m) {
dirsep = 1;
@@ -1166,80 +1387,195 @@ glob_free_pattern(struct glob_pattern *list)
struct glob_pattern *tmp = list;
list = list->next;
if (tmp->str)
- free(tmp->str);
- free(tmp);
+ GLOB_FREE(tmp->str);
+ GLOB_FREE(tmp);
}
}
static char *
-join_path(const char *path, int dirsep, const char *name)
+join_path(const char *path, long len, int dirsep, const char *name, size_t namlen)
{
- long len = strlen(path);
- char *buf = GLOB_ALLOC_N(char, len+strlen(name)+(dirsep?1:0)+1);
+ char *buf = GLOB_ALLOC_N(char, len+namlen+(dirsep?1:0)+1);
if (!buf) return 0;
memcpy(buf, path, len);
if (dirsep) {
- strcpy(buf+len, "/");
- len++;
+ buf[len++] = '/';
}
- strcpy(buf+len, name);
+ memcpy(buf+len, name, namlen);
+ buf[len+namlen] = '\0';
return buf;
}
-enum answer { YES, NO, UNKNOWN };
+#ifdef HAVE_GETATTRLIST
+static int
+is_case_sensitive(DIR *dirp)
+{
+ u_int32_t attrbuf[SIZEUP32(vol_capabilities_attr_t) + 1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, 0, ATTR_VOL_INFO|ATTR_VOL_CAPABILITIES};
+ const vol_capabilities_attr_t *cap = (void *)(attrbuf+1);
+ const int idx = VOL_CAPABILITIES_FORMAT;
+ const uint32_t mask = VOL_CAP_FMT_CASE_SENSITIVE;
+ struct statfs sf;
+
+ if (fstatfs(dirfd(dirp), &sf)) return -1;
+ if (getattrlist(sf.f_mntonname, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+ return -1;
+ if (!(cap->valid[idx] & mask))
+ return -1;
+ return (cap->capabilities[idx] & mask) != 0;
+}
+
+static char *
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p)
+{
+ u_int32_t attrbuf[SIZEUP32(attrreference_t) + RUP32(MAXPATHLEN * 3) + 1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_NAME};
+ const attrreference_t *ar = (void *)(attrbuf+1);
+ const char *name;
+ long len;
+ char *tmp;
+ IF_NORMALIZE_UTF8PATH(VALUE utf8str = Qnil);
+
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+ return path;
+
+ name = (char *)ar + ar->attr_dataoffset;
+ len = (long)ar->attr_length - 1;
+ if (name + len > (char *)attrbuf + sizeof(attrbuf))
+ return path;
+
+# if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, len)) {
+ if (!NIL_P(utf8str = rb_str_normalize_ospath(name, len))) {
+ RSTRING_GETMEM(utf8str, name, len);
+ }
+ }
+# endif
+
+ tmp = GLOB_REALLOC(path, base + len + 1);
+ if (tmp) {
+ path = tmp;
+ memcpy(path + base, name, len);
+ path[base + len] = '\0';
+ }
+ IF_NORMALIZE_UTF8PATH(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
+ return path;
+}
+#elif defined _WIN32
+VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
+
+static char *
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p)
+{
+ char *plainname = path;
+ volatile VALUE tmp = 0;
+ WIN32_FIND_DATAW fd;
+ WIN32_FILE_ATTRIBUTE_DATA fa;
+ WCHAR *wplain;
+ HANDLE h = INVALID_HANDLE_VALUE;
+ long wlen;
+ if (enc &&
+ enc != rb_usascii_encoding() &&
+ enc != rb_ascii8bit_encoding() &&
+ enc != rb_utf8_encoding()) {
+ tmp = rb_enc_str_new_cstr(plainname, enc);
+ tmp = rb_str_encode_ospath(tmp);
+ plainname = RSTRING_PTR(tmp);
+ }
+ wplain = rb_w32_mbstr_to_wstr(CP_UTF8, plainname, -1, &wlen);
+ if (tmp) rb_str_resize(tmp, 0);
+ if (!wplain) return path;
+ if (GetFileAttributesExW(wplain, GetFileExInfoStandard, &fa))
+ h = FindFirstFileW(wplain, &fd);
+ free(wplain);
+ if (h == INVALID_HANDLE_VALUE) return path;
+ FindClose(h);
+ if (tmp) {
+ char *buf;
+ tmp = rb_w32_conv_from_wchar(fd.cFileName, enc);
+ wlen = RSTRING_LEN(tmp);
+ buf = GLOB_REALLOC(path, base + wlen + 1);
+ if (buf) {
+ path = buf;
+ memcpy(path + base, RSTRING_PTR(tmp), wlen);
+ path[base + wlen] = 0;
+ }
+ rb_str_resize(tmp, 0);
+ }
+ else {
+ char *utf8filename;
+ wlen = WideCharToMultiByte(CP_UTF8, 0, fd.cFileName, -1, NULL, 0, NULL, NULL);
+ utf8filename = GLOB_REALLOC(0, wlen);
+ if (utf8filename) {
+ char *buf;
+ WideCharToMultiByte(CP_UTF8, 0, fd.cFileName, -1, utf8filename, wlen, NULL, NULL);
+ buf = GLOB_REALLOC(path, base + wlen + 1);
+ if (buf) {
+ path = buf;
+ memcpy(path + base, utf8filename, wlen);
+ path[base + wlen] = 0;
+ }
+ GLOB_FREE(utf8filename);
+ }
+ }
+ return path;
+}
+#elif USE_NAME_ON_FS == 1
+# error not implemented
+#endif
+
+enum answer {UNKNOWN = -1, NO, YES};
+
+#ifndef S_ISDIR
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
#ifndef S_ISLNK
# ifndef S_IFLNK
# define S_ISLNK(m) (0)
# else
-# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# endif
#endif
-#ifndef S_ISDIR
-# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
-#endif
-
struct glob_args {
- void (*func) _((const char*, VALUE));
- const char *c;
- VALUE v;
+ void (*func)(const char *, VALUE, void *);
+ const char *path;
+ VALUE value;
+ rb_encoding *enc;
};
-static VALUE glob_func_caller _((VALUE));
+#define glob_call_func(func, path, arg, enc) (*(func))((path), (arg), (void *)(enc))
static VALUE
-glob_func_caller(val)
- VALUE val;
+glob_func_caller(VALUE val)
{
struct glob_args *args = (struct glob_args *)val;
- (*args->func)(args->c, args->v);
+ glob_call_func(args->func, args->path, args->value, args->enc);
return Qnil;
}
-#define glob_call_func(func, path, arg) (*func)(path, arg)
-
-static int glob_helper _((const char *, int, enum answer, enum answer, struct glob_pattern **, struct glob_pattern **, int, ruby_glob_func *, VALUE));
-
static int
-glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
- const char *path;
- int dirsep; /* '/' should be placed before appending child entry's name to 'path'. */
- enum answer exist; /* Does 'path' indicate an existing entry? */
- enum answer isdir; /* Does 'path' indicate a directory or a symlink to a directory? */
- struct glob_pattern **beg;
- struct glob_pattern **end;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+glob_helper(
+ const char *path,
+ int dirsep, /* '/' should be placed before appending child entry's name to 'path'. */
+ enum answer exist, /* Does 'path' indicate an existing entry? */
+ enum answer isdir, /* Does 'path' indicate a directory or a symlink to a directory? */
+ struct glob_pattern **beg,
+ struct glob_pattern **end,
+ int flags,
+ ruby_glob_func *func,
+ VALUE arg,
+ rb_encoding *enc)
{
struct stat st;
int status = 0;
struct glob_pattern **cur, **new_beg, **new_end;
int plain = 0, magical = 0, recursive = 0, match_all = 0, match_dir = 0;
int escape = !(flags & FNM_NOESCAPE);
+ long pathlen;
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
@@ -1248,26 +1584,34 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
p = p->next;
}
switch (p->type) {
- case PLAIN:
+ case PLAIN:
plain = 1;
break;
- case MAGICAL:
+ case ALPHA:
+#if USE_NAME_ON_FS == 1
+ plain = 1;
+#else
magical = 1;
+#endif
+ break;
+ case MAGICAL:
+ magical = 2;
break;
- case MATCH_ALL:
+ case MATCH_ALL:
match_all = 1;
break;
- case MATCH_DIR:
+ case MATCH_DIR:
match_dir = 1;
break;
- case RECURSIVE:
+ case RECURSIVE:
rb_bug("continuous RECURSIVEs");
}
}
+ pathlen = strlen(path);
if (*path) {
if (match_all && exist == UNKNOWN) {
- if (do_lstat(path, &st, flags) == 0) {
+ if (do_lstat(path, &st, flags, enc) == 0) {
exist = YES;
isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
}
@@ -1277,7 +1621,7 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
}
}
if (match_dir && isdir == UNKNOWN) {
- if (do_stat(path, &st, flags) == 0) {
+ if (do_stat(path, &st, flags, enc) == 0) {
exist = YES;
isdir = S_ISDIR(st.st_mode) ? YES : NO;
}
@@ -1287,14 +1631,14 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
}
}
if (match_all && exist == YES) {
- status = glob_call_func(func, path, arg);
+ status = glob_call_func(func, path, arg, enc);
if (status) return status;
}
if (match_dir && isdir == YES) {
- char *tmp = join_path(path, dirsep, "");
+ char *tmp = join_path(path, pathlen, dirsep, "", 0);
if (!tmp) return -1;
- status = glob_call_func(func, tmp, arg);
- free(tmp);
+ status = glob_call_func(func, tmp, arg, enc);
+ GLOB_FREE(tmp);
if (status) return status;
}
}
@@ -1303,21 +1647,83 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
if (magical || recursive) {
struct dirent *dp;
- DIR *dirp = do_opendir(*path ? path : ".", flags);
- if (dirp == NULL) return 0;
+ DIR *dirp;
+# if USE_NAME_ON_FS == 2
+ char *plainname = 0;
+# endif
+ IF_NORMALIZE_UTF8PATH(int norm_p);
+# if USE_NAME_ON_FS == 2
+ if (cur + 1 == end && (*cur)->type <= ALPHA) {
+ plainname = join_path(path, pathlen, dirsep, (*cur)->str, strlen((*cur)->str));
+ if (!plainname) return -1;
+ dirp = do_opendir(plainname, flags, enc);
+ GLOB_FREE(plainname);
+ }
+ else
+# endif
+ dirp = do_opendir(*path ? path : ".", flags, enc);
+ if (dirp == NULL) {
+# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+ if ((magical < 2) && !recursive && (errno == EACCES)) {
+ /* no read permission, fallback */
+ goto literally;
+ }
+# endif
+ return 0;
+ }
+ IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp, *path ? path : "."));
- for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- char *buf = join_path(path, dirsep, dp->d_name);
+# if NORMALIZE_UTF8PATH
+ if (!(norm_p || magical || recursive)) {
+ closedir(dirp);
+ goto literally;
+ }
+# endif
+# ifdef HAVE_GETATTRLIST
+ if (is_case_sensitive(dirp) == 0)
+ flags |= FNM_CASEFOLD;
+# endif
+ while ((dp = READDIR(dirp, enc)) != NULL) {
+ char *buf;
enum answer new_isdir = UNKNOWN;
+ const char *name;
+ size_t namlen;
+ int dotfile = 0;
+ IF_NORMALIZE_UTF8PATH(VALUE utf8str = Qnil);
+
+ if (recursive && dp->d_name[0] == '.') {
+ ++dotfile;
+ if (!dp->d_name[1]) {
+ /* unless DOTMATCH, skip current directories not to recurse infinitely */
+ if (!(flags & FNM_DOTMATCH)) continue;
+ ++dotfile;
+ }
+ else if (dp->d_name[1] == '.' && !dp->d_name[2]) {
+ /* always skip parent directories not to recurse infinitely */
+ continue;
+ }
+ }
+ name = dp->d_name;
+ namlen = NAMLEN(dp);
+# if NORMALIZE_UTF8PATH
+ if (norm_p && has_nonascii(name, namlen)) {
+ if (!NIL_P(utf8str = rb_str_normalize_ospath(name, namlen))) {
+ RSTRING_GETMEM(utf8str, name, namlen);
+ }
+ }
+# endif
+ buf = join_path(path, pathlen, dirsep, name, namlen);
+ IF_NORMALIZE_UTF8PATH(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
if (!buf) {
status = -1;
break;
}
- if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0
- && fnmatch("*", dp->d_name, flags) == 0) {
+ name = buf + pathlen + (dirsep != 0);
+ if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1)) {
+ /* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
#ifndef _WIN32
- if (do_lstat(buf, &st, flags) == 0)
+ if (do_lstat(buf, &st, flags, enc) == 0)
new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
else
new_isdir = NO;
@@ -1328,6 +1734,7 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, (end - beg) * 2);
if (!new_beg) {
+ GLOB_FREE(buf);
status = -1;
break;
}
@@ -1339,15 +1746,27 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
*new_end++ = p; /* append recursive pattern */
p = p->next; /* 0 times recursion */
}
- if (p->type == PLAIN || p->type == MAGICAL) {
- if (fnmatch(p->str, dp->d_name, flags) == 0)
+ switch (p->type) {
+ case ALPHA:
+# if USE_NAME_ON_FS == 2
+ if (plainname) {
+ *new_end++ = p->next;
+ break;
+ }
+# endif
+ case PLAIN:
+ case MAGICAL:
+ if (fnmatch(p->str, enc, name, flags) == 0)
*new_end++ = p->next;
+ default:
+ break;
}
}
- status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end, flags, func, arg);
- free(buf);
- free(new_beg);
+ status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end,
+ flags, func, arg, enc);
+ GLOB_FREE(buf);
+ GLOB_FREE(new_beg);
if (status) break;
}
@@ -1356,74 +1775,82 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
else if (plain) {
struct glob_pattern **copy_beg, **copy_end, **cur2;
+# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+ literally:
+# endif
copy_beg = copy_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
if (!copy_beg) return -1;
for (cur = beg; cur < end; ++cur)
- *copy_end++ = (*cur)->type == PLAIN ? *cur : 0;
+ *copy_end++ = (*cur)->type <= ALPHA ? *cur : 0;
for (cur = copy_beg; cur < copy_end; ++cur) {
if (*cur) {
char *buf;
char *name;
- name = GLOB_ALLOC_N(char, strlen((*cur)->str) + 1);
+ size_t len = strlen((*cur)->str) + 1;
+ name = GLOB_ALLOC_N(char, len);
if (!name) {
status = -1;
break;
}
- strcpy(name, (*cur)->str);
- if (escape) remove_backslashes(name);
+ memcpy(name, (*cur)->str, len);
+ if (escape)
+ len = remove_backslashes(name, name+len-1, enc) - name;
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
if (!new_beg) {
- free(name);
+ GLOB_FREE(name);
status = -1;
break;
}
*new_end++ = (*cur)->next;
for (cur2 = cur + 1; cur2 < copy_end; ++cur2) {
- if (*cur2 && fnmatch((*cur2)->str, name, flags) == 0) {
+ if (*cur2 && fnmatch((*cur2)->str, enc, name, flags) == 0) {
*new_end++ = (*cur2)->next;
*cur2 = 0;
}
}
- buf = join_path(path, dirsep, name);
- free(name);
+ buf = join_path(path, pathlen, dirsep, name, len);
+ GLOB_FREE(name);
if (!buf) {
- free(new_beg);
+ GLOB_FREE(new_beg);
status = -1;
break;
}
- status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg, new_end, flags, func, arg);
- free(buf);
- free(new_beg);
+#if USE_NAME_ON_FS == 1
+ if ((*cur)->type == ALPHA) {
+ long base = pathlen + (dirsep != 0);
+ buf = replace_real_basename(buf, base, enc, IF_NORMALIZE_UTF8PATH(1)+0);
+ }
+#endif
+ status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg,
+ new_end, flags, func, arg, enc);
+ GLOB_FREE(buf);
+ GLOB_FREE(new_beg);
if (status) break;
}
}
- free(copy_beg);
+ GLOB_FREE(copy_beg);
}
return status;
}
static int
-ruby_glob0(path, flags, func, arg)
- const char *path;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
{
struct glob_pattern *list;
const char *root, *start;
char *buf;
- int n;
+ size_t n;
int status;
start = root = path;
flags |= FNM_SYSCASE;
#if defined DOSISH
- root = rb_path_skip_prefix(root);
+ root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
#endif
if (root && *root == '/') root++;
@@ -1434,90 +1861,75 @@ ruby_glob0(path, flags, func, arg)
MEMCPY(buf, start, char, n);
buf[n] = '\0';
- list = glob_make_pattern(root, flags);
+ list = glob_make_pattern(root, root + strlen(root), flags, enc);
if (!list) {
- free(buf);
+ GLOB_FREE(buf);
return -1;
}
- status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg);
+ status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg, enc);
glob_free_pattern(list);
- free(buf);
+ GLOB_FREE(buf);
return status;
}
int
-ruby_glob(path, flags, func, arg)
- const char *path;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+ruby_glob(const char *path, int flags, ruby_glob_func *func, VALUE arg)
{
- return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg);
+ return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg,
+ rb_ascii8bit_encoding());
}
-static int rb_glob_caller _((const char *, VALUE));
-
static int
-rb_glob_caller(path, a)
- const char *path;
- VALUE a;
+rb_glob_caller(const char *path, VALUE a, void *enc)
{
int status;
struct glob_args *args = (struct glob_args *)a;
- args->c = path;
+ args->path = path;
rb_protect(glob_func_caller, a, &status);
return status;
}
static int
-rb_glob2(path, flags, func, arg)
- const char *path;
- int flags;
- void (*func) _((const char *, VALUE));
- VALUE arg;
+rb_glob2(const char *path, int flags,
+ void (*func)(const char *, VALUE, void *), VALUE arg,
+ rb_encoding* enc)
{
struct glob_args args;
args.func = func;
- args.v = arg;
+ args.value = arg;
+ args.enc = enc;
if (flags & FNM_SYSCASE) {
rb_warning("Dir.glob() ignores File::FNM_CASEFOLD");
}
- return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args);
+ return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args,
+ enc);
}
void
-rb_glob(path, func, arg)
- const char *path;
- void (*func) _((const char*, VALUE));
- VALUE arg;
+rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg)
{
- int status = rb_glob2(path, 0, func, arg);
+ int status = rb_glob2(path, 0, func, arg, rb_ascii8bit_encoding());
if (status) GLOB_JUMP_TAG(status);
}
-static void push_pattern _((const char* path, VALUE ary));
static void
-push_pattern(path, ary)
- const char *path;
- VALUE ary;
+push_pattern(const char *path, VALUE ary, void *enc)
{
- rb_ary_push(ary, rb_tainted_str_new2(path));
+ rb_ary_push(ary, rb_external_str_new_with_enc(path, strlen(path), enc));
}
-int
-ruby_brace_expand(str, flags, func, arg)
- const char *str;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+static int
+ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
+ rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
const char *p = str;
+ const char *pend = p + strlen(p);
const char *s = p;
const char *lbrace = 0, *rbrace = 0;
int nest = 0, status = 0;
@@ -1533,11 +1945,12 @@ ruby_brace_expand(str, flags, func, arg)
if (*p == '\\' && escape) {
if (!*++p) break;
}
- Inc(p);
+ Inc(p, pend, enc);
}
if (lbrace && rbrace) {
- char *buf = GLOB_ALLOC_N(char, strlen(s) + 1);
+ size_t len = strlen(s) + 1;
+ char *buf = GLOB_ALLOC_N(char, len);
long shift;
if (!buf) return -1;
@@ -1553,17 +1966,17 @@ ruby_brace_expand(str, flags, func, arg)
if (*p == '\\' && escape) {
if (++p == rbrace) break;
}
- Inc(p);
+ Inc(p, pend, enc);
}
memcpy(buf+shift, t, p-t);
- strcpy(buf+shift+(p-t), rbrace+1);
- status = ruby_brace_expand(buf, flags, func, arg);
+ strlcpy(buf+shift+(p-t), rbrace+1, len-(shift+(p-t)));
+ status = ruby_brace_expand(buf, flags, func, arg, enc);
if (status) break;
}
- free(buf);
+ GLOB_FREE(buf);
}
else if (!lbrace && !rbrace) {
- status = (*func)(s, arg);
+ status = glob_call_func(func, s, arg, enc);
}
return status;
@@ -1575,84 +1988,91 @@ struct brace_args {
int flags;
};
-static int glob_brace _((const char *, VALUE));
static int
-glob_brace(path, val)
- const char *path;
- VALUE val;
+glob_brace(const char *path, VALUE val, void *enc)
{
struct brace_args *arg = (struct brace_args *)val;
- return ruby_glob0(path, arg->flags, arg->func, arg->value);
+ return ruby_glob0(path, arg->flags, arg->func, arg->value, enc);
}
static int
-ruby_brace_glob0(str, flags, func, arg)
- const char *str;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+ruby_brace_glob0(const char *str, int flags, ruby_glob_func *func, VALUE arg,
+ rb_encoding* enc)
{
struct brace_args args;
args.func = func;
args.value = arg;
args.flags = flags;
- return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args);
+ return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args, enc);
}
int
-ruby_brace_glob(str, flags, func, arg)
- const char *str;
- int flags;
- ruby_glob_func *func;
- VALUE arg;
+ruby_brace_glob(const char *str, int flags, ruby_glob_func *func, VALUE arg)
+{
+ return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg,
+ rb_ascii8bit_encoding());
+}
+
+int
+ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
{
- return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg);
+ return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg, enc);
}
static int
-push_glob(VALUE ary, const char *str, int flags)
+push_glob(VALUE ary, VALUE str, int flags)
{
struct glob_args args;
+#ifdef __APPLE__
+ rb_encoding *enc = rb_utf8_encoding();
+ str = rb_str_encode_ospath(str);
+#else
+ rb_encoding *enc = rb_enc_get(str);
+
+ if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
+ if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding();
+#endif
args.func = push_pattern;
- args.v = ary;
- return ruby_brace_glob0(str, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args);
+ args.value = ary;
+ args.enc = enc;
+
+ RB_GC_GUARD(str);
+ return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
+ rb_glob_caller, (VALUE)&args, enc);
}
static VALUE
-rb_push_glob(str, flags) /* '\0' is delimiter */
- VALUE str;
- int flags;
+rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */
{
long offset = 0;
VALUE ary;
+ GlobPathValue(str, TRUE);
ary = rb_ary_new();
- SafeStringValue(str);
while (offset < RSTRING_LEN(str)) {
- int status = push_glob(ary, RSTRING(str)->ptr + offset, flags);
char *p, *pend;
+ int status;
+ p = RSTRING_PTR(str) + offset;
+ status = push_glob(ary, rb_enc_str_new(p, strlen(p), rb_enc_get(str)),
+ flags);
if (status) GLOB_JUMP_TAG(status);
if (offset >= RSTRING_LEN(str)) break;
- p = RSTRING(str)->ptr + offset;
p += strlen(p) + 1;
- pend = RSTRING(str)->ptr + RSTRING_LEN(str);
+ pend = RSTRING_PTR(str) + RSTRING_LEN(str);
while (p < pend && !*p)
p++;
- offset = p - RSTRING(str)->ptr;
+ offset = p - RSTRING_PTR(str);
}
return ary;
}
static VALUE
-dir_globs(argc, argv, flags)
- long argc;
- VALUE *argv;
- int flags;
+dir_globs(long argc, const VALUE *argv, int flags)
{
VALUE ary = rb_ary_new();
long i;
@@ -1660,8 +2080,8 @@ dir_globs(argc, argv, flags)
for (i = 0; i < argc; ++i) {
int status;
VALUE str = argv[i];
- SafeStringValue(str);
- status = push_glob(ary, RSTRING(str)->ptr, flags);
+ GlobPathValue(str, TRUE);
+ status = push_glob(ary, str, flags);
if (status) GLOB_JUMP_TAG(status);
}
@@ -1670,60 +2090,73 @@ dir_globs(argc, argv, flags)
/*
* call-seq:
- * Dir[ array ] => array
- * Dir[ string [, string ...] ] => array
+ * Dir[ string [, string ...] ] -> array
*
* Equivalent to calling
- * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
* <code>Dir.glob([</code><i>string,...</i><code>],0)</code>.
*
*/
static VALUE
dir_s_aref(int argc, VALUE *argv, VALUE obj)
- {
+{
if (argc == 1) {
return rb_push_glob(argv[0], 0);
}
return dir_globs(argc, argv, 0);
- }
+}
/*
* call-seq:
- * Dir.glob( pattern, [flags] ) => array
- * Dir.glob( pattern, [flags] ) {| filename | block } => nil
- *
- * Returns the filenames found by expanding <i>pattern</i> which is
- * an +Array+ of the patterns or the pattern +String+, either as an
- * <i>array</i> or as parameters to the block. Note that this pattern
- * is not a regexp (it's closer to a shell glob). See
- * <code>File::fnmatch</code> for the meaning of the <i>flags</i>
- * parameter. Note that case sensitivity depends on your system (so
- * <code>File::FNM_CASEFOLD</code> is ignored)
- *
- * <code>*</code>:: Matches any file. Can be restricted by
- * other values in the glob. <code>*</code>
- * will match all files; <code>c*</code> will
- * match all files beginning with
- * <code>c</code>; <code>*c</code> will match
- * all files ending with <code>c</code>; and
- * <code>*c*</code> will match all files that
- * have <code>c</code> in them (including at
- * the beginning or end). Equivalent to
- * <code>/ .* /x</code> in regexp.
- * <code>**</code>:: Matches directories recursively.
- * <code>?</code>:: Matches any one character. Equivalent to
- * <code>/.{1}/</code> in regexp.
- * <code>[set]</code>:: Matches any one character in +set+.
- * Behaves exactly like character sets in
- * Regexp, including set negation
- * (<code>[^a-z]</code>).
- * <code>{p,q}</code>:: Matches either literal <code>p</code> or
- * literal <code>q</code>. Matching literals
- * may be more than one character in length.
- * More than two literals may be specified.
- * Equivalent to pattern alternation in
- * regexp.
- * <code>\</code>:: Escapes the next metacharacter.
+ * Dir.glob( pattern, [flags] ) -> matches
+ * Dir.glob( pattern, [flags] ) { |filename| block } -> nil
+ *
+ * Expands +pattern+, which is an Array of patterns or a pattern String, and
+ * returns the results as +matches+ or as arguments given to the block.
+ *
+ * Note that this pattern is not a regexp, it's closer to a shell glob. See
+ * File::fnmatch for the meaning of the +flags+ parameter. Note that case
+ * sensitivity depends on your system (so File::FNM_CASEFOLD is ignored), as
+ * does the order in which the results are returned.
+ *
+ * <code>*</code>::
+ * Matches any file. Can be restricted by other values in the glob.
+ * Equivalent to <code>/ .* /x</code> in regexp.
+ *
+ * <code>*</code>:: Matches all files
+ * <code>c*</code>:: Matches all files beginning with <code>c</code>
+ * <code>*c</code>:: Matches all files ending with <code>c</code>
+ * <code>\*c\*</code>:: Match all files that have <code>c</code> in them
+ * (including at the beginning or end).
+ *
+ * Note, this will not match Unix-like hidden files (dotfiles). In order
+ * to include those in the match results, you must use the
+ * File::FNM_DOTMATCH flag or something like <code>"{*,.*}"</code>.
+ *
+ * <code>**</code>::
+ * Matches directories recursively.
+ *
+ * <code>?</code>::
+ * Matches any one character. Equivalent to <code>/.{1}/</code> in regexp.
+ *
+ * <code>[set]</code>::
+ * Matches any one character in +set+. Behaves exactly like character sets
+ * in Regexp, including set negation (<code>[^a-z]</code>).
+ *
+ * <code>{p,q}</code>::
+ * Matches either literal <code>p</code> or literal <code>q</code>.
+ * Equivalent to pattern alternation in regexp.
+ *
+ * Matching literals may be more than one character in length. More than
+ * two literals may be specified.
+ *
+ * <code> \\ </code>::
+ * Escapes the next metacharacter.
+ *
+ * Note that this means you cannot use backslash on windows as part of a
+ * glob, i.e. <code>Dir["c:\\foo*"]</code> will not work, use
+ * <code>Dir["c:/foo*"]</code> instead.
+ *
+ * Examples:
*
* Dir["config.?"] #=> ["config.h"]
* Dir.glob("config.?") #=> ["config.h"]
@@ -1735,23 +2168,20 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
*
* rbfiles = File.join("**", "*.rb")
* Dir.glob(rbfiles) #=> ["main.rb",
- * "lib/song.rb",
- * "lib/song/karaoke.rb"]
+ * # "lib/song.rb",
+ * # "lib/song/karaoke.rb"]
* libdirs = File.join("**", "lib")
* Dir.glob(libdirs) #=> ["lib"]
*
* librbfiles = File.join("**", "lib", "**", "*.rb")
* Dir.glob(librbfiles) #=> ["lib/song.rb",
- * "lib/song/karaoke.rb"]
+ * # "lib/song/karaoke.rb"]
*
* librbfiles = File.join("**", "lib", "*.rb")
* Dir.glob(librbfiles) #=> ["lib/song.rb"]
*/
static VALUE
-dir_s_glob(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+dir_s_glob(int argc, VALUE *argv, VALUE obj)
{
VALUE str, rflags, ary;
int flags;
@@ -1766,8 +2196,9 @@ dir_s_glob(argc, argv, obj)
ary = rb_push_glob(str, flags);
}
else {
- volatile VALUE v = ary;
- ary = dir_globs(RARRAY_LEN(v), RARRAY_PTR(v), flags);
+ VALUE v = ary;
+ ary = dir_globs(RARRAY_LEN(v), RARRAY_CONST_PTR(v), flags);
+ RB_GC_GUARD(v);
}
if (rb_block_given_p()) {
@@ -1778,27 +2209,27 @@ dir_s_glob(argc, argv, obj)
}
static VALUE
-dir_open_dir(path)
- VALUE path;
+dir_open_dir(int argc, VALUE *argv)
{
- VALUE dir = rb_funcall(rb_cDir, rb_intern("open"), 1, path);
+ VALUE dir = rb_funcall2(rb_cDir, rb_intern("open"), argc, argv);
- if (TYPE(dir) != T_DATA ||
- RDATA(dir)->dfree != (RUBY_DATA_FUNC)free_dir) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Dir)",
- rb_obj_classname(dir));
- }
+ rb_check_typeddata(dir, &dir_data_type);
return dir;
}
/*
* call-seq:
- * Dir.foreach( dirname ) {| filename | block } => nil
+ * Dir.foreach( dirname ) {| filename | block } -> nil
+ * Dir.foreach( dirname, encoding: enc ) {| filename | block } -> nil
+ * Dir.foreach( dirname ) -> an_enumerator
+ * Dir.foreach( dirname, encoding: enc ) -> an_enumerator
*
* Calls the block once for each entry in the named directory, passing
* the filename of each entry as a parameter to the block.
*
+ * If no block is given, an enumerator is returned instead.
+ *
* Dir.foreach("testdir") {|x| puts "Got #{x}" }
*
* <em>produces:</em>
@@ -1810,97 +2241,137 @@ dir_open_dir(path)
*
*/
static VALUE
-dir_foreach(io, dirname)
- VALUE io, dirname;
+dir_foreach(int argc, VALUE *argv, VALUE io)
{
VALUE dir;
- RETURN_ENUMERATOR(io, 1, &dirname);
- dir = dir_open_dir(dirname);
+ RETURN_ENUMERATOR(io, argc, argv);
+ dir = dir_open_dir(argc, argv);
rb_ensure(dir_each, dir, dir_close, dir);
return Qnil;
}
/*
* call-seq:
- * Dir.entries( dirname ) => array
+ * Dir.entries( dirname ) -> array
+ * Dir.entries( dirname, encoding: enc ) -> array
*
* Returns an array containing all of the filenames in the given
* directory. Will raise a <code>SystemCallError</code> if the named
* directory doesn't exist.
*
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
+ * If not specified, the filesystem encoding is used.
+ *
* Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"]
*
*/
static VALUE
-dir_entries(io, dirname)
- VALUE io, dirname;
+dir_entries(int argc, VALUE *argv, VALUE io)
{
VALUE dir;
- dir = dir_open_dir(dirname);
+ dir = dir_open_dir(argc, argv);
return rb_ensure(rb_Array, dir, dir_close, dir);
}
+static int
+fnmatch_brace(const char *pattern, VALUE val, void *enc)
+{
+ struct brace_args *arg = (struct brace_args *)val;
+ VALUE path = arg->value;
+ rb_encoding *enc_pattern = enc;
+ rb_encoding *enc_path = rb_enc_get(path);
+
+ if (enc_pattern != enc_path) {
+ if (!rb_enc_asciicompat(enc_pattern))
+ return FNM_NOMATCH;
+ if (!rb_enc_asciicompat(enc_path))
+ return FNM_NOMATCH;
+ if (!rb_enc_str_asciionly_p(path)) {
+ int cr = ENC_CODERANGE_7BIT;
+ long len = strlen(pattern);
+ if (rb_str_coderange_scan_restartable(pattern, pattern + len,
+ enc_pattern, &cr) != len)
+ return FNM_NOMATCH;
+ if (cr != ENC_CODERANGE_7BIT)
+ return FNM_NOMATCH;
+ }
+ }
+ return (fnmatch(pattern, enc, RSTRING_PTR(path), arg->flags) == 0);
+}
+
/*
* call-seq:
- * File.fnmatch( pattern, path, [flags] ) => (true or false)
- * File.fnmatch?( pattern, path, [flags] ) => (true or false)
- *
- * Returns true if <i>path</i> matches against <i>pattern</i> The
- * pattern is not a regular expression; instead it follows rules
- * similar to shell filename globbing. It may contain the following
- * metacharacters:
- *
- * <code>*</code>:: Matches any file. Can be restricted by
- * other values in the glob. <code>*</code>
- * will match all files; <code>c*</code> will
- * match all files beginning with
- * <code>c</code>; <code>*c</code> will match
- * all files ending with <code>c</code>; and
- * <code>*c*</code> will match all files that
- * have <code>c</code> in them (including at
- * the beginning or end). Equivalent to
- * <code>/ .* /x</code> in regexp.
- * <code>**</code>:: Matches directories recursively or files
- * expansively.
- * <code>?</code>:: Matches any one character. Equivalent to
- * <code>/.{1}/</code> in regexp.
- * <code>[set]</code>:: Matches any one character in +set+.
- * Behaves exactly like character sets in
- * Regexp, including set negation
- * (<code>[^a-z]</code>).
- * <code>\</code>:: Escapes the next metacharacter.
- *
- * <i>flags</i> is a bitwise OR of the <code>FNM_xxx</code>
- * parameters. The same glob pattern and flags are used by
- * <code>Dir::glob</code>.
- *
- * File.fnmatch('cat', 'cat') #=> true : match entire string
- * File.fnmatch('cat', 'category') #=> false : only match partial string
- * File.fnmatch('c{at,ub}s', 'cats') #=> false : { } isn't supported
- *
- * File.fnmatch('c?t', 'cat') #=> true : '?' match only 1 character
- * File.fnmatch('c??t', 'cat') #=> false : ditto
- * File.fnmatch('c*', 'cats') #=> true : '*' match 0 or more characters
- * File.fnmatch('c*t', 'c/a/b/t') #=> true : ditto
- * File.fnmatch('ca[a-z]', 'cat') #=> true : inclusive bracket expression
- * File.fnmatch('ca[^t]', 'cat') #=> false : exclusive bracket expression ('^' or '!')
- *
- * File.fnmatch('cat', 'CAT') #=> false : case sensitive
- * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true : case insensitive
- *
- * File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false : wildcard doesn't match '/' on FNM_PATHNAME
- * File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false : ditto
- * File.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false : ditto
- *
- * File.fnmatch('\?', '?') #=> true : escaped wildcard becomes ordinary
- * File.fnmatch('\a', 'a') #=> true : escaped ordinary remains ordinary
- * File.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true : FNM_NOESACPE makes '\' ordinary
- * File.fnmatch('[\?]', '?') #=> true : can escape inside bracket expression
- *
- * File.fnmatch('*', '.profile') #=> false : wildcard doesn't match leading
- * File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true period by default.
+ * File.fnmatch( pattern, path, [flags] ) -> (true or false)
+ * File.fnmatch?( pattern, path, [flags] ) -> (true or false)
+ *
+ * Returns true if +path+ matches against +pattern+. The pattern is not a
+ * regular expression; instead it follows rules similar to shell filename
+ * globbing. It may contain the following metacharacters:
+ *
+ * <code>*</code>::
+ * Matches any file. Can be restricted by other values in the glob.
+ * Equivalent to <code>/ .* /x</code> in regexp.
+ *
+ * <code>*</code>:: Matches all files regular files
+ * <code>c*</code>:: Matches all files beginning with <code>c</code>
+ * <code>*c</code>:: Matches all files ending with <code>c</code>
+ * <code>\*c*</code>:: Matches all files that have <code>c</code> in them
+ * (including at the beginning or end).
+ *
+ * To match hidden files (that start with a <code>.</code> set the
+ * File::FNM_DOTMATCH flag.
+ *
+ * <code>**</code>::
+ * Matches directories recursively or files expansively.
+ *
+ * <code>?</code>::
+ * Matches any one character. Equivalent to <code>/.{1}/</code> in regexp.
+ *
+ * <code>[set]</code>::
+ * Matches any one character in +set+. Behaves exactly like character sets
+ * in Regexp, including set negation (<code>[^a-z]</code>).
+ *
+ * <code> \ </code>::
+ * Escapes the next metacharacter.
+ *
+ * <code>{a,b}</code>::
+ * Matches pattern a and pattern b if File::FNM_EXTGLOB flag is enabled.
+ * Behaves like a Regexp union (<code>(?:a|b)</code>).
+ *
+ * +flags+ is a bitwise OR of the <code>FNM_XXX</code> constants. The same
+ * glob pattern and flags are used by Dir::glob.
+ *
+ * Examples:
+ *
+ * File.fnmatch('cat', 'cat') #=> true # match entire string
+ * File.fnmatch('cat', 'category') #=> false # only match partial string
+ *
+ * File.fnmatch('c{at,ub}s', 'cats') #=> false # { } isn't supported by default
+ * File.fnmatch('c{at,ub}s', 'cats', File::FNM_EXTGLOB) #=> true # { } is supported on FNM_EXTGLOB
+ *
+ * File.fnmatch('c?t', 'cat') #=> true # '?' match only 1 character
+ * File.fnmatch('c??t', 'cat') #=> false # ditto
+ * File.fnmatch('c*', 'cats') #=> true # '*' match 0 or more characters
+ * File.fnmatch('c*t', 'c/a/b/t') #=> true # ditto
+ * File.fnmatch('ca[a-z]', 'cat') #=> true # inclusive bracket expression
+ * File.fnmatch('ca[^t]', 'cat') #=> false # exclusive bracket expression ('^' or '!')
+ *
+ * File.fnmatch('cat', 'CAT') #=> false # case sensitive
+ * File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true # case insensitive
+ *
+ * File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false # wildcard doesn't match '/' on FNM_PATHNAME
+ * File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false # ditto
+ * File.fnmatch('[/]', '/', File::FNM_PATHNAME) #=> false # ditto
+ *
+ * File.fnmatch('\?', '?') #=> true # escaped wildcard becomes ordinary
+ * File.fnmatch('\a', 'a') #=> true # escaped ordinary remains ordinary
+ * File.fnmatch('\a', '\a', File::FNM_NOESCAPE) #=> true # FNM_NOESCAPE makes '\' ordinary
+ * File.fnmatch('[\?]', '?') #=> true # can escape inside bracket expression
+ *
+ * File.fnmatch('*', '.profile') #=> false # wildcard doesn't match leading
+ * File.fnmatch('*', '.profile', File::FNM_DOTMATCH) #=> true # period by default.
* File.fnmatch('.*', '.profile') #=> true
*
* rbfiles = '**' '/' '*.rb' # you don't have to do like this. just write in single string.
@@ -1924,10 +2395,7 @@ dir_entries(io, dirname)
* File.fnmatch(pattern, 'a/.b/c/foo', File::FNM_PATHNAME | File::FNM_DOTMATCH) #=> true
*/
static VALUE
-file_s_fnmatch(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
{
VALUE pattern, path;
VALUE rflags;
@@ -1939,15 +2407,85 @@ file_s_fnmatch(argc, argv, obj)
flags = 0;
StringValue(pattern);
- StringValue(path);
+ FilePathStringValue(path);
- if (fnmatch(RSTRING(pattern)->ptr, RSTRING(path)->ptr, flags) == 0)
- return Qtrue;
+ if (flags & FNM_EXTGLOB) {
+ struct brace_args args;
+
+ args.value = path;
+ args.flags = flags;
+ if (ruby_brace_expand(RSTRING_PTR(pattern), flags, fnmatch_brace,
+ (VALUE)&args, rb_enc_get(pattern)) > 0)
+ return Qtrue;
+ }
+ else {
+ rb_encoding *enc = rb_enc_compatible(pattern, path);
+ if (!enc) return Qfalse;
+ if (fnmatch(RSTRING_PTR(pattern), enc, RSTRING_PTR(path), flags) == 0)
+ return Qtrue;
+ }
+ RB_GC_GUARD(pattern);
return Qfalse;
}
/*
+ * call-seq:
+ * Dir.home() -> "/home/me"
+ * Dir.home("root") -> "/root"
+ *
+ * Returns the home directory of the current user or the named user
+ * if given.
+ */
+static VALUE
+dir_s_home(int argc, VALUE *argv, VALUE obj)
+{
+ VALUE user;
+ const char *u = 0;
+
+ rb_check_arity(argc, 0, 1);
+ user = (argc > 0) ? argv[0] : Qnil;
+ if (!NIL_P(user)) {
+ SafeStringValue(user);
+ rb_must_asciicompat(user);
+ u = StringValueCStr(user);
+ if (*u) {
+ return rb_home_dir_of(user, rb_str_new(0, 0));
+ }
+ }
+ return rb_default_home_dir(rb_str_new(0, 0));
+
+}
+
+#if 0
+/*
+ * call-seq:
+ * Dir.exist?(file_name) -> true or false
+ *
+ * Returns <code>true</code> if the named file is a directory,
+ * <code>false</code> otherwise.
+ *
+ */
+VALUE
+rb_file_directory_p(void)
+{
+}
+#endif
+
+/*
+ * call-seq:
+ * Dir.exists?(file_name) -> true or false
+ *
+ * Deprecated method. Don't use.
+ */
+static VALUE
+rb_dir_exists_p(VALUE obj, VALUE fname)
+{
+ rb_warning("Dir.exists? is a deprecated name, use Dir.exist? instead");
+ return rb_file_directory_p(obj, fname);
+}
+
+/*
* Objects of class <code>Dir</code> are directory streams representing
* directories in the underlying file system. They provide a variety of
* ways to list directories and their contents. See also
@@ -1959,19 +2497,21 @@ file_s_fnmatch(argc, argv, obj)
* (<code>.</code>).
*/
void
-Init_Dir()
+Init_Dir(void)
{
rb_cDir = rb_define_class("Dir", rb_cObject);
rb_include_module(rb_cDir, rb_mEnumerable);
rb_define_alloc_func(rb_cDir, dir_s_alloc);
- rb_define_singleton_method(rb_cDir, "open", dir_s_open, 1);
- rb_define_singleton_method(rb_cDir, "foreach", dir_foreach, 1);
- rb_define_singleton_method(rb_cDir, "entries", dir_entries, 1);
+ rb_define_singleton_method(rb_cDir, "open", dir_s_open, -1);
+ rb_define_singleton_method(rb_cDir, "foreach", dir_foreach, -1);
+ rb_define_singleton_method(rb_cDir, "entries", dir_entries, -1);
- rb_define_method(rb_cDir,"initialize", dir_initialize, 1);
+ rb_define_method(rb_cDir,"initialize", dir_initialize, -1);
+ rb_define_method(rb_cDir,"fileno", dir_fileno, 0);
rb_define_method(rb_cDir,"path", dir_path, 0);
+ rb_define_method(rb_cDir,"to_path", dir_path, 0);
rb_define_method(rb_cDir,"inspect", dir_inspect, 0);
rb_define_method(rb_cDir,"read", dir_read, 0);
rb_define_method(rb_cDir,"each", dir_each, 0);
@@ -1990,16 +2530,53 @@ Init_Dir()
rb_define_singleton_method(rb_cDir,"rmdir", dir_s_rmdir, 1);
rb_define_singleton_method(rb_cDir,"delete", dir_s_rmdir, 1);
rb_define_singleton_method(rb_cDir,"unlink", dir_s_rmdir, 1);
+ rb_define_singleton_method(rb_cDir,"home", dir_s_home, -1);
rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1);
rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
+ rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1);
+ rb_define_singleton_method(rb_cDir,"exists?", rb_dir_exists_p, 1);
rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);
+ /* Document-const: File::Constants::FNM_NOESCAPE
+ *
+ * Disables escapes in File.fnmatch and Dir.glob patterns
+ */
rb_file_const("FNM_NOESCAPE", INT2FIX(FNM_NOESCAPE));
+
+ /* Document-const: File::Constants::FNM_PATHNAME
+ *
+ * Wildcards in File.fnmatch and Dir.glob patterns do not match directory
+ * separators
+ */
rb_file_const("FNM_PATHNAME", INT2FIX(FNM_PATHNAME));
+
+ /* Document-const: File::Constants::FNM_DOTMATCH
+ *
+ * The '*' wildcard matches filenames starting with "." in File.fnmatch
+ * and Dir.glob patterns
+ */
rb_file_const("FNM_DOTMATCH", INT2FIX(FNM_DOTMATCH));
+
+ /* Document-const: File::Constants::FNM_CASEFOLD
+ *
+ * Makes File.fnmatch patterns case insensitive (but not Dir.glob
+ * patterns).
+ */
rb_file_const("FNM_CASEFOLD", INT2FIX(FNM_CASEFOLD));
+
+ /* Document-const: File::Constants::FNM_EXTGLOB
+ *
+ * Allows file globbing through "{a,b}" in File.fnmatch patterns.
+ */
+ rb_file_const("FNM_EXTGLOB", INT2FIX(FNM_EXTGLOB));
+
+ /* Document-const: File::Constants::FNM_SYSCASE
+ *
+ * System default case insensitiveness, equals to FNM_CASEFOLD or
+ * 0.
+ */
rb_file_const("FNM_SYSCASE", INT2FIX(FNM_SYSCASE));
}
diff --git a/distruby.rb b/distruby.rb
deleted file mode 100644
index 613da0eb9c..0000000000
--- a/distruby.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#!./miniruby
-
-if RUBY_PATCHLEVEL.zero?
- dirname = sprintf 'ruby-%s', RUBY_VERSION
- tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)/, 'v\1_\2_\3'
-else
- dirname = sprintf 'ruby-%s-p%u', RUBY_VERSION, RUBY_PATCHLEVEL
- tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)-p/, 'v\1_\2_\3_'
-end
-tgzname = dirname + '.tar.gz'
-tbzname = dirname + '.tar.bz2'
-zipname = dirname + '.zip'
-repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
-
-STDERR.puts 'exporting sources...'
-system 'svn', 'export', '-q', repos, dirname
-Dir.chdir dirname do
- STDERR.puts 'generating configure...'
- system 'autoconf'
- system 'rm', '-rf', 'autom4te.cache'
-
- STDERR.puts 'generating parse.c...'
- system 'bison', '-y', '-o', 'parse.c', 'parse.y'
-end
-
-STDERR.puts 'generating tarballs...'
-ENV['GZIP'] = '-9'
-system 'tar', 'chofzp', tgzname, dirname
-system 'tar', 'chojfp', tbzname, dirname
-system 'zip', '-q9r', zipname, dirname
-
-require 'digest/md5'
-require 'digest/sha2'
-for name in [tgzname, tbzname, zipname] do
- open name, 'rb' do |fp|
- str = fp.read
- md5 = Digest::MD5.hexdigest str
- sha = Digest::SHA256.hexdigest str
- printf "MD5(%s)= %s\nSHA256(%s)= %s\nSIZE(%s)= %s\n\n",
- name, md5,
- name, sha,
- name, str.size
- end
-end
-
-
-
-#
-# Local Variables:
-# mode: ruby
-# code: utf-8
-# indent-tabs-mode: t
-# tab-width: 3
-# ruby-indent-level: 3
-# fill-column: 79
-# default-justification: full
-# End:
-# vi: ts=3 sw=3
-
diff --git a/djgpp/GNUmakefile.in b/djgpp/GNUmakefile.in
deleted file mode 100644
index 0a7e1fb131..0000000000
--- a/djgpp/GNUmakefile.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include Makefile
-VPATH = $(srcdir) $(srcdir)/missing
diff --git a/djgpp/README.djgpp b/djgpp/README.djgpp
deleted file mode 100644
index f1f413a478..0000000000
--- a/djgpp/README.djgpp
+++ /dev/null
@@ -1,21 +0,0 @@
-* How to compile and install on djgpp
-
-This is what you need to do to compile and install Ruby:
-
- 1. Run configure.bat, which will generate config.h and Makefile
- (GNU sed required).
- Message like this is normal:
- sed.exe: can't read 123456789: No such file or directory (ENOENT)
-
- 2. Edit defines.h if you need. Probably this step will not need.
-
- 3. Remove comment mark(#) before the module names from ext/Setup.dj (or
- add module names if not present).
-
- 4. Run make.
-
- 5. Optionally, run 'make test' to check whether the compiled Ruby
- interpreter works well. If you see the message "test succeeded",
- your ruby works as it should (hopefully).
-
- 6. Run 'make install'
diff --git a/djgpp/config.hin b/djgpp/config.hin
deleted file mode 100644
index 8ee427c92f..0000000000
--- a/djgpp/config.hin
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#define PACKAGE_NAME ""
-#define PACKAGE_TARNAME ""
-#define PACKAGE_VERSION ""
-#define PACKAGE_STRING ""
-#define PACKAGE_BUGREPORT ""
-#define USE_BUILTIN_FRAME_ADDRESS 1
-#define STDC_HEADERS 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_STRINGS_H 1
-#define HAVE_UNISTD_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 8
-#define SIZEOF___INT64 0
-#define SIZEOF_OFF_T 4
-#define SIZEOF_VOIDP 4
-#define SIZEOF_FLOAT 4
-#define SIZEOF_DOUBLE 8
-#define HAVE_PROTOTYPES 1
-#define TOKEN_PASTE(x,y) x##y
-#define HAVE_STDARG_PROTOTYPES 1
-#define NORETURN(x) x __attribute__ ((noreturn))
-#define HAVE_DECL_SYS_NERR 1
-#define HAVE_DIRENT_H 1
-#define STDC_HEADERS 1
-#define HAVE_SYS_WAIT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#define HAVE_UNISTD_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_SYS_FILE_H 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_FCNTL_H 1
-#define HAVE_SYS_FCNTL_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TIMES_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_PWD_H 1
-#define HAVE_UTIME_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_DIRECT_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-#define HAVE_ST_BLKSIZE 1
-#define HAVE_STRUCT_STAT_ST_RDEV 1
-#define HAVE_ST_RDEV 1
-#define GETGROUPS_T gid_t
-#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_STRTOUL 1
-#define HAVE_ISINF 1
-#define HAVE_ISNAN 1
-#define HAVE_FINITE 1
-#define HAVE_HYPOT 1
-#define HAVE_ACOSH 1
-#define HAVE_FMOD 1
-#define HAVE_WAITPID 1
-#define HAVE_FSYNC 1
-#define HAVE_TRUNCATE 1
-#define HAVE_CHSIZE 1
-#define HAVE_TIMES 1
-#define HAVE_UTIMES 1
-#define HAVE_FCNTL 1
-#define HAVE_SYMLINK 1
-#define HAVE_SETITIMER 1
-#define HAVE_PAUSE 1
-#define HAVE_GETPGRP 1
-#define HAVE_SETPGID 1
-#define HAVE_GETGROUPS 1
-#define HAVE_GETRLIMIT 1
-#define HAVE_SIGPROCMASK 1
-#define HAVE_SIGACTION 1
-#define HAVE_SETSID 1
-#define HAVE_TELLDIR 1
-#define HAVE_SEEKDIR 1
-#define HAVE_MKTIME 1
-#define HAVE_COSH 1
-#define HAVE_SINH 1
-#define HAVE_TANH 1
-#define HAVE_STRUCT_TM_TM_ZONE 1
-#define HAVE_TM_ZONE 1
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-#define POSIX_SIGNAL 1
-#define GETPGRP_VOID 1
-#define SETPGRP_VOID 1
-#define RSHIFT(x,y) ((x)>>(int)y)
-#define FILE_COUNT _cnt
-#define FILE_READPTR _ptr
-#define NEED_IO_FLUSH_BETWEEN_RW 1
-#define DEFAULT_KCODE KCODE_NONE
-#define DLEXT ".so"
-#define RUBY_LIB "/lib/ruby/@MAJOR@.@MINOR@"
-#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
-#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/@MAJOR@.@MINOR@"
-#define RUBY_PLATFORM "i386-msdosdjgpp"
-#define RUBY_ARCHLIB "/lib/ruby/@MAJOR@.@MINOR@/i386-msdosdjgpp"
-#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/@MAJOR@.@MINOR@/i386-msdosdjgpp"
diff --git a/djgpp/config.sed b/djgpp/config.sed
deleted file mode 100644
index 1805789520..0000000000
--- a/djgpp/config.sed
+++ /dev/null
@@ -1,128 +0,0 @@
-/^SHELL/s,/bin/sh,$(COMSPEC),
-;s%/bin/rm%rm%
-;s%|| true%%
-;/\/dev\/null/ {
-;s,/dev/null 2>&1, nul,
-;s,2> /dev/null,,
-;}
-;/^config.status/ {
-; N;N;N;N;N;d
-;}
-:t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@srcdir@,.,g;t t
-s,@top_srcdir@,..,;t t
-s,@PATH_SEPARATOR@,:,;t t
-s,@PACKAGE_NAME@,,;t t
-s,@PACKAGE_TARNAME@,,;t t
-s,@PACKAGE_VERSION@,,;t t
-s,@PACKAGE_STRING@,,;t t
-s,@PACKAGE_BUGREPORT@,,;t t
-s,@exec_prefix@,${prefix},;t t
-s,@prefix@,/dev/env/DJDIR,;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@,${prefix}/com,;t t
-s,@localstatedir@,${prefix}/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,@build_alias@,i586-pc-msdosdjgpp,;t t
-s,@host_alias@,i586-pc-msdosdjgpp,;t t
-s,@target_alias@,i386-msdosdjgpp,;t t
-s,@DEFS@,,;t t
-s,@ECHO_C@,,;t t
-s,@ECHO_N@,-n,;t t
-s,@ECHO_T@,,;t t
-s,@LIBS@,-lm ,;t t
-s,@MAJOR@,1,;t t
-s,@MINOR@,7,;t t
-s,@TEENY@,3,;t t
-s,@build@,i586-pc-msdosdjgpp,;t t
-s,@build_cpu@,i586,;t t
-s,@build_vendor@,pc,;t t
-s,@build_os@,msdosdjgpp,;t t
-s,@host@,i586-pc-msdosdjgpp,;t t
-s,@host_cpu@,i586,;t t
-s,@host_vendor@,pc,;t t
-s,@host_os@,msdosdjgpp,;t t
-s,@target@,i386-pc-msdosdjgpp,;t t
-s,@target_cpu@,i386,;t t
-s,@target_vendor@,pc,;t t
-s,@target_os@,msdosdjgpp,;t t
-s,@CC@,gcc,;t t
-s,@ac_ct_CC@,,;t t
-s,@CFLAGS@,-Os,;t t
-s,@LDFLAGS@,,;t t
-s,@CPPFLAGS@,,;t t
-s,@EXEEXT@,.exe,;t t
-s,@OBJEXT@,o,;t t
-s,@CPP@,gcc -E,;t t
-s,@EGREP@,grep -E,;t t
-s,@GNU_LD@,yes,;t t
-s,@CPPOUTFILE@,-o conftest.i,;t t
-s,@OUTFLAG@,-o ,;t t
-s,@YACC@,bison -y,;t t
-s,@RANLIB@,ranlib,;t t
-s,@ac_ct_RANLIB@,,;t t
-s,@AR@,ar,;t t
-s,@ac_ct_AR@,,;t t
-s,@NM@,,;t t
-s,@ac_ct_NM@,,;t t
-s,@WINDRES@,,;t t
-s,@ac_ct_WINDRES@,,;t t
-s,@DLLWRAP@,,;t t
-s,@ac_ct_DLLWRAP@,,;t t
-s,@LN_S@,ln -s,;t t
-s,@SET_MAKE@,,;t t
-s,@LIBOBJS@,crypt.o flock.o vsnprintf.o,;t t
-s,@ALLOCA@,,;t t
-s,@XCFLAGS@,,;t t
-s,@XLDFLAGS@, -L.,;t t
-s,@DLDFLAGS@,,;t t
-s,@STATIC@,,;t t
-s,@CCDLFLAGS@,,;t t
-s,@LDSHARED@,ld,;t t
-s,@DLEXT@,so,;t t
-s,@DLEXT2@,,;t t
-s,@LIBEXT@,a,;t t
-s,@LINK_SO@,,;t t
-s,@LIBPATHFLAG@, -L%s,;t t
-s,@STRIP@,strip,;t t
-s,@EXTSTATIC@,,;t t
-s,@setup@,Setup.dj,;t t
-s,@MINIRUBY@,./miniruby,;t t
-s,@PREP@,,;t t
-s,@ARCHFILE@,,;t t
-s,@LIBRUBY_LDSHARED@,ld,;t t
-s,@LIBRUBY_DLDFLAGS@,,;t t
-s,@RUBY_INSTALL_NAME@,ruby,;t t
-s,@rubyw_install_name@,,;t t
-s,@RUBYW_INSTALL_NAME@,,;t t
-s,@RUBY_SO_NAME@,$(RUBY_INSTALL_NAME),;t t
-s,@LIBRUBY_A@,lib$(RUBY_INSTALL_NAME).a,;t t
-s,@LIBRUBY_SO@,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY),;t t
-s,@LIBRUBY_ALIASES@,lib$(RUBY_SO_NAME).so,;t t
-s,@LIBRUBY@,$(LIBRUBY_A),;t t
-s,@LIBRUBYARG@,-l$(RUBY_INSTALL_NAME),;t t
-s,@SOLIBS@,,;t t
-s,@DLDLIBS@,-lc,;t t
-s,@ENABLE_SHARED@,no,;t t
-s,@MAINLIBS@,,;t t
-s,@COMMON_LIBS@,,;t t
-s,@COMMON_MACROS@,,;t t
-s,@COMMON_HEADERS@,,;t t
-s,@EXPORT_PREFIX@,,;t t
-s,@MAKEFILES@,Makefile,;t t
-s,@arch@,i386-msdosdjgpp,;t t
-s,@sitearch@,i386-msdosdjgpp,;t t
-s,@sitedir@,${prefix}/lib/ruby/site_ruby,;t t
-s,@configure_args@,,;t t
-/^,THIS_IS_DUMMY_PATTERN_/i\
-ac_given_srcdir=.
diff --git a/djgpp/configure.bat b/djgpp/configure.bat
deleted file mode 100755
index e6a5d79d4a..0000000000
--- a/djgpp/configure.bat
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-if exist configure.bat cd ..
-if exist djgpp\version.sed goto exist
- sed -n -f djgpp\mkver.sed < version.h > djgpp\version.sed
-:exist
-set _conv_=-f djgpp\config.sed -f djgpp\version.sed
-sed %_conv_% < Makefile.in > Makefile
-sed %_conv_% < djgpp\config.hin > config.h
-echo LFN check > 12345678
-sed -n /LFN/d 123456789 > nul
-if errorlevel 2 goto LFN
- copy missing\vsnprintf.c missing\vsnprint.c > nul
- copy djgpp\config.sed config.sta > nul
-goto end
-:LFN
- copy djgpp\config.sed config.status > nul
-:end
-set _conv_=
-del 12345678
-echo Now you must run a make.
diff --git a/djgpp/mkver.sed b/djgpp/mkver.sed
deleted file mode 100644
index f29b9ddd3e..0000000000
--- a/djgpp/mkver.sed
+++ /dev/null
@@ -1 +0,0 @@
-/RUBY_VERSION /s/^.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/s,@MAJOR@,\1,;s,@MINOR@,\2,;s,@TEENY@,\3,/p
diff --git a/dln.c b/dln.c
index 5ba25b6415..e5269ca441 100644
--- a/dln.c
+++ b/dln.c
@@ -3,26 +3,30 @@
dln.c -
$Author$
- $Date$
created at: Tue Jan 18 17:05:06 JST 1994
- Copyright (C) 1993-2003 Yukihiro Matsumoto
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
-#include "ruby.h"
+#ifdef RUBY_EXPORT
+#include "ruby/ruby.h"
+#define dln_notimplement rb_notimplement
+#define dln_memerror rb_memerror
+#define dln_exit rb_exit
+#define dln_loaderror rb_loaderror
+#else
+#define dln_notimplement --->>> dln not implemented <<<---
+#define dln_memerror abort
+#define dln_exit exit
+static void dln_loaderror(const char *format, ...);
+#endif
#include "dln.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
-#ifdef __CHECKER__
-#undef HAVE_DLOPEN
-#undef USE_DLN_A_OUT
-#undef USE_DLN_DLOPEN
-#endif
-
#ifdef USE_DLN_A_OUT
char *dln_argv0;
#endif
@@ -43,15 +47,18 @@ void *xcalloc();
void *xrealloc();
#endif
+#undef free
+#define free(x) xfree(x)
+
#include <stdio.h>
-#if defined(_WIN32) || defined(__VMS)
+#if defined(_WIN32)
#include "missing/file.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifndef S_ISDIR
-# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifdef HAVE_SYS_PARAM_H
@@ -69,19 +76,7 @@ void *xrealloc();
char *getenv();
#endif
-#if defined(__VMS)
-#pragma builtins
-#include <dlfcn.h>
-#endif
-
-#ifdef __MACOS__
-# include <TextUtils.h>
-# include <CodeFragments.h>
-# include <Aliases.h>
-# include "macruby_private.h"
-#endif
-
-#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+#ifdef __APPLE__
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
# define MACOSX_DLOPEN
@@ -90,63 +85,69 @@ char *getenv();
# endif
#endif
-#ifdef __BEOS__
+#if defined(__BEOS__) || defined(__HAIKU__)
# include <image.h>
#endif
-#ifndef NO_DLN_LOAD
+#ifndef dln_loaderror
+static void
+dln_loaderror(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ abort();
+}
+#endif
#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(MACOSX_DYLD) && !defined(_UNICOSMP)
/* dynamic load with dlopen() */
# define USE_DLN_DLOPEN
#endif
-#ifndef FUNCNAME_PATTERN
-# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
-# define FUNCNAME_PATTERN "_Init_%s"
-# else
-# define FUNCNAME_PATTERN "Init_%s"
-# endif
+#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
+# define EXTERNAL_PREFIX "_"
+#else
+# define EXTERNAL_PREFIX ""
#endif
+#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
-static int
-init_funcname_len(buf, file)
- char **buf;
- const char *file;
-{
- char *p;
- const char *slash;
- int len;
-
- /* Load the file as an object one */
- for (slash = file-1; *file; file++) /* Find position of last '/' */
-#ifdef __MACOS__
- if (*file == ':') slash = file;
+#if defined __CYGWIN__ || defined DOSISH
+#define isdirsep(x) ((x) == '/' || (x) == '\\')
#else
- if (*file == '/') slash = file;
+#define isdirsep(x) ((x) == '/')
#endif
- len = strlen(FUNCNAME_PATTERN) + strlen(slash + 1);
- *buf = xmalloc(len);
- snprintf(*buf, len, FUNCNAME_PATTERN, slash + 1);
- for (p = *buf; *p; p++) { /* Delete suffix if it exists */
- if (*p == '.') {
- *p = '\0'; break;
- }
+static size_t
+init_funcname_len(const char **file)
+{
+ const char *p = *file, *base, *dot = NULL;
+
+ /* Load the file as an object one */
+ for (base = p; *p; p++) { /* Find position of last '/' */
+ if (*p == '.' && !dot) dot = p;
+ if (isdirsep(*p)) base = p+1, dot = NULL;
}
- return p - *buf;
+ *file = base;
+ /* Delete suffix if it exists */
+ return (dot ? dot : p) - base;
}
+static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX;
+
#define init_funcname(buf, file) do {\
- int len = init_funcname_len(buf, file);\
- char *tmp = ALLOCA_N(char, len+1);\
+ const char *base = (file);\
+ const size_t flen = init_funcname_len(&base);\
+ const size_t plen = sizeof(funcname_prefix);\
+ char *const tmp = ALLOCA_N(char, plen+flen+1);\
if (!tmp) {\
- free(*buf);\
- rb_memerror();\
+ dln_memerror();\
}\
- strcpy(tmp, *buf);\
- free(*buf);\
- *buf = tmp;\
+ memcpy(tmp, funcname_prefix, plen);\
+ memcpy(tmp+plen, base, flen);\
+ tmp[plen+flen] = '\0';\
+ *(buf) = tmp;\
} while (0)
#ifdef USE_DLN_A_OUT
@@ -184,8 +185,8 @@ static int dln_init_p = 0;
#define INVALID_OBJECT(h) (N_MAGIC(h) != OMAGIC)
-#include "util.h"
-#include "st.h"
+#include "ruby/util.h"
+#include "ruby/st.h"
static st_table *sym_tbl;
static st_table *undef_tbl;
@@ -193,10 +194,7 @@ static st_table *undef_tbl;
static int load_lib();
static int
-load_header(fd, hdrp, disp)
- int fd;
- struct exec *hdrp;
- long disp;
+load_header(int fd, struct exec *hdrp, long disp)
{
int size;
@@ -230,7 +228,7 @@ load_header(fd, hdrp, disp)
#define RELOC_TARGET_SIZE(r) ((r)->r_length)
#endif
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
/* Sparc (Sun 4) macros */
# undef relocation_info
# define relocation_info reloc_info_sparc
@@ -266,10 +264,7 @@ static int reloc_r_length[] = {
#endif
static struct relocation_info *
-load_reloc(fd, hdrp, disp)
- int fd;
- struct exec *hdrp;
- long disp;
+load_reloc(int fd, struct exec *hdrp, long disp)
{
struct relocation_info *reloc;
int size;
@@ -292,10 +287,7 @@ load_reloc(fd, hdrp, disp)
}
static struct nlist *
-load_sym(fd, hdrp, disp)
- int fd;
- struct exec *hdrp;
- long disp;
+load_sym(int fd, struct exec *hdrp, long disp)
{
struct nlist * buffer;
struct nlist * sym;
@@ -336,9 +328,7 @@ load_sym(fd, hdrp, disp)
}
static st_table *
-sym_hash(hdrp, syms)
- struct exec *hdrp;
- struct nlist *syms;
+sym_hash(struct exec *hdrp, struct nlist *syms)
{
st_table *tbl;
struct nlist *sym = syms;
@@ -358,17 +348,16 @@ sym_hash(hdrp, syms)
}
static int
-dln_init(prog)
- const char *prog;
+dln_init(const char *prog)
{
- char *file;
+ char *file, fbuf[MAXPATHLEN];
int fd;
struct exec hdr;
struct nlist *syms;
if (dln_init_p == 1) return 0;
- file = dln_find_exe(prog, NULL);
+ file = dln_find_exe_r(prog, NULL, fbuf, sizeof(fbuf));
if (file == NULL || (fd = open(file, O_RDONLY)) < 0) {
dln_errno = errno;
return -1;
@@ -433,11 +422,7 @@ dln_init(prog)
}
static long
-load_text_data(fd, hdrp, bss, disp)
- int fd;
- struct exec *hdrp;
- int bss;
- long disp;
+load_text_data(int fd, struct exec *hdrp, int bss, long disp)
{
int size;
unsigned char* addr;
@@ -471,27 +456,26 @@ load_text_data(fd, hdrp, bss, disp)
}
static int
-undef_print(key, value)