mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-12 09:24:29 -05:00
empty_slabs will remain a singly-linked list
This commit is contained in:
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) {
|
||||
struct slab_metadata *metadata = c->empty_slabs;
|
||||
c->empty_slabs = c->empty_slabs->next;
|
||||
if (c->empty_slabs) {
|
||||
c->empty_slabs->prev = NULL;
|
||||
}
|
||||
|
||||
metadata->next = c->partial_slabs;
|
||||
metadata->prev = NULL;
|
||||
@ -429,10 +426,6 @@ static inline void slab_free(void *p) {
|
||||
|
||||
metadata->next = c->empty_slabs;
|
||||
metadata->prev = NULL;
|
||||
|
||||
if (c->empty_slabs) {
|
||||
c->empty_slabs->prev = metadata;
|
||||
}
|
||||
c->empty_slabs = metadata;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user