Index: libunwind/src/UnwindCursor.hpp =================================================================== --- libunwind/src/UnwindCursor.hpp +++ libunwind/src/UnwindCursor.hpp @@ -151,6 +151,7 @@ template typename A::pint_t DwarfFDECache::findFDE(pint_t mh, pint_t pc) { pint_t result = 0; +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared()); for (entry *p = _buffer; p < _bufferUsed; ++p) { if ((mh == p->mh) || (mh == kSearchAll)) { @@ -161,6 +162,7 @@ } } _LIBUNWIND_LOG_IF_FALSE(_lock.unlock_shared()); +#endif return result; } @@ -198,6 +200,7 @@ template void DwarfFDECache::removeAllIn(pint_t mh) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_IF_FALSE(_lock.lock()); entry *d = _buffer; for (const entry *s = _buffer; s < _bufferUsed; ++s) { @@ -209,6 +212,7 @@ } _bufferUsed = d; _LIBUNWIND_LOG_IF_FALSE(_lock.unlock()); +#endif } #ifdef __APPLE__ @@ -221,11 +225,13 @@ template void DwarfFDECache::iterateCacheEntries(void (*func)( unw_word_t ip_start, unw_word_t ip_end, unw_word_t fde, unw_word_t mh)) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_IF_FALSE(_lock.lock()); for (entry *p = _buffer; p < _bufferUsed; ++p) { (*func)(p->ip_start, p->ip_end, p->fde, p->mh); } _LIBUNWIND_LOG_IF_FALSE(_lock.unlock()); +#endif } #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)