From 2393d22cdbf7583111a6c7c6cc029307abc102fb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 30 Mar 2023 12:43:23 -0400 Subject: [PATCH] kernel/util: Add static assert that the two list links are the same size. They are used interchangeably in some places, so we should assert this. --- src/system/kernel/util/list.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/system/kernel/util/list.cpp b/src/system/kernel/util/list.cpp index 7f7341172a..39a30b02eb 100644 --- a/src/system/kernel/util/list.cpp +++ b/src/system/kernel/util/list.cpp @@ -5,6 +5,7 @@ #include +#include #include @@ -13,6 +14,9 @@ #define GET_LINK(list, item) ({ BytePointer pointer((uint8*)item \ + list->offset); &pointer; }) +STATIC_ASSERT(sizeof(DoublyLinkedListLink) == sizeof(list_link)); + + /** Initializes the list with a specified offset to the link * structure in the items that will be part of the list. */