|
Packit Service |
7f3b24 |
.\" SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
.\" Copyright (C) 2015 - 2020 Intel Corporation.
|
|
Packit Service |
7f3b24 |
.\"
|
|
Packit Service |
7f3b24 |
.TH "HBWALLOCATOR" 3 "2015-11-02" "Intel Corporation" "HBWALLOCATOR" \" -*- nroff -*-
|
|
Packit Service |
7f3b24 |
.SH "NAME"
|
|
Packit Service |
7f3b24 |
hbw::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 |
This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.
|
|
Packit Service |
7f3b24 |
.SH "SYNOPSIS"
|
|
Packit Service |
7f3b24 |
.nf
|
|
Packit Service |
7f3b24 |
.B #include <hbw_allocator.h>
|
|
Packit Service |
7f3b24 |
.sp
|
|
Packit Service |
7f3b24 |
.B Link with -lmemkind
|
|
Packit Service |
7f3b24 |
.sp
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator();"
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "template <class U>hbw::allocator<T>::allocator(const hbw::allocator<U>&);
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::~allocator()'"
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::address(hbw::allocator<T>::reference " "x" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::const_pointer hbw::allocator<T>::address(hbw::allocator<T>::const_reference " "x" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::allocate(hbw::allocator<T>::size_type " "n" ", const void * = 0);
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "void hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer " "p" ", hbw::allocator<T>::size_type " "n" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::size_type hbw::allocator<T>::max_size();
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "void hbw::allocator<T>::construct(hbw::allocator<T>::pointer " "p" ", const hbw::allocator<T>::value_type& " "val" );
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "void hbw::allocator<T>::destroy(hbw::allocator<T>::pointer " "p" );
|
|
Packit Service |
7f3b24 |
.fi
|
|
Packit Service |
7f3b24 |
.SH "DESCRIPTION"
|
|
Packit Service |
7f3b24 |
The
|
|
Packit Service |
7f3b24 |
.BR hbw::allocator<T>
|
|
Packit Service |
7f3b24 |
is intended to be used with STL containers to allocate high bandwidth memory. Memory management is based on hbwmalloc (memkind library), enabling users to gain performance in multithreaded applications. Refer
|
|
Packit Service |
7f3b24 |
.BR hbwmalloc (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 |
All public member types and functions corresponds to standard library allocator concepts and definitions. The current implementation supports C++03 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 |
.B Note:
|
|
Packit Service |
7f3b24 |
.br
|
|
Packit Service |
7f3b24 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::allocate(hbw::allocator<T>::size_type " "n" ", const void * = 0)"
|
|
Packit Service |
7f3b24 |
allocates high bandwidth memory using
|
|
Packit Service |
7f3b24 |
.BR hbw_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 |
.I n
|
|
Packit Service |
7f3b24 |
>
|
|
Packit Service |
7f3b24 |
.BR max_size ()
|
|
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 "hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer " "p" ", hbw::allocator<T>::size_type " "n")
|
|
Packit Service |
7f3b24 |
deallocates memory associated with pointer returned by
|
|
Packit Service |
7f3b24 |
.BR allocate ()
|
|
Packit Service |
7f3b24 |
using
|
|
Packit Service |
7f3b24 |
.BR hbw_free ().
|
|
Packit Service |
7f3b24 |
|
|
Packit Service |
7f3b24 |
.SH ERRORS
|
|
Packit Service |
7f3b24 |
The same as described in
|
|
Packit Service |
7f3b24 |
.B ERRORS
|
|
Packit Service |
7f3b24 |
section of
|
|
Packit Service |
7f3b24 |
.BR hbwmalloc (3)
|
|
Packit Service |
7f3b24 |
man page.
|
|
Packit Service |
7f3b24 |
.SH "NOTES"
|
|
Packit Service |
7f3b24 |
The
|
|
Packit Service |
7f3b24 |
.BR hbw::allocator<T>
|
|
Packit Service |
7f3b24 |
behavior depends on hbwmalloc heap management policy. To get and set the policy please use
|
|
Packit Service |
7f3b24 |
.BR hbw_get_policy ()
|
|
Packit Service |
7f3b24 |
and
|
|
Packit Service |
7f3b24 |
.BR hbw_set_policy ()
|
|
Packit Service |
7f3b24 |
respectively.
|
|
Packit Service |
7f3b24 |
.SH "COPYRIGHT"
|
|
Packit Service |
7f3b24 |
Copyright (C) 2015 - 2020 Intel Corporation. All rights reserved.
|
|
Packit Service |
7f3b24 |
.SH "SEE ALSO"
|
|
Packit Service |
7f3b24 |
.BR hbwmalloc (3),
|
|
Packit Service |
7f3b24 |
.BR numa (3),
|
|
Packit Service |
7f3b24 |
.BR numactl (8),
|
|
Packit Service |
7f3b24 |
.BR memkind (3)
|