Reading c-style structures from disk

If you only want to read the C structs in the file and not modify them, you may be able to create a read-only memory map to the file in order to obtain a reference to the bytes and avoid using alloc/dealloc that way (at the cost of a memmap call). This has another additional benefit: it is zero-copy, so performance will be better for bigger files.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.