X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpagealign_alloc.c;h=01bb9e092f84e44a8ae9e3d18a5c15c81c2233ef;hb=86627bb14a123f183bd094e582e4cd9f2aca489a;hp=b40d960df95aa56cf53975a1b4ea02b07ab24532;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c index b40d960df..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-2007, 2009-2011 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;