SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
Memory.h File Reference

Detailed Description

Memory manager interface definitions.

This abstracts the Memory management interface to be used with SysLink code. Allocation, Freeing-up, copy and address translate are supported for the memory management.

#include <ti/syslink/utils/MemoryDefs.h>
#include <ti/syslink/utils/MemoryOS.h>
#include <ti/syslink/utils/_Memory.h>
#include <ti/syslink/utils/IHeap.h>
Include dependency graph for Memory.h:

Go to the source code of this file.

Macros

#define Memory_Q_BLOCKING   1
 Blocking quality Heaps with this "quality" may cause the calling thread to block; i.e., suspend execution until another thread leaves the gate.
#define Memory_copy   MemoryOS_copy
 Copies the data between memory areas.
#define Memory_set   MemoryOS_set
 Set the specific value in the said memory area.

Functions

Ptr Memory_alloc (IHeap_Handle heap, SizeT size, SizeT align, Ptr eb)
 Allocates the specified number of bytes.
Ptr Memory_calloc (IHeap_Handle heap, SizeT size, SizeT align, Ptr eb)
 Allocates the specified number of bytes and memory is set to zero.
Void Memory_free (IHeap_Handle heap, Ptr block, SizeT size)
 Frees up the specified chunk of memory.
Void Memory_getStats (IHeap_Handle heap, Memory_Stats *stats)
 Function to obtain statistics from a heap.
Bool Memory_query (IHeap_Handle heap, Int qual)
 Function to test for a particular IHeap quality.
SizeT Memory_getMaxDefaultTypeAlign (Void)
 Function to get memory alignment.
Ptr Memory_valloc (IHeap_Handle heap, SizeT size, SizeT align, Char value, Ptr eb)
 Allocates the specified number of bytes and memory is set to the specified value.

Macro Definition Documentation

#define Memory_Q_BLOCKING   1

Blocking quality Heaps with this "quality" may cause the calling thread to block; i.e., suspend execution until another thread leaves the gate.

#define Memory_copy   MemoryOS_copy

Copies the data between memory areas.

#define Memory_set   MemoryOS_set

Set the specific value in the said memory area.


Function Documentation

Ptr Memory_alloc ( IHeap_Handle  heap,
SizeT  size,
SizeT  align,
Ptr  eb 
)

Allocates the specified number of bytes.

Parameters:
heapHandle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory.
sizeAmount of memory to be allocated.
alignAlignment constraints (power of 2)
ebNot used. Pass as NULL.
Return values:
PointerSuccess: Pointer to allocated buffer
NULLFailed to allocate memory
See also:
Memory_calloc
Ptr Memory_calloc ( IHeap_Handle  heap,
SizeT  size,
SizeT  align,
Ptr  eb 
)

Allocates the specified number of bytes and memory is set to zero.

Parameters:
heapHandle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory.
sizeAmount of memory to be allocated.
alignAlignment constraints (power of 2)
ebNot used. Pass as NULL.
Return values:
PointerSuccess: Pointer to allocated buffer
NULLFailed to allocate memory
See also:
Memory_alloc, MemoryOS_calloc
Void Memory_free ( IHeap_Handle  heap,
Ptr  block,
SizeT  size 
)

Frees up the specified chunk of memory.

Parameters:
heapHandle to the heap
blockBlock of memory to be freed
sizeAmount of memory to be freed
See also:
IHeap_free, MemoryOS_free
Void Memory_getStats ( IHeap_Handle  heap,
Memory_Stats stats 
)

Function to obtain statistics from a heap.

Parameters:
heapHandle to the heap
statsPointer to the Memory stats structure to be filled.
See also:
Bool Memory_query ( IHeap_Handle  heap,
Int  qual 
)

Function to test for a particular IHeap quality.

Parameters:
heapHandle to the heap
qualQuality to be queried.
See also:
Memory_Q_BLOCKING
SizeT Memory_getMaxDefaultTypeAlign ( Void  )

Function to get memory alignment.

Return values:
AlignmentMaximum default alignment
Ptr Memory_valloc ( IHeap_Handle  heap,
SizeT  size,
SizeT  align,
Char  value,
Ptr  eb 
)

Allocates the specified number of bytes and memory is set to the specified value.

Parameters:
heapHandle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory.
sizeAmount of memory to be allocated.
alignAlignment constraints (power of 2)
valueValue to be set for all bytes in the buffer
ebNot used. Pass as NULL.
Return values:
PointerSuccess: Pointer to allocated buffer
NULLFailed to allocate memory
See also:
Memory_alloc, MemoryOS_calloc
Copyright 2014, Texas Instruments Incorporated