bool file_storage::truncate_mapped(size_t size) { log_resizing(size); #ifndef MREMAP_MAYMOVE if (!unmap()) return false; #endif if (!truncate(size)) return false; #ifndef MREMAP_MAYMOVE return map(size); #else return remap(size); #endif }
bool memory_map::truncate_mapped(size_t size) { log_resizing(size); // Critical Section (conditional/external) /////////////////////////////////////////////////////////////////////////// conditional_lock lock(remap_mutex_); #ifndef MREMAP_MAYMOVE if (!unmap()) return false; #endif if (!truncate(size)) return false; #ifndef MREMAP_MAYMOVE return map(size); #else return remap(size); #endif /////////////////////////////////////////////////////////////////////////// }