本文整理汇总了C++中osmium::memory::Buffer::purge_removed方法的典型用法代码示例。如果您正苦于以下问题:C++ Buffer::purge_removed方法的具体用法?C++ Buffer::purge_removed怎么用?C++ Buffer::purge_removed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osmium::memory::Buffer
的用法示例。
在下文中一共展示了Buffer::purge_removed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: possibly_purge_removed_members
/**
* Decide whether to purge removed members and then do it.
*
* Currently the purging is done every thousand calls.
* This could probably be improved upon.
*/
void possibly_purge_removed_members() {
++m_count_complete;
if (m_count_complete > 10000) { // XXX
const size_t size_before = m_members_buffer.committed();
m_members_buffer.purge_removed(this);
const size_t size_after = m_members_buffer.committed();
double percent = static_cast<double>(size_before - size_after);
percent /= size_before;
percent *= 100;
std::cerr << "PURGE (size before=" << size_before << " after=" << size_after << " purged=" << (size_before - size_after) << " / " << static_cast<int>(percent) << "%)\n";
m_count_complete = 0;
}
}