diff options
author | 2019-02-06 10:24:34 +0100 | |
---|---|---|
committer | 2019-02-07 21:54:11 +0100 | |
commit | 3b899b86e67e3a5cc093d2dd9c0dcaeed197c806 (patch) | |
tree | 5efe135d75b1fd837549719bfa6572802870be1b /src/lib/netlist/plib/palloc.cpp | |
parent | c8d0db0c83d4b72e86f6255b95ff45ccc475d85d (diff) |
netlist: Refactoring after adding clang-tidy support to netlist makefile
- convert macros to c++ code.
- order of device creation should not depend on std lib.
- some state saving cleanup.
- added support for clang-tidy to makefile.
- modifications triggered by clang-tidy-9.
Diffstat (limited to 'src/lib/netlist/plib/palloc.cpp')
-rw-r--r-- | src/lib/netlist/plib/palloc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/netlist/plib/palloc.cpp b/src/lib/netlist/plib/palloc.cpp index 80fd2098a66..ab5b14d0618 100644 --- a/src/lib/netlist/plib/palloc.cpp +++ b/src/lib/netlist/plib/palloc.cpp @@ -7,8 +7,8 @@ #include "pconfig.h" #include "palloc.h" -#include "pfmtlog.h" #include "pexception.h" +#include "pfmtlog.h" #include <algorithm> @@ -37,7 +37,7 @@ mempool::~mempool() mempool::block * mempool::new_block() { - block *b = new block(); + auto *b = new block(); b->data = static_cast<char *>(::operator new(m_min_alloc)); b->cur_ptr = b->data; b->m_free = m_min_alloc; @@ -92,7 +92,7 @@ void mempool::free(void *ptr) auto i = reinterpret_cast<info *>(p - mininfosize()); block *b = i->m_block; if (b->m_num_alloc == 0) - plib::pexception("mempool::free - double free was called\n"); + throw plib::pexception("mempool::free - double free was called\n"); else { //b->m_free = m_min_alloc; @@ -101,4 +101,4 @@ void mempool::free(void *ptr) b->m_num_alloc--; } -} +} // namespace plib |