Yet Another Malloc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
459 B

/*
* Yet Another Malloc
* yatest.c
* Author: Titouan Rigoudy
*/
#include <stdio.h>
#include "yamalloc.h"
void *print_malloc(size_t size) {
void *ptr = malloc(size);
printf("malloc(%ld) = %p\n", size, ptr);
return ptr;
}
int main(int argc, char **argv) {
ya_print_blocks();
print_malloc(4);
print_malloc(10);
ya_print_blocks();
print_malloc(10000);
ya_print_blocks();
print_malloc(2000);
ya_print_blocks();
}