summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2009-01-22 18:55:00 +0000
committerRay Johnston <ray.johnston@artifex.com>2009-01-22 18:55:00 +0000
commit1d64f0c92d5fd639bede2caa9e707babc8567754 (patch)
treebc409d0233deb58a8be0784c8b457f7daa999d4f
parent52724559138f7a591dc6a193a4ddea9fe9b3033e (diff)
Disable plalloc's free mem list by default in release build to prevent
performance impact. DETAILS: On a customer test file, SP03P_AC.prn, PL_KEEP_GLOBAL_FREE_LIST true causes the page to take 400 seconds at 1200 dpi vs. 29 seconds with this set 'false'. This _may_ indicate a memory leak, but a DEBUG build is needed to investigate it anyway. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9388 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--pl/plalloc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/pl/plalloc.h b/pl/plalloc.h
index 851d59156..8ad4131d9 100644
--- a/pl/plalloc.h
+++ b/pl/plalloc.h
@@ -15,7 +15,7 @@
gs_memory_t *pl_alloc_init(void);
-
+#ifdef DEBUG
/* If true PL_KEEP_GLOBAL_FREE_LIST will force all memory allocations to be stored
* in a linked list, calling mem_node_free_all_remaining() will free any remaining
* blocks. This can be used to force a return to zero memory usage prior to
@@ -23,9 +23,13 @@ gs_memory_t *pl_alloc_init(void);
* of searching for the block to be freed on every deallocation.
*
* To disable the feature define PL_KEEP_GLOBAL_FREE_LIST to false
+ * We only set this in a DEBUG build to prevent poor performance in a release build.
*/
-#define PL_KEEP_GLOBAL_FREE_LIST true
+# define PL_KEEP_GLOBAL_FREE_LIST true
+#else
+# define PL_KEEP_GLOBAL_FREE_LIST false
+#endif
/* free all remaining memory blocks */
void pl_mem_node_free_all_remaining(gs_memory_t *mem);