From c1d2f8392e6e0b4a0a6f7d6ba221a4edeb261371 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Fri, 17 Jan 2025 22:41:01 +0000 Subject: [PATCH] perf(lexer): align `Token` on 8 --- crates/oxc_parser/src/lexer/token.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/oxc_parser/src/lexer/token.rs b/crates/oxc_parser/src/lexer/token.rs index 63e3a774b6e6c..7fc99cdc91863 100644 --- a/crates/oxc_parser/src/lexer/token.rs +++ b/crates/oxc_parser/src/lexer/token.rs @@ -5,6 +5,8 @@ use oxc_span::Span; use super::kind::Kind; #[derive(Debug, Clone, Copy, Default)] +// Align `Token` on 8 on 64-bit platforms (same alignment as `Span`) +#[cfg_attr(target_pointer_width = "64", repr(align(8)))] pub struct Token { /// Token Kind pub kind: Kind,