raw 0.0.5

Utilities for unsafely manipulating raw representations in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Utilities for dealing with the boilerplate of using the allocator directly. In particular,
//! correctly handles zero-sized types and checks for integer overflows in allocation requests.
//!
//! `plain` will return a `null` pointer on OOM, while `lazy` will panic. Otherwise the two
//! APIs are identical.

use std::intrinsics::abort;

pub mod lazy;
pub mod plain;

pub fn oom() -> ! {
    unsafe { abort() }
}