74 size_t alignment() const { return _alignment; }
75 char* reserved_low_addr() const { return _reserved_low_addr; }
76 char* reserved_high_addr() const { return _reserved_high_addr; }
77 char* committed_low_addr() const { return _committed_low_addr; }
78 char* committed_high_addr() const { return _committed_high_addr; }
79 bool special() const { return _special; }
80
81 inline size_t committed_size() const;
82 inline size_t reserved_size() const;
83 inline size_t uncommitted_size() const;
84
85 // Operations.
86 inline void set_reserved(char* low_addr, char* high_addr, bool special);
87 inline void set_reserved(ReservedSpace rs);
88 inline void set_committed(char* low_addr, char* high_addr);
89 virtual bool expand_by(size_t bytes);
90 virtual bool shrink_by(size_t bytes);
91 virtual size_t expand_into(PSVirtualSpace* space, size_t bytes);
92 void release();
93
94 #ifndef PRODUCT
95 // Debugging
96 static bool is_aligned(size_t val, size_t align);
97 bool is_aligned(size_t val) const;
98 bool is_aligned(char* val) const;
99 void verify() const;
100 virtual bool grows_up() const { return true; }
101 bool grows_down() const { return !grows_up(); }
102
103 // Helper class to verify a space when entering/leaving a block.
104 class PSVirtualSpaceVerifier: public StackObj {
105 private:
106 const PSVirtualSpace* const _space;
107 public:
108 PSVirtualSpaceVerifier(PSVirtualSpace* space): _space(space) {
109 _space->verify();
110 }
111 ~PSVirtualSpaceVerifier() { _space->verify(); }
112 };
113 #endif
|
74 size_t alignment() const { return _alignment; }
75 char* reserved_low_addr() const { return _reserved_low_addr; }
76 char* reserved_high_addr() const { return _reserved_high_addr; }
77 char* committed_low_addr() const { return _committed_low_addr; }
78 char* committed_high_addr() const { return _committed_high_addr; }
79 bool special() const { return _special; }
80
81 inline size_t committed_size() const;
82 inline size_t reserved_size() const;
83 inline size_t uncommitted_size() const;
84
85 // Operations.
86 inline void set_reserved(char* low_addr, char* high_addr, bool special);
87 inline void set_reserved(ReservedSpace rs);
88 inline void set_committed(char* low_addr, char* high_addr);
89 virtual bool expand_by(size_t bytes);
90 virtual bool shrink_by(size_t bytes);
91 virtual size_t expand_into(PSVirtualSpace* space, size_t bytes);
92 void release();
93
94 // NVDIMM versions to manage expansion/shrinking
95 bool expand_by(size_t bytes, int fd);
96 size_t expand_into(PSVirtualSpace* space, size_t bytes, int fd);
97
98 #ifndef PRODUCT
99 // Debugging
100 static bool is_aligned(size_t val, size_t align);
101 bool is_aligned(size_t val) const;
102 bool is_aligned(char* val) const;
103 void verify() const;
104 virtual bool grows_up() const { return true; }
105 bool grows_down() const { return !grows_up(); }
106
107 // Helper class to verify a space when entering/leaving a block.
108 class PSVirtualSpaceVerifier: public StackObj {
109 private:
110 const PSVirtualSpace* const _space;
111 public:
112 PSVirtualSpaceVerifier(PSVirtualSpace* space): _space(space) {
113 _space->verify();
114 }
115 ~PSVirtualSpaceVerifier() { _space->verify(); }
116 };
117 #endif
|