diff options
Diffstat (limited to 'apps/plugins/pdbox/dbestfit-3.3/mytest.c')
-rw-r--r-- | apps/plugins/pdbox/dbestfit-3.3/mytest.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/apps/plugins/pdbox/dbestfit-3.3/mytest.c b/apps/plugins/pdbox/dbestfit-3.3/mytest.c index bf338b72ef..80407dee00 100644 --- a/apps/plugins/pdbox/dbestfit-3.3/mytest.c +++ b/apps/plugins/pdbox/dbestfit-3.3/mytest.c | |||
@@ -1,74 +1,3 @@ | |||
1 | |||
2 | #include <stdio.h> | ||
3 | #include <stdlib.h> | ||
4 | |||
5 | #include "bmalloc.h" | ||
6 | |||
7 | int main(int argc, char **argv) | ||
8 | { | ||
9 | void *pointers[5]; | ||
10 | int i; | ||
11 | void *area; | ||
12 | |||
13 | for(i=0; i<5; i++) | ||
14 | pointers[i] = malloc(8000); | ||
15 | |||
16 | if(argc>1) { | ||
17 | switch(argv[1][0]) { | ||
18 | case '1': | ||
19 | for(i=0; i<5; i++) { | ||
20 | add_pool(pointers[i], 4000); | ||
21 | add_pool((char *)pointers[i]+4000, 4000); | ||
22 | } | ||
23 | break; | ||
24 | case '2': | ||
25 | area = malloc(20000); | ||
26 | add_pool(area, 3000); | ||
27 | add_pool((char *)area+6000, 3000); | ||
28 | add_pool((char *)area+3000, 3000); | ||
29 | add_pool((char *)area+12000, 3000); | ||
30 | add_pool((char *)area+9000, 3000); | ||
31 | break; | ||
32 | case '3': | ||
33 | { | ||
34 | void *ptr[10]; | ||
35 | area = malloc(20000); | ||
36 | add_pool(area, 20000); | ||
37 | |||
38 | printf(" ** TEST USAGE\n"); | ||
39 | for(i=0; i<9; i++) | ||
40 | ptr[i]=bmalloc(200); | ||
41 | print_lists(); | ||
42 | for(i=0; i<9; i++) | ||
43 | bfree(ptr[i]); | ||
44 | printf(" ** END OF TEST USAGE\n"); | ||
45 | } | ||
46 | |||
47 | break; | ||
48 | case '4': | ||
49 | { | ||
50 | void *ptr[10]; | ||
51 | area = malloc(20000); | ||
52 | add_pool(area, 20000); | ||
53 | |||
54 | ptr[0]=bmalloc(4080); | ||
55 | print_lists(); | ||
56 | bfree(ptr[0]); | ||
57 | printf(" ** END OF TEST USAGE\n"); | ||
58 | } | ||
59 | |||
60 | break; | ||
61 | } | ||
62 | } | ||
63 | else | ||
64 | for(i=4; i>=0; i--) | ||
65 | add_pool(pointers[i], 8000-i*100); | ||
66 | |||
67 | print_lists(); | ||
68 | |||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | #include <stdio.h> | 1 | #include <stdio.h> |
73 | #include <stdlib.h> | 2 | #include <stdlib.h> |
74 | 3 | ||