A memory allocation library with error checking