Skip to content

Commit 7a59af0

Browse files
author
llgoer
committed
Update README.md
1 parent 8f397ee commit 7a59af0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -621,21 +621,21 @@ Examples are available in js\_libc.c.
621621

622622
#### 3.4.7 C模块
623623

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.
624+
支持动态或者静态链接的原生ES6模块。查看test\_bjson和bjson.so示例。标准库js\_libc.c也是原生模块很好的一个例子。
625625

626626
#### 3.4.8 内存处理
627627

628-
Use `JS_SetMemoryLimit()` to set a global memory allocation limit to a given JSRuntime.
628+
使用 `JS_SetMemoryLimit()` 为给定的JSRuntime设置全局内存分配限制。
629629

630-
Custom memory allocation functions can be provided with `JS_NewRuntime2()`.
630+
`JS_NewRuntime2()`可以提供自定义内存分配功能。
631631

632-
The maximum system stack size can be set with `JS_SetMaxStackSize()`.
632+
`JS_SetMaxStackSize()`可以使用设置最大系统堆栈大小
633633

634634
#### 3.4.9 执行超时和中断
635635

636636
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.
637637

638-
It is used by the command line interpreter to implement a `Ctrl-C` handler.
638+
命令行解释器使用它来实现 `Ctrl-C` 处理程序。
639639

640640
4 内部实现
641641
-----------
@@ -676,17 +676,17 @@ Warning: the binary JSON format may change without notice, so it should not be u
676676

677677
#### 4.3.1 Strings
678678

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位字符数组。因此,随机访问字符总是很快。
680680

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 字符串不涉及复制。
682682

683683
#### 4.3.2 Objects
684684

685685
The object shapes (object prototype, property names and flags) are shared between objects to save memory.
686686

687687
Arrays with no holes (except at the end of the array) are optimized.
688688

689-
TypedArray accesses are optimized.
689+
TypedArray访问已优化。
690690

691691
#### 4.3.3 Atoms
692692

@@ -698,7 +698,7 @@ Numbers are represented either as 32-bit signed integers or 64-bit IEEE-754 floa
698698

699699
#### 4.3.5 垃圾回收
700700

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.
702702

703703
#### 4.3.6 JSValue
704704

0 commit comments

Comments
 (0)