ASAN unlock freelist in size_pool_add_page

This commit is contained in:
Peter Zhu 2024-09-09 10:55:18 -04:00
Родитель f2057277ea
Коммит 1205f17125
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -2050,14 +2050,15 @@ size_pool_add_page(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t
page->slot_size = size_pool->slot_size; page->slot_size = size_pool->slot_size;
page->size_pool = size_pool; page->size_pool = size_pool;
asan_unlock_freelist(page);
page->freelist = NULL; page->freelist = NULL;
for (VALUE p = (VALUE)start; p < start + (slot_count * size_pool->slot_size); p += size_pool->slot_size) { for (VALUE p = (VALUE)start; p < start + (slot_count * size_pool->slot_size); p += size_pool->slot_size) {
heap_page_add_freeobj(objspace, page, p); heap_page_add_freeobj(objspace, page, p);
} }
page->free_slots = slot_count;
asan_lock_freelist(page); asan_lock_freelist(page);
page->free_slots = slot_count;
size_pool->total_allocated_pages++; size_pool->total_allocated_pages++;
ccan_list_add_tail(&heap->pages, &page->page_node); ccan_list_add_tail(&heap->pages, &page->page_node);