[gs-cvs] rev 8805 - trunk/gs/src
alexcher at ghostscript.com
alexcher at ghostscript.com
Thu Jun 26 12:17:37 PDT 2008
Author: alexcher
Date: 2008-06-26 12:17:37 -0700 (Thu, 26 Jun 2008)
New Revision: 8805
Modified:
trunk/gs/src/inamedef.h
trunk/gs/src/inameidx.h
trunk/gs/src/inamestr.h
Log:
Use extended name table by default and adjust the settings to have
up to 1M names of up to 1K characters long. Bug 689913.
DIFFERENCES:
None
Modified: trunk/gs/src/inamedef.h
===================================================================
--- trunk/gs/src/inamedef.h 2008-06-25 16:18:57 UTC (rev 8804)
+++ trunk/gs/src/inamedef.h 2008-06-26 19:17:37 UTC (rev 8805)
@@ -28,6 +28,8 @@
* names up to 16K in size, and a slightly slower one that limits
* the total to 4M and restricts names to 256 characters.
* The maximum number of names is 2^(16+EXTEND_NAMES)-1.
+ * By default, EXTEND_NAMES == 4, which coresponds to a slower algorithm,
+ * the total of 1M names up to 1K characters long.
*/
#define max_name_extension_bits 6
#if EXTEND_NAMES > max_name_extension_bits
@@ -79,7 +81,7 @@
# define nt_sub_index_mask (nt_sub_size - 1)
typedef struct name_sub_table_s {
name names[NT_SUB_SIZE]; /* must be first */
-#ifdef EXTEND_NAMES
+#if EXTEND_NAMES
uint high_index; /* sub-table base index & (-1 << 16) */
#endif
} name_sub_table;
Modified: trunk/gs/src/inameidx.h
===================================================================
--- trunk/gs/src/inameidx.h 2008-06-25 16:18:57 UTC (rev 8804)
+++ trunk/gs/src/inameidx.h 2008-06-26 19:17:37 UTC (rev 8805)
@@ -20,15 +20,19 @@
/*
* The name table machinery has two slightly different configurations:
* a faster one that limits the total number of names to 64K and allows
- * names up to 16K in size, and a slightly slower one that limits
- * the total to 4M and restricts names to 256 characters.
+ * names up to 16K in size (EXTEND_NAMES == 0), and a slightly slower
+ * one that limits the total to 64K << EXTEND_NAMES and and restricts names
+ * to 16K >> EXTEND_NAMES. Max value of EXTEND_NAMES is 6, which corresponds
+ * to 4M names of up to to 256 characters.
*/
#ifndef EXTEND_NAMES /* # of bits beyond 16 */
-# define EXTEND_NAMES 0
+# define EXTEND_NAMES 4
#endif
/* Define the size of a name sub-table. */
-#define NT_LOG2_SUB_SIZE (8 + (EXTEND_NAMES / 2))
+/* With NT_LOG2_SUB_SIZE >= 10 the subtable goes into a large chunk, */
+/* which names_trace_finish() cannot handle. */
+# define NT_LOG2_SUB_SIZE (8 + (EXTEND_NAMES >= 2))
# define NT_SUB_SIZE (1 << NT_LOG2_SUB_SIZE)
# define NT_SUB_INDEX_MASK (NT_SUB_SIZE - 1)
Modified: trunk/gs/src/inamestr.h
===================================================================
--- trunk/gs/src/inamestr.h 2008-06-25 16:18:57 UTC (rev 8804)
+++ trunk/gs/src/inamestr.h 2008-06-26 19:17:37 UTC (rev 8805)
@@ -64,11 +64,7 @@
* free names.
*/
typedef struct name_string_s {
-#if EXTEND_NAMES
-# define name_extension_bits 6
-#else
-# define name_extension_bits 0
-#endif
+# define name_extension_bits EXTEND_NAMES
unsigned next_index:16 + name_extension_bits; /* next name in chain or 0 */
unsigned foreign_string:1; /* string is allocated statically */
unsigned mark:1; /* GC mark bit of index for this name */
More information about the gs-cvs
mailing list