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
d9889cfd
Commit
d9889cfd
authored
Nov 11, 2011
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Nov 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use VALGRIND_RESIZEINPLACE_BLOCK when available.
parent
5fc25686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
heap.c
dlls/ntdll/heap.c
+14
-9
No files found.
dlls/ntdll/heap.c
View file @
d9889cfd
...
...
@@ -263,6 +263,13 @@ static inline void notify_free( void const *ptr )
#endif
}
static
inline
void
notify_realloc
(
void
const
*
ptr
,
SIZE_T
size_old
,
SIZE_T
size_new
)
{
#ifdef VALGRIND_RESIZEINPLACE_BLOCK
VALGRIND_RESIZEINPLACE_BLOCK
(
ptr
,
size_old
,
size_new
,
0
);
#endif
}
static
void
subheap_notify_free_all
(
SUBHEAP
const
*
subheap
)
{
#ifdef VALGRIND_FREELIKE_BLOCK
...
...
@@ -753,6 +760,11 @@ static void *realloc_large_block( HEAP *heap, DWORD flags, void *ptr, SIZE_T siz
SIZE_T
unused
=
arena
->
block_size
-
sizeof
(
*
arena
)
-
size
;
/* FIXME: we could remap zero-pages instead */
#ifdef VALGRIND_RESIZEINPLACE_BLOCK
if
(
RUNNING_ON_VALGRIND
)
notify_realloc
(
arena
+
1
,
arena
->
data_size
,
size
);
else
#endif
if
(
size
>
arena
->
data_size
)
initialize_block
(
(
char
*
)
ptr
+
arena
->
data_size
,
size
-
arena
->
data_size
,
unused
,
flags
);
else
...
...
@@ -1844,11 +1856,8 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
list_remove
(
&
pFree
->
entry
);
pArena
->
size
+=
(
pFree
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
*
pFree
);
if
(
!
HEAP_Commit
(
subheap
,
pArena
,
rounded_size
))
goto
oom
;
notify_
free
(
pArena
+
1
);
notify_
realloc
(
pArena
+
1
,
oldActualSize
,
size
);
HEAP_ShrinkBlock
(
subheap
,
pArena
,
rounded_size
);
notify_alloc
(
pArena
+
1
,
size
,
FALSE
);
/* FIXME: this is wrong as we may lose old VBits settings */
mark_block_initialized
(
pArena
+
1
,
oldActualSize
);
}
else
/* Do it the hard way */
{
...
...
@@ -1883,12 +1892,8 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
}
else
{
/* Shrink the block */
notify_free
(
pArena
+
1
);
HEAP_ShrinkBlock
(
subheap
,
pArena
,
rounded_size
);
notify_alloc
(
pArena
+
1
,
size
,
FALSE
);
/* FIXME: this is wrong as we may lose old VBits settings */
mark_block_initialized
(
pArena
+
1
,
size
);
notify_realloc
(
pArena
+
1
,
oldActualSize
,
size
);
}
pArena
->
unused_bytes
=
(
pArena
->
size
&
ARENA_SIZE_MASK
)
-
size
;
...
...
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