Dynamic memory management system (my implementation of malloc and free)