How does mmap interact with lifetime rules for C++ objects?
Background I've recently been looking at parsing ELF files as a learning exercise and while checking my working against readelf, I came across this comment which made me physically recoil. Since we do not know how big the symbol table is, we default to reading in the entire file (!) and processing that. I was already trying to avoid un-needed copying as much as possible but this made me determined to get as close as I could to the other extreme: a zero-copy implementation. My starting point is mmap. The problem I have is ensuring that using the resulting memory is free of undefined behaviour.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.