However, in order to give the application developer some control, all
dynamic memory requests throughout the FSS and its component file sys-
tem and physical interface drivers are made through centralized functions,
which then make calls into the C library functions or can be directed to
call custom functions for either greater efficiency or monitoring purposes.
There are three heap allocation functions for
operations, and all three must be replaced with custom functions if any are
to be replaced. To use your own functions, ensure that the functions you
wish to use conform to the following prototypes for each operation.
:
malloc
void *<custom-heap_malloc-function>( int, size_t );
realloc:
void *<custom-heap_realloc-function>( int, void *, size_t );
free:
void
<custom-heap_free-function>( int, void * );
These are then required to be registered with the file system service using
the following command-value pairs:
{ ADI_FSS_CMD_SET_MALLOC_FUNC,
(void*)<custom-heap_malloc-function>
{ ADI_FSS_CMD_SET_REALLOC_FUNC,
(void*)<custom-heap_realloc-function> },
{ ADI_FSS_CMD_SET_FREE_FUNC,
(void*)<custom-heap_free-function>
Furthermore, memory allocation is divided into two categories of memory
requirement: general memory is defined as the memory required for data
structures such as device driver instance data and file descriptors, and so
on, and cache memory is defined as the memory required for cache-type
buffers such as DMA transfer buffers. Management of these categories of
memory is implemented by the use of custom (or user) heaps, available
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
File System Service
,
, and
malloc
realloc
},
},
free
12-15
Need help?
Do you have a question about the VisualDSP++ 5.0 and is the answer not in the manual?