Alignment of gfortran allocated arrays

FX Coudert fxcoudert@gmail.com
Tue Aug 14 18:12:00 GMT 2007


Hi again,

> If that is not an option and you work on a system which supports
> $LD_PRELOAD or something similar, you could just preload your own
> malloc(), which allocates SIZE+16 Bytes and returns an "allocated"
> pointer. But be carefull, you also need to LD_PRELOAD a modified  
> version
> of free()

Actually, I was walking back home when I thought I forgot to say  
exactly this! In my opinion, your best option is to preload your own  
malloc(). I would differ from Tim, still: if instead of allocating  
larger space and choosing a "good" pointer insider, you actually call  
posix_memalign(), then you don't need to overload free(). (My man  
page, at least, says that pointers returned by posix_memalign can be  
freed.)

FX



More information about the Fortran mailing list