diff options
Diffstat (limited to '')
| -rw-r--r-- | libffwd/alloc.c (renamed from src/alloc.c) | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/alloc.c b/libffwd/alloc.c index 41a59a4..6af854a 100644 --- a/src/alloc.c +++ b/libffwd/alloc.c @@ -8,8 +8,8 @@ * growth, never allocate fewer than the minimum, and round up to the * granularity so small length changes do not trigger a realloc on every call. * Existing larger capacity is preserved. */ -#define EMBED_MIN_WORKSPACE_SEQ_CAP 16 -#define EMBED_WORKSPACE_SEQ_GRANULARITY 16 +#define FFWD_MIN_WORKSPACE_SEQ_CAP 16 +#define FFWD_WORKSPACE_SEQ_GRANULARITY 16 int mul_size(size_t a, size_t b, size_t *out) { if (a != 0 && b > SIZE_MAX / a) @@ -30,12 +30,12 @@ int grow_cap(int current, int needed, int *out) { return -1; int cap = needed; - if (cap < EMBED_MIN_WORKSPACE_SEQ_CAP) - cap = EMBED_MIN_WORKSPACE_SEQ_CAP; + if (cap < FFWD_MIN_WORKSPACE_SEQ_CAP) + cap = FFWD_MIN_WORKSPACE_SEQ_CAP; - int rem = cap % EMBED_WORKSPACE_SEQ_GRANULARITY; + int rem = cap % FFWD_WORKSPACE_SEQ_GRANULARITY; if (rem != 0) { - int pad = EMBED_WORKSPACE_SEQ_GRANULARITY - rem; + int pad = FFWD_WORKSPACE_SEQ_GRANULARITY - rem; if (cap > INT_MAX - pad) return -1; cap += pad; |
