/Heap-Allocator

NEU Computer System Simple Heap Allocator written in C

Primary LanguageC

Heap-Allocator

NEU CS5600 Computer System Course Project

Implemented a simple Heap Allocator with Doubly-Linked List structure to store blocks. The following APIs are supported:

  • Initialize memory allocator

void mm_init();

  • Reset memory allocator

void mm_reset();

  • De-initialize memory allocator

void mm_deinit();

  • Calculate the total amount of available free memory

size_t mm_getfree(void);

  • Allocates size bytes of memory and returns a pointer to the allocated memory, or NULL if request storage cannot be allocated

void *mm_malloc(size_t nbytes);

  • Deallocates the memory allocation pointed to by ptr. if ptr is a NULL pointer, no operation is performed

void mm_free(void *ap);

  • Reallocates size bytes of memory and returns a pointer to the allocated memory, or NULL if request storage cannot be allocated

void *mm_realloc(void *ap, size_t size);