I have some data (a few tens of megabytes) consisting of mainly 32 bit integers and 64 bit doubles. I'm considering dumping it all into a file, then memory mapping the file using NSData dataWithContentsOfFile:options:error: passing NSDataReadingMappedAlways.
In Objective-C, I assume if I take the pointer returned by the -bytes method, I can cast it to whatever makes sense (uint32_t *, double * or maybe even a pointer to a packed struct) and do arithmetic on it to give random access to my data. The question is - do I have to worry about byte alignment? Is the pointer returned from -bytes aligned to anything? Suppose I had one 4-byte int then an 8-byte double... if the bytes pointer was 8-byte aligned, the double would then be misaligned. Do I need to care about this?