|struct arena_header *||header|
|struct shm_mapping *||mapping|
change_count will be compared with the arena_header change_count in the shared memory arena file to see if the local process object mappings are up to date with the arena file.
fd is the file descriptor of the arena file being mapped. We could have saved arena filename and closed the file after each mapping change, but that would make the re-openings fail if the file was unlinked before the re-opening and mapping changes.
|struct arena_header* shm_arena::header|
header points to the first mapping, mapping, which will never change in position or length for the life of the arena object, so we don't need a mutex to access it. It's also special because it has the arena header in it. We have this in addition to an allocated array of mappings. This makes it easier to make this code thread-safe, accessing the arena header in a thread-safe manner would be a real pain if used the array of mappings in mapping below.
|struct shm_mapping* shm_arena::mapping|
local process memory mappings realloc() is used to add to this array of pointers. This is not NULL terminated. arena->mapping.start has the same address as arena->header. Since this is re-allocated when mappings are added or removed we needed header to access mapping.start in an easily thread-safe manner.
number of mappings that are mapped in this local process object in addition to the first mapping. The array mapping (above) is of size num_mappings.