[PATCH] D11897: [libunwind] Make it possible to use libunwind without heap.
whitequark via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 8 23:00:01 PST 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252452: Make it possible to use libunwind without heap. (authored by whitequark).
Changed prior to commit:
http://reviews.llvm.org/D11897?vs=35212&id=39667#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11897
Files:
libunwind/trunk/src/DwarfParser.hpp
libunwind/trunk/src/UnwindCursor.hpp
Index: libunwind/trunk/src/UnwindCursor.hpp
===================================================================
--- libunwind/trunk/src/UnwindCursor.hpp
+++ libunwind/trunk/src/UnwindCursor.hpp
@@ -114,6 +114,7 @@
template <typename A>
void DwarfFDECache<A>::add(pint_t mh, pint_t ip_start, pint_t ip_end,
pint_t fde) {
+#if !defined(_LIBUNWIND_NO_HEAP)
_LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_wrlock(&_lock));
if (_bufferUsed >= _bufferEnd) {
size_t oldSize = (size_t)(_bufferEnd - _buffer);
@@ -139,6 +140,7 @@
}
#endif
_LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_unlock(&_lock));
+#endif
}
template <typename A>
Index: libunwind/trunk/src/DwarfParser.hpp
===================================================================
--- libunwind/trunk/src/DwarfParser.hpp
+++ libunwind/trunk/src/DwarfParser.hpp
@@ -380,7 +380,9 @@
uint64_t length;
uint8_t opcode = addressSpace.get8(p);
uint8_t operand;
+#if !defined(_LIBUNWIND_NO_HEAP)
PrologInfoStackEntry *entry;
+#endif
++p;
switch (opcode) {
case DW_CFA_nop:
@@ -492,6 +494,7 @@
fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n",
reg, reg2);
break;
+#if !defined(_LIBUNWIND_NO_HEAP)
case DW_CFA_remember_state:
// avoid operator new, because that would be an upward dependency
entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry));
@@ -517,6 +520,7 @@
if (logDwarf)
fprintf(stderr, "DW_CFA_restore_state\n");
break;
+#endif
case DW_CFA_def_cfa:
reg = addressSpace.getULEB128(p, instructionsEnd);
offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11897.39667.patch
Type: text/x-patch
Size: 1725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151109/f5ec422b/attachment.bin>
More information about the llvm-commits
mailing list