[llvm-commits] [compiler-rt] r158502 - /compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
Alexey Samsonov
samsonov at google.com
Fri Jun 15 00:41:23 PDT 2012
Author: samsonov
Date: Fri Jun 15 02:41:23 2012
New Revision: 158502
URL: http://llvm.org/viewvc/llvm-project?rev=158502&view=rev
Log:
[Sanitizer] Use mmaped buffer in DumpProcessMaps to avoid large stack frames
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=158502&r1=158501&r2=158502&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Fri Jun 15 02:41:23 2012
@@ -106,13 +106,14 @@
ProcessMaps proc_maps;
uptr start, end;
const sptr kBufSize = 4095;
- char filename[kBufSize];
+ char *filename = (char*)MmapOrDie(kBufSize, __FUNCTION__);
Report("Process memory map follows:\n");
while (proc_maps.Next(&start, &end, /* file_offset */0,
filename, kBufSize)) {
Printf("\t%p-%p\t%s\n", (void*)start, (void*)end, filename);
}
Report("End of process memory map.\n");
+ UnmapOrDie(filename, kBufSize);
}
void DisableCoreDumper() {
More information about the llvm-commits
mailing list