diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-22 13:12:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 13:12:58 +0200 |
commit | 7ebb25cca193063f0a3ff2ec8b6206e0832e1215 (patch) | |
tree | fbcfa265403eeaac463038c2b08cd2475f267b30 /src/nvim/api/private/handle.c | |
parent | 3d3c0c669d054ef49304223e3b91ac820996d1e0 (diff) | |
parent | c265fd31ab2b0307650ad94e1ea272e9360c345f (diff) | |
download | rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.gz rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.bz2 rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.zip |
Merge pull request #15451 from bfredl/metamap
perf(map): get rid of unnecessary pointer indirections for maps.
Diffstat (limited to 'src/nvim/api/private/handle.c')
-rw-r--r-- | src/nvim/api/private/handle.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/nvim/api/private/handle.c b/src/nvim/api/private/handle.c deleted file mode 100644 index eb96192af2..0000000000 --- a/src/nvim/api/private/handle.c +++ /dev/null @@ -1,40 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - -#include <assert.h> -#include <stdint.h> - -#include "nvim/vim.h" -#include "nvim/map.h" -#include "nvim/api/private/handle.h" - -#define HANDLE_INIT(name) name##_handles = pmap_new(handle_T)() - -#define HANDLE_IMPL(type, name) \ - static PMap(handle_T) *name##_handles = NULL; /* NOLINT */ \ - \ - type *handle_get_##name(handle_T handle) \ - { \ - return pmap_get(handle_T)(name##_handles, handle); \ - } \ - \ - void handle_register_##name(type *name) \ - { \ - pmap_put(handle_T)(name##_handles, name->handle, name); \ - } \ - \ - void handle_unregister_##name(type *name) \ - { \ - pmap_del(handle_T)(name##_handles, name->handle); \ - } - -HANDLE_IMPL(buf_T, buffer) -HANDLE_IMPL(win_T, window) -HANDLE_IMPL(tabpage_T, tabpage) - -void handle_init(void) -{ - HANDLE_INIT(buffer); - HANDLE_INIT(window); - HANDLE_INIT(tabpage); -} |