* src/base/ftdbgmem.c: another realloc memory counting bug fix

* src/tools/Jamfile: adding missing file

  * src/lzw/Jamfile: fixing incorrect source file reference
This commit is contained in:
David Turner 2005-10-21 10:01:25 +00:00
parent 560d5fed38
commit 398d64c0cc
4 changed files with 29 additions and 38 deletions

View File

@ -1,3 +1,11 @@
2005-10-21 David Turner <david@freetype.org>
* src/base/ftdbgmem.c: another realloc memory counting bug fix
* src/tools/Jamfile: adding missing file
* src/lzw/Jamfile: fixing incorrect source file reference
2005-10-20 David Turner <david@freetype.org>
* src/base/ftdbgmem.c (ft_mem_table_set, ft_mem_table_remove,
@ -5,8 +13,8 @@
to better account for memory reallocations.
* src/lzw/ftlzw2.c, src/lzw/ftzopen.h, src/lzw/ftzopen.c,
src/lzw/rules.mk: First version of LZW loader re-implementation.
Apparently, this saves about 260 KB of heap memory when loading
src/lzw/rules.mk: First version of LZW loader re-implementation.
Apparently, this saves about 330 KB of heap memory when loading
timR24.pcf.Z.
2005-10-20 Chia-I Wu <b90201047@ntu.edu.tw>

View File

@ -554,12 +554,14 @@
if ( delta != 0 )
{
/* we're growing or shrinking a realloc-ed block */
source->cur_size += delta;
source->cur_size += delta;
table->alloc_current += delta;
}
else
{
/* we're allocating a new block */
source->cur_size += size;
source->cur_size += size;
table->alloc_current += size;
}
source->all_size += size;
@ -575,16 +577,8 @@
pnode[0] = node;
table->nodes++;
if ( delta != 0 )
{
table->alloc_total += size;
table->alloc_current += delta;
}
else
{
table->alloc_total += size;
table->alloc_current += size;
}
table->alloc_total += size;
if ( table->alloc_current > table->alloc_max )
table->alloc_max = table->alloc_current;
@ -742,6 +736,10 @@
FT_Long line_no = table->line_no;
/* unlikely, but possible */
if ( new_size == cur_size )
return block;
/* the following is valid according to ANSI C */
#if 0
if ( block == NULL || cur_size == 0 )
@ -774,19 +772,6 @@
"%ld instead of %ld in (%s:%ld)",
block, cur_size, node->size, file_name, line_no );
#if 0
new_block = ft_mem_debug_alloc( memory, new_size );
if ( new_block == NULL )
return NULL;
ft_memcpy( new_block, block, cur_size < new_size ? cur_size : new_size );
table->file_name = file_name;
table->line_no = line_no;
ft_mem_debug_free( memory, (FT_Byte*)block );
#else
/* return NULL if the maximum number of allocations was reached */
if ( table->bound_count &&
table->alloc_count >= table->alloc_count_max )
@ -806,23 +791,16 @@
ft_mem_table_set( table, new_block, new_size, delta );
table->file_name = NULL;
table->line_no = 0;
ft_memcpy( new_block, block, cur_size < new_size ? cur_size : new_size );
table->file_name = file_name;
table->line_no = line_no;
ft_mem_table_remove( table, (FT_Byte*)block, delta );
table->file_name = NULL;
table->line_no = 0;
if ( !table->keep_alive )
ft_mem_table_free( table, block );
table->alloc_current += delta;
#endif
return new_block;
}

View File

@ -11,7 +11,7 @@
SubDir FT2_TOP $(FT2_SRC_DIR) lzw ;
Library $(FT2_LIB) : ftlzw.c ;
Library $(FT2_LIB) : ftlzw2.c ;
# end of src/lzw Jamfile

5
src/tools/Jamfile Normal file
View File

@ -0,0 +1,5 @@
# Jamfile for src/tools
#
SubDir FT2_TOP src tools ;
Main apinames : apinames.c ;