.\" SPDX-License-Identifier: BSD-2-Clause .\" Copyright (C) 2015 - 2020 Intel Corporation. .\" .TH "HBWALLOCATOR" 3 "2015-11-02" "Intel Corporation" "HBWALLOCATOR" \" -*- nroff -*- .SH "NAME" hbw::allocator \- The C++ allocator compatible with the C++ standard library allocator concepts .br .BR Note: This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed. .SH "SYNOPSIS" .nf .B #include .sp .B Link with -lmemkind .sp .BI "hbw::allocator();" .br .BI "template hbw::allocator::allocator(const hbw::allocator&); .br .BI "hbw::allocator::~allocator()'" .br .BI "hbw::allocator::pointer hbw::allocator::address(hbw::allocator::reference " "x" ); .br .BI "hbw::allocator::const_pointer hbw::allocator::address(hbw::allocator::const_reference " "x" ); .br .BI "hbw::allocator::pointer hbw::allocator::allocate(hbw::allocator::size_type " "n" ", const void * = 0); .br .BI "void hbw::allocator::deallocate(hbw::allocator::pointer " "p" ", hbw::allocator::size_type " "n" ); .br .BI "hbw::allocator::size_type hbw::allocator::max_size(); .br .BI "void hbw::allocator::construct(hbw::allocator::pointer " "p" ", const hbw::allocator::value_type& " "val" ); .br .BI "void hbw::allocator::destroy(hbw::allocator::pointer " "p" ); .fi .SH "DESCRIPTION" The .BR hbw::allocator 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 .BR hbwmalloc (3) and .BR memkind (3) man page for more details. .PP All public member types and functions corresponds to standard library allocator concepts and definitions. The current implementation supports C++03 standard. .PP Template arguments: .br .I T is an object type aliased by value_type. .br .I U is an object type. .PP .B Note: .br .BI "hbw::allocator::pointer hbw::allocator::allocate(hbw::allocator::size_type " "n" ", const void * = 0)" allocates high bandwidth memory using .BR hbw_malloc (). Throw .I std::bad_alloc when: .br .RS .I n = 0, .RE .br .RS .I n > .BR max_size () .RE .br .RS or there is not enough memory to satisfy the request. .RE .PP .BI "hbw::allocator::deallocate(hbw::allocator::pointer " "p" ", hbw::allocator::size_type " "n") deallocates memory associated with pointer returned by .BR allocate () using .BR hbw_free (). .SH ERRORS The same as described in .B ERRORS section of .BR hbwmalloc (3) man page. .SH "NOTES" The .BR hbw::allocator behavior depends on hbwmalloc heap management policy. To get and set the policy please use .BR hbw_get_policy () and .BR hbw_set_policy () respectively. .SH "COPYRIGHT" Copyright (C) 2015 - 2020 Intel Corporation. All rights reserved. .SH "SEE ALSO" .BR hbwmalloc (3), .BR numa (3), .BR numactl (8), .BR memkind (3)