[Dropping libvir-list]

Peter O'Gorman wrote:
> Many of these systems have valloc(3) which could be used for this purpose.

Yes, but gnulib's pagealign_alloc() function is less wasteful that the
valloc() function that some systems have. E.g. in OpenBSD:

void *
valloc(size_t i)
{
        long valsiz = getpagesize(), j;
        void *cp = malloc(i + (valsiz-1));

        j = ((long)cp + (valsiz-1)) &~ (valsiz-1);
        return ((void *)j);
}

This implementation nearly always wastes an entire page of memory.

Bruno
-- 
In memoriam Valentín Elizalde <http://en.wikipedia.org/wiki/Valentín_Elizalde>

Reply via email to