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: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/oxc_allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ allocator-api2 = { workspace = true }
bumpalo = { workspace = true, features = ["allocator-api2", "collections"] }
hashbrown = { workspace = true, default-features = false, features = ["inline-more", "allocator-api2"] }
rustc-hash = { workspace = true }
simdutf8 = { workspace = true }

serde = { workspace = true, optional = true }

Expand Down
10 changes: 5 additions & 5 deletions crates/oxc_allocator/src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ impl Allocator {
///
/// 1. Padding bytes between objects which have been allocated to preserve alignment of types
/// where they have different alignments or have larger-than-typical alignment.
/// 2. Excess capacity in [`Vec`]s, [`String`]s and [`HashMap`]s.
/// 2. Excess capacity in [`Vec`]s, [`StringBuilder`]s and [`HashMap`]s.
/// 3. Objects which were allocated but later dropped. [`Allocator`] does not re-use allocations,
/// so anything which is allocated into arena continues to take up "dead space", even after it's
/// no longer referenced anywhere.
/// 4. "Dead space" left over where a [`Vec`], [`String`] or [`HashMap`] has grown and had to make
/// a new allocation to accommodate its new larger size. Its old allocation continues to take up
/// "dead" space in the allocator, unless it was the most recent allocation.
/// 4. "Dead space" left over where a [`Vec`], [`StringBuilder`] or [`HashMap`] has grown and had to
/// make a new allocation to accommodate its new larger size. Its old allocation continues to
/// take up "dead" space in the allocator, unless it was the most recent allocation.
///
/// In practice, this almost always means that the result returned from this function will be an
/// over-estimate vs the amount of "live" data in the arena.
Expand Down Expand Up @@ -519,7 +519,7 @@ impl Allocator {
///
/// [`capacity`]: Allocator::capacity
/// [`Vec`]: crate::Vec
/// [`String`]: crate::String
/// [`StringBuilder`]: crate::StringBuilder
/// [`HashMap`]: crate::HashMap
pub fn used_bytes(&self) -> usize {
let mut bytes = 0;
Expand Down
7 changes: 0 additions & 7 deletions crates/oxc_allocator/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ where

// ---------------- Primitive allocations ----------------

impl<'a> FromIn<'a, String> for crate::String<'a> {
#[inline(always)]
fn from_in(value: String, allocator: &'a Allocator) -> Self {
crate::String::from_str_in(value.as_str(), allocator)
}
}

impl<'a> FromIn<'a, String> for &'a str {
#[inline(always)]
fn from_in(value: String, allocator: &'a Allocator) -> Self {
Expand Down
2 changes: 0 additions & 2 deletions crates/oxc_allocator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ mod convert;
#[cfg(feature = "from_raw_parts")]
mod from_raw_parts;
pub mod hash_map;
pub mod string;
mod string_builder;
mod take_in;
mod vec;
Expand All @@ -45,7 +44,6 @@ pub use boxed::Box;
pub use clone_in::CloneIn;
pub use convert::{FromIn, IntoIn};
pub use hash_map::HashMap;
pub use string::String;
pub use string_builder::StringBuilder;
pub use take_in::{Dummy, TakeIn};
pub use vec::Vec;
Loading
Loading