Skip to content

Commit 670ac60

Browse files
committed
Update Allocator Designs post to use LinkedListAllocator::lock method
1 parent 4f42826 commit 670ac60

File tree

1 file changed

+2
-2
lines changed
  • blog/content/second-edition/posts/11-allocator-designs

1 file changed

+2
-2
lines changed

blog/content/second-edition/posts/11-allocator-designs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ unsafe impl GlobalAlloc for Locked<LinkedListAllocator> {
701701
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
702702
// perform layout adjustments
703703
let (size, align) = LinkedListAllocator::size_align(layout);
704-
let mut allocator = self.inner.lock();
704+
let mut allocator = self.lock();
705705

706706
if let Some((region, alloc_start)) = allocator.find_region(size, align) {
707707
let alloc_end = alloc_start.checked_add(size).expect("overflow");
@@ -719,7 +719,7 @@ unsafe impl GlobalAlloc for Locked<LinkedListAllocator> {
719719
// perform layout adjustments
720720
let (size, _) = LinkedListAllocator::size_align(layout);
721721

722-
self.inner.lock().add_free_region(ptr as usize, size)
722+
self.lock().add_free_region(ptr as usize, size)
723723
}
724724
}
725725
```

0 commit comments

Comments
 (0)