grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] save around 100 bytes on core.img by inlining small misc.c f


From: Robert Millan
Subject: Re: [PATCH] save around 100 bytes on core.img by inlining small misc.c functions
Date: Mon, 17 Aug 2009 15:43:02 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Aug 15, 2009 at 04:47:32PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> +static inline char *
> +grub_strncat (char *dest, const char *src, int c)
> +{
> +  char *p = dest;
> +
> +  while (*p)
> +    p++;
> +
> +  while ((*p = *src) != '\0' && c--)
> +    {
> +      p++;
> +      src++;
> +    }
> +
> +  *p = '\0';
> +
> +  return dest;
> +}

Some of them (like this one) are surprisingly big.  Did you test them
separately?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

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