[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] kern/strings.c (strlen): mark with attribute pure
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 1/2] kern/strings.c (strlen): mark with attribute pure |
Date: |
Fri, 20 Dec 2013 00:28:17 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Thu 19 Dec 2013 18:51:05 +0100, a écrit :
> * kern/strings.c (strlen): Mark with attribute pure.
Also add the attribute to the header. It's actually *there* that it is
useful, for the caller to know that the function calls can be optimized
away.
> ---
> kern/strings.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kern/strings.c b/kern/strings.c
> index 0752722..72eb4f3 100644
> --- a/kern/strings.c
> +++ b/kern/strings.c
> @@ -161,7 +161,7 @@ strncpy(
> * the terminating null character.
> */
>
> -size_t
> +size_t __attribute__ ((pure))
> strlen(
> const char *string)
> {
> --
> 1.8.1.4
>
>
--
Samuel
Créer une hiérarchie supplementaire pour remedier à un problème (?) de
dispersion est d'une logique digne des Shadocks.
* BT in: Guide du Cabaliste Usenet - La Cabale vote oui (les Shadocks aussi) *