mallocator 0.1.0

Use malloc() and free() for memory management in Rust.
Documentation
#![no_std]

use core::alloc::{GlobalAlloc, Layout};

pub struct Mallocator;

extern "C" {
    fn malloc(size: usize) -> *mut u8;
    fn free(ptr: *mut u8);
}

unsafe impl GlobalAlloc for Mallocator {
    unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
        malloc(layout.size())
    }

    unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
        free(ptr)
    }
}