remove PK_LOW_MEMORY_MODE

This commit is contained in:
blueloveTH 2025-04-13 13:59:04 +08:00
parent f7141d5967
commit dacb1091db
2 changed files with 3 additions and 17 deletions

View File

@ -7,12 +7,6 @@
#define PK_VERSION_PATCH 8
/*************** feature settings ***************/
// Reduce the startup memory usage for embedded systems
#ifndef PK_LOW_MEMORY_MODE // can be overridden by cmake
#define PK_LOW_MEMORY_MODE 0
#endif
// Whether to compile os-related modules or not
#ifndef PK_ENABLE_OS // can be overridden by cmake
#define PK_ENABLE_OS 1
@ -20,12 +14,8 @@
// GC min threshold
#ifndef PK_GC_MIN_THRESHOLD // can be overridden by cmake
#if PK_LOW_MEMORY_MODE
#define PK_GC_MIN_THRESHOLD 2048
#else
#define PK_GC_MIN_THRESHOLD 32768
#endif
#endif
// Memory allocation functions
#ifndef PK_MALLOC
@ -37,11 +27,7 @@
// This is the maximum size of the value stack in py_TValue units
// The actual size in bytes equals `sizeof(py_TValue) * PK_VM_STACK_SIZE`
#ifndef PK_VM_STACK_SIZE // can be overridden by cmake
#if PK_LOW_MEMORY_MODE
#define PK_VM_STACK_SIZE 2048
#else
#define PK_VM_STACK_SIZE 16384
#endif
#define PK_VM_STACK_SIZE 8192
#endif
// This is the maximum number of local variables in a function

View File

@ -81,7 +81,7 @@ PyObject* ManagedHeap__gcnew(ManagedHeap* self, py_Type type, int slots, int uds
PyObject* obj;
// header + slots + udsize
int size = sizeof(PyObject) + PK_OBJ_SLOTS_SIZE(slots) + udsize;
if(!PK_LOW_MEMORY_MODE && size <= kPoolMaxBlockSize) {
if(size <= kPoolMaxBlockSize) {
obj = MultiPool__alloc(&self->small_objects, size);
assert(obj != NULL);
} else {