/* * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// 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
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.