stuff
This commit is contained in:
23
06-MemoryManager/testcases/tc0.c
Normal file
23
06-MemoryManager/testcases/tc0.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "memory_manager.h"
|
||||
|
||||
#define MY_HEAP_SIZE 100
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("TC0: init and destroy\n");
|
||||
|
||||
char my_heap[MY_HEAP_SIZE];
|
||||
mmInit(my_heap, MY_HEAP_SIZE);
|
||||
|
||||
printf("1 -- Available Memory: %d, Alloc Memory: %d, Fragment Count: %d\n", get_remaining_space(), get_allocated_space(), get_fragment_count());
|
||||
printf("Total successful mallocs: %d\n", get_mymalloc_count());
|
||||
|
||||
mmDestroy();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user