1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-01 13:56:14 -04:00

Get the proc macro working. It's time to release.

This commit is contained in:
2018-11-11 22:22:24 -05:00
parent 80f1d5c1f8
commit 8bc768e40b
3 changed files with 61 additions and 11 deletions

View File

@ -73,6 +73,11 @@ pub fn exit_protected() {
static INTERNAL_ALLOCATION: RwLock<usize> = RwLock::new(usize::max_value());
/// Get the current "protection level" in QADAPT: calls to enter_protected() - exit_protected()
pub fn protection_level() -> usize {
PROTECTION_LEVEL.try_with(|v| *v.read() ).unwrap_or(0)
}
fn claim_internal_alloc() {
loop {
match INTERNAL_ALLOCATION.write() {