merge fix

This commit is contained in:
Meghan Denny
2025-09-23 22:47:12 -07:00
parent 70e9c9b3e0
commit 8ff53b8ecf
10 changed files with 11 additions and 12 deletions

View File

@@ -143,7 +143,7 @@ const { values: options, positionals: filters } = parseArgs({
},
["retries"]: {
type: "string",
default: isCI ? "0" : "0", // N retries = N+1 attempts
default: isCI ? "3" : "0", // N retries = N+1 attempts
},
["junit"]: {
type: "boolean",

View File

@@ -793,6 +793,7 @@ pub fn scan(this: *JSTranspiler, globalThis: *jsc.JSGlobalObject, callframe: *js
}
var arena = MimallocArena.init();
defer arena.deinit();
const prev_allocator = this.transpiler.allocator;
const allocator = arena.allocator();
this.transpiler.setAllocator(allocator);
@@ -1067,6 +1068,7 @@ pub fn scanImports(this: *JSTranspiler, globalThis: *jsc.JSGlobalObject, callfra
}
var arena = MimallocArena.init();
defer arena.deinit();
const prev_allocator = this.transpiler.allocator;
const allocator = arena.allocator();
var ast_memory_allocator = bun.handleOom(allocator.create(JSAst.ASTMemoryAllocator));

View File

@@ -272,7 +272,7 @@ pub fn constructor(globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) b
const pat_str: []u8 = @constCast((pat_arg.toSliceClone(globalThis) orelse return error.JSError).slice());
const glob = bun.handleOom(alloc.create(Glob));
const glob = bun.handleOom(bun.default_allocator.create(Glob));
glob.* = .{ .pattern = pat_str };
return glob;

View File

@@ -3365,6 +3365,7 @@ const js_printer = bun.js_printer;
const logger = bun.logger;
const strings = bun.strings;
const uws = bun.uws;
const Arena = bun.allocators.MimallocArena;
const BoringSSL = bun.BoringSSL.c;
const SocketAddress = bun.api.socket.SocketAddress;

View File

@@ -9,12 +9,10 @@ namespace Bun {
extern "C" JSC::EncodedJSValue JSUint8Array__fromDefaultAllocator(JSC::JSGlobalObject* lexicalGlobalObject, uint8_t* ptr, size_t length)
{
JSC::JSUint8Array* uint8Array;
if (length > 0) [[likely]] {
auto buffer = ArrayBuffer::createFromBytes({ ptr, length }, createSharedTask<void(void*)>([](void* p) {
bun_free(p);
}));
uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType<JSC::TypeUint8>(), WTFMove(buffer), 0, length);
} else {
uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType<JSC::TypeUint8>(), 0);
@@ -27,7 +25,6 @@ extern "C" JSC::EncodedJSValue JSArrayBuffer__fromDefaultAllocator(JSC::JSGlobal
{
RefPtr<ArrayBuffer> buffer;
if (length > 0) [[likely]] {
ASSERT(mi_is_in_heap_region(ptr) == (ENABLE_MIMALLOC == 1));
buffer = ArrayBuffer::createFromBytes({ ptr, length }, createSharedTask<void(void*)>([](void* p) {

View File

@@ -3183,7 +3183,6 @@ JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t len, J
ASSERT(!mi_is_in_heap_region(str.ptr));
ASSERT(!mi_is_in_heap_region(Zig::untag(str.ptr)));
#endif
if (Zig::isTaggedUTF16Ptr(str.ptr)) {
auto ref = String(ExternalStringImpl::create({ reinterpret_cast<const char16_t*>(Zig::untag(str.ptr)), str.len }, Zig::untagVoid(str.ptr), free_global_string));
return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTFMove(ref)));

View File

@@ -357,7 +357,7 @@ const default_allocator = bun.default_allocator;
const js_ast = bun.ast;
const allocators = bun.allocators;
const MimallocArena = bun.allocators.MimallocArena;
const ThreadLocalArena = bun.allocators.MimallocArena;
const BundleV2 = bun.bundle_v2.BundleV2;
const LinkerContext = bun.bundle_v2.LinkerContext;

View File

@@ -60,7 +60,7 @@ pub fn postProcessCSSChunk(ctx: GenerateChunkCtx, worker: *ThreadPool.Worker, ch
}
// Save the offset to the start of the stored JavaScript
j.push(compile_result.code(), compile_result.allocator());
j.push(compile_result.code(), bun.default_allocator);
if (compile_result.sourceMapChunk()) |source_map_chunk| {
if (c.options.source_maps != .none) {

View File

@@ -11,7 +11,7 @@ pub fn postProcessHTMLChunk(ctx: GenerateChunkCtx, worker: *ThreadPool.Worker, c
const compile_results = chunk.compile_results_for_chunk;
for (compile_results) |compile_result| {
j.push(compile_result.code(), compile_result.allocator());
j.push(compile_result.code(), bun.default_allocator);
}
j.ensureNewlineAtEnd();

View File

@@ -199,7 +199,7 @@ pub fn postProcessJSChunk(ctx: GenerateChunkCtx, worker: *ThreadPool.Worker, chu
const source_index = compile_result.sourceIndex();
if (source_index != Index.runtime.value) break;
line_offset.advance(compile_result.code());
j.push(compile_result.code(), compile_result.allocator());
j.push(compile_result.code(), bun.default_allocator);
}
}
@@ -312,10 +312,10 @@ pub fn postProcessJSChunk(ctx: GenerateChunkCtx, worker: *ThreadPool.Worker, chu
if (is_runtime) {
if (c.options.output_format != .internal_bake_dev) {
line_offset.advance(compile_result.code());
j.push(compile_result.code(), compile_result.allocator());
j.push(compile_result.code(), bun.default_allocator);
}
} else {
j.push(compile_result.code(), compile_result.allocator());
j.push(compile_result.code(), bun.default_allocator);
if (compile_result.sourceMapChunk()) |source_map_chunk| {
if (c.options.source_maps != .none) {