vimpunk / mio

Cross-platform C++11 header-only library for memory mapped file IO
MIT License
1.71k stars 157 forks source link

Allow releasing a map from the wrapper #108

Open louist103 opened 4 weeks ago

louist103 commented 4 weeks ago

Similar to std::unique_ptr's release function which allows the user to take control of the object, allow the user to take control of the map to unmap the file after the original wrapper goes out of scope. This causes an issue when using something like libzip where data added to the zip file must remain valid until the archive is closed. Normally the pointer and size can be stored by the callee and released after the archive is closed, but this is not possible