GCC Code Coverage Report


Directory: ./
File: Os/Stub/DefaultCountingSemaphore.cpp
Date: 2026-09-03 21:13:48
Exec Total Coverage
Lines: 0 4 0.0%
Functions: 0 1 0.0%
Branches: 0 3 0.0%

Line Branch Exec Source
1 // ======================================================================
2 // \title Os/Stub/DefaultCountingSemaphore.cpp
3 // \brief sets default Os::CountingSemaphore to stub implementation via linker
4 // ======================================================================
5 #include "Os/Delegate.hpp"
6 #include "Os/Stub/CountingSemaphore.hpp"
7
8 namespace Os {
9
10 CountingSemaphoreInterface* CountingSemaphoreInterface::getDelegate(CountingSemaphoreHandleStorage& aligned_new_memory,
11 U32 initial_count) {
12 static_assert(std::is_base_of<CountingSemaphoreInterface, Os::Stub::Semaphore::StubCountingSemaphore>::value,
13 "Implementation must derive from CountingSemaphoreInterface");
14 static_assert(sizeof(Os::Stub::Semaphore::StubCountingSemaphore) <= sizeof(CountingSemaphoreHandleStorage),
15 "Handle size not large enough");
16 static_assert((FW_HANDLE_ALIGNMENT % alignof(Os::Stub::Semaphore::StubCountingSemaphore)) == 0,
17 "Handle alignment invalid");
18 auto* ptr = new (aligned_new_memory) Os::Stub::Semaphore::StubCountingSemaphore(initial_count);
19 FW_ASSERT(ptr != nullptr);
20 return ptr;
21 }
22 } // namespace Os
23