Artifact 551899b41552227299a1e550dc13a451bfb55f6172fc8e9002456951feb17fbd:
- File kmem/mem.h — part of check-in [51af496851] at 2019-06-28 04:48:43 on branch trunk — add Kmsz macro (user: lexi, size: 501) [annotate] [blame] [check-ins using]
#ifndef KImem #define KImem #include <k/type.h> #ifndef KFclean # define Kmsz(e) ( sizeof (e) / sizeof (e) [0] ) #endif typedef enum kmkind { kmkind_none, kmkind_heap, kmkind_pool, kmkind_ref, kmkind_tree } kmkind; typedef enum kmshred { kmshred_yes, kmshred_no } kmshred; typedef struct kmcell { kmkind kind; sz size; kmshred shred; sz refs; struct kmcell* src; char data[]; } kmcell; typedef struct kmptr { kmkind kind; kmshred shred; void* ref; kmcell* cell; } kmptr; #endif