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.
The wrapper functions in gettext-rs have to allocate
CString
s 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.