mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
perf(highlight): allocate permanent names in an arena for fun and cache locality
This commit is contained in:
@@ -605,6 +605,14 @@ void arena_mem_free(ArenaMem mem, ArenaMem *reuse_blk)
|
||||
}
|
||||
}
|
||||
|
||||
char *arena_memdupz(Arena *arena, const char *buf, size_t size)
|
||||
{
|
||||
char *mem = arena_alloc(arena, size + 1, false);
|
||||
memcpy(mem, buf, size);
|
||||
mem[size] = NUL;
|
||||
return mem;
|
||||
}
|
||||
|
||||
#if defined(EXITFREE)
|
||||
|
||||
# include "nvim/buffer.h"
|
||||
|
Reference in New Issue
Block a user