add type string_t
parent
b665626818
commit
0aa66e2823
|
|
@ -169,6 +169,12 @@ typedef struct
|
|||
int length;
|
||||
} BufferInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *str;
|
||||
int len;
|
||||
} string_t;
|
||||
|
||||
typedef void (*FreeDataFunc)(void *ptr);
|
||||
typedef int (*CompareFunc)(void *p1, void *p2);
|
||||
typedef void* (*MallocFunc)(size_t size);
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ int hash_set_locks(HashArray *pHash, const int lock_count)
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
//do NOT support rehash
|
||||
if (pHash->load_factor >= 0.10)
|
||||
{
|
||||
return EINVAL;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ typedef int (*HashWalkFunc)(const int index, const HashData *data, void *args);
|
|||
* pHash: the hash table
|
||||
* hash_func: hash function
|
||||
* capacity: init capacity
|
||||
* load_factor: hash load factor, such as 0.75
|
||||
* load_factor: hash load factor (or watermark), >= 0.10 for auto rehash. eg. 0.75
|
||||
* max_bytes: max memory can be used (bytes)
|
||||
* bMallocValue: if need malloc value buffer
|
||||
* return 0 for success, != 0 for error
|
||||
|
|
|
|||
Loading…
Reference in New Issue