src/app/jdk/lib/jvm/os_genode.cpp
// If 'fixed' is true, anon_mmap() will attempt to reserve anonymous memory
// at 'requested_addr'. If there are existing memory mappings at the same
// location, however, they will be overwritten. If 'fixed' is false,
// 'requested_addr' is only treated as a hint, the return value may or
// may not start from the requested address. Unlike Bsd mmap(), this
// function returns NULL to indicate failure.
If 'fixed' is true, anon_mmap() will attempt to reserve anonymous memory
at 'requested_addr'. If there are existing memory mappings at the same
location, however, they will be overwritten. If 'fixed' is false,
'requested_addr' is only treated as a hint, the return value may or
may not start from the requested address. Unlike Bsd mmap(), this
function returns NULL to indicate failure.
If ' fixed ' is true anon_mmap () will attempt to reserve anonymous memory at ' requested_addr ' . If there are existing memory mappings at the same location however they will be overwritten . If ' fixed ' is false ' requested_addr ' is only treated as a hint the return value may or may not start from the requested address . Unlike Bsd mmap () this function returns NULL to indicate failure .
static char* anon_mmap(char* requested_addr, size_t bytes, bool fixed) {
  char * addr;
  int flags;
  flags = MAP_PRIVATE | MAP_ANONYMOUS;
  if (fixed) {
    assert((uintptr_t)requested_addr % os::Bsd::page_size() == 0, "unaligned address");
    flags |= MAP_FIXED;
  }
  addr = (char*)::mmap(requested_addr, bytes, PROT_NONE,
                       flags, -1, 0);
  return addr == MAP_FAILED ? NULL : addr;
}
static char * anon_mmap ( char * requested_addr , size_t bytes , bool fixed ) { char * addr ; int flags ; flags = MAP_PRIVATE | MAP_ANONYMOUS ; if ( fixed ) { assert ( ( uintptr_t ) requested_addr % os :: Bsd :: page_size ( ) == 0 , " " ) ; flags |= MAP_FIXED ; } addr = ( char * ) :: mmap ( requested_addr , bytes , PROT_NONE , flags , -1 , 0 ) ; return addr == MAP_FAILED ? NULL : addr ; }
If 'fixed' is true, anon_mmap() will attempt to reserve anonymous memory
at 'requested_addr'.
If ' fixed ' is true anon_mmap () will attempt to reserve anonymous memory at ' requested_addr ' .
// Map reserved/uncommitted pages PROT_NONE so we fail early if we // touch an uncommitted page. Otherwise, the read/write might // succeed if we have enough swap space to back the physical page.