It made mouse
, a luxury item.
In Linux, NULL
is a macro which is defined as:
#define NULL (void *)0
And that is why it is said to initialize every pointer to NULL
, so that you
can get seg-fault :) [by accessing virtual address 0] in case of blind access.
-
The way generic Linked List is created with the help of
container_of
macro. The code for this macro is used to calculate the base address of any custom-made Linked List (Smartest1-line code
encountered so far). -
There could be many reasons (some simpler and some software engineering related) to create a generic Linked List kernel data structure. Out of all this reasons, one reason, which I have recently encountered (Thanks to
CRIU
), could be:
The functions like list_add, list_del and others do not perform any memory allocation or deallocation (opposed to what we learn in our data structure classes). It just perform pointer manipulations. You could say "Yeah I know. Whats big deal in that?". It become crucial when you are maintaining (feature addition, refactoring, reusebility) applications/ drivers.
Its ever evolving isolation mechanism:
- From process to threads, to virtual machines (hypervisors), to containers (cgroups and namespaces).