felipecrv commented on issue #4428: URL: https://github.com/apache/arrow-adbc/issues/4428#issuecomment-4849593093
> Seems quite reasonable to me. Any thoughts [@felipecrv](https://github.com/felipecrv) [@eitsupi](https://github.com/eitsupi)? The only way to truly avoid allocations is to change the annotations to take `&CStr` [1] because the ABI expects NUL-terminated strings. If you take a `value: &str` you have to allocate a `CString` [2] (don't confuse with `&CStr` [1]) to append the `NUL` at the end. If you take `&CStr`, you can define static `CStr` in your code and if you have to allocate, you allocate `CString` right away -- no need to recreate strings with a `NUL` at the end. [1] https://doc.rust-lang.org/std/ffi/struct.CStr.html [2] https://doc.rust-lang.org/std/ffi/struct.CString.html -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
