diff options
author | marha <marha@users.sourceforge.net> | 2013-06-21 11:18:17 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-06-21 11:18:17 +0200 |
commit | 039fb6c83783fff3b92f1e7934ce4702cedb1722 (patch) | |
tree | bb971ed2e247f7d311b696e62c7ed4d66b199b6d /freetype/src/base/ftdbgmem.c | |
parent | 84f6a75a56f4749f91a51a161c1989cbc8807b80 (diff) | |
parent | fa791414601df61d20d860299dba80fdb62565df (diff) | |
download | vcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.tar.gz vcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.tar.bz2 vcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
Upgraded freetype to 2.5.0.1
Conflicts:
freetype/src/base/ftcalc.c
freetype/src/base/ftgloadr.c
freetype/src/base/ftgxval.c
freetype/src/base/ftotval.c
freetype/src/base/ftoutln.c
freetype/src/base/ftpfr.c
freetype/src/base/fttrigon.c
freetype/src/cff/cffobjs.c
freetype/src/psaux/afmparse.c
freetype/src/psnames/psmodule.c
freetype/src/raster/ftraster.c
freetype/src/raster/ftrend1.c
freetype/src/sfnt/ttsbit.c
freetype/src/sfnt/ttsbit0.c
freetype/src/truetype/ttobjs.c
freetype/src/truetype/ttsubpix.c
freetype/src/type1/t1afm.c
Diffstat (limited to 'freetype/src/base/ftdbgmem.c')
-rw-r--r-- | freetype/src/base/ftdbgmem.c | 105 |
1 files changed, 50 insertions, 55 deletions
diff --git a/freetype/src/base/ftdbgmem.c b/freetype/src/base/ftdbgmem.c index ea9f2a9b1..f4b98effc 100644 --- a/freetype/src/base/ftdbgmem.c +++ b/freetype/src/base/ftdbgmem.c @@ -4,7 +4,7 @@ /* */ /* Memory debugger (body). */ /* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ +/* Copyright 2001-2006, 2009, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -344,85 +344,80 @@ ft_mem_table_destroy( FT_MemTable table ) { FT_ULong i; + FT_Long leak_count = 0; + FT_ULong leaks = 0; FT_DumpMemory( table->memory ); - if ( table ) + /* remove all blocks from the table, revealing leaked ones */ + for ( i = 0; i < table->size; i++ ) { - FT_Long leak_count = 0; - FT_ULong leaks = 0; + FT_MemNode *pnode = table->buckets + i, next, node = *pnode; - /* remove all blocks from the table, revealing leaked ones */ - for ( i = 0; i < table->size; i++ ) + while ( node ) { - FT_MemNode *pnode = table->buckets + i, next, node = *pnode; + next = node->link; + node->link = 0; - - while ( node ) + if ( node->size > 0 ) { - next = node->link; - node->link = 0; - - if ( node->size > 0 ) - { - printf( - "leaked memory block at address %p, size %8ld in (%s:%ld)\n", - node->address, node->size, - FT_FILENAME( node->source->file_name ), - node->source->line_no ); + printf( + "leaked memory block at address %p, size %8ld in (%s:%ld)\n", + node->address, node->size, + FT_FILENAME( node->source->file_name ), + node->source->line_no ); - leak_count++; - leaks += node->size; + leak_count++; + leaks += node->size; - ft_mem_table_free( table, node->address ); - } + ft_mem_table_free( table, node->address ); + } - node->address = NULL; - node->size = 0; + node->address = NULL; + node->size = 0; - ft_mem_table_free( table, node ); - node = next; - } - table->buckets[i] = 0; + ft_mem_table_free( table, node ); + node = next; } + table->buckets[i] = 0; + } - ft_mem_table_free( table, table->buckets ); - table->buckets = NULL; - - table->size = 0; - table->nodes = 0; + ft_mem_table_free( table, table->buckets ); + table->buckets = NULL; - /* remove all sources */ - for ( i = 0; i < FT_MEM_SOURCE_BUCKETS; i++ ) - { - FT_MemSource source, next; + table->size = 0; + table->nodes = 0; + /* remove all sources */ + for ( i = 0; i < FT_MEM_SOURCE_BUCKETS; i++ ) + { + FT_MemSource source, next; - for ( source = table->sources[i]; source != NULL; source = next ) - { - next = source->link; - ft_mem_table_free( table, source ); - } - table->sources[i] = NULL; + for ( source = table->sources[i]; source != NULL; source = next ) + { + next = source->link; + ft_mem_table_free( table, source ); } - printf( - "FreeType: total memory allocations = %ld\n", table->alloc_total ); - printf( - "FreeType: maximum memory footprint = %ld\n", table->alloc_max ); + table->sources[i] = NULL; + } - ft_mem_table_free( table, table ); + printf( "FreeType: total memory allocations = %ld\n", + table->alloc_total ); + printf( "FreeType: maximum memory footprint = %ld\n", + table->alloc_max ); - if ( leak_count > 0 ) - ft_mem_debug_panic( - "FreeType: %ld bytes of memory leaked in %ld blocks\n", - leaks, leak_count ); + ft_mem_table_free( table, table ); - printf( "FreeType: no memory leaks detected\n" ); - } + if ( leak_count > 0 ) + ft_mem_debug_panic( + "FreeType: %ld bytes of memory leaked in %ld blocks\n", + leaks, leak_count ); + + printf( "FreeType: no memory leaks detected\n" ); } |