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
fd7acb03
Commit
fd7acb03
authored
Mar 23, 2017
by
Alex Henrie
Committed by
Alexandre Julliard
Mar 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Simplify Linux implementation of GlobalMemoryStatusEx.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a83b5cdb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
27 deletions
+13
-27
heap.c
dlls/kernel32/heap.c
+13
-27
No files found.
dlls/kernel32/heap.c
View file @
fd7acb03
...
...
@@ -1200,38 +1200,24 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
if
(
f
)
{
char
buffer
[
256
];
unsigned
long
total
,
used
,
free
,
shared
,
buffers
,
cached
;
unsigned
long
value
;
lpmemex
->
ullTotalPhys
=
lpmemex
->
ullAvailPhys
=
0
;
lpmemex
->
ullTotalPageFile
=
lpmemex
->
ullAvailPageFile
=
0
;
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
f
))
{
/* old style /proc/meminfo ... */
if
(
sscanf
(
buffer
,
"Mem: %lu %lu %lu %lu %lu %lu"
,
&
total
,
&
used
,
&
free
,
&
shared
,
&
buffers
,
&
cached
))
{
lpmemex
->
ullTotalPhys
+=
total
;
lpmemex
->
ullAvailPhys
+=
free
+
buffers
+
cached
;
}
if
(
sscanf
(
buffer
,
"Swap: %lu %lu %lu"
,
&
total
,
&
used
,
&
free
))
{
lpmemex
->
ullTotalPageFile
+=
total
;
lpmemex
->
ullAvailPageFile
+=
free
;
}
/* new style /proc/meminfo ... */
if
(
sscanf
(
buffer
,
"MemTotal: %lu"
,
&
total
))
lpmemex
->
ullTotalPhys
=
(
ULONG64
)
total
*
1024
;
if
(
sscanf
(
buffer
,
"MemFree: %lu"
,
&
free
))
lpmemex
->
ullAvailPhys
=
(
ULONG64
)
free
*
1024
;
if
(
sscanf
(
buffer
,
"SwapTotal: %lu"
,
&
total
))
lpmemex
->
ullTotalPageFile
=
(
ULONG64
)
total
*
1024
;
if
(
sscanf
(
buffer
,
"SwapFree: %lu"
,
&
free
))
lpmemex
->
ullAvailPageFile
=
(
ULONG64
)
free
*
1024
;
if
(
sscanf
(
buffer
,
"Buffers: %lu"
,
&
buffers
))
lpmemex
->
ullAvailPhys
+=
(
ULONG64
)
buffers
*
1024
;
if
(
sscanf
(
buffer
,
"Cached: %lu"
,
&
cached
))
lpmemex
->
ullAvailPhys
+=
(
ULONG64
)
cached
*
1024
;
if
(
sscanf
(
buffer
,
"MemTotal: %lu"
,
&
value
))
lpmemex
->
ullTotalPhys
=
(
ULONG64
)
value
*
1024
;
else
if
(
sscanf
(
buffer
,
"MemFree: %lu"
,
&
value
))
lpmemex
->
ullAvailPhys
=
(
ULONG64
)
value
*
1024
;
else
if
(
sscanf
(
buffer
,
"SwapTotal: %lu"
,
&
value
))
lpmemex
->
ullTotalPageFile
=
(
ULONG64
)
value
*
1024
;
else
if
(
sscanf
(
buffer
,
"SwapFree: %lu"
,
&
value
))
lpmemex
->
ullAvailPageFile
=
(
ULONG64
)
value
*
1024
;
else
if
(
sscanf
(
buffer
,
"Buffers: %lu"
,
&
value
))
lpmemex
->
ullAvailPhys
+=
(
ULONG64
)
value
*
1024
;
else
if
(
sscanf
(
buffer
,
"Cached: %lu"
,
&
value
))
lpmemex
->
ullAvailPhys
+=
(
ULONG64
)
value
*
1024
;
}
fclose
(
f
);
}
...
...
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