summaryrefslogtreecommitdiff
path: root/fitz/memento.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-04-29 11:52:09 +0100
committerRobin Watts <robin.watts@artifex.com>2013-04-29 13:00:14 +0100
commit7696a4678e1eee59488649ef20f7fbb4d7d3fc0c (patch)
tree095dc8589574d9a16d8d5e20be33045a6cc4310c /fitz/memento.h
parentae40ceccb46df6d45e45c40b27f426286a46a7e6 (diff)
downloadmupdf-7696a4678e1eee59488649ef20f7fbb4d7d3fc0c.tar.xz
Add Memento build option to Android build. Fix memory leaks.
Following up on a report from a potential customer, fix various places in mupdf.c where we were leaking memory (devices not freed, context not properly freed etc). In order to track this down, I added a Memento build - just do: ndk-build MEMENTO=1 when building. This only checks for leaks, not for memory overwrites by default as it uses MEMENTO_LEAKONLY to avoid any possibility of the android kernel killing stuff for being too slow or using too much memory.
Diffstat (limited to 'fitz/memento.h')
-rw-r--r--fitz/memento.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fitz/memento.h b/fitz/memento.h
index 4831349b..75354384 100644
--- a/fitz/memento.h
+++ b/fitz/memento.h
@@ -137,6 +137,12 @@
#include <memory.h>
+#ifdef __ANDROID__
+#define MEMENTO_ANDROID
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+
#define MEMENTO_H
#ifndef MEMENTO_UNDERLYING_MALLOC