24 #ifndef __BLACKBOARD_MEMORY_MANAGER_H_ 25 #define __BLACKBOARD_MEMORY_MANAGER_H_ 27 #include <sys/types.h> 31 class BlackBoardSharedMemoryHeader;
63 const char *shmem_token =
"FawkesBlackBoard");
66 void * alloc(
unsigned int num_bytes);
67 void free(
void *chunk_ptr);
71 bool is_master()
const;
73 unsigned int max_free_size()
const;
74 unsigned int max_allocated_size()
const;
76 unsigned int free_size()
const;
77 unsigned int allocated_size()
const;
78 unsigned int overhang_size()
const;
80 unsigned int num_free_chunks()
const;
81 unsigned int num_allocated_chunks()
const;
83 unsigned int memory_size()
const;
84 unsigned int version()
const;
86 void print_free_chunks_info()
const;
87 void print_allocated_chunks_info()
const;
88 void print_performance_info()
const;
115 void * operator* ()
const;
118 unsigned int size()
const;
133 unsigned int list_length(
const chunk_list_t *list)
const;
137 void cleanup_free_chunks();
141 void * alloc_nolock(
unsigned int num_bytes);
Fawkes library namespace.
BlackBoard memory manager.
chunk_list_t * next
offset to next element in list
unsigned int size
total size of chunk, including overhanging bytes, excluding header
Chunk lists as stored in BlackBoard shared memory segment.
unsigned int overhang
number of overhanging bytes in this chunk
void * ptr
pointer to data memory
Iterator for memory chunks.
Mutex mutual exclusion lock.
BlackBoard interface manager.