blueloveTH 1 год назад
Родитель
Сommit
40f95580d3
2 измененных файлов с 7 добавлено и 3 удалено
  1. 5 1
      include/pocketpy/vm.h
  2. 2 2
      src/memory.cpp

+ 5 - 1
include/pocketpy/vm.h

@@ -363,8 +363,12 @@ public:
     }
 
     struct ImportContext{
+        PK_ALWAYS_PASS_BY_POINTER(ImportContext)
+
         std::vector<Str> pending;
-        pod_vector<bool> pending_is_init;   // a.k.a __init__.py
+        std::vector<bool> pending_is_init;   // a.k.a __init__.py
+
+        ImportContext() {}
 
         struct Temp{
             PK_ALWAYS_PASS_BY_POINTER(Temp)

+ 2 - 2
src/memory.cpp

@@ -267,8 +267,8 @@ struct MemoryPool{
     }
 };
 
-static MemoryPool<64>* pool64;
-static MemoryPool<128>* pool128;
+static MemoryPool<64>* pool64 = nullptr;
+static MemoryPool<128>* pool128 = nullptr;
 
 void init_memory_pools_if_needed(){
     if(pool64 == nullptr) pool64 = new MemoryPool<64>();