1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-22 16:01:04 -08:00

* Short eln filename hashes

* src/comp.c (HASH_LENGTH): New macro.
	(comp_hash_string, comp_hash_source_file): Trim the hash before
	returning.
This commit is contained in:
Andrea Corallo 2021-02-02 21:20:28 +01:00
parent a8b8d220b4
commit 41509d873e

View file

@ -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. */