Written helper function checkSize in allocator.c