unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Pip Cet <pipcet@protonmail.com>,
	 Emacs Devel <emacs-devel@gnu.org>,
	Helmut Eller <eller.helmut@gmail.com>
Subject: Re: MPS: Change some macros to functions
Date: Thu, 11 Jul 2024 09:13:24 -0400	[thread overview]
Message-ID: <yp1msmocbrf.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <m234ogytdq.fsf@pro2.fritz.box> ("Gerd Möllmann"'s message of "Thu, 11 Jul 2024 15:01:53 +0200")

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Any objections against changing these to functions?
>>
>>   #define IGC_HEADER_NWORDS(h) ((h)->v >> IGC_HEADER_NWORDS_SHIFT)
>>   #define IGC_HEADER_HASH(h) (((h)->v >> IGC_HEADER_HASH_SHIFT) & IGC_HEADER_HASH_MASK)
>>   #define IGC_HEADER_TYPE(h) (((h)->v >> IGC_HEADER_TYPE_SHIFT) & IGC_HEADER_TYPE_MASK)
>>   #define IGC_HEADER_TAG(h) ((h)->v & IGC_HEADER_TAG_MASK)
>>
>> LLDB can't handle macros, and having return types would also be nice.
>>
>> I can do that if you agree.
>
> Something like

You could make them 'always_inline' if you want to have something very
similar to macros (performance-wise) but using functions.

The only down-side of using functions compared to macros (and the reason
why we still use these in Emacs a lot) is that in non optimized builds
functions are slower then macros.



  reply	other threads:[~2024-07-11 13:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 12:35 MPS: Change some macros to functions Gerd Möllmann
2024-07-11 13:01 ` Gerd Möllmann
2024-07-11 13:13   ` Andrea Corallo [this message]
2024-07-11 13:25     ` Gerd Möllmann
2024-07-11 13:35   ` Pip Cet
2024-07-11 14:19     ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yp1msmocbrf.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=pipcet@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).