Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Date: Thu, 2 Aug 2001 02:10:15 -0400 Message-Id: <200108020610.CAA06564@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f From: DJ Delorie To: cwilson AT ece DOT gatech DOT edu CC: binutils AT sources DOT redhat DOT com, cygwin-apps AT cygwin DOT com In-reply-to: <3B68ED4B.4080405@ece.gatech.edu> (message from Charles Wilson on Thu, 02 Aug 2001 02:03:55 -0400) Subject: Re: [RFA] pei386 dll: auto-import patch References: <3B670087 DOT 7090102 AT ece DOT gatech DOT edu> <200108011735 DOT NAA32231 AT envy DOT delorie DOT com> <3B6846D2 DOT 9040206 AT ece DOT gatech DOT edu> <200108011847 DOT OAA32757 AT envy DOT delorie DOT com> <3B68C879 DOT 1070809 AT ece DOT gatech DOT edu> <200108020347 DOT XAA05289 AT envy DOT delorie DOT com> <3B68ED4B DOT 4080405 AT ece DOT gatech DOT edu> > 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.