WinStd
Windows Win32 API using Standard C++
|
HeapAlloc allocator. More...
#include <WinStd/Win.h>
Classes | |
struct | rebind |
A structure that enables an allocator for objects of one type to allocate storage for objects of another type. More... | |
Public Types | |
typedef _Ty | value_type |
A type that is managed by the allocator. | |
typedef _Ty * | pointer |
A type that provides a pointer to the type of object managed by the allocator. | |
typedef _Ty & | reference |
A type that provides a reference to the type of object managed by the allocator. | |
typedef const _Ty * | const_pointer |
A type that provides a constant pointer to the type of object managed by the allocator. | |
typedef const _Ty & | const_reference |
A type that provides a constant reference to type of object managed by the allocator. | |
typedef SIZE_T | size_type |
An unsigned integral type that can represent the length of any sequence that an object of template class heap_allocator can allocate. | |
typedef ptrdiff_t | difference_type |
A signed integral type that can represent the difference between values of pointers to the type of object managed by the allocator. | |
Public Member Functions | |
heap_allocator (HANDLE heap) | |
Constructs allocator. | |
template<class _Other > | |
heap_allocator (const heap_allocator< _Other > &other) | |
Constructs allocator from another type. | |
pointer | allocate (size_type count) |
Allocates a new memory block. | |
void | deallocate (pointer ptr, size_type size) |
Frees memory block. | |
void | construct (pointer ptr, const _Ty &val) |
Calls copying constructor for the element. | |
void | construct (pointer ptr, _Ty &&val) |
Calls moving constructor for the element. | |
void | destroy (pointer ptr) |
Calls destructor for the element. | |
size_type | max_size () const |
Returns maximum memory block size. | |
Public Attributes | |
HANDLE | m_heap |
Heap handle. | |
HeapAlloc allocator.
|
inline |
Constructs allocator.
[in] | heap | Handle to existing heap |
|
inline |
Constructs allocator from another type.
[in] | other | Another allocator of the heap_allocator kind |
|
inline |
Allocates a new memory block.
[in] | count | Number of elements |
|
inline |
Calls moving constructor for the element.
[in] | ptr | Pointer to memory block |
[in] | val | Source element |
|
inline |
Calls copying constructor for the element.
[in] | ptr | Pointer to memory block |
[in] | val | Source element |
|
inline |
Frees memory block.
[in] | ptr | Pointer to memory block |
[in] | size | Size of memory block (in bytes) |
|
inline |
Calls destructor for the element.
[in] | ptr | Pointer to memory block |