Re: [PATCH v2 00/10] Rework READ_ONCE() to improve codegen

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

 



Of course, if you're feeling adventurous and willing to at least entertain the
mere speculation of switching the kernel source to C++, we could then use
inline template functions:

	template <typename T>
	static inline T __READ_ONCE(T &var)
	{
		T val = *(const volatile T *)&var;
		return val;
	}

	template <typename T>
	static inline T READ_ONCE(T &var)
	{
		T val;
		compiletime_assert_rwonce_type(var);
		val = __READ_ONCE(var);
		smp_read_barrier_depends();
		return val;
	}

Of course, that would mean using C++...

David




[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