Pārlūkot izejas kodu

Update 1_5_0.md

blueloveTH 1 gadu atpakaļ
vecāks
revīzija
12d3ae8055
1 mainītis faili ar 28 papildinājumiem un 0 dzēšanām
  1. 28 0
      docs/1_5_0.md

+ 28 - 0
docs/1_5_0.md

@@ -146,3 +146,31 @@ from __builtins import next
 ```
 
 Related C++ APIs do not change. They still return `vm->StopIteration` to indicate the end of iteration.
+
+## User config support
+
+We used to read `user_config.h` file to override the default configurations.
+In `v1.5.0`, this is no longer supported.
+Please use config macros before `#include "pocketpy.h"` directly.
+
+```cpp
+#define PK_ENABLE_OS            1
+#define PK_ENABLE_THREAD        1
+#define PK_ENABLE_PROFILER      1
+// for all config macros, please refer to `include/pocketpy/config.h`
+#include "pocketpy.h"
+```
+
+## Debugger and profiler
+
+We added a macro `PK_ENABLE_PROFILER` (default is 0) to control the availability of the builtin debugger and profiler.
+If you want to use them, for example, you want to call `breakpoint()` or `import line_profiler`, you need to set `PK_ENABLE_PROFILER` to 1 before `#include "pocketpy.h"`.
+
+```cpp
+#define PK_ENABLE_PROFILER      1
+#include "pocketpy.h"
+```
+
+!!!
+Enabling the profiler has a performance overhead. Only enable it when you need it.
+!!!