An open API service indexing awesome lists of open source software.

https://github.com/terance-edmonds/malloc

C language - malloc and free functions implementation
https://github.com/terance-edmonds/malloc

c malloc-functions

Last synced: 4 months ago
JSON representation

C language - malloc and free functions implementation

Awesome Lists containing this project

README

        

# Implement a malloc-like memory allocation library in C.

1. Declare a global array of 25000 bytes.

2. You must implement a function that is like malloc(). Call it MyMalloc(). Its signature is similar to malloc(). You should also implement MyFree() which has a signature and functionality that are similar to free(). Read the documentation on malloc() and free(). It would be a good idea to use malloc and free before attempting to implement MyMalloc() and MyFree().

3. MyMalloc() allocates memory only from the previously mentioned array of 25000 bytes.

4. All the data structures that are required to manage the memory must also reside within the same array.

5. MyMalloc() and MyFree() must be in a file called mymalloc.c. You should also provide a suitable header file mymalloc.h.

6. Our test program contains the main() and it includes mymalloc.h. Do not include a main() in your mymalloc.c.

7. Upload only the mymalloc.c and mymalloc.h to UGVLE by the due date.

8. You cannot use malloc() and free() in your implementation of MyMalloc() and MyFree().

# Execute

Run the below codes in your terminal

`gcc index.c mymalloc.c -o index`

`index.exe`