Memory and disk layout of real*10 variables

Erik Schnetter schnetter@aei.mpg.de
Sun Jul 17 12:39:00 GMT 2005


The memory layout of a real*10 variable on an i386 processor requires 12 
or 16 bytes per variable, depending on the flag -m128bit-long-double.  
The disk layout for unformatted (binary) writing occupies 10 bytes per 
variable.

This has several disadvantages.  It is different from I would naively 
expect (which does not mean much), and it is different from binary C 
I/O (which could also be ignored).  However, it is likely also rather 
inefficient if large arrays are written to disk, because a single call 
to write() or fwrite() now has to be split up into one call per array 
element, so that the padding is removed.

It is also questionable whether having a real*10 variable occupy 12 or 
16 bytes in memory is what people expect; again, this could be ignored 
since the standard permits this.

I have opened a PR for this because this set of behaviours is very 
different from other compilers and detrimental to performance.

-erik

-- 
Erik Schnetter <schnetter@aei.mpg.de>   http://www.aei.mpg.de/~eschnett/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050717/7fdf405c/attachment.sig>


More information about the Fortran mailing list