summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2009-03-19 01:51:53 +0000
committerHenry Stiles <henry.stiles@artifex.com>2009-03-19 01:51:53 +0000
commitd914bba645d5cd209417bef680fc350a794e12ee (patch)
tree3601cb421cba6f3bfb7ddbf247b956a8cca14dfb
parentcf628f15a158710bd126f6e2ef751f72df272b1c (diff)
For a debug build we stack up 2 heap allocators instead of using 1 heap
allocator and a chunk allocator. In debug mode each allocation and free resolves to a corresponding system malloc and free so that memory tools such as valgrind, mpatrol, etc. are effective. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9568 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--pl/plalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pl/plalloc.c b/pl/plalloc.c
index 5681c91e7..e2848ad74 100644
--- a/pl/plalloc.c
+++ b/pl/plalloc.c
@@ -19,9 +19,13 @@ pl_alloc_init()
if (mem == NULL) return NULL;
+#ifndef DEBUG
/* fix me... the second parameter (chunk size) should be a member of
pl_main_instance_t */
pl_mem = (gs_memory_t *)ialloc_alloc_state(mem, 20000);
+#else
+ pl_mem = gs_malloc_init(mem);
+#endif
/* if ialloc fails we return NULL here */
return pl_mem;