|
Packit Service |
7f3b24 |
.\" SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
.\" Copyright (C) 2018 - 2020 Intel Corporation.
|
|
Packit Service |
7f3b24 |
.\"
|
|
Packit Service |
7f3b24 |
.TH "PMEMALLOCATOR" 3 "2018-09-13" "Intel Corporation" "PMEMALLOCATOR" \" -*- nroff -*-
|
|
Packit Service |
7f3b24 |
.SH "NAME"
|
|
Packit Service |
7f3b24 |
libmemkind::pmem::allocator<T> \- The C++ allocator compatible with the C++ standard library allocator concepts
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BR Note:
|
|
Packit Service |
7f3b24 |
.I pmem_allocator.h
|
|
Packit Service |
7f3b24 |
functionality is considered as stable API (STANDARD API).
|
|
Packit Service |
7f3b24 |
.SH "SYNOPSIS"
|
|
Packit Service |
7f3b24 |
.nf
|
|
Packit Service |
7f3b24 |
.B #include <pmem_allocator.h>
|
|
Packit Service |
7f3b24 |
.sp
|
|
Packit Service |
7f3b24 |
.B Link with -lmemkind
|
|
Packit Service |
7f3b24 |
.sp
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::allocator(const char " "*dir" ", size_t " "max_size" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::llocator(const char " "&dir" ", size_t " "max_size" ", libmemkind::allocation_policy " "alloc_policy" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::allocator(const std::string " "&dir" ", size_t " "max_size" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::allocator(const std::string " "&dir" ", size_t " "max_size" ", libmemkind::allocation_policy " "alloc_policy" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "template <typename U> libmemkind::pmem::allocator<T>::allocator(const libmemkind::pmem::allocator<U>&)" " "noexcept;
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "template <typename U> libmemkind::pmem::allocator(const allocator<U>&& " "other" ) " "noexcept;
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::allocator<T>::~allocator();
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "T *libmemkind::pmem::allocator<T>::allocate(std::size_t " "n" ) " "const;
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "void libmemkind::pmem::allocator<T>::deallocate(T " "*p" ", std::size_t " "n" ) " "const;
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "template <class U, class... Args> void libmemkind::pmem::allocator<T>::construct(U " "*p" ", Args... " "args" ) " "const;
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "void libmemkind::pmem::allocator<T>::destroy(T " "*p" ) " "const;
|
|
Packit Service |
7f3b24 |
.fi
|
|
Packit Service |
7f3b24 |
.SH "DESCRIPTION"
|
|
Packit Service |
7f3b24 |
The
|
|
Packit Service |
7f3b24 |
.BR libmemkind::pmem::allocator<T>
|
|
Packit Service |
7f3b24 |
is intended to be used with STL containers to allocate persistent memory. Memory management is based on memkind_pmem (memkind library). Refer
|
|
Packit Service |
7f3b24 |
.BR memkind_pmem (3)
|
|
Packit Service |
7f3b24 |
and
|
|
Packit Service |
7f3b24 |
.BR memkind (3)
|
|
Packit Service |
7f3b24 |
man page for more details.
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
The
|
|
Packit Service |
7f3b24 |
.BR libmemkind::allocation_policy
|
|
Packit Service |
7f3b24 |
specifies allocator memory usage policy, which allows to tune up memory utilization. The available types of allocator usage policy:
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
.B libmemkind::allocation_policy::DEFAULT
|
|
Packit Service |
7f3b24 |
Default allocator memory usage policy.
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
.B libmemkind::allocation_policy::CONSERVATIVE
|
|
Packit Service |
7f3b24 |
Conservative allocator memory usage policy - prioritize memory usage at cost of performance.
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
All public member types and functions corresponds to standard library allocator concepts and definitions. The current implementation supports C++11 standard.
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
Template arguments:
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.I T
|
|
Packit Service |
7f3b24 |
is an object type aliased by value_type.
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.I U
|
|
Packit Service |
7f3b24 |
is an object type.
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
.BR Note:
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "T *libmemkind::pmem::allocator<T>::allocate(std::size_t " "n")
|
|
Packit Service |
7f3b24 |
allocates persistent memory using
|
|
Packit Service |
7f3b24 |
.BR memkind_malloc ().
|
|
Packit Service |
7f3b24 |
Throw
|
|
Packit Service |
7f3b24 |
.I std::bad_alloc
|
|
Packit Service |
7f3b24 |
when:
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.RS
|
|
Packit Service |
7f3b24 |
.I n
|
|
Packit Service |
7f3b24 |
= 0
|
|
Packit Service |
7f3b24 |
.RE
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.RS
|
|
Packit Service |
7f3b24 |
or there is not enough memory to satisfy the request.
|
|
Packit Service |
7f3b24 |
.RE
|
|
Packit Service |
7f3b24 |
.PP
|
|
Packit Service |
7f3b24 |
.BI "libmemkind::pmem::allocator<T>::deallocate(T " "*p" ", std::size_t " "n")
|
|
Packit Service |
7f3b24 |
deallocates memory associated with pointer returned by
|
|
Packit Service |
7f3b24 |
.BR allocate ()
|
|
Packit Service |
7f3b24 |
using
|
|
Packit Service |
7f3b24 |
.BR memkind_free ().
|
|
Packit Service |
7f3b24 |
|
|
Packit Service |
7f3b24 |
.SH "COPYRIGHT"
|
|
Packit Service |
7f3b24 |
Copyright (C) 2018 - 2020 Intel Corporation. All rights reserved.
|
|
Packit Service |
7f3b24 |
.SH "SEE ALSO"
|
|
Packit Service |
7f3b24 |
.BR memkind_pmem (3),
|
|
Packit Service |
7f3b24 |
.BR memkind (3)
|