btw, if you really need to create a subview, then you can create your own substring type on top of bigarray, that will basically have the following type definition
type view = {
off : int;
len : int;
data : Bigstring.t;
}
Then the view function will just change off and len and won’t touch data and therefore ba_sub would never be called.
Surprisingly, this type already exists in BAP, it is called Memory.t
And Memory.view is efficient as it doesn’t do any slices.