m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [0/18] new argv_ref branch for m4 speedup


From: Eric Blake-1
Subject: Re: [0/18] new argv_ref branch for m4 speedup
Date: Tue, 20 Nov 2007 13:36:51 -0800 (PST)

> With 16000 arguments in the m4_join example, valgrind gives me these
> errors, the first of which is unique to large N, but the latter two
> happen with small N as well:

Thanks for doing that.

        * src/macro.c (arg_adjust_refcount): Avoid reading argv memory
        after freeing it in adjust_refcount.

Ahh.  That was the one that was eluding me in testing.  I had seen this
one during testing, but when it disappeared, I though I had caught all
of the cases.  Obviously not - it was only disappearing because my
other improvements used so much less memory as to no longer spill
obstack boundaries for smaller limits.  This belongs in stage15.

        Avoid referencing uninitialized part of union.
        * src/input.c (append_quote_token): Reorder logic to avoid
        reading string part of token_chain if argv_ref.

I already caught that one myself this morning.  As it is, I'm
redoing stage12 and onwards to use an enum instead of a bool
as the key for distinguishing the token_chain* union, and will
soon be republishing the argv_ref branch with that change.
Why?  Because it makes it much easier for my next goal,
making shift, ifdef, ifelse, and user macros able to transparently
pass builtin function tokens.

For example, Solaris m4 supports:

define(`foo',shift(,defn(`divnum')))foo
=> 0

The other goal that becomes much easier after all this
work is supporting NUL as an input character; I'm already
80% of the way there, now that the input engine uses
length-based processing instead of NUL-terminated processing.

        * src/input.c (pop_input): Avoid reading uninitialized data.

Copy-n-paste got me there.  I thought I had nuked that, but
obviously not.

-- 
Eric Blake

-- 
View this message in context: 
http://www.nabble.com/-0-18--new-argv_ref-branch-for-m4-speedup-tf4841140.html#a13866151
Sent from the Gnu - M4 - Patches mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]