package optint
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=2ae8d1e9fa30838c3c620af6a9e94b50b43a48a72ce06e318a71bb8afb52efa8
sha512=6127f5d216a66a376b75a309627e2c52c08d655c4a88a2d1df2b622d98abfe011fb10175f5f99737e950c8095596ef8fd680fe2338f53383e2263edb2d3a5c49
Description
This library provide an abstract type which represents at least a 32-bits integer. On x64, this library use a native unboxed integer (63 bits). On x86, this library use a boxed int32.
Implementation depends on target architecture.
Published: 10 Mar 2020
README
Optint - Abstract type on integer between x64 and x86 architecture
This library provide one module Optint
which use internally an int
if you are in a x64 architecture or an int32
(boxed value) if you are in a x86 architecture. This module is really unsafe and does not care some details (like the sign bit) for any cast.
Goal
The main difference between an int
and an int32
is the second is boxed. About performance this is not the best. However, you can not ensure to be in an x64 architecture where you can use directly an int
instead an int32
(and improve performance).
So, this library provide an abstraction about a real int32
. In a x64 architecture, internally, we use a int
and in a x86 architecture, we use a int32
. By this way, we ensure to have in any platform 32 free bits in Optint.t
.
Used by (11)
- carton
- carton-lwt
- chamelon
-
checkseum
< "0.3.1"
-
decompress
>= "0.8" & < "1.4.0"
-
git
>= "3.0.0"
-
mirage-kv-mem
>= "3.2.1"
-
mirage-kv-unix
>= "3.0.0"
- octez-internal-libs
-
rfc1951
< "1.0.0" | >= "1.3.0"
-
tar-mirage
>= "2.3.0"
Conflicts
None