1FIXEDALLOCATOR(3) FIXEDALLOCATOR FIXEDALLOCATOR(3)
2
3
4
6 libmemkind::fixed::allocator<T> - The C++ allocator compatible with the
7 C++ standard library allocator concepts
8 Note: fixed_allocator.h is a part of stable API (STANDARD API).
9
11 #include <fixed_allocator.h>
12
13 Link with -lmemkind
14
15 libmemkind::fixed::allocator(void *addr, size_t size);
16 template <typename U> libmemkind::fixed::allocator<T>::allocator(const libmemkind::fixed::allocator<U>&) noexcept;
17 template <typename U> libmemkind::fixed::allocator<T>::allocator(allocator<U>&& other) noexcept;
18 libmemkind::fixed::allocator<T>::~allocator();
19 T *libmemkind::fixed::allocator<T>::allocate(std::size_t n) const;
20 void libmemkind::fixed::allocator<T>::deallocate(T *p, std::size_t n) const;
21 template <class U, class... Args> void libmemkind::fixed::allocator<T>::construct(U *p, Args... &&args) const;
22 void libmemkind::fixed::allocator<T>::destroy(T *p) const;
23
25 The libmemkind::fixed::allocator<T> is intended to be used with STL
26 containers to allocate memory on specific area. Memory management is
27 handled by jemalloc on the supplied area. Refer memkind(3) man page for
28 more details.
29
30 All public member types and functions correspond to standard library
31 allocator concepts and definitions. The current implementation supports
32 C++11 standard.
33
34 Template arguments:
35 T is an object type aliased by value_type.
36 U is an object type.
37
38 Note:
39 T *libmemkind::fixed::allocator<T>::allocate(std::size_t n) allocates
40 memory using memkind_malloc() on the area supplied to lib‐
41 memkind::fixed::allocator(). Throws std::bad_alloc when:
42 n = 0
43 or there is not enough memory to satisfy the request.
44
45 libmemkind::fixed::allocator<T>::deallocate(T *p, std::size_t n) de‐
46 allocates memory associated with pointer returned by allocate() using
47 memkind_free().
48
49
51 Copyright (C) 2021 Intel Corporation. All rights reserved.
52
54 memkind(3)
55
56
57
58Intel Corporation 2021-12-03 FIXEDALLOCATOR(3)