Constant lmdb::NO_MEM_INIT
[−]
pub const NO_MEM_INIT: EnvironmentFlags=
EnvironmentFlags{bits: MDB_NOMEMINIT,}
Do not initialize malloc'd memory before writing to unused spaces in the data file.
By default, memory for pages written to the data file is obtained using malloc.
While these pages may be reused in subsequent transactions, freshly malloc'd pages
will be initialized to zeroes before use. This avoids persisting leftover data from
other code (that used the heap and subsequently freed the memory) into the data
file. Note that many other system libraries may allocate and free memory from the
heap for arbitrary uses. E.g., stdio may use the heap for file I/O buffers. This
initialization step has a modest performance cost so some applications may want to
disable it using this flag. This option can be a problem for applications which
handle sensitive data like passwords, and it makes memory checkers like Valgrind
noisy. This flag is not needed with WRITE_MAP
, which writes directly to the mmap
instead of using malloc for pages. The initialization is also skipped if writing
with reserve; the caller is expected to overwrite all of the memory that was
reserved in that case.
This flag may be changed at any time using Environment::set_flags
.