Граф коммитов

13877 Коммитов

Автор SHA1 Сообщение Дата
nari c56ef25cf9 * gc.c (gc_profile_record_get): to static function.
(gc_profile_result): ditto.
  (gc_profile_report): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 10:47:39 +00:00
akr 49e9f42703 * include/ruby/io.h (rb_io_enc_t): rename flags to ecflags.
(rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags.
  (MakeOpenFile): follow the renaming.

* io.c: follow the renaming.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 10:22:11 +00:00
akr 45c3707303 * include/ruby/encoding.h (ECONV_INVALID_IGNORE): removed because
it tend to cause security problem.  If the behaviour is really
  required, ECONV_INVALID_REPLACE with empty string can be used.
  For example, CVE-2006-2313, CVE-2008-1036, [ruby-core:15645]
  (ECONV_UNDEF_IGNORE): ditto.

* transcode.c (rb_econv_convert): follow the above change.
  (econv_opts): ditto.
  (Init_transcode): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 10:15:34 +00:00
nobu 1633eb7238 * vm.c (rb_vm_mark): commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:37:25 +00:00
nobu c5bf9ceef6 * vm_core.h (struct rb_vm_struct): replaced signal staff with trap
staff.

* signal.c (signal_buff): per process resouce now.

* signal.c (trap_list): moved to VM.

* signal.c (rb_get_next_signal): reverted.

* signal.c (rb_trap_exit): trap_pending_list was no longer used.

* thread.c (timer_thread_function): delivers buffered per-process
  signals to each VMs.

* vm.c (rb_vm_mark): marks trap_list.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:22:04 +00:00
nobu 83e28e5176 * io.c (struct sysopen_struct, rb_sysopen_internal, rb_sysopen):
constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:01:13 +00:00
nobu 8f0f91e155 * io.c: expanded ARGF members macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 03:33:27 +00:00
nobu 783541e0a4 * tool/transcode-tblgen.rb (citrus_decode_mapsrc): support older 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 01:43:50 +00:00
nobu 747d9b3925 * io.c (argf_next_argv, argf_set_encoding): copy struct wise.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 01:33:47 +00:00
akr 31b054122c * io.c (rb_scan_open_args): follow rb_str_transcode change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 00:48:01 +00:00
nobu d2aa9dd18b properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 00:40:28 +00:00
akr b94060024d * file.c (rb_find_file): fix GC problem on Debian GNU/Linux (IA64)
with gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21).
  There is no register/memory to contain load_path.  A register (r35)
  contains &RARRAY_PTR(load_path), (char*)load_path + 32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 00:05:30 +00:00
akr dead0a4c51 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 19:05:24 +00:00
akr 8c321128d9 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 18:22:21 +00:00
akr 58964e3249 * include/ruby/io.h (rb_io_t): new fields: encs.ecopts and
writeconv_pre_ecopts.
  (MakeOpenFile): initialize them.

* include/ruby/encoding.h (rb_str_transcode): take ecopts argument.
  (rb_econv_flags): removed.
  (rb_econv_prepare_opts): declared.
  (rb_econv_open_opts): declared.

* io.c (make_writeconv): use rb_econv_open_opts.
  (make_readconv): ditto.
  (io_fwrite): follow rb_str_transcode change.
  (rb_io_extract_modeenc): use rb_econv_prepare_opts.
  (rb_file_open_generic): initialize encs.ecopts.
  (rb_file_open_internal): ditto.
  (rb_io_reopen): ditto.
  (argf_ecopts): defined.
  (argf_next_argv): set encs.ecopts.
  (io_encoding_set): use rb_econv_prepare_opts.
  (argf_set_encoding): set argf_ecopts.

* gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts
  in T_FILE.

* transcode.c (transcode_loop): take ecopts argument. use
  rb_econv_open_opts.
  (rb_econv_flags): removed.
  (rb_econv_prepare_opts): defined.
  (rb_econv_open_opts): defined.
  (str_transcode0): take ecopts.
  (str_transcode): use rb_econv_prepare_opts.
  (rb_str_transcode): take ecopts.
  (econv_init): accept hash argument.
  (econv_insert_output): follow rb_str_transcode change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 18:18:10 +00:00
akr 0ebcad6a7b * include/ruby/encoding.h (rb_econv_set_replacemenet): declared.
* transcode.c (rb_econv_t): new fields: replacement_str,
  replacement_len, replacement_enc and replacement_allocated.
  (get_replacement_character): make len as size_t.
  (rb_econv_open_by_transcoder_entries): initialize the new fields.
  (rb_econv_close): deallocate replacement_str if it allocated.
  (make_replacement): new function.
  (output_replacement_character): use make_replacement.
  (rb_econv_set_replacemenet): defined.
  (econv_get_replacement): new method.
  (econv_set_replacement): new method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 16:34:11 +00:00
akr c359b80127 comment updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 16:31:14 +00:00
usa e64711977b * 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]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 16:14:17 +00:00
usa 9b6608c78d * transcode.c (transcode_restartable0): avoid VC++6's bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 16:02:10 +00:00
usa 71e00fd061 * io.c (make_writeconv): follow akr's previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:27:12 +00:00
akr 56343375b8 * include/ruby/encoding.h (rb_econv_option_t): removed. Since
rb_econv_option_t has only one field, int flags, rb_econv_option_t is
  replaced by int.

* include/ruby/io.h: follow the above change.

* io.c: ditto.

* transcode.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:11:46 +00:00
ko1 b00710df4e * win32/win32.c: fix ruby/signal.h depending codes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:06:55 +00:00
svn 44a522c6a4 * 2008-09-04
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:02:26 +00:00
mame c309cda903 * test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
Process.euid and egid instead of Etc.getlogin to identify current
  user which may be different from a login one (e.g., su command).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:02:22 +00:00
kazu 1f322f83e7 s
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 14:54:31 +00:00
mame 65b1544649 * test/etc/test_etc.rb: check only typical use of
setpwent/getpwent/endpwent and setgrent/getgrent/endgrent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 14:54:14 +00:00
akr 1afc1b7bc8 * transcode.c (rb_transcoding): moved from transcode_data.h.
(TRANSCODING_READBUF): ditto.
  (TRANSCODING_WRITEBUF): ditto.
  (TRANSCODING_STATE_EMBED_MAX): ditto.
  (TRANSCODING_STATE): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 14:34:09 +00:00
akr f6441bf61c * transcode_data.h (rb_transcoding): remove stateful field.
add state field.
  (TRANSCODING_STATE): defined.
  (rb_transcoder): add fields: state_size, state_init_func,
  state_fini_func.
  change rb_transcoding* argument to void*.

* transcode.c (transcode_restartable0): use TRANSCODING_STATE for
  first arguments of transcoder functions.
  (rb_transcoding_open_by_transcoder): initialize state field.
  (rb_transcoding_close): finalize state field.

* tool/transcode-tblgen.rb: provide state size/init/fini.

* enc/trans/newline.trans (universal_newline_init): defined.
  (fun_so_universal_newline): take void* as a state pointer.
  (rb_universal_newline): provide state size/init/fini.
  (rb_crlf_newline): ditto.
  (rb_cr_newline): ditto.

* enc/trans/iso2022.trans (iso2022jp_init): defined.
  (fun_si_iso2022jp_to_eucjp): take void* as a state pointer.
  (fun_so_iso2022jp_to_eucjp): ditto.
  (fun_so_eucjp_to_iso2022jp): ditto.
  (iso2022jp_reset_sequence_size): ditto.
  (finish_eucjp_to_iso2022jp): ditto.
  (rb_ISO_2022_JP_to_EUC_JP): provide state size/init/fini.
  (rb_EUC_JP_to_ISO_2022_JP): ditto.

* enc/trans/utf_16_32.trans (fun_so_from_utf_16be): take void* as a
  state pointer.
  (fun_so_to_utf_16be): ditto.
  (fun_so_from_utf_16le): ditto.
  (fun_so_to_utf_16le): ditto.
  (fun_so_from_utf_32be): ditto.
  (fun_so_to_utf_32be): ditto.
  (fun_so_from_utf_32le): ditto.
  (fun_so_to_utf_32le): ditto.
  (rb_from_UTF_16BE): provide state size/init/fini.
  (rb_to_UTF_16BE): ditto.
  (rb_from_UTF_16LE): ditto.
  (rb_to_UTF_16LE): ditto.
  (rb_from_UTF_32BE): ditto.
  (rb_to_UTF_32BE): ditto.
  (rb_from_UTF_32LE): ditto.
  (rb_to_UTF_32LE): ditto.

* enc/trans/japanese.trans (fun_so_eucjp2sjis): take void* as a state
  pointer.
  (fun_so_sjis2eucjp): ditto.
  (rb_eucjp2sjis): provide state size/init/fini.
  (rb_sjis2eucjp): provide state size/init/fini.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 14:12:06 +00:00
yugui fce093432e * lib/mathn.rb (Integer): moved into prime.rb.
(Prime): ditto.

* lib/prime.rb (Integer): moved from mathn.rb.
  (Integer.each_prime): added.
  (Integer#prime?): added.
  (Prime): moved from mathn.rb.
    Its implmentation was rewritten. see [ruby-dev:35863].
    And patched by Keiju ISHITSUKA <keiju@ishitsuka.com>,
    see [ruby-dev:36128].
  (Prime.new):                     obsolete.
  (Prime.instance):                added.
  (Prime.each):                    added.
  (Prime.int_from_prime_division): added.
  (Prime.prime_division):          added.
  (Prime.prime?):                  added.
    Patch by TOYOFUKU Chikanobu
    <nobu_toyofuku at nifty.com> in [ruby-dev:36067].
  (Prime.cache):                   removed.
  (Prime.primes):                  removed.
  (Prime.primes_so_far):           removed.
  (Prime#int_from_prime_division): added.
  (Prime#prime_division):          added.
  (Prime#prime?):                  added.
  (Prime#primes):                  removed.
  (Prime#primes_so_far):           removed.
  (Prime::PseudoPrmeGenerator):    added.
  (Prime::EratosthenesGenerator):  added.
  (Prime::TrialDivisionGenerator): added.
  (Prime::Generator23):            added.
  (Prime::TrialDivision):          added.
    Extracted from the previous implementation of Prime
    by Keiju ISHITSUKA.
  (Prime::EratosthenesSieve):      added.

* lib/.document (prime.rb): added

* lib/README (prime.rb): added

* test/test_prime.rb: added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 13:57:21 +00:00
dblack 9cab7d15ca * lib/scanf.rb: fixed bug involving matching literal '['
* test/scanf/test_scanf.rb: added test for scanf.rb fix



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 12:54:13 +00:00
akr 6378201f8b * transcode_data.h (WORDINDEX_SHIFT_BITS): defined.
(WORDINDEX2INFO): defined.
  (INFO2WORDINDEX): defined.

* tool/transcode-tblgen.rb: use WORDINDEX2INFO.

* transcode.c: use INFO2WORDINDEX.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 12:35:29 +00:00
kazu b99c31b38f * golf_prelude.rb: suppress warning when goruby -v.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 12:21:32 +00:00
akr 6fe24d1f13 refactor last change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 12:09:59 +00:00
akr 069f85f812 * transcode.c (BL_MIN_BYTE): defined.
(BL_MAX_BYTE): defined.
  (BL_OFFSET): defined.
  (BL_ACTION): defined.
  (transcode_restartable0): use BL_MIN_BYTE, BL_MAX_BYTE and
  BL_ACTION.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 12:08:27 +00:00
akr ac5631e6f0 * transcode.c (BYTE_ADDR): defined.
(WORD_ADDR): ditto.
  (BL_BASE): use BYTE_ADDR and WORD_ADDR.
  (BL_INFO): use WORD_ADDR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:59:50 +00:00
akr 4277473d5b * transcode_data.h (rb_transcoder): new field: byte_array_length and
word_array_length.

* tool/transcode-tblgen.rb (transcode_generated_code): generate
  byte_array_length and word_array_length.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:48:17 +00:00
akr 9233dc9bf4 * tool/transcode-tblgen.rb (ArrayCode): new class.
(ActionMap#gen_array_code): moved to ArrayCode.
  (ActionMap#numelt_array_code): ditto.
  (ActionMap#array_code_insert_at_last): ditto.
  (TRANSCODE_GENERATED_BYTES_CODE): use ArrayCode.
  (TRANSCODE_GENERATED_WORDS_CODE): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:36:04 +00:00
akr 4406629bd6 * enc/trans/japanese.trans: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:09:25 +00:00
akr 8108417c5e * tool/transcode-tblgen.rb (ActionMap#gen_array_code): extracted from
generate_lookup_node.
  (ActionMap#numelt_array_code): ditto.
  (ActionMap#array_code_insert_at_last): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:07:16 +00:00
akr 2eb763857d * parse.y (parser_encoding_name): defined.
(parser_tokadd_mbchar): show encoding in the message of
  "invalid multibyte char" error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 11:02:11 +00:00
usa 03e778757b * vm_insnhelper.c (vm_method_missing): C99.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 10:28:48 +00:00
ko1 cb0ade87d6 * test/ruby/test_thread.rb: fix test.
[ruby-dev:35960]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 10:19:24 +00:00
naruse 42a48c1e9d * enc/trans/make_transdb.rb: check $(srcdir)/enc/trans before
enc/trans.

* enc/trans/make_transdb.rb: keep names_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 08:57:18 +00:00
ko1 204929af9d * include/ruby/signal.h: removed.
* common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c,
  io.c, process.c, signal.c: vm_core.h: ditto.
  Some unused external global variables are also removed.
  (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending,
  rb_thread_critical)
* ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c,
  ext/readline/readline.c, ext/socket/depend,
  ext/socket/socket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 08:00:05 +00:00
knu 028c1b16c2 Add svn:ignore entries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 05:35:55 +00:00
svn d644ee78a9 * 2008-09-03
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 15:23:54 +00:00
mame 095ae8fd84 * vm_insnhelper.c (vm_method_missing): copy arguments to allocated
memory from machine stack.  [ruby-dev:36064]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 15:23:49 +00:00
akr 41e1933fd8 * transcode_data.h (base_element): removed.
(BYTE_LOOKUP): removed.
  (BYTE_LOOKUP_BASE): don't cast.
  (BYTE_LOOKUP_INFO): ditto.
  (PType): unsigned int, instead of uintptr_t.
  (rb_transcoding): change type of next_field, conv_tree_start and
  word_array.

* tool/transcode-tblgen.rb: generate word_array as array of unsigned
  int.

* transcode.c (transcode_restartable0): follow the above type change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 13:26:02 +00:00
akr 39f172f9d7 * tool/transcode-tblgen.rb: add prefix for byte_array and word_array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 12:22:56 +00:00
akr 5cea1b07f4 * enc/trans/make_transdb.rb: check foo.c only if foo.trans exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 11:57:49 +00:00