| 104 | } |
| 105 | |
| 106 | static __declspec(noinline) void ensureCacheReady() noexcept { |
| 107 | if (g_cacheReady.load(std::memory_order_acquire)) return; |
| 108 | std::lock_guard<std::mutex> lock(getCacheMutex()); |
| 109 | if (g_cacheReady.load(std::memory_order_relaxed)) return; |
| 110 | buildModuleCache(); |
| 111 | g_cacheReady.store(true, std::memory_order_release); |
| 112 | } |
| 113 | |
| 114 | static __forceinline bool findModule(ULONG64 pc, const CachedModule *&lastModule, ULONG64 &imageBase) { |
| 115 | if (lastModule && pc >= imageBase && pc < lastModule->end) |
no test coverage detected