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

Both sizeof and Base.summarysize inaccurate for non-power of two width ints #35920

Closed
lesshaste opened this issue May 18, 2020 · 2 comments
Closed

Comments

@lesshaste
Copy link

I am using https://github.com/rfourquet/BitIntegers.jl as follows.

using BitIntegers
BitIntegers.@define_integers 40
v = ones(UInt40, 10^6)

Now I do the following:

Base.summarysize(v) 
5000040
sizeof(v)
5000000

Both of these are wrong I believe as each 40-bit integer takes 64-bit of memory (i.e. one word).

The correct answer should be 8000000 (plus whatever overheads).

@KristofferC
Copy link
Member

Fixed by #35900?

@JeffBezanson
Copy link
Member

Yes, dup of #35884.

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

No branches or pull requests

3 participants