From f5222560755e78d150a79094469210c7cd8230d8 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 18 Dec 2006 20:21:48 +0000 Subject: 2006-12-18 Jeff Johnston * libc/stdlib/mallocr.c (malloc_extend_top): Add patch from 2.6.5 version of Doug Lea's malloc which is the basis of this code. --- newlib/libc/stdlib/mallocr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libc/stdlib/mallocr.c') diff --git a/newlib/libc/stdlib/mallocr.c b/newlib/libc/stdlib/mallocr.c index cfa25545f..e7cdace22 100644 --- a/newlib/libc/stdlib/mallocr.c +++ b/newlib/libc/stdlib/mallocr.c @@ -2223,11 +2223,11 @@ static void malloc_extend_top(RARG nb) RDECL INTERNAL_SIZE_T nb; /* Also keep size a multiple of MALLOC_ALIGNMENT */ old_top_size = (old_top_size - 3*SIZE_SZ) & ~MALLOC_ALIGN_MASK; - set_head_size(old_top, old_top_size); chunk_at_offset(old_top, old_top_size )->size = SIZE_SZ|PREV_INUSE; chunk_at_offset(old_top, old_top_size + SIZE_SZ)->size = SIZE_SZ|PREV_INUSE; + set_head_size(old_top, old_top_size); /* If possible, release the rest. */ if (old_top_size >= MINSIZE) fREe(RCALL chunk2mem(old_top)); -- cgit v1.2.3