Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MffPQ-0001l4-3m for mharc-grub-devel@gnu.org; Mon, 24 Aug 2009 15:40:52 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MffPO-0001kN-W5 for grub-devel@gnu.org; Mon, 24 Aug 2009 15:40:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MffPK-0001fZ-DW for grub-devel@gnu.org; Mon, 24 Aug 2009 15:40:50 -0400 Received: from [199.232.76.173] (port=54249 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MffPK-0001fJ-95 for grub-devel@gnu.org; Mon, 24 Aug 2009 15:40:46 -0400 Received: from mail-bw0-f222.google.com ([209.85.218.222]:63100) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MffPJ-0005LT-Mb for grub-devel@gnu.org; Mon, 24 Aug 2009 15:40:46 -0400 Received: by bwz22 with SMTP id 22so2185042bwz.42 for ; Mon, 24 Aug 2009 12:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6eZwTrLC3Geq26geEZlW7M53hgKMkgL0qwOxLAbEOXQ=; b=vBLCQgJXrdfWGo8Z0ent/nQ5/11AI/v5FTL8ztlAi3P1Yf0xbHg8m9qmBDCVnxeubv 0/yhzgyywaK5AgJalE7PtyTg6kOg55Qkofp/fUbmfkLhZV9nk4quOBa1S7WvSBk/tOWq 0mF+7Y5lEFPfHd7NIOHjKtORj+LIk6OXRXuhQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pPhS66Fji9s8sgUnf13Z6/30skaXqt2rXfNj2vx4mD0DtGgN8+GA4JvSodfm6wyYDf AGDftI5ldmcprBZTlIhoFw9EfubhIDF/328IVhR0EUBFcFO3p0qxb6DNRlLtEvH49gWI GoZqR0IK5I8H5QhxOO6hiwVfQwq2dUaQV0D2Y= MIME-Version: 1.0 Received: by 10.204.6.65 with SMTP id 1mr1684979bky.186.1251142844607; Mon, 24 Aug 2009 12:40:44 -0700 (PDT) In-Reply-To: <20090819151123.GB7859@thorin> References: <20090817134302.GI32551@thorin> <20090819151123.GB7859@thorin> Date: Mon, 24 Aug 2009 21:40:44 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] save around 100 bytes on core.img by inlining small misc.c functions X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2009 19:40:51 -0000 On Wed, Aug 19, 2009 at 5:11 PM, Robert Millan wrote: > On Mon, Aug 17, 2009 at 03:54:06PM +0200, Vladimir 'phcoder' Serbinenko w= rote: >> On Mon, Aug 17, 2009 at 3:43 PM, Robert Millan wrote: >> > On Sat, Aug 15, 2009 at 04:47:32PM +0200, Vladimir 'phcoder' Serbinenk= o wrote: >> >> +static inline char * >> >> +grub_strncat (char *dest, const char *src, int c) >> >> +{ >> >> + =A0char *p =3D dest; >> >> + >> >> + =A0while (*p) >> >> + =A0 =A0p++; >> >> + >> >> + =A0while ((*p =3D *src) !=3D '\0' && c--) >> >> + =A0 =A0{ >> >> + =A0 =A0 =A0p++; >> >> + =A0 =A0 =A0src++; >> >> + =A0 =A0} >> >> + >> >> + =A0*p =3D '\0'; >> >> + >> >> + =A0return dest; >> >> +} >> > >> > Some of them (like this one) are surprisingly big. =A0Did you test the= m >> > separately? >> Yes I did. My test environment was a core.img with pc+fat+biosdisk. I >> have a log which functions save how much. In this case inlining >> strncat saved 21 bytes. The reason for some bigger functions to be >> inlined is that they are used only in non-size critical parts. In this >> case it's used in LUA and iso9660.mod (one call). So inlining strncat >> always saves space (even if iso9660.mod is in core.img but there is no >> size limit when booting from cd). > > Ok, fine with me then. Comitted > > -- > Robert Millan > > =A0The DRM opt-in fallacy: "Your data belongs to us. We will decide when = (and > =A0how) you may access your data; but nobody's threatening your freedom: = we > =A0still allow you to remove your data and not access it at all." > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git