Print this page
rev 4525 : 8014611: reserve_and_align() assumptions are invalid on windows
Summary: also reviewed by ron.durbin@oracle.com, thomas.schatzl@oracle.com
Reviewed-by: dcubed, brutisso

Split Split Close
Expand all
Collapse all
          --- old/src/os/windows/vm/os_windows.cpp
          +++ new/src/os/windows/vm/os_windows.cpp
↓ open down ↓ 2963 lines elided ↑ open up ↑
2964 2964      release_memory(base, size);
2965 2965      if (realloc) {
2966 2966        reserve_memory(split, base);
2967 2967      }
2968 2968      if (size != split) {
2969 2969        reserve_memory(size - split, base + split);
2970 2970      }
2971 2971    }
2972 2972  }
2973 2973  
     2974 +bool os::can_release_partial_region() {
     2975 +  return false;
     2976 +}
     2977 +
2974 2978  // Multiple threads can race in this code but it's not possible to unmap small sections of
2975 2979  // virtual space to get requested alignment, like posix-like os's.
2976 2980  // Windows prevents multiple thread from remapping over each other so this loop is thread-safe.
2977 2981  char* os::reserve_memory_aligned(size_t size, size_t alignment) {
2978 2982    assert((alignment & (os::vm_allocation_granularity() - 1)) == 0,
2979 2983        "Alignment must be a multiple of allocation granularity (page size)");
2980 2984    assert((size & (alignment -1)) == 0, "size must be 'alignment' aligned");
2981 2985  
2982 2986    size_t extra_size = size + alignment;
2983 2987    assert(extra_size >= size, "overflow, size is too large to allow alignment");
↓ open down ↓ 2513 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX