#include
#include
#include "mymalloc.h"
int main() {
// You can use sbrk(0) to get the current position of the break.
// This is nice for testing cause you can see if the heap is the same size
// before and after your tests, like here.
void* heap_at_start = sbrk(0);
void* block = my_malloc(100);
my_free(block);
void* heap_at_end = sbrk(0);
unsigned int heap_size_diff = (unsigned int)(heap_at_end - heap_at_start);
if(heap_size_diff)
printf("Hmm, the heap got bigger by %u (0x%X) bytes...\n", heap_size_diff, heap_size_diff);
// ADD MORE TESTS HERE.
return 0;
}