checkpoint

This commit is contained in:
John Smith
2023-01-29 13:13:50 -05:00
parent 8b026f4756
commit 766872ac26
11 changed files with 535 additions and 666 deletions

View File

@@ -299,6 +299,14 @@ pub unsafe fn aligned_8_u8_vec_uninit(n_bytes: usize) -> Vec<u8> {
)
}
pub unsafe fn unaligned_u8_vec_uninit(n_bytes: usize) -> Vec<u8> {
let mut unaligned: Vec<u8> = Vec::with_capacity(n_bytes);
let ptr = unaligned.as_mut_ptr();
mem::forget(unaligned);
Vec::from_raw_parts(ptr as *mut u8, n_bytes, n_bytes)
}
pub fn debug_backtrace() -> String {
let bt = backtrace::Backtrace::new();
format!("{:?}", bt)