Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe-string compatibility #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

gasche
Copy link

@gasche gasche commented Sep 22, 2015

The code changes have been tested to work on 4.00, 4.01 (using the backward-compatibility ocamlfind package for bytes) and 4.02.

We now depend on the 'bytes' ocamlfind package, which provides
compatibility of Bytes-using code on older OCaml versions.

The only place where the new code is not equivalent to the previous
one is the reading of section names in index.ml: we allocate a new
string for each section name read, while the previous code mutated
a buffer in place. Allocating a Bytes buffer in place would be doable,
but then we would use Bytes.to_string to match against section name
strings (so doing an allocation in any case), or would have to use an
unsafe operation in a place where that does not feel necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant