take out "asize" from vector/dequeue to picontainers.h->calcNewSize()

minAlloc and maxPoTAlloc now can be override from CMake by PIP_CONTAINERS_MIN_ALLOC and PIP_CONTAINERS_MAX_POT_ALLOC variables
This commit is contained in:
2024-11-21 20:15:18 +03:00
parent 53ec75bf0c
commit bf9ad65ff0
5 changed files with 72 additions and 66 deletions

View File

@@ -22,8 +22,21 @@
#include "piliterals_bytes.h"
const size_t minAlloc = 64;
const size_t maxPoTAlloc = 64_MiB;
#if defined(PIP_CONTAINERS_MIN_ALLOC)
# define ACTUAL_MIN_ALLOC PIP_CONTAINERS_MIN_ALLOC
#else
# define ACTUAL_MIN_ALLOC 64
#endif
#if defined(PIP_CONTAINERS_MAX_POT_ALLOC)
# define ACTUAL_MAX_POT_ALLOC PIP_CONTAINERS_MAX_POT_ALLOC
#else
# define ACTUAL_MAX_POT_ALLOC 64_MiB
#endif
const size_t minAlloc = ACTUAL_MIN_ALLOC;
const size_t maxPoTAlloc = ACTUAL_MAX_POT_ALLOC;
size_t _PIContainerConstantsBase::calcMinCountPoT(size_t szof) {