[Insight-developers] So... What platforms DON'T have stdint? (WAS discussion of 64bit niftilib lossage)

Steve M. Robbins steve at sumost.ca
Tue Jul 24 20:57:43 EDT 2007


On Tue, Jul 24, 2007 at 02:22:28PM -0400, Sean McBride wrote:
> On 7/24/07 1:07 PM, kent williams said:

> >Is it really the case that structure alignment is so undependable that it's
> >necessary to read and write headers a field at a time?

I believe the answer is: yes, if you want portable code.

> struct alignment is largely up to the compiler.  Most compilers provide
> #pragmas or other methods of forcing an alignment.  I also recommend reading:
> <http://en.wikipedia.org/wiki/Data_structure_alignment>
> 
> Reading one field at a time can be a performance problem, especially if
> each read generates new disk activity.

True, but you can be smarter about it: read a reasonable-sized
buffer and parse it a field at a time.

-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20070724/e1acb148/attachment.pgp


More information about the Insight-developers mailing list