inline jlong Thread::cooked_allocated_bytes() {
jlong allocated_bytes = Atomic::load_acquire(&_allocated_bytes); if (UseTLAB) { // These reads are unsynchronized and unordered with the thread updating its tlab pointers. // Use only if top > start && used_bytes <= max_tlab_size_bytes. const HeapWord* const top = tlab().top_relaxed(); const HeapWord* const start = tlab().start_relaxed(); if (top <= start) { return allocated_bytes;
} const size_t used_bytes = pointer_delta(top, start, 1); if (used_bytes <= ThreadLocalAllocBuffer::max_size_in_bytes()) { // Comparing used_bytes with the maximum allowed size will ensure // that we don't add the used bytes from a semi-initialized TLAB // ending up with incorrect values. There is still a race between // incrementing _allocated_bytes and clearing the TLAB, that might // cause double counting in rare cases. return allocated_bytes + used_bytes;
}
} return allocated_bytes;
}
#ifdefined(__APPLE__) && defined(AARCH64) inlinevoid Thread::init_wx() {
assert(this == Thread::current(), "should only be called for current thread");
assert(!_wx_init, "second init");
_wx_state = WXWrite;
os::current_thread_enable_wx(_wx_state);
DEBUG_ONLY(_wx_init = true);
}
inline WXMode Thread::enable_wx(WXMode new_state) {
assert(this == Thread::current(), "should only be called for current thread");
assert(_wx_init, "should be inited");
WXMode old = _wx_state; if (_wx_state != new_state) {
_wx_state = new_state;
os::current_thread_enable_wx(new_state);
} return old;
} #endif// __APPLE__ && AARCH64
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.