changeset 52920:100818c5ddd0

8215026: Incorrect amount of memory unmapped with ImageFileReader::close() Summary: Use map_size() instead of _index_size as the amount of memory to be unmapped while closing an image file Reviewed-by: alanb, jlaskey
author jgeorge
date Mon, 10 Dec 2018 19:08:24 +0530
parents ef9a34d58474
children f83b21839314
files src/java.base/share/native/libjimage/imageFile.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/native/libjimage/imageFile.cpp	Mon Dec 10 07:52:31 2018 -0500
+++ b/src/java.base/share/native/libjimage/imageFile.cpp	Mon Dec 10 19:08:24 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -428,7 +428,7 @@
 void ImageFileReader::close() {
     // Deallocate the index.
     if (_index_data) {
-        osSupport::unmap_memory((char*)_index_data, _index_size);
+        osSupport::unmap_memory((char*)_index_data, (size_t)map_size());
         _index_data = NULL;
     }
     // Close file.