namespace art HIDDEN { namespace mirror { class Object;
} // namespace mirror namespace gc { namespace space { class ContinuousSpace;
} // namespace space
namespace collector {
// An immune region is a continuous region of memory for which all objects contained are assumed to // be marked. This is used as an optimization in the GC to avoid needing to test the mark bitmap of // the zygote, image spaces, and sometimes non moving spaces. Doing the ContainsObject check is // faster than doing a bitmap read. There is no support for discontinuous spaces and you need to be // careful that your immune region doesn't contain any large objects. class ImmuneRegion { public:
ImmuneRegion();
void Reset();
// Returns true if an object is inside of the immune region (assumed to be marked).
ALWAYS_INLINE bool ContainsObject(const mirror::Object* obj) const { // Note: Relies on integer underflow behavior. returnreinterpret_cast<uintptr_t>(obj) - reinterpret_cast<uintptr_t>(begin_) < size_;
}
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.