Removed malloc/free callback because it doesn't solve the mem-alloc deadlock problem;
Used one single allocator and take a pre-allocated buffer from caller as the linear allocation buffer.