Skip to content

Instantly share code, notes, and snippets.

@dheeptuck
Created September 16, 2022 05:46
Show Gist options
  • Save dheeptuck/70dc0d290bdd9b4fe5942a3d54210080 to your computer and use it in GitHub Desktop.
Save dheeptuck/70dc0d290bdd9b4fe5942a3d54210080 to your computer and use it in GitHub Desktop.
/*
* 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