fixed a segfault error in Awk.cpp for missed rtx->_instsize adjustment

This commit is contained in:
2019-09-03 16:46:57 +00:00
parent 8c6a7ae29c
commit f89efc150a
6 changed files with 19 additions and 26 deletions

View File

@ -56,12 +56,12 @@ void* Mmgr::callocate (qse_size_t n, bool raise_exception) /*QSE_CPP_THREXCEPT1(
#if 0
#if defined(__GNUC__)
static StdMmgr __attribute__((init_priority(101))) std_dfl_mmgr; <- this solved the problem
static StdMmgr __attribute__((init_priority(101))) std_dfl_mmgr; //<- this solved the problem
#else
static StdMmgr std_dfl_mmgr; <-- has an issue for undefined initialization order
static StdMmgr std_dfl_mmgr; //<-- has an issue for undefined initialization order
#endif
Mmgr* Mmgr::dfl_mmgr = &std_dfl_mmgr;
//Mmgr* Mmgr::dfl_mmgr = StdMmgr::getInstance(); <--- has an issue as well
//Mmgr* Mmgr::dfl_mmgr = StdMmgr::getInstance(); //<--- has an issue as well
Mmgr* Mmgr::getDFL () QSE_CPP_NOEXCEPT
{
return Mmgr::dfl_mmgr;

View File

@ -277,7 +277,7 @@ htb_t* qse_htb_open (
htb = (htb_t*) QSE_MMGR_ALLOC (mmgr, SIZEOF(htb_t) + xtnsize);
if (htb == QSE_NULL) return QSE_NULL;
if (qse_htb_init (htb, mmgr, capa, factor, kscale, vscale) <= -1)
if (qse_htb_init(htb, mmgr, capa, factor, kscale, vscale) <= -1)
{
QSE_MMGR_FREE (mmgr, htb);
return QSE_NULL;
@ -313,7 +313,7 @@ int qse_htb_init (
QSE_MEMSET (htb, 0, SIZEOF(*htb));
htb->mmgr = mmgr;
htb->bucket = QSE_MMGR_ALLOC (mmgr, capa*SIZEOF(pair_t*));
htb->bucket = QSE_MMGR_ALLOC(mmgr, capa * SIZEOF(pair_t*));
if (htb->bucket == QSE_NULL) return -1;
/*for (i = 0; i < capa; i++) htb->bucket[i] = QSE_NULL;*/