F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Fw::MemAllocator Class Referenceabstract

#include <Fw/Types/MemAllocator.hpp>

Inheritance diagram for Fw::MemAllocator:
Fw::MallocAllocator Fw::MmapAllocator

Public Member Functions

virtual void * allocate (const NATIVE_UINT_TYPE identifier, NATIVE_UINT_TYPE &size, bool &recoverable)=0
 Allocate memory. More...
 
virtual void deallocate (const NATIVE_UINT_TYPE identifier, void *ptr)=0
 Deallocate memory. More...
 

Protected Member Functions

 MemAllocator ()
 
virtual ~MemAllocator ()
 

Detailed Description

Definition at line 46 of file MemAllocator.hpp.

Constructor & Destructor Documentation

◆ MemAllocator()

Fw::MemAllocator::MemAllocator ( )
protected

Definition at line 17 of file MemAllocator.cpp.

◆ ~MemAllocator()

Fw::MemAllocator::~MemAllocator ( )
protectedvirtual

Definition at line 19 of file MemAllocator.cpp.

Member Function Documentation

◆ allocate()

virtual void* Fw::MemAllocator::allocate ( const NATIVE_UINT_TYPE  identifier,
NATIVE_UINT_TYPE size,
bool &  recoverable 
)
pure virtual

Allocate memory.

Parameters
identifierthe memory segment identifier, each identifier is to be used in once single allocation
sizethe requested size - changed to actual if different
recoverable- flag to indicate the memory could be recoverable
Returns
the pointer to memory. Zero if unable to allocate

Implemented in Fw::MmapAllocator, and Fw::MallocAllocator.

◆ deallocate()

virtual void Fw::MemAllocator::deallocate ( const NATIVE_UINT_TYPE  identifier,
void *  ptr 
)
pure virtual

Deallocate memory.

Parameters
identifierthe memory segment identifier, each identifier is to be used in once single allocation
ptrthe pointer to memory returned by allocate()

Implemented in Fw::MmapAllocator, and Fw::MallocAllocator.


The documentation for this class was generated from the following files: