Open paperdave opened 3 months ago
In a release build there is undefined behavior causing a module resolve error lol
70 | fallbackBindings = require('@swc/wasm');
^
error: Could not resolve: "@swc/wasm". Maybe you need to "bun install"?
at /Users/dave/code/bun/test/node_modules/@swc/core/index.js:70:36
When using this test case
I get a crash while bundling in ASTMemoryAllocator.
My proposed solution to this is to just deleteASTMemoryAllocator
, as it was sort of leftover code from https://github.com/oven-sh/bun/pull/12388.NewStore
is a better bump allocator. Looking at the remaining usages of it, I think it could be replaced with two things.add to a way to push and pop reset points onto the threadlocalNewStore
that already exists (this is most uses boil down to)an option to configure how much to pre-allocate at initialization (this takes care of bun install's use-case "The default store we use pre-allocates around 16 MB of memory per thread; That adds up in multi-threaded scenarios.")EDIT: The above solution is not satisfactory as AstMemoryAllocator is used to hold onto an ast for a lifetime longer than what the store allows for.
Opening an issue to look into later instead of just doing a quick fix, since that quick fix is unlikely to be reliable. the better fix is the harder thing.