Skip to content

Commit

Permalink
update doc of test api
Browse files Browse the repository at this point in the history
  • Loading branch information
vita-dounai committed Sep 23, 2020
1 parent e731378 commit b8a36a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/in_depth/compile_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ overflow-checks = true

- `panic = "abort"`,当发生panic时,Rust程序的默认行为是执行堆栈展开,用于执行各个栈上对象的析构函数。此处用于更改此默认行为,使得当panic发生时,合约直接终止,而无需执行堆栈展开的代码,有助于减少合约字节码的体积。由于合约在虚拟机中执行,当合约执行终止时,所有的资源都将会被宿主环境回收,因此无需担心资源泄露的问题。

- `lto = true`,用于开启链接时优化(Link Time Optimization)。开启后链接器将会对整个合约进行分析及跨模块的优化,有助于减少合约字节码的体积。
- `lto = true`,用于开启链接时优化(Link Time Optimization)。开启后链接器将会对整个合约进行分析并进行跨模块的优化,有助于减少合约字节码的体积。

- `opt-level = "z"`,用于指定编译器的优化等级,`z`级别的优化将会更专注于缩小字节码的体积。

Expand Down

0 comments on commit b8a36a1

Please sign in to comment.