Library to provide a fast integer (x64 arch) or allocated int32 (x84 arch)
Browse cluster: OCaml Systems and Utilities →Optint is a library that provides two new integer types optimized for 64-bit architectures: `Optint.t` and `Optint.Int63.t`. These types use immediate (unboxed) representation on 64-bit systems for better memory and performance efficiency, while falling back to boxed 32-bit or 64-bit representations on 32-bit architectures. The library addresses the performance cost of the standard library's `Int32.t` and `Int64.t` types, which maintain consistent heap-allocated representations across all architectures. It is implemented for OCaml and provides safe, tested alternatives to standard integer types, with the caveat that they cannot be used with OCaml's `Marshal` module.