groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] too many symbols


From: Ralph Corderoy
Subject: Re: [Groff] too many symbols
Date: Wed, 05 Jun 2002 22:53:07 +0100

Hi Chris,

> I am trying to process a 77256 file using groff-1.17.2 on FreeBSD:
> 
> groff file -Tps -t -mm  > file.ps
> 
> and it always fails with:
> 
> file:33726: fatal error: too many symbols

Until I saw that line number, I thought you meant a 77256 *byte* file
:-)

> so it looks like I can add another value, I doubled the largest one:
> 
> static const unsigned int table_sizes[] = { 
> 101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021,
> 160001, 500009, 1000003, 2000006, 0
> };
> 
> and it seems to have worked, 4 minutes later I have an 1100 page
> postscript file.

What's it about to need so many symbols?

> Is this the right way for me to solve this problem?

Yes and no.  Yes, add a bigger size, but no it should really be a prime
number.

Werner, here's a possible patch.  Personally, I'd suggest a hash table
implementation that wasn't built around primes but powers of two so it
could double in size each time without needing a table of sizes, and one
that stored the hash of the key so they didn't all need recomputing on
growing the table.  But that might be an unnecessary optimisation.

Cheers,


Ralph.


cvs server: Diffing src/roff/troff
Index: src/roff/troff/symbol.cc
===================================================================
RCS file: /var/cvs/groff/src/roff/troff/symbol.cc,v
retrieving revision 1.2
diff -u -r1.2 symbol.cc
--- src/roff/troff/symbol.cc    14 Apr 2002 10:22:58 -0000      1.2
+++ src/roff/troff/symbol.cc    5 Jun 2002 21:50:45 -0000
@@ -39,9 +39,9 @@
 // the table will increase in size as necessary
 // the size will be chosen from the following array
 // add some more if you want
-// I think it unlikely that we'll need more than a million symbols
 static const unsigned int table_sizes[] = { 
-101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021, 160001, 
500009, 1000003, 0 
+    101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021,
+    160001, 500009, 1000003, 1500007, 2000003, 0
 };
 const double FULL_MAX = 0.3;   // don't let the table get more than this full
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]