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];