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 where is_pmem(1) returns false may not do anything useful -- use msync(1) instead.