-
Notifications
You must be signed in to change notification settings - Fork 3
Kernel Data Structures
The microkernel provides basic C-style data structures so that the microkernel can remain as small as possible and have fast operations. The microkernel provides the following data structures -
Header File - Interface/Util/LinkedList.h
Source File - Util/LinkedList.cpp
LinkedListNode
- This struct
is used as the element in the linked-list. For structures that participate only in linked-lists it should be placed at the beginning of the structure.
The linked-list is not synchronized so it must be external locked. The following functions operate on the struct LinkedList
-
AddElement
- This function will add the element to the starting of the linked-list.
RemoveElement
- Remove a element from the linked-list, assuming it was added before removing.
InsertElementAfter
, InsertElementBefore
- Add a element into the list before or after a existing element. This is very good for objects which use partially sorted lists.
'PushHead', 'PullTail' - Used for FIFO operations on lists.
Header File - Interface/Util/CircularList.hpp
Source File - Util/CircularList.cpp
'CircularListNode' - This `struct' is used for elements in the circular list.
ClnInsert
, ClnRemove
- are the functions which insert & remove elements from the circular list. The circular list is better for low memory code, where iteration can start from any node.