Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
476324e8
Commit
476324e8
authored
Jun 25, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Compute the free lists address at run-time instead of playing with alignment and padding.
parent
edebc2b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
heap.c
dlls/ntdll/heap.c
+5
-4
No files found.
dlls/ntdll/heap.c
View file @
476324e8
...
...
@@ -91,6 +91,8 @@ typedef struct
#define LARGE_ALIGNMENT 16
/* large blocks have stricter alignment */
#define ARENA_OFFSET (ALIGNMENT - sizeof(ARENA_INUSE))
C_ASSERT
(
sizeof
(
ARENA_LARGE
)
%
LARGE_ALIGNMENT
==
0
);
#define ROUND_SIZE(size) ((((size) + ALIGNMENT - 1) & ~(ALIGNMENT-1)) + ARENA_OFFSET)
#define QUIET 1
/* Suppress messages */
...
...
@@ -144,7 +146,7 @@ typedef struct tagHEAP
SIZE_T
grow_size
;
/* Size of next subheap for growing heap */
DWORD
magic
;
/* Magic number */
RTL_CRITICAL_SECTION
critSection
;
/* Critical section for serialization */
FREE_LIST_ENTRY
freeList
[
HEAP_NB_FREE_LISTS
]
DECLSPEC_ALIGN
(
8
);
/* Free lists */
FREE_LIST_ENTRY
*
freeList
;
/* Free lists */
}
HEAP
;
#define HEAP_MAGIC ((DWORD)('H' | ('E'<<8) | ('A'<<16) | ('P'<<24)))
...
...
@@ -824,6 +826,8 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
/* Build the free lists */
heap
->
freeList
=
(
FREE_LIST_ENTRY
*
)((
char
*
)
heap
+
subheap
->
headerSize
);
subheap
->
headerSize
+=
HEAP_NB_FREE_LISTS
*
sizeof
(
FREE_LIST_ENTRY
);
list_init
(
&
heap
->
freeList
[
0
].
arena
.
entry
);
for
(
i
=
0
,
pEntry
=
heap
->
freeList
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
,
pEntry
++
)
{
...
...
@@ -1261,9 +1265,6 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
{
processHeap
=
subheap
->
heap
;
/* assume the first heap we create is the process main heap */
list_init
(
&
processHeap
->
entry
);
/* make sure structure alignment is correct */
assert
(
(
ULONG_PTR
)
processHeap
->
freeList
%
ALIGNMENT
==
ARENA_OFFSET
);
assert
(
sizeof
(
ARENA_LARGE
)
%
LARGE_ALIGNMENT
==
0
);
}
return
subheap
->
heap
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment