This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] pei386 dll: auto-import patch



> no, this saves execution time rather than calling strlen OVER and OVER
> on the same constant strings.  We could compute it once and then cache
> those values, but geez, that's ugly.

Ok, never mind then.

> Is printf ("%s\n", __FUNCTION__); okay ?  If so, done.

Yup.

>    ret = snprintf (fixup_name, buffer_len, "__fu%d_%s",
>                    counter++, sym->name);

Sorry, can't use snprintf.  Use strlen every time (figure 20 for the
counter) and compare to the max length.  Round up to a multiple of 100
to reduce heap fragmentation.  Then use regular sprintf.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]