Fixes #1791: Port Lua Bin Allocator to next:
* Bin Allocator * Lua memory allocaton fixes * Simulator memory leak fixes
This commit is contained in:
+6
-4
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user