Changeset e72b0a3 in mainline
- Timestamp:
- 2006-02-04T21:34:04Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5158549
- Parents:
- 3260ada
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/slab.c
r3260ada re72b0a3 235 235 236 236 ASSERT(slab->cache == cache); 237 ASSERT(slab->available < cache->objects); 237 238 238 239 spinlock_lock(&cache->slablock); … … 243 244 244 245 /* Move it to correct list */ 245 if (slab->available == 1) {246 /* It was in full, move to partial */247 list_remove(&slab->link);248 list_prepend(&slab->link, &cache->partial_slabs);249 }250 246 if (slab->available == cache->objects) { 251 247 /* Free associated memory */ … … 255 251 * keep all locks */ 256 252 frames = slab_space_free(cache, slab); 253 } else if (slab->available == 1) { 254 /* It was in full, move to partial */ 255 list_remove(&slab->link); 256 list_prepend(&slab->link, &cache->partial_slabs); 257 257 } 258 258 … … 283 283 spinlock_unlock(&cache->slablock); 284 284 slab = slab_space_alloc(cache, flags); 285 if (!slab) 286 return NULL; 285 287 spinlock_lock(&cache->slablock); 286 if (!slab)287 goto err;288 288 } else { 289 289 slab = list_get_instance(cache->partial_slabs.next, … … 302 302 spinlock_unlock(&cache->slablock); 303 303 return obj; 304 err:305 spinlock_unlock(&cache->slablock);306 return NULL;307 304 } 308 305 -
test/mm/slab2/test.c
r3260ada re72b0a3 200 200 multitest(128); 201 201 multitest(2048); 202 multitest(8192); 202 203 printf("All done.\n"); 203 204 }
Note:
See TracChangeset
for help on using the changeset viewer.