Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2b97a064
Commit
2b97a064
authored
Jan 08, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use sysconf() instead of getpagesize().
parent
a81996d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
32 deletions
+3
-32
mapping.c
server/mapping.c
+3
-32
No files found.
server/mapping.c
View file @
2b97a064
...
...
@@ -108,36 +108,7 @@ static const struct fd_ops mapping_fd_ops =
static
struct
list
shared_list
=
LIST_INIT
(
shared_list
);
#ifdef __i386__
/* These are always the same on an i386, and it will be faster this way */
# define page_mask 0xfff
# define page_shift 12
# define init_page_size() do {
/* nothing */
} while(0)
#else
/* __i386__ */
static
int
page_shift
,
page_mask
;
static
void
init_page_size
(
void
)
{
int
page_size
;
# ifdef HAVE_GETPAGESIZE
page_size
=
getpagesize
();
# else
# ifdef __svr4__
page_size
=
sysconf
(
_SC_PAGESIZE
);
# else
# error Cannot get the page size on this platform
# endif
# endif
page_mask
=
page_size
-
1
;
/* Make sure we have a power of 2 */
assert
(
!
(
page_size
&
page_mask
)
);
page_shift
=
0
;
while
((
1
<<
page_shift
)
!=
page_size
)
page_shift
++
;
}
#endif
/* __i386__ */
static
size_t
page_mask
;
#define ROUND_SIZE(size) (((size) + page_mask) & ~page_mask)
...
...
@@ -474,7 +445,7 @@ static struct object *create_mapping( struct directory *root, const struct unico
int
unix_fd
;
struct
stat
st
;
if
(
!
page_mask
)
init_page_size
()
;
if
(
!
page_mask
)
page_mask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
if
(
!
(
mapping
=
create_named_object_dir
(
root
,
name
,
attr
,
&
mapping_ops
)))
return
NULL
;
...
...
@@ -647,7 +618,7 @@ static enum server_fd_type mapping_get_fd_type( struct fd *fd )
int
get_page_size
(
void
)
{
if
(
!
page_mask
)
init_page_size
()
;
if
(
!
page_mask
)
page_mask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
return
page_mask
+
1
;
}
...
...
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