No Documented way to Save Memory with BitIntegers
I get that using BitIntegers.jl is useful if you want to do residue class calculations.
However, I hoped that BitIntegers.jl could also be used to save some memory, but I haven't found that documented.
using BitIntegers, StaticArrays
@define_integers 24
SA{Int24}[1, 2, 3, 4, 5, 6, 7, 8] |> Base.summarysize
results in 40 instead of the intended 32. I understand, that the machine code accessing this array would be a bit more complicated, but that was exactly the reason why I did not want to bit-fiddle it myself.
But even the simple case of
struct Point
a::Int24
c::Int8
end
Point(Int24(1), Int8(2)) |> sizeof
results in 8 instead of 4.
Isn't there any way to save memory when using Int24 compared to Int32? I think either way it would help to document the behavior.
Perhaps https://github.com/Seelengrab/FieldFlags.jl could be mentioned.
It is a good idea, to mention FieldFlags.jl. I think documenting the padding issues, which are also present in C as I learned, would still be needed.