From e3a81044ab546bead22367428a20b131f39e0195 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Fri, 9 Jan 2026 16:56:30 +0000 Subject: Invoke malloc more often because we run out of memory? --- charf.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/charf.c b/charf.c index 2552b06..101722b 100644 --- a/charf.c +++ b/charf.c @@ -36,7 +36,7 @@ static const int K=24; /*given function df[0] on domain [0,M-1], compute derivatives f' until f^{(K)} and store f^{(K)} in df*/ void differentiate(VALUETYPE* f, VALUETYPE* df, int D, int k){ - VALUETYPE df0[D]; + VALUETYPE* df0 = malloc(D*sizeof(VALUETYPE)); /*Set zeroth derivative to be f.*/ for(int i=0; i= 0){ if(d > *domain_current){ @@ -245,7 +257,8 @@ void* compute_chunk(void* arguments){ compute(p,d,f,records); i += NUM_THREADS; d = generate_function(f,i); - } + } + free(f); } int main() { -- cgit v1.2.3