1 |
|
2001-09-20 Gary V. Vaughan <gary@gnu.org> |
2 |
|
|
3 |
|
More cleanup. After the last patch, m4_symbol holds nothing but |
4 |
|
the head of a chain of m4_token_data. So I have removed the old |
5 |
|
m4_symbol, so that m4_token_data chains are stored directly in the |
6 |
|
value cell of a hash table node. But there's more... m4_symbol |
7 |
|
was a more natural name for the symbol value cell, and now that it |
8 |
|
is gone I have renamed the former m4_token_data structure to |
9 |
|
m4_symbol. This change turned out to be a pig to get right, since |
10 |
|
the original code didn't need to modify the value cell itself, |
11 |
|
since changing the chain happened inside the m4_symbol that used |
12 |
|
to be returned -- I had to pass the address of the value cell |
13 |
|
across various function calls, incase the head value changed. I |
14 |
|
also tightened up the memory management to help me find a nasty |
15 |
|
memory corruption bug that took me all night to track down... |
16 |
|
|
17 |
|
* m4/m4private.h (struct m4_symbol): Removed. |
18 |
|
(struct m4_token_data): Renamed to `struct m4_symbol'. Updated |
19 |
|
all references. |
20 |
|
* m4/hash.c (m4_hash_iterator_value): Return the address of the |
21 |
|
value cell. Updated all callers. |
22 |
|
* m4/symtab.c: Took advantage of the simplification in the data |
23 |
|
structures to rewrite a lot of this file more simply. There is |
24 |
|
still some room for optimisation here, but we should tackle that |
25 |
|
systematically closer to the release. |
26 |
|
|
27 |
|
* m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it |
28 |
|
revealed. This version is ahead of CVS libtool until I get chance |
29 |
|
to flush my changes. |
30 |
|
* m4/module.c (m4_module_remove): New function that holds the core |
31 |
|
of the old m4_module_unload. |
32 |
|
(m4_module_unload): Use it. |
33 |
|
(m4_module_unload_all): When we know the modules will never be |
34 |
|
used again (i.e. on exit), free up as much module memory as |
35 |
|
possible. There are still some artifacts from resident modules |
36 |
|
living inside ltdl.c, but everything else is freed. |
37 |
|
* m4/debug.c (m4_debug_exit): Free memory allocated in |
38 |
|
m4_debug_init(). |
39 |
|
* m4/input.c (m4_input_exit): Ditto wrt m4_input_init(). |
40 |
|
* m4/output.c (m4_output_exit): Ditto wrt m4_output_init (). |
41 |
|
* src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap (). |
42 |
|
* m4/m4module.h: Updated prototypes. |
43 |
|
* m4/hash.c (m4_hash_exit): Free the nodes on the free list. |
44 |
|
* m4/hash.h: Updated prototypes. |
45 |
|
* src/main.c (main): Use all these new functions to clean up as |
46 |
|
much memory as possible before exit. |
47 |
|
|
48 |
2001-09-18 Gary V. Vaughan <gary@gnu.org> |
2001-09-18 Gary V. Vaughan <gary@gnu.org> |
49 |
|
|
50 |
The `traced' flag needs to be attached to the definition of a |
The `traced' flag needs to be attached to the definition of a |