From 4fc02e2ddceee1874ce22f06ce5a46f4e14e6322 Mon Sep 17 00:00:00 2001 From: Geng Chen Date: Mon, 25 Aug 2025 10:24:19 +0800 Subject: [PATCH] compact memory before emit Signed-off-by: Geng Chen --- ets2panda/compiler/core/compilerImpl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ets2panda/compiler/core/compilerImpl.cpp b/ets2panda/compiler/core/compilerImpl.cpp index 539573f68c..5f070d67f4 100644 --- a/ets2panda/compiler/core/compilerImpl.cpp +++ b/ets2panda/compiler/core/compilerImpl.cpp @@ -345,6 +345,9 @@ static pandasm::Program *EmitProgram(CompilerImpl *compilerImpl, public_lib::Con { ES2PANDA_PERF_SCOPE("@EmitProgram"); context->emitter->GenAnnotation(); + + context->allocator->Compact(); + auto result = compilerImpl->Emit(context); if (unit.ext == ScriptExtension::ETS && context->compilingState != public_lib::CompilingState::SINGLE_COMPILING) { SavePermanents(context, context->parserProgram); -- Gitee