diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-02-21 12:30:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-21 12:30:28 +0100 |
| commit | 09651342e746af38c38f22f3cae6bfb40dade327 (patch) | |
| tree | 37548d8d3f4cb673c8f2293a96aa635cdd8917ff /src/nvim/api/private | |
| parent | 9bb046d1be5aa9ba0482b2cad050b286d4b78978 (diff) | |
| parent | 4fb1739e6f1f06f10165f3c9a7b80a1ec014db3c (diff) | |
| download | rneovim-09651342e746af38c38f22f3cae6bfb40dade327.tar.gz rneovim-09651342e746af38c38f22f3cae6bfb40dade327.tar.bz2 rneovim-09651342e746af38c38f22f3cae6bfb40dade327.zip | |
Merge pull request #27552 from bfredl/apialloc
refactor(api): make freeing of return-value opt-in instead of opt out.
Diffstat (limited to 'src/nvim/api/private')
| -rw-r--r-- | src/nvim/api/private/dispatch.h | 4 | ||||
| -rw-r--r-- | src/nvim/api/private/helpers.h | 7 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h index 6d051176ac..288f368fba 100644 --- a/src/nvim/api/private/dispatch.h +++ b/src/nvim/api/private/dispatch.h @@ -18,8 +18,8 @@ struct MsgpackRpcRequestHandler { ///< uv loop (the loop is run very frequently due to breakcheck). ///< If "fast" is false, the function is deferred, i e the call will ///< be put in the event queue, for safe handling later. - bool arena_return; ///< return value is allocated in the arena (or statically) - ///< and should not be freed as such. + bool ret_alloc; ///< return value is allocated and should be freed using api_free_object + ///< otherwise it uses arena and/or static memory }; extern const MsgpackRpcRequestHandler method_handlers[]; diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 20bc889a0a..7eda8ffaf6 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -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); |