MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / unlockMemoryResident

Function unlockMemoryResident

app/src/Platform/AppPlatform.cpp:651–667  ·  view source on GitHub ↗

* @brief Releases a lockMemoryResident() pin so the lock quota is returned before the * underlying allocation is freed or recycled. */

Source from the content-addressed store, hash-verified

649 * underlying allocation is freed or recycled.
650 */
651void unlockMemoryResident(const void* ptr, size_t len)
652{
653 Q_ASSERT(ptr != nullptr);
654 Q_ASSERT(len > 0);
655
656 if (!ptr || len == 0) [[unlikely]]
657 return;
658
659#if defined(Q_OS_WIN)
660 (void)VirtualUnlock(const_cast<void*>(ptr), len);
661#elif defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
662 (void)munlock(ptr, len);
663#else
664 Q_UNUSED(ptr);
665 Q_UNUSED(len);
666#endif
667}
668
669} // namespace AppPlatform
670

Callers 2

makeStorageMethod · 0.85
~FrameReaderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected