delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/08/03:11:33

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Fri, 08 Feb 2002 10:05:36 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <1928-Fri08Feb2002100535+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <0BA32251E589D2118EA60008C70DDCAB025F91A3@JNJFRISEXS1.eu.jnj.com>
(CBARIBAU AT jnjfr DOT JNJ DOT com)
Subject: Re: Alignment problem
References: <0BA32251E589D2118EA60008C70DDCAB025F91A3 AT JNJFRISEXS1 DOT eu DOT jnj DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Baribaud, Christophe [JNJFR]" <CBARIBAU AT jnjfr DOT JNJ DOT com>
> Date: Fri, 8 Feb 2002 07:23:47 +0100 
> 
> It seems that you consider that malloc should return an aligned =
> pointer. It has never been the case...

Of course, it was.  malloc should return a buffer aligned on 8-byte
boundary for any allocation whose size is greater than 8.  Even if
some other impementations of malloc don't guarantee that (I think
most if not all do), the DJGPP implementation should, since the x86
processors impose a significant penalty on unaligned accesses.

> If gcc's library permits this (and I don't believe so) it is not the =
> case for other C compilers.

This has nothing to do with the compiler: malloc is implemented in
the library.

- Raw text -


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