// A very simple data structure representing a contiguous region // region of address space.
// Note that MemRegions are typically passed by value, not by reference. // The intent is that they remain very small and contain no // objects. The copy constructor and destructor must be trivial, // to support optimization for pass-by-value. // These should almost never be allocated in heap but we do // create MemRegions (in CardTable and G1CMRootMemRegions) on the heap so operator // new and operator new [] were added for these special cases.
class MemRegion { friendclass VMStructs; private:
HeapWord* _start;
size_t _word_size;
MemRegion intersection(const MemRegion mr2) const; // regions must overlap or be adjacent
MemRegion _union(const MemRegion mr2) const; // minus will fail a guarantee if mr2 is interior to this, // since there's no way to return 2 disjoint regions.
MemRegion minus(const MemRegion mr2) const;
// Creates and initializes an array of MemRegions of the given length. static MemRegion* create_array(size_t length, MEMFLAGS flags); staticvoid destroy_array(MemRegion* array, size_t length);
};
// For iteration over MemRegion's.
class MemRegionClosure : public StackObj { public: virtualvoid do_MemRegion(MemRegion mr) = 0;
};
// A ResourceObj version of MemRegionClosure
class MemRegionClosureRO: public MemRegionClosure { public: void* operatornew(size_t size) throw() { return resource_allocate_bytes(size);
}
voidoperatordelete(void* p) {} // nothing to do
};
#endif// SHARE_MEMORY_MEMREGION_HPP
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-05)
¤
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.