mirror of
https://github.com/bspeice/qadapt
synced 2024-11-23 14:28:10 -05:00
Fix up the clippy warnings
This commit is contained in:
parent
f4f33dabb7
commit
a1ee8934b4
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
use qadapt::allocate_panic;
|
use qadapt::allocate_panic;
|
||||||
use qadapt::QADAPT;
|
use qadapt::QADAPT;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use env_logger;
|
use env_logger;
|
||||||
|
|
||||||
|
|
||||||
use qadapt::allocate_panic;
|
use qadapt::allocate_panic;
|
||||||
|
|
||||||
// Note that we're missing the `#[global_allocator]` attribute
|
// Note that we're missing the `#[global_allocator]` attribute
|
||||||
|
@ -12,10 +12,7 @@
|
|||||||
//! for some helper macros to make working with QADAPT a bit easier.
|
//! for some helper macros to make working with QADAPT a bit easier.
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
|
|
||||||
#[macro_use]
|
use log::warn;
|
||||||
extern crate log;
|
|
||||||
|
|
||||||
|
|
||||||
// thread_id is necessary because `std::thread::current()` panics if we have not yet
|
// thread_id is necessary because `std::thread::current()` panics if we have not yet
|
||||||
// allocated a `thread_local!{}` it depends on.
|
// allocated a `thread_local!{}` it depends on.
|
||||||
use thread_id;
|
use thread_id;
|
||||||
@ -47,7 +44,7 @@ pub fn enter_protected() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if *IS_ACTIVE.read() == false {
|
if !*IS_ACTIVE.read() {
|
||||||
*IS_ACTIVE.write() = true;
|
*IS_ACTIVE.write() = true;
|
||||||
warn!("QADAPT not initialized when using allocation guards; please verify `#[global_allocator]` is set!");
|
warn!("QADAPT not initialized when using allocation guards; please verify `#[global_allocator]` is set!");
|
||||||
}
|
}
|
||||||
@ -123,7 +120,7 @@ fn alloc_immediate() -> bool {
|
|||||||
|
|
||||||
unsafe impl GlobalAlloc for QADAPT {
|
unsafe impl GlobalAlloc for QADAPT {
|
||||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||||
if *IS_ACTIVE.read() == false {
|
if !*IS_ACTIVE.read() {
|
||||||
*IS_ACTIVE.write() = true;
|
*IS_ACTIVE.write() = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
use qadapt::enter_protected;
|
use qadapt::enter_protected;
|
||||||
use qadapt::exit_protected;
|
use qadapt::exit_protected;
|
||||||
use qadapt::protection_level;
|
use qadapt::protection_level;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use qadapt::allocate_panic;
|
use qadapt::allocate_panic;
|
||||||
|
Loading…
Reference in New Issue
Block a user