mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix build
This commit is contained in:
@@ -1129,7 +1129,7 @@ pub const DNSLookup = struct {
|
||||
pub fn onComplete(this: *DNSLookup, result: *c_ares.AddrInfo) void {
|
||||
log("onComplete", .{});
|
||||
|
||||
const array = result.toJSArray(this.globalThis.allocator(), this.globalThis);
|
||||
const array = result.toJSArray(this.globalThis);
|
||||
this.onCompleteWithArray(array);
|
||||
}
|
||||
|
||||
@@ -1296,7 +1296,7 @@ pub const DNSResolver = struct {
|
||||
|
||||
var pending: ?*DNSLookup = key.lookup.head.next;
|
||||
var prev_global = key.lookup.head.globalThis;
|
||||
var array = addr.toJSArray(this.vm.allocator, prev_global);
|
||||
var array = addr.toJSArray(prev_global);
|
||||
defer addr.deinit();
|
||||
array.ensureStillAlive();
|
||||
key.lookup.head.onCompleteWithArray(array);
|
||||
@@ -1308,7 +1308,7 @@ pub const DNSResolver = struct {
|
||||
while (pending) |value| {
|
||||
const new_global = value.globalThis;
|
||||
if (prev_global != new_global) {
|
||||
array = addr.toJSArray(this.vm.allocator, new_global);
|
||||
array = addr.toJSArray(new_global);
|
||||
prev_global = new_global;
|
||||
}
|
||||
pending = value.next;
|
||||
|
||||
@@ -369,11 +369,8 @@ pub const AddrInfo = extern struct {
|
||||
|
||||
pub fn toJSArray(
|
||||
addr_info: *AddrInfo,
|
||||
parent_allocator: std.mem.Allocator,
|
||||
globalThis: *JSC.JSGlobalObject,
|
||||
) JSC.JSValue {
|
||||
var stack = std.heap.stackFallback(2048, parent_allocator);
|
||||
var arena = bun.ArenaAllocator.init(stack.get());
|
||||
var node = addr_info.node.?;
|
||||
const array = JSC.JSValue.createEmptyArray(
|
||||
globalThis,
|
||||
@@ -381,9 +378,6 @@ pub const AddrInfo = extern struct {
|
||||
);
|
||||
|
||||
{
|
||||
defer arena.deinit();
|
||||
|
||||
const allocator = arena.allocator();
|
||||
var j: u32 = 0;
|
||||
var current: ?*AddrInfo_node = addr_info.node;
|
||||
while (current) |this_node| : (current = this_node.next) {
|
||||
@@ -400,7 +394,6 @@ pub const AddrInfo = extern struct {
|
||||
.ttl = this_node.ttl,
|
||||
},
|
||||
globalThis,
|
||||
allocator,
|
||||
),
|
||||
);
|
||||
j += 1;
|
||||
|
||||
Reference in New Issue
Block a user