<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/bignum.c, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326: [Backport #21814]</title>
<updated>2026-01-25T08:41:02+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2026-01-25T08:41:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8fa17ea3b2c857369c808a4384ff7ff8174d69f8'/>
<id>8fa17ea3b2c857369c808a4384ff7ff8174d69f8</id>
<content type='text'>
	[PATCH] [Bug #21814] Fix negative bignum modulo

	If modulo is zero, do not  apply bias even if the divisor is zero.
	`BIGNUM_POSITIVE_P` is true even on bignum zero.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21814] Fix negative bignum modulo

	If modulo is zero, do not  apply bias even if the divisor is zero.
	`BIGNUM_POSITIVE_P` is true even on bignum zero.
</pre>
</div>
</content>
</entry>
<entry>
<title>bignum nogvl is offload safe. (#12132)</title>
<updated>2024-11-21T00:46:27+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-11-21T00:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89deb38736ccfb89a2de82a6087ce0723ba700e4'/>
<id>89deb38736ccfb89a2de82a6087ce0723ba700e4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Check bignum multiplication digits overflow</title>
<updated>2024-11-08T15:08:03+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-11-08T10:04:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=39537e07fe606b8b05ce2a07368f1341fe96db5d'/>
<id>39537e07fe606b8b05ce2a07368f1341fe96db5d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid interger multiplication overflow</title>
<updated>2024-11-08T10:48:56+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-11-08T06:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c348a4fd7ae7b50cc8839693aab87457a0aba6f7'/>
<id>c348a4fd7ae7b50cc8839693aab87457a0aba6f7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not round `a**b` to infinity</title>
<updated>2024-11-08T10:48:56+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-11-08T05:46:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=45cd4a8296814f3b082dfb906cdef29974726731'/>
<id>45cd4a8296814f3b082dfb906cdef29974726731</id>
<content type='text'>
... instead, just calculate the value unless it is too big.
Also, this change raises an ArgumentError if it is expected to exceed
16 GB in a 64-bit environment.

(It is possible to calculate it straightforward, but it would likely be
out-of-memory, so I didn't think it would make sense.)

[Feature #20811]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... instead, just calculate the value unless it is too big.
Also, this change raises an ArgumentError if it is expected to exceed
16 GB in a 64-bit environment.

(It is possible to calculate it straightforward, but it would likely be
out-of-memory, so I didn't think it would make sense.)

[Feature #20811]
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20524] win32: Suppress GMP warning</title>
<updated>2024-06-05T09:01:28+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-06-05T09:01:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f8e3dd4ec1afab4cd056029982229f3bbea006da'/>
<id>f8e3dd4ec1afab4cd056029982229f3bbea006da</id>
<content type='text'>
```
C:\vcpkg\installed\x64-windows\include\gmp.h(2237): warning C4146: unary minus operator applied to unsigned type, result still unsigned
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
C:\vcpkg\installed\x64-windows\include\gmp.h(2237): warning C4146: unary minus operator applied to unsigned type, result still unsigned
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Faster Integer.sqrt for large bignum</title>
<updated>2024-03-18T04:52:27+00:00</updated>
<author>
<name>tompng</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2024-03-17T14:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0ff2c7fe6fbd663ebffdbbd09c44b810cdf492d2'/>
<id>0ff2c7fe6fbd663ebffdbbd09c44b810cdf492d2</id>
<content type='text'>
Integer.sqrt uses Newton's method.
This pull request reduces the precision which was unnecessarily high in each calculation step.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Integer.sqrt uses Newton's method.
This pull request reduces the precision which was unnecessarily high in each calculation step.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor VM root modules</title>
<updated>2024-03-06T20:33:43+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2024-03-03T09:46:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d4f3dcf4dff80ded472ba3061e62c6c676ffab8c'/>
<id>d4f3dcf4dff80ded472ba3061e62c6c676ffab8c</id>
<content type='text'>
This `st_table` is used to both mark and pin classes
defined from the C API. But `vm-&gt;mark_object_ary` already
does both much more efficiently.

Currently a Ruby process starts with 252 rooted classes,
which uses `7224B` in an `st_table` or `2016B` in an `RArray`.

So a baseline of 5kB saved, but since `mark_object_ary` is
preallocated with `1024` slots but only use `405` of them,
it's a net `7kB` save.

`vm-&gt;mark_object_ary` is also being refactored.

Prior to this changes, `mark_object_ary` was a regular `RArray`, but
since this allows for references to be moved, it was marked a second
time from `rb_vm_mark()` to pin these objects.

This has the detrimental effect of marking these references on every
minors even though it's a mostly append only list.

But using a custom TypedData we can save from having to mark
all the references on minor GC runs.

Addtionally, immediate values are now ignored and not appended
to `vm-&gt;mark_object_ary` as it's just wasted space.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This `st_table` is used to both mark and pin classes
defined from the C API. But `vm-&gt;mark_object_ary` already
does both much more efficiently.

Currently a Ruby process starts with 252 rooted classes,
which uses `7224B` in an `st_table` or `2016B` in an `RArray`.

So a baseline of 5kB saved, but since `mark_object_ary` is
preallocated with `1024` slots but only use `405` of them,
it's a net `7kB` save.

`vm-&gt;mark_object_ary` is also being refactored.

Prior to this changes, `mark_object_ary` was a regular `RArray`, but
since this allows for references to be moved, it was marked a second
time from `rb_vm_mark()` to pin these objects.

This has the detrimental effect of marking these references on every
minors even though it's a mostly append only list.

But using a custom TypedData we can save from having to mark
all the references on minor GC runs.

Addtionally, immediate values are now ignored and not appended
to `vm-&gt;mark_object_ary` as it's just wasted space.
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not include a backtick in error messages and backtraces</title>
<updated>2024-02-15T09:42:31+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-01-19T07:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=25d74b9527cd525042ad0b612b794fa331d3a318'/>
<id>25d74b9527cd525042ad0b612b794fa331d3a318</id>
<content type='text'>
[Feature #16495]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #16495]
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace assert with RUBY_ASSERT in bignum.c</title>
<updated>2024-02-12T20:07:47+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-02-08T14:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6906e502f9d02a5b683bc4d0839add9f946f409a'/>
<id>6906e502f9d02a5b683bc4d0839add9f946f409a</id>
<content type='text'>
assert does not print the bug report, only the file and line number of
the assertion that failed. RUBY_ASSERT prints the full bug report, which
makes it much easier to debug.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assert does not print the bug report, only the file and line number of
the assertion that failed. RUBY_ASSERT prints the full bug report, which
makes it much easier to debug.
</pre>
</div>
</content>
</entry>
</feed>
