diff options
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/api/JSBundler.zig | 6 | ||||
-rw-r--r-- | src/bun.js/api/bun/socket.zig | 6 | ||||
-rw-r--r-- | src/bun.js/api/server.zig | 2 | ||||
-rw-r--r-- | src/bun.js/javascript.zig | 2 | ||||
-rw-r--r-- | src/bun.js/node/fs_events.zig | 2 | ||||
-rw-r--r-- | src/bun.js/node/path_watcher.zig | 4 | ||||
-rw-r--r-- | src/bun.js/test/expect.zig | 4 | ||||
-rw-r--r-- | src/bun.js/webcore/blob.zig | 2 |
8 files changed, 14 insertions, 14 deletions
diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig index af1a55ce6..f5c3793ed 100644 --- a/src/bun.js/api/JSBundler.zig +++ b/src/bun.js/api/JSBundler.zig @@ -594,8 +594,8 @@ pub const JSBundler = struct { external: bool = false, pub fn deinit(this: *@This()) void { - bun.default_allocator.destroy(this.path); - bun.default_allocator.destroy(this.namespace); + bun.default_allocator.free(this.path); + bun.default_allocator.free(this.namespace); } }, no_match: void, @@ -747,7 +747,7 @@ pub const JSBundler = struct { pub fn deinit(this: *Value) void { switch (this.*) { .success => |success| { - bun.default_allocator.destroy(success.source_code); + bun.default_allocator.free(success.source_code); }, .err => |*err| { err.deinit(bun.default_allocator); diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig index 5da6c1f40..592fd6540 100644 --- a/src/bun.js/api/bun/socket.zig +++ b/src/bun.js/api/bun/socket.zig @@ -499,10 +499,10 @@ pub const Listener = struct { pub fn deinit(this: UnixOrHost) void { switch (this) { .unix => |u| { - bun.default_allocator.destroy(@as([*]u8, @ptrFromInt(@intFromPtr(u.ptr)))); + bun.default_allocator.free(u); }, .host => |h| { - bun.default_allocator.destroy(@as([*]u8, @ptrFromInt(@intFromPtr(h.host.ptr)))); + bun.default_allocator.free(h.host); }, } } @@ -833,7 +833,7 @@ pub const Listener = struct { this.connection.deinit(); if (this.protos) |protos| { this.protos = null; - bun.default_allocator.destroy(protos); + bun.default_allocator.free(protos); } bun.default_allocator.destroy(this); } diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index e96135a5e..64a85d6a4 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -5131,7 +5131,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp this.cached_protocol.deref(); if (this.config.hostname) |host| { - bun.default_allocator.destroy(host); + bun.default_allocator.free(host[0 .. std.mem.len(host) + 1]); } if (this.config.base_url.href.len > 0) { diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig index 062bd52a2..03cdab205 100644 --- a/src/bun.js/javascript.zig +++ b/src/bun.js/javascript.zig @@ -2558,7 +2558,7 @@ pub const VirtualMachine = struct { } else if (kind.isObject() or kind.isArray()) { var bun_str = bun.String.empty; defer bun_str.deref(); - value.jsonStringify(this.global, 2, &bun_str); + value.jsonStringify(this.global, 2, &bun_str); //2 try writer.print(comptime Output.prettyFmt(" {s}<d>: <r>{any}<r>\n", allow_ansi_color), .{ field, bun_str }); add_extra_line = true; } diff --git a/src/bun.js/node/fs_events.zig b/src/bun.js/node/fs_events.zig index 70b41fc33..ce158a037 100644 --- a/src/bun.js/node/fs_events.zig +++ b/src/bun.js/node/fs_events.zig @@ -488,7 +488,7 @@ pub const FSEventsLoop = struct { CS.FSEventStreamScheduleWithRunLoop(ref, this.loop, CF.RunLoopDefaultMode.*); if (CS.FSEventStreamStart(ref) == 0) { //clean in case of failure - bun.default_allocator.destroy(paths); + bun.default_allocator.free(paths); CF.Release(cf_paths); CS.FSEventStreamInvalidate(ref); CS.FSEventStreamRelease(ref); diff --git a/src/bun.js/node/path_watcher.zig b/src/bun.js/node/path_watcher.zig index 1d81661e9..1f1b9d1a1 100644 --- a/src/bun.js/node/path_watcher.zig +++ b/src/bun.js/node/path_watcher.zig @@ -85,7 +85,7 @@ pub const PathWatcherManager = struct { return info.*; } const cloned_path = try bun.default_allocator.dupeZ(u8, path); - errdefer bun.default_allocator.destroy(cloned_path); + errdefer bun.default_allocator.free(cloned_path); if (std.fs.openIterableDirAbsoluteZ(cloned_path, .{ .access_sub_paths = true, @@ -657,7 +657,7 @@ pub const PathWatcherManager = struct { while (it.next()) |*entry| { const path = entry.value_ptr.*; std.os.close(path.fd); - bun.default_allocator.destroy(path.path); + bun.default_allocator.free(path.path); } this.file_paths.deinit(); diff --git a/src/bun.js/test/expect.zig b/src/bun.js/test/expect.zig index de3f185d5..0d3ff663e 100644 --- a/src/bun.js/test/expect.zig +++ b/src/bun.js/test/expect.zig @@ -1131,12 +1131,12 @@ pub const Expect = struct { if (value.isAnyInt()) { const _value = value.toInt64(); pass = @mod(_value, 2) == 0; - if (_value == -0) { // negative zero is even + if (_value == -0.0) { // negative zero is even pass = true; } } else if (value.isBigInt() or value.isBigInt32()) { const _value = value.toInt64(); - pass = switch (_value == -0) { // negative zero is even + pass = switch (_value == -0.0) { // negative zero is even true => true, else => _value & 1 == 0, }; diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index c794ab59b..c5e893a5a 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -2361,7 +2361,7 @@ pub const Blob = struct { } pub fn doFCopyFile(this: *CopyFile) anyerror!void { - switch (JSC.Node.Syscall.fcopyfile(this.source_fd, this.destination_fd, os.system.COPYFILE.DATA)) { + switch (JSC.Node.Syscall.fcopyfile(this.source_fd, this.destination_fd, os.system.COPYFILE_DATA)) { .err => |errno| { this.system_error = errno.toSystemError(); |