Jelajahi Sumber

Update 1_5_0.md

blueloveTH 1 tahun lalu
induk
melakukan
ade87cb848
1 mengubah file dengan 18 tambahan dan 3 penghapusan
  1. 18 3
      docs/1_5_0.md

+ 18 - 3
docs/1_5_0.md

@@ -6,7 +6,7 @@ order: 25
 
 
 We are applying a major API refactoring in this release. The main goal is to make the API more consistent and easier to use. We are also adding new features and improvements. This release is not backward compatible with the previous versions. Please read the following guide to upgrade your project.
 We are applying a major API refactoring in this release. The main goal is to make the API more consistent and easier to use. We are also adding new features and improvements. This release is not backward compatible with the previous versions. Please read the following guide to upgrade your project.
 
 
-## New style bindings
+## Old style bindings
 
 
 We introduced the new style bindings `vm->bind` in [`v1.1.3`](https://github.com/pocketpy/pocketpy/releases/tag/v1.1.3) and deprecated the old style bindings `vm->bind_func<>` and `vm->bind_method<>`.
 We introduced the new style bindings `vm->bind` in [`v1.1.3`](https://github.com/pocketpy/pocketpy/releases/tag/v1.1.3) and deprecated the old style bindings `vm->bind_func<>` and `vm->bind_method<>`.
 
 
@@ -85,7 +85,22 @@ int main(){
 }
 }
 ```
 ```
 
 
-## Optimization of `vm->bind__next__`
+## Signature of `_import_handler`
+
+The signature of `_import_handler` was changed from:
+
+```cpp
+unsigned char* (*)(const char* name_p, int name_size, int* out_size);
+```
+
+to:
+```cpp
+unsigned char* (*)(const char* name, int* out_size);
+```
+
+This is because `str` object was ensured to be null-terminated after `v1.4.1`.
+
+## Signature of `bind__next__`
 
 
 `vm->bind__next__` is a special method that is used to implement the iterator protocol.
 `vm->bind__next__` is a special method that is used to implement the iterator protocol.
 Previously, if you want to return multiple values, you need to pack them into a tuple.
 Previously, if you want to return multiple values, you need to pack them into a tuple.
@@ -178,4 +193,4 @@ Enabling the profiler has a performance overhead. Only enable it when you need i
 ## Type checking functions
 ## Type checking functions
 
 
 + `vm->is_non_tagged_type` was removed. Use `vm->is_type` instead.
 + `vm->is_non_tagged_type` was removed. Use `vm->is_type` instead.
-+ `vm->check_non_tagged_type` was removed. Use `vm->check_type` instead.
++ `vm->check_non_tagged_type` was removed. Use `vm->check_type` instead.