summaryrefslogtreecommitdiff
path: root/base/gsmdebug.h
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2013-07-23 16:24:19 +0100
committerChris Liddell <chris.liddell@artifex.com>2015-07-20 18:21:17 +0100
commit6948650efd3fb9e2a70b8cf16aca57e9d0b7eb0a (patch)
tree5c2a1c671c1d4521f8a770d1e69e3d4342718030 /base/gsmdebug.h
parent7fd9e0be26e67c36f87733bc89ea07dc26d9f839 (diff)
downloadghostpdl-6948650efd3fb9e2a70b8cf16aca57e9d0b7eb0a.tar.gz
Commit of build_consolidation branch
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.
Diffstat (limited to 'base/gsmdebug.h')
-rw-r--r--base/gsmdebug.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/base/gsmdebug.h b/base/gsmdebug.h
new file mode 100644
index 000000000..f5c00fcc8
--- /dev/null
+++ b/base/gsmdebug.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2001-2012 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+ CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+
+/* Allocator debugging definitions and interface */
+/* Requires gdebug.h (for gs_debug) */
+
+#ifndef gsmdebug_INCLUDED
+# define gsmdebug_INCLUDED
+
+#include "valgrind.h"
+
+/* Define the fill patterns used for debugging the allocator. */
+extern const byte
+ gs_alloc_fill_alloc, /* allocated but not initialized */
+ gs_alloc_fill_block, /* locally allocated block */
+ gs_alloc_fill_collected, /* garbage collected */
+ gs_alloc_fill_deleted, /* locally deleted block */
+ gs_alloc_fill_free; /* freed */
+
+/* Define an alias for a specialized debugging flag */
+/* that used to be a separate variable. */
+#define gs_alloc_debug gs_debug['@']
+
+/* Conditionally fill unoccupied blocks with a pattern. */
+extern void gs_alloc_memset(void *, int /*byte */ , ulong);
+
+#ifdef DEBUG
+# define gs_alloc_fill(ptr, fill, len) \
+ BEGIN \
+ if ( gs_alloc_debug ) gs_alloc_memset(ptr, fill, (ulong)(len)); \
+ VALGRIND_MAKE_MEM_UNDEFINED(ptr,(ulong)(len)); \
+ END
+#else
+# define gs_alloc_fill(ptr, fill, len) \
+ BEGIN \
+ VALGRIND_MAKE_MEM_UNDEFINED(ptr,(ulong)(len)); \
+ END
+#endif
+
+#endif /* gsmdebug_INCLUDED */