[pull] master from mruby:master#174
Merged
pull[bot] merged 7 commits intosysfce2:masterfrom Jan 9, 2026
Merged
Conversation
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
mpz_and, mpz_or, and mpz_xor were not calling trim() on their results, causing inflated size values with trailing zero limbs. This led to incorrect comparisons in ucmp() and caused udiv() to take wrong code paths, resulting in memory leaks when exceptions occurred. Also added defensive overflow checks in mpz_init_heap and udiv. Co-authored-by: Claude <noreply@anthropic.com>
Add MRB_BIGINT_BIT_LIMIT (1 billion bits / 128MB) to prevent unreasonably large allocations when left-shifting by huge amounts. Raises RangeError instead of attempting multi-GB allocations. Co-authored-by: Claude <noreply@anthropic.com>
Reduces recursion overhead for large number multiplication. Benchmarks show ~32% speedup for million-bit operands. Co-authored-by: Claude <noreply@anthropic.com>
Add fast path for multiplying numbers of form 2^n - 1 (all bits set). Uses algebraic identities: - (2^n - 1) * (2^m - 1) = 2^(n+m) - 2^n - 2^m + 1 - (2^n - 1) * y = (y << n) - y These are O(n) operations instead of O(n^1.585) for Karatsuba. Fuzzing test cases using all-ones patterns now complete in 0.01s instead of 13+ seconds. Also raises KARATSUBA_THRESHOLD from 8 to 32 for ~32% speedup on general large number multiplication. Co-authored-by: Claude <noreply@anthropic.com>
Add fast path for multiplying by powers of 2 (2^n). Uses left shift instead of Karatsuba multiplication: x * 2^n = x << n. This optimizes "mostly-zero" patterns common in fuzzing tests, where numbers like 2^2097150 (single bit set) would otherwise trigger slow Karatsuba multiplication. Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )