mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 12:19:36 +00:00
Pack shaped run cache arenas in 4 KiB blocks
I've been running with the shaped run cache and some extra logging, decided to bump to a 4KiB slab. The theoretical and actual waste do show up during use. My initial sizing was only a best guess based of glyph cache and a 32 cell run typically fitting just below a 2KiB slab.
This commit is contained in:
parent
e436d55b71
commit
9806100346
1 changed files with 4 additions and 2 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#define SHAPED_RUN_MAX_ENTRIES 2048u
|
||||
#define SHAPED_RUN_MAX_BYTES (1024u * 1024u)
|
||||
#define SHAPED_RUN_MA_BLOCK_SIZE 16u
|
||||
#define SHAPED_RUN_SLAB 4096u
|
||||
|
||||
typedef struct ShapedRunKey {
|
||||
uint32_t keysz_in_bytes;
|
||||
|
|
@ -56,11 +57,12 @@ static bool shaped_run_map_cmpr(KEY_TY a, KEY_TY b);
|
|||
#define MA_NAME Key
|
||||
#define MA_BLOCK_SIZE SHAPED_RUN_MA_BLOCK_SIZE
|
||||
static_assert(MA_BLOCK_SIZE > sizeof(ShapedRunKey), "increase arena block size");
|
||||
#define MA_ARENA_NUM_BLOCKS (2048u / MA_BLOCK_SIZE)
|
||||
static_assert(SHAPED_RUN_SLAB % MA_BLOCK_SIZE == 0, "slab must be a multiple of the block size");
|
||||
#define MA_ARENA_NUM_BLOCKS (SHAPED_RUN_SLAB / MA_BLOCK_SIZE)
|
||||
#include "arena.h"
|
||||
#define MA_NAME Val
|
||||
#define MA_BLOCK_SIZE SHAPED_RUN_MA_BLOCK_SIZE
|
||||
#define MA_ARENA_NUM_BLOCKS (2048u / MA_BLOCK_SIZE)
|
||||
#define MA_ARENA_NUM_BLOCKS (SHAPED_RUN_SLAB / MA_BLOCK_SIZE)
|
||||
#include "arena.h"
|
||||
|
||||
#include "kitty-verstable.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue