Skip to content

Fix critical bugs and improve file hashing performance#28

Closed
kreynolds wants to merge 9 commits intonashby:masterfrom
kreynolds:code-quality-improvements
Closed

Fix critical bugs and improve file hashing performance#28
kreynolds wants to merge 9 commits intonashby:masterfrom
kreynolds:code-quality-improvements

Conversation

@kreynolds
Copy link
Copy Markdown
Contributor

@kreynolds kreynolds commented Oct 30, 2025

I have some Claude Max burning a hole in my pocket so I'm running it on some of the gems that I've found useful over the years. The following is a guided use of that for this gem.

Overview

Fixes critical memory leaks and data corruption issues, plus performance improvements for file hashing.

Changes

Critical Fixes:

  • Fix memory leaks in XXH32/XXH64 state creation when allocation fails
  • Fix file read error detection (was silently treating I/O errors as EOF)

High Priority Fixes:

  • Validate parameters before use in XXH3_64bits_reset_withSecret()
  • Fix overflow check in XXH_alignedMalloc()
  • Support full 64-bit seeds in XXH64 Ruby binding (was truncating to 32-bit)

Performance:

  • Increase file I/O buffer from 16KB to 64KB (+15-18% throughput)

Code Quality:

  • Use XXH32_hash_t for type consistency

Testing

All 21 existing tests pass with no regressions.

@nashby
Copy link
Copy Markdown
Owner

nashby commented Feb 25, 2026

Hey! Thanks for the PR but it's better to propose these changes to https://github.com/Cyan4973/xxHash directly since this gem is just a wrapper.

@nashby nashby closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants