Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type handling to work on 32-bit systems (Superseded by #20) #18

Closed
wants to merge 1 commit into from
Closed

Conversation

kimikage
Copy link
Contributor

Fixes #16

I do not have a clear policy on the extent to which I should make changes. At least, this is not a minimal fix.

@@ -33,11 +33,11 @@ module Inflate
export inflate, inflate_zlib, inflate_gzip,
InflateStream, InflateZlibStream, InflateGzipStream

# Huffman codes are internally represented by Vector{Vector{Int}},
# Huffman codes are internally represented by Vector{Vector{UInt16}},
Copy link
Contributor Author

@kimikage kimikage May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be done in a separate PR, but I think the tables of 64-bit elements are inefficient.

The bit width of this package is not very important because there are other performance bottlenecks in this package.
The important point here is that Unsigned should be used, not Signed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to decouple 32-bit correctness from optimizations. The latter can be measured to verify if they are effective.


abstract type AbstractInflateData end

mutable struct InflateData <: AbstractInflateData
bytes::Vector{UInt8}
current_byte::Int
current_byte::UInt8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I beleve that *_byte should be a UInt8 type.

Comment on lines -318 to -320
if crc_table[1] == 0
make_crc_table()
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't crc_table[1] always zero?

@kimikage kimikage marked this pull request as ready for review May 28, 2024 20:36
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.35%. Comparing base (f16eec8) to head (ba815fa).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
- Coverage   99.35%   99.35%   -0.01%     
==========================================
  Files           1        1              
  Lines         468      463       -5     
==========================================
- Hits          465      460       -5     
  Misses          3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kimikage kimikage marked this pull request as draft May 29, 2024 07:29
@kimikage kimikage changed the title Improve type handling to work on 32-bit systems Improve type handling to work on 32-bit systems (Superseded by #20) May 29, 2024
@kimikage
Copy link
Contributor Author

See #20.

@kimikage kimikage closed this May 29, 2024
@kimikage kimikage deleted the type_handling branch May 30, 2024 00:15
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.

Malfunctioning on 32-bit systems and inconsistent type handling
3 participants