1. 19 Oct, 2018 2 commits
    • win32: refactor `git_win32_path_remove_namespace` · a34f5b0d
      Update `git_win32_path_remove_namespace` to disambiguate the prefix
      being removed versus the prefix being added.  Now we remove the
      "namespace", and (may) add a "prefix" in its place.  Eg, we remove the
      `\\?\` namespace.  We remove the `\\?\UNC\` namespace, and replace it
      with the `\\` prefix.  This aids readability somewhat.
      
      Additionally, use pointer arithmetic instead of offsets, which seems to
      also help readability.
      Edward Thomson committed
    • win32: rename `git_win32__canonicalize_path` · b2e85f98
      The internal API `git_win32__canonicalize_path` is far, far too easily
      confused with the internal API `git_win32_path_canonicalize`.  The
      former removes the namespace prefix from a path (eg, given
      `\\?\C:\Temp\foo`, it returns `C:\Temp\foo`, and given
      `\\?\UNC\server\share`, it returns `\\server\share`).  As such, rename
      it to `git_win32_path_remove_namespace`.
      
      `git_win32_path_canonicalize` remains unchanged.
      Edward Thomson committed
  2. 30 Sep, 2018 1 commit
  3. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  4. 10 Jun, 2018 1 commit
  5. 07 Jun, 2018 3 commits
    • alloc: make memory allocators use function pointers · 9865cd16
      Currently, our memory allocators are being redirected to the correct
      implementation at compile time by simply using macros. In order to make
      them swappable at runtime, this commit reshuffles that by instead making
      use of a global "git_allocator" structure, whose pointers are set up to
      reference the allocator functions. Like this, it becomes easy to swap
      out allocators by simply setting these function pointers.
      
      In order to initialize a "git_allocator", our provided allocators
      "stdalloc" and "crtdbg" both provide an init function. This is being
      called to initialize a passed in allocator struct and set up its members
      correctly.
      
      No support is yet included to enable users of libgit2 to switch out the
      memory allocator at a global level.
      Patrick Steinhardt committed
    • win32: crtdbg: provide independent `free` function · 496b0df2
      Currently, the `git__free` function is being defined in a single place,
      only, disregarding whether we use our standard allocators or the crtdbg
      allocators. This makes it a bit harder to convert our code base to use
      pluggable allocators, and furthermore makes the border between our two
      allocators a bit more blurry.
      
      Implement a separate `git__crtdbg__free` function for the crtdbg
      allocator in order to completely separate both allocator
      implementations.
      Patrick Steinhardt committed
    • win32: crtdbg: internalize implementation of allocators · aab8f87b
      The crtdbg allocators are currently being implemented as inline
      functions as part of the "w32_crtdbg_stacktrace.h" header. As we are
      moving towards pluggable allocators with the help of function pointers,
      though, we cannot make use of inlining anymore. Instead, we can only
      have a single implementation of these allocating functions.
      
      Move all implementations of the crtdbg allocators into
      "w32_crtdbg_stacktrace.c".
      Patrick Steinhardt committed
  6. 01 Feb, 2018 1 commit
  7. 09 Oct, 2017 2 commits
  8. 26 Jul, 2017 2 commits
  9. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  10. 30 Jun, 2017 1 commit
    • win32: fix circular include deps with w32_crtdbg · 459fb8fe
      The current order of declarations and includes between "common.h" and
      "w32_crtdbg_stacktrace.h" is rather complicated. Both header files make
      use of things defined in the other one and are thus circularly dependent
      on each other. This makes it currently impossible to compile the
      "w32_crtdbg_stacktrace.c" file when including "common.h" inside of
      "w32_crtdbg_stacktrace.h".
      
      We can disentangle the mess by moving declaration of the inline crtdbg
      functions into the "w32_crtdbg_stacktrace.h" file and adding additional
      includes inside of it, such that all required functions are available to
      it. This allows us to break the dependency cycle.
      Patrick Steinhardt committed
  11. 17 Apr, 2017 1 commit
  12. 05 Apr, 2017 1 commit
  13. 03 Apr, 2017 3 commits
  14. 02 Apr, 2017 5 commits
  15. 01 Apr, 2017 2 commits
  16. 28 Feb, 2017 1 commit
    • odb_loose: fsync tests · e6ed0d2f
      Introduce a simple counter that `p_fsync` implements.  This is useful
      for ensuring that `p_fsync` is called when we expect it to be, for
      example when we have enabled an odb backend to perform `fsync`s when
      writing objects.
      Edward Thomson committed
  17. 29 Dec, 2016 1 commit
  18. 06 Dec, 2016 1 commit
  19. 20 Nov, 2016 1 commit
  20. 18 Nov, 2016 1 commit
    • threads: introduce `git_thread_exit` · 82f15896
      Introduce `git_thread_exit`, which will allow threads to terminate at an
      arbitrary time, returning a `void *`.  On Windows, this means that we
      need to store the current `git_thread` in TLS, so that we can set its
      `return` value when terminating.
      
      We cannot simply use `ExitThread`, since Win32 returns `DWORD`s from
      threads; we return `void *`.
      Edward Thomson committed
  21. 06 Oct, 2016 1 commit
  22. 20 Jun, 2016 7 commits