mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +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:
@@ -125,13 +125,6 @@ typedef kvec_withinit_t(Object, 16) ArrayBuilder;
|
||||
|
||||
#define KEYDICT_INIT { 0 }
|
||||
|
||||
#define api_free_boolean(value)
|
||||
#define api_free_integer(value)
|
||||
#define api_free_float(value)
|
||||
#define api_free_buffer(value)
|
||||
#define api_free_window(value)
|
||||
#define api_free_tabpage(value)
|
||||
|
||||
EXTERN PMap(int) buffer_handles INIT( = MAP_INIT);
|
||||
EXTERN PMap(int) window_handles INIT( = MAP_INIT);
|
||||
EXTERN PMap(int) tabpage_handles INIT( = MAP_INIT);
|
||||
|
Reference in New Issue
Block a user