Changeset 1093620 in mainline for test/mm/falloc2/test.c
- Timestamp:
- 2006-01-22T16:51:11Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d8d27c
- Parents:
- bd6e392
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mm/falloc2/test.c
rbd6e392 r1093620 30 30 #include <mm/page.h> 31 31 #include <mm/frame.h> 32 #include <mm/heap.h> 32 33 #include <arch/mm/page.h> 33 34 #include <arch/types.h> … … 37 38 #include <memstr.h> 38 39 39 #define MAX_FRAMES 12840 #define MAX_ORDER 240 #define MAX_FRAMES 256 41 #define MAX_ORDER 8 41 42 42 43 #define THREAD_RUNS 1 43 #define THREADS 644 #define THREADS 8 44 45 45 46 static void thread(void * arg); … … 54 55 index_t k; 55 56 56 __address frames[MAX_FRAMES];57 __address * frames = (__address *) malloc(MAX_FRAMES * sizeof(__address)); 57 58 58 59 for (run=0;run<THREAD_RUNS;run++) { … … 61 62 printf("Thread #%d: Allocating %d frames blocks ... \n",val, 1<<order); 62 63 allocated = 0; 63 for (i=0;i <MAX_FRAMES>>order;i++) {64 for (i=0;i < (MAX_FRAMES >> order);i++) { 64 65 frames[allocated] = frame_alloc(FRAME_NON_BLOCKING | FRAME_KA,order, &status); 65 66 if (status == 0) { … … 75 76 printf("Thread #%d: Deallocating ... \n", val); 76 77 for (i=0;i<allocated;i++) { 78 77 79 for (k=0;k<=((FRAME_SIZE << order) - 1);k++) { 78 80 if ( ((char *) frames[i])[k] != val ) { … … 82 84 83 85 } 84 86 85 87 frame_free(frames[i]); 86 88 }
Note:
See TracChangeset
for help on using the changeset viewer.