129 return end() - top();
130 }
131
132 inline const ZPhysicalMemory& ZPage::physical_memory() const {
133 return _physical;
134 }
135
136 inline const ZVirtualMemory& ZPage::virtual_memory() const {
137 return _virtual;
138 }
139
140 inline uint8_t ZPage::numa_id() {
141 if (_numa_id == (uint8_t)-1) {
142 _numa_id = (uint8_t)ZNUMA::memory_id(ZAddress::good(start()));
143 }
144
145 return _numa_id;
146 }
147
148 inline bool ZPage::is_allocating() const {
149 return _seqnum == ZGlobalSeqNum;
150 }
151
152 inline bool ZPage::is_relocatable() const {
153 return _seqnum < ZGlobalSeqNum;
154 }
155
156 inline bool ZPage::is_mapped() const {
157 return _seqnum > 0;
158 }
159
160 inline void ZPage::set_pre_mapped() {
161 // The _seqnum variable is also used to signal that the virtual and physical
162 // memory has been mapped. So, we need to set it to non-zero when the memory
163 // has been pre-mapped.
164 _seqnum = 1;
165 }
166
167 inline uint64_t ZPage::last_used() const {
168 return _last_used;
169 }
|
129 return end() - top();
130 }
131
132 inline const ZPhysicalMemory& ZPage::physical_memory() const {
133 return _physical;
134 }
135
136 inline const ZVirtualMemory& ZPage::virtual_memory() const {
137 return _virtual;
138 }
139
140 inline uint8_t ZPage::numa_id() {
141 if (_numa_id == (uint8_t)-1) {
142 _numa_id = (uint8_t)ZNUMA::memory_id(ZAddress::good(start()));
143 }
144
145 return _numa_id;
146 }
147
148 inline bool ZPage::is_allocating() const {
149 return _seqnum >= ZGlobalSeqNum;
150 }
151
152 inline void ZPage::pin_allocating() {
153 _seqnum = (uint32_t)-1;
154 }
155
156 inline void ZPage::unpin_allocating() {
157 _seqnum = ZGlobalSeqNum;
158 }
159
160 inline bool ZPage::is_relocatable() const {
161 return _seqnum < ZGlobalSeqNum;
162 }
163
164 inline bool ZPage::is_mapped() const {
165 return _seqnum > 0;
166 }
167
168 inline void ZPage::set_pre_mapped() {
169 // The _seqnum variable is also used to signal that the virtual and physical
170 // memory has been mapped. So, we need to set it to non-zero when the memory
171 // has been pre-mapped.
172 _seqnum = 1;
173 }
174
175 inline uint64_t ZPage::last_used() const {
176 return _last_used;
177 }
|