diff options
Diffstat (limited to 'pkg/sentry/socket/unix')
-rw-r--r-- | pkg/sentry/socket/unix/transport/transport_message_list.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/sentry/socket/unix/transport/transport_message_list.go b/pkg/sentry/socket/unix/transport/transport_message_list.go index dda579c27..945163cc1 100644 --- a/pkg/sentry/socket/unix/transport/transport_message_list.go +++ b/pkg/sentry/socket/unix/transport/transport_message_list.go @@ -38,16 +38,22 @@ func (l *messageList) Reset() { } // Empty returns true iff the list is empty. +// +//go:nosplit func (l *messageList) Empty() bool { return l.head == nil } // Front returns the first element of list l or nil. +// +//go:nosplit func (l *messageList) Front() *message { return l.head } // Back returns the last element of list l or nil. +// +//go:nosplit func (l *messageList) Back() *message { return l.tail } @@ -55,6 +61,8 @@ func (l *messageList) Back() *message { // Len returns the number of elements in the list. // // NOTE: This is an O(n) operation. +// +//go:nosplit func (l *messageList) Len() (count int) { for e := l.Front(); e != nil; e = (messageElementMapper{}.linkerFor(e)).Next() { count++ @@ -63,6 +71,8 @@ func (l *messageList) Len() (count int) { } // PushFront inserts the element e at the front of list l. +// +//go:nosplit func (l *messageList) PushFront(e *message) { linker := messageElementMapper{}.linkerFor(e) linker.SetNext(l.head) @@ -77,6 +87,8 @@ func (l *messageList) PushFront(e *message) { } // PushBack inserts the element e at the back of list l. +// +//go:nosplit func (l *messageList) PushBack(e *message) { linker := messageElementMapper{}.linkerFor(e) linker.SetNext(nil) @@ -91,6 +103,8 @@ func (l *messageList) PushBack(e *message) { } // PushBackList inserts list m at the end of list l, emptying m. +// +//go:nosplit func (l *messageList) PushBackList(m *messageList) { if l.head == nil { l.head = m.head @@ -106,6 +120,8 @@ func (l *messageList) PushBackList(m *messageList) { } // InsertAfter inserts e after b. +// +//go:nosplit func (l *messageList) InsertAfter(b, e *message) { bLinker := messageElementMapper{}.linkerFor(b) eLinker := messageElementMapper{}.linkerFor(e) @@ -124,6 +140,8 @@ func (l *messageList) InsertAfter(b, e *message) { } // InsertBefore inserts e before a. +// +//go:nosplit func (l *messageList) InsertBefore(a, e *message) { aLinker := messageElementMapper{}.linkerFor(a) eLinker := messageElementMapper{}.linkerFor(e) @@ -141,6 +159,8 @@ func (l *messageList) InsertBefore(a, e *message) { } // Remove removes e from l. +// +//go:nosplit func (l *messageList) Remove(e *message) { linker := messageElementMapper{}.linkerFor(e) prev := linker.Prev() @@ -173,21 +193,29 @@ type messageEntry struct { } // Next returns the entry that follows e in the list. +// +//go:nosplit func (e *messageEntry) Next() *message { return e.next } // Prev returns the entry that precedes e in the list. +// +//go:nosplit func (e *messageEntry) Prev() *message { return e.prev } // SetNext assigns 'entry' as the entry that follows e in the list. +// +//go:nosplit func (e *messageEntry) SetNext(elem *message) { e.next = elem } // SetPrev assigns 'entry' as the entry that precedes e in the list. +// +//go:nosplit func (e *messageEntry) SetPrev(elem *message) { e.prev = elem } |