From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by sourceware.org (Postfix) with ESMTPS id 9F7C93858D3C for ; Tue, 4 Jul 2023 12:57:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F7C93858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd88.dcpf.telekom.de (fwd88.aul.t-online.de [10.223.144.114]) by mailout08.t-online.de (Postfix) with SMTP id CB80E1A825; Tue, 4 Jul 2023 14:57:15 +0200 (CEST) Received: from localhost.localdomain ([115.165.108.210]) by fwd88.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1qGfai-1kYk6a0; Tue, 4 Jul 2023 14:57:15 +0200 Message-ID: <9ea42bb89381ab067f9581ed29ef2979d5de4cf5.camel@t-online.de> Subject: Re: wishlist: support for shorter pointers From: Oleg Endo To: David Brown , =?UTF-8?Q?Rafa=C5=82?= Pietrak , Ian Lance Taylor Cc: "Richard Earnshaw (lists)" , Martin Uecker , "gcc@gcc.gnu.org" Date: Tue, 04 Jul 2023 21:57:09 +0900 In-Reply-To: References: <439affd4-11fe-de80-94c8-6fc64cbf76ec@ztk-rp.eu> <112e711791835d56cca38654f83a009cb46707d4.camel@gwdg.de> <940e9ae5-8649-5a28-e29f-06f0b2982892@ztk-rp.eu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1688475435-EBFF2029-651B4F56/0/0 CLEAN NORMAL X-TOI-MSGID: cd20e022-d413-49f4-9b97-fcf886249ee4 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > I think a C++ class (or rather, class template) with inline functions is= =20 > the way to go here. gcc's optimiser will give good code, and the C++=20 > class will let you get nice syntax to hide the messy details. >=20 > There is no good way to do this in C. Named address spaces would be a= =20 > possibility, but require quite a bit of effort and change to the=20 > compiler to implement, and they don't give you anything that you would= =20 > not get from a C++ class. >=20 > (That's not quite true - named address spaces can, I believe, also=20 > influence the section name used for allocation of data defined in these= =20 > spaces, which cannot be done by a C++ class.) >=20 Does the C++ template class shebang work for storing "short code pointers" for things like compile-time/link-time generated function tables? Haven't tried it myself, but somehow I doubt it. Cheers, Oleg