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

24129 Коммитов

Автор SHA1 Сообщение Дата
ktsj a17fd731c9 * ChangeLog: style fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04 06:18:06 +00:00
ktsj 7c9b9977b0 * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
add a test. Unlike TestThread#test_no_valid_cfp,
  this test succeeds even if win32ole is required (see r33153).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 15:54:44 +00:00
svn aa6ebbe329 * 2011-09-04
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 15:11:57 +00:00
nobu bc2a1f2a98 * variable.c (rb_const_set): show the previous definition
location.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 15:11:53 +00:00
nobu 3e0819c66a * configure.in (sizeof_struct_dirent_too_small): check if struct
dirent.d_name is too small.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:56:26 +00:00
nobu 90a10297d6 * configure.in (RUBY_MINGW32): take tool prefix from CC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:55:20 +00:00
nobu 4ac511266d * ext/io/console/console.c (console_set_winsize): remove
unused variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:54:14 +00:00
nobu 74f724de1a * io.c (argf_next_argv): open in default text mode.
[ruby-core:39234] [Bug #5268]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:52:18 +00:00
nagachika a46d29bb4e * lib/thread.rb (SizedQueue#max=) raise ArgumentError if max is not
positive number. patch by Masaki Matsushita.
  [ruby-dev:44449] [Bug #5259]

* test/thread/test_queue.rb (test_sized_queue_initialize,
  test_sized_queue_assign_max): add tests for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 09:46:51 +00:00
nobu b31c817782 * test/ruby/test_encoding.rb (test_find): mingw is not Unix, of course.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 04:49:43 +00:00
svn a1b8cacd0f * 2011-09-03
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 21:23:26 +00:00
nobu 69dff899a0 * win32/win32.c (rb_w32_fd_copy): cast explicitly to suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 21:23:22 +00:00
nobu 7dc7da3d86 * io.c (validate_enc_binmode, prep_stdio): default to text mode on
dosish platforms.  [ruby-core:38822] [Bug #5164]
* transcode.c (rb_econv_prepare_options): keep default ecflags
  unchanged if no options.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 12:11:17 +00:00
kazu 45fffaeac8 fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 08:09:04 +00:00
nobu 7dddaf6807 * vm_insnhelper.c (vm_search_const_defined_class): search
ancestors only when global scope.  [ruby-core:39227] [Bug #5264]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 05:36:49 +00:00
nobu 5e14b97947 * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
which prefixes an non-ascii character, which has no escape
  syntax.  [ruby-core:39222] [Ruby 1.9 - Bug #5262]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 00:58:10 +00:00
tenderlove 8659de2e0f * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
ascii-8bit as binary in YAML.
* test/psych/test_string.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 19:07:44 +00:00
svn 6e6feaf8da * 2011-09-02
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 16:07:21 +00:00
nobu c4eb2983ba * numeric.c (flo_round): substitute machine dependent magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 16:07:16 +00:00
nobu 43284b6bf8 * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see
also inherited constants for classes without superclass and
  modules.  [ruby-core:37698] [Bug #3423]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 08:31:24 +00:00
nobu d9acd1965d properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 08:16:29 +00:00
nahi d3507e3ea6 * Release GVL while OpenSSL's public key generation.
t = Thread.new { print "."; sleep 0.1 }
    key = OpenSSL::PKey::RSA.new(2048)
    #=> Thread t works in parallel with public key generation if
        OS/machine allows it.

  This works with OpenSSL >= 0.9.8. From this version, it has new 
  public key generation function which allows us to interrupt the
  execution while pkey generation iterations.

* ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
  generation function. (DH_generate_parameters_ex,
  DSA_generate_parameters_ex and RSA_generate_key_ex.

* ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
  ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
  generation which handles Thread interruption by Ruby.
  ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
  sets a stop flag. New pkey generation callback ossl_generate_cb_2
  checks the stop flag at each iterations of OpenSSL and interrupts
  pkey generation when the flag is set.

* ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
  rb_thread_blocking_region with the above unblock function to release
  GVL while pkey generation.

* ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.

* ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.

* test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 07:42:29 +00:00
usa ca3b4133fd * test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip when
win32ole is required.  in such case, win32ole redefines
  Thread#initialize, and the block argument becomes to be not the top
  of the thread, then this testcase always fails.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 05:09:29 +00:00
usa 9cdc7f9db0 * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
  committed in r33144.  I'd misunderstood the spec of ruby's universal
  newline.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 01:22:58 +00:00
naruse d163179c3e * variable.c (rb_autoloading_value) Fix the order of definitions.
It is used by autoload_defined_p.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 00:31:18 +00:00
svn 6240b52cb9 * 2011-09-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 00:23:24 +00:00
naruse 91e4b4f6d8 Remove tests of json/add/{complex, rational}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 00:23:20 +00:00
nahi 0d475da805 * variable.c (rb_autoload): There was a chance to run GC (from
rb_str_new2()) before finishing autoload_data_i construction. It
  caused SEGV at rb_gc_mark() at autoload_i_mark.

* variable.c (rb_autoload_load): Move RB_GC_GUARD() to proper
  position based on suggestion by CHIKANAGA Tomoyuki at
  http://d.hatena.ne.jp/nagachika/20110826/ruby_trunk_changes_33070_33078

* variable.c (autoload_defined_p): Fix incompatible autoload behavior
  that causes Rails crash. Class deifnition instruction defined in 
  'defineclass' in insns.def always invokes rb_autoload_load for a
  constant. It's invoked for every class definition regardless of
  existence of autoload definition. rb_autoload_load checkes if a
  constant is defined as autoloaded, but new thread-safe autoload
  returned different value if the constant is under autoloading.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 08:35:27 +00:00
nahi cfe8ed5cbc * Re-apply r33078, thread-safe autoload which is reverted at r33093.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 08:28:19 +00:00
usa f653519cbb * ChangeLog: wrong ticket number and ML number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 07:55:15 +00:00
usa 8b74d0c3fb * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
default_mode_on_unix,text_mode,binary_mode}): tests for [Bug # 5164].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 07:29:57 +00:00
naruse c06658feba * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 06:56:16 +00:00
marcandre 64e0cae274 * numeric.c (flo_round): Avoid overflow by optimizing for trivial cases
[Bug #5227]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 04:13:00 +00:00
usa 800081d0c8 * win32/win32.c (rb_w32_select_with_thread): and my typo. we all must
be more careful.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:51:13 +00:00
usa a34f81561d * thread.c (rb_thread_select): critical typo in r33117.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:49:55 +00:00
usa 13a77870de * test/-ext-/old_thread_select/test_old_thread_select.rb
(TestOldThreadSelect#test_old_select_read_timeout): if the machine
  is fast enough, the time used by code around IO.select may be smaller
  than Time implement threshold.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:34:54 +00:00
usa 34e65bee79 * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
typo.

* test/-ext-/old_thread_select/test_old_thread_select.rb
  (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
  of SIGUSR1 because the former is general and the latter is platform
  dependent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:07:21 +00:00
svn 790e8b5836 * 2011-08-31
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:04:16 +00:00
usa ee7d523631 * win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
for rb_thread_select() in thread.c.  the use of rb_fd_copy() is
  introduced in r33117.
  [Bug #5229] [ruby-core:39102]

* thread.c (rb_thread_select): must call rb_fd_init() before using
  rb_fdset_t.  see the implementations of rb_fd_init()s if you want to
  know the reason.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:04:11 +00:00
nagachika 527be1b25a * test/dl/test_callback.rb (test_callback_with_string): prevents
temporary string from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 13:39:31 +00:00
usa 13d3a16ada * vm_insnhelper.c (vm_call_cfunc): revert r33112. RB_GC_GUARD macro
protect a VALUE from GC.  It's not for general anti-optimizing
  purpose.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 13:28:58 +00:00
naruse 28bba481f9 Don't include complex and rational; fix r33122.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 05:21:27 +00:00
naruse b14c060dda * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
[Bug #5173] [ruby-core:38866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 02:23:12 +00:00
kosaki 2dd9d721ed * lib/thread.rb (Queue#pop): fix a race against Thread.wakeup.
Patch by Masaki Matsushita <glass.saga at gmail dot com>
  [Bug #5195] [ruby-dev:44400]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:59:52 +00:00
kosaki 3ffa44622d * cont.c (fiber_entry): fix stack allocation failure on Debian
GNU/kFreeBSD.
  Patch by Lucas Nussbaum <lucas at lucas-nussbaum dot net>.
  [Bug #5241] [ruby-core:39147]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:51:46 +00:00
kosaki 0cebfad20a * thread.c (rb_thread_select): rewrite by using
rb_thread_fd_select(). old one is EINTR unsafe.
  Patch by Eric Wong. [Bug #5229] [ruby-core:39102]

* test/-ext-/old_thread_select/test_old_thread_select.rb:
  a testcase for rb_thread_select().
* ext/-test-/old_thread_select/old_thread_select.c: ditto.
* ext/-test-/old_thread_select/depend: ditto.
* ext/-test-/old_thread_select/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:33:05 +00:00
svn f3ef9346d1 * 2011-08-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:13:59 +00:00
kosaki 3596d49edf * configure.in: fix a build failure on GNU Hurd.
Patch by Samuel Thibault <sthibault at debian dot org>. Thank you!
  [Bug #5250] [ruby-core:39185]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:13:56 +00:00
mrkn 9742dec279 * test/ruby/test_numeric.rb (test_num2long): modify a test agaist the
change by r33108.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29 14:24:31 +00:00
naruse 8ca1e6a0ee Use RB_GC_GUARD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29 06:51:48 +00:00