| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
[Bug #19390]
We shouldn't check the string length when skipping zeros, as the
string might only contains zero characters, resulting in an empty string.
|
| |
|
| |
|
|
|
|
| |
[Misc #18891]
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This commit removes usages of rb_gc_force_recycle since it is a burden
to maintain and makes changes to the GC difficult.
|
|
|
|
| |
Move the allocation of working buffer before the loop.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
[Feature #18051]
|
| |
|
| |
|
|
|
|
|
|
| |
... because BDIGIT_DBL may be long long. POSFIXABLE and NEGFIXABLE
ensures that the value is representable as long, but it failed to build
on emscripten with -Werror -Wshorten-64-to-32.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It uses random to determine if the bignum is sparse or not.
It is arguable if three-digit samples are enough or not to determine it,
but anyway, consuming Random source implicitly is not good.
I introduced the random sampling mechanism, and I don't know any
significant reason to do so. So, let's remove it.
This change makes the sampling points fixed: 40th, 50th, and 60th
percentiles.
|
|
|
|
| |
... instead of 1 because it requires "modulo 1". [Bug #17257]
|
| |
|
|
|
|
| |
This is no longer used.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
| |
And fixed typo in compilers.yml.
|
|
|
|
| |
To fix build failures.
|
|
|
|
| |
This shall fix compile errors.
|
|
|
| |
Split ruby.h
|
| |
|
| |
|
|
|
|
|
|
| |
Starting GCC 7, warnings about uninitialized variables are issued around
them. Such warnings could be false positives (all versions of clang do
not warn), but adding initializers there could never be bad things.
|
|
|
|
|
|
|
| |
I struggled figuring out which of the pack/unpack functions goes into which direction and the two first sentences were of the documentation were:
* Import an integer into a buffer.
* Export an integer into a buffer.
It sounds like both of them go from a ruby integer to a buffer because both use "into". So I fixed it and went to "Import an integer from a buffer". I find this much more clear.
|
| |
|
|
|
|
|
|
| |
* bignum.h: Add BIGNUM_EMBED_P
* bignum.c: Use macros for handling BIGNUM_EMBED_FLAG
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
|
|
|
|
|
| |
Turn macros into inline functions for better readability. Also add
rb_int128t2big delcaration, which was missing.
|
|
|
|
|
|
|
| |
With these macros implemented we can write codes just like we can assume
the compiler being clang. MSC_VERSION_SINCE is defined to implement
those macros, but turned out to be handy for other places. The -fdeclspec
compiler flag is necessary for clang to properly handle __has_declspec().
|
|
|
|
|
|
|
| |
These functions are used from within a compilation unit so we can
make them static, for better binary size. This changeset reduces
the size of generated ruby binary from 26,590,128 bytes to
26,584,472 bytes on my macihne.
|
|
|
|
|
| |
`Integer.sqrt(0xffff_ffff_ffff_ffff ** 2)` caused assertion failure
because of integer overflow. [ruby-core:95453] [Bug #16269]
|
|
|
|
|
| |
LONG_MAX_as_double is not needed when long is small enough to be
exactly representable as a double, e.g., IL32LLP64 platforms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset is to suppress clang's -Wimplicit-int-float-conversion
warning.
In 64 bit signed long and IEEE 754 double combination (== almost
everyone these days), LONG_MAX is 9,223,372,036,854,775,807. This
value is _not_ exactly representable by double. The nearest value
that a double can represnt is 9,223,372,036,854,775,808. It is one
greater than LONG_MAX. Let's call this value the "x".
The expression `LONG_MAX < yi` is a long versus double comparison.
According to ISO/IEC 9899:1999 Section 6.3.1.8 (that defines the
"usual rithmetic conversions"), The long value must first be casted
into double. Because FLT_ROUNDS is typically 1 ("round to the
nearest" mode), the conversion yields the "x" value shown above. So
the comparison is in fact `x < yi`.
This comparison is false for yi == x situation, i.e. yi is still
bigger than LONG_MAX. On such situation the `yn = (long)yi;`
statement that appear several lines below renders underfined
behaviour, as per ISO/IEC 9899:1999 Section 6.3.1.3.
To remedy, we just change the comparison from `<` to `<=` so that
yi == x situation can properly be handled.
|