Re: Mostly portable strnlen_user()

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

 



From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 May 2012 16:37:40 -0700

> On Fri, May 25, 2012 at 4:14 PM, David Miller <davem@xxxxxxxxxxxxx> wrote:
>>
>> I suppose then I'd need to make BE's has_zero() a macro instead of a
>> function.  Either that or we pass a pointer to this opaque typedef
>> thing.
> 
> Gcc is *usually* pretty good about optimizing small structures on the
> stack, even if you pass a pointer (if the pointer then always gets
> dereferenced within that function). So I think you could try the
> "pointer to opaque thing" approach and see.
> 
> But yeah, the macro approach obviously puts much less reliance on the
> optimizer getting things right, so it might be the way to go if it
> turns out that gcc screws up code generation.

I'm playing around with this now, I should have something for you
to look at in the next few hours.
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux