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.
This commit is contained in:
Augustin Cavalier
2023-03-30 12:43:23 -04:00
parent e37168ad4f
commit 2393d22cdb
+4
View File
@@ -5,6 +5,7 @@
#include <util/list.h>
#include <util/DoublyLinkedList.h>
#include <BytePointer.h>
@@ -13,6 +14,9 @@
#define GET_LINK(list, item) ({ BytePointer<list_link> pointer((uint8*)item \
+ list->offset); &pointer; })
STATIC_ASSERT(sizeof(DoublyLinkedListLink<void*>) == sizeof(list_link));
/** Initializes the list with a specified offset to the link
* structure in the items that will be part of the list.
*/