* 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
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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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