From 8921ce29627b45d78d1870d550418fc3d13dcdbe Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 30 Apr 2022 05:28:06 -0700 Subject: grow memory for visits as needed --- web/dartboat_wasm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'web/dartboat_wasm.c') diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c index e7f0415..691be77 100644 --- a/web/dartboat_wasm.c +++ b/web/dartboat_wasm.c @@ -321,6 +321,8 @@ EMSCRIPTEN_KEEPALIVE void user_visit(int points) } struct leg *l = state->active_leg; + if (l->n_visits == l->size_visits) + leg_grow_visits(l); struct visit *v = l->visits + l->n_visits++; v->points = points; l->rem -= points; -- cgit v1.2.3-70-g09d2