summaryrefslogtreecommitdiff
path: root/src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hist.c')
-rw-r--r--src/hist.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/hist.c b/src/hist.c
index 123ed7b..bff1325 100644
--- a/src/hist.c
+++ b/src/hist.c
@@ -67,8 +67,7 @@ static TERM_NOINLINE bool ring_grow(struct hist *h, uint64_t n)
uint64_t cap = h->ring ? (uint64_t)h->ring_mask + 1 : 65536;
if (cap < 65536)
cap = 65536;
- while (cap < h->head - h->tail + n)
- cap *= 2;
+ cap = term_grow_cap64(cap, h->head - h->tail + n);
struct hline *ring = term_aligned_alloc(64, (size_t)cap * sizeof(*ring));
if (!ring)
return false;