From cac91ec4dbb4466c5f417ade44e5ca11501da129 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Fri, 29 Feb 2008 17:03:34 +1100 Subject: [PATCH] Fixed temp arrays that were allocated too large (no change in peak mem) --- libcelt/stack_alloc.h | 2 +- libcelt/vq.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libcelt/stack_alloc.h b/libcelt/stack_alloc.h index f1bb0d8d..3de8edd4 100644 --- a/libcelt/stack_alloc.h +++ b/libcelt/stack_alloc.h @@ -105,7 +105,7 @@ #include -#define ALLOC_STACK(stack) (stack = (stack==0) ? celt_alloc_scratch(30000) : stack, VALGRIND_MAKE_NOACCESS(stack, 1000)) +#define ALLOC_STACK(stack) (stack = (stack==0) ? celt_alloc_scratch(25000) : stack, VALGRIND_MAKE_NOACCESS(stack, 1000)) #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) #define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) diff --git a/libcelt/vq.c b/libcelt/vq.c index 425b41f8..68053b8b 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -148,10 +148,10 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, cel ALLOC(_ny, L*N, celt_norm_t); ALLOC(_iy, L*N, int); ALLOC(_iny, L*N, int); - ALLOC(y, L*N, celt_norm_t*); - ALLOC(ny, L*N, celt_norm_t*); - ALLOC(iy, L*N, int*); - ALLOC(iny, L*N, int*); + ALLOC(y, L, celt_norm_t*); + ALLOC(ny, L, celt_norm_t*); + ALLOC(iy, L, int*); + ALLOC(iny, L, int*); ALLOC(xy, L, celt_word32_t); ALLOC(yy, L, celt_word32_t);