X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpagealign_alloc.c;h=01bb9e092f84e44a8ae9e3d18a5c15c81c2233ef;hb=dd5c6076e60de0237ab75d5a3a77070231d6c0fd;hp=8aefea3f97fe3dd5d3b21693dbff158c12449b07;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c index 8aefea3f9..01bb9e092 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, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2012 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;