ArmNN
 24.02
SampleMemoryManager::Pool Class Reference

#include <SampleMemoryManager.hpp>

Public Member Functions

 Pool (unsigned int numBytes)
 
 ~Pool ()
 
void Acquire ()
 
void Release ()
 
void * GetPointer ()
 
void Reserve (unsigned int numBytes)
 

Detailed Description

Definition at line 33 of file SampleMemoryManager.hpp.

Constructor & Destructor Documentation

◆ Pool()

Pool ( unsigned int  numBytes)

Definition at line 61 of file SampleMemoryManager.cpp.

62  : m_Size(numBytes),
63  m_Pointer(nullptr)
64 {}

◆ ~Pool()

~Pool ( )

Definition at line 66 of file SampleMemoryManager.cpp.

67 {
68  if (m_Pointer)
69  {
70  Release();
71  }
72 }

References SampleMemoryManager::Release().

Member Function Documentation

◆ Acquire()

void Acquire ( )

Definition at line 84 of file SampleMemoryManager.cpp.

85 {
86  m_Pointer = ::operator new(size_t(m_Size));
87 }

◆ GetPointer()

void * GetPointer ( )

Definition at line 74 of file SampleMemoryManager.cpp.

75 {
76  return m_Pointer;
77 }

Referenced by SampleMemoryManager::GetPointer().

◆ Release()

void Release ( )

Definition at line 89 of file SampleMemoryManager.cpp.

90 {
91  ::operator delete(m_Pointer);
92  m_Pointer = nullptr;
93 }

◆ Reserve()

void Reserve ( unsigned int  numBytes)

Definition at line 79 of file SampleMemoryManager.cpp.

80 {
81  m_Size = std::max(m_Size, numBytes);
82 }

Referenced by SampleMemoryManager::Manage().


The documentation for this class was generated from the following files:
sdb::SampleMemoryManager::Pool::Release
void Release()
Definition: SampleMemoryManager.cpp:89