-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathREADME
11 lines (9 loc) · 862 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
Malloc: Writing a Dynamic Storage Allocator
My implementation of the dynamic storage allocator consists of the following fuctions, as well as some additional helper functions:
int mm_init(void): Performs necessary initializations
void *malloc(size_t size): returns a pointer to the allocated block payload
void free(void *ptr): frees the block pointed to by ptr
void *realloc(void *ptr, size_t size): returns a pointer to the allocated bock payload
void *calloc(size_t nmemb, size_t size): allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the memory, sets the memory to zero before returning
void mm_checkheap(void): debugging function, scans the heap and checks for consistency
My implementation uses a doubly linked explicit free list for memory management and a first fit scanning algorithm for allocating memory.