本文整理汇总了C++中FixedArray::purge方法的典型用法代码示例。如果您正苦于以下问题:C++ FixedArray::purge方法的具体用法?C++ FixedArray::purge怎么用?C++ FixedArray::purge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FixedArray
的用法示例。
在下文中一共展示了FixedArray::purge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startup
virtual kernel::ApplicationResult startup( kernel::Params & params )
{
#if 0
printf( "Memory Test: \n" );
Test * a = CREATE(Test);
std::vector<int, GeminiAllocator<int> > int_vector;
int_vector.push_back( 30 );
int_vector.push_back( 16 );
int_vector.push_back( 31 );
typedef std::map<int, int, std::less<int>, GeminiAllocator<int> > MyMap;
MyMap int_map;
int_map.insert( MyMap::value_type( 30, 17 ) );
int_map.insert( MyMap::value_type( 16, 100) );
int_map.insert( MyMap::value_type( 300, 2 ) );
// Test FixedArray - which should cause derived destructors
// to be called as well as the BaseObject's destructors.
FixedArray<BaseObject> objects;
objects.allocate(3);
for( size_t i = 0; i < 3; ++i )
{
objects[i] = CREATE(DerivedObject);
objects[i]->type = i+4;
}
objects.purge();#
// added z-modifer to satisfy Xcode, C99 addition, we'll see who doesn't support it :)
printf( "totalAllocations: %zu, totalBytes: %zu\n", memory::allocator().total_allocations(), memory::allocator().total_bytes() );
printf( "activeAllocations: %zu, activeBytes: %zu\n", memory::allocator().active_allocations(), memory::allocator().active_bytes() );
DESTROY(Test, a);
printf( "activeAllocations: %zu, activeBytes: %zu\n", memory::allocator().active_allocations(), memory::allocator().active_bytes() );
#endif
PooledObject * p = new DerivedPoolObject();
delete p;
return kernel::Application_NoWindow;
}