1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-03 06:45:02 -04:00

Vendor in the spin crate for the time being

This commit is contained in:
2018-12-15 15:50:48 -05:00
parent a0f06ab30a
commit 816c4f994f
12 changed files with 1331 additions and 2 deletions

View File

@ -30,10 +30,22 @@
//! ```rust,no_run
//! use qadapt::no_alloc;
//!
//! // This function is fine, there are no allocations here
//! #[no_alloc]
//! fn do_math() -> u8 {
//! 2 + 2
//! }
//!
//! // This function will trigger a panic when called
//! #[no_alloc]
//! fn does_panic() -> Box<u32> {
//! Box::new(5)
//! }
//!
//! fn main() {
//! do_math();
//! does_panic();
//! }
//! ```
//!
//! 2. Evaluate expressions with the `assert_no_alloc!` macro
@ -60,7 +72,7 @@ pub use qadapt_macro::*;
use libc::c_void;
use libc::free;
use libc::malloc;
use spin::RwLock;
use qadapt_spin::RwLock;
use std::alloc::GlobalAlloc;
use std::alloc::Layout;
use std::thread;