emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS: Change some macros to functions


From: Andrea Corallo
Subject: Re: MPS: Change some macros to functions
Date: Thu, 11 Jul 2024 09:13:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

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