Use stacks for small memory block instead of using 'malloc'