From: John Hodge Date: Sun, 16 Mar 2014 15:07:54 +0000 (+0800) Subject: Kernel - Ring buffer free method X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=fabb7ed39828c58b044f9c2b4f27f55b96c6d56a;p=tpg%2Facess2.git Kernel - Ring buffer free method --- diff --git a/KernelLand/Kernel/adt.c b/KernelLand/Kernel/adt.c index 9d1a96e1..045600a3 100644 --- a/KernelLand/Kernel/adt.c +++ b/KernelLand/Kernel/adt.c @@ -17,6 +17,11 @@ tRingBuffer *RingBuffer_Create(size_t Space) return ret; } +void RingBuffer_Free(tRingBuffer *Buffer) +{ + free(Buffer); +} + size_t RingBuffer_Read(void *Dest, tRingBuffer *Buffer, size_t Length) { size_t tmpLen; diff --git a/KernelLand/Kernel/include/adt.h b/KernelLand/Kernel/include/adt.h index 67e12665..952a963e 100644 --- a/KernelLand/Kernel/include/adt.h +++ b/KernelLand/Kernel/include/adt.h @@ -24,6 +24,12 @@ typedef struct sRingBuffer * \return Pointer to the buffer structure */ extern tRingBuffer *RingBuffer_Create(size_t Space); + +/** + * \brief Free a ring buffer + */ +extern void RingBuffer_Free(tRingBuffer *Buffer); + /** * \brief Read at most \a Length bytes from the buffer * \param Dest Destinaton buffer