inhabitedtype / bigstringaf

Bigstring intrinsics and fast blits based on memcpy/memmove
Other
37 stars 15 forks source link

implement safe blit/memcmp operations #8

Closed seliopou closed 6 years ago

seliopou commented 6 years ago

Closes #6.

gasche commented 6 years ago

Nice, thanks!

Just in case you haven't seen it before, it is possible to use Printf.ksprintf to pass a continuation to the result of the string-building format. I find it reasonably nice-looking for continuations of the form "fail with an error":

Printf.ksprintf invalid_arg
  "Bigstringaf.%s invalid range: { src_len: %d, src_off: %d, dst_len: %d, dst_off: %d, len: %d }"
  op src_len src_off dst_len dst_off len
seliopou commented 6 years ago

Thanks for the hint. I structure the code that way to keep the assembly related to exception raising out of the main function, so that the function is smaller.