empty_slabs will remain a singly-linked list
parent
f94068ea63
commit
29df2429c2
7
malloc.c
7
malloc.c
|
@ -303,9 +303,6 @@ static inline void *slab_allocate(size_t requested_size) {
|
||||||
if (c->empty_slabs != NULL) {
|
if (c->empty_slabs != NULL) {
|
||||||
struct slab_metadata *metadata = c->empty_slabs;
|
struct slab_metadata *metadata = c->empty_slabs;
|
||||||
c->empty_slabs = c->empty_slabs->next;
|
c->empty_slabs = c->empty_slabs->next;
|
||||||
if (c->empty_slabs) {
|
|
||||||
c->empty_slabs->prev = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
metadata->next = c->partial_slabs;
|
metadata->next = c->partial_slabs;
|
||||||
metadata->prev = NULL;
|
metadata->prev = NULL;
|
||||||
|
@ -429,10 +426,6 @@ static inline void slab_free(void *p) {
|
||||||
|
|
||||||
metadata->next = c->empty_slabs;
|
metadata->next = c->empty_slabs;
|
||||||
metadata->prev = NULL;
|
metadata->prev = NULL;
|
||||||
|
|
||||||
if (c->empty_slabs) {
|
|
||||||
c->empty_slabs->prev = metadata;
|
|
||||||
}
|
|
||||||
c->empty_slabs = metadata;
|
c->empty_slabs = metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue