balloon.c
static void *lock_page(void) {
    void *p = mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
        MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, 0, 0);
    if (p == MAP_FAILED)
        return NULL;

    *((void**)p) = NULL;
    return p;
}
/* Allocate and pin a page in memory. Returns a pointer to the page or NULL on
 * failure.
 */
Allocate and pin a page in memory. Returns a pointer to the page or NULL on
failure.
Allocate and pin a page in memory . Returns a pointer to the page or NULL on failure .
static void *lock_page(void) {
    void *p = mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
        MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, 0, 0);
    if (p == MAP_FAILED)
        return NULL;
    *((void**)p) = NULL;
    return p;
}
static void * lock_page ( void ) { void * p = mmap ( NULL , getpagesize ( ) , PROT_READ | PROT_WRITE , MAP_PRIVATE | MAP_ANONYMOUS | MAP_LOCKED , 0 , 0 ) ; if ( p == MAP_FAILED ) return NULL ; * ( ( void * * ) p ) = NULL ; return p ; }
Allocate and pin a page in memory.
Allocate and pin a page in memory .