aboutsummaryrefslogtreecommitdiff
path: root/libffwd/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--liblangdet/alloc.c (renamed from libffwd/alloc.c)12
1 files changed, 6 insertions, 6 deletions
diff --git a/libffwd/alloc.c b/liblangdet/alloc.c
index ba21fbb..4bc1496 100644
--- a/libffwd/alloc.c
+++ b/liblangdet/alloc.c
@@ -9,8 +9,8 @@
* - never allocate less than the minimum required size.
* - round up to the granularity so small length changes do not trigger a realloc on every call.
* - keep existing capacity if it is already larger. */
-#define FFWD_MIN_WORKSPACE_SEQ_CAP 16
-#define FFWD_WORKSPACE_SEQ_GRANULARITY 16
+#define LANGDET_MIN_WORKSPACE_SEQ_CAP 16
+#define LANGDET_WORKSPACE_SEQ_GRANULARITY 16
int mul_size(size_t a, size_t b, size_t *out) {
if (a != 0 && b > SIZE_MAX / a)
@@ -24,12 +24,12 @@ int grow_cap(int current, int needed, int *out) {
return -1;
int cap = needed;
- if (cap < FFWD_MIN_WORKSPACE_SEQ_CAP)
- cap = FFWD_MIN_WORKSPACE_SEQ_CAP;
+ if (cap < LANGDET_MIN_WORKSPACE_SEQ_CAP)
+ cap = LANGDET_MIN_WORKSPACE_SEQ_CAP;
- int rem = cap % FFWD_WORKSPACE_SEQ_GRANULARITY;
+ int rem = cap % LANGDET_WORKSPACE_SEQ_GRANULARITY;
if (rem != 0) {
- int pad = FFWD_WORKSPACE_SEQ_GRANULARITY - rem;
+ int pad = LANGDET_WORKSPACE_SEQ_GRANULARITY - rem;
if (cap > INT_MAX - pad)
return -1;
cap += pad;