<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>On 11 okt '12, Jonas Maebe wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><!-- html ignored --><!-- head ignored --><!-- meta ignored --><br />
<div>
<div>On 11 Oct 2012, at 15:23, <a href="mailto:dhkblaszyk@zeelandnet.nl">dhkblaszyk@zeelandnet.nl</a> wrote:</div>
<br class="Apple-interchange-newline" />
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: monospace;">Thanks, I think everything is clear now. My plan now is to<br />respect default padding and write records in one go to disk. The padding<br />value will be written to the file header so the records can be read back<br />one variable at a time when padding differs, otherwise they will be read<br />back in one go again. This will sure come at a cost, but only if the<br />file is shared between different ABI's (as is the case when sharing<br />between different endianess). The result will be that the data<br />structures will be at default padding internally allways making optimal<br />use of the CPU.<span class="Apple-converted-space"> </span><br /><br />So is there a way to get the padding value at runtime?<br /></span></span></blockquote>
</div>
<br />
<div>No. You really should write the fields one by one. Yes, it's slower. That's the cost of portability. You can always optimize by first writing them to a buffer and then writing the buffer in one go.</div>
<div>Jonas</div>
</blockquote>
<p>Sorry I keep asking questions, but why write them one by one? If I would store the offset each variable has at the time of writing (only need to do one time per record type), I could easily make the loading work (even if the ABI changes when the file is read back). What makes you prefer writing the variables one by one over once at a time?</p>
<p>Darius</p>
<p> </p>
<div> </div>
</body></html>