mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
remove PK_LOW_MEMORY_MODE
This commit is contained in:
parent
f7141d5967
commit
dacb1091db
@ -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,11 +14,7 @@
|
||||
|
||||
// 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
|
||||
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user