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
95df19ef
Commit
95df19ef
authored
Feb 16, 2014
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Prefer HW_MEMSIZE sysctl variable over HW_PHYSMEM, if available, since it's 64 bits.
parent
69531892
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
heap.c
dlls/kernel32/heap.c
+24
-4
No files found.
dlls/kernel32/heap.c
View file @
95df19ef
...
...
@@ -1147,6 +1147,7 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
#ifdef linux
FILE
*
f
;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
DWORDLONG
total
;
#ifdef __APPLE__
unsigned
int
val
;
#else
...
...
@@ -1154,6 +1155,9 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
#endif
int
mib
[
2
];
size_t
size_sys
;
#ifdef HW_MEMSIZE
uint64_t
val64
;
#endif
#elif defined(sun)
unsigned
long
pagesize
,
maxpages
,
freepages
,
swapspace
,
swapfree
;
struct
anoninfo
swapinf
;
...
...
@@ -1219,11 +1223,27 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
fclose
(
f
);
}
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
total
=
0
;
mib
[
0
]
=
CTL_HW
;
mib
[
1
]
=
HW_PHYSMEM
;
size_sys
=
sizeof
(
val
);
if
(
!
sysctl
(
mib
,
2
,
&
val
,
&
size_sys
,
NULL
,
0
)
&&
size_sys
==
sizeof
(
val
)
&&
val
)
lpmemex
->
ullTotalPhys
=
val
;
#ifdef HW_MEMSIZE
mib
[
1
]
=
HW_MEMSIZE
;
size_sys
=
sizeof
(
val64
);
if
(
!
sysctl
(
mib
,
2
,
&
val64
,
&
size_sys
,
NULL
,
0
)
&&
size_sys
==
sizeof
(
val64
)
&&
val64
)
total
=
val64
;
#endif
if
(
!
total
)
{
mib
[
1
]
=
HW_PHYSMEM
;
size_sys
=
sizeof
(
val
);
if
(
!
sysctl
(
mib
,
2
,
&
val
,
&
size_sys
,
NULL
,
0
)
&&
size_sys
==
sizeof
(
val
)
&&
val
)
total
=
val
;
}
if
(
total
)
lpmemex
->
ullTotalPhys
=
total
;
mib
[
1
]
=
HW_USERMEM
;
size_sys
=
sizeof
(
val
);
if
(
!
sysctl
(
mib
,
2
,
&
val
,
&
size_sys
,
NULL
,
0
)
&&
size_sys
==
sizeof
(
val
)
&&
val
)
...
...
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