-
Notifications
You must be signed in to change notification settings - Fork 16
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
Always store OCaml representation as a struct #55
Conversation
@rixed wrote:
To be honest, I just copied the struct from the incomplete emulation side, although it did mean in an earlier version of what's now in #50 I accidentally had one of the 128-bit copies big endian and one little endian which was, um, amusing 🤦♂️ |
@rixed awaiting your review. |
a CHANGES entry would be welcome as well. |
This looks good to me! |
Pointers to 128-bit numbers must be 16-byte aligned which OCaml cannot guarantee. Always store the number in a struct and read it into a 128-bit integer.
f49d158
to
cc56911
Compare
CHANGES: ## Fixes: * Correct conversion from uint24 to other ints (andrenth/ocaml-stdint#39, @rixed) * Fix conversion from all ints to uint24 and int24 (andrenth/ocaml-stdint#41, @rixed) * Fix int24 failing to recover from casts (andrenth/ocaml-stdint#43, @rixed) * Fix sign extensions (andrenth/ocaml-stdint#49, @rixed) * `Long_val` returns `intnat`, previously `long` was used (andrenth/ocaml-stdint#53, @dra27) * Reduce size of marshalled custom values on 4.08+ (andrenth/ocaml-stdint#54, @dra27) * Store 128-bit ints as structs to prevent unaligned access (andrenth/ocaml-stdint#55, @dra27) ## New features: * Add `of_substring` (andrenth/ocaml-stdint#49, @darlentar)
CHANGES: ## Fixes: * Correct conversion from uint24 to other ints (andrenth/ocaml-stdint#39, @rixed) * Fix conversion from all ints to uint24 and int24 (andrenth/ocaml-stdint#41, @rixed) * Fix int24 failing to recover from casts (andrenth/ocaml-stdint#43, @rixed) * Fix sign extensions (andrenth/ocaml-stdint#49, @rixed) * `Long_val` returns `intnat`, previously `long` was used (andrenth/ocaml-stdint#53, @dra27) * Reduce size of marshalled custom values on 4.08+ (andrenth/ocaml-stdint#54, @dra27) * Store 128-bit ints as structs to prevent unaligned access (andrenth/ocaml-stdint#55, @dra27) ## New features: * Add `of_substring` (andrenth/ocaml-stdint#49, @darlentar)
This is split off from #50 and will shortly be an alternative to it. This version always stores the number as a struct and reads it into a 128-bit integer.