X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpagealign_alloc.c;h=94a85fcf9ba256b70c4e73d7b8d92136f5abe759;hb=458c944ddbb41cd6ba34416db2867eb6f17bf61a;hp=b40d960df95aa56cf53975a1b4ea02b07ab24532;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c index b40d960df..94a85fcf9 100644 --- a/lib/pagealign_alloc.c +++ b/lib/pagealign_alloc.c @@ -1,6 +1,6 @@ /* Memory allocation aligned to system page boundaries. - Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2014 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 @@ -123,6 +123,9 @@ void * 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;