delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/13/11:57:50

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Date: Sat, 13 Jan 2001 11:58:00 -0500
MIME-Version: 1.0
Subject: Re: memalign & valloc patch v2
Message-ID: <3A6042C8.14505.1DC212@localhost>
In-reply-to: <5137-Sat13Jan2001121228+0200-eliz@is.elta.co.il>
References: <3A5E1168 DOT 31413 DOT E8B6A2 AT localhost> (snowball3 AT bigfoot DOT com)
X-mailer: Pegasus Mail for Win32 (v3.12c)
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

> Speaking for myself, I don't think I understand the problem (not
> surprisingly, since I never looked at this issue close enough).  Could
> you perhaps elaborate a bit more on the tests gcc does in these
> failing cases, and why does it fail?

I've already found the problem. It turns out I was assuming that (aligned 
pointer - malloc'ed pointer) would be a multiple of 8. This assumption worked 
in my testing. But when using gcc, the value above could also be a multiple 
of 4 because the memory addresses returned by malloc could be end in the form 
0x.......8 or 0x.......4. My code wasn't accounting for this.

Mark

- Raw text -


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