diff options
Diffstat (limited to 'src/gstore.c')
| -rw-r--r-- | src/gstore.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gstore.c b/src/gstore.c index c5109c6..d2bc57f 100644 --- a/src/gstore.c +++ b/src/gstore.c @@ -355,9 +355,8 @@ uint32_t term_gstore_intern(struct gstore *g, const uint32_t *cps, int n) if (n > 2) { size_t extra = (size_t)(n - 2); if (g->arena_len + extra > g->arena_cap) { - size_t new_cap = g->arena_cap ? g->arena_cap * 2 : 512; - while (new_cap < g->arena_len + extra) - new_cap *= 2; + size_t new_cap = term_grow_cap(g->arena_cap ? g->arena_cap * 2 : 512, + g->arena_len + extra); uint32_t *next = realloc(g->arena, new_cap * sizeof(*next)); if (!next) { e->allocated = false; |
