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:
overlookmotel committed 2026-04-12 15:04:19 +00:00
1 parent 6dd061c70e
commit 04b0fdc394
1 file changed
+5
+5
View File
@@ -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();