X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpagealign_alloc.c;h=94a85fcf9ba256b70c4e73d7b8d92136f5abe759;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=337091dcaea8d5c30c71fb7c3be2c83bce2f1c47;hpb=3030c5b5e0a5199e16b05927da72c43c42f211c3;p=gnulib.git diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c index 337091dca..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, 2006, 2007, 2009 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;