Issue 3223: make unsafe scopes tighter

This commit is contained in:
Alexander McLin
2026-04-04 13:37:42 -04:00
parent fcd6c3f127
commit 83218bf0da
6 changed files with 19 additions and 22 deletions

View File

@@ -176,8 +176,8 @@ impl Stack {
#[inline(always)]
unsafe fn alloc(&mut self, frame_size: usize) -> Result<NonNull<u8>, AllocError> {
unsafe {
loop {
unsafe {
let ptr = self.buf.alloc(frame_size);
if let Some(ptr) = NonNull::new(ptr) {
return Ok(ptr);