Great point I hadn't even considered - future self thanks you for solving an issue that would have stumped me later on down the road. Thanks to both of you!
I'm actually trying to find more info about memory mapping files in Swift, but it seems that mmap
is perhaps undocumented? I found some stuff from 2011 which is preswift - and the digging into the definition in XCode it looks to be straight C? (edit: didn't realise it was a system call)
Not even quite sure how to approach writing throw conditions for try handleErrors(...)
without trial and error. Any tips on finding documentation for this?
Related: Whatโs the recommended way to memory-map a file? - #5 by benrimmington