From 093bda019317a5a66699b35f8b25ab73802f1f1c Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 22 Jan 2017 23:36:54 +0100 Subject: Added infix notation parsing to the function parser. (nw) --- src/lib/netlist/plib/pstring.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/lib/netlist/plib/pstring.cpp') diff --git a/src/lib/netlist/plib/pstring.cpp b/src/lib/netlist/plib/pstring.cpp index 7d676f34c0d..1a65bb152ff 100644 --- a/src/lib/netlist/plib/pstring.cpp +++ b/src/lib/netlist/plib/pstring.cpp @@ -6,10 +6,6 @@ */ #include -//FIXME:: pstring should be locale free -#include -#include -#include #include #include @@ -17,6 +13,8 @@ #include "palloc.h" #include "plists.h" +template pstr_t pstring_t::m_zero(0); + template pstring_t::~pstring_t() { @@ -373,7 +371,7 @@ void pstringbuffer::pcat(const pstring &s) * This improves startup performance by 30%. */ -#if 1 +#if 0 static std::stack *stk = nullptr; @@ -416,8 +414,8 @@ static inline std::size_t countleadbits(std::size_t x) template void pstring_t::sfree(pstr_t *s) { - s->m_ref_count--; - if (s->m_ref_count == 0 && s != &m_zero) + bool b = s->dec_and_check(); + if ( b && s != &m_zero) { if (stk != nullptr) { @@ -472,8 +470,8 @@ void pstring_t::resetmem() template void pstring_t::sfree(pstr_t *s) { - s->m_ref_count--; - if (s->m_ref_count == 0 && s != &m_zero) + bool b = s->dec_and_check(); + if ( b && s != &m_zero) { plib::pfree_array(((char *)s)); } -- cgit v1.2.3-70-g09d2