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
1 change: 1 addition & 0 deletions crates/oxc_allocator/src/bump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ fn layout_from_size_align(size: usize, align: usize) -> Result<Layout, AllocErr>
Layout::from_size_align(size, align).map_err(|_| AllocErr)
}

#[cold]
#[inline(never)]
fn allocation_size_overflow<T>() -> T {
panic!("requested allocation size overflowed")
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_allocator/src/bumpalo_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ use core::usize;

pub use core::alloc::{Layout, LayoutErr};

#[cold]
#[inline(never)]
fn new_layout_err() -> LayoutErr {
Layout::from_size_align(1, 3).unwrap_err()
}

#[cold]
#[inline(never)]
pub fn handle_alloc_error(layout: Layout) -> ! {
panic!("encountered allocation error: {:?}", layout)
}
Expand Down
2 changes: 2 additions & 0 deletions crates/oxc_allocator/src/vec2/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,8 @@ fn alloc_guard(alloc_size: usize) -> Result<(), AllocError> {
// One central function responsible for reporting capacity overflows. This'll
// ensure that the code generation related to these panics is minimal as there's
// only one location which panics rather than a bunch throughout the module.
#[cold]
#[inline(never)]
fn capacity_overflow() -> ! {
panic!("capacity overflow")
}
Expand Down
Loading