Created
September 16, 2022 05:46
-
-
Save dheeptuck/70dc0d290bdd9b4fe5942a3d54210080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Initializes the heap. It internally created a BD and places at start of the | |
* heap. The BD is added to avail_dll. | |
* @param pHeapInfo: Pointer to the current heap info. | |
**/ | |
void CustomMallocInit(HEAP_INFO_t *pHeapInfo); | |
/* | |
* Mimics the malloc function(i.e provides the requested memory). Returns NULL in | |
* case is it not possible to allocate the requested memory. | |
* @param pHeapInfo: Pointer to the current heap info. | |
* @param sz: The size of the requested memory. | |
**/ | |
void *CustomMalloc(HEAP_INFO_t *pHeapInfo, size_t sz); | |
/* | |
* Mimics the free function(i.e frees an block that was already allocated) | |
* @param pHeapInfo: Pointer to the current heap info. | |
* @param blkPtr: Pointer to the block to be freed. | |
**/ | |
void CustomFree(HEAP_INFO_t *pHeapInfo, void *blkPtr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment