POSIX Shared Memory Data Structures 1.0
High-performance lock-free data structures for inter-process communication
Loading...
Searching...
No Matches
posix_shm.h File Reference

Core POSIX shared memory management with automatic reference counting. More...

#include <string>
#include <stdexcept>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstring>
#include <atomic>
#include <cerrno>
#include "shm_table.h"
+ Include dependency graph for posix_shm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  posix_shm_impl< TableType >
 POSIX shared memory wrapper with RAII and reference counting. More...
 

Typedefs

using posix_shm = posix_shm_impl< shm_table >
 Default shared memory type with standard table configuration.
 
using posix_shm_small = posix_shm_impl< shm_table_small >
 Small configuration for embedded/constrained systems.
 
using posix_shm_large = posix_shm_impl< shm_table_large >
 Large configuration for complex simulations.
 
using posix_shm_huge = posix_shm_impl< shm_table_huge >
 Huge configuration for maximum flexibility.
 

Detailed Description

Core POSIX shared memory management with automatic reference counting.

Author
POSIX SHM Library Team
Date
2025
Version
1.0.0

This file provides the foundation for all shared memory operations in the library. It wraps POSIX shared memory primitives with RAII semantics, automatic reference counting, and embedded metadata management.

See also
shm_table.h for metadata table implementation
shm_array.h, shm_queue.h for data structure implementations

Definition in file posix_shm.h.

Typedef Documentation

◆ posix_shm

Default shared memory type with standard table configuration.

Uses shm_table (32 char names, 64 max entries) Suitable for most applications.

Definition at line 339 of file posix_shm.h.

◆ posix_shm_huge

Huge configuration for maximum flexibility.

Uses shm_table_huge (256 char names, 1024 max entries) Table overhead: ~423KB

Warning
Large overhead - use only when necessary

Definition at line 364 of file posix_shm.h.

◆ posix_shm_large

Large configuration for complex simulations.

Uses shm_table_large (64 char names, 256 max entries) Table overhead: ~26KB

Definition at line 355 of file posix_shm.h.

◆ posix_shm_small

Small configuration for embedded/constrained systems.

Uses shm_table_small (16 char names, 16 max entries) Table overhead: ~900 bytes

Definition at line 347 of file posix_shm.h.