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
8316a779
Commit
8316a779
authored
Jan 05, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Jan 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Avoid HeapRealloc when no data need be copied.
parent
4654b3f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
15 deletions
+4
-15
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+2
-8
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+2
-7
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
8316a779
...
@@ -2029,10 +2029,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
...
@@ -2029,10 +2029,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
if
(
write_pos
+
frames
>
This
->
bufsize_frames
){
if
(
write_pos
+
frames
>
This
->
bufsize_frames
){
if
(
This
->
tmp_buffer_frames
<
frames
){
if
(
This
->
tmp_buffer_frames
<
frames
){
if
(
This
->
tmp_buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
);
This
->
tmp_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
,
frames
*
This
->
fmt
->
nBlockAlign
);
else
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
frames
*
This
->
fmt
->
nBlockAlign
);
frames
*
This
->
fmt
->
nBlockAlign
);
if
(
!
This
->
tmp_buffer
){
if
(
!
This
->
tmp_buffer
){
...
@@ -2184,10 +2181,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
...
@@ -2184,10 +2181,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
if
(
This
->
lcl_offs_frames
+
*
frames
>
This
->
bufsize_frames
){
if
(
This
->
lcl_offs_frames
+
*
frames
>
This
->
bufsize_frames
){
UINT32
chunk_bytes
,
offs_bytes
,
frames_bytes
;
UINT32
chunk_bytes
,
offs_bytes
,
frames_bytes
;
if
(
This
->
tmp_buffer_frames
<
*
frames
){
if
(
This
->
tmp_buffer_frames
<
*
frames
){
if
(
This
->
tmp_buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
);
This
->
tmp_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
,
*
frames
*
This
->
fmt
->
nBlockAlign
);
else
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
frames
*
This
->
fmt
->
nBlockAlign
);
*
frames
*
This
->
fmt
->
nBlockAlign
);
if
(
!
This
->
tmp_buffer
){
if
(
!
This
->
tmp_buffer
){
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
8316a779
...
@@ -1738,10 +1738,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
...
@@ -1738,10 +1738,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
(
This
->
lcl_offs_frames
+
This
->
held_frames
)
%
This
->
bufsize_frames
;
if
(
write_pos
+
frames
>
This
->
bufsize_frames
){
if
(
write_pos
+
frames
>
This
->
bufsize_frames
){
if
(
This
->
tmp_buffer_frames
<
frames
){
if
(
This
->
tmp_buffer_frames
<
frames
){
if
(
This
->
tmp_buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
);
This
->
tmp_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
,
frames
*
This
->
fmt
->
nBlockAlign
);
else
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
frames
*
This
->
fmt
->
nBlockAlign
);
frames
*
This
->
fmt
->
nBlockAlign
);
if
(
!
This
->
tmp_buffer
){
if
(
!
This
->
tmp_buffer
){
...
@@ -1922,9 +1919,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
...
@@ -1922,9 +1919,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
UINT32
chunk_bytes
,
offs_bytes
,
frames_bytes
;
UINT32
chunk_bytes
,
offs_bytes
,
frames_bytes
;
if
(
This
->
tmp_buffer_frames
<
*
frames
){
if
(
This
->
tmp_buffer_frames
<
*
frames
){
if
(
This
->
tmp_buffer
)
if
(
This
->
tmp_buffer
)
This
->
tmp_buffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
);
This
->
tmp_buffer
,
*
frames
*
This
->
fmt
->
nBlockAlign
);
else
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
tmp_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
frames
*
This
->
fmt
->
nBlockAlign
);
*
frames
*
This
->
fmt
->
nBlockAlign
);
if
(
!
This
->
tmp_buffer
){
if
(
!
This
->
tmp_buffer
){
...
...
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