www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/08/02/02:10:48

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: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
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 <dj AT delorie DOT com>
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019