relabel purged slabs

pull/87/head
Daniel Micay 2019-03-23 22:59:59 -04:00
parent 178ec6e3f9
commit 64dfd23f7b
1 changed files with 2 additions and 0 deletions

View File

@ -689,6 +689,7 @@ static inline void deallocate_small(void *p, const size_t *expected_size) {
if (c->empty_slabs_total + slab_size > max_empty_slabs_total) { if (c->empty_slabs_total + slab_size > max_empty_slabs_total) {
if (!memory_map_fixed(slab, slab_size)) { if (!memory_map_fixed(slab, slab_size)) {
memory_set_name(slab, slab_size, size_class_labels[class]);
enqueue_free_slab(c, metadata); enqueue_free_slab(c, metadata);
mutex_unlock(&c->lock); mutex_unlock(&c->lock);
return; return;
@ -1509,6 +1510,7 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) {
if (memory_map_fixed(slab, slab_size)) { if (memory_map_fixed(slab, slab_size)) {
break; break;
} }
memory_set_name(slab, slab_size, size_class_labels[class]);
struct slab_metadata *trimmed = iterator; struct slab_metadata *trimmed = iterator;
iterator = iterator->next; iterator = iterator->next;