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
59c4a32f
Commit
59c4a32f
authored
Nov 24, 1998
by
Stephen Crowley
Committed by
Alexandre Julliard
Nov 24, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return the "buffers" and "cached" memory as free since it is
deallocated when a program needs it anyway.
parent
2e120f88
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
global.c
memory/global.c
+8
-3
No files found.
memory/global.c
View file @
59c4a32f
...
@@ -1464,17 +1464,18 @@ VOID WINAPI GlobalMemoryStatus(
...
@@ -1464,17 +1464,18 @@ VOID WINAPI GlobalMemoryStatus(
if
(
f
)
if
(
f
)
{
{
char
buffer
[
256
];
char
buffer
[
256
];
int
total
,
used
,
free
;
int
total
,
used
,
free
,
shared
,
buffers
,
cached
;
lpmem
->
dwLength
=
sizeof
(
MEMORYSTATUS
);
lpmem
->
dwTotalPhys
=
lpmem
->
dwAvailPhys
=
0
;
lpmem
->
dwTotalPhys
=
lpmem
->
dwAvailPhys
=
0
;
lpmem
->
dwTotalPageFile
=
lpmem
->
dwAvailPageFile
=
0
;
lpmem
->
dwTotalPageFile
=
lpmem
->
dwAvailPageFile
=
0
;
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
f
))
while
(
fgets
(
buffer
,
sizeof
(
buffer
),
f
))
{
{
/* old style /proc/meminfo ... */
/* old style /proc/meminfo ... */
if
(
sscanf
(
buffer
,
"Mem: %d %d %d
"
,
&
total
,
&
used
,
&
free
))
if
(
sscanf
(
buffer
,
"Mem: %d %d %d
%d %d %d"
,
&
total
,
&
used
,
&
free
,
&
shared
,
&
buffers
,
&
cached
))
{
{
lpmem
->
dwTotalPhys
+=
total
;
lpmem
->
dwTotalPhys
+=
total
;
lpmem
->
dwAvailPhys
+=
free
;
lpmem
->
dwAvailPhys
+=
free
+
buffers
+
cached
;
}
}
if
(
sscanf
(
buffer
,
"Swap: %d %d %d"
,
&
total
,
&
used
,
&
free
))
if
(
sscanf
(
buffer
,
"Swap: %d %d %d"
,
&
total
,
&
used
,
&
free
))
{
{
...
@@ -1491,6 +1492,10 @@ VOID WINAPI GlobalMemoryStatus(
...
@@ -1491,6 +1492,10 @@ VOID WINAPI GlobalMemoryStatus(
lpmem
->
dwTotalPageFile
=
total
*
1024
;
lpmem
->
dwTotalPageFile
=
total
*
1024
;
if
(
sscanf
(
buffer
,
"SwapFree: %d"
,
&
free
))
if
(
sscanf
(
buffer
,
"SwapFree: %d"
,
&
free
))
lpmem
->
dwAvailPageFile
=
free
*
1024
;
lpmem
->
dwAvailPageFile
=
free
*
1024
;
if
(
sscanf
(
buffer
,
"Buffers: %d"
,
&
buffers
))
lpmem
->
dwAvailPhys
+=
buffers
*
1024
;
if
(
sscanf
(
buffer
,
"Cached: %d"
,
&
cached
))
lpmem
->
dwAvailPhys
+=
cached
*
1024
;
}
}
fclose
(
f
);
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