mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(allocator): mark Allocator::alloc_layout as #[inline(always)] (#21335)
Mark this method `#[inline(always)]` like all other `Allocator` methods.
This commit is contained in:
1 parent
6dd061c70e
commit
04b0fdc394
1 file changed
+5
@@ -361,6 +361,11 @@ impl Allocator {
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if reserving space matching `layout` fails.
|
||||
//
|
||||
// `#[inline(always)]` because this is a hot path and `Bump::alloc_layout` is a very small function.
|
||||
// We always want it to be inlined.
|
||||
#[expect(clippy::inline_always)]
|
||||
#[inline(always)]
|
||||
pub fn alloc_layout(&self, layout: Layout) -> NonNull<u8> {
|
||||
#[cfg(all(feature = "track_allocations", not(feature = "disable_track_allocations")))]
|
||||
self.stats.record_allocation();
|
||||
|
||||
Reference in new issue
Block a user