Changeset bc504ef2 in mainline for test/mm/slab1/test.c
- Timestamp:
- 2006-02-02T16:14:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 086d4fd
- Parents:
- 2d43f3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mm/slab1/test.c
r2d43f3e rbc504ef2 44 44 printf("Creating cache.\n"); 45 45 cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE); 46 slab_print_list();47 46 printf("Destroying cache.\n"); 48 47 slab_cache_destroy(cache); … … 62 61 } 63 62 printf("done.\n"); 63 64 printf("Allocating %d items...", VAL_COUNT); 65 for (i=0; i < VAL_COUNT; i++) { 66 data[i] = slab_alloc(cache, 0); 67 } 68 printf("done.\n"); 69 70 slab_print_list(); 71 printf("Freeing %d items...", VAL_COUNT/2); 72 for (i=VAL_COUNT-1; i >= VAL_COUNT/2; i--) { 73 slab_free(cache, data[i]); 74 } 75 printf("done.\n"); 76 77 printf("Allocating %d items...", VAL_COUNT/2); 78 for (i=VAL_COUNT/2; i < VAL_COUNT; i++) { 79 data[i] = slab_alloc(cache, 0); 80 } 81 printf("done.\n"); 82 printf("Freeing %d items...", VAL_COUNT); 83 for (i=0; i < VAL_COUNT; i++) { 84 slab_free(cache, data[i]); 85 } 86 printf("done.\n"); 87 slab_print_list(); 88 slab_cache_destroy(cache); 89 90 printf("Test complete.\n"); 64 91 }
Note:
See TracChangeset
for help on using the changeset viewer.