WinDBG/Exts/CodeAnalyzer/gdbplus/gdb-1824/src/gdb/segment.c
/////////////////////////////////////////////////////////
// Dismantle all segments previously built
// but keep the buffer for reuse
/////////////////////////////////////////////////////////
Dismantle all segments previously built
but keep the buffer for reuse
Dismantle all segments previously built but keep the buffer for reuse
CA_BOOL release_all_segments(void)
{
	unsigned int i;
	struct ca_segment* segment;
	for (i=0; i<g_segment_count; i++)
	{
		segment = &g_segments[i];
		if (segment->m_ptr_bitvec)
		{
			sys_free(segment->m_ptr_bitvec, g_bitvec_length);
			break;
		}
	}
	for (i=0; i<g_segment_count; i++)
	{
		segment = &g_segments[i];
		if ((segment->m_type == ENUM_MODULE_TEXT || segment->m_type == ENUM_MODULE_DATA)
			&& segment->m_module_name)
			free((void*)segment->m_module_name);
	}
	g_segment_count = 0;
	return CA_TRUE;
}
CA_BOOL release_all_segments ( void ) { unsigned int i ; struct ca_segment * segment ; for ( i = 0 ; i < g_segment_count ; i ++ ) { segment = & g_segments [ i ] ; if ( segment -> m_ptr_bitvec ) { sys_free ( segment -> m_ptr_bitvec , g_bitvec_length ) ; break ; } } for ( i = 0 ; i < g_segment_count ; i ++ ) { segment = & g_segments [ i ] ; if ( ( segment -> m_type == ENUM_MODULE_TEXT || segment -> m_type == ENUM_MODULE_DATA ) && segment -> m_module_name ) free ( ( void * ) segment -> m_module_name ) ; } g_segment_count = 0 ; return CA_TRUE ; }
Dismantle all segments previously built
but keep the buffer for reuse
Dismantle all segments previously built but keep the buffer for reuse
// release the bit vector, which is one monolithic region // release module_name // Since all ca_segments are on a big buffer, simply ground the indexes