From a7b27bc2d094582c91c77f91b5198686e8a86775 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Wed, 20 Oct 2010 21:33:24 +0200 Subject: [PATCH] shm: Explain some fields Explain what some of the fields in the allocator actually mean --- sys/shm/shmalloc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/shm/shmalloc.c b/sys/shm/shmalloc.c index e4a9a5ad9a..67bae732fc 100644 --- a/sys/shm/shmalloc.c +++ b/sys/shm/shmalloc.c @@ -33,22 +33,30 @@ #include #include +/* This is the allocated space to hold multiple blocks */ struct _ShmAllocSpace { + /* The total size of this space */ size_t size; + /* chained list of the blocks contained in this space */ ShmAllocBlock *blocks; }; +/* A single block of data */ struct _ShmAllocBlock { int use_count; + /* Pointer back to the AllocSpace where this block is */ ShmAllocSpace *space; + /* The offset of this block in the alloc space */ unsigned long offset; + /* The size of the block */ unsigned long size; + /* Pointer to the next block in the chain */ ShmAllocBlock *next; };