src/share/vm/runtime/virtualspace.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-mmap Cdiff src/share/vm/runtime/virtualspace.cpp

src/share/vm/runtime/virtualspace.cpp

Print this page
rev 3899 : [mq]: mickes-originalpatch

*** 327,350 **** // Check alignment constraints if ((((size_t)base + noaccess_prefix) & (alignment - 1)) != 0) { // Base not aligned, retry if (!os::release_memory(base, size)) fatal("os::release_memory failed"); ! // Reserve size large enough to do manual alignment and ! // increase size to a multiple of the desired alignment ! size = align_size_up(size, alignment); ! size_t extra_size = size + alignment; ! do { ! char* extra_base = os::reserve_memory(extra_size, NULL, alignment); ! if (extra_base == NULL) return; ! // Do manual alignement ! base = (char*) align_size_up((uintptr_t) extra_base, alignment); ! assert(base >= extra_base, "just checking"); ! // Re-reserve the region at the aligned base address. ! os::release_memory(extra_base, extra_size); ! base = os::reserve_memory(size, base); ! } while (base == NULL); if (requested_address != 0 && failed_to_reserve_as_requested(base, requested_address, size, false)) { // As a result of the alignment constraints, the allocated base differs // from the requested address. Return back to the caller who can --- 327,337 ---- // Check alignment constraints if ((((size_t)base + noaccess_prefix) & (alignment - 1)) != 0) { // Base not aligned, retry if (!os::release_memory(base, size)) fatal("os::release_memory failed"); ! base = os::reserve_memory_aligned(size, alignment); if (requested_address != 0 && failed_to_reserve_as_requested(base, requested_address, size, false)) { // As a result of the alignment constraints, the allocated base differs // from the requested address. Return back to the caller who can
src/share/vm/runtime/virtualspace.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File