Zebediah Figura (@zfigura) commented about dlls/ntdll/heap.c:
if (ROUND_SIZE( *old_size, BLOCK_ALIGN - 1) != ROUND_SIZE( size, BLOCK_ALIGN - 1)) return STATUS_NO_MEMORY; if (size >= *old_size) return STATUS_NO_MEMORY;
- heap_lock( heap, flags ); - block_set_flags( block, BLOCK_FLAG_USER_MASK & ~BLOCK_FLAG_USER_INFO, BLOCK_USER_FLAGS( flags ) ); block->tail_size = old_block_size - sizeof(*block) - size; initialize_block( block, *old_size, size, flags ); mark_block_tail( block, flags );
- heap_unlock( heap, flags ); -
Why did this have locks to begin with? What are they protecting? (Concurrent access to this block, I guess, but that seems like it's a meaningless race, right?) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1628#note_22681