diff options
Diffstat (limited to 'c/enc/memory.h')
-rw-r--r-- | c/enc/memory.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/c/enc/memory.h b/c/enc/memory.h index 2d56e97..ab928d0 100644 --- a/c/enc/memory.h +++ b/c/enc/memory.h @@ -80,6 +80,21 @@ R: requested size } \ } +/* +Appends value and dynamically grows array capacity when needed +M: MemoryManager +T: data type +A: array +C: array capacity +S: array size +V: value to append +*/ +#define BROTLI_ENSURE_CAPACITY_APPEND(M, T, A, C, S, V) { \ + (S)++; \ + BROTLI_ENSURE_CAPACITY(M, T, A, C, S); \ + A[(S) - 1] = (V); \ +} + #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ #endif |