summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-16 19:50:17 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-16 19:50:17 +0000
commit04c9c09af60b79f78a0c281cbb8e482318a2cdb7 (patch)
tree7d49b2217c8ad06dd15347fef1331e3799ca11f6
parent42cb763c9ce52e671c681a9321a5e1b5741c9caf (diff)
downloadmupdf-04c9c09af60b79f78a0c281cbb8e482318a2cdb7.tar.xz
Increase amount to search in blocks for nestings in memento.
Mupdf has some large structures (fz_shade is over 32K!), so to catch all pointers we need to search further than the 1K I was originally limiting ourselves to.
-rw-r--r--fitz/memento.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fitz/memento.c b/fitz/memento.c
index daac3dfa..2fc911b1 100644
--- a/fitz/memento.c
+++ b/fitz/memento.c
@@ -51,6 +51,10 @@ char *getenv(const char *);
//void *memset(void *,int,size_t);
//int atexit(void (*)(void));
+/* How far to search for pointers in each block when calculating nestings */
+/* mupdf needs at least 34000ish (sizeof(fz_shade))/ */
+#define MEMENTO_PTRSEARCH 65536
+
#ifdef MEMENTO
#ifdef HAVE_VALGRIND
@@ -494,7 +498,7 @@ int Memento_listBlocksNested(void)
/* Now, calculate tree */
for (b = globals.used.head; b; b = b->next) {
char *p = MEMBLK_TOBLK(b);
- int end = (b->rawsize < 1024 ? b->rawsize : 1024);
+ int end = (b->rawsize < MEMENTO_PTRSEARCH ? b->rawsize : MEMENTO_PTRSEARCH);
for (i = 0; i < end; i += sizeof(void *)) {
void *q = *(void **)(&p[i]);
void **r;