You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -621,21 +621,21 @@ Examples are available in js\_libc.c.
621
621
622
622
#### 3.4.7 C模块
623
623
624
-
Native ES6 modules are supported and can be dynamically or statically linked. Look at the test\_bjson and bjson.so examples. The standard library js\_libc.c is also a good example of a native module.
Use`JS_SetMemoryLimit()`to set a global memory allocation limit to a given JSRuntime.
628
+
使用`JS_SetMemoryLimit()`为给定的JSRuntime设置全局内存分配限制。
629
629
630
-
Custom memory allocation functions can be provided with `JS_NewRuntime2()`.
630
+
`JS_NewRuntime2()`可以提供自定义内存分配功能。
631
631
632
-
The maximum system stack size can be set with `JS_SetMaxStackSize()`.
632
+
`JS_SetMaxStackSize()`可以使用设置最大系统堆栈大小
633
633
634
634
#### 3.4.9 执行超时和中断
635
635
636
636
Use `JS_SetInterruptHandler()` to set a callback which is regularly called by the engine when it is executing code. This callback can be used to implement an execution timeout.
637
637
638
-
It is used by the command line interpreter to implement a `Ctrl-C`handler.
638
+
命令行解释器使用它来实现 `Ctrl-C`处理程序。
639
639
640
640
4 内部实现
641
641
-----------
@@ -676,17 +676,17 @@ Warning: the binary JSON format may change without notice, so it should not be u
676
676
677
677
#### 4.3.1 Strings
678
678
679
-
Strings are stored either as an 8 bit or a 16 bit array of characters. Hence random access to characters is always fast.
679
+
字符串存储为8位或16位字符数组。因此,随机访问字符总是很快。
680
680
681
-
The C API provides functions to convert Javascript Strings to C UTF-8 encoded strings. The most common case where the Javascript string contains only ASCII characters involves no copying.
681
+
C API提供将Javascript字符串转换为C UTF-8编码字符串的函数。最常见情况是 Javascript字符串仅包含ASCII 字符串不涉及复制。
682
682
683
683
#### 4.3.2 Objects
684
684
685
685
The object shapes (object prototype, property names and flags) are shared between objects to save memory.
686
686
687
687
Arrays with no holes (except at the end of the array) are optimized.
688
688
689
-
TypedArray accesses are optimized.
689
+
TypedArray访问已优化。
690
690
691
691
#### 4.3.3 Atoms
692
692
@@ -698,7 +698,7 @@ Numbers are represented either as 32-bit signed integers or 64-bit IEEE-754 floa
698
698
699
699
#### 4.3.5 垃圾回收
700
700
701
-
Reference counting is used to free objects automatically and deterministically. A separate cycle removal pass is done when the allocated memory becomes too large. The cycle removal algorithm only uses the reference counts and the object content, so no explicit garbage collection roots need to be manipulated in the C code.
701
+
引用计数用于自动和准确地释放对象。A separate cycle removal pass is done when the allocated memory becomes too large. The cycle removal algorithm only uses the reference counts and the object content, so no explicit garbage collection roots need to be manipulated in the C code.
0 commit comments