1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-19 08:47:46 +03:00
Commit Graph

10 Commits

Author SHA1 Message Date
Maxime Coste
04a96b059f Use different hash algorithms for strings and file hashing
For hash map, using fnv1a is faster as it is a much simpler algorithm
we can afford to inline. For files murmur3 should win as it processes
bytes 4 by 4.
2024-02-06 21:57:17 +11:00
Maxime Coste
ce75867e44 Merge branch 'roam-murmurhash-endian' of http://github.com/ppentchev/kakoune 2022-07-10 17:46:07 +10:00
Peter Pentchev
ded97628f7 murmurhash: always load byte by byte
Also reverse the order of bytes, loading the most significant parts first,
and use bitwise "or" instead of addition.
2022-07-07 08:53:57 +03:00
Peter Pentchev
085973a486 Fix murmurhash for big-endian architectures.
The murmurhash implementation tries to read a sequence of four bytes as
a single little-endian uint32 value. This does not work on e.g. Linux/s390x;
https://buildd.debian.org/status/fetch.php?pkg=kakoune&arch=s390x&ver=2021.11.08-1&stamp=1645975425&raw=0
2022-06-24 20:01:25 +03:00
Maxime Coste
e4a23a64fa Support opening files bigger than 2 GiB
The real technical limit is with lines bigger than 2 GiB and buffers
with more than 2 Gi lines, refactor buffer loading to make it possible
to load those files.

Fix an overflow with the hash_data function at the same time
2021-05-28 17:03:41 +10:00
Ben Judd
56875088d4 comments 2021-04-18 16:06:05 -07:00
Ben Judd
161ca6d4d1 hash unit tests. 2021-04-17 13:19:35 -07:00
Maxime Coste
4e7a357a47 Fix various undefined behaviours detected by UBSan 2017-06-26 11:27:18 +01:00
Maxime Coste
ea105b9942 Add fallthrough comment to silence gcc-7 warning
Until we switch to C++17 and can use the proper attributes there.
Fixes #1437
2017-06-16 10:28:40 +01:00
Maxime Coste
ebecd60eb8 Rework hashing, use a more extensible framework similar to n3876 proposal
std::hash specialization is a pain to work with, stop using that, and
just specialize a 'size_t hash_value(const T&)' free function.
2014-12-16 18:57:19 +00:00