diff options
author | 2022-12-01 23:42:57 -0800 | |
---|---|---|
committer | 2022-12-01 23:42:57 -0800 | |
commit | 2621fbf206878ceed45792867c5221709157029c (patch) | |
tree | f4a05096f7c9f2408ab43a8162f6c73416c996a3 /src/bun.js | |
parent | d7ab2c04eca13cbe9cc8687d685037660daf5cf2 (diff) | |
download | bun-2621fbf206878ceed45792867c5221709157029c.tar.gz bun-2621fbf206878ceed45792867c5221709157029c.tar.zst bun-2621fbf206878ceed45792867c5221709157029c.zip |
Remove file blob caching
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/javascript.zig | 15 | ||||
-rw-r--r-- | src/bun.js/webcore/response.zig | 7 |
2 files changed, 1 insertions, 21 deletions
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig index 54fec7a96..b46a69cda 100644 --- a/src/bun.js/javascript.zig +++ b/src/bun.js/javascript.zig @@ -764,21 +764,6 @@ pub const VirtualMachine = struct { _ = VirtualMachine.vm.ref_strings.remove(ref_string.hash); } - pub fn getFileBlob(this: *VirtualMachine, pathlike: JSC.Node.PathOrFileDescriptor) ?*JSC.WebCore.Blob.Store { - const hash = pathlike.hash(); - return this.file_blobs.get(hash); - } - - pub fn putFileBlob(this: *VirtualMachine, pathlike: JSC.Node.PathOrFileDescriptor, store: *JSC.WebCore.Blob.Store) !void { - const hash = pathlike.hash(); - try this.file_blobs.put(hash, store); - } - - pub fn removeFileBlob(this: *VirtualMachine, pathlike: JSC.Node.PathOrFileDescriptor) void { - const hash = pathlike.hash(); - _ = this.file_blobs.remove(hash); - } - pub fn refCountedResolvedSource(this: *VirtualMachine, code: []const u8, specifier: []const u8, source_url: []const u8, hash_: ?u32) ResolvedSource { var source = this.refCountedString(code, hash_, true); diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig index d68d4b6d2..fabaffbad 100644 --- a/src/bun.js/webcore/response.zig +++ b/src/bun.js/webcore/response.zig @@ -1703,9 +1703,6 @@ pub const Blob = struct { pub fn findOrCreateFileFromPath(path_: JSC.Node.PathOrFileDescriptor, globalThis: *JSGlobalObject) Blob { var vm = globalThis.bunVM(); - if (vm.getFileBlob(path_)) |blob| { - blob.ref(); - return Blob.initWithStore(blob, globalThis); } var allocator = globalThis.bunVM().allocator; @@ -1743,9 +1740,7 @@ pub const Blob = struct { } }; - const result = Blob.initWithStore(Blob.Store.initFile(path, null, allocator) catch unreachable, globalThis); - vm.putFileBlob(path, result.store.?) catch unreachable; - return result; + return Blob.initWithStore(Blob.Store.initFile(path, null, allocator) catch unreachable, globalThis); } pub const Store = struct { |