Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/tcmalloc/chromium/src/stacktrace_libunwind-inl.h

Issue 9311003: Update the tcmalloc chromium branch to r144 (gperftools 2.0), and merge chromium-specific changes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasec Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 // Anything that should only be defined once should be here: 38 // Anything that should only be defined once should be here:
39 39
40 // We only need local unwinder. 40 // We only need local unwinder.
41 #define UNW_LOCAL_ONLY 41 #define UNW_LOCAL_ONLY
42 42
43 extern "C" { 43 extern "C" {
44 #include <assert.h> 44 #include <assert.h>
45 #include <string.h> // for memset() 45 #include <string.h> // for memset()
46 #include <libunwind.h> 46 #include <libunwind.h>
47 } 47 }
48 #include "google/stacktrace.h" 48 #include "gperftools/stacktrace.h"
49 #include "base/logging.h" 49 #include "base/logging.h"
50 50
51 // Sometimes, we can try to get a stack trace from within a stack 51 // Sometimes, we can try to get a stack trace from within a stack
52 // trace, because libunwind can call mmap (maybe indirectly via an 52 // trace, because libunwind can call mmap (maybe indirectly via an
53 // internal mmap based memory allocator), and that mmap gets trapped 53 // internal mmap based memory allocator), and that mmap gets trapped
54 // and causes a stack-trace request. If were to try to honor that 54 // and causes a stack-trace request. If were to try to honor that
55 // recursive request, we'd end up with infinite recursion or deadlock. 55 // recursive request, we'd end up with infinite recursion or deadlock.
56 // Luckily, it's safe to ignore those subsequent traces. In such 56 // Luckily, it's safe to ignore those subsequent traces. In such
57 // cases, we return 0 to indicate the situation. 57 // cases, we return 0 to indicate the situation.
58 static __thread int recursive; 58 static __thread int recursive;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (unw_get_reg(&cursor, UNW_REG_SP, &next_sp) , 0) { 119 if (unw_get_reg(&cursor, UNW_REG_SP, &next_sp) , 0) {
120 break; 120 break;
121 } 121 }
122 sizes[n - 1] = next_sp - sp; 122 sizes[n - 1] = next_sp - sp;
123 #endif 123 #endif
124 } 124 }
125 out: 125 out:
126 --recursive; 126 --recursive;
127 return n; 127 return n;
128 } 128 }
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/stacktrace_generic-inl.h ('k') | third_party/tcmalloc/chromium/src/stacktrace_powerpc-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698