comn/
lib.rs

1#![allow(unused_imports)]
2#![allow(nonstandard_style)]
3
4#[macro_use]
5extern crate ctor;
6pub use ctor::*;
7
8pub use comn_pms::*;
9use std::alloc::{alloc, dealloc, Layout};
10
11mod macros;
12pub use macros::CallPos;
13
14pub mod atomic;
15pub mod flags;
16pub mod leadlock;
17pub mod syna;
18
19mod my_handle;
20pub use my_handle::MyHandle;
21
22mod list_head;
23pub use list_head::ListHead;
24
25mod lkf;
26pub use lkf::{Lkf, LkfNode};
27
28pub unsafe fn malloc<T>() -> *mut T {
29    alloc(Layout::new::<T>()) as *mut T
30}
31
32pub unsafe fn free<T>(ptr: *const T) {
33    dealloc(ptr as *mut _, Layout::new::<T>());
34}