[gs-cvs] rev 8727 - in trunk/gs: lib src

alexcher at ghostscript.com alexcher at ghostscript.com
Mon May 12 20:58:10 PDT 2008


Author: alexcher
Date: 2008-05-12 20:58:10 -0700 (Mon, 12 May 2008)
New Revision: 8727

Modified:
   trunk/gs/lib/gs_lev2.ps
   trunk/gs/src/zmisc.c
Log:
Reduce generation of garbage and the time spent on garbage collection by
placing gstate into the 2nd element of the patterm implementation array
in Adobe compatibility mode only. Ghostscript doesn't use this gstate
at all. Bug 689488.

DIFFERENCES:
None.


Modified: trunk/gs/lib/gs_lev2.ps
===================================================================
--- trunk/gs/lib/gs_lev2.ps	2008-05-11 17:00:17 UTC (rev 8726)
+++ trunk/gs/lib/gs_lev2.ps	2008-05-13 03:58:10 UTC (rev 8727)
@@ -883,9 +883,10 @@
   % this about the contents of Implementation:  "The type and value of this
   % entry are implementation-dependent."  The CET (page 2 of 18-02f) expects
   % that this entry be an array and that the second element of the array be a
-  % gstate.  We put our pattern instance struct into the first element of the
+  % gstate. We put our pattern instance struct into the first element of the
   % array.
-  1 index /Implementation 3 -1 roll gstate 2 array astore
+  1 index /Implementation 3 -1 roll
+  .getCPSImode { gstate } { //null } ifelse 2 array astore
   put				% put Implementation into the pattern dict.
 		% Stack: proto matrix global newdict
   readonly exch .setglobal exch pop exch pop

Modified: trunk/gs/src/zmisc.c
===================================================================
--- trunk/gs/src/zmisc.c	2008-05-11 17:00:17 UTC (rev 8726)
+++ trunk/gs/src/zmisc.c	2008-05-13 03:58:10 UTC (rev 8727)
@@ -383,6 +383,17 @@
     return 0;
 }
 
+/* - .getCPSImode <bool> */
+static int
+zgetCPSImode(i_ctx_t *i_ctx_p)
+{
+    os_ptr op = osp;
+
+    push(1);
+    make_bool(op, CPSI_mode);
+    return 0;
+}
+
 /* ------ gs persistent cache operators ------ */
 /* these are for testing only. they're disabled in the normal build
  * to prevent access to the cache by malicious postscript files
@@ -473,6 +484,7 @@
     {"1.setoserrno", zsetoserrno},
     {"0usertime", zusertime},
     {"1.setCPSImode", zsetCPSImode},
+    {"0.getCPSImode", zgetCPSImode},
 #ifdef DEBUG_CACHE
 	/* pcache test */
     {"2.pcacheinsert", zpcacheinsert},



More information about the gs-cvs mailing list