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>
Go to the source code of this file.
Defines |
#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.
|
Define 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
Allocates the specified number of bytes.
- Parameters:
-
heap | Handle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory. |
size | Amount of memory to be allocated. |
align | Alignment constraints (power of 2) |
eb | Not used. Pass as NULL. |
- Return values:
-
Pointer | Success: Pointer to allocated buffer |
NULL | Failed to allocate memory |
- See also:
- Memory_calloc
Allocates the specified number of bytes and memory is set to zero.
- Parameters:
-
heap | Handle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory. |
size | Amount of memory to be allocated. |
align | Alignment constraints (power of 2) |
eb | Not used. Pass as NULL. |
- Return values:
-
Pointer | Success: Pointer to allocated buffer |
NULL | Failed to allocate memory |
- See also:
- Memory_alloc, MemoryOS_calloc
Frees up the specified chunk of memory.
- Parameters:
-
heap | Handle to the heap |
block | Block of memory to be freed |
size | Amount of memory to be freed |
- See also:
- IHeap_free, MemoryOS_free
Function to obtain statistics from a heap.
- Parameters:
-
heap | Handle to the heap |
stats | Pointer to the Memory stats structure to be filled. |
- See also:
Function to test for a particular IHeap quality.
- Parameters:
-
heap | Handle to the heap |
qual | Quality to be queried. |
- See also:
- Memory_Q_BLOCKING
SizeT Memory_getMaxDefaultTypeAlign |
( |
Void |
) |
|
Function to get memory alignment.
- Return values:
-
Alignment | Maximum default alignment |
Allocates the specified number of bytes and memory is set to the specified value.
- Parameters:
-
heap | Handle to the heap from which the memory is to be allocated. Specify NULL to allocate from local memory. |
size | Amount of memory to be allocated. |
align | Alignment constraints (power of 2) |
value | Value to be set for all bytes in the buffer |
eb | Not used. Pass as NULL. |
- Return values:
-
Pointer | Success: Pointer to allocated buffer |
NULL | Failed to allocate memory |
- See also:
- Memory_alloc, MemoryOS_calloc