aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/memory.h')
-rw-r--r--src/nvim/memory.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/memory.h b/src/nvim/memory.h
index 0c048e1b5b..63d607c2ce 100644
--- a/src/nvim/memory.h
+++ b/src/nvim/memory.h
@@ -51,6 +51,10 @@ typedef struct {
// inits an empty arena. use arena_start() to actually allocate space!
#define ARENA_EMPTY { .cur_blk = NULL, .pos = 0, .size = 0 }
+#define kv_fixsize_arena(a, v, s) \
+ ((v).capacity = (s), \
+ (v).items = (void *)arena_alloc(a, sizeof((v).items[0]) * (v).capacity, true))
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memory.h.generated.h"
#endif