[PATCH] introduce a MALLOC_ALIGNMENT configuration macro

Olivier Hainque hainque@adacore.com
Fri Jun 27 21:39:00 GMT 2008


Richard Guenther wrote:
> >  While adding a parameter is a very nice idea, a per-target
> >  static default still looks useful to me.
> 
> Well, if it is an always correct default, yes.

 Understood :-)

> In principle the allocator has to make sure it can serve allocation requests
> for any type such that the guaranteed natural alignment required by C
> is fulfilled.  The maximum natural alignment is specified by the ABI and
> would be, for i?86 for example, 4 bytes.  For x86_64 it would be 8 bytes.

 Fine with me. AFAICS, STACK_BOUNDARY might fit the bill as a common default.

 A possible track would then be to have an "OS_MALLOC_ALIGNMENT" optional target
 definition defaulted to STACK_BOUNDARY + a malloc-alignment user parameter.

 Are we allowed to reference the "target machine" macros from params.def ?
 I'm wondering how to control the default parameter value.

 Thanks for your feedback,

 Olivier



 


   

  



More information about the Gcc-patches mailing list