Skip to content

Commit

Permalink
fix mempool placement
Browse files Browse the repository at this point in the history
  • Loading branch information
bertmelis authored May 14, 2024
1 parent f46b042 commit 9db2d8f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Outbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class Outbox {
: _first(nullptr)
, _last(nullptr)
, _current(nullptr)
, _prev(nullptr) {}
, _prev(nullptr)
#if EMC_USE_MEMPOOL
, _memPool()
#endif
{}
~Outbox() {
while (_first) {
Node* n = _first->next;
Expand Down Expand Up @@ -82,9 +86,6 @@ class Outbox {
private:
Node* _node = nullptr;
Node* _prev = nullptr;
#if EMC_USE_MEMPOOL
MemoryPool::Fixed<EMC_NUM_POOL_ELEMENTS, sizeof(Node)> _memPool;
#endif
};

// add node to back, advance current to new if applicable
Expand Down Expand Up @@ -200,6 +201,9 @@ class Outbox {
Node* _last;
Node* _current;
Node* _prev; // element just before _current
#if EMC_USE_MEMPOOL
MemoryPool::Fixed<EMC_NUM_POOL_ELEMENTS, sizeof(Node)> _memPool;
#endif

void _remove(Node* prev, Node* node) {
if (!node) return;
Expand Down

0 comments on commit 9db2d8f

Please sign in to comment.