summaryrefslogtreecommitdiff
path: root/include/mupdf/memento.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-05-14 19:22:11 +0100
committerRobin Watts <robin.watts@artifex.com>2015-05-15 13:44:41 +0100
commitf671c582bd62f65ee036f505d75841c15a5ecec3 (patch)
tree96fcb377a568812a129f3ddbacdf2f207ff4f846 /include/mupdf/memento.h
parent6f3ed1b06deef624c703dc072d6ca1d760751927 (diff)
downloadmupdf-f671c582bd62f65ee036f505d75841c15a5ecec3.tar.xz
Memento improvements.
Firstly, when displaying a list of nested blocks, don't suppress outputting a block just because it contains a pointer to itself. Various valgrind fixes from the gs version of memento. Experimental C++ operators. See writeup in memento.h comments for how to integrate.
Diffstat (limited to 'include/mupdf/memento.h')
-rw-r--r--include/mupdf/memento.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/mupdf/memento.h b/include/mupdf/memento.h
index 82227608..90f9285e 100644
--- a/include/mupdf/memento.h
+++ b/include/mupdf/memento.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2013 Artifex Software, Inc.
+/* Copyright (C) 2009-2015 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -13,7 +13,7 @@
/* Memento: A library to aid debugging of memory leaks/heap corruption.
*
- * Usage:
+ * Usage (with C):
* First, build your project with MEMENTO defined, and include this
* header file wherever you use malloc, realloc or free.
* This header file will use macros to point malloc, realloc and free to
@@ -130,6 +130,29 @@
* then more useful features can be used; firstly memory squeezing will
* work, and secondly, Memento will have a "finer grained" paranoia
* available to it.
+ *
+ * Usage with C++:
+ *
+ * Memento has some experimental code in it to trap new/delete (and
+ * new[]/delete[] if required) calls.
+ *
+ * In order for this to work, either:
+ *
+ * 1) Build memento.c with the c++ compiler.
+ *
+ * or
+ *
+ * 2) Build memento.c as normal with the C compiler, then from any
+ * one of your .cpp files, do:
+ *
+ * #define MEMENTO_CPP_EXTRAS_ONLY
+ * #include "memento.c"
+ *
+ * In the case where MEMENTO is not defined, this will not do anything.
+ *
+ * Both Windows and GCC provide separate new[] and delete[] operators
+ * for arrays. Apparently some systems do not. If this is the case for
+ * your system, define MEMENTO_CPP_NO_ARRAY_CONSTRUCTORS.
*/
#ifndef MEMENTO_H