Skip to content

Commit b437bd3

Browse files
committed
Bump dependencies, clippy suggested changes
1 parent a51e890 commit b437bd3

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ version = "0.9.8"
2020
optional = true
2121

2222
[dev-dependencies]
23-
criterion = "0.3"
24-
ctor = "0.1.23"
23+
criterion = "0.5.1"
24+
ctor = "0.2.6"
2525
rand = "0.8.5"
2626
rand_chacha = "0.3.1"
2727

benches/memory_allocator_benchmark.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use alloc::alloc::GlobalAlloc;
1212
use alloc::alloc::Layout;
1313
use buddy_system_allocator::LockedHeap;
1414
use criterion::{black_box, criterion_group, criterion_main, Criterion};
15+
use rand::{Rng, SeedableRng};
1516

1617
const SMALL_SIZE: usize = 8;
1718
const LARGE_SIZE: usize = 1024 * 1024; // 1M
@@ -42,10 +43,6 @@ pub fn large_alloc<const ORDER: usize>(heap: &LockedHeap<ORDER>) {
4243
pub fn mutil_thread_random_size<const ORDER: usize>(heap: &'static LockedHeap<ORDER>) {
4344
const THREAD_SIZE: usize = 10;
4445

45-
use rand::prelude::*;
46-
use rand::{Rng, SeedableRng};
47-
use rand_chacha::ChaCha8Rng;
48-
4946
let mut threads = Vec::with_capacity(THREAD_SIZE);
5047
let alloc = Arc::new(heap);
5148
for i in 0..THREAD_SIZE {

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ unsafe impl<const ORDER: usize> GlobalAlloc for LockedHeap<ORDER> {
262262
.lock()
263263
.alloc(layout)
264264
.ok()
265-
.map_or(0 as *mut u8, |allocation| allocation.as_ptr())
265+
.map_or(core::ptr::null_mut(), |allocation| allocation.as_ptr())
266266
}
267267

268268
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
@@ -328,7 +328,7 @@ unsafe impl<const ORDER: usize> GlobalAlloc for LockedHeapWithRescue<ORDER> {
328328
inner
329329
.alloc(layout)
330330
.ok()
331-
.map_or(0 as *mut u8, |allocation| allocation.as_ptr())
331+
.map_or(core::ptr::null_mut(), |allocation| allocation.as_ptr())
332332
}
333333
}
334334
}

0 commit comments

Comments
 (0)