* src/base/ftdbgmem.c: another realloc memory counting bug fix * src/tools/Jamfile: adding missing file * src/lzw/Jamfile: fixing incorrect source file reference
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
diff --git a/ChangeLog b/ChangeLog
index 7493962..95a1732 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index fd24689..72c5007 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -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;
}
diff --git a/src/lzw/Jamfile b/src/lzw/Jamfile
index e9c3c4a..f14b8c3 100644
--- a/src/lzw/Jamfile
+++ b/src/lzw/Jamfile
@@ -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
diff --git a/src/tools/Jamfile b/src/tools/Jamfile
new file mode 100644
index 0000000..475161e
--- /dev/null
+++ b/src/tools/Jamfile
@@ -0,0 +1,5 @@
+# Jamfile for src/tools
+#
+SubDir FT2_TOP src tools ;
+
+Main apinames : apinames.c ;