alloc-no-stdlib 1.1.0

A dynamic allocator that may be used with or without the stdlib. This allows a package with nostd to allocate memory dynamically and be used either with a custom allocator, items on the stack, or by a package that wishes to simply use Box<>. It also provides options to use calloc or a mutable global variable for pre-zeroed memory
Documentation
extern crate core;
use super::allocated_memory::SliceWrapper;
use super::allocated_memory::SliceWrapperMut;
use core::ops;
pub struct AllocatedStackMemory<'a, T:'a> {
    pub mem : &'a mut [T],
}

impl<'a, T: 'a> core::default::Default for AllocatedStackMemory<'a, T> {
    fn default() -> Self {
        return AllocatedStackMemory::<'a, T>{mem : &mut[]};
    }
}

impl<'a, T: 'a> ops::Index<usize> for AllocatedStackMemory<'a, T> {
    type Output = T;
    fn index<'b>(&'b self, _index : usize) -> &'b T {
        return &self.mem[_index];
    }
}

impl<'a, T: 'a> ops::IndexMut<usize> for AllocatedStackMemory<'a, T> {
    fn index_mut<'b>(&'b mut self, _index : usize) -> &'b mut T {
        return &mut self.mem[_index];
    }
}

impl<'a, T: 'a> SliceWrapper<T> for AllocatedStackMemory<'a, T> {
    fn slice(& self) -> & [T] {
        return & self.mem;
    }
}

impl<'a, T: 'a> SliceWrapperMut<T> for AllocatedStackMemory<'a, T> {
    fn slice_mut(& mut self) ->& mut [T] {
        return &mut self.mem;
    }
}