class SoftRefPolicy { private: // Set to true when policy wants soft refs cleared. // Reset to false by gc after it clears all soft refs. bool _should_clear_all_soft_refs;
// Set to true by the GC if the just-completed gc cleared all // softrefs. This is set to true whenever a gc clears all softrefs, and // set to false each time gc returns to the mutator. For example, in the // ParallelScavengeHeap case the latter would be done toward the end of // mem_allocate() where it returns op.result() bool _all_soft_refs_clear;
// Called by the GC after Soft Refs have been cleared to indicate // that the request in _should_clear_all_soft_refs has been fulfilled. virtualvoid cleared_all_soft_refs();
};
class ClearedAllSoftRefs : public StackObj { bool _clear_all_soft_refs;
SoftRefPolicy* _soft_ref_policy; public:
ClearedAllSoftRefs(bool clear_all_soft_refs, SoftRefPolicy* soft_ref_policy) :
_clear_all_soft_refs(clear_all_soft_refs),
_soft_ref_policy(soft_ref_policy) {}
~ClearedAllSoftRefs() { if (_clear_all_soft_refs) {
_soft_ref_policy->cleared_all_soft_refs();
}
}
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.