mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 00:30:07 +00:00
Add Dynamic Memory Support to otLwf.sys (#1414)
* Add Dynamic Memory Support * Use single list for free buffers. Null mNext on return of new buffer. * Use Paged memory for Buffers.
This commit is contained in:
@@ -63,7 +63,7 @@ extern "C" {
|
||||
* @param[in] aBufferSize The size in bytes of a Buffer object.
|
||||
*
|
||||
*/
|
||||
void otPlatMessagePoolInit(uint16_t aMinNumFreeBuffers, size_t aBufferSize);
|
||||
void otPlatMessagePoolInit(otInstance *aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize);
|
||||
|
||||
/**
|
||||
* Allocate a buffer from the platform managed buffer pool.
|
||||
@@ -71,7 +71,7 @@ void otPlatMessagePoolInit(uint16_t aMinNumFreeBuffers, size_t aBufferSize);
|
||||
* @returns A pointer to the Buffer or NULL if no Buffers are available.
|
||||
*
|
||||
*/
|
||||
otMessage *otPlatMessagePoolNew(void);
|
||||
otMessage *otPlatMessagePoolNew(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function is used to free a Buffer back to the platform managed buffer pool.
|
||||
@@ -79,7 +79,7 @@ otMessage *otPlatMessagePoolNew(void);
|
||||
* @param[in] aBuffer The Buffer to free.
|
||||
*
|
||||
*/
|
||||
void otPlatMessagePoolFree(otMessage *aBuffer);
|
||||
void otPlatMessagePoolFree(otInstance *aInstance, otMessage *aBuffer);
|
||||
|
||||
/**
|
||||
* Get the number of free buffers.
|
||||
@@ -87,7 +87,7 @@ void otPlatMessagePoolFree(otMessage *aBuffer);
|
||||
* @returns The number of buffers currently free and available to OpenThread.
|
||||
*
|
||||
*/
|
||||
uint16_t otPlatMessagePoolNumFreeBuffers(void);
|
||||
uint16_t otPlatMessagePoolNumFreeBuffers(otInstance *aInstance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user