diff options
| author | Tyge Løvset <[email protected]> | 2020-03-24 19:43:58 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-24 19:43:58 +0100 |
| commit | 324d53aec69dc02ee4aeb11d8671a88627cde98b (patch) | |
| tree | f389df31614559531365f04ade1c09e0ca1bf577 | |
| parent | 1086f8075de19eb62fe3407a01bc2c2f353a2f93 (diff) | |
| download | STC-modified-324d53aec69dc02ee4aeb11d8671a88627cde98b.tar.gz STC-modified-324d53aec69dc02ee4aeb11d8671a88627cde98b.zip | |
Add files via upload
| -rw-r--r-- | c_lib/cmap.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/c_lib/cmap.h b/c_lib/cmap.h index 8ebba47c..ee62134c 100644 --- a/c_lib/cmap.h +++ b/c_lib/cmap.h @@ -103,7 +103,7 @@ static inline void cmap_##tag##_destroy(CMap_##tag* self) { \ CMapEntry_##tag* e = self->_table.data, *end = e + cap; \
for (; e != end; ++e) if (e->hashx) cmapentry_##tag##_destroy(e); \
} \
- cvector_map_##tag##_destroy(&self->_table); \
+ free(_cvector_alloced(self->_table.data)); \
} \
\
static inline size_t cmap_##tag##_reserve(CMap_##tag* self, size_t size); /* predeclared */ \
@@ -114,8 +114,7 @@ static inline void cmap_##tag##_clear(CMap_##tag* self) { \ } \
\
static inline void cmap_##tag##_swap(CMap_##tag* a, CMap_##tag* b) { \
- cvector_map_##tag##_swap(&a->_table, &b->_table); \
- c_swap(size_t, a->_size, b->_size); \
+ c_swap(CMap_##tag, *a, *b); \
} \
\
static inline void cmap_##tag##_setMaxLoadFactor(CMap_##tag* self, double fac) { \
@@ -123,6 +122,7 @@ static inline void cmap_##tag##_setMaxLoadFactor(CMap_##tag* self, double fac) { if (cmap_size(*self) >= cmap_buckets(*self) * fac) \
cmap_##tag##_reserve(self, (size_t) (cmap_size(*self) / fac)); \
} \
+ \
static inline void cmap_##tag##_setShrinkLimitFactor(CMap_##tag* self, double limit) { \
self->shrinkLimitPercent = (uint8_t) (limit * 100); \
if (cmap_size(*self) < cmap_buckets(*self) * limit) \
|
