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
53b4c0f6
Commit
53b4c0f6
authored
Nov 08, 2005
by
Robert Lunnon
Committed by
Alexandre Julliard
Nov 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement GlobalMemoryStatusEx for Solaris.
parent
7ff49410
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
3 deletions
+40
-3
heap.c
dlls/kernel/heap.c
+40
-3
No files found.
dlls/kernel/heap.c
View file @
53b4c0f6
...
...
@@ -40,6 +40,16 @@
# include <unistd.h>
#endif
#ifdef sun
/* FIXME: Unfortunately swapctl can't be used with largefile.... */
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
# include <sys/resource.h>
# include <sys/stat.h>
# include <sys/swap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
...
...
@@ -1132,6 +1142,12 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
int
size_sys
;
int
mib
[
2
]
=
{
CTL_HW
};
#endif
#ifdef sun
long
pagesize
,
maxpages
,
freepages
,
swapspace
,
swapfree
;
struct
anoninfo
swapinf
;
int
rval
;
#endif
if
(
time
(
NULL
)
==
cache_lastchecked
)
{
memcpy
(
lpmemex
,
&
cached_memstatus
,
sizeof
(
*
lpmemex
));
return
TRUE
;
...
...
@@ -1200,9 +1216,9 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
if
(
tmp
&&
*
tmp
)
{
lpmemex
->
ullTotalPhys
=
*
tmp
;
free
(
tmp
);
mib
[
1
]
=
HW_USERMEM
;
sysctl
(
mib
,
2
,
NULL
,
&
size_sys
,
NULL
,
0
);
free
(
tmp
);
mib
[
1
]
=
HW_USERMEM
;
sysctl
(
mib
,
2
,
NULL
,
&
size_sys
,
NULL
,
0
);
tmp
=
malloc
(
size_sys
*
sizeof
(
int
));
sysctl
(
mib
,
2
,
tmp
,
&
size_sys
,
NULL
,
0
);
if
(
tmp
&&
*
tmp
)
...
...
@@ -1221,6 +1237,27 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
free
(
tmp
);
}
#elif defined ( sun )
pagesize
=
sysconf
(
_SC_PAGESIZE
);
maxpages
=
sysconf
(
_SC_PHYS_PAGES
);
freepages
=
sysconf
(
_SC_AVPHYS_PAGES
);
rval
=
swapctl
(
SC_AINFO
,
&
swapinf
);
if
(
rval
>-
1
)
{
swapspace
=
swapinf
.
ani_max
*
pagesize
;
swapfree
=
swapinf
.
ani_free
*
pagesize
;
}
else
{
WARN
(
"Swap size cannot be determined , assuming equal to physical memory
\n
"
);
swapspace
=
maxpages
*
pagesize
;
swapfree
=
maxpages
*
pagesize
;
}
lpmemex
->
ullTotalPhys
=
pagesize
*
maxpages
;
lpmemex
->
ullAvailPhys
=
pagesize
*
freepages
;
lpmemex
->
ullTotalPageFile
=
swapspace
;
lpmemex
->
ullAvailPageFile
=
swapfree
;
lpmemex
->
dwMemoryLoad
=
lpmemex
->
ullTotalPhys
-
lpmemex
->
ullAvailPhys
;
#endif
/* Project2k refuses to start if it sees less than 1Mb of free swap */
...
...
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