Clarify Ownership and Lifetime of String Returned by ogex_version #9
Labels
No labels
Epic
GHA
Release
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
major
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/Ogex#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal: Ensure users of the C API understand they should not free the string returned by
ogex_version.Currently,
ogex_versionreturns a*const c_charpointing to a static byte string. The function signature does not indicate whether the caller is responsible for freeing the memory.Documentation Improvement:
Add a comment above the function in
ffi.rsand in the public header (if any) stating:Also ensure that the returned pointer is valid for the lifetime of the program.
Implementation: