API Documentation
MAIN PAGE
NAMESPACES
CLASSES
Documentation
Headers
NilkinsMemory
Pagers
Linear
LinearPager.h
1
// LinearPager.h
3
//
5
6
namespace
nkMemory
7
{
20
template
<
typename
T =
char
*,
typename
U = DefaultMemorySpace>
21
class
LinearPager
final
22
{
23
public :
24
31
LinearPager
(
unsigned
long
long
pageSize,
UniquePtr
<
MemorySpaceAllocator<U>
> allocator = makeUnique<
DefaultMemorySpaceAllocator<U>
>()) noexcept ;
35
LinearPager
(const
LinearPager
&) noexcept = delete ;
39
LinearPager
(
LinearPager
&&) noexcept = default ;
40
41
// Getters
45
unsigned
long
long
getPageSize
() const ;
49
unsigned
long
long
getCurrentOffset
() const ;
53
unsigned
long
long
getAllocatedPageCount
() const ;
57
unsigned
long
long
getAvailablePageCount
() const ;
58
59
// Allocations
69
T
allocate
(
unsigned
long
long
size,
unsigned
long
long
alignment = 1) ;
70
76
void
reset
() ;
77
81
unsigned
long
long
getCurrentPageFreeMemory
() const ;
82
83
public :
84
85
// Operators
89
LinearPager
& operator= (const
LinearPager
&) noexcept = delete ;
93
LinearPager
& operator= (
LinearPager
&&) noexcept = default ;
94
} ;
95
}
nkMemory::LinearPager::getPageSize
unsigned long long getPageSize() const
nkMemory::LinearPager::LinearPager
LinearPager(unsigned long long pageSize, UniquePtr< MemorySpaceAllocator< U >> allocator=makeUnique< DefaultMemorySpaceAllocator< U >>()) noexcept
nkMemory::LinearPager::allocate
T allocate(unsigned long long size, unsigned long long alignment=1)
nkMemory::DefaultMemorySpaceAllocator
A default memory space allocator, offering the most basic memory allocation method.
Definition:
DefaultMemorySpaceAllocator.h:24
nkMemory::LinearPager::getAllocatedPageCount
unsigned long long getAllocatedPageCount() const
nkMemory::LinearPager
A pager using a linear allocation algorithm.
Definition:
LinearPager.h:22
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition:
UniquePtr.h:17
nkMemory::LinearPager::getCurrentOffset
unsigned long long getCurrentOffset() const
nkMemory::LinearPager::reset
void reset()
nkMemory::LinearPager::getCurrentPageFreeMemory
unsigned long long getCurrentPageFreeMemory() const
nkMemory::LinearPager::getAvailablePageCount
unsigned long long getAvailablePageCount() const
nkMemory::MemorySpaceAllocator
Defines the interface for a memory space allocator, to be used within the pagers.
Definition:
MemorySpaceAllocator.h:13
nkMemory
Encompasses all API of component NilkinsMemory.
Definition:
Allocator.h:7
Generated by
Doxygen
1.8.18