lkml.org 
[lkml]   [2020]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 02/10] netfilter: Avoid assigning 'const' pointer to non-const pointer
Date
From: Linus Torvalds
> Sent: 24 January 2020 17:37
...
> (That also means that the compiler can't necessarily even optimize
> multiple accesses through a const pointer away, because the object
> might be modified through another pointer that aliases the const one -
> you'd need to also mark it "restrict" to tell the compiler that no
> other pointer will alias).

I've seen gcc cache a value read through a 'const' parameter pointer
across a function call.
Can't remember which version though.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2020-01-27 13:22    [W:2.747 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site