Skip to content

Commit bfd17fd

Browse files
committed
perf(allocator/address): add #[repr(transparent)] to Address (#15312)
`Address` just wraps a `usize`, so make it `#[repr(transparent)]`. This may improve perf in some cases (or maybe not, but still it's good practice).
1 parent ed0e023 commit bfd17fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/oxc_allocator/src/address.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::Box;
44

55
/// Memory address of an AST node in arena.
66
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7+
#[repr(transparent)]
78
pub struct Address(usize);
89

910
impl Address {

0 commit comments

Comments
 (0)