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

#include <Fw/Types/MallocAllocator.hpp>

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

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from Fw::MemAllocator
 MemAllocator ()
 
virtual ~MemAllocator ()
 

Detailed Description

This class is an implementation of the MemAllocator base class. It uses the heap as the memory source.

Since it is heap space, the identifier is unused, and memory is never recoverable.

Definition at line 29 of file MallocAllocator.hpp.

Constructor & Destructor Documentation

◆ MallocAllocator()

Fw::MallocAllocator::MallocAllocator ( )

Definition at line 18 of file MallocAllocator.cpp.

◆ ~MallocAllocator()

Fw::MallocAllocator::~MallocAllocator ( )
virtual

Definition at line 20 of file MallocAllocator.cpp.

Member Function Documentation

◆ allocate()

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

Allocate memory.

Parameters
identifierthe memory segment identifier (not used)
sizethe requested size (not changed)
recoverable- flag to indicate the memory could be recoverable (always set to false)
Returns
the pointer to memory. Zero if unable to allocate.

Implements Fw::MemAllocator.

Definition at line 22 of file MallocAllocator.cpp.

◆ deallocate()

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

Deallocate memory.

Parameters
identifierthe memory segment identifier (not used)
ptrthe pointer to memory returned by allocate()

Implements Fw::MemAllocator.

Definition at line 33 of file MallocAllocator.cpp.


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