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

45544 Коммитов

Автор SHA1 Сообщение Дата
normal 9c4ba969a5 io.c: recycle garbage on write
* string.c (STR_IS_SHARED_M): new flag to mark shared mulitple times
  (STR_SET_SHARED): set STR_IS_SHARED_M
  (rb_str_tmp_frozen_acquire, rb_str_tmp_frozen_release): new functions
  (str_new_frozen): set/unset STR_IS_SHARED_M as appropriate
* internal.h: declare new functions
* io.c (fwrite_arg, fwrite_do, fwrite_end): new
  (io_fwrite): use new functions

Introduce rb_str_tmp_frozen_acquire and rb_str_tmp_frozen_release
to manage a hidden, frozen string.  Reuse one bit of the embed
length for shared strings as STR_IS_SHARED_M to indicate a string
has been shared multiple times.  In the common case, the string
is only shared once so the object slot can be reclaimed immediately.

minimum results in each 3 measurements. (time and size)

Execution time (sec)
name                            trunk   built
io_copy_stream_write            0.682   0.254
io_copy_stream_write_socket     1.225   0.751

Speedup ratio: compare with the result of `trunk' (greater is better)
name    built
io_copy_stream_write            2.680
io_copy_stream_write_socket     1.630

Memory usage (last size) (B)
name                            trunk           built
io_copy_stream_write            95436800.000    6512640.000
io_copy_stream_write_socket     117628928.000   7127040.000

Memory consuming ratio (size) with the result of `trunk' (greater is better)
name    built
io_copy_stream_write            14.654
io_copy_stream_write_socket     16.505

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 20:40:18 +00:00
nobu 886e8f75ca common.mk: limits.c
* common.mk (ext/rbconfig/sizeof/sizes.c): specify the target
  explicitly.

* common.mk (ext/rbconfig/sizeof/limits.c): add the recipe.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 12:00:34 +00:00
nobu 12d61437ea VC18 or later support stdbool.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 11:45:00 +00:00
svn 9dd87beb21 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 10:12:19 +00:00
shyouhei 8ad7429644 make FIXNUM_MAX visible from Ruby
Because our tests now have several places where FIXNUM_MAX is needed,
we decided to provide it along with several other constants.

	* template/limits.c.tmpl: new file, defining RbConfig::Limits

	* ext/rbconfig/sizeof/depend (limits.c): rule to generate limits.c

	* test/-ext-/num2int/test_num2int.rb: use RbConfig::Limits

	* bootstraptest/test_insns.rb: ditto.

	* .gitignore: ignore new generated file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 10:12:18 +00:00
ko1 f7015c968c add a ticket number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 07:39:27 +00:00
nobu 6cc463cac9 reduce iterations for slower machines
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 05:09:13 +00:00
nobu 9e03ee87bf fix up r57461
* internal.h: Microsoft Visual C++ has never supported C99 yet,
  even in 2017.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 04:54:52 +00:00
nobu 9b0118a84c refine assertions
* test/irb/test_ruby-lex.rb (test_prompt): invert confinue flag by
  FIXME comments.  adjust line numbers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 04:47:44 +00:00
shyouhei 7c7133b718 #include <stdbool.h>
17+ years passed since standardized in ISO, 8 years since we added
AC_HEADER_STDBOOL to configure.in.  I'm quite confident that it's
already safe to use <stdbool.h>.

I understand that when we introduced AC_HEADER_STDBOOL, <stdbool.h>
was remain not included because C standard and SVR4 curses conflicted
miserably back then (#1).  Though I believe such situation has been
fixed already(#2), I'm afraid of your operating system might ship a
proprietary curses that still conflicts with the standard. So to avoid
potential problem, we limit the inclusion to our internal use only.

#1 : 1997 version of SUSv2 said bool is "defined though typedef" in
     <curses.h>, while C99 said bool is a macro, plus in C++ bool is a
     keyword.  AFASIK the curses library has never been a part of
     POSIX.

#2 : In reality ncurses and NetBSD curses both just follow C99 to
     include <stdbool.h> from <curses.h>.  I think C99 is now widely
     adopted.

----

	* internal.h: #include <stdbool.h> if present.  That is
	  believed to be the case for 99.9% systems that lives today.
	  Non-C99, non-C++ situations are intentionally left
	  undefined, advised by Motohiro Kosaki.  If you have such
	  compiler, please fill the definition appropriately.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 04:42:04 +00:00
nobu d617fce9ab more checks for prompt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 03:57:46 +00:00
svn d492043fba * 2017-01-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 03:21:16 +00:00
nobu 5a48f20c33 test for prompt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 03:21:15 +00:00
nobu 62acbb9805 test for immature statement
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 12:53:24 +00:00
nobu 1997f7807b test for top level statement
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 12:53:23 +00:00
nobu 3abb4948b2 test for comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 12:20:26 +00:00
nobu 25ad4a7907 tests for irb lexer
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 09:51:55 +00:00
svn afe4e0e4d6 * 2017-01-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 01:35:24 +00:00
kazu b9d8758e26 {ext,test}/etc: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 01:35:23 +00:00
nobu 1127a366fd test/unit.rb: minimum workers
* test/lib/test/unit.rb (_run_parallel): launch only necessary
  workers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 11:27:32 +00:00
nobu b2c9c82cb7 extmk.rb: remove clean and install mode
* ext/extmk.rb (parse_args): remove clean and install mode, now
  configure mode only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:31:25 +00:00
nobu c3df88eca6 extmk.rb: remove direct build mode
* ext/extmk.rb (parse_args): --command-output is now mandatory.
  remove direct build mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:23:39 +00:00
nobu cc33dd2b67 extension gems in static-linked-exts
* template/configure-ext.mk.tmpl: --no-extstatic option to gems.

* template/exts.mk.tmpl: include extension gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:02:41 +00:00
nobu b3dbeb6e90 mkmf.rb: fix script installation
* lib/mkmf.rb (MakeMakefile): fix condition to install script
  files.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:02:39 +00:00
kazu 886e805799 {ext,test}/dbm: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 04:36:08 +00:00
nobu 658fc3dd26 exts.mk.tmpl: ruby names
* template/exts.mk.tmpl: extract configured ruby names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 01:43:29 +00:00
svn e52d2e038e * 2017-01-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 15:32:50 +00:00
naruse ac66222f1f fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 15:32:50 +00:00
nobu 3d5facc48f extmk.rb: fix for static-linked-ext
* ext/extmk.rb (extmake): fix up r57424 for static-linked-ext.
  separate maybestatic argument from basedir which is given always
  now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 08:05:06 +00:00
nobu dbacbc440f template/exts.mk.tmpl: fix missing dependencies
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 07:51:58 +00:00
nobu 88eea2ba69 template/exts.mk.tmpl: consider EXEEXT
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 07:23:21 +00:00
nobu df05027c2d exts.mk.tmpl: for not GNU makes
* template/exts.mk.tmpl: use `cd` then `make` instead of `make -C`
  when not GNU make.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 07:16:36 +00:00
nobu 640bcdf217 leakchecker.rb: get rid of uninitialized Tempfile
* test/lib/leakchecker.rb (LeakChecker#find_tempfiles): get rid of
  errors on uninitialized Tempfile, which can be left when
  Dir.tmpdir failed or by Tempfile.allocate.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 05:01:18 +00:00
nobu 70410163f5 enum.c: write barrier
* enum.c (rb_nmin_run): set the class with write barrier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 03:24:45 +00:00
nobu 2c1bdb5849 enum.c (rb_nmin_run): adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 03:24:44 +00:00
nobu 559bef4228 Enumerable#{min,min_by,max,max_by} [ci skip]
* enum.c: [DOC] Enumerable#{min,min_by,max,max_by} return a sorted
  array when +n+ argument is used.

* enum.c: Small typo : minimum -> maximum

[Bug #13161]
Author:    Eric Duminil <eric.duminil@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 03:24:43 +00:00
nobu 3be16b24f3 configure-ext.mk.tmpl: fix ext build
* template/configure-ext.mk.tmpl: fixed inverted names of target
  and directory, and chomp the last slash.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 02:55:02 +00:00
kazu 8edb6ce4f7 {ext,test}/date: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27 00:29:21 +00:00
kazu c71e1223c5 [DOC] Use Integer instead of Fixnum [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 15:14:02 +00:00
svn 8eeadfe06e * 2017-01-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 15:14:01 +00:00
kazu e7cc39008e lib/weakref.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 15:14:00 +00:00
kou fdbb4bb3e2 Add document for lib/rss/atom.rb
[fix GH-1520]

Patch by Tsehau Chao. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 12:47:51 +00:00
ko1 8fa99e6458 skip T_IMEMO for VMDEBUG
* vm_dump.c (vm_stack_dump_each): skip T_IMEMO object to display
  for VMDEBUG=3. [Bug #13030]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 09:57:41 +00:00
ko1 a4bc6c277a * vm_dump.c: enable to compile with VMDEBUG == 3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 09:40:25 +00:00
svn 599d751139 * 2017-01-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 08:19:35 +00:00
nobu 72ad0019ba Parallel gem configuration
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 08:19:34 +00:00
hsbt 17ee91960f Fix function name for DBM on extension document.
Patch by Yuji Yaginuma, @y-yagi <yuuji.yaginuma@gmail.com>
  [ci skip][fix GH-1519]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 07:09:58 +00:00
nobu 61701ae167 io.c: close before wait
* io.c (io_close_fptr): notify then close, and wait for other
  threads before free fptr.  [ruby-core:79262] [Bug #13158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-25 14:34:07 +00:00
kazu a7bc6c1b8f [DOC] Add empty example to enum.all? and any?
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-25 14:28:42 +00:00
nobu 7db9fbdfe6 regcomp.c: debug function [ci skip]
* regcomp.c (print_indent_tree): make a function for debug static.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-25 06:08:16 +00:00