From bfe4d1a77e7065edf53a4906bce7dbc41cad81fb Mon Sep 17 00:00:00 2001 From: David Cozens Date: Mon, 1 Jun 2026 12:27:45 +0100 Subject: [PATCH] refactor: S24.17 collapse per-platform pool tunables to role-based Reduce the pool-size tunable surface in SolidSyslogTunablesDefaults.h from 35 macros to 18 by collapsing 8 platform/vendor-selected role groups to a single role-named tunable each: TCP_STREAM <- POSIX/WINSOCK/PLUS_TCP/LWIP_RAW TCP stream DATAGRAM <- POSIX/WINSOCK/PLUS_TCP/LWIP_RAW datagram RESOLVER <- GETADDRINFO/WINSOCK/PLUS_TCP/LWIP_RAW/LWIP_RAW_DNS MUTEX <- POSIX/WINDOWS/FREE_RTOS mutex FILE <- POSIX/WINDOWS/FATFS file ATOMIC_COUNTER <- STD/WINDOWS atomic counter TLS_STREAM <- OpenSSL/mbedTLS TLS stream HMAC_SHA256_POLICY <- OpenSSL/mbedTLS HMAC policy A build links exactly one implementation per role, so the integrator tunes the role (SOLIDSYSLOG_TCP_STREAM_POOL_SIZE) rather than the platform. Extends the existing SOLIDSYSLOG_ADDRESS_POOL_SIZE precedent; the table now grows O(1) per new OS/stack/vendor instead of O(roles). Within each role group the prior per-platform defaults were already uniform, so no default-value reconciliation. Clean break, no deprecated aliases (pre-1.0). All floor static_asserts kept. Convention + the two-implementations-in-one-build sum caveat documented in docs/NAMING.md and the header preamble. No behaviour change. Closes #501 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../FreeRtos/solidsyslog_user_tunables.h | 2 +- .../FreeRtosLwip/solidsyslog_user_tunables.h | 2 +- CLAUDE.md | 9 +- Core/Interface/SolidSyslogTunablesDefaults.h | 529 ++++-------------- DEVLOG.md | 38 ++ .../SolidSyslogStdAtomicCounterStatic.c | 10 +- .../FatFs/Source/SolidSyslogFatFsFileStatic.c | 10 +- .../Source/SolidSyslogFreeRtosMutexStatic.c | 13 +- .../Source/SolidSyslogLwipRawDatagramStatic.c | 10 +- .../SolidSyslogLwipRawDnsResolverStatic.c | 10 +- .../Source/SolidSyslogLwipRawResolverStatic.c | 10 +- .../SolidSyslogLwipRawTcpStreamStatic.c | 10 +- ...SolidSyslogMbedTlsHmacSha256PolicyStatic.c | 11 +- .../Source/SolidSyslogMbedTlsStreamStatic.c | 10 +- ...SolidSyslogOpenSslHmacSha256PolicyStatic.c | 11 +- .../Source/SolidSyslogPlusTcpDatagramStatic.c | 10 +- .../Source/SolidSyslogPlusTcpResolverStatic.c | 10 +- .../SolidSyslogPlusTcpTcpStreamStatic.c | 10 +- .../SolidSyslogGetAddrInfoResolverStatic.c | 10 +- .../Source/SolidSyslogPosixDatagramStatic.c | 13 +- .../Posix/Source/SolidSyslogPosixFileStatic.c | 10 +- .../Source/SolidSyslogPosixMutexStatic.c | 10 +- .../Source/SolidSyslogPosixTcpStreamStatic.c | 10 +- .../SolidSyslogWindowsAtomicCounterStatic.c | 10 +- .../Source/SolidSyslogWindowsFileStatic.c | 10 +- .../Source/SolidSyslogWindowsMutexStatic.c | 13 +- .../Source/SolidSyslogWinsockDatagramStatic.c | 10 +- .../Source/SolidSyslogWinsockResolverStatic.c | 10 +- .../SolidSyslogWinsockTcpStreamStatic.c | 10 +- Tests/FatFs/SolidSyslogFatFsFilePoolTest.cpp | 6 +- Tests/Fixtures/SmallMessageSizeTunables.h | 5 +- .../FreeRtos/SolidSyslogFreeRtosMutexTest.cpp | 6 +- .../SolidSyslogPlusTcpDatagramTest.cpp | 6 +- .../SolidSyslogPlusTcpResolverTest.cpp | 6 +- .../SolidSyslogPlusTcpTcpStreamTest.cpp | 6 +- Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp | 6 +- .../SolidSyslogLwipRawDnsResolverTest.cpp | 6 +- Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp | 6 +- .../Lwip/SolidSyslogLwipRawTcpStreamTest.cpp | 6 +- ...SolidSyslogMbedTlsHmacSha256PolicyTest.cpp | 2 +- .../SolidSyslogMbedTlsStreamPoolTest.cpp | 6 +- Tests/SolidSyslogGetAddrInfoResolverTest.cpp | 6 +- ...SolidSyslogOpenSslHmacSha256PolicyTest.cpp | 2 +- Tests/SolidSyslogPosixDatagramTest.cpp | 6 +- Tests/SolidSyslogPosixFileTest.cpp | 6 +- Tests/SolidSyslogPosixMutexTest.cpp | 6 +- Tests/SolidSyslogPosixTcpStreamTest.cpp | 6 +- Tests/SolidSyslogStdAtomicCounterPoolTest.cpp | 6 +- Tests/SolidSyslogStdAtomicCounterTestHelper.c | 2 +- ...olidSyslogWindowsAtomicCounterPoolTest.cpp | 6 +- ...olidSyslogWindowsAtomicCounterTestHelper.c | 2 +- Tests/SolidSyslogWindowsFileTest.cpp | 6 +- Tests/SolidSyslogWindowsMutexTest.cpp | 6 +- Tests/SolidSyslogWinsockDatagramTest.cpp | 6 +- Tests/SolidSyslogWinsockResolverTest.cpp | 6 +- Tests/SolidSyslogWinsockTcpStreamTest.cpp | 6 +- docs/NAMING.md | 30 + docs/integrating-lwip.md | 7 +- docs/misra-deviations.md | 2 +- 59 files changed, 384 insertions(+), 631 deletions(-) diff --git a/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h b/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h index 1103077b..2f62bf27 100644 --- a/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h +++ b/Bdd/Targets/FreeRtos/solidsyslog_user_tunables.h @@ -23,6 +23,6 @@ * mid-run). The library default of 1 would silently fall the second Create * back to NullMutex — Lock/Unlock would become no-ops and the rebuild path * could race the Service task. */ -#define SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE 2U +#define SOLIDSYSLOG_MUTEX_POOL_SIZE 2U #endif /* SOLIDSYSLOG_USER_TUNABLES_H */ diff --git a/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h b/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h index 58e88042..34cb917a 100644 --- a/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h +++ b/Bdd/Targets/FreeRtosLwip/solidsyslog_user_tunables.h @@ -19,6 +19,6 @@ * `lifecycleMutex` (serialising SolidSyslog_Service against teardown). The * library default of 1 would silently fall the second Create back to * NullMutex — Lock/Unlock would become no-ops. */ -#define SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE 2U +#define SOLIDSYSLOG_MUTEX_POOL_SIZE 2U #endif /* SOLIDSYSLOG_USER_TUNABLES_H */ diff --git a/CLAUDE.md b/CLAUDE.md index 65f0ec67..678354d7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -345,7 +345,7 @@ live under `Core/Interface/`; platform-specific helpers (the `SolidSyslogPosix*` | `SolidSyslogPlusTcpResolverErrors.h` | Any code installing an error handler that wants to react to PlusTcpResolver-specific events (pointer-identity match on `PlusTcpResolverErrorSource`, switch on `enum SolidSyslogPlusTcpResolverErrors`) | `enum SolidSyslogPlusTcpResolverErrors` (`PLUSTCPRESOLVER_ERROR_*` codes + `PLUSTCPRESOLVER_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource PlusTcpResolverErrorSource`. Integrators ignore if not handling errors per source. | | `SolidSyslogLwipRawResolver.h` | System setup code on **any target using lwIP Raw API** that resolves numeric IPv4 hosts (no DNS) | `SolidSyslogLwipRawResolver_Create(void)`, `_Destroy(base)` — Resolve delegates to lwIP's `ipaddr_aton`: whatever the parser accepts, we accept; whatever it rejects (DNS names, alphabetic input, empty string), we reject. We do not enforce any specific shape on top of the parser. Transport is ignored. DNS-name resolution lands as the sibling `SolidSyslogLwipRawDnsResolver`. Instance struct lives in a library-internal static pool (E11). Pool-exhaustion fallback is the shared `SolidSyslogNullResolver`. | | `SolidSyslogLwipRawResolverErrors.h` | Any code installing an error handler that wants to react to LwipRawResolver-specific events (pointer-identity match on `LwipRawResolverErrorSource`, switch on `enum SolidSyslogLwipRawResolverErrors`) | `enum SolidSyslogLwipRawResolverErrors` (`LWIPRAWRESOLVER_ERROR_*` codes + `LWIPRAWRESOLVER_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource LwipRawResolverErrorSource`. Integrators ignore if not handling errors per source. | -| `SolidSyslogLwipRawDnsResolver.h` | System setup code on **any target using lwIP Raw API** that resolves hosts **by name** (DNS) — superset of the numeric resolver: literals, DNS-cache hits, and local-hostlist entries also resolve | `SolidSyslogLwipRawDnsResolverConfig` (required `Sleep`), `SolidSyslogLwipRawDnsResolver_Create(config)`, `_Destroy(base)` — wraps lwIP's async `dns_gethostbyname` under the `SolidSyslogLwipRaw_Marshal` hop (it touches lwIP core state, unlike the numeric resolver's `ipaddr_aton`), bridging it to the synchronous `Resolve()` via a bounded spin on the caller's thread (integrator-supplied `Sleep`; deadline `SOLIDSYSLOG_DNS_RESOLVE_TIMEOUT_MS`, poll `SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVE_POLL_MS`). `ERR_OK` synchronous hit → immediate; `ERR_INPROGRESS` → spin to the `dns_found_callback`; deadline → fail + error report. Transport ignored. Requires `LWIP_DNS=1`. Instance struct lives in a library-internal static pool (E11; tunable `SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE`, default 1). Pool-exhaustion and bad-config (`NULL` config or `NULL` `Sleep`) fallback is the shared `SolidSyslogNullResolver`. See [`docs/integrating-lwip.md`](docs/integrating-lwip.md). | +| `SolidSyslogLwipRawDnsResolver.h` | System setup code on **any target using lwIP Raw API** that resolves hosts **by name** (DNS) — superset of the numeric resolver: literals, DNS-cache hits, and local-hostlist entries also resolve | `SolidSyslogLwipRawDnsResolverConfig` (required `Sleep`), `SolidSyslogLwipRawDnsResolver_Create(config)`, `_Destroy(base)` — wraps lwIP's async `dns_gethostbyname` under the `SolidSyslogLwipRaw_Marshal` hop (it touches lwIP core state, unlike the numeric resolver's `ipaddr_aton`), bridging it to the synchronous `Resolve()` via a bounded spin on the caller's thread (integrator-supplied `Sleep`; deadline `SOLIDSYSLOG_DNS_RESOLVE_TIMEOUT_MS`, poll `SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVE_POLL_MS`). `ERR_OK` synchronous hit → immediate; `ERR_INPROGRESS` → spin to the `dns_found_callback`; deadline → fail + error report. Transport ignored. Requires `LWIP_DNS=1`. Instance struct lives in a library-internal static pool (E11; role tunable `SOLIDSYSLOG_RESOLVER_POOL_SIZE`, default 1). Pool-exhaustion and bad-config (`NULL` config or `NULL` `Sleep`) fallback is the shared `SolidSyslogNullResolver`. See [`docs/integrating-lwip.md`](docs/integrating-lwip.md). | | `SolidSyslogLwipRawDnsResolverErrors.h` | Any code installing an error handler that wants to react to LwipRawDnsResolver-specific events (pointer-identity match on `LwipRawDnsResolverErrorSource`, switch on `enum SolidSyslogLwipRawDnsResolverErrors`) | `enum SolidSyslogLwipRawDnsResolverErrors` (`LWIPRAWDNSRESOLVER_ERROR_*` codes incl. `_RESOLVE_TIMEOUT` + `LWIPRAWDNSRESOLVER_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource LwipRawDnsResolverErrorSource`. Integrators ignore if not handling errors per source. | | `SolidSyslogWinsockResolverErrors.h` | Any code installing an error handler that wants to react to WinsockResolver-specific events (pointer-identity match on `WinsockResolverErrorSource`, switch on `enum SolidSyslogWinsockResolverErrors`) | `enum SolidSyslogWinsockResolverErrors` (`WINSOCKRESOLVER_ERROR_*` codes + `WINSOCKRESOLVER_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource WinsockResolverErrorSource`. Integrators ignore if not handling errors per source. | | `SolidSyslogGetAddrInfoResolverErrors.h` | Any code installing an error handler that wants to react to GetAddrInfoResolver-specific events (pointer-identity match on `GetAddrInfoResolverErrorSource`, switch on `enum SolidSyslogGetAddrInfoResolverErrors`) | `enum SolidSyslogGetAddrInfoResolverErrors` (`GETADDRINFORESOLVER_ERROR_*` codes + `GETADDRINFORESOLVER_ERROR_MAX` bookend), `extern const struct SolidSyslogErrorSource GetAddrInfoResolverErrorSource`. Integrators ignore if not handling errors per source. | @@ -582,6 +582,13 @@ Every stateful Created class lives in a library-internal static pool of N slots, public `_Create` accepts a config struct and returns an opaque handle (a pointer into the pool); `_Destroy` takes the handle and releases the slot. Pool semantics: +Platform- and vendor-selected classes (TCP stream, datagram, resolver, mutex, file, +atomic counter, TLS stream, HMAC policy) share a **role-named** tunable rather than one +name per implementation — `SOLIDSYSLOG_TCP_STREAM_POOL_SIZE`, not a per-platform +`SOLIDSYSLOG_POSIX_TCP_STREAM_*` name. A build links one implementation per role, so +the integrator tunes the role. See `docs/NAMING.md`, *Pool-size tunables are named by +role, not platform*, for the rule and the two-implementations-in-one-build caveat. + - **No `malloc`.** Pools are file-scope `static` arrays. Integrators on bare-metal / FreeRTOS-static-allocation / DO-178C-style targets get the same code path as hosted targets. - **Pool exhaustion** falls back to a shared null sibling — `SolidSyslogNullSender`, diff --git a/Core/Interface/SolidSyslogTunablesDefaults.h b/Core/Interface/SolidSyslogTunablesDefaults.h index de576f6e..157d0afc 100644 --- a/Core/Interface/SolidSyslogTunablesDefaults.h +++ b/Core/Interface/SolidSyslogTunablesDefaults.h @@ -5,6 +5,22 @@ // Defaults are reached through the SolidSyslogTunables.h umbrella so the optional // SOLIDSYSLOG_USER_TUNABLES_FILE override gets a chance to win first. +/* + * Pool-size tunables are named by ROLE, not by platform or vendor. + * + * A build links exactly one implementation of each platform/vendor-selected + * role (one TCP stream backend, one datagram backend, one mutex, one crypto + * vendor, ...), so a single role tunable serves whichever implementation is + * compiled in — the integrator reasons about "how many TCP streams", never + * "how many POSIX streams". SOLIDSYSLOG_ADDRESS_POOL_SIZE established this + * pattern; the role blocks below follow it. + * + * The pool counts INSTANCES, not implementations. If a future build ever + * wires two implementations of the same role into one executable (e.g. a + * numeric AND a DNS resolver, or two crypto vendors), size that role's pool + * to the SUM of the concurrent instances. + */ + /* * Maximum bytes the library will format for a single syslog message. * @@ -106,103 +122,110 @@ #endif /* - * Number of SolidSyslogPosixMutex instances the library's internal - * static pool can simultaneously hold. Each instance carries a - * pthread_mutex_t. + * Role pool: Mutex. Number of mutex instances the library's internal static + * pool can simultaneously hold, across whichever implementation is compiled + * in — SolidSyslogPosixMutex (pthread_mutex_t), SolidSyslogWindowsMutex + * (CRITICAL_SECTION), or SolidSyslogFreeRtosMutex (StaticSemaphore_t). * - * Default 1 — almost all integrators wire a single PosixMutex into - * a CircularBuffer or other thread-safe primitive. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely - * needed. + * Default 1 — most integrators wire a single mutex into a CircularBuffer or + * other thread-safe primitive. Targets that need more (e.g. a separate + * lifecycle mutex alongside a buffer mutex) bump this via + * SOLIDSYSLOG_USER_TUNABLES_FILE. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE -#define SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_MUTEX_POOL_SIZE +#define SOLIDSYSLOG_MUTEX_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE < 1 -#error "SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_MUTEX_POOL_SIZE < 1 +#error "SOLIDSYSLOG_MUTEX_POOL_SIZE must be >= 1" #endif /* - * Number of SolidSyslogPosixDatagram instances the library's internal - * static pool can simultaneously hold. Each instance carries the - * AF_INET socket FD and a one-shot connect flag. + * Role pool: Datagram (UDP transport). Number of datagram instances the + * library's internal static pool can simultaneously hold, across whichever + * implementation is compiled in — SolidSyslogPosixDatagram, + * SolidSyslogWinsockDatagram, SolidSyslogPlusTcpDatagram, or + * SolidSyslogLwipRawDatagram. * - * Default 1 — almost all integrators wire a single PosixDatagram into - * a UdpSender. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than - * one is genuinely needed. + * Default 1 — almost all integrators wire a single datagram into a UdpSender. + * Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely + * needed. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE -#define SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_DATAGRAM_POOL_SIZE +#define SOLIDSYSLOG_DATAGRAM_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_DATAGRAM_POOL_SIZE < 1 +#error "SOLIDSYSLOG_DATAGRAM_POOL_SIZE must be >= 1" #endif /* - * Number of SolidSyslogGetAddrInfoResolver instances the library's - * internal static pool can simultaneously hold. The class is - * effectively stateless today — the pool slot carries the vtable - * holder. + * Role pool: Resolver. Number of resolver instances the library's internal + * static pool can simultaneously hold, across whichever implementation is + * compiled in — SolidSyslogGetAddrInfoResolver, SolidSyslogWinsockResolver, + * SolidSyslogPlusTcpResolver, SolidSyslogLwipRawResolver, or + * SolidSyslogLwipRawDnsResolver. * - * Default 1 — almost all integrators wire a single resolver into - * one or more Senders. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if - * more than one is genuinely needed. + * Default 1 — almost all integrators wire a single resolver shared across + * their Senders. If a build wires two resolver implementations into one + * executable (e.g. the lwIP numeric AND DNS resolver), set this to the sum + * via SOLIDSYSLOG_USER_TUNABLES_FILE. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE -#define SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_RESOLVER_POOL_SIZE +#define SOLIDSYSLOG_RESOLVER_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_RESOLVER_POOL_SIZE < 1 +#error "SOLIDSYSLOG_RESOLVER_POOL_SIZE must be >= 1" #endif /* - * Number of SolidSyslogPosixFile instances the library's internal - * static pool can simultaneously hold. Each instance carries an - * int file descriptor. + * Role pool: File. Number of file instances the library's internal static + * pool can simultaneously hold, across whichever implementation is compiled + * in — SolidSyslogPosixFile, SolidSyslogWindowsFile, or SolidSyslogFatFsFile. * - * Default 1 — almost all integrators wire a single PosixFile into a - * FileBlockDevice. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more - * than one is genuinely needed. + * Default 1 — almost all integrators wire a single file into a + * FileBlockDevice. Integrators using FileBlockDevice with BlockStore may + * want to bump this in line with SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE via + * SOLIDSYSLOG_USER_TUNABLES_FILE. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_POSIX_FILE_POOL_SIZE -#define SOLIDSYSLOG_POSIX_FILE_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_FILE_POOL_SIZE +#define SOLIDSYSLOG_FILE_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_POSIX_FILE_POOL_SIZE < 1 -#error "SOLIDSYSLOG_POSIX_FILE_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_FILE_POOL_SIZE < 1 +#error "SOLIDSYSLOG_FILE_POOL_SIZE must be >= 1" #endif /* - * Number of SolidSyslogPosixTcpStream instances the library's internal - * static pool can simultaneously hold. Each instance carries an - * int file descriptor. + * Role pool: TCP stream. Number of TCP stream instances the library's + * internal static pool can simultaneously hold, across whichever + * implementation is compiled in — SolidSyslogPosixTcpStream, + * SolidSyslogWinsockTcpStream, SolidSyslogPlusTcpTcpStream, or + * SolidSyslogLwipRawTcpStream. * - * Default 2 — the Linux BDD target wires *two* stream-framed senders - * behind a SwitchingSender (plain TCP, plus TLS that wraps another - * underlying PosixTcpStream as its transport), so default 1 would - * silently fall back to NullStream on the second Create. Matches the - * SOLIDSYSLOG_STREAM_SENDER_POOL_SIZE default for the same reason. - * Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more are needed. + * Default 2 — common multi-transport wirings combine a plain TCP stream with + * a second TCP stream that underlies a TLS stream (TLS wraps an injected + * Stream as its byte transport), so a pool of 1 would silently fall the + * second Create back to NullStream. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE + * for wirings that need more. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE -#define SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE 2U +#ifndef SOLIDSYSLOG_TCP_STREAM_POOL_SIZE +#define SOLIDSYSLOG_TCP_STREAM_POOL_SIZE 2U #endif -#if SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_TCP_STREAM_POOL_SIZE < 1 +#error "SOLIDSYSLOG_TCP_STREAM_POOL_SIZE must be >= 1" #endif /* @@ -398,239 +421,6 @@ #error "SOLIDSYSLOG_ORIGIN_SD_POOL_SIZE must be >= 1" #endif -/* - * Number of SolidSyslogWindowsMutex instances the library's internal - * static pool can simultaneously hold. Each instance carries a - * CRITICAL_SECTION. - * - * Default 1 — almost all integrators wire a single WindowsMutex into - * a CircularBuffer or other thread-safe primitive. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely - * needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE -#define SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogWinsockDatagram instances the library's internal - * static pool can simultaneously hold. Each instance carries the AF_INET - * SOCKET handle and a one-shot connect flag. - * - * Default 1 — almost all integrators wire a single WinsockDatagram into - * a UdpSender. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one - * is genuinely needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE -#define SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogWinsockResolver instances the library's internal - * static pool can simultaneously hold. The resolver is stateless (its - * slot just holds the vtable); the pool exists for lifecycle symmetry - * with the stateful PlusTcpResolver / GetAddrInfoResolver siblings. - * - * Default 1. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE -#define SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogWindowsFile instances the library's internal - * static pool can simultaneously hold. Each instance carries an `int` - * MSVC CRT file descriptor. - * - * Default 1. Integrators using FileBlockDevice with BlockStore may want - * to bump this in line with SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE -#define SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogWinsockTcpStream instances the library's internal - * static pool can simultaneously hold. Each instance carries the SOCKET - * for the non-blocking TCP connection. - * - * Default 2 — the BDD target needs a plain-TCP stream and a - * TLS-underlying-TCP stream concurrently, matching the POSIX pool size. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE -#define SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE 2U -#endif - -#if SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogFreeRtosMutex instances the library's internal - * static pool can simultaneously hold. Each instance carries a - * StaticSemaphore_t — the kernel-primitive layout the adapter wraps - * via xSemaphoreCreateMutexStatic. - * - * Default 1 — almost all FreeRTOS integrators wire a single mutex - * into a CircularBuffer or other thread-safe primitive. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely - * needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE -#define SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE < 1 -#error "SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogPlusTcpDatagram instances the library's - * internal static pool can simultaneously hold. Each instance carries - * a FreeRTOS-Plus-TCP Socket_t. - * - * Default 1 — almost all FreeRTOS integrators wire a single datagram - * into a UdpSender. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more - * than one is genuinely needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE -#define SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogPlusTcpResolver instances the library's - * internal static pool can simultaneously hold. Each instance carries - * the 4-byte IPv4 octets the integrator pins it to. - * - * Default 1 — the resolver pairs with a single hardcoded - * destination; the typical FreeRTOS integrator wires one. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE -#define SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogLwipRawResolver instances the library's - * internal static pool can simultaneously hold. The resolver is - * stateless — it just delegates to lwIP's ipaddr_aton on each Resolve - * call — so a single instance comfortably serves any number of senders. - * - * Default 1 — bump via SOLIDSYSLOG_USER_TUNABLES_FILE if a use case - * for multiple instances surfaces (none anticipated). - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE -#define SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogLwipRawDnsResolver instances the library's - * internal static pool can simultaneously hold. Each instance carries - * the in-flight async-resolve state (done flag + resolved address) the - * dns_found_callback writes and the bounded spin polls, so unlike the - * stateless numeric SolidSyslogLwipRawResolver it is not freely shareable - * mid-resolve — but the Service loop is single-threaded per sender, so one - * instance per sender comfortably serialises its own lookups. - * - * Default 1 — almost all integrators wire a single resolver. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if multiple concurrent resolvers surface. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE -#define SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogLwipRawDatagram instances the library's internal - * static pool can simultaneously hold. Each instance carries a single - * struct udp_pcb pointer the wrapper holds across Open/SendTo/Close. - * - * Default 1 — almost all lwIP Raw integrators wire a single datagram into - * a UdpSender. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one - * is genuinely needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE -#define SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogLwipRawTcpStream instances the library's internal - * static pool can simultaneously hold. Each instance carries a struct tcp_pcb - * pointer, the Connected / Errored flags, and a bounded RX pbuf ring sized - * by SOLIDSYSLOG_LWIP_RAW_TCP_RX_QUEUE_SIZE. - * - * Default 2 — matches SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE and the other - * TCP-stream-backend defaults so the canonical TLS-over-plain-TCP pair does - * not silently fall back to NullStream on the second Create. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more are needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE -#define SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE 2U -#endif - -#if SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE must be >= 1" -#endif - /* * Period (milliseconds) the SolidSyslogLwipRawTcpStream bounded-connect * spin loop sleeps between polls of the lwIP-side connected_cb flag. @@ -719,93 +509,33 @@ #endif /* - * Number of SolidSyslogPlusTcpTcpStream instances the library's - * internal static pool can simultaneously hold. Each instance carries - * a FreeRTOS-Plus-TCP Socket_t for the bounded-blocking-connect - * non-blocking TCP transport. - * - * Default 2 — matches the POSIX and Windows TCP stream pool defaults - * so a future TLS-via-mbedTLS path (S08.07) wrapping an underlying - * PlusTcpTcpStream does not silently fall back to NullStream on the - * second Create. Plain-TCP-only integrators pay 8 bytes of extra - * static state; mbedTLS integrators are spared an override. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE -#define SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE 2U -#endif - -#if SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogStdAtomicCounter instances the library's - * internal static pool can simultaneously hold. Each instance carries - * a single _Atomic uint32_t (the sequenceId counter). - * - * Default 1 — RFC 5424 sequenceIds are scoped per SolidSyslog instance, - * and almost all integrators run a single SolidSyslog instance per - * process. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is - * genuinely needed (e.g. several independent SolidSyslog instances). - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE -#define SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogWindowsAtomicCounter instances the library's - * internal static pool can simultaneously hold. Each instance carries - * a single `volatile LONG` (the sequenceId counter, manipulated via - * `InterlockedCompareExchange`). + * Role pool: AtomicCounter. Number of atomic-counter instances the library's + * internal static pool can simultaneously hold, across whichever + * implementation is compiled in — SolidSyslogStdAtomicCounter (C11 + * ) or SolidSyslogWindowsAtomicCounter (legacy MSVC + * InterlockedCompareExchange). Each instance carries a single counter word + * (the sequenceId counter). * - * Default 1 — RFC 5424 sequenceIds are scoped per SolidSyslog instance, - * and almost all integrators run a single SolidSyslog instance per - * process. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is - * genuinely needed. + * Default 1 — RFC 5424 sequenceIds are scoped per SolidSyslog instance, and + * almost all integrators run a single SolidSyslog instance per process. Bump + * via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE -#define SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE +#define SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE < 1 -#error "SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE < 1 +#error "SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE must be >= 1" #endif /* - * Number of SolidSyslogFatFsFile instances the library's internal static - * pool can simultaneously hold. Each instance carries a FatFs FIL object - * (~56 B header + 512 B sector buffer when FF_MAX_SS=512, FF_FS_TINY=0) - * plus an IsOpen flag. - * - * Default 1 — store-and-forward integrations wire a single file under - * BlockStore + FileBlockDevice; that's the dominant pattern. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_FATFS_FILE_POOL_SIZE -#define SOLIDSYSLOG_FATFS_FILE_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_FATFS_FILE_POOL_SIZE < 1 -#error "SOLIDSYSLOG_FATFS_FILE_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogTlsStream instances the library's internal static - * pool can simultaneously hold. Each instance carries an SSL_CTX*, SSL*, - * BIO_METHOD*, and the integrator's TlsStreamConfig (transport pointer, - * sleep callback, cert/key/CA paths). + * Role pool: TLS stream. Number of TLS stream instances the library's + * internal static pool can simultaneously hold, across whichever crypto + * vendor is compiled in — SolidSyslogTlsStream (OpenSSL) or + * SolidSyslogMbedTlsStream (Mbed TLS). Each instance carries the vendor's + * session/context handles and the integrator's TLS config. * * Default 1 — TLS senders are scoped per destination and almost all * integrators wire a single TLS sender per process. Bump via @@ -823,65 +553,26 @@ #endif /* - * Number of SolidSyslogMbedTlsStream instances the library's internal static - * pool can simultaneously hold. Each instance carries an mbedtls_ssl_context, - * mbedtls_ssl_config, and the integrator's MbedTlsStreamConfig (transport - * pointer, sleep callback, mbedTLS handle pointers — Rng, CaChain, optional - * ClientCertChain/ClientKey). - * - * Default 1 — TLS senders are scoped per destination and almost all - * integrators wire a single TLS sender per process. Bump via - * SOLIDSYSLOG_USER_TUNABLES_FILE if more than one is genuinely needed - * (e.g. multi-destination egress with separate TLS sessions per peer). - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE -#define SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE < 1 -#error "SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogMbedTlsHmacSha256Policy instances the library's internal - * static pool can simultaneously hold. Each instance carries the integrator's - * key-accessor callback (SolidSyslogKeyFunction) and its context — the policy - * fetches the key on demand and never stores it. - * - * Default 1 — a single at-rest store with one integrity policy is the common - * case. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one store with an - * independent key is genuinely needed. - * - * Floor: 1. Sub-floor values rejected at compile time. - */ -#ifndef SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE -#define SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE 1U -#endif - -#if SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE < 1 -#error "SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE must be >= 1" -#endif - -/* - * Number of SolidSyslogOpenSslHmacSha256Policy instances the library's internal - * static pool can simultaneously hold. The OpenSSL sibling of the mbedTLS HMAC - * policy above — same key-on-demand contract (SolidSyslogKeyFunction; the key - * is fetched per operation and never stored on the instance). + * Role pool: HMAC-SHA256 SecurityPolicy. Number of keyed HMAC policy + * instances the library's internal static pool can simultaneously hold, + * across whichever crypto vendor is compiled in — + * SolidSyslogMbedTlsHmacSha256Policy or SolidSyslogOpenSslHmacSha256Policy. + * Each instance carries the integrator's key-accessor callback + * (SolidSyslogKeyFunction) and its context — the policy fetches the key on + * demand and never stores it. * * Default 1 — a single at-rest store with one integrity policy is the common - * case. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one store with an - * independent key is genuinely needed. + * case. Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than one store with + * an independent key is genuinely needed. * * Floor: 1. Sub-floor values rejected at compile time. */ -#ifndef SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE -#define SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE 1U +#ifndef SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE +#define SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE 1U #endif -#if SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE < 1 -#error "SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE must be >= 1" +#if SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE < 1 +#error "SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE must be >= 1" #endif /* @@ -912,7 +603,7 @@ * Default 3 — matches the canonical BDD multi-transport wiring * (UDP + plain-TCP + TLS-stream, one Address per Sender) so common * integrators are spared an override. Same trade-off as - * SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE / _STREAM_SENDER_POOL_SIZE: + * SOLIDSYSLOG_TCP_STREAM_POOL_SIZE / _STREAM_SENDER_POOL_SIZE: * single-transport integrators pay ~32 bytes of unused slots per platform; * multi-transport integrators get the canonical wiring out of the box. * Bump via SOLIDSYSLOG_USER_TUNABLES_FILE if more than three concurrent diff --git a/DEVLOG.md b/DEVLOG.md index 4098b838..d7feadff 100644 --- a/DEVLOG.md +++ b/DEVLOG.md @@ -1,5 +1,43 @@ # Dev Log +## 2026-06-01 — S24.17 Collapse per-platform pool tunables to role-based + +Reduced the pool-size tunable surface in `SolidSyslogTunablesDefaults.h` from +35 macros to 18 by collapsing 8 platform/vendor-selected role groups (TCP +stream, datagram, resolver, mutex, file, atomic counter, TLS stream, HMAC +policy) to a single role-named tunable each. A build links exactly one +implementation per role, so the integrator now tunes the role +(`SOLIDSYSLOG_TCP_STREAM_POOL_SIZE`) rather than the platform +(`SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE`). Pure rename + header +consolidation; no behaviour change. + +### Decisions + +- **Extends the Address precedent, not a new pattern.** `ADDRESS_POOL_SIZE` + already pooled three platform Address types under one role tunable; this + applies the same model to the rest. The table now grows O(1) per new + OS/stack/vendor instead of O(roles). + +- **Role pool counts instances, not implementations.** Documented in + `docs/NAMING.md` and the header preamble. The two same-platform coexistence + cases (lwIP numeric + DNS resolver; two crypto vendors) share a role pool — + wire N, set the pool to N. A pre-implementation audit (issue #501) confirmed + no current BDD executable wires two implementations of one role, so every + per-platform override mapped 1:1 to a role override at the same value + (`FREE_RTOS_MUTEX=2` → `MUTEX=2`; the fixture's two atomic-counter lines + collapsed to one). + +- **Clean break, no deprecated aliases.** Pre-1.0; the 17 removed names appear + nowhere in the tree (verified by grep). All floor `static_assert`s preserved. + +### Deferred + +- Nothing — single mechanical commit. + +### Open questions + +- None. + ## 2026-06-01 — S12.21 Extract SolidSyslogMessageFormatter Lifted the rest of the RFC 5424 wire-format knowledge (PRIVAL, header layout, diff --git a/Platform/Atomics/Source/SolidSyslogStdAtomicCounterStatic.c b/Platform/Atomics/Source/SolidSyslogStdAtomicCounterStatic.c index 7c89f870..679e580b 100644 --- a/Platform/Atomics/Source/SolidSyslogStdAtomicCounterStatic.c +++ b/Platform/Atomics/Source/SolidSyslogStdAtomicCounterStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogAtomicCounter; static inline size_t StdAtomicCounter_IndexFromHandle(const struct SolidSyslogAtomicCounter* base); static inline void StdAtomicCounter_CleanupAtIndex(size_t index, void* context); -static bool StdAtomicCounter_InUse[SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE]; -static struct SolidSyslogStdAtomicCounter StdAtomicCounter_Pool[SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE]; +static bool StdAtomicCounter_InUse[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE]; +static struct SolidSyslogStdAtomicCounter StdAtomicCounter_Pool[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE]; static struct SolidSyslogPoolAllocator StdAtomicCounter_Allocator = { StdAtomicCounter_InUse, - SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE + SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE }; struct SolidSyslogAtomicCounter* SolidSyslogStdAtomicCounter_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogStdAtomicCounter_Destroy(struct SolidSyslogAtomicCounter* base) static inline size_t StdAtomicCounter_IndexFromHandle(const struct SolidSyslogAtomicCounter* base) { - size_t result = SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; poolIndex++) { if (base == &StdAtomicCounter_Pool[poolIndex].Base) { diff --git a/Platform/FatFs/Source/SolidSyslogFatFsFileStatic.c b/Platform/FatFs/Source/SolidSyslogFatFsFileStatic.c index 30a50e9f..706b4d3c 100644 --- a/Platform/FatFs/Source/SolidSyslogFatFsFileStatic.c +++ b/Platform/FatFs/Source/SolidSyslogFatFsFileStatic.c @@ -17,9 +17,9 @@ struct SolidSyslogFile; static inline size_t FatFsFile_IndexFromHandle(const struct SolidSyslogFile* base); static inline void FatFsFile_CleanupAtIndex(size_t index, void* context); -static bool FatFsFile_InUse[SOLIDSYSLOG_FATFS_FILE_POOL_SIZE]; -static struct SolidSyslogFatFsFile FatFsFile_Pool[SOLIDSYSLOG_FATFS_FILE_POOL_SIZE]; -static struct SolidSyslogPoolAllocator FatFsFile_Allocator = {FatFsFile_InUse, SOLIDSYSLOG_FATFS_FILE_POOL_SIZE}; +static bool FatFsFile_InUse[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogFatFsFile FatFsFile_Pool[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogPoolAllocator FatFsFile_Allocator = {FatFsFile_InUse, SOLIDSYSLOG_FILE_POOL_SIZE}; struct SolidSyslogFile* SolidSyslogFatFsFile_Create(void) { @@ -54,8 +54,8 @@ void SolidSyslogFatFsFile_Destroy(struct SolidSyslogFile* base) static inline size_t FatFsFile_IndexFromHandle(const struct SolidSyslogFile* base) { - size_t result = SOLIDSYSLOG_FATFS_FILE_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_FATFS_FILE_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_FILE_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_FILE_POOL_SIZE; poolIndex++) { if (base == &FatFsFile_Pool[poolIndex].Base) { diff --git a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexStatic.c b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexStatic.c index dc0ed74f..a3968242 100644 --- a/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexStatic.c +++ b/Platform/FreeRtos/Source/SolidSyslogFreeRtosMutexStatic.c @@ -17,12 +17,9 @@ struct SolidSyslogMutex; static inline size_t FreeRtosMutex_IndexFromHandle(const struct SolidSyslogMutex* base); static inline void FreeRtosMutex_CleanupAtIndex(size_t index, void* context); -static bool FreeRtosMutex_InUse[SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE]; -static struct SolidSyslogFreeRtosMutex FreeRtosMutex_Pool[SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE]; -static struct SolidSyslogPoolAllocator FreeRtosMutex_Allocator = { - FreeRtosMutex_InUse, - SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE -}; +static bool FreeRtosMutex_InUse[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogFreeRtosMutex FreeRtosMutex_Pool[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogPoolAllocator FreeRtosMutex_Allocator = {FreeRtosMutex_InUse, SOLIDSYSLOG_MUTEX_POOL_SIZE}; struct SolidSyslogMutex* SolidSyslogFreeRtosMutex_Create(void) { @@ -62,8 +59,8 @@ void SolidSyslogFreeRtosMutex_Destroy(struct SolidSyslogMutex* base) static inline size_t FreeRtosMutex_IndexFromHandle(const struct SolidSyslogMutex* base) { - size_t result = SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_MUTEX_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_MUTEX_POOL_SIZE; poolIndex++) { if (base == &FreeRtosMutex_Pool[poolIndex].Base) { diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagramStatic.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagramStatic.c index 2031ab43..90d3ae27 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagramStatic.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawDatagramStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogDatagram; static inline size_t LwipRawDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base); static inline void LwipRawDatagram_CleanupAtIndex(size_t index, void* context); -static bool LwipRawDatagram_InUse[SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE]; -static struct SolidSyslogLwipRawDatagram LwipRawDatagram_Pool[SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE]; +static bool LwipRawDatagram_InUse[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; +static struct SolidSyslogLwipRawDatagram LwipRawDatagram_Pool[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator LwipRawDatagram_Allocator = { LwipRawDatagram_InUse, - SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE + SOLIDSYSLOG_DATAGRAM_POOL_SIZE }; struct SolidSyslogDatagram* SolidSyslogLwipRawDatagram_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogLwipRawDatagram_Destroy(struct SolidSyslogDatagram* base) static inline size_t LwipRawDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base) { - size_t result = SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_DATAGRAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_DATAGRAM_POOL_SIZE; poolIndex++) { if (base == &LwipRawDatagram_Pool[poolIndex].Base) { diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverStatic.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverStatic.c index 0daaaecf..1f496455 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverStatic.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawDnsResolverStatic.c @@ -18,11 +18,11 @@ static inline bool LwipRawDnsResolver_IsValidConfig(const struct SolidSyslogLwip static inline size_t LwipRawDnsResolver_IndexFromHandle(const struct SolidSyslogResolver* base); static inline void LwipRawDnsResolver_CleanupAtIndex(size_t index, void* context); -static bool LwipRawDnsResolver_InUse[SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE]; -static struct SolidSyslogLwipRawDnsResolver LwipRawDnsResolver_Pool[SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE]; +static bool LwipRawDnsResolver_InUse[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; +static struct SolidSyslogLwipRawDnsResolver LwipRawDnsResolver_Pool[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; static struct SolidSyslogPoolAllocator LwipRawDnsResolver_Allocator = { LwipRawDnsResolver_InUse, - SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE + SOLIDSYSLOG_RESOLVER_POOL_SIZE }; struct SolidSyslogResolver* SolidSyslogLwipRawDnsResolver_Create( @@ -77,8 +77,8 @@ static inline bool LwipRawDnsResolver_IsValidConfig(const struct SolidSyslogLwip static inline size_t LwipRawDnsResolver_IndexFromHandle(const struct SolidSyslogResolver* base) { - size_t result = SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_RESOLVER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_RESOLVER_POOL_SIZE; poolIndex++) { if (base == &LwipRawDnsResolver_Pool[poolIndex].Base) { diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawResolverStatic.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawResolverStatic.c index 65b076fd..ada243e6 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawResolverStatic.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawResolverStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogResolver; static inline size_t LwipRawResolver_IndexFromHandle(const struct SolidSyslogResolver* base); static inline void LwipRawResolver_CleanupAtIndex(size_t index, void* context); -static bool LwipRawResolver_InUse[SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE]; -static struct SolidSyslogLwipRawResolver LwipRawResolver_Pool[SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE]; +static bool LwipRawResolver_InUse[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; +static struct SolidSyslogLwipRawResolver LwipRawResolver_Pool[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; static struct SolidSyslogPoolAllocator LwipRawResolver_Allocator = { LwipRawResolver_InUse, - SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE + SOLIDSYSLOG_RESOLVER_POOL_SIZE }; struct SolidSyslogResolver* SolidSyslogLwipRawResolver_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogLwipRawResolver_Destroy(struct SolidSyslogResolver* base) static inline size_t LwipRawResolver_IndexFromHandle(const struct SolidSyslogResolver* base) { - size_t result = SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_RESOLVER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_RESOLVER_POOL_SIZE; poolIndex++) { if (base == &LwipRawResolver_Pool[poolIndex].Base) { diff --git a/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStreamStatic.c b/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStreamStatic.c index 6a9106c4..f6dcdc4c 100644 --- a/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStreamStatic.c +++ b/Platform/LwipRaw/Source/SolidSyslogLwipRawTcpStreamStatic.c @@ -18,11 +18,11 @@ static inline bool LwipRawTcpStream_IsValidConfig(const struct SolidSyslogLwipRa static inline size_t LwipRawTcpStream_IndexFromHandle(const struct SolidSyslogStream* base); static inline void LwipRawTcpStream_CleanupAtIndex(size_t index, void* context); -static bool LwipRawTcpStream_InUse[SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE]; -static struct SolidSyslogLwipRawTcpStream LwipRawTcpStream_Pool[SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE]; +static bool LwipRawTcpStream_InUse[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; +static struct SolidSyslogLwipRawTcpStream LwipRawTcpStream_Pool[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator LwipRawTcpStream_Allocator = { LwipRawTcpStream_InUse, - SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE + SOLIDSYSLOG_TCP_STREAM_POOL_SIZE }; struct SolidSyslogStream* SolidSyslogLwipRawTcpStream_Create(const struct SolidSyslogLwipRawTcpStreamConfig* config) @@ -71,8 +71,8 @@ static inline bool LwipRawTcpStream_IsValidConfig(const struct SolidSyslogLwipRa static inline size_t LwipRawTcpStream_IndexFromHandle(const struct SolidSyslogStream* base) { - size_t result = SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; poolIndex++) { if (base == &LwipRawTcpStream_Pool[poolIndex].Base) { diff --git a/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256PolicyStatic.c b/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256PolicyStatic.c index 495aae07..01be9f98 100644 --- a/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256PolicyStatic.c +++ b/Platform/MbedTls/Source/SolidSyslogMbedTlsHmacSha256PolicyStatic.c @@ -16,12 +16,11 @@ static inline bool MbedTlsHmacSha256Policy_ConfigIsValid(const struct SolidSyslo static inline size_t MbedTlsHmacSha256Policy_IndexFromHandle(const struct SolidSyslogSecurityPolicy* base); static inline void MbedTlsHmacSha256Policy_CleanupAtIndex(size_t index, void* context); -static bool MbedTlsHmacSha256Policy_InUse[SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE]; -static struct SolidSyslogMbedTlsHmacSha256Policy - MbedTlsHmacSha256Policy_Pool[SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE]; +static bool MbedTlsHmacSha256Policy_InUse[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE]; +static struct SolidSyslogMbedTlsHmacSha256Policy MbedTlsHmacSha256Policy_Pool[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE]; static struct SolidSyslogPoolAllocator MbedTlsHmacSha256Policy_Allocator = { MbedTlsHmacSha256Policy_InUse, - SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE + SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE }; struct SolidSyslogSecurityPolicy* SolidSyslogMbedTlsHmacSha256Policy_Create( @@ -72,8 +71,8 @@ static inline bool MbedTlsHmacSha256Policy_ConfigIsValid(const struct SolidSyslo static inline size_t MbedTlsHmacSha256Policy_IndexFromHandle(const struct SolidSyslogSecurityPolicy* base) { - size_t result = SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE; poolIndex++) { if (base == &MbedTlsHmacSha256Policy_Pool[poolIndex].Base) { diff --git a/Platform/MbedTls/Source/SolidSyslogMbedTlsStreamStatic.c b/Platform/MbedTls/Source/SolidSyslogMbedTlsStreamStatic.c index 4933b433..47e41a4e 100644 --- a/Platform/MbedTls/Source/SolidSyslogMbedTlsStreamStatic.c +++ b/Platform/MbedTls/Source/SolidSyslogMbedTlsStreamStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogStream; static inline size_t MbedTlsStream_IndexFromHandle(const struct SolidSyslogStream* base); static inline void MbedTlsStream_CleanupAtIndex(size_t index, void* context); -static bool MbedTlsStream_InUse[SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE]; -static struct SolidSyslogMbedTlsStream MbedTlsStream_Pool[SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE]; +static bool MbedTlsStream_InUse[SOLIDSYSLOG_TLS_STREAM_POOL_SIZE]; +static struct SolidSyslogMbedTlsStream MbedTlsStream_Pool[SOLIDSYSLOG_TLS_STREAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator MbedTlsStream_Allocator = { MbedTlsStream_InUse, - SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE + SOLIDSYSLOG_TLS_STREAM_POOL_SIZE }; struct SolidSyslogStream* SolidSyslogMbedTlsStream_Create(const struct SolidSyslogMbedTlsStreamConfig* config) @@ -62,8 +62,8 @@ void SolidSyslogMbedTlsStream_Destroy(struct SolidSyslogStream* base) static inline size_t MbedTlsStream_IndexFromHandle(const struct SolidSyslogStream* base) { - size_t result = SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_TLS_STREAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_TLS_STREAM_POOL_SIZE; poolIndex++) { if (base == &MbedTlsStream_Pool[poolIndex].Base) { diff --git a/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256PolicyStatic.c b/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256PolicyStatic.c index b2072cd0..810120b5 100644 --- a/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256PolicyStatic.c +++ b/Platform/OpenSsl/Source/SolidSyslogOpenSslHmacSha256PolicyStatic.c @@ -16,12 +16,11 @@ static inline bool OpenSslHmacSha256Policy_ConfigIsValid(const struct SolidSyslo static inline size_t OpenSslHmacSha256Policy_IndexFromHandle(const struct SolidSyslogSecurityPolicy* base); static inline void OpenSslHmacSha256Policy_CleanupAtIndex(size_t index, void* context); -static bool OpenSslHmacSha256Policy_InUse[SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE]; -static struct SolidSyslogOpenSslHmacSha256Policy - OpenSslHmacSha256Policy_Pool[SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE]; +static bool OpenSslHmacSha256Policy_InUse[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE]; +static struct SolidSyslogOpenSslHmacSha256Policy OpenSslHmacSha256Policy_Pool[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE]; static struct SolidSyslogPoolAllocator OpenSslHmacSha256Policy_Allocator = { OpenSslHmacSha256Policy_InUse, - SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE + SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE }; struct SolidSyslogSecurityPolicy* SolidSyslogOpenSslHmacSha256Policy_Create( @@ -72,8 +71,8 @@ static inline bool OpenSslHmacSha256Policy_ConfigIsValid(const struct SolidSyslo static inline size_t OpenSslHmacSha256Policy_IndexFromHandle(const struct SolidSyslogSecurityPolicy* base) { - size_t result = SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE; poolIndex++) { if (base == &OpenSslHmacSha256Policy_Pool[poolIndex].Base) { diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagramStatic.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagramStatic.c index bcdad447..76c659d3 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagramStatic.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpDatagramStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogDatagram; static inline size_t PlusTcpDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base); static inline void PlusTcpDatagram_CleanupAtIndex(size_t index, void* context); -static bool PlusTcpDatagram_InUse[SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE]; -static struct SolidSyslogPlusTcpDatagram PlusTcpDatagram_Pool[SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE]; +static bool PlusTcpDatagram_InUse[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; +static struct SolidSyslogPlusTcpDatagram PlusTcpDatagram_Pool[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator PlusTcpDatagram_Allocator = { PlusTcpDatagram_InUse, - SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE + SOLIDSYSLOG_DATAGRAM_POOL_SIZE }; struct SolidSyslogDatagram* SolidSyslogPlusTcpDatagram_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogPlusTcpDatagram_Destroy(struct SolidSyslogDatagram* base) static inline size_t PlusTcpDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base) { - size_t result = SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_DATAGRAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_DATAGRAM_POOL_SIZE; poolIndex++) { if (base == &PlusTcpDatagram_Pool[poolIndex].Base) { diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpResolverStatic.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpResolverStatic.c index 6efa953b..4292c021 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpResolverStatic.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpResolverStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogResolver; static inline size_t PlusTcpResolver_IndexFromHandle(const struct SolidSyslogResolver* base); static inline void PlusTcpResolver_CleanupAtIndex(size_t index, void* context); -static bool PlusTcpResolver_InUse[SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE]; -static struct SolidSyslogPlusTcpResolver PlusTcpResolver_Pool[SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE]; +static bool PlusTcpResolver_InUse[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; +static struct SolidSyslogPlusTcpResolver PlusTcpResolver_Pool[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; static struct SolidSyslogPoolAllocator PlusTcpResolver_Allocator = { PlusTcpResolver_InUse, - SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE + SOLIDSYSLOG_RESOLVER_POOL_SIZE }; struct SolidSyslogResolver* SolidSyslogPlusTcpResolver_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogPlusTcpResolver_Destroy(struct SolidSyslogResolver* base) static inline size_t PlusTcpResolver_IndexFromHandle(const struct SolidSyslogResolver* base) { - size_t result = SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_RESOLVER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_RESOLVER_POOL_SIZE; poolIndex++) { if (base == &PlusTcpResolver_Pool[poolIndex].Base) { diff --git a/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStreamStatic.c b/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStreamStatic.c index d086779f..238baaf5 100644 --- a/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStreamStatic.c +++ b/Platform/PlusTcp/Source/SolidSyslogPlusTcpTcpStreamStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogStream; static inline size_t PlusTcpTcpStream_IndexFromHandle(const struct SolidSyslogStream* base); static inline void PlusTcpTcpStream_CleanupAtIndex(size_t index, void* context); -static bool PlusTcpTcpStream_InUse[SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE]; -static struct SolidSyslogPlusTcpTcpStream PlusTcpTcpStream_Pool[SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE]; +static bool PlusTcpTcpStream_InUse[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; +static struct SolidSyslogPlusTcpTcpStream PlusTcpTcpStream_Pool[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator PlusTcpTcpStream_Allocator = { PlusTcpTcpStream_InUse, - SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE + SOLIDSYSLOG_TCP_STREAM_POOL_SIZE }; struct SolidSyslogStream* SolidSyslogPlusTcpTcpStream_Create(const struct SolidSyslogPlusTcpTcpStreamConfig* config) @@ -62,8 +62,8 @@ void SolidSyslogPlusTcpTcpStream_Destroy(struct SolidSyslogStream* base) static inline size_t PlusTcpTcpStream_IndexFromHandle(const struct SolidSyslogStream* base) { - size_t result = SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; poolIndex++) { if (base == &PlusTcpTcpStream_Pool[poolIndex].Base) { diff --git a/Platform/Posix/Source/SolidSyslogGetAddrInfoResolverStatic.c b/Platform/Posix/Source/SolidSyslogGetAddrInfoResolverStatic.c index 5bb50318..f4285a88 100644 --- a/Platform/Posix/Source/SolidSyslogGetAddrInfoResolverStatic.c +++ b/Platform/Posix/Source/SolidSyslogGetAddrInfoResolverStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogResolver; static inline size_t GetAddrInfoResolver_IndexFromHandle(const struct SolidSyslogResolver* base); static inline void GetAddrInfoResolver_CleanupAtIndex(size_t index, void* context); -static bool GetAddrInfoResolver_InUse[SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE]; -static struct SolidSyslogGetAddrInfoResolver GetAddrInfoResolver_Pool[SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE]; +static bool GetAddrInfoResolver_InUse[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; +static struct SolidSyslogGetAddrInfoResolver GetAddrInfoResolver_Pool[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; static struct SolidSyslogPoolAllocator GetAddrInfoResolver_Allocator = { GetAddrInfoResolver_InUse, - SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE + SOLIDSYSLOG_RESOLVER_POOL_SIZE }; struct SolidSyslogResolver* SolidSyslogGetAddrInfoResolver_Create(void) @@ -66,8 +66,8 @@ void SolidSyslogGetAddrInfoResolver_Destroy(struct SolidSyslogResolver* base) static inline size_t GetAddrInfoResolver_IndexFromHandle(const struct SolidSyslogResolver* base) { - size_t result = SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_RESOLVER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_RESOLVER_POOL_SIZE; poolIndex++) { if (base == &GetAddrInfoResolver_Pool[poolIndex].Base) { diff --git a/Platform/Posix/Source/SolidSyslogPosixDatagramStatic.c b/Platform/Posix/Source/SolidSyslogPosixDatagramStatic.c index 9ec205f0..daf2eec8 100644 --- a/Platform/Posix/Source/SolidSyslogPosixDatagramStatic.c +++ b/Platform/Posix/Source/SolidSyslogPosixDatagramStatic.c @@ -17,12 +17,9 @@ struct SolidSyslogDatagram; static inline size_t PosixDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base); static inline void PosixDatagram_CleanupAtIndex(size_t index, void* context); -static bool PosixDatagram_InUse[SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE]; -static struct SolidSyslogPosixDatagram PosixDatagram_Pool[SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE]; -static struct SolidSyslogPoolAllocator PosixDatagram_Allocator = { - PosixDatagram_InUse, - SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE -}; +static bool PosixDatagram_InUse[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; +static struct SolidSyslogPosixDatagram PosixDatagram_Pool[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; +static struct SolidSyslogPoolAllocator PosixDatagram_Allocator = {PosixDatagram_InUse, SOLIDSYSLOG_DATAGRAM_POOL_SIZE}; struct SolidSyslogDatagram* SolidSyslogPosixDatagram_Create(void) { @@ -62,8 +59,8 @@ void SolidSyslogPosixDatagram_Destroy(struct SolidSyslogDatagram* base) static inline size_t PosixDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base) { - size_t result = SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_DATAGRAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_DATAGRAM_POOL_SIZE; poolIndex++) { if (base == &PosixDatagram_Pool[poolIndex].Base) { diff --git a/Platform/Posix/Source/SolidSyslogPosixFileStatic.c b/Platform/Posix/Source/SolidSyslogPosixFileStatic.c index 803e6bb2..f7d7453d 100644 --- a/Platform/Posix/Source/SolidSyslogPosixFileStatic.c +++ b/Platform/Posix/Source/SolidSyslogPosixFileStatic.c @@ -17,9 +17,9 @@ struct SolidSyslogFile; static inline size_t PosixFile_IndexFromHandle(const struct SolidSyslogFile* base); static inline void PosixFile_CleanupAtIndex(size_t index, void* context); -static bool PosixFile_InUse[SOLIDSYSLOG_POSIX_FILE_POOL_SIZE]; -static struct SolidSyslogPosixFile PosixFile_Pool[SOLIDSYSLOG_POSIX_FILE_POOL_SIZE]; -static struct SolidSyslogPoolAllocator PosixFile_Allocator = {PosixFile_InUse, SOLIDSYSLOG_POSIX_FILE_POOL_SIZE}; +static bool PosixFile_InUse[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogPosixFile PosixFile_Pool[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogPoolAllocator PosixFile_Allocator = {PosixFile_InUse, SOLIDSYSLOG_FILE_POOL_SIZE}; struct SolidSyslogFile* SolidSyslogPosixFile_Create(void) { @@ -54,8 +54,8 @@ void SolidSyslogPosixFile_Destroy(struct SolidSyslogFile* base) static inline size_t PosixFile_IndexFromHandle(const struct SolidSyslogFile* base) { - size_t result = SOLIDSYSLOG_POSIX_FILE_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_POSIX_FILE_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_FILE_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_FILE_POOL_SIZE; poolIndex++) { if (base == &PosixFile_Pool[poolIndex].Base) { diff --git a/Platform/Posix/Source/SolidSyslogPosixMutexStatic.c b/Platform/Posix/Source/SolidSyslogPosixMutexStatic.c index 9ad8128f..b0277d8a 100644 --- a/Platform/Posix/Source/SolidSyslogPosixMutexStatic.c +++ b/Platform/Posix/Source/SolidSyslogPosixMutexStatic.c @@ -17,9 +17,9 @@ struct SolidSyslogMutex; static inline size_t PosixMutex_IndexFromHandle(const struct SolidSyslogMutex* base); static inline void PosixMutex_CleanupAtIndex(size_t index, void* context); -static bool PosixMutex_InUse[SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE]; -static struct SolidSyslogPosixMutex PosixMutex_Pool[SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE]; -static struct SolidSyslogPoolAllocator PosixMutex_Allocator = {PosixMutex_InUse, SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE}; +static bool PosixMutex_InUse[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogPosixMutex PosixMutex_Pool[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogPoolAllocator PosixMutex_Allocator = {PosixMutex_InUse, SOLIDSYSLOG_MUTEX_POOL_SIZE}; struct SolidSyslogMutex* SolidSyslogPosixMutex_Create(void) { @@ -58,8 +58,8 @@ void SolidSyslogPosixMutex_Destroy(struct SolidSyslogMutex* base) static inline size_t PosixMutex_IndexFromHandle(const struct SolidSyslogMutex* base) { - size_t result = SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_MUTEX_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_MUTEX_POOL_SIZE; poolIndex++) { if (base == &PosixMutex_Pool[poolIndex].Base) { diff --git a/Platform/Posix/Source/SolidSyslogPosixTcpStreamStatic.c b/Platform/Posix/Source/SolidSyslogPosixTcpStreamStatic.c index 9d9cf64e..6ba09642 100644 --- a/Platform/Posix/Source/SolidSyslogPosixTcpStreamStatic.c +++ b/Platform/Posix/Source/SolidSyslogPosixTcpStreamStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogStream; static inline size_t PosixTcpStream_IndexFromHandle(const struct SolidSyslogStream* base); static inline void PosixTcpStream_CleanupAtIndex(size_t index, void* context); -static bool PosixTcpStream_InUse[SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE]; -static struct SolidSyslogPosixTcpStream PosixTcpStream_Pool[SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE]; +static bool PosixTcpStream_InUse[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; +static struct SolidSyslogPosixTcpStream PosixTcpStream_Pool[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator PosixTcpStream_Allocator = { PosixTcpStream_InUse, - SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE + SOLIDSYSLOG_TCP_STREAM_POOL_SIZE }; struct SolidSyslogStream* SolidSyslogPosixTcpStream_Create(const struct SolidSyslogPosixTcpStreamConfig* config) @@ -62,8 +62,8 @@ void SolidSyslogPosixTcpStream_Destroy(struct SolidSyslogStream* base) static inline size_t PosixTcpStream_IndexFromHandle(const struct SolidSyslogStream* base) { - size_t result = SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; poolIndex++) { if (base == &PosixTcpStream_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWindowsAtomicCounterStatic.c b/Platform/Windows/Source/SolidSyslogWindowsAtomicCounterStatic.c index 185c926a..2a2ae90b 100644 --- a/Platform/Windows/Source/SolidSyslogWindowsAtomicCounterStatic.c +++ b/Platform/Windows/Source/SolidSyslogWindowsAtomicCounterStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogAtomicCounter; static inline size_t WindowsAtomicCounter_IndexFromHandle(const struct SolidSyslogAtomicCounter* base); static inline void WindowsAtomicCounter_CleanupAtIndex(size_t index, void* context); -static bool WindowsAtomicCounter_InUse[SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE]; -static struct SolidSyslogWindowsAtomicCounter WindowsAtomicCounter_Pool[SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE]; +static bool WindowsAtomicCounter_InUse[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE]; +static struct SolidSyslogWindowsAtomicCounter WindowsAtomicCounter_Pool[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE]; static struct SolidSyslogPoolAllocator WindowsAtomicCounter_Allocator = { WindowsAtomicCounter_InUse, - SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE + SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE }; struct SolidSyslogAtomicCounter* SolidSyslogWindowsAtomicCounter_Create(void) @@ -66,8 +66,8 @@ void SolidSyslogWindowsAtomicCounter_Destroy(struct SolidSyslogAtomicCounter* ba static inline size_t WindowsAtomicCounter_IndexFromHandle(const struct SolidSyslogAtomicCounter* base) { - size_t result = SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; poolIndex++) { if (base == &WindowsAtomicCounter_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWindowsFileStatic.c b/Platform/Windows/Source/SolidSyslogWindowsFileStatic.c index 7020e376..659d7354 100644 --- a/Platform/Windows/Source/SolidSyslogWindowsFileStatic.c +++ b/Platform/Windows/Source/SolidSyslogWindowsFileStatic.c @@ -17,9 +17,9 @@ struct SolidSyslogFile; static inline size_t WindowsFile_IndexFromHandle(const struct SolidSyslogFile* base); static inline void WindowsFile_CleanupAtIndex(size_t index, void* context); -static bool WindowsFile_InUse[SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE]; -static struct SolidSyslogWindowsFile WindowsFile_Pool[SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE]; -static struct SolidSyslogPoolAllocator WindowsFile_Allocator = {WindowsFile_InUse, SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE}; +static bool WindowsFile_InUse[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogWindowsFile WindowsFile_Pool[SOLIDSYSLOG_FILE_POOL_SIZE]; +static struct SolidSyslogPoolAllocator WindowsFile_Allocator = {WindowsFile_InUse, SOLIDSYSLOG_FILE_POOL_SIZE}; struct SolidSyslogFile* SolidSyslogWindowsFile_Create(void) { @@ -59,8 +59,8 @@ void SolidSyslogWindowsFile_Destroy(struct SolidSyslogFile* base) static inline size_t WindowsFile_IndexFromHandle(const struct SolidSyslogFile* base) { - size_t result = SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_FILE_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_FILE_POOL_SIZE; poolIndex++) { if (base == &WindowsFile_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWindowsMutexStatic.c b/Platform/Windows/Source/SolidSyslogWindowsMutexStatic.c index 2fcee3fa..9bd21d51 100644 --- a/Platform/Windows/Source/SolidSyslogWindowsMutexStatic.c +++ b/Platform/Windows/Source/SolidSyslogWindowsMutexStatic.c @@ -17,12 +17,9 @@ struct SolidSyslogMutex; static inline size_t WindowsMutex_IndexFromHandle(const struct SolidSyslogMutex* base); static inline void WindowsMutex_CleanupAtIndex(size_t index, void* context); -static bool WindowsMutex_InUse[SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE]; -static struct SolidSyslogWindowsMutex WindowsMutex_Pool[SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE]; -static struct SolidSyslogPoolAllocator WindowsMutex_Allocator = { - WindowsMutex_InUse, - SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE -}; +static bool WindowsMutex_InUse[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogWindowsMutex WindowsMutex_Pool[SOLIDSYSLOG_MUTEX_POOL_SIZE]; +static struct SolidSyslogPoolAllocator WindowsMutex_Allocator = {WindowsMutex_InUse, SOLIDSYSLOG_MUTEX_POOL_SIZE}; struct SolidSyslogMutex* SolidSyslogWindowsMutex_Create(void) { @@ -62,8 +59,8 @@ void SolidSyslogWindowsMutex_Destroy(struct SolidSyslogMutex* base) static inline size_t WindowsMutex_IndexFromHandle(const struct SolidSyslogMutex* base) { - size_t result = SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_MUTEX_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_MUTEX_POOL_SIZE; poolIndex++) { if (base == &WindowsMutex_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWinsockDatagramStatic.c b/Platform/Windows/Source/SolidSyslogWinsockDatagramStatic.c index d6a9bd2d..9b5a65e6 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockDatagramStatic.c +++ b/Platform/Windows/Source/SolidSyslogWinsockDatagramStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogDatagram; static inline size_t WinsockDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base); static inline void WinsockDatagram_CleanupAtIndex(size_t index, void* context); -static bool WinsockDatagram_InUse[SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE]; -static struct SolidSyslogWinsockDatagram WinsockDatagram_Pool[SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE]; +static bool WinsockDatagram_InUse[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; +static struct SolidSyslogWinsockDatagram WinsockDatagram_Pool[SOLIDSYSLOG_DATAGRAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator WinsockDatagram_Allocator = { WinsockDatagram_InUse, - SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE + SOLIDSYSLOG_DATAGRAM_POOL_SIZE }; struct SolidSyslogDatagram* SolidSyslogWinsockDatagram_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogWinsockDatagram_Destroy(struct SolidSyslogDatagram* base) static inline size_t WinsockDatagram_IndexFromHandle(const struct SolidSyslogDatagram* base) { - size_t result = SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_DATAGRAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_DATAGRAM_POOL_SIZE; poolIndex++) { if (base == &WinsockDatagram_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWinsockResolverStatic.c b/Platform/Windows/Source/SolidSyslogWinsockResolverStatic.c index 4dc36709..5c83ebef 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockResolverStatic.c +++ b/Platform/Windows/Source/SolidSyslogWinsockResolverStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogResolver; static inline size_t WinsockResolver_IndexFromHandle(const struct SolidSyslogResolver* base); static inline void WinsockResolver_CleanupAtIndex(size_t index, void* context); -static bool WinsockResolver_InUse[SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE]; -static struct SolidSyslogWinsockResolver WinsockResolver_Pool[SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE]; +static bool WinsockResolver_InUse[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; +static struct SolidSyslogWinsockResolver WinsockResolver_Pool[SOLIDSYSLOG_RESOLVER_POOL_SIZE]; static struct SolidSyslogPoolAllocator WinsockResolver_Allocator = { WinsockResolver_InUse, - SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE + SOLIDSYSLOG_RESOLVER_POOL_SIZE }; struct SolidSyslogResolver* SolidSyslogWinsockResolver_Create(void) @@ -62,8 +62,8 @@ void SolidSyslogWinsockResolver_Destroy(struct SolidSyslogResolver* base) static inline size_t WinsockResolver_IndexFromHandle(const struct SolidSyslogResolver* base) { - size_t result = SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_RESOLVER_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_RESOLVER_POOL_SIZE; poolIndex++) { if (base == &WinsockResolver_Pool[poolIndex].Base) { diff --git a/Platform/Windows/Source/SolidSyslogWinsockTcpStreamStatic.c b/Platform/Windows/Source/SolidSyslogWinsockTcpStreamStatic.c index 12957a4d..c239149d 100644 --- a/Platform/Windows/Source/SolidSyslogWinsockTcpStreamStatic.c +++ b/Platform/Windows/Source/SolidSyslogWinsockTcpStreamStatic.c @@ -17,11 +17,11 @@ struct SolidSyslogStream; static inline size_t WinsockTcpStream_IndexFromHandle(const struct SolidSyslogStream* base); static inline void WinsockTcpStream_CleanupAtIndex(size_t index, void* context); -static bool WinsockTcpStream_InUse[SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE]; -static struct SolidSyslogWinsockTcpStream WinsockTcpStream_Pool[SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE]; +static bool WinsockTcpStream_InUse[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; +static struct SolidSyslogWinsockTcpStream WinsockTcpStream_Pool[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE]; static struct SolidSyslogPoolAllocator WinsockTcpStream_Allocator = { WinsockTcpStream_InUse, - SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE + SOLIDSYSLOG_TCP_STREAM_POOL_SIZE }; struct SolidSyslogStream* SolidSyslogWinsockTcpStream_Create(const struct SolidSyslogWinsockTcpStreamConfig* config) @@ -62,8 +62,8 @@ void SolidSyslogWinsockTcpStream_Destroy(struct SolidSyslogStream* base) static inline size_t WinsockTcpStream_IndexFromHandle(const struct SolidSyslogStream* base) { - size_t result = SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE; - for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE; poolIndex++) + size_t result = SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; + for (size_t poolIndex = 0; poolIndex < SOLIDSYSLOG_TCP_STREAM_POOL_SIZE; poolIndex++) { if (base == &WinsockTcpStream_Pool[poolIndex].Base) { diff --git a/Tests/FatFs/SolidSyslogFatFsFilePoolTest.cpp b/Tests/FatFs/SolidSyslogFatFsFilePoolTest.cpp index 18c40bbc..b17d5265 100644 --- a/Tests/FatFs/SolidSyslogFatFsFilePoolTest.cpp +++ b/Tests/FatFs/SolidSyslogFatFsFilePoolTest.cpp @@ -31,7 +31,7 @@ using namespace CososoTesting; // clang-format off TEST_GROUP(SolidSyslogFatFsFilePool) { - struct SolidSyslogFile* pooled[SOLIDSYSLOG_FATFS_FILE_POOL_SIZE] = {}; + struct SolidSyslogFile* pooled[SOLIDSYSLOG_FILE_POOL_SIZE] = {}; struct SolidSyslogFile* overflow = nullptr; void setup() override @@ -113,8 +113,8 @@ TEST(SolidSyslogFatFsFilePool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogFatFsFile_Create(); - LONGS_EQUAL(SOLIDSYSLOG_FATFS_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_FATFS_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogFatFsFilePool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/Fixtures/SmallMessageSizeTunables.h b/Tests/Fixtures/SmallMessageSizeTunables.h index 3b2b60c4..1346683a 100644 --- a/Tests/Fixtures/SmallMessageSizeTunables.h +++ b/Tests/Fixtures/SmallMessageSizeTunables.h @@ -9,13 +9,12 @@ * `EachPooledHandleHasIsolatedQueue` in SolidSyslogPosixMessageQueueBufferTest * to exercise the slot-indexed queue-name discriminator (CodeRabbit * feedback on PR #407). - * - SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE bumped to 2 enables + * - SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE bumped to 2 enables * `TwoCountersFromPoolAreIndependent` in SolidSyslogAtomicCounterContractTest * to exercise two concurrent counters drawn from the same pool. * - SOLIDSYSLOG_POOL_SIZE bumped to 3 lets the SolidSyslogPool fixture's * FillPool walk three slots and exercise multi-instance Create/Destroy. */ #define SOLIDSYSLOG_MAX_MESSAGE_SIZE 512 #define SOLIDSYSLOG_POSIX_MESSAGE_QUEUE_BUFFER_POOL_SIZE 2U -#define SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE 2U -#define SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE 2U +#define SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE 2U #define SOLIDSYSLOG_POOL_SIZE 3U diff --git a/Tests/FreeRtos/SolidSyslogFreeRtosMutexTest.cpp b/Tests/FreeRtos/SolidSyslogFreeRtosMutexTest.cpp index 0a910146..e3757292 100644 --- a/Tests/FreeRtos/SolidSyslogFreeRtosMutexTest.cpp +++ b/Tests/FreeRtos/SolidSyslogFreeRtosMutexTest.cpp @@ -79,7 +79,7 @@ TEST(SolidSyslogFreeRtosMutex, DestroyCallsSemaphoreDeleteOnce) // clang-format off TEST_GROUP(SolidSyslogFreeRtosMutexPool) { - struct SolidSyslogMutex* pooled[SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE] = {}; + struct SolidSyslogMutex* pooled[SOLIDSYSLOG_MUTEX_POOL_SIZE] = {}; struct SolidSyslogMutex* overflow = nullptr; void setup() override @@ -171,8 +171,8 @@ TEST(SolidSyslogFreeRtosMutexPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogFreeRtosMutex_Create(); - LONGS_EQUAL(SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_FREE_RTOS_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogFreeRtosMutexPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/FreeRtos/SolidSyslogPlusTcpDatagramTest.cpp b/Tests/FreeRtos/SolidSyslogPlusTcpDatagramTest.cpp index 8b576bb6..8c7dbfac 100644 --- a/Tests/FreeRtos/SolidSyslogPlusTcpDatagramTest.cpp +++ b/Tests/FreeRtos/SolidSyslogPlusTcpDatagramTest.cpp @@ -278,7 +278,7 @@ TEST(SolidSyslogPlusTcpDatagram, SendToForwardsLengthVerbatim) // clang-format off TEST_GROUP(SolidSyslogPlusTcpDatagramPool) { - struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE] = {}; + struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_DATAGRAM_POOL_SIZE] = {}; struct SolidSyslogDatagram* overflow = nullptr; void setup() override @@ -377,8 +377,8 @@ TEST(SolidSyslogPlusTcpDatagramPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogPlusTcpDatagram_Create(); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPlusTcpDatagramPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/FreeRtos/SolidSyslogPlusTcpResolverTest.cpp b/Tests/FreeRtos/SolidSyslogPlusTcpResolverTest.cpp index 1c437c17..a3d5ffe0 100644 --- a/Tests/FreeRtos/SolidSyslogPlusTcpResolverTest.cpp +++ b/Tests/FreeRtos/SolidSyslogPlusTcpResolverTest.cpp @@ -141,7 +141,7 @@ TEST(SolidSyslogPlusTcpResolverTest, FreesAddrInfoOnSuccess) // clang-format off TEST_GROUP(SolidSyslogPlusTcpResolverPoolTest) { - struct SolidSyslogResolver* pooled[SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE] = {}; + struct SolidSyslogResolver* pooled[SOLIDSYSLOG_RESOLVER_POOL_SIZE] = {}; struct SolidSyslogResolver* overflow = nullptr; void teardown() override @@ -221,8 +221,8 @@ TEST(SolidSyslogPlusTcpResolverPoolTest, CreateLocksOncePerSlotProbedWhenPoolIsF overflow = SolidSyslogPlusTcpResolver_Create(); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPlusTcpResolverPoolTest, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp b/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp index ef59b041..617c6f2a 100644 --- a/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp +++ b/Tests/FreeRtos/SolidSyslogPlusTcpTcpStreamTest.cpp @@ -458,7 +458,7 @@ TEST(SolidSyslogPlusTcpTcpStream, DestroyAfterCloseDoesNotCloseAgain) // clang-format off TEST_GROUP(SolidSyslogPlusTcpTcpStreamPool) { - struct SolidSyslogStream* pooled[SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE] = {}; + struct SolidSyslogStream* pooled[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE] = {}; struct SolidSyslogStream* overflow = nullptr; void setup() override @@ -560,8 +560,8 @@ TEST(SolidSyslogPlusTcpTcpStreamPool, CreateLocksOncePerSlotProbedWhenPoolIsFull overflow = SolidSyslogPlusTcpTcpStream_Create(nullptr); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_PLUS_TCP_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPlusTcpTcpStreamPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp b/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp index 0f08fd6d..ea34caf4 100644 --- a/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawDatagramTest.cpp @@ -335,7 +335,7 @@ TEST(SolidSyslogLwipRawDatagramOpen, SendToFreesPbufEvenWhenSendtoErrors) // clang-format off TEST_GROUP(SolidSyslogLwipRawDatagramPool) { - struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE] = {}; + struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_DATAGRAM_POOL_SIZE] = {}; struct SolidSyslogDatagram* overflow = nullptr; void setup() override @@ -423,8 +423,8 @@ TEST(SolidSyslogLwipRawDatagramPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogLwipRawDatagram_Create(); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogLwipRawDatagramPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp b/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp index 22458cdf..3810dc15 100644 --- a/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawDnsResolverTest.cpp @@ -386,7 +386,7 @@ TEST(SolidSyslogLwipRawDnsResolver, ResolveAcceptsNumericLiteralAsSynchronousHit TEST_GROUP(SolidSyslogLwipRawDnsResolverPool) { struct SolidSyslogLwipRawDnsResolverConfig config = {}; - struct SolidSyslogResolver* pooled[SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE] = {}; + struct SolidSyslogResolver* pooled[SOLIDSYSLOG_RESOLVER_POOL_SIZE] = {}; struct SolidSyslogResolver* overflow = nullptr; void setup() override @@ -488,8 +488,8 @@ TEST(SolidSyslogLwipRawDnsResolverPool, CreateLocksOncePerSlotProbedWhenPoolIsFu overflow = SolidSyslogLwipRawDnsResolver_Create(&config); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogLwipRawDnsResolverPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp b/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp index a329ec0e..5c04dafd 100644 --- a/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawResolverTest.cpp @@ -128,7 +128,7 @@ TEST(SolidSyslogLwipRawResolver, ResolveReturnsFalseWhenIpaddrAtonRejectsHost) // clang-format off TEST_GROUP(SolidSyslogLwipRawResolverPool) { - struct SolidSyslogResolver* pooled[SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE] = {}; + struct SolidSyslogResolver* pooled[SOLIDSYSLOG_RESOLVER_POOL_SIZE] = {}; struct SolidSyslogResolver* overflow = nullptr; void teardown() override @@ -210,8 +210,8 @@ TEST(SolidSyslogLwipRawResolverPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogLwipRawResolver_Create(); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogLwipRawResolverPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp b/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp index bdf250c8..b76cb068 100644 --- a/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp +++ b/Tests/Lwip/SolidSyslogLwipRawTcpStreamTest.cpp @@ -729,7 +729,7 @@ TEST(SolidSyslogLwipRawTcpStreamConnected, CloseDrainsRxQueueBeforeTcpClose) TEST_GROUP(SolidSyslogLwipRawTcpStreamPool) { struct SolidSyslogLwipRawTcpStreamConfig validConfig{}; - struct SolidSyslogStream* pooled[SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE] = {}; + struct SolidSyslogStream* pooled[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE] = {}; struct SolidSyslogStream* overflow = nullptr; void setup() override @@ -815,8 +815,8 @@ TEST(SolidSyslogLwipRawTcpStreamPool, CreateLocksOncePerSlotProbedWhenPoolIsFull overflow = SolidSyslogLwipRawTcpStream_Create(&validConfig); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogLwipRawTcpStreamPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp index 761bc0bc..2d5b77ee 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsHmacSha256PolicyTest.cpp @@ -87,7 +87,7 @@ TEST_BASE(MbedTlsHmacSha256PolicyTestBase) TEST_GROUP_BASE(SolidSyslogMbedTlsHmacSha256Policy, MbedTlsHmacSha256PolicyTestBase) { - struct SolidSyslogSecurityPolicy* pooled[SOLIDSYSLOG_MBED_TLS_HMAC_SHA256_POLICY_POOL_SIZE] = {}; + struct SolidSyslogSecurityPolicy* pooled[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE] = {}; struct SolidSyslogSecurityPolicy* overflow = nullptr; void setup() override diff --git a/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp b/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp index 223c7890..f904423e 100644 --- a/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp +++ b/Tests/MbedTls/SolidSyslogMbedTlsStreamPoolTest.cpp @@ -35,7 +35,7 @@ TEST_GROUP(SolidSyslogMbedTlsStreamPool) { struct SolidSyslogStream* transport = nullptr; struct SolidSyslogMbedTlsStreamConfig config = {}; - struct SolidSyslogStream* pooled[SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE] = {}; + struct SolidSyslogStream* pooled[SOLIDSYSLOG_TLS_STREAM_POOL_SIZE] = {}; struct SolidSyslogStream* overflow = nullptr; void setup() override @@ -132,8 +132,8 @@ TEST(SolidSyslogMbedTlsStreamPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogMbedTlsStream_Create(&config); - LONGS_EQUAL(SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_MBED_TLS_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TLS_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TLS_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogMbedTlsStreamPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogGetAddrInfoResolverTest.cpp b/Tests/SolidSyslogGetAddrInfoResolverTest.cpp index 3253207a..bbdd8b17 100644 --- a/Tests/SolidSyslogGetAddrInfoResolverTest.cpp +++ b/Tests/SolidSyslogGetAddrInfoResolverTest.cpp @@ -141,7 +141,7 @@ TEST(SolidSyslogGetAddrInfoResolver, FreesAddrInfoOnSuccess) // clang-format off TEST_GROUP(SolidSyslogGetAddrInfoResolverPool) { - struct SolidSyslogResolver* pooled[SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE] = {}; + struct SolidSyslogResolver* pooled[SOLIDSYSLOG_RESOLVER_POOL_SIZE] = {}; struct SolidSyslogResolver* overflow = nullptr; void teardown() override @@ -220,8 +220,8 @@ TEST(SolidSyslogGetAddrInfoResolverPool, CreateLocksOncePerSlotProbedWhenPoolIsF overflow = SolidSyslogGetAddrInfoResolver_Create(); - LONGS_EQUAL(SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogGetAddrInfoResolverPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp b/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp index 57fe8b72..66b6f91c 100644 --- a/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp +++ b/Tests/SolidSyslogOpenSslHmacSha256PolicyTest.cpp @@ -87,7 +87,7 @@ TEST_BASE(OpenSslHmacSha256PolicyTestBase) TEST_GROUP_BASE(SolidSyslogOpenSslHmacSha256Policy, OpenSslHmacSha256PolicyTestBase) { - struct SolidSyslogSecurityPolicy* pooled[SOLIDSYSLOG_OPEN_SSL_HMAC_SHA256_POLICY_POOL_SIZE] = {}; + struct SolidSyslogSecurityPolicy* pooled[SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE] = {}; struct SolidSyslogSecurityPolicy* overflow = nullptr; void setup() override diff --git a/Tests/SolidSyslogPosixDatagramTest.cpp b/Tests/SolidSyslogPosixDatagramTest.cpp index dab2527f..de577dbd 100644 --- a/Tests/SolidSyslogPosixDatagramTest.cpp +++ b/Tests/SolidSyslogPosixDatagramTest.cpp @@ -264,7 +264,7 @@ TEST(SolidSyslogPosixDatagram, SendToReturnsFailedWhenConnectFails) // clang-format off TEST_GROUP(SolidSyslogPosixDatagramPool) { - struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE] = {}; + struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_DATAGRAM_POOL_SIZE] = {}; struct SolidSyslogDatagram* overflow = nullptr; void teardown() override @@ -341,8 +341,8 @@ TEST(SolidSyslogPosixDatagramPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogPosixDatagram_Create(); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPosixDatagramPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogPosixFileTest.cpp b/Tests/SolidSyslogPosixFileTest.cpp index 87b86db7..978e3499 100644 --- a/Tests/SolidSyslogPosixFileTest.cpp +++ b/Tests/SolidSyslogPosixFileTest.cpp @@ -129,7 +129,7 @@ TEST(SolidSyslogPosixFile, DeleteReturnsFalseForNonexistentFile) // clang-format off TEST_GROUP(SolidSyslogPosixFilePool) { - struct SolidSyslogFile* pooled[SOLIDSYSLOG_POSIX_FILE_POOL_SIZE] = {}; + struct SolidSyslogFile* pooled[SOLIDSYSLOG_FILE_POOL_SIZE] = {}; struct SolidSyslogFile* overflow = nullptr; void teardown() override @@ -206,8 +206,8 @@ TEST(SolidSyslogPosixFilePool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogPosixFile_Create(); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPosixFilePool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogPosixMutexTest.cpp b/Tests/SolidSyslogPosixMutexTest.cpp index 75868d57..e263bb85 100644 --- a/Tests/SolidSyslogPosixMutexTest.cpp +++ b/Tests/SolidSyslogPosixMutexTest.cpp @@ -55,7 +55,7 @@ TEST(SolidSyslogPosixMutex, LockUnlockDoesNotCrash) // clang-format off TEST_GROUP(SolidSyslogPosixMutexPool) { - struct SolidSyslogMutex* pooled[SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE] = {}; + struct SolidSyslogMutex* pooled[SOLIDSYSLOG_MUTEX_POOL_SIZE] = {}; struct SolidSyslogMutex* overflow = nullptr; void teardown() override @@ -133,8 +133,8 @@ TEST(SolidSyslogPosixMutexPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogPosixMutex_Create(); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPosixMutexPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogPosixTcpStreamTest.cpp b/Tests/SolidSyslogPosixTcpStreamTest.cpp index 50f7888d..6ef48508 100644 --- a/Tests/SolidSyslogPosixTcpStreamTest.cpp +++ b/Tests/SolidSyslogPosixTcpStreamTest.cpp @@ -577,7 +577,7 @@ TEST(SolidSyslogPosixTcpStream, ReadReturnsNegativeOneOnErrorAndClosesSocket) // clang-format off TEST_GROUP(SolidSyslogPosixTcpStreamPool) { - struct SolidSyslogStream* pooled[SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE] = {}; + struct SolidSyslogStream* pooled[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE] = {}; struct SolidSyslogStream* overflow = nullptr; void teardown() override @@ -654,8 +654,8 @@ TEST(SolidSyslogPosixTcpStreamPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogPosixTcpStream_Create(nullptr); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogPosixTcpStreamPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogStdAtomicCounterPoolTest.cpp b/Tests/SolidSyslogStdAtomicCounterPoolTest.cpp index 6ad5a652..c6ef3d1d 100644 --- a/Tests/SolidSyslogStdAtomicCounterPoolTest.cpp +++ b/Tests/SolidSyslogStdAtomicCounterPoolTest.cpp @@ -27,7 +27,7 @@ using namespace CososoTesting; // clang-format off TEST_GROUP(SolidSyslogStdAtomicCounterPool) { - struct SolidSyslogAtomicCounter* pooled[SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE] = {}; + struct SolidSyslogAtomicCounter* pooled[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE] = {}; struct SolidSyslogAtomicCounter* overflow = nullptr; void teardown() override @@ -104,8 +104,8 @@ TEST(SolidSyslogStdAtomicCounterPool, CreateLocksOncePerSlotProbedWhenPoolIsFull overflow = SolidSyslogStdAtomicCounter_Create(); - LONGS_EQUAL(SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogStdAtomicCounterPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogStdAtomicCounterTestHelper.c b/Tests/SolidSyslogStdAtomicCounterTestHelper.c index fb468c88..dabe72b1 100644 --- a/Tests/SolidSyslogStdAtomicCounterTestHelper.c +++ b/Tests/SolidSyslogStdAtomicCounterTestHelper.c @@ -41,5 +41,5 @@ void TestAtomicCounter_Destroy(struct SolidSyslogAtomicCounter* base) size_t TestAtomicCounter_PoolSize(void) { - return SOLIDSYSLOG_STD_ATOMIC_COUNTER_POOL_SIZE; + return SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; } diff --git a/Tests/SolidSyslogWindowsAtomicCounterPoolTest.cpp b/Tests/SolidSyslogWindowsAtomicCounterPoolTest.cpp index d0c02862..cb1d833b 100644 --- a/Tests/SolidSyslogWindowsAtomicCounterPoolTest.cpp +++ b/Tests/SolidSyslogWindowsAtomicCounterPoolTest.cpp @@ -27,7 +27,7 @@ using namespace CososoTesting; // clang-format off TEST_GROUP(SolidSyslogWindowsAtomicCounterPool) { - struct SolidSyslogAtomicCounter* pooled[SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE] = {}; + struct SolidSyslogAtomicCounter* pooled[SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE] = {}; struct SolidSyslogAtomicCounter* overflow = nullptr; void teardown() override @@ -104,8 +104,8 @@ TEST(SolidSyslogWindowsAtomicCounterPool, CreateLocksOncePerSlotProbedWhenPoolIs overflow = SolidSyslogWindowsAtomicCounter_Create(); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWindowsAtomicCounterPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogWindowsAtomicCounterTestHelper.c b/Tests/SolidSyslogWindowsAtomicCounterTestHelper.c index 3bc08a5a..00b55eb2 100644 --- a/Tests/SolidSyslogWindowsAtomicCounterTestHelper.c +++ b/Tests/SolidSyslogWindowsAtomicCounterTestHelper.c @@ -40,5 +40,5 @@ void TestAtomicCounter_Destroy(struct SolidSyslogAtomicCounter* base) size_t TestAtomicCounter_PoolSize(void) { - return SOLIDSYSLOG_WINDOWS_ATOMIC_COUNTER_POOL_SIZE; + return SOLIDSYSLOG_ATOMIC_COUNTER_POOL_SIZE; } diff --git a/Tests/SolidSyslogWindowsFileTest.cpp b/Tests/SolidSyslogWindowsFileTest.cpp index a5b6e8c6..7e09796f 100644 --- a/Tests/SolidSyslogWindowsFileTest.cpp +++ b/Tests/SolidSyslogWindowsFileTest.cpp @@ -157,7 +157,7 @@ TEST(SolidSyslogWindowsFile, DeleteReturnsFalseForNonexistentFile) // clang-format off TEST_GROUP(SolidSyslogWindowsFilePool) { - struct SolidSyslogFile* pooled[SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE] = {}; + struct SolidSyslogFile* pooled[SOLIDSYSLOG_FILE_POOL_SIZE] = {}; struct SolidSyslogFile* overflow = nullptr; void teardown() override @@ -234,8 +234,8 @@ TEST(SolidSyslogWindowsFilePool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogWindowsFile_Create(); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_FILE_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWindowsFilePool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogWindowsMutexTest.cpp b/Tests/SolidSyslogWindowsMutexTest.cpp index bfaf6798..f5a8a284 100644 --- a/Tests/SolidSyslogWindowsMutexTest.cpp +++ b/Tests/SolidSyslogWindowsMutexTest.cpp @@ -55,7 +55,7 @@ TEST(SolidSyslogWindowsMutex, LockUnlockDoesNotCrash) // clang-format off TEST_GROUP(SolidSyslogWindowsMutexPool) { - struct SolidSyslogMutex* pooled[SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE] = {}; + struct SolidSyslogMutex* pooled[SOLIDSYSLOG_MUTEX_POOL_SIZE] = {}; struct SolidSyslogMutex* overflow = nullptr; void teardown() override @@ -133,8 +133,8 @@ TEST(SolidSyslogWindowsMutexPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogWindowsMutex_Create(); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINDOWS_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_MUTEX_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWindowsMutexPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogWinsockDatagramTest.cpp b/Tests/SolidSyslogWinsockDatagramTest.cpp index fd93e411..cd13a4bc 100644 --- a/Tests/SolidSyslogWinsockDatagramTest.cpp +++ b/Tests/SolidSyslogWinsockDatagramTest.cpp @@ -270,7 +270,7 @@ TEST(SolidSyslogWinsockDatagram, MaxPayloadFallsBackWhenIpMtuLookupFails) // clang-format off TEST_GROUP(SolidSyslogWinsockDatagramPool) { - struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE] = {}; + struct SolidSyslogDatagram* pooled[SOLIDSYSLOG_DATAGRAM_POOL_SIZE] = {}; struct SolidSyslogDatagram* overflow = nullptr; void teardown() override @@ -353,8 +353,8 @@ TEST(SolidSyslogWinsockDatagramPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogWinsockDatagram_Create(); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_DATAGRAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWinsockDatagramPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogWinsockResolverTest.cpp b/Tests/SolidSyslogWinsockResolverTest.cpp index 08c6843b..e54f55f3 100644 --- a/Tests/SolidSyslogWinsockResolverTest.cpp +++ b/Tests/SolidSyslogWinsockResolverTest.cpp @@ -142,7 +142,7 @@ TEST(SolidSyslogWinsockResolver, FreesAddrInfoOnSuccess) // clang-format off TEST_GROUP(SolidSyslogWinsockResolverPool) { - struct SolidSyslogResolver* pooled[SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE] = {}; + struct SolidSyslogResolver* pooled[SOLIDSYSLOG_RESOLVER_POOL_SIZE] = {}; struct SolidSyslogResolver* overflow = nullptr; void teardown() override @@ -222,8 +222,8 @@ TEST(SolidSyslogWinsockResolverPool, CreateLocksOncePerSlotProbedWhenPoolIsFull) overflow = SolidSyslogWinsockResolver_Create(); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_RESOLVER_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWinsockResolverPool, DestroyOfPooledHandleLocksOnce) diff --git a/Tests/SolidSyslogWinsockTcpStreamTest.cpp b/Tests/SolidSyslogWinsockTcpStreamTest.cpp index ddcc5ce0..60c6e5bd 100644 --- a/Tests/SolidSyslogWinsockTcpStreamTest.cpp +++ b/Tests/SolidSyslogWinsockTcpStreamTest.cpp @@ -532,7 +532,7 @@ TEST(SolidSyslogWinsockTcpStream, DestroyClosesOpenSocket) // clang-format off TEST_GROUP(SolidSyslogWinsockTcpStreamPool) { - struct SolidSyslogStream* pooled[SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE] = {}; + struct SolidSyslogStream* pooled[SOLIDSYSLOG_TCP_STREAM_POOL_SIZE] = {}; struct SolidSyslogStream* overflow = nullptr; void teardown() override @@ -609,8 +609,8 @@ TEST(SolidSyslogWinsockTcpStreamPool, CreateLocksOncePerSlotProbedWhenPoolIsFull overflow = SolidSyslogWinsockTcpStream_Create(nullptr); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); - LONGS_EQUAL(SOLIDSYSLOG_WINSOCK_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_LockCallCount()); + LONGS_EQUAL(SOLIDSYSLOG_TCP_STREAM_POOL_SIZE, ConfigLockFake_UnlockCallCount()); } TEST(SolidSyslogWinsockTcpStreamPool, DestroyOfPooledHandleLocksOnce) diff --git a/docs/NAMING.md b/docs/NAMING.md index 34a334b8..3d86286b 100644 --- a/docs/NAMING.md +++ b/docs/NAMING.md @@ -533,6 +533,36 @@ pressure from rule 5.4.) **Exceptions:** CppUTest's `TEST`, `TEST_GROUP`, `CHECK_*`, `LONGS_EQUAL`, etc. are used unmodified — see Tests below. +### Pool-size tunables are named by role, not platform + +Every stateful Created class lives in a static pool sized by a +`SOLIDSYSLOG_..._POOL_SIZE` tunable (see CLAUDE.md, *Pool Allocation (E11)*). +For classes selected by platform or crypto vendor — where a build links +exactly one implementation of a given role — the tunable is named for the +**role**, not the implementation: + +```c +#define SOLIDSYSLOG_TCP_STREAM_POOL_SIZE 2U /* not _POSIX_TCP_STREAM_ */ +#define SOLIDSYSLOG_MUTEX_POOL_SIZE 1U /* not _POSIX_MUTEX_ / _WINDOWS_MUTEX_ */ +#define SOLIDSYSLOG_TLS_STREAM_POOL_SIZE 1U /* OpenSSL or Mbed TLS, one name */ +``` + +The integrator reasons about "how many TCP streams", never "how many POSIX +streams". `SOLIDSYSLOG_ADDRESS_POOL_SIZE` established the pattern; the role +pools (`TCP_STREAM`, `DATAGRAM`, `RESOLVER`, `MUTEX`, `FILE`, `ATOMIC_COUNTER`, +`TLS_STREAM`, `HMAC_SHA256_POLICY`) follow it. Do **not** reintroduce a +per-platform pool name when adding a new OS, network stack, or crypto vendor — +the new implementation references the existing role tunable. + +The pool counts **instances, not implementations**. The naming holds only +because a build links one implementation per role. If a future build ever +wires two implementations of the same role into one executable (e.g. the lwIP +numeric *and* DNS resolver, or two crypto vendors), size that role's pool to +the **sum** of the concurrent instances rather than splitting the name again. + +Classes with no platform/vendor variants keep their class-specific name +(`SOLIDSYSLOG_BLOCK_STORE_POOL_SIZE`, `SOLIDSYSLOG_ORIGIN_SD_POOL_SIZE`, etc.). + ### Enum constants All enum constants — tagged or anonymous, public or TU-local — are diff --git a/docs/integrating-lwip.md b/docs/integrating-lwip.md index fedc3a57..f898d3ea 100644 --- a/docs/integrating-lwip.md +++ b/docs/integrating-lwip.md @@ -396,12 +396,11 @@ the `SOLIDSYSLOG_USER_TUNABLES_FILE` CMake variable. | Tunable | Default | Adjust when | |---|---|---| -| `SOLIDSYSLOG_LWIP_RAW_RESOLVER_POOL_SIZE` | `1U` | You need multiple concurrent numeric resolver instances (rare). | -| `SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVER_POOL_SIZE` | `1U` | You need multiple concurrent DNS resolver instances (rare). | +| `SOLIDSYSLOG_RESOLVER_POOL_SIZE` | `1U` | You wire more than one resolver. Role pool shared by the numeric and DNS resolvers — counts instances, not implementations, so wiring **both** the numeric and DNS resolver in one build means setting this to `2U`. | | `SOLIDSYSLOG_DNS_RESOLVE_TIMEOUT_MS` | `5000U` | Default suits a healthy recursive resolver. Raise for a slow / distant DNS server. | | `SOLIDSYSLOG_LWIP_RAW_DNS_RESOLVE_POLL_MS` | `10U` | Default gives 500 polls inside the 5 s resolve deadline. Lower to notice completion sooner; raise to reduce spin overhead on a constrained MCU. | -| `SOLIDSYSLOG_LWIP_RAW_DATAGRAM_POOL_SIZE` | `1U` | You wire more than one UDP sender. | -| `SOLIDSYSLOG_LWIP_RAW_TCP_STREAM_POOL_SIZE` | `2U` | You wire more than the canonical plain-TCP + TLS-underlying-TCP pair. | +| `SOLIDSYSLOG_DATAGRAM_POOL_SIZE` | `1U` | You wire more than one UDP sender. | +| `SOLIDSYSLOG_TCP_STREAM_POOL_SIZE` | `2U` | You wire more than the canonical plain-TCP + TLS-underlying-TCP pair. | | `SOLIDSYSLOG_ADDRESS_POOL_SIZE` | `3U` | Shared with PlusTcp / Posix / Winsock — bump if you need >3 concurrent destinations. | | `SOLIDSYSLOG_TCP_CONNECT_TIMEOUT_MS` | `200U` | Default suits loopback / LAN. Raise for WAN deployments behind a high-RTT link; or install a runtime `GetConnectTimeoutMs` getter for per-instance tuning. | | `SOLIDSYSLOG_LWIP_RAW_TCP_CONNECT_POLL_MS` | `10U` | Default gives 20 polls inside the 200 ms connect deadline. Lower it to notice a fast connect sooner; raise it to reduce spin overhead on a constrained MCU. | diff --git a/docs/misra-deviations.md b/docs/misra-deviations.md index 7f78c4cf..50c7870f 100644 --- a/docs/misra-deviations.md +++ b/docs/misra-deviations.md @@ -69,7 +69,7 @@ The Tier 1 naming scheme in `docs/NAMING.md` (form 30–40 character range — `SolidSyslogPlusTcpResolver_Create` is 40, `SolidSyslogPlusTcpTcpStream_Destroy` is 36 — and a few public storage-size enums sit just below 40 (e.g. -`SOLIDSYSLOG_PLUS_TCP_RESOLVER_POOL_SIZE`, 40). Strict 31-character +`SOLIDSYSLOG_HMAC_SHA256_POLICY_POOL_SIZE`, 40). Strict 31-character distinctness would either collapse identifier pairs that read identically up to a trailing word (`SolidSyslogPlusTcpResolver_Create` vs `_Destroy`) into a