5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
27
28 #include "memory/virtualspace.hpp"
29
30 // VirtualSpace for the parallel scavenge collector.
31 //
32 // VirtualSpace is data structure for committing a previously reserved address
33 // range in smaller chunks.
34
35 class PSVirtualSpace : public CHeapObj<mtGC> {
36 friend class VMStructs;
37 protected:
38 // The space is committed/uncommitted in chunks of size _alignment. The
39 // ReservedSpace passed to initialize() must be aligned to this value.
40 const size_t _alignment;
41
42 // Reserved area
43 char* _reserved_low_addr;
44 char* _reserved_high_addr;
45
46 // Committed area
162
163 inline size_t PSVirtualSpace::uncommitted_size() const {
164 return reserved_size() - committed_size();
165 }
166
167 inline void PSVirtualSpace::set_reserved(char* low_addr, char* high_addr, bool special) {
168 _reserved_low_addr = low_addr;
169 _reserved_high_addr = high_addr;
170 _special = special;
171 }
172
173 inline void PSVirtualSpace::set_reserved(ReservedSpace rs) {
174 set_reserved(rs.base(), rs.base() + rs.size(), rs.special());
175 }
176
177 inline void PSVirtualSpace::set_committed(char* low_addr, char* high_addr) {
178 _committed_low_addr = low_addr;
179 _committed_high_addr = high_addr;
180 }
181
182 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_PARALLEL_PSVIRTUALSPACE_HPP
26 #define SHARE_VM_GC_PARALLEL_PSVIRTUALSPACE_HPP
27
28 #include "memory/virtualspace.hpp"
29
30 // VirtualSpace for the parallel scavenge collector.
31 //
32 // VirtualSpace is data structure for committing a previously reserved address
33 // range in smaller chunks.
34
35 class PSVirtualSpace : public CHeapObj<mtGC> {
36 friend class VMStructs;
37 protected:
38 // The space is committed/uncommitted in chunks of size _alignment. The
39 // ReservedSpace passed to initialize() must be aligned to this value.
40 const size_t _alignment;
41
42 // Reserved area
43 char* _reserved_low_addr;
44 char* _reserved_high_addr;
45
46 // Committed area
162
163 inline size_t PSVirtualSpace::uncommitted_size() const {
164 return reserved_size() - committed_size();
165 }
166
167 inline void PSVirtualSpace::set_reserved(char* low_addr, char* high_addr, bool special) {
168 _reserved_low_addr = low_addr;
169 _reserved_high_addr = high_addr;
170 _special = special;
171 }
172
173 inline void PSVirtualSpace::set_reserved(ReservedSpace rs) {
174 set_reserved(rs.base(), rs.base() + rs.size(), rs.special());
175 }
176
177 inline void PSVirtualSpace::set_committed(char* low_addr, char* high_addr) {
178 _committed_low_addr = low_addr;
179 _committed_high_addr = high_addr;
180 }
181
182 #endif // SHARE_VM_GC_PARALLEL_PSVIRTUALSPACE_HPP
|