mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
5 lines
247 B
OCaml
5 lines
247 B
OCaml
(** How many bytes are missing for [n] to be a multiple of 8 *)
|
|
let[@inline] missing_to_round (n : int) : int = lnot (n - 1) land 0b111
|
|
|
|
(** Round up to a multiple of 8 *)
|
|
let[@inline] round_to_word (n : int) : int = n + (lnot (n - 1) land 0b111)
|