[PATCH 6/6] ntdll: Store the block size directly in block headers.
Rémi Bernon
wine at gitlab.winehq.org
Wed May 25 03:00:02 CDT 2022
From: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/ntdll/heap.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index ac0f14646c4..1b6337d4ce8 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -253,17 +253,11 @@ static inline UINT block_get_overhead( const struct block *block )
/* return the size of a block, including its header */
static inline UINT block_get_size( const struct block *block )
{
- UINT data_size = block->size & ARENA_SIZE_MASK, size = data_size;
- if (block_get_flags( block ) & ARENA_FLAG_FREE) size += sizeof(struct entry);
- else size += sizeof(*block);
- if (size < data_size) return ~0u;
- return size;
+ return block->size & ARENA_SIZE_MASK;
}
static inline void block_set_size( struct block *block, UINT flags, UINT block_size )
{
- if (flags & ARENA_FLAG_FREE) block_size -= sizeof(struct entry);
- else block_size -= sizeof(*block);
block->size = (block_size & ARENA_SIZE_MASK) | (flags & ~ARENA_SIZE_MASK);
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/128
More information about the wine-devel
mailing list