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 ;
32
33
// Getters
37
unsigned
long
long
getPageSize
() const ;
41
unsigned
long
long
getCurrentOffset
() const ;
45
unsigned
long
long
getAllocatedPageCount
() const ;
49
unsigned
long
long
getAvailablePageCount
() const ;
50
51
// Allocations
61
T
allocate
(
unsigned
long
long
size,
unsigned
long
long
alignment = 1) ;
62
68
void
reset
() ;
69
73
unsigned
long
long
getCurrentPageFreeMemory
() const ;
74
} ;
75
}
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