projects
/
sdk
/
tools
/
heaptrack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
faae998
)
Preallocate trace buffer once.
author
Milian Wolff
<mail@milianw.de>
Wed, 21 May 2014 19:41:09 +0000
(21:41 +0200)
committer
Milian Wolff
<mail@milianw.de>
Wed, 21 May 2014 19:41:09 +0000
(21:41 +0200)
malloctrace.cpp
patch
|
blob
|
history
diff --git
a/malloctrace.cpp
b/malloctrace.cpp
index
c76c62c
..
54533c7
100644
(file)
--- a/
malloctrace.cpp
+++ b/
malloctrace.cpp
@@
-87,6
+87,9
@@
void trace(const int skip = 2)
{
traceBuffer.clear();
+ const size_t MAX_TRACE_SIZE = 64;
+ traceBuffer.reserve(MAX_TRACE_SIZE);
+
unw_context_t uc;
unw_getcontext (&uc);
@@
-100,7
+103,6
@@
void trace(const int skip = 2)
}
}
- const size_t MAX_TRACE_SIZE = 64;
while (unw_step(&cursor) > 0 && traceBuffer.size() < MAX_TRACE_SIZE) {
unw_word_t ip;