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:
Nick Banks
2017-03-06 13:39:56 -08:00
committed by Jonathan Hui
parent 0357848f42
commit 2549d03f1f
15 changed files with 259 additions and 44 deletions
+4 -4
View File
@@ -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"