Drop "restrict" keyword

The "restrict" keyword can be used to indicate that no other
pointer will be used to access a chunk of memory while the
restricted pointer is alive. If that promise is not upheld,
undefined behavior is triggered.

It may be difficult to ensure this property, and the property may
be brittle - becoming invalid as code evolves. Just like "inline",
let's just leave optimizations up to the compiler to figure out.
This commit is contained in:
Simon Ser 2026-05-25 10:31:55 +02:00 committed by Isaac Freund
parent 3bd8f29b13
commit 7265a79e46
4 changed files with 14 additions and 14 deletions

View file

@ -395,8 +395,8 @@ bool wlr_session_change_vt(struct wlr_session *session, unsigned vt) {
/* Tests if 'path' is KMS compatible by trying to open it. Returns the opened
* device on success. */
struct wlr_device *session_open_if_kms(struct wlr_session *restrict session,
const char *restrict path) {
struct wlr_device *session_open_if_kms(struct wlr_session *session,
const char *path) {
if (!path) {
return NULL;
}