linear allocator implementation with small test