/*
* 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.
*
*/
{
}
{
}
}
template <class E, MEMFLAGS F>
{
reset(true);
}
template <class E, MEMFLAGS F>
{
if (this->_cur_seg_size == this->_seg_size) {
push_segment();
}
++this->_cur_seg_size;
}
template <class E, MEMFLAGS F>
{
if (this->_cur_seg_size == 1) {
pop_segment();
return tmp;
}
return this->_cur_seg[--this->_cur_seg_size];
}
template <class E, MEMFLAGS F>
{
}
template <class E, MEMFLAGS F>
{
// Number of elements that fit in 4K bytes minus the size of two pointers
// (link field and malloc header).
return (4096 - 2 * sizeof(E*)) / sizeof(E);
}
template <class E, MEMFLAGS F>
{
}
return seg_size;
}
template <class E, MEMFLAGS F>
{
return align_size_up(this->_seg_size * sizeof(E), sizeof(E*));
}
template <class E, MEMFLAGS F>
{
return link_offset() + sizeof(E*);
}
template <class E, MEMFLAGS F>
{
return (E**) ((char*)seg + link_offset());
}
template <class E, MEMFLAGS F>
{
}
template <class E, MEMFLAGS F>
{
return new_seg;
}
template <class E, MEMFLAGS F>
{
return (E*) NEW_C_HEAP_ARRAY(char, bytes, F);
}
template <class E, MEMFLAGS F>
{
FREE_C_HEAP_ARRAY(char, (char*) addr, F);
}
template <class E, MEMFLAGS F>
{
E* next;
if (this->_cache_size > 0) {
// Use a cached segment.
--this->_cache_size;
} else {
}
this->_cur_seg_size = 0;
}
template <class E, MEMFLAGS F>
{
if (this->_cache_size < this->_max_cache_size) {
// Add the current segment to the cache.
++this->_cache_size;
} else {
}
this->_cur_seg_size = this->_seg_size;
}
template <class E, MEMFLAGS F>
{
}
}
template <class E, MEMFLAGS F>
{
this->_full_seg_size = 0;
if (reset_cache) {
this->_cache_size = 0;
}
}
#ifdef ASSERT
template <class E, MEMFLAGS F>
{
if (is_empty()) {
}
}
template <class E, MEMFLAGS F>
{
if (!ZapStackSegments) return;
*cur++ = 0xfadfaded;
}
}
#endif
template <class E, MEMFLAGS F>
{
return (E*) resource_allocate_bytes(bytes);
}
template <class E, MEMFLAGS F>
{
}
template <class E, MEMFLAGS F>
{
}
template <class E, MEMFLAGS F>
{
if (_cur_seg_size == 1) {
return addr;
}
return _cur_seg + --_cur_seg_size;
}
#endif // SHARE_VM_UTILITIES_STACK_INLINE_HPP