HBWALLOCATOR(3)
π NAME β¨
ok so bestie, welcome to HBWALLOCATOR(3) β this is hbw::allocator<T>, the C++ allocator that plays nice with the C++ standard library allocator concepts. π
β οΈ Note: This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed. So likeβ¦ don't build your whole personality on it, okay? π
πΈ SYNOPSIS πΈ
#include <hbw_allocator.h>
Link with -lmemkind π
hbw::allocator();
template <class U>hbw::allocator<T>::allocator(const hbw::allocator<U>&);
hbw::allocator<T>::~allocator()'
hbw::allocator<T>::pointer hbw::allocator<T>::address(hbw::allocator<T>::reference x);
hbw::allocator<T>::const_pointer hbw::allocator<T>::address(hbw::allocator<T>::const_reference x);
hbw::allocator<T>::pointer hbw::allocator<T>::allocate(hbw::allocator<T>::size_type n, const void * = 0);
void hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer p, hbw::allocator<T>::size_type n);
hbw::allocator<T>::size_type hbw::allocator<T>::max_size();
void hbw::allocator<T>::construct(hbw::allocator<T>::pointer p, const hbw::allocator<T>::value_type& val);
void hbw::allocator<T>::destroy(hbw::allocator<T>::pointer p);
π DESCRIPTION π
So the whole vibe of hbw::allocator<T> is: you use it with STL containers to allocate high bandwidth memory. Memory management is based on hbwmalloc (the memkind library), which lets you get performance gains in multithreaded applications. Like, actual gains. Not fake gains. π If you want the whole lore, go read hbwmalloc(3) and memkind(3) man pages, they spill all the tea.
Every public member type and function corresponds to standard library allocator concepts and definitions. The current implementation supports C++03 standard. periodt. π
Template arguments:
Tis an object type aliased byvalue_type.Uis an object type.
Note:
hbw::allocator<T>::pointer
hbw::allocator<T>::allocate(hbw::allocator<T>::size_type n, const void * = 0) allocates high bandwidth memory using hbw_malloc(). β¨ It throws std::bad_alloc when:
n = 0,n > max_size()- or there is not enough memory to satisfy the request. π
hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer p, hbw::allocator<T>::size_type n) deallocates memory associated with pointer returned by allocate() using hbw_free(). π§
π ERRORS π
The same as described in the ERRORS section of the hbwmalloc(3) man page. No new drama, same drama. π
π¦ NOTES π¦
The hbw::allocator<T> behavior depends on the hbwmalloc heap management policy. To get and set the policy please use hbw_get_policy() and hbw_set_policy() respectively. iykyk π₯
π COPYRIGHT π
Copyright (C) 2015 - 2020 Intel Corporation. All rights reserved. π«Ά
π SEE ALSO π
hbwmalloc(3), numa(3), numactl(8), memkind(3)
ok that's the whole page bestie, you're officially fluent in high bandwidth memory allocation π β¨
π cute lil sign-off: this was brought to you by the HBWALLOCATOR(3) man page from Intel Corporation, dated 2015-11-02. slay. ππΈ
π¦ where this page comes from
- centos-stream 9: memkind-devel 1.11.0-2.el9 Β· BSD
- debian bookworm: libmemkind-dev 1.14.0-2 Β· BSD-3-Clause
- fedora 43: memkind-devel 1.14.0-11.fc43 Β· BSD-2-Clause
- ubuntu jammy: libmemkind-dev 1.13.0-1 Β· BSD-3-Clause
- ubuntu noble: libmemkind-dev 1.14.0-3build1 Β· BSD-3-Clause
- π the page's license: BSD-2-Clause
- Copyright (C) 2015 - 2020 Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms