From: Andrea Corallo Date: Tue, 2 Feb 2021 20:20:28 +0000 (+0100) Subject: * Short eln filename hashes X-Git-Tag: emacs-28.0.90~2727^2~160 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=41509d873e8a05aa98133cb78f384e06e69779ab;p=emacs.git * Short eln filename hashes * src/comp.c (HASH_LENGTH): New macro. (comp_hash_string, comp_hash_source_file): Trim the hash before returning. --- diff --git a/src/comp.c b/src/comp.c index b5adc3ed864..1b346f847dd 100644 --- a/src/comp.c +++ b/src/comp.c @@ -413,6 +413,9 @@ load_gccjit_if_necessary (bool mandatory) /* Increase this number to force a new Vcomp_abi_hash to be generated. */ #define ABI_VERSION "1" +/* Length of the hashes used for eln file naming. */ +#define HASH_LENGTH 8 + /* C symbols emitted for the load relocation mechanism. */ #define CURRENT_THREAD_RELOC_SYM "current_thread_reloc" #define PURE_RELOC_SYM "pure_reloc" @@ -662,7 +665,7 @@ comp_hash_string (Lisp_Object string) md5_buffer (SSDATA (string), SCHARS (string), SSDATA (digest)); hexbuf_digest (SSDATA (digest), SDATA (digest), MD5_DIGEST_SIZE); - return digest; + return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH)); } static Lisp_Object @@ -688,7 +691,7 @@ comp_hash_source_file (Lisp_Object filename) hexbuf_digest (SSDATA (digest), SSDATA (digest), MD5_DIGEST_SIZE); - return digest; + return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH)); } /* Produce a key hashing Vcomp_subr_list. */