summaryrefslogtreecommitdiff
path: root/base/memento.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-12-15 17:42:35 +0000
committerRobin Watts <Robin.Watts@artifex.com>2020-12-15 18:33:43 +0000
commit9912c583aba35b68e251a73861ead44b0dbd91b4 (patch)
tree846acab142433fec446a79ab097686f1276f4730 /base/memento.c
parente1dfb92cc593cd27ed593ffcc3a79711b7504563 (diff)
downloadghostpdl-9912c583aba35b68e251a73861ead44b0dbd91b4.tar.gz
Add Memento_blockInfo(void *addr).
Show the history for a block.
Diffstat (limited to 'base/memento.c')
-rw-r--r--base/memento.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/base/memento.c b/base/memento.c
index 22ce9e989..381d2d0ee 100644
--- a/base/memento.c
+++ b/base/memento.c
@@ -1624,6 +1624,25 @@ void Memento_listBlockInfo(void)
#endif
}
+#ifdef MEMENTO_DETAILS
+static int
+showBlockInfo(Memento_BlkHeader *b, void *arg)
+{
+ if (arg < MEMBLK_TOBLK(b) || (void *)MEMBLK_POSTPTR(b) <= arg)
+ return 0;
+ return showInfo(b, NULL);
+}
+#endif
+
+void Memento_blockInfo(void *p)
+{
+#ifdef MEMENTO_DETAILS
+ MEMENTO_LOCK();
+ Memento_appBlocks(&memento.used, showBlockInfo, p);
+ MEMENTO_UNLOCK();
+#endif
+}
+
static int Memento_nonLeakBlocksLeaked(void)
{
Memento_BlkHeader *blk = memento.used.head;
@@ -3571,6 +3590,10 @@ void (Memento_listBlockInfo)(void)
{
}
+void (Memento_blockInfo)(void *ptr)
+{
+}
+
void (Memento_startLeaking)(void)
{
}