diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-09-29 13:05:44 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-09-29 13:05:44 +0200 |
| commit | cf7d8169ec12cb3adf90d4ff78b3257e74985302 (patch) | |
| tree | f666589acfd68e76bbde4e74eead44ae7819d0bb /libffwd/alloc.c | |
| parent | 91871be6ece9317c5d49353f6474583e7e28168d (diff) | |
| download | langdet-cf7d8169ec12cb3adf90d4ff78b3257e74985302.tar.gz langdet-cf7d8169ec12cb3adf90d4ff78b3257e74985302.zip | |
Remove unused model families and inference paths
Diffstat (limited to 'libffwd/alloc.c')
| -rw-r--r-- | libffwd/alloc.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/libffwd/alloc.c b/libffwd/alloc.c index 828258e..ba21fbb 100644 --- a/libffwd/alloc.c +++ b/libffwd/alloc.c @@ -19,13 +19,6 @@ int mul_size(size_t a, size_t b, size_t *out) { return 0; } -int add_size(size_t a, size_t b, size_t *out) { - if (b > SIZE_MAX - a) - return -1; - *out = a + b; - return 0; -} - int grow_cap(int current, int needed, int *out) { if (current < 0 || needed <= 0) return -1; @@ -61,13 +54,6 @@ int realloc_floats(float **ptr, size_t count) { return 0; } -float *malloc_floats(size_t count) { - size_t bytes; - if (mul_size(count, sizeof(float), &bytes) != 0) - return NULL; - return (float *)malloc(bytes); -} - int realloc_floats_2d(float **ptr, int rows, int cols) { if (rows < 0 || cols < 0) return -1; @@ -77,15 +63,3 @@ int realloc_floats_2d(float **ptr, int rows, int cols) { return -1; return realloc_floats(ptr, count); } - -int realloc_ints(int **ptr, size_t count) { - size_t bytes; - if (mul_size(count, sizeof(int), &bytes) != 0) - return -1; - - void *p = realloc(*ptr, bytes); - if (!p && bytes != 0) - return -1; - *ptr = (int *)p; - return 0; -} |
