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

Fix some deadlock issues

Slower, but much safer internal allocation guard
This commit is contained in:
2018-11-10 20:54:35 -05:00
parent 753b3a4e8b
commit a7df1639ce
2 changed files with 80 additions and 24 deletions

27
tests/macros.rs Normal file
View File

@ -0,0 +1,27 @@
extern crate qadapt;
use qadapt::allocate_panic;
#[allocate_panic]
fn allocates() {
let _v: Vec<()> = Vec::with_capacity(1);
}
#[allocate_panic]
fn no_allocate() {
let _v: Vec<()> = Vec::with_capacity(0);
}
#[test]
fn test_no_allocate() {
no_allocate();
}
/*
#[test]
#[should_panic]
fn test_allocates() {
allocates();
}
*/