Changeset 41deb2a in mainline for kernel/generic/src/lib/ra.c
- Timestamp:
- 2011-12-30T19:27:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efb48eb
- Parents:
- 0fd9b35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/ra.c
r0fd9b35 r41deb2a 55 55 #include <synch/spinlock.h> 56 56 57 static slab_cache_t *ra_segment_cache; 58 57 59 #define USED_BUCKETS 1024 58 60 … … 90 92 ra_segment_t *seg; 91 93 92 seg = (ra_segment_t *) malloc(sizeof(ra_segment_t), FRAME_ATOMIC);94 seg = slab_alloc(ra_segment_cache, FRAME_ATOMIC); 93 95 if (!seg) 94 96 return NULL; … … 105 107 static void ra_segment_destroy(ra_segment_t *seg) 106 108 { 107 free(seg);109 slab_free(ra_segment_cache, seg); 108 110 } 109 111 … … 420 422 } 421 423 424 void ra_init(void) 425 { 426 ra_segment_cache = slab_cache_create("segment_cache", 427 sizeof(ra_segment_t), 0, NULL, NULL, SLAB_CACHE_MAGDEFERRED); 428 } 422 429 423 430 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.