Container-of macro for intrusive data structures. More...
#include <stddef.h>Go to the source code of this file.
Macros | |
| #define | SPP_STRUCTOF(p_member, type, member) |
| Recover a pointer to the containing struct from a member pointer. | |
Container-of macro for intrusive data structures.
Allows recovering a pointer to the enclosing struct from a pointer to one of its members — enabling zero-overhead intrusive lists and trees without extra allocations, as used in lely-core.
Naming conventions used in this file:
Definition in file structof.h.
| #define SPP_STRUCTOF | ( | p_member, | |
| type, | |||
| member ) |
Recover a pointer to the containing struct from a member pointer.
| p_member | Pointer to the member field. |
| type | Type of the containing struct. |
| member | Name of the member field inside type. |
type instance.Example:
Definition at line 34 of file structof.h.