mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
Support running WASI (WebAssembly) files using bun run (#1929)
* another micro bench * Support running WASI --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -838,6 +838,17 @@ pub inline fn append(allocator: std.mem.Allocator, self: string, other: string)
|
||||
return buf;
|
||||
}
|
||||
|
||||
pub inline fn append3(allocator: std.mem.Allocator, self: string, other: string, third: string) ![]u8 {
|
||||
var buf = try allocator.alloc(u8, self.len + other.len + third.len);
|
||||
if (self.len > 0)
|
||||
@memcpy(buf.ptr, self.ptr, self.len);
|
||||
if (other.len > 0)
|
||||
@memcpy(buf.ptr + self.len, other.ptr, other.len);
|
||||
if (third.len > 0)
|
||||
@memcpy(buf.ptr + self.len + other.len, third.ptr, third.len);
|
||||
return buf;
|
||||
}
|
||||
|
||||
pub inline fn joinBuf(out: []u8, parts: anytype, comptime parts_len: usize) []u8 {
|
||||
var remain = out;
|
||||
var count: usize = 0;
|
||||
|
||||
Reference in New Issue
Block a user