fix `_stack2string`
fix `_stack2string`

memory pointer was not updated correctly, resulting in following allocations
overwriting previous data (after header).

Whole allocation code is far too messy.

timor/mfactor,timor/mfactor,timor/mfactor,timor/mfactor