#include <stdio.h>
#include "rtl_malloc.h"
Include dependency graph for test.c:
Go to the source code of this file.
Defines | |
#define | KiloByte 1024 |
#define | POOL_SIZE 1024 |
Functions | |
main () | |
Variables | |
char | pool [POOL_SIZE *KiloByte] |
|
|
|
Definition at line 5 of file test.c. Referenced by main(). |
|
Definition at line 12 of file test.c. References associate_buffer, destroy_memory_pool(), init_memory_pool(), pool, POOL_SIZE, rtl_free, and rtl_malloc.
00012 { 00013 int *ptr[100]; 00014 int i, free_mem; 00015 00016 free_mem = init_memory_pool(POOL_SIZE, 5, pool); 00017 printf("Total free memory= %d\n", free_mem); 00018 00019 // default malloc and free use this buffer. 00020 associate_buffer(pool); 00021 00022 00023 for (i=0; i< 100; i++) 00024 if (!(ptr[i]=rtl_malloc(100))){ 00025 printf("Error\n"); 00026 exit(-1); 00027 } 00028 00029 for (i=0; i< 100; i++) 00030 rtl_free(ptr[i]); 00031 00032 00033 destroy_memory_pool(pool); 00034 printf("Test OK\n"); 00035 exit(0); 00036 } |
Here is the call graph for this function:
|
Definition at line 9 of file test.c. Referenced by main(). |