Function pmem::is_pmem
[−]
[src]
pub fn is_pmem<T>(x: &T) -> bool
Checks if an entire object consists of persistent memory
If true
then it is safe to use persist(1)
and other related functions to make changes durable for that memory range.
The implementation of is_pmem(1)
requires a non-trivial amount of work to determine if the given range is
entirely persistent memory. For this reason, it is better to call is_pmem(1)
once when a range of memory is first encountered,
save the result, and use the saved result to determine whether persist()
or msync(1)
is appropriate for flushing changes to persistence.
Calling is_pmem(1)
each time changes are flushed to persistence will not perform well.
Warning: Using
persist(1)
on a range whereis_pmem(1)
returnsfalse
may not do anything useful -- usemsync(1)
instead.