mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-29 01:18:12 +08:00
backup for spsc
This commit is contained in:
@@ -31,6 +31,14 @@ void km_stat_print(const void *km);
|
||||
#define Kcalloc(km, type, cnt) ((type*)kcalloc((km), (cnt), sizeof(type)))
|
||||
#define Krealloc(km, type, ptr, cnt) ((type*)krealloc((km), (ptr), (cnt) * sizeof(type)))
|
||||
|
||||
#define Kgrow(km, type, ptr, __i, __m) do { \
|
||||
if ((__i) >= (__m)) { \
|
||||
(__m) = (__i) + 1; \
|
||||
(__m) += ((__m)>>1) + 16; \
|
||||
(ptr) = Krealloc(km, type, ptr, (__m)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define Kexpand(km, type, a, m) do { \
|
||||
(m) = (m) >= 4? (m) + ((m)>>1) : 16; \
|
||||
(a) = Krealloc(km, type, (a), (m)); \
|
||||
|
||||
Reference in New Issue
Block a user