소스 검색

fix a bug

blueloveTH 1 년 전
부모
커밋
51170e4a47
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/pocketpy/gc.h

+ 1 - 1
include/pocketpy/gc.h

@@ -54,7 +54,7 @@ struct ManagedHeap{
     PyVar _new(Type type, Args&&... args){
         using __T = std::decay_t<T>;
         static_assert(!is_sso_v<__T>);
-        PyObject* p = new(pool128_alloc<__T>()) PyObject(type);
+        PyObject* p = new(pool128_alloc(py_sizeof<__T>)) PyObject(type);
         p->placement_new<__T>(std::forward<Args>(args)...);
         _no_gc.push_back(p);
         return PyVar(type, p);