Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ members = [
"src/install/windows-shim",
"src/parsers",
"src/io",
"src/js",
"src/libarchive",
"src/md",
"src/paths",
Expand Down Expand Up @@ -363,7 +362,6 @@ bun_http = { path = "src/http" }
bun_install = { path = "src/install" }
bun_parsers = { path = "src/parsers" }
bun_io = { path = "src/io" }
bun_js = { path = "src/js" }
bun_libarchive = { path = "src/libarchive" }
bun_md = { path = "src/md" }
bun_paths = { path = "src/paths" }
Expand Down
29 changes: 29 additions & 0 deletions src/bun_bin/c_abi_exports.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//! C-ABI entry points that belong to the final binary rather than any
//! library crate: the process-level panic hook and the OOM crash handler.
//!
//! Everything else that used to live here has a real home in `bun_jsc` /
//! `bun_runtime` and is exported via `generate-host-exports.ts`.

#![allow(non_snake_case, clippy::missing_safety_doc)]

/// Panic entry point for C/C++ callers (`bindings.cpp`, `bun-usockets`).
/// Routes through `bun_core::output::panic` so the crash report matches
/// Rust-originated panics.
#[unsafe(no_mangle)]
pub(crate) extern "C" fn Bun__panic(msg: *const u8, len: usize) -> ! {
let bytes = if msg.is_null() {
&b""[..]
} else {
// SAFETY: `msg` is non-null (checked above) and the C++ caller
// guarantees it is valid for reading `len` bytes for this call.
unsafe { core::slice::from_raw_parts(msg, len) }
};
bun_core::output::panic(format_args!("{}", bstr::BStr::new(bytes)));
}

/// Out-of-memory entry point for C callers (bun-usockets) that cannot
/// propagate an allocation failure. Same crash report as `handle_oom`.
#[unsafe(no_mangle)]
pub(crate) extern "C" fn Bun__outOfMemory() -> ! {
bun_core::out_of_memory()
}
2 changes: 1 addition & 1 deletion src/bun_bin/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

use core::ffi::{c_char, c_int};

mod phase_c_exports;
mod c_abi_exports;

// Force-link `bun_platform` so its `#[no_mangle]` C exports
// (`sys_epoll_pwait2`, …) reach the linker.
Expand Down
303 changes: 0 additions & 303 deletions src/bun_bin/phase_c_exports.rs

This file was deleted.

Loading
Loading