summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2021-04-22 15:35:55 -0500
committerEric Blake <eblake@redhat.com>2021-04-22 15:35:55 -0500
commit5cdaf1bc27d061599357eec07bd1962c580db807 (patch)
tree9a4923500ec3f9619eb06f0bc4f08734f5f9ad58
parente409a744ecb6aa02803f28e11653592e52721e93 (diff)
downloadm4-5cdaf1bc27d061599357eec07bd1962c580db807.tar.gz
m4: change command-line -H default
* src/m4.h (HASHMAX): Bump to ~64k. * doc/m4.texi (Limits control): Document it. * NEWS: Likewise.
-rw-r--r--NEWS3
-rw-r--r--doc/m4.texi6
-rw-r--r--src/m4.h2
3 files changed, 7 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 847a5f5c..a4bfbc7c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ GNU M4 NEWS - User visible changes.
* Noteworthy changes in release ?.? (????-??-??) [?]
+** The symbol hash table now defaults to 65537 buckets instead of 509, as
+ modern systems have enough memory to benefit from fewer hash collisions
+ by default.
* Noteworthy changes in release 1.4.18 (2016-12-31) [stable]
diff --git a/doc/m4.texi b/doc/m4.texi
index ce9b5575..b7bad625 100644
--- a/doc/m4.texi
+++ b/doc/m4.texi
@@ -43,8 +43,8 @@ This manual (@value{UPDATED}) is for GNU M4 (version
@value{VERSION}), a package containing an implementation of the m4 macro
language.
-Copyright @copyright{} 1989--1994, 2004--2014, 2016--2017, 2020 Free
-Software Foundation, Inc.
+Copyright @copyright{} 1989--1994, 2004--2014, 2016--2017, 2020--2021
+Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -791,7 +791,7 @@ System V version. @xref{Compatibility}, for a list of these.
@itemx --hashsize=@var{num}
Make the internal hash table for symbol lookup be @var{num} entries big.
For better performance, the number should be prime, but this is not
-checked. The default is 509 entries. It should not be necessary to
+checked. The default is 65537 entries. It should not be necessary to
increase this value, unless you define an excessive number of macros.
@item -L @var{num}
diff --git a/src/m4.h b/src/m4.h
index 89156acc..85a4e7ec 100644
--- a/src/m4.h
+++ b/src/m4.h
@@ -387,7 +387,7 @@ typedef enum symbol_lookup symbol_lookup;
typedef struct symbol symbol;
typedef void hack_symbol (symbol *, void *);
-#define HASHMAX 509 /* default, overridden by -Hsize */
+#define HASHMAX 65537 /* default, overridden by -Hsize */
extern void free_symbol (symbol *sym);
extern void symtab_init (void);