5 while (newSize < _MxBfL) {
7 else if (newSize > 0) newSize *= 2;
10 if (newSize >
MxBfL) {
12 Bf = (
char*) malloc(newSize);
15 Bf = (
char *) realloc(
Bf, newSize);
39 int NStr=0; SIn.
Load(NStr);
41 for (
int i = 0; i < NStr; i++) {
67 for (
int i = 0; i < NStr; i++) {
96 IAssertR(Len > 0,
"String too short (lenght includes the null character)");
98 if (Len == 1 &&
IdOffV.
Len() > 0) {
return 0; }
100 memcpy(
Bf +
BfL, Str, Len);
#define IAssertR(Cond, Reason)
TBigStrPool(TSize MxBfLen=0, uint _GrowBy=16 *1024 *1024)
void LoadPoolShM(TShMIn &ShMIn, bool LoadCompact=true)
char * AdvanceCursor(TSize N)
Return the current pointer and advance the cursor.
TSizeTy Len() const
Returns the number of elements in the vector.
int AddStr(const char *Str, uint Len)
void Save(TSOut &SOut) const
static int GetPrimHashCd(const char *p)
static int GetSecHashCd(const char *p)
static int GetMn(const int &Int1, const int &Int2)
unsigned long long uint64
TBigStrPool & operator=(const TBigStrPool &Pool)
void SaveBf(const void *Bf, const TSize &BfL)
static int GetSecHashCd(const char *CStr)
void Save(const bool &Bool)
static TStr Fmt(const char *FmtStr,...)
void LoadBf(const void *Bf, const TSize &BfL)
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
static int GetPrimHashCd(const char *CStr)
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
int GetPrimHashCd() const
static int GetSecHashCd(const char *p)
void Resize(TSize _MxBfL)
static int GetPrimHashCd(const char *p)