Found and added another unused but missing subroutine from the bplane

implementation.
This commit is contained in:
Tim Edwards 2020-04-08 12:28:26 -04:00
parent 2d35bb52b3
commit 116feec2df
2 changed files with 12 additions and 2 deletions

View File

@ -276,8 +276,8 @@ int IHashStats2(IHashTable *table,
if(nEntries) *nEntries = table->iht_nEntries;
return
UtlsStatMallocMem(sizeof(IHashTable)) +
UtlsStatMallocMem(sizeof(void *)* table->iht_nBuckets);
IHashAlignedSize(sizeof(IHashTable)) +
IHashAlignedSize(sizeof(void *)* table->iht_nBuckets);
}
/* hash for key fields that are pointers to strings */

View File

@ -42,6 +42,16 @@
#ifndef _IHASH_H
#define _IHASH_H
/* returns total memory required for malloc of given size, for */
/* routine IHashStat2() only. */
static __inline__ int IHashAlignedSize(int size)
{
int result;
/* Expand size to be double-word (64 bit) aligned */
result = ((size + 7) / 8) * 8;
}
/* The IHashTable struct should not be manipulated directly by clients */
typedef struct ihashtable