Fix size class calculation for sec

Due to a bug in sec initialization, the number of cached size classes
was equal to 198. The bug caused the creation of more than a hundred of
unused bins, although it didn't affect the caching logic.
This commit is contained in:
Alex Lapenkou
2022-03-14 20:17:14 -07:00
committed by Alexander Lapenkov
parent 7ae0f15c59
commit 52631c90f6
2 changed files with 9 additions and 5 deletions

View File

@@ -46,6 +46,7 @@ test_sec_init(sec_t *sec, pai_t *fallback, size_t nshards, size_t max_alloc,
bool err = sec_init(TSDN_NULL, sec, base, fallback, &opts);
assert_false(err, "Unexpected initialization failure");
assert_u_ge(sec->npsizes, 0, "Zero size classes allowed for caching");
}
static inline edata_t *