Make bun.webcore.Blob smaller and ref-counted (#23015)

Reduce the size of `bun.webcore.Blob` from 120 bytes to 96. Also make it
ref-counted: in-progress work on improving the bindings generator
depends on this, as it means C++ can pass a pointer to the `Blob` to Zig
without risking it being destroyed if the GC collects the associated
`JSBlob`.

Note that this PR depends on #23013.

(For internal tracking: fixes STAB-1289, STAB-1290)
This commit is contained in:
taylor.fish
2025-09-26 17:18:30 -07:00
committed by GitHub
parent 250d30eb7d
commit eb04e4e640
13 changed files with 165 additions and 118 deletions

View File

@@ -199,7 +199,6 @@ pub const StandaloneModuleGraph = struct {
store.ref();
const b = bun.webcore.Blob.initWithStore(store, globalObject).new();
b.allocator = bun.default_allocator;
if (bun.http.MimeType.byExtensionNoDefault(bun.strings.trimLeadingChar(std.fs.path.extension(this.name), '.'))) |mime| {
store.mime_type = mime;