本文整理汇总了C++中GenCollectedHeap::last_incremental_collection_failed方法的典型用法代码示例。如果您正苦于以下问题:C++ GenCollectedHeap::last_incremental_collection_failed方法的具体用法?C++ GenCollectedHeap::last_incremental_collection_failed怎么用?C++ GenCollectedHeap::last_incremental_collection_failed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenCollectedHeap
的用法示例。
在下文中一共展示了GenCollectedHeap::last_incremental_collection_failed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: should_try_older_generation_allocation
// Return true if any of the following is true:
// . the allocation won't fit into the current young gen heap
// . gc locker is occupied (jni critical section)
// . heap memory is tight -- the most recent previous collection
// was a full collection because a partial collection (would
// have) failed and is likely to fail again
bool GenCollectorPolicy::should_try_older_generation_allocation(
size_t word_size) const {
GenCollectedHeap* gch = GenCollectedHeap::heap();
size_t gen0_capacity = gch->get_gen(0)->capacity_before_gc();
return (word_size > heap_word_size(gen0_capacity))
|| (GC_locker::is_active_and_needs_gc())
|| ( gch->last_incremental_collection_failed()
&& gch->incremental_collection_will_fail());
}