This commit is contained in:
blueloveTH 2025-06-22 01:12:39 +08:00
parent 0f8c7d6d11
commit 790710b1a4
2 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,11 @@ if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox")
add_definitions(-DNDEBUG) add_definitions(-DNDEBUG)
endif() endif()
# if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# message(">> Enable Address Sanitizer")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address /Zi")
# endif()
else() else()
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
@ -99,6 +104,9 @@ if(PK_ENABLE_DETERMINISM)
endif() endif()
endif() endif()
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} Threads::Threads)
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
if(NOT PK_ENABLE_DETERMINISM) if(NOT PK_ENABLE_DETERMINISM)
# use platform libm # use platform libm

View File

@ -260,11 +260,11 @@ void VM__dtor(VM* self) {
while(self->top_frame) while(self->top_frame)
VM__pop_frame(self); VM__pop_frame(self);
BinTree__dtor(&self->modules); BinTree__dtor(&self->modules);
c11_vector__dtor(&self->types);
FixedMemoryPool__dtor(&self->pool_frame); FixedMemoryPool__dtor(&self->pool_frame);
ValueStack__dtor(&self->stack); ValueStack__dtor(&self->stack);
CachedNames__dtor(&self->cached_names); CachedNames__dtor(&self->cached_names);
NameDict__dtor(&self->compile_time_funcs); NameDict__dtor(&self->compile_time_funcs);
c11_vector__dtor(&self->types);
} }
void VM__push_frame(VM* self, py_Frame* frame) { void VM__push_frame(VM* self, py_Frame* frame) {