Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
73bd8d2b
Commit
73bd8d2b
authored
Sep 03, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Sep 03, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HEAP_Commit/Decommit were assuming a page size of 4KB
unconditionally.
parent
4e877163
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
heap.c
memory/heap.c
+4
-2
No files found.
memory/heap.c
View file @
73bd8d2b
...
...
@@ -263,7 +263,8 @@ static SUBHEAP *HEAP_FindSubHeap(
static
BOOL
HEAP_Commit
(
SUBHEAP
*
subheap
,
void
*
ptr
)
{
DWORD
size
=
(
DWORD
)((
char
*
)
ptr
-
(
char
*
)
subheap
);
size
=
(
size
+
0xfff
)
&
0xfffff000
;
/* Align size on a page boundary */
DWORD
pageMask
=
VIRTUAL_GetPageSize
()
-
1
;
size
=
(
size
+
pageMask
)
&
~
pageMask
;
/* Align size on a page boundary */
if
(
size
>
subheap
->
size
)
size
=
subheap
->
size
;
if
(
size
<=
subheap
->
commitSize
)
return
TRUE
;
if
(
!
VirtualAlloc
(
(
char
*
)
subheap
+
subheap
->
commitSize
,
...
...
@@ -289,7 +290,8 @@ static BOOL HEAP_Commit( SUBHEAP *subheap, void *ptr )
static
BOOL
HEAP_Decommit
(
SUBHEAP
*
subheap
,
void
*
ptr
)
{
DWORD
size
=
(
DWORD
)((
char
*
)
ptr
-
(
char
*
)
subheap
);
size
=
(
size
+
0xfff
)
&
0xfffff000
;
/* Align size on a page boundary */
DWORD
pageMask
=
VIRTUAL_GetPageSize
()
-
1
;
size
=
(
size
+
pageMask
)
&
~
pageMask
;
/* Align size on a page boundary */
if
(
size
>=
subheap
->
commitSize
)
return
TRUE
;
if
(
!
VirtualFree
(
(
char
*
)
subheap
+
size
,
subheap
->
commitSize
-
size
,
MEM_DECOMMIT
))
...
...
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