delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/03/02/11:01:59

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200203021549.QAA04624@father.ludd.luth.se>
Subject: Re: Malloc/free DJGPP code
In-Reply-To: <3C80E4AF.BB20511F@phekda.freeserve.co.uk> from Richard Dawe at "Mar 2, 2002 02:41:51 pm"
To: djgpp-workers AT delorie DOT com
Date: Sat, 2 Mar 2002 16:49:35 +0100 (MET)
X-Mailer: ELM [version 2.4ME+ PL54 (25)]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Charles Sandmann wrote:
> *** malloc.c_   Wed Dec  5 14:52:52 2001
> --- malloc.c    Tue Feb 12 10:52:20 2002
> *************** malloc(size_t size)
> *** 192,195 ****
> --- 192,196 ----
>     }
> 
> +   brk((void *)( ((int)sbrk(0)+(ALIGN-1)) & ~(ALIGN-1) )); /* Align next sbrk */
>     chunk_size = size+16; /* two ends plus two placeholders */
>     rv = (BLOCK *)sbrk(chunk_size);
> 
> I posted both; little feedback on which should be committed.  But it's
> important that the block overhead be a factor of the alignment or you
> will almost never merge blocks.

I think this one is best. Short and to the point.


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019