diff options
| author | Andrea Corallo | 2021-02-02 21:20:28 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-02-03 21:15:18 +0100 |
| commit | 41509d873e8a05aa98133cb78f384e06e69779ab (patch) | |
| tree | 956a6c180f4d7030757d8f5a631db0d26c7172e0 /src/comp.c | |
| parent | a8b8d220b4fccaa812e85f9b2b3715593dc285ac (diff) | |
| download | emacs-41509d873e8a05aa98133cb78f384e06e69779ab.tar.gz emacs-41509d873e8a05aa98133cb78f384e06e69779ab.zip | |
* Short eln filename hashes
* src/comp.c (HASH_LENGTH): New macro.
(comp_hash_string, comp_hash_source_file): Trim the hash before
returning.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) | |||
| 413 | /* Increase this number to force a new Vcomp_abi_hash to be generated. */ | 413 | /* Increase this number to force a new Vcomp_abi_hash to be generated. */ |
| 414 | #define ABI_VERSION "1" | 414 | #define ABI_VERSION "1" |
| 415 | 415 | ||
| 416 | /* Length of the hashes used for eln file naming. */ | ||
| 417 | #define HASH_LENGTH 8 | ||
| 418 | |||
| 416 | /* C symbols emitted for the load relocation mechanism. */ | 419 | /* C symbols emitted for the load relocation mechanism. */ |
| 417 | #define CURRENT_THREAD_RELOC_SYM "current_thread_reloc" | 420 | #define CURRENT_THREAD_RELOC_SYM "current_thread_reloc" |
| 418 | #define PURE_RELOC_SYM "pure_reloc" | 421 | #define PURE_RELOC_SYM "pure_reloc" |
| @@ -662,7 +665,7 @@ comp_hash_string (Lisp_Object string) | |||
| 662 | md5_buffer (SSDATA (string), SCHARS (string), SSDATA (digest)); | 665 | md5_buffer (SSDATA (string), SCHARS (string), SSDATA (digest)); |
| 663 | hexbuf_digest (SSDATA (digest), SDATA (digest), MD5_DIGEST_SIZE); | 666 | hexbuf_digest (SSDATA (digest), SDATA (digest), MD5_DIGEST_SIZE); |
| 664 | 667 | ||
| 665 | return digest; | 668 | return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH)); |
| 666 | } | 669 | } |
| 667 | 670 | ||
| 668 | static Lisp_Object | 671 | static Lisp_Object |
| @@ -688,7 +691,7 @@ comp_hash_source_file (Lisp_Object filename) | |||
| 688 | 691 | ||
| 689 | hexbuf_digest (SSDATA (digest), SSDATA (digest), MD5_DIGEST_SIZE); | 692 | hexbuf_digest (SSDATA (digest), SSDATA (digest), MD5_DIGEST_SIZE); |
| 690 | 693 | ||
| 691 | return digest; | 694 | return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH)); |
| 692 | } | 695 | } |
| 693 | 696 | ||
| 694 | /* Produce a key hashing Vcomp_subr_list. */ | 697 | /* Produce a key hashing Vcomp_subr_list. */ |