22 May 16:49
[integer] Promotion of endian library code from vault
From: Neil Mayhew <neil_mayhew <at> users.sourceforge.net>
Subject: [integer] Promotion of endian library code from vault
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-05-22 14:53:29 GMT
Subject: [integer] Promotion of endian library code from vault
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-05-22 14:53:29 GMT
On 2006-07-22 12:21:01, Beman Dawes wrote: > [boost] [integer] endian-0.6 posted w/ names changed > endian-0.6.zip has been posted in the integer directory of the file > vault at http://boost-consulting.com/vault/ This code is still in the vault, but I'd like to see it in the main part of boost. What needs to be done to make this happen? The endian library is exactly what I've been looking for, and I would really like to use it in my work, but I can't justify that to my colleagues if it's not an official part of boost. I would hate to become yet another person that reinvents this particular wheel. However, I notice there was a lot of discussion <http://lists.boost.org/Archives/boost/2006/07/108125.php> about PODs vs constructors, because of unions, so maybe not enough consensus was reached? There were some interesting proposals but no agreed-upon solution. In which case, I suspect that people will need to copy the code and each hack it to suit their own purposes, which is not what boost is all about. I have two use cases from my own work: TrueType fonts, and Mac HFS+ file systems. Both of these are big-endian file formats that need to be read into memory and processed, so (FWIW) I would support the POD approach. Currently, I can't use the code as-is because of the need to use the types in unions. References: http://lists.boost.org/Archives/boost/2000/03/2495.php http://lists.boost.org/Archives/boost/2006/05/105621.php(Continue reading)
I find that mmap()ing binary files into memory has the following
significant advantage compared to read()ing them in: if the file is
large and memory is tight, then read-in data must be swapped out i.e.
written to disk. In contrast, read-only mmap()ed pages can simply be
discarded from RAM. Even if the data is never actually swapped out,
unless the OS over-commits swap space, disk will be reserved for this
data. So mmap() has a performance benefit on all memory-constrained
systems and also a disk (i.e. flash) space benefit on embedded systems.
So while I'm generally quite pedantic about standards-compliance
issues, struct layout is an area where I'm prepared to assume that the
RSS Feed