projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
canonicalize, canonicalize-lgpl: support MS-Windows file names
[gnulib.git]
/
lib
/
pagealign_alloc.c
diff --git
a/lib/pagealign_alloc.c
b/lib/pagealign_alloc.c
index
b40d960
..
01bb9e0
100644
(file)
--- a/
lib/pagealign_alloc.c
+++ b/
lib/pagealign_alloc.c
@@
-1,6
+1,6
@@
/* Memory allocation aligned to system page boundaries.
/* Memory allocation aligned to system page boundaries.
- Copyright (C) 2005-2007, 2009-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-201
2
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-123,6
+123,9
@@
void *
pagealign_alloc (size_t size)
{
void *ret;
pagealign_alloc (size_t size)
{
void *ret;
+ /* We prefer the mmap() approach over the posix_memalign() or malloc()
+ based approaches, since the latter often waste an entire memory page
+ per call. */
#if HAVE_MMAP
# ifdef HAVE_MAP_ANONYMOUS
const int fd = -1;
#if HAVE_MMAP
# ifdef HAVE_MAP_ANONYMOUS
const int fd = -1;