Plug in variable size queue implementation for saving buffer space in iAP.

This commit is contained in:
Russell
2011-12-06 17:12:44 +00:00
parent f979c80dbd
commit 1e1cb9288d
3 changed files with 49 additions and 10 deletions

View File

@@ -9,10 +9,11 @@ typedef struct queue {
int rdptr; // Using absolute indices which count reads and writes so this needs to be considered when accessing.
int wrptr;
int size;
int element_size;
int mask;
} queue;
void init_queue(REFERENCE_PARAM(queue, q), unsigned arr[], int size);
void init_queue(REFERENCE_PARAM(queue, q), unsigned char arr[], int size, int element_size);
void enqueue(REFERENCE_PARAM(queue, q), unsigned value);
unsigned dequeue(REFERENCE_PARAM(queue, q));
int isempty(REFERENCE_PARAM(queue, q));