From f4cf0cc86a06f07f4df18fbf521abf3126721d24 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 13 Nov 2019 07:41:20 +0100 Subject: netlist: code maintenance. (nw) - move memory pool to netlist_state_t removing one static allocation. - add memory allocation stats to verbose output - nl_assert no longer throws, first step to remove NL_EXCEPT macro. --- src/lib/netlist/plib/pexception.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/lib/netlist/plib/pexception.cpp') diff --git a/src/lib/netlist/plib/pexception.cpp b/src/lib/netlist/plib/pexception.cpp index 6b53d362c79..674601f2ed8 100644 --- a/src/lib/netlist/plib/pexception.cpp +++ b/src/lib/netlist/plib/pexception.cpp @@ -19,12 +19,35 @@ namespace plib { // terminate //============================================================ - void terminate(const pstring &msg) noexcept + void terminate(const char *msg) noexcept { - std::cerr << msg.c_str() << "\n"; + try + { + std::cerr << msg << "\n"; + } + catch (...) + { + /* ignore */ + } std::terminate(); } + void passert_fail(const char *assertion, const char *file, int lineno, const char *msg) noexcept + { + try + { + std::cerr << file << ":" << lineno << ": "; + if (msg != nullptr) + std::cerr << msg << "\n"; + else + std::cerr << "Assertion '" << assertion << "' failed.\n"; + } + catch (...) + { + /* ignore */ + } + std::terminate(); + } //============================================================ // Exceptions -- cgit v1.2.3-70-g09d2