src/hotspot/share/memory/heap.hpp
changeset 47688 3d1e3786d66e
parent 47216 71c04702a3d5
child 47768 3d1d05c9b6cd
--- a/src/hotspot/share/memory/heap.hpp	Sun Oct 15 22:54:03 2017 +0200
+++ b/src/hotspot/share/memory/heap.hpp	Mon Sep 04 19:50:01 2017 +0200
@@ -147,6 +147,12 @@
   // Memory allocation
   void* allocate (size_t size); // Allocate 'size' bytes in the code cache or return NULL
   void  deallocate(void* p);    // Deallocate memory
+  // Free the tail of segments allocated by the last call to 'allocate()' which exceed 'used_size'.
+  // ATTENTION: this is only safe to use if there was no other call to 'allocate()' after
+  //            'p' was allocated. Only intended for freeing memory which would be otherwise
+  //            wasted after the interpreter generation because we don't know the interpreter size
+  //            beforehand and we also can't easily relocate the interpreter to a new location.
+  void  deallocate_tail(void* p, size_t used_size);
 
   // Attributes
   char* low_boundary() const                     { return _memory.low_boundary(); }