On Tue, Jul 11, 2006 at 12:24:47AM -0500, Vishal Soni wrote:

> Other thing I could do is re-allocate the Macro Array size when it gets
> full. So it would not fail until system starts swapping :-)
> 
> I would prefer the second option. Because it might hinder your and other
> language development. This might become a bigger issue as you start
> writing bigger programs or libraries.

Reallocation of the macro array is only one part of a fix. The bigger
problem is that macros are kept in a global and never invalidated or
freed.

This means that, if file A defines some macros or constants, these
macros are also in scope, when compiling a file B.

A fix needs these steps:
- manage the macro array within imc_info[1]
- reallocate it on demand
- clean the array after compiling a file

It'd be also reasonable to use a hash to avoid linear search in
existing macros/constants.

[1] this is a bit tricky, as .include should of course keep the
defines, while compiling a different file needs cleanup.

leo

Reply via email to