Is your feature request related to a problem? Please describe.
It was discovered via fcitx5-chewing integration that C and Rust version used different strategy to maintain internal buffers. We should be able to make a stronger guarantee for the *_static APIs to make them safer to use.
Describe the solution you'd like
Copy the outputs to per-context-method internal buffer. Poison previously returned buffers so it's easier to discover misuse.
Describe alternatives you've considered
Deprecate *_static functions. Although they might seem convenient to use due to lack of memory management, they are a footgun for the same reason.
Is your feature request related to a problem? Please describe.
It was discovered via fcitx5-chewing integration that C and Rust version used different strategy to maintain internal buffers. We should be able to make a stronger guarantee for the
*_static
APIs to make them safer to use.Describe the solution you'd like
Copy the outputs to per-context-method internal buffer. Poison previously returned buffers so it's easier to discover misuse.
Describe alternatives you've considered
Deprecate
*_static
functions. Although they might seem convenient to use due to lack of memory management, they are a footgun for the same reason.Additional context
https://github.com/fcitx/fcitx5-chewing/issues/18