On Sat, 18 Oct 2025 00:01:30 +0900
Masami Hiramatsu (Google) <[email protected]> wrote:

> On Wed, 15 Oct 2025 17:20:20 -0400
> Steven Rostedt <[email protected]> wrote:
> 
> I could not find any other enum64 usage, so I doubt it is
> available. (Does it depend on compiler?)
> It seems C23 standard support it...

Bah, I thought I saw it used, but it appears it's BPF that does
something special.


> 
> > 
> > Not to mention, using const u64 requires saving these numbers in an address
> > and referencing them, instead of doing it inlined in text. That is, using
> > u64 instead of enum64 is both slower and wastes more memory.  
> 
> Yeah, I expected that the compiler could easily optimize correctly, but
> maybe not?

I doubt it. The values are exported to be allowed to be used in other
files, so I doubt it can optimize it.

The only thing I can think of is to unravel the enum into a bunch of
#defines, that have the bit shifts.

-- Steve

Reply via email to