Update config.h

This commit is contained in:
blueloveTH 2023-06-11 14:12:39 +08:00
parent c43e759cf8
commit 206302a736

View File

@ -7,28 +7,35 @@
#else #else
/*************** feature settings ***************/ /*************** feature settings ***************/
// Whether to compile os-related modules
#define PK_ENABLE_OS 1 #define PK_ENABLE_OS 1
// Enable this if you are working with multi-threading (experimental)
// This triggers necessary locks to make the VM thread-safe
#define PK_ENABLE_THREAD 0 #define PK_ENABLE_THREAD 0
// Whether to use `std::function` to do bindings // Whether to use `std::function` to do bindings
// By default, the function to be binded must be a C function pointer with no capture // By default, functions to be binded must be a C function pointer without capture
// which is fast and simple. However, someone thinks it's not convenient enough. // However, someone thinks it's not convenient.
// By setting this to 1, capturing lambdas can be binded, // By setting this to 1, capturing lambdas can be binded,
// but it's slower and may cause severe "code bloat", also needs more time to compile. // but it's slower and may cause severe "code bloat", also needs more time to compile.
#define PK_ENABLE_STD_FUNCTION 0 #define PK_ENABLE_STD_FUNCTION 0
/*************** internal settings ***************/ /*************** internal settings ***************/
// This is the maximum size of the value stack in void* units, not bytes // This is the maximum size of the value stack in void* units
// The actual size is `sizeof(void*) * PK_VM_STACK_SIZE` // The actual size in bytes equals `sizeof(void*) * PK_VM_STACK_SIZE`
#define PK_VM_STACK_SIZE 32768 #define PK_VM_STACK_SIZE 32768
// This is the maximum number of arguments in a function declaration // This is the maximum number of arguments in a function declaration
// including positional arguments, keyword-only arguments, and varargs // including positional arguments, keyword-only arguments, and varargs
// (not recommended to change this)
#define PK_MAX_CO_VARNAMES 255 #define PK_MAX_CO_VARNAMES 255
// Hash table load factor (smaller ones mean less collision but more memory) // Hash table load factor (smaller ones mean less collision but more memory)
// For class instance
inline const float kInstAttrLoadFactor = 0.67f; inline const float kInstAttrLoadFactor = 0.67f;
// For class itself
inline const float kTypeAttrLoadFactor = 0.5f; inline const float kTypeAttrLoadFactor = 0.5f;
#ifdef _WIN32 #ifdef _WIN32
@ -39,7 +46,7 @@ inline const float kTypeAttrLoadFactor = 0.5f;
/*************** debug settings ***************/ /*************** debug settings ***************/
// Enable this may help you to find bugs in the VM // Enable this may help you find bugs
#define DEBUG_EXTRA_CHECK 0 #define DEBUG_EXTRA_CHECK 0
// Do not edit the following settings unless you know what you are doing // Do not edit the following settings unless you know what you are doing