|
libe3 0.2.5
C++ library for E3AP RAN vendor integration
|
Per-thread ring storage and sequence allocator for latrec. More...
Go to the source code of this file.
Macros | |
| #define | LATREC_TLS_ENTRIES_LOG2 18 /* 256 K records = 8 MiB per thread */ |
| #define | LATREC_ENTRIES_LOG2_MIN 12 |
| #define | LATREC_ENTRIES_LOG2_MAX 28 |
| #define | LATREC_MAX_RINGS 64 |
Functions | |
| static void | flush_open_rings (void) |
| static void | install_atexit (void) |
| static unsigned | entries_log2_from (const char *name) |
| static unsigned | entries_log2 (const char *role) |
| void | latrec_set_output_dir (const char *dir) |
| latrec_t * | latrec_tls_open_as (const char *role) |
| latrec_t * | latrec_tls_open (void) |
| uint64_t | latrec_seq_next (void) |
Variables | |
| static latrec_t | disabled_ring |
| __thread latrec_t * | latrec_tls = &disabled_ring |
| static latrec_t * | open_rings [64] |
| static int | n_open_rings |
| static pthread_mutex_t | rings_mu = PTHREAD_MUTEX_INITIALIZER |
| static pthread_once_t | atexit_once = PTHREAD_ONCE_INIT |
| static char | output_dir [512] |
Per-thread ring storage and sequence allocator for latrec.
latrec.h is usable on its own with an explicitly owned latrec_t. This file backs the convenience API on top of it: one ring per calling thread, opened on first stamp and named <prefix>.<tid>, plus the process-wide sequence counter. Keeping the storage in one translation unit gives a single ring per thread rather than one per includer.
SPDX-FileCopyrightText: Copyright (c) 2026 Northeastern University SPDX-License-Identifier: Apache-2.0
Definition in file latrec.c.
| #define LATREC_TLS_ENTRIES_LOG2 18 /* 256 K records = 8 MiB per thread */ |
| __thread latrec_t* latrec_tls = &disabled_ring |