mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
refactor(api): make freeing of return-value opt-in instead of opt out
As only a few API functions make use of explicit freeing of the return value, make it opt-in instead. The arena is always present under the hood, so `Arena *arena` arg now doesn't mean anything other than getting access to this arena. Also it is in principle possible to return an allocated value while still using the arena as scratch space for other stuff (unlikely, but there no reason to not allow it).
This commit is contained in:
@@ -212,6 +212,8 @@
|
||||
#if defined(DEFINE_FUNC_ATTRIBUTES) || defined(DEFINE_EMPTY_ATTRIBUTES)
|
||||
/// Fast (non-deferred) API function.
|
||||
# define FUNC_API_FAST
|
||||
/// Return value needs to be freed
|
||||
# define FUNC_API_RET_ALLOC
|
||||
/// Internal C function not exposed in the RPC API.
|
||||
# define FUNC_API_NOEXPORT
|
||||
/// API function not exposed in Vimscript/eval.
|
||||
|
Reference in New Issue
Block a user