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

SearchTerm: add function to convert to bytestring #5

Open
frasertweedale opened this issue Jul 27, 2017 · 0 comments
Open

SearchTerm: add function to convert to bytestring #5

frasertweedale opened this issue Jul 27, 2017 · 0 comments

Comments

@frasertweedale
Copy link
Member

frasertweedale commented Jul 27, 2017

We have to convert the SearchTerm to a C string to pass to libnotmuch.
Converting it to String then marshalling to CString is undesirable.

Ideally should use Builder to build the bytestring, convert to lazy bytestring, then convert
to strict bytestring. If we null terminate the string we can use Data.ByteString.Unsafe.unsafeUseAsCString to avoid the final copy that would be
incurred by B.useAsCString.

The query_create function should be updated to use B.ByteString at the same time.

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

No branches or pull requests

1 participant