本文整理汇总了C++中SharedHeap::is_in_reserved_or_null方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedHeap::is_in_reserved_or_null方法的具体用法?C++ SharedHeap::is_in_reserved_or_null怎么用?C++ SharedHeap::is_in_reserved_or_null使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedHeap
的用法示例。
在下文中一共展示了SharedHeap::is_in_reserved_or_null方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doit
void VM_GenCollectForPermanentAllocation::doit() {
SvcGCMarker sgcm(SvcGCMarker::FULL);
SharedHeap* heap = (SharedHeap*)Universe::heap();
GCCauseSetter gccs(heap, _gc_cause);
switch (heap->kind()) {
case (CollectedHeap::GenCollectedHeap): {
GenCollectedHeap* gch = (GenCollectedHeap*)heap;
gch->do_full_collection(gch->must_clear_all_soft_refs(),
gch->n_gens() - 1);
break;
}
#ifndef SERIALGC
case (CollectedHeap::G1CollectedHeap): {
G1CollectedHeap* g1h = (G1CollectedHeap*)heap;
g1h->do_full_collection(_gc_cause == GCCause::_last_ditch_collection);
break;
}
#endif // SERIALGC
default:
ShouldNotReachHere();
}
_res = heap->perm_gen()->allocate(_size, false);
assert(heap->is_in_reserved_or_null(_res), "result not in heap");
if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}