mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
caml_alloc() takes units of Wsize (word size), not bytes. As a consequence, we're allocating 4 or 8 times too much memory. Ocaml has a helper, Wsize_bsize(), but it truncates cases which aren't an exact multiple. Use a BUILD_BUG_ON() to cover the potential for truncation, as there's no rounding-up form of the helper. Fixes:8b7ce06a2d("ocaml: Add XC bindings.") Fixes:d3e649277a("ocaml: add mmap bindings implementation.") Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Christian Lindig <christian.lindig@citrix.com> (cherry picked from commit36eb2de31b)