adjoiningVirtualSpaces.hpp revision 1472
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*
*/
// Contains two virtual spaces that each can individually span
// most of the reserved region but committed parts of which
// cannot overlap.
//
// +-------+ <--- high_boundary for H
// | |
// | H |
// | |
// | |
// | |
// --------- <--- low for H
// | |
// ========= <--- low_boundary for H, high_boundary for L
// | |
// | |
// | |
// --------- <--- high for L
// | |
// | L |
// | |
// | |
// | |
// +-------+ <--- low_boundary for L
//
// Each virtual space in the AdjoiningVirtualSpaces grows and shrink
// within its reserved region (between the low_boundary and the
// boundary) independently. If L want to grow above its high_boundary,
// then the high_boundary of L and the low_boundary of H must be
// moved up consistently. AdjoiningVirtualSpaces provide the
// interfaces for moving the this boundary.
class AdjoiningVirtualSpaces {
// space at the high end and the low end, respectively
// The reserved space spanned by the two spaces.
// The minimum byte size for the low space. It will not
// be shrunk below this value.
// Same for the high space
const size_t _alignment;
public:
// Allocates two virtual spaces that will be located at the
// high and low ends. Does no initialization.
// accessors
// move boundary between the two spaces up
// and down
// Maximum byte size for the high space.
}
// Maximum byte size for the low space.
}
// Sets the boundaries for the virtual spaces and commits and
// initial size;
};