Re: [PATCH v3 4/6] pack-bitmap: prepare to read lookup table extension

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

 



On Mon, 18 Jul 2022 at 21:26, Abhradeep Chakraborty
<chakrabortyabhradeep79@xxxxxxxxx> wrote:
>
> On Mon, Jul 18, 2022 at 2:37 PM Martin Ågren <martin.agren@xxxxxxxxx> wrote:
> >
> > Would it make sense to let the `const void *key` directly carry the
> > 32-bit value and hope that `sizeof(key) >= sizeof(uint32_t)`? That's
> > probably too magical, "just" to save on dereferencing.
>
> I do not have any particular opinion here. I will do whatever you think is best.

To be honest, I think it would be better not to do that. I floated it as
a random idea, but it's somewhere in the vicinity of undefined behavior,
and in any case, it might be a bit too tricky. If we're doing a byteswap
anyway (on virtually all platforms) and doing a bunch of comparisons,
trying to save on a dereference doesn't seem worth the increased "huh"
factor.

Martin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux