diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 2dcdeac..f7a6849 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -570,6 +570,10 @@ void *malloc_or_warn(size_t size) FAST_FUNC; void *xmalloc(size_t size) FAST_FUNC; void *xzalloc(size_t size) FAST_FUNC; void *xrealloc(void *old, size_t size) FAST_FUNC; +/* After xrealloc_vector(v, 4, idx) it's ok to use + * at least v[idx] and v[idx+1], for all idx values. + * shift specifies how many new elements are added (1: 2, 2: 4... 8: 256...) + * when all elements are used up. New elements are zeroed out. */ #define xrealloc_vector(vector, shift, idx) \ xrealloc_vector_helper((vector), (sizeof((vector)[0]) << 8) + (shift), (idx)) void* xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, int idx) FAST_FUNC; |