Open chambart opened 9 years ago
Something like that:
type buffer = { buffer : string; offset : int; length : int } let read_int32 buf = if buf.offset + 4 >= length then raise Some_error else let result = read_int32_from_string buf.buffer buf.offset in { buf = buf with offset = buf.offset + 4 }
Successions of read shouldn't allocate too much. This is a pattern heavily used in cstruct generated code.
Maybe add something to the asmcomp/ testsuite.
Something like that:
Successions of read shouldn't allocate too much. This is a pattern heavily used in cstruct generated code.