From 51170e4a47e8ee003c5de3cdf3a1b388e9b323c0 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 26 May 2024 16:47:34 +0800 Subject: [PATCH] fix a bug --- include/pocketpy/gc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pocketpy/gc.h b/include/pocketpy/gc.h index cd2541b8..42f3292b 100644 --- a/include/pocketpy/gc.h +++ b/include/pocketpy/gc.h @@ -54,7 +54,7 @@ struct ManagedHeap{ PyVar _new(Type type, Args&&... args){ using __T = std::decay_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)...); _no_gc.push_back(p); return PyVar(type, p);