This little library allows us to check if to
bigarray share same memory area:
ba2 ba1 .-------. .------|. | | | | | 0x000800: [-------###-------] | | . ba3
In this example,
ba2 share a small area and
returns this small area to you as a new
open Bigarray let () = let ba = Array1.create Char Bigarray.c_layout 17 in let ba1 = Array1.sub ba 0 10 in let ba2 = Array1.sub ba 7 17 in match Overlap.array1 ba1 ba2 with | Some (len, x, _y) -> let ba3 = Array1.sub ba x len in ... | None -> ...
overlap returns the length of the shared area, the
x point from
y point from
overlap is compatible with
js_of_ocaml but it lies about expected results.
Indeed, we are not able to know the position in memory of given
the JS world. By this fact,
js_of_ocaml will always returns