Add memory allocator, compile with C99