Changeset a294ad0 in mainline for test/mm/slab1/test.c
- Timestamp:
- 2006-02-02T14:00:32Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2d43f3e
- Parents:
- 758e065
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mm/slab1/test.c
r758e065 ra294ad0 29 29 #include <test.h> 30 30 #include <mm/slab.h> 31 #include <print.h> 32 33 #define VAL_SIZE 128 34 #define VAL_COUNT 1024 35 36 void * data[16384]; 31 37 32 38 void test(void) 33 39 { 34 slab_cache_create("test_cache", 10, 0, NULL, NULL, 0); 40 slab_cache_t *cache; 41 int i; 42 43 44 printf("Creating cache.\n"); 45 cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE); 46 slab_print_list(); 47 printf("Destroying cache.\n"); 48 slab_cache_destroy(cache); 49 50 printf("Creating cache.\n"); 51 cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, 52 SLAB_CACHE_NOMAGAZINE); 53 54 printf("Allocating %d items...", VAL_COUNT); 55 for (i=0; i < VAL_COUNT; i++) { 56 data[i] = slab_alloc(cache, 0); 57 } 58 printf("done.\n"); 59 printf("Freeing %d items...", VAL_COUNT); 60 for (i=0; i < VAL_COUNT; i++) { 61 slab_free(cache, data[i]); 62 } 63 printf("done.\n"); 35 64 }
Note:
See TracChangeset
for help on using the changeset viewer.