mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +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:
@ -956,7 +956,7 @@ void nvim_buf_del_var(Buffer buffer, String name, Error *err)
|
||||
/// @param buffer Buffer handle, or 0 for current buffer
|
||||
/// @param[out] err Error details, if any
|
||||
/// @return Buffer name
|
||||
String nvim_buf_get_name(Buffer buffer, Arena *arena, Error *err)
|
||||
String nvim_buf_get_name(Buffer buffer, Error *err)
|
||||
FUNC_API_SINCE(1)
|
||||
{
|
||||
String rv = STRING_INIT;
|
||||
|
Reference in New Issue
Block a user