Message ID | 20230429131223.2507236-1-bugaevc@gmail.com |
---|---|
State | Committed, archived |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2AC433856DCA for <patchwork@sourceware.org>; Sat, 29 Apr 2023 13:12:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AC433856DCA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682773971; bh=zRCx3DeYXaHK1SvFZEbQYIZTpwQimdqkETW/S/qFdP8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=x2EsVyQ5DdO9CYTC/HW1y9lecPw65G1SW+Yd9HS5evRoaYv7eFRo/v/A8dkIVyyvF Ts/9ZvGQ/CF7Sf/ledc9vO2aAJUlpBH+kZTwsbb4Kr5Tqd4uxyF3IZJ81F1GSSbGEI iILhumWa1fHFKMmh82wHrlJpxP9Zp2xnSIgNgFpg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id DC7543858C50 for <libc-alpha@sourceware.org>; Sat, 29 Apr 2023 13:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC7543858C50 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2a8ba23a2abso7307201fa.2 for <libc-alpha@sourceware.org>; Sat, 29 Apr 2023 06:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682773945; x=1685365945; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zRCx3DeYXaHK1SvFZEbQYIZTpwQimdqkETW/S/qFdP8=; b=kGRV03D3SrGLZC09P50cEm/PWfcbnRM7b9pdqFbbADuwLOaVOEwQ18anYM8Ti8rOmV f6k0bC/jRMV0va3/L95qsd5Udt80yjMv0RHEarRN87kIZW5Q5yz7spDIqj8WK+zBkDC1 iO7wb32WzgCbdq1YhHjnEbl76PcstBHPSHDOnBeite3KFCoCQsWKXdpVs2s7RdwEe6Ks gmcxKjXL6ipGT5bkm/DDn23KaYaLg1PF/AW8HaWb96F9c6JGOBeXRTLhcBhgzcvUbgOU 4lnUKC+gElZdhSS0qd76sjYBh6bHNtVH85FEENOpfaJ4tsD/QlFHLz+wbYe+WVw7JOf5 fQBg== X-Gm-Message-State: AC+VfDw3jveG6dMyfdV+WnU18MTgYgFgXANQwEYJmDrZGhEEwEaikYSc ykn+sbAFF27UA8XZPgRLnzCTbb0dTkmDKQ== X-Google-Smtp-Source: ACHHUZ6Q2xbOmZ9fHZkFYA4Isp8fxj0Tg8bPo3FvQXxiYFc3GTwqd4HJnpqFAnGlfOqmjTJ/Xa6wHQ== X-Received: by 2002:a05:651c:10d:b0:2aa:e28d:cdc3 with SMTP id a13-20020a05651c010d00b002aae28dcdc3mr2211902ljb.2.1682773944912; Sat, 29 Apr 2023 06:12:24 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:8a14:19ba:9e6b:1866]) by smtp.gmail.com with ESMTPSA id u21-20020a2e8455000000b002a8e8c776e9sm3736870ljh.56.2023.04.29.06.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Apr 2023 06:12:24 -0700 (PDT) To: libc-alpha@sourceware.org Cc: bug-hurd@gnu.org, Samuel Thibault <samuel.thibault@gnu.org> Subject: [PATCH 1/3] cdefs.h: Define __COLD Date: Sat, 29 Apr 2023 16:12:21 +0300 Message-Id: <20230429131223.2507236-1-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Sergey Bugaev via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Sergey Bugaev <bugaevc@gmail.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[1/3] cdefs.h: Define __COLD
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Sergey Bugaev
April 29, 2023, 1:12 p.m. UTC
This expands to __attribute__ ((cold)) when supported. It should be
used to mark up functions that are invoked rarely.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
I can change __COLD to __attribute_cold__ if that is preferred.
misc/sys/cdefs.h | 6 ++++++
1 file changed, 6 insertions(+)
Comments
And of course right after I have sent it, I notice that I forgot the "Not GCC or clang." case. Sergey -- >8 -- From 1b8c6563828399de563846525d0f525001f2d80d Mon Sep 17 00:00:00 2001 From: Sergey Bugaev <bugaevc@gmail.com> Date: Thu, 27 Apr 2023 17:42:11 +0300 Subject: [PATCH] cdefs.h: Define __COLD This expands to __attribute__ ((cold)) when supported. It should be used to mark up functions that are invoked rarely. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> --- misc/sys/cdefs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 23ec0ebd..9a07e297 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -98,6 +98,12 @@ # endif # endif +# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__) +# define __COLD __attribute__ ((__cold__)) +# else +# define __COLD +# endif + #else /* Not GCC or clang. */ # if (defined __cplusplus \ @@ -110,6 +116,7 @@ # define __THROW # define __THROWNL # define __NTH(fct) fct +# define __COLD #endif /* GCC || clang. */
Applied, thanks! Sergey Bugaev, le sam. 29 avril 2023 16:20:53 +0300, a ecrit: > And of course right after I have sent it, I notice that I forgot the > "Not GCC or clang." case. > > Sergey > > -- >8 -- > > From 1b8c6563828399de563846525d0f525001f2d80d Mon Sep 17 00:00:00 2001 > From: Sergey Bugaev <bugaevc@gmail.com> > Date: Thu, 27 Apr 2023 17:42:11 +0300 > Subject: [PATCH] cdefs.h: Define __COLD > > This expands to __attribute__ ((cold)) when supported. It should be > used to mark up functions that are invoked rarely. > > Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> > --- > misc/sys/cdefs.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h > index 23ec0ebd..9a07e297 100644 > --- a/misc/sys/cdefs.h > +++ b/misc/sys/cdefs.h > @@ -98,6 +98,12 @@ > # endif > # endif > > +# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__) > +# define __COLD __attribute__ ((__cold__)) > +# else > +# define __COLD > +# endif > + > #else /* Not GCC or clang. */ > > # if (defined __cplusplus \ > @@ -110,6 +116,7 @@ > # define __THROW > # define __THROWNL > # define __NTH(fct) fct > +# define __COLD > > #endif /* GCC || clang. */ > > -- > 2.40.1 >
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 23ec0ebd..8eec4b94 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -98,6 +98,12 @@ # endif # endif +# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__) +# define __COLD __attribute__ ((__cold__)) +# else +# define __COLD +# endif + #else /* Not GCC or clang. */ # if (defined __cplusplus \