Skip to content

Commit

Permalink
格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Dec 18, 2023
1 parent f0fa62c commit 7365d97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion learn/engineering/build-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ pub fn build(b: *std.Build) void {
// 添加一个匿名的依赖 // [!code focus]
exe.addAnonymousModule("hello", .{ .source_file = .{ .path = "src/hello.txt" } }); // [!code focus]
// 添加到顶级 install step 中作为依赖
// 添加到顶级 install step 中作为依赖
b.installArtifact(exe);
// zig 提供了一个方便的函数允许我们直接运行构建结果
Expand Down
2 changes: 1 addition & 1 deletion learn/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn main() !void {

它们都是依靠系统调用来实现输出效果,但是这就面临着性能问题,我们知道系统调用会造成内核上下文切换的开销(系统调用的流程:执行系统调用,此时控制权会切换回内核,由内核执行完成进程需要的系统调用函数后再将控制权返回给进程),所以我们如何解决这个问题呢?可以增加一个缓冲区,等到要打印的内容都到一定程度后再一次性全部 `print`,那么此时的解决方式就如下:

```zig
```zig
const std = @import("std");
pub fn main() !void {
Expand Down

0 comments on commit 7365d97

Please sign in to comment.