This commit is contained in:
Heng Li
2018-09-16 14:49:53 -04:00
parent c63a33904f
commit 2b653ecda3
5 changed files with 113 additions and 3 deletions
+7
View File
@@ -31,6 +31,13 @@
#define MALLOC(type, len) ((type*)malloc((len) * sizeof(type)))
#define CALLOC(type, len) ((type*)calloc((len), sizeof(type)))
#define REALLOC(ptr, len) ((ptr) = (__typeof__(ptr))realloc((ptr), (len) * sizeof(*(ptr))))
#define EXPAND(a, m) do { \
(m) = (m)? (m) + ((m)>>1) : 16; \
REALLOC((a), (m)); \
} while (0)
#ifdef __cplusplus
extern "C" {
#endif