* configure.in: define RUBY_DEVEL only in the trunk.
* gc.c: enable runtime rgengc debug if RUBY_DEVEL
* ruby.c (debug_option): enable RUBY_DEBUG in --debug option only
if RUBY_DEVEL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (glob_helper): support Dir instance as `base` option.
[Feature#13056]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This experimental feature is only for Ruby-core team, not for casual users.
Usage: `./configure --enable-gcov && make && make exam && make gcov`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: get rid of unreliable tgamma() implemented of
mingw, which returns NaN unexpectedly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c (math_lgamma): check the argument before calling math
function `lgamma_r` for edge cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c (math_gamma): check the argument before calling math
function `tgamma` for edge cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: do not use buggy tgamma() of mingw.
* missing/tgamma.c (tgamma): merge fix for inifity from
ruby_tgamma. since msvcr120.dll and later have tgamma, this
implementation will not be used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Defining PACKED_STRUCT_UNALIGNED to a noop in ruby/config.h (via
`configure') prevents the definition in include/ruby/defines.h
from working
This should have been fixed in r46914, so there's a size
regression for some objects since Ruby 2.2+. I do not believe
we can backport to existing releases, either, since it can
affect ABI.
Add a test for Time objects on common x86-based platforms to
check for future regressions.
* configure.in: remove PACKED_STRUCT_UNALIGNED definition
* test/ruby/test_time.rb (test_memsize): new test for x86
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (RUBY_SETJMP_TYPE): optional flag to save signal
mask.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: default HAVE_BASERUBY to yes, for auto detection.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in, win32/configure.bat: add --with-git option to
tell git command to use, or not to use git.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: add rpath flags which is needed for OPTDIR as well
as -L options, when it is given. [ruby-dev:50065] [Bug #13411]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: define HAVE_MALLOC_CONF when using jemalloc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
These methods are useful for safe/concurrent file I/O in
multi-thread/process environments and also fairly standard
nowadays especially in systems supporting pthreads.
Based on patches by Avseyev <sergey.avseyev@gmail.com> at
[ruby-core:79290]. [Feature #4532]
* configure.in: check for pwrite(2). pread() is already used
internally for IO.copy_stream.
* io.c: implement wrappers for pread(2) and pwrite(2) and expose
them in IO.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: syscall is no longer supported on macOS since
10.12. [ruby-core:80300] [Bug #13361]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (RUBY_SO_NAME): [EXPERIMENTAL] use the given name
literally if --with-soname is specified.
[ruby-core:79972] [Misc #13296]
[ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We already check for __builtin_mul_overflow in configure but never
actually referred it before. Why not call it if available, because
that should render supposedly-optimial assembly outputs.
Optionally if __builtin_mul_overflow_p is available, which is the case
for recent GCC, use that to detect fixnum overflow. This is much
faster than the previous. On my machine generated assembly of
numeric.c:int_pow reduces from 480 to 448 bytes, according to nm(1).
Also on my machine, following script boosts from 7.819 to 6.929 sec.
time ./miniruby -e 'i=0; while i < 30_000_000 do i += 1; 7 ** 23; end'
Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
NOTE:
(1) Fixnum's LSB is always 1.
It means you can always run `x - 1` without overflow.
(2) Of course `z = x + (y-1)` may overflow.
Now z's LSB is always 1, and the MSB of true result is also 1.
You can get true result in long as `(1<<63)|(z>>1)`,
and it equals to `(z<<63)|(z>>1)` == `ror(z)`.
GCC and Clang have __builtin_add_ovewflow:
* https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
* https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (--with-gmp, --with-jemalloc): use AC_SEARCH_LIBS
to check if no library is required, instead of AC_CHECK_LIB.
[ruby-core:79368] [Bug #13175]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (crypt.h): crypt_r() was added in FreeBSD 12.0 but
is declared in unistd.h. [ruby-core:78664] [Bug #13038]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The `compatibility_version` should have an API version and the
`current_version` should have a program version of Ruby, but they have
been reversed and the binary compatibility has never worked.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: include sys/sysmacros.h for ArchLinux which deprecated
use of major() and minor() in sys/types.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (ac_cv_func_round): round(3) in x86_64-w64-mingw32
is not accurate in an edge case. [ruby-core:77794] [Bug #12878]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (RUBY_APPEND_OPTION, RUBY_PREPEND_OPTION): expand
the option to be appended/prepended when matching, as well as
RUBY_APPEND_OPTIONS and RUBY_PREPEND_OPTIONS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e