Fixes #1791: Port Lua Bin Allocator to next:

* Bin Allocator
* Lua memory allocaton fixes
* Simulator memory leak fixes
This commit is contained in:
Damjan Adamic
2014-10-26 09:14:45 +01:00
parent 56a4cf5d26
commit c89381bae5
19 changed files with 294 additions and 13 deletions
+6 -4
View File
@@ -47,10 +47,6 @@ class Fifo
{
}
bool empty() {
return (ridx == widx);
}
void push(uint8_t byte) {
uint32_t next = (widx+1) & (N-1);
if (next != ridx) {
@@ -69,6 +65,12 @@ class Fifo
return true;
}
}
bool empty() {
return (ridx == widx);
}
void flush() {
while (!empty()) {};
}
protected:
uint8_t fifo[N];