1. 13 Dec, 2020 1 commit
    • Make git__strntol64() ~70%* faster · e99e833f
      This change uses compiler intrinsics to detect overflows instead of
      using divisions to detect potential overflow. This makes the code faster
      and makes it easier to read as a bonus side-effect!
      
      Some of the things this quickens:
      
      * Config parsing.
      * Tree parsing.
      * Smart protocol negotiation.
      
      \* Measured by running `libgit2_clar` with `-fno-optimize-sibling-calls
      -fno-omit-frame-pointer` under `perf(1)`:
      
      ```shell
      $ perf diff --symbols=git__strntol64 --compute=ratio \
        --percentage=absolute baseline.data perf.data
      \# Event 'cycles'
      \#
      \# Baseline           Ratio  Shared Object
      \# ........  ..............  .............
      \#
           0.25%        0.321836  libgit2_clar
      ```
      lhchavez committed
  2. 09 Dec, 2020 6 commits
  3. 08 Dec, 2020 3 commits
  4. 06 Dec, 2020 5 commits
  5. 05 Dec, 2020 5 commits
  6. 29 Nov, 2020 3 commits
    • Merge pull request #5593 from lhchavez/fix-mwindow-thread-unsafety · 87e4597c
      Make the pack and mwindow implementations data-race-free
      Edward Thomson committed
    • Merge pull request #5595 from lhchavez/odb-race-free · 5699ef81
      Make the odb race-free
      Edward Thomson committed
    • Make the pack and mwindow implementations data-race-free · 322c15ee
      This change fixes a packfile heap corruption that can happen when
      interacting with multiple packfiles concurrently across multiple
      threads. This is exacerbated by setting a lower mwindow open file limit.
      
      This change:
      
      * Renames most of the internal methods in pack.c to clearly indicate
        that they expect to be called with a certain lock held, making
        reasoning about the state of locks a bit easier.
      * Splits the `git_pack_file` lock in two: the one in `git_pack_file`
        only protects the `index_map`. The protection to `git_mwindow_file` is
        now in that struct.
      * Explicitly checks for freshness of the `git_pack_file` in
        `git_packfile_unpack_header`: this allows the mwindow implementation
        to close files whenever there is enough cache pressure, and
        `git_packfile_unpack_header` will reopen the packfile if needed.
      * After a call to `p_munmap()`, the `data` and `len` fields are poisoned
        with `NULL` to make use-after-frees more evident and crash rather than
        being open to the possibility of heap corruption.
      * Adds a test case to prevent this from regressing in the future.
      
      Fixes: #5591
      lhchavez committed
  7. 28 Nov, 2020 1 commit
  8. 27 Nov, 2020 16 commits