[PATCH 5/8] Lift up mmap_cache_delete invocation from unwind.c

Masatake YAMATO yamato at redhat.com
Fri Jan 26 20:36:41 UTC 2018


Destructor of unwind related code called mmap_cache_delete function.
However, now, other parts than unwind.c can use mmap cache.
So mmap_cache_delete, the cache destructor should be called separately
from unwind related code.

* strace.c (droptcb): Call mmap_cache_delete.
* unwind.c (unwind_tcb_fin): Don't call mmap_cache_delete.

Signed-off-by: Masatake YAMATO <yamato at redhat.com>
---
 strace.c | 2 ++
 unwind.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/strace.c b/strace.c
index 0ee9b5e3..6ea1765a 100644
--- a/strace.c
+++ b/strace.c
@@ -782,6 +782,8 @@ droptcb(struct tcb *tcp)
 	}
 #endif
 
+	mmap_cache_delete(tcp, __func__);
+
 	nprocs--;
 	debug_msg("dropped tcb for pid %d, %d remain", tcp->pid, nprocs);
 
diff --git a/unwind.c b/unwind.c
index c3f56709..9e9d43a1 100644
--- a/unwind.c
+++ b/unwind.c
@@ -94,8 +94,6 @@ unwind_tcb_fin(struct tcb *tcp)
 	free(tcp->queue);
 	tcp->queue = NULL;
 
-	mmap_cache_delete(tcp, __func__);
-
 	_UPT_destroy(tcp->libunwind_ui);
 	tcp->libunwind_ui = NULL;
 }
-- 
2.14.3





More information about the Strace-devel mailing list