From b6cf9680834692345c37d6ed24f77ea29d0bed10 Mon Sep 17 00:00:00 2001 From: barter-simsum Date: Wed, 13 Mar 2024 15:20:33 -0400 Subject: [PATCH] pma: btree test related changes --- rust/ares_pma/c-src/btest-overrides.h | 5 +++++ rust/ares_pma/c-src/btree.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rust/ares_pma/c-src/btest-overrides.h b/rust/ares_pma/c-src/btest-overrides.h index 94cee5c..4199461 100644 --- a/rust/ares_pma/c-src/btest-overrides.h +++ b/rust/ares_pma/c-src/btest-overrides.h @@ -10,4 +10,9 @@ #undef BT_DAT_MAXKEYS #define BT_DAT_MAXKEYS 10 +/* maxdepth expanded because when BT_DAT_MAXKEYS is shrunk, the depth of the + btree can grow higher than usual */ +#undef BT_MAXDEPTH +#define BT_MAXDEPTH 10 + #endif diff --git a/rust/ares_pma/c-src/btree.c b/rust/ares_pma/c-src/btree.c index 64b2513..aa9811f 100644 --- a/rust/ares_pma/c-src/btree.c +++ b/rust/ares_pma/c-src/btree.c @@ -367,7 +367,10 @@ _bt_insertdat(vaof_t lo, vaof_t hi, pgno_t fo, static int _bt_flip_meta(BT_state *); -#define BT_MAXDEPTH 4 /* ;;: todo derive it */ +/* TODO: derive BT_MAXDEPTH */ +#ifndef BT_MAXDEPTH +#define BT_MAXDEPTH 4 +#endif typedef struct BT_findpath BT_findpath; struct BT_findpath { BT_page *path[BT_MAXDEPTH];