diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /src/nvim/memory.h | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'src/nvim/memory.h')
-rw-r--r-- | src/nvim/memory.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/memory.h b/src/nvim/memory.h index 63d607c2ce..5b9798dc0d 100644 --- a/src/nvim/memory.h +++ b/src/nvim/memory.h @@ -1,10 +1,12 @@ #ifndef NVIM_MEMORY_H #define NVIM_MEMORY_H -#include <stdbool.h> // for bool -#include <stddef.h> // for size_t -#include <stdint.h> // for uint8_t -#include <time.h> // for time_t +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <time.h> + +#include "nvim/macros.h" /// `malloc()` function signature typedef void *(*MemMalloc)(size_t); @@ -37,18 +39,20 @@ extern MemRealloc mem_realloc; extern bool entered_free_all_mem; #endif +EXTERN size_t arena_alloc_count INIT(= 0); + typedef struct consumed_blk { struct consumed_blk *prev; } *ArenaMem; -#define ARENA_ALIGN sizeof(void *) +#define ARENA_ALIGN MAX(sizeof(void *), sizeof(double)) typedef struct { char *cur_blk; size_t pos, size; } Arena; -// inits an empty arena. use arena_start() to actually allocate space! +// inits an empty arena. #define ARENA_EMPTY { .cur_blk = NULL, .pos = 0, .size = 0 } #define kv_fixsize_arena(a, v, s) \ |