Jelajahi Sumber

Update config.h

blueloveTH 2 tahun lalu
induk
melakukan
206302a736
1 mengubah file dengan 12 tambahan dan 5 penghapusan
  1. 12 5
      src/config.h

+ 12 - 5
src/config.h

@@ -7,28 +7,35 @@
 #else
 
 /*************** feature settings ***************/
+
+// Whether to compile os-related modules
 #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
 
 // Whether to use `std::function` to do bindings
-// By default, the function to be binded must be a C function pointer with no capture
-// which is fast and simple. However, someone thinks it's not convenient enough.
+// By default, functions to be binded must be a C function pointer without capture
+// However, someone thinks it's not convenient.
 // 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.
 #define PK_ENABLE_STD_FUNCTION      0
 
 /*************** internal settings ***************/
 
-// This is the maximum size of the value stack in void* units, not bytes
-// The actual size is `sizeof(void*) * PK_VM_STACK_SIZE`
+// This is the maximum size of the value stack in void* units
+// The actual size in bytes equals `sizeof(void*) * PK_VM_STACK_SIZE`
 #define PK_VM_STACK_SIZE            32768
 
 // This is the maximum number of arguments in a function declaration
 // including positional arguments, keyword-only arguments, and varargs
+// (not recommended to change this)
 #define PK_MAX_CO_VARNAMES          255
 
 // Hash table load factor (smaller ones mean less collision but more memory)
+// For class instance
 inline const float kInstAttrLoadFactor = 0.67f;
+// For class itself
 inline const float kTypeAttrLoadFactor = 0.5f;
 
 #ifdef _WIN32
@@ -39,7 +46,7 @@ inline const float kTypeAttrLoadFactor = 0.5f;
 
 /*************** 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
 
 // Do not edit the following settings unless you know what you are doing