F´ Flight Software - C/C++ Documentation
NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
u
v
w
Variables
b
c
f
g
k
l
m
o
p
r
s
t
u
w
z
Typedefs
a
b
c
d
e
f
g
h
i
l
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
a
b
f
h
i
k
n
o
p
s
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
e
f
i
m
r
s
t
w
Enumerations
b
c
d
f
g
h
m
o
q
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Related Symbols
:
a
b
c
d
f
g
h
l
p
q
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Functions
f
g
i
m
p
r
s
t
u
Variables
_
b
c
f
g
i
l
p
r
s
w
Typedefs
a
b
c
e
f
i
n
p
s
t
u
Enumerations
Enumerator
a
b
c
f
g
h
p
r
s
t
Macros
_
a
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
►
F´ Flight Software - C/C++ Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
MallocAllocator.cpp
Go to the documentation of this file.
1
13
#include <
Fw/Types/MallocAllocator.hpp
>
14
#include <cstdlib>
15
16
namespace
Fw
{
17
18
MallocAllocator::MallocAllocator
() {
19
}
18
MallocAllocator::MallocAllocator
() {
…
}
20
21
MallocAllocator::~MallocAllocator
() {
22
}
21
MallocAllocator::~MallocAllocator
() {
…
}
23
24
void
*
MallocAllocator::allocate
(
const
NATIVE_UINT_TYPE
identifier,
NATIVE_UINT_TYPE
&size,
bool
& recoverable) {
25
// don't use identifier
26
// heap memory is never recoverable
27
recoverable =
false
;
28
void
*mem = ::malloc(size);
29
if
(
nullptr
== mem) {
30
size = 0;
// set to zero if can't get memory
31
}
32
return
mem;
33
}
24
void
*
MallocAllocator::allocate
(
const
NATIVE_UINT_TYPE
identifier,
NATIVE_UINT_TYPE
&size,
bool
& recoverable) {
…
}
34
35
void
MallocAllocator::deallocate
(
const
NATIVE_UINT_TYPE
identifier,
void
* ptr) {
36
::free(ptr);
37
}
35
void
MallocAllocator::deallocate
(
const
NATIVE_UINT_TYPE
identifier,
void
* ptr) {
…
}
38
39
}
/* namespace Fw */
NATIVE_UINT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
Definition
BasicTypes.h:52
MallocAllocator.hpp
A MemAllocator implementation class that uses malloc.
Fw::MallocAllocator::MallocAllocator
MallocAllocator()
Definition
MallocAllocator.cpp:18
Fw::MallocAllocator::allocate
void * allocate(const NATIVE_UINT_TYPE identifier, NATIVE_UINT_TYPE &size, bool &recoverable)
Allocate memory.
Definition
MallocAllocator.cpp:24
Fw::MallocAllocator::~MallocAllocator
virtual ~MallocAllocator()
Definition
MallocAllocator.cpp:21
Fw::MallocAllocator::deallocate
void deallocate(const NATIVE_UINT_TYPE identifier, void *ptr)
Deallocate memory.
Definition
MallocAllocator.cpp:35
Fw
Definition
BufferGetPortAc.cpp:11
Fw
Types
MallocAllocator.cpp
Generated by
1.10.0