delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/05/07/12:13:54

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: Laurynas Biveinis <lauras AT softhome DOT net>,
DJGPP Workers <djgpp-workers AT delorie DOT com>
Date: Sun, 7 May 2000 13:03:20 -0400
MIME-Version: 1.0
Subject: Re: Perfomance of gc-simple
Message-ID: <39156998.19034.D4090@localhost>
In-reply-to: <3915881A.13BE1702@softhome.net>
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

> >   /* Record location to pass to free() in unused allocated space.  */
> >   *((char **)(aligned_ptr - ptr_size)) = unaligned_ptr;
> 
> Could it be that unused allocated space is too small to hold a pointer and it
> will be corrupted?

DJGPP pointers are 8-byte aligned, so the minimum adjustment is 8-bytes which 
does leave room for the pointer. As long as a malloc returns a 4-byte aligned 
pointer, then the scheme should work.

> 
> Right now I'm playing with other (but similar) fix to ggc-page - allocating
> pointer with malloc, aligning it, and remembering two pointers - one for
> users, other for free().

Good. It looks like one way or another this will get fixed.

- Raw text -


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