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

Suggestion: use gettext-sys directly to avoid allocations #18

Open
ajtribick opened this issue Jul 5, 2023 · 1 comment
Open

Suggestion: use gettext-sys directly to avoid allocations #18

ajtribick opened this issue Jul 5, 2023 · 1 comment

Comments

@ajtribick
Copy link

The wrapper functions in gettext-rs have to allocate CStrings on each call due to the interface of the underlying C library.

It may be interesting to use something like what the cstr! macro in the cstr crate does to append the trailing zero byte at compile time and pass the result directly to the gettext-sys functions, avoiding the intermediate allocation.

@ogoffart
Copy link
Member

ogoffart commented Jul 5, 2023

yes, we could implement such things with a feature flag.

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

2 participants