Jinoh Kang (@iamahuman) commented about dlls/ntdll/heap.c:
- if (!(block_get_flags( block ) & BLOCK_FLAG_LFH)) return STATUS_UNSUCCESSFUL;
- bin = heap->bins + BLOCK_SIZE_BIN( block_size );
- if (bin == last) return STATUS_UNSUCCESSFUL;
- i = block_get_group_index( block );
- valgrind_make_writable( block, sizeof(*block) );
- block_set_type( block, BLOCK_TYPE_FREE );
- block_set_flags( block, ~BLOCK_FLAG_LFH, BLOCK_FLAG_FREE );
- mark_block_free( block + 1, (char *)block + block_size - (char *)(block + 1), flags );
- InterlockedOr( &group->free_bits, 1 << i );
- /* if this was the last used block in a group and GROUP_FLAG_FREE was set */
- if (!~ReadNoFence( &group->free_bits ))
There is no instance of `!~` as an operator sequence in Wine's C codebase. Wine just does `!= ~0` or `!= ~0u` instead.
```suggestion:-0+0 if (ReadNoFence( &group->free_bits ) == ~0) ```