From: "Mark E." To: Laurynas Biveinis , DJGPP Workers Date: Sun, 7 May 2000 13:03:20 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT 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 Precedence: bulk > > /* 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.