--- a/hotspot/src/share/vm/runtime/virtualspace.hpp Wed Jul 05 16:39:00 2017 +0200
+++ b/hotspot/src/share/vm/runtime/virtualspace.hpp Sat Jul 19 17:38:22 2008 -0400
@@ -29,13 +29,15 @@
private:
char* _base;
size_t _size;
+ size_t _noaccess_prefix;
size_t _alignment;
bool _special;
// ReservedSpace
ReservedSpace(char* base, size_t size, size_t alignment, bool special);
void initialize(size_t size, size_t alignment, bool large,
- char* requested_address = NULL);
+ char* requested_address,
+ const size_t noaccess_prefix);
// Release parts of an already-reserved memory region [addr, addr + len) to
// get a new region that has "compound alignment." Return the start of the
@@ -59,13 +61,19 @@
const size_t suffix_size,
const size_t suffix_align);
+ protected:
+ // Create protection page at the beginning of the space.
+ void protect_noaccess_prefix(const size_t size);
+
public:
// Constructor
ReservedSpace(size_t size);
ReservedSpace(size_t size, size_t alignment, bool large,
- char* requested_address = NULL);
+ char* requested_address = NULL,
+ const size_t noaccess_prefix = 0);
ReservedSpace(const size_t prefix_size, const size_t prefix_align,
- const size_t suffix_size, const size_t suffix_align);
+ const size_t suffix_size, const size_t suffix_align,
+ const size_t noaccess_prefix);
// Accessors
char* base() const { return _base; }
@@ -73,6 +81,8 @@
size_t alignment() const { return _alignment; }
bool special() const { return _special; }
+ size_t noaccess_prefix() const { return _noaccess_prefix; }
+
bool is_reserved() const { return _base != NULL; }
void release();
@@ -104,6 +114,16 @@
return last_part(partition_size, alignment());
}
+// Class encapsulating behavior specific of memory space reserved for Java heap
+class ReservedHeapSpace : public ReservedSpace {
+public:
+ // Constructor
+ ReservedHeapSpace(size_t size, size_t forced_base_alignment,
+ bool large, char* requested_address);
+ ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
+ const size_t suffix_size, const size_t suffix_align);
+};
+
// VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
class VirtualSpace VALUE_OBJ_CLASS_SPEC {