From 26ea6c48eebe4decfa9ad5f65321cfe97ffdac55 Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Thu, 26 Feb 2026 10:32:40 +0000 Subject: [PATCH] docs: add documentation for functions in PR #59604 --- src/backend/Assembly.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/Assembly.zig b/src/backend/Assembly.zig index 914bffb..8fd1971 100644 --- a/src/backend/Assembly.zig +++ b/src/backend/Assembly.zig @@ -6,11 +6,14 @@ text: []const u8, const Assembly = @This(); +/// Frees the memory allocated for the assembly data and text sections. pub fn deinit(self: *const Assembly, gpa: Allocator) void { gpa.free(self.data); gpa.free(self.text); } +/// Writes both the data and text sections of the assembly to a file using writev. +/// This writes all data and text sections in a single vectored I/O operation. pub fn writeToAllFile(self: Assembly, file: std.fs.File) !void { var vec: [2]std.posix.iovec_const = .{ .{ .base = self.data.ptr, .len = self.data.len }, -- Gitee