The file malloc.c with the "better" version of mm_malloc also contans some auxilliary functions you can use including: