Repository navigation
Remove 98 unsafe blocks from bun_threading, bun_alloc, the bundler and the transpiler
#47901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
0004f1b
threading: `Semaphore` and `Channel` keep their state in a `Guarded`
claude 4f928f3
threading: `Task::from_node` is a cast, and `Batch::pop` reads its ow…
claude daed865
threading: `IntrusiveWorkTask` and `OwnedTask` are safe traits
claude 650cee1
alloc: `secure_zero` takes `&mut [u8]`
claude 9500c26
collections: drop `VecExt::from_bump_slice` and `VecExt::writable_slice`
claude 3aad198
sema: the stand-ins that ignore their arguments are safe `extern "C" …
claude 0f38b7e
alloc, opaque: remove dead code that carried `unsafe`
claude dbddc13
alloc: `WTFStringImplStruct::m_ref_count` is an `AtomicU32`
claude ebf7030
alloc: `Mutex::lock` returns a guard that borrows the mutex
claude eaccd7a
alloc: use the reference `MaybeUninit::write` returns, and index a ch…
claude 61b1ec6
alloc: `Zone::init` takes `&'static CStr`
claude d0d863b
threading: a worker's `Thread` is only ever borrowed shared
claude 039a118
threading: `Bun__lock` takes `&ReleaseImpl`
claude 4180b96
ptr: `DebugData::deinit` takes `&self`
claude fcab46d
sql: `PostgresSQLConnection::drop` zeroes `options_buf` with `secure_…
claude 12efe51
bundler: `zig__ModuleInfoDeserialized__deinit` takes the `Box` that i…
claude 63f26c1
transpiler: `print_with_source_map` takes `Option<&mut ModuleInfo>`
claude b580702
bundler: five `unsafe` blocks that plain borrows replace
claude ae5fd67
bundler: `BundleThread::enqueue` takes `&self`; `generation` is a loc…
claude 8fe8818
bundler: `enqueue_entry_points_dev_server` borrows the transpiler whe…
claude b1147c9
bundler: `process_html_import_files` borrows four fields of the parse…
claude e85108d
transpiler: `Linker` takes what it reads as parameters instead of poi…
claude 11e2338
transpiler: `Transpiler::init` builds its value with a struct literal
claude 1e028bb
bundler: three worker contexts that only read the linker hold `&Linke…
claude a3dff79
bundler: `LinkerContext::load` and `link` take the fields they use, n…
claude 052ab80
bundler: the back-pointers of the tasks name the bundle's lifetime
claude 5c2f91b
threading: `ThreadPool::each_ptr` hands each task a `&mut V`
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.