Changeset a35b458 in mainline for kernel/test/mm/falloc1.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/mm/falloc1.c
r3061bc1 ra35b458 45 45 if (TEST_RUNS < 2) 46 46 return "Test is compiled with TEST_RUNS < 2"; 47 47 48 48 uintptr_t *frames = (uintptr_t *) 49 49 malloc(MAX_FRAMES * sizeof(uintptr_t), 0); 50 50 if (frames == NULL) 51 51 return "Unable to allocate frames"; 52 52 53 53 unsigned int results[MAX_FRAMES + 1]; 54 54 55 55 for (unsigned int run = 0; run < TEST_RUNS; run++) { 56 56 for (size_t count = 1; count <= MAX_FRAMES; count++) { 57 57 size_t bytes = FRAMES2SIZE(count); 58 58 59 59 TPRINTF("Allocating %zu frames blocks (%zu bytes) ... ", 60 60 count, bytes); 61 61 62 62 unsigned int allocated = 0; 63 63 for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) { … … 70 70 } 71 71 } 72 72 73 73 TPRINTF("%d blocks allocated.\n", allocated); 74 74 75 75 if (run > 0) { 76 76 if (results[count] != allocated) … … 78 78 } else 79 79 results[count] = allocated; 80 80 81 81 TPRINTF("Deallocating ... "); 82 82 83 83 for (unsigned int i = 0; i < allocated; i++) 84 84 frame_free(frames[i], count); 85 85 86 86 TPRINTF("done.\n"); 87 87 } 88 88 } 89 89 90 90 free(frames); 91 91 92 92 return NULL; 93 93 }
Note:
See TracChangeset
for help on using the changeset viewer.