1. 20 Jul, 2023 2 commits
  2. 19 Jul, 2023 3 commits
  3. 18 Jul, 2023 2 commits
  4. 17 Jul, 2023 5 commits
  5. 15 Jul, 2023 9 commits
  6. 14 Jul, 2023 4 commits
  7. 09 Jul, 2023 1 commit
  8. 25 Jun, 2023 1 commit
  9. 22 Jun, 2023 3 commits
  10. 10 Jun, 2023 1 commit
  11. 16 May, 2023 6 commits
  12. 15 May, 2023 3 commits
    • tests: only copy when `ptr` is non-NULL · 27576416
      Avoid passing a `NULL` ptr to `memcpy` -- that's UB (even if size is 0)
      Edward Thomson committed
    • tests: add allocation failure test for buffers · 8e5281c8
      Test that `git_buf` correctly fails if no more bytes can be allocated.
      This is mostly for demonstration purposes.
      Patrick Steinhardt committed
    • tests: add allocator with limited number of bytes · 90cc0771
      In several circumstances, we get bug reports about things that happen in
      situations where the environment is quite limited with regards to
      available memory. While it's expected that functionality will fail if
      memory allocations fail, the assumption is that we should do so in a
      controlled way. Most importantly, we do not want to crash hard due to
      e.g. accessing NULL pointers.
      
      Naturally, it is quite hard to debug such situations. But since our
      addition of pluggable allocators, we are able to implement allocators
      that fail in deterministic ways, e.g. after a certain amount of bytes
      has been allocated. This commit does exactly that.
      
      To be able to properly keep track of the amount of bytes currently
      allocated, allocated pointers contain tracking information. This
      tracking information is currently limited to the number of bytes
      allocated, so that we can correctly replenish them on calling `free` on
      the pointer. In the future, it would be feasible to extend the tracked
      information even further, e.g. by adding information about file and line
      where the allocation has been performed. As this introduced some
      overhead to allocations though, only information essential to limited
      allocations is currently tracked.
      Patrick Steinhardt committed