Refactor to share map_info amongst threads.
Allow the use of the same map info to be shared when getting information on
multiple threads from the same pid.
Change-Id: I2e460e20154a10f4894ae563331fb32179e4551f
diff --git a/libbacktrace/UnwindCurrent.cpp b/libbacktrace/UnwindCurrent.cpp
index 6c0cad6..94a82fe 100644
--- a/libbacktrace/UnwindCurrent.cpp
+++ b/libbacktrace/UnwindCurrent.cpp
@@ -194,11 +194,11 @@
//-------------------------------------------------------------------------
// C++ object creation function.
//-------------------------------------------------------------------------
-Backtrace* CreateCurrentObj() {
- return new BacktraceCurrent(new UnwindCurrent());
+Backtrace* CreateCurrentObj(backtrace_map_info_t* map_info) {
+ return new BacktraceCurrent(new UnwindCurrent(), map_info);
}
-Backtrace* CreateThreadObj(pid_t tid) {
+Backtrace* CreateThreadObj(pid_t tid, backtrace_map_info_t* map_info) {
UnwindThread* thread_obj = new UnwindThread();
- return new BacktraceThread(thread_obj, thread_obj, tid);
+ return new BacktraceThread(thread_obj, thread_obj, tid, map_info);
}