unmap#
Release a mapping explicitly before the scalar goes out of scope.
Σύνοψη#
unmap $map;
When to call it#
Most programs never need to. A mapped scalar is unmapped automatically when it is freed - at scope exit for my variables, at the end of the program for globals - and the kernel flushes any pending writes as part of that. Call unmap explicitly when you want to release the memory (and close the mapping of the file) before the natural lifetime of the scalar ends.
After unmap, the scalar becomes an ordinary empty string and can be reused for any purpose, including being mapped again.
Οριακές περιπτώσεις#
Calling
unmapon a scalar that is not mapped raises an exception.
Διαφορές από το upstream#
Fully compatible with upstream File::Map 0.71.
Δείτε επίσης#
sync- flush writes without releasing the mapping.