PRIVATE: Avoid global constructors

This commit is contained in:
Eugene Sandulenko 2021-03-05 19:12:02 +01:00
parent 4a3ab29624
commit b880768235
5 changed files with 15 additions and 47 deletions

View file

@ -53,7 +53,7 @@
namespace Private {
Gen::VM *Gen::g_vm = new Gen::VM();
Gen::VM *Gen::g_vm;
void Gen::VM::run() {
Gen::execute(Gen::g_vm->_prog);
@ -63,10 +63,10 @@ namespace Settings {
using namespace Gen;
SettingMaps *g_setts = new SettingMaps();
SettingMaps *g_setts;
/* initialize setting for code generation */
void SettingMaps::init() {
void SettingMaps::init() {
_setting = (Setting *)malloc(sizeof(Setting));
memset((void *)_setting, 0, sizeof(Setting));