mallockit 0.1.0

A framework for building malloc implementations in Rust
Documentation
use std::alloc::Layout;

use crate::{mutator::Mutator, util::Address};

pub trait Plan: Singleton + Sized + 'static {
    type Mutator: Mutator<Plan = Self>;

    fn new() -> Self;
    fn init(&'static self) {}
    fn get_layout(ptr: Address) -> Layout;

    fn get() -> &'static Self {
        <Self as Singleton>::singleton()
    }
}

pub trait Singleton: Sized + 'static {
    fn singleton() -> &'static Self;
}