1. 20 May, 2019 1 commit
  2. 19 May, 2019 3 commits
  3. 06 May, 2019 1 commit
  4. 05 May, 2019 1 commit
  5. 22 Feb, 2019 1 commit
  6. 21 Feb, 2019 1 commit
    • allocators: extract crtdbg allocator into its own file · 48727e5d
      The Windows-specific crtdbg allocator is currently mixed into the
      crtdbg stacktracing compilation unit, making it harder to find
      than necessary. Extract it and move it into the new "allocators/"
      subdirectory to improve discoverability.
      
      This change means that the crtdbg compilation unit is now
      compiled unconditionally, whereas it has previously only been
      compiled on Windows platforms. Thus we now have additional guards
      around the code so that it will only be compiled if
      GIT_MSVC_CRTDBG is defined. This also allows us to move over the
      fallback-implementation of `git_win32_crtdbg_init_allocator` into
      the same compilation unit.
      Patrick Steinhardt committed
  7. 30 Jan, 2019 1 commit
  8. 25 Jan, 2019 1 commit
    • windows: add SSIZE_MAX · a861839d
      Windows doesn't include ssize_t or its _MAX value by default.  We are
      already declaring ssize_t as SSIZE_T, which is __int64_t on Win64 and
      long otherwise.  Include its _MAX value as a correspondence to its type.
      Edward Thomson committed
  9. 22 Jan, 2019 1 commit
  10. 06 Jan, 2019 1 commit
    • Fix a bunch of warnings · 7b453e7e
      This change fixes a bunch of warnings that were discovered by compiling
      with `clang -target=i386-pc-linux-gnu`. It turned out that the
      intrinsics were not necessarily being used in all platforms! Especially
      in GCC, since it does not support __has_builtin.
      
      Some more warnings were gleaned from the Windows build, but I stopped
      when I saw that some third-party dependencies (e.g. zlib) have warnings
      of their own, so we might never be able to enable -Werror there.
      lhchavez committed
  11. 20 Oct, 2018 2 commits
  12. 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
  13. 30 Sep, 2018 1 commit
  14. 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
  15. 10 Jun, 2018 1 commit
  16. 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
  17. 01 Feb, 2018 1 commit
  18. 09 Oct, 2017 2 commits
  19. 26 Jul, 2017 2 commits
  20. 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
  21. 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
  22. 17 Apr, 2017 1 commit
  23. 05 Apr, 2017 1 commit
  24. 03 Apr, 2017 3 commits
  25. 02 Apr, 2017 5 commits
  26. 01 Apr, 2017 1 commit