logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

hbw::allocator<T> - The C++ allocator compatible with the C++ standard library allocator concepts

Description

       The hbw::allocator<T> 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 hbwmalloc(3) and memkind(3) man page for more details.

       All public member types and functions corresponds to standard library allocator concepts and definitions.
       The current implementation supports C++03 standard.

       Template arguments:
       T is an object type aliased by value_type.
       U is an object type.

       Note:hbw::allocator<T>::pointerhbw::allocator<T>::allocate(hbw::allocator<T>::size_typen,constvoid*=0)
       allocates high bandwidth memory using hbw_malloc().  Throw 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>::pointerp,hbw::allocator<T>::size_typen) deallocates
       memory associated with pointer returned by allocate() using hbw_free().

Errors

       The same as described in ERRORS section of hbwmalloc(3) man page.

Name

       hbw::allocator<T> - The C++ allocator compatible 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.

Notes

       The hbw::allocator<T> behavior depends on hbwmalloc heap management policy. To get  and  set  the  policy
       please use hbw_get_policy() and hbw_set_policy() respectively.

See Also

hbwmalloc(3), numa(3), numactl(8), memkind(3)

Intel Corporation                                  2015-11-02                                    HBWALLOCATOR(3)

Synopsis

#include<hbw_allocator.h>Linkwith-lmemkindhbw::allocator();template<classU>hbw::allocator<T>::allocator(consthbw::allocator<U>&);hbw::allocator<T>::~allocator()'hbw::allocator<T>::pointerhbw::allocator<T>::address(hbw::allocator<T>::referencex);hbw::allocator<T>::const_pointerhbw::allocator<T>::address(hbw::allocator<T>::const_referencex);hbw::allocator<T>::pointerhbw::allocator<T>::allocate(hbw::allocator<T>::size_typen,constvoid*=0);voidhbw::allocator<T>::deallocate(hbw::allocator<T>::pointerp,hbw::allocator<T>::size_typen);hbw::allocator<T>::size_typehbw::allocator<T>::max_size();voidhbw::allocator<T>::construct(hbw::allocator<T>::pointerp,consthbw::allocator<T>::value_type&val);voidhbw::allocator<T>::destroy(hbw::allocator<T>::pointerp);

See Also