Kind-of worked on the R-Tree; not really enough time to do much.
[aesalon.git] / include / shm / Header.h
blob9871439b481bc6d014342314a5d7a5eb8065f344
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/shm/Header.h
8 */
10 #ifndef AesalonSHM_Header_H
11 #define AesalonSHM_Header_H
13 #include <semaphore.h>
14 #include <stdint.h>
16 #ifdef __cplusplus
17 namespace SHM {
19 struct Header {
20 #else
21 typedef struct SHMHeader SHMHeader;
22 struct SHMHeader {
23 #endif
24 /** The overall size of the SHM in pages. */
25 uint32_t shmSize;
27 /** The size of the configuration data (in pages). */
28 uint32_t configDataSize;
30 /** The number of pages to use to store zone usage data in. */
31 uint32_t zoneUsagePages;
32 /** The page offset that zones are created starting at. */
33 uint32_t zonePageOffset;
34 /** The size of a zone, in pages. */
35 uint32_t zoneSize;
36 /** The number of zones currently in use. */
37 uint32_t zoneCount;
38 /** The number of zones that memory has been allocated for. */
39 uint32_t zonesAllocated;
41 /** Packet semaphore: incremented when a packet is available for reading. */
42 sem_t packetSemaphore;
43 /** Resizing semaphore; locked when a thread is resizing the SHM. */
44 sem_t resizeSemaphore;
46 /** The last allocated process ID; used to assign 4-byte process IDs dynamically. */
47 uint32_t lastProcessID;
48 /** The last allocated thread ID; used to assign 4-byte thread IDs dynamically. */
49 uint32_t lastThreadID;
52 #ifdef __cplusplus
53 } // namespace SHM
54 #endif
56 #endif