porting over some small LLT fixes
This commit is contained in:
parent
731e41cdb6
commit
45c11c944b
|
@ -74,7 +74,7 @@ typedef long int_t;
|
||||||
typedef int64_t offset_t;
|
typedef int64_t offset_t;
|
||||||
typedef u_int64_t index_t;
|
typedef u_int64_t index_t;
|
||||||
typedef int64_t ptrint_t; // pointer-size int
|
typedef int64_t ptrint_t; // pointer-size int
|
||||||
typedef u_int64_t u_ptrint_t
|
typedef u_int64_t u_ptrint_t;
|
||||||
#else
|
#else
|
||||||
#define TOP_BIT 0x80000000
|
#define TOP_BIT 0x80000000
|
||||||
#define NBITS 32
|
#define NBITS 32
|
||||||
|
|
|
@ -50,11 +50,11 @@ static void **HTNAME##_lookup_bp(htable_t *h, void *key) \
|
||||||
if (sz >= (1<<19) || (sz <= (1<<8))) \
|
if (sz >= (1<<19) || (sz <= (1<<8))) \
|
||||||
newsz = sz<<1; \
|
newsz = sz<<1; \
|
||||||
else if (sz <= HT_N_INLINE) \
|
else if (sz <= HT_N_INLINE) \
|
||||||
newsz = 32; \
|
newsz = HT_N_INLINE; \
|
||||||
else \
|
else \
|
||||||
newsz = sz<<2; \
|
newsz = sz<<2; \
|
||||||
/*printf("trying to allocate %d words.\n", newsz); fflush(stdout);*/ \
|
/*printf("trying to allocate %d words.\n", newsz); fflush(stdout);*/ \
|
||||||
tab = (void**)malloc(newsz*sizeof(void*)); \
|
tab = (void**)LLT_ALLOC(newsz*sizeof(void*)); \
|
||||||
if (tab == NULL) \
|
if (tab == NULL) \
|
||||||
return NULL; \
|
return NULL; \
|
||||||
for(i=0; i < newsz; i++) \
|
for(i=0; i < newsz; i++) \
|
||||||
|
@ -67,7 +67,7 @@ static void **HTNAME##_lookup_bp(htable_t *h, void *key) \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
if (ol != &h->_space[0]) \
|
if (ol != &h->_space[0]) \
|
||||||
free(ol); \
|
LLT_FREE(ol); \
|
||||||
\
|
\
|
||||||
sz = hash_size(h); \
|
sz = hash_size(h); \
|
||||||
maxprobe = max_probe(sz); \
|
maxprobe = max_probe(sz); \
|
||||||
|
|
Loading…
Reference in New Issue