From 608cf43886f87d2c4fb31efd12a0352728354661 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 13 May 2024 23:45:52 +0000 Subject: [PATCH] inline some functions --- simdnbt/src/borrow/tag_alloc.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simdnbt/src/borrow/tag_alloc.rs b/simdnbt/src/borrow/tag_alloc.rs index 6356481..2d7768c 100644 --- a/simdnbt/src/borrow/tag_alloc.rs +++ b/simdnbt/src/borrow/tag_alloc.rs @@ -74,6 +74,7 @@ impl IndividualTagAllocator where T: Clone, { + #[inline] pub fn start(&mut self, depth: usize) -> ContiguousTagsAllocator { // make sure we have enough space for this depth // (also note that depth is reused for compounds and arrays so we might have to push @@ -87,6 +88,7 @@ where start_allocating_tags(alloc) } + #[inline] pub fn finish<'a>(&mut self, alloc: ContiguousTagsAllocator, depth: usize) -> &'a [T] { finish_allocating_tags(alloc, &mut self.current[depth], &mut self.previous[depth]) } @@ -109,6 +111,7 @@ impl Drop for IndividualTagAllocator { } } +#[inline] fn start_allocating_tags(alloc: TagsAllocation) -> ContiguousTagsAllocator { let is_new_allocation = alloc.cap == 0; ContiguousTagsAllocator { @@ -117,6 +120,7 @@ fn start_allocating_tags(alloc: TagsAllocation) -> ContiguousTagsAllocator size: 0, } } +#[inline] fn finish_allocating_tags<'a, T>( alloc: ContiguousTagsAllocator, current_alloc: &mut TagsAllocation,