git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/6] mingw: stop using nedmalloc

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
May 7, 2026, 16:00 UTC
Message-ID
<pull.2104.v2.git.1778169613.gitgitgadget@gmail.com>
In-Reply-To
<pull.2104.git.1777811392756.gitgitgadget@gmail.com>

Git for Windows' SDK wants to update GCC to v16. Since it is used in the CI builds also of the git/git repository, it is crucial that GCC can compile even the latter all right, but currently it does not, see https://github.com/git-for-windows/git-sdk-64/actions/runs/25244795074.

Git for Windows switched away from nedmalloc to mimalloc a long time ago, but recent benchmarks across Windows, macOS, and Linux (see https://github.com/git-for-windows/git/pull/6231) show no measurable benefit from mimalloc over the platforms' default allocators, so rather than upstreaming the mimalloc support, I will drop it from Git for Windows entirely.

This series therefore disables nedmalloc for MINGW builds and removes the vendored-in nedmalloc from Git's source code; my earlier sketch in https://lore.kernel.org/git/00fd3145-b3d2-ddab-466d-d06fd27298ec@gmx.de/ had the opposite ordering only because it assumed mimalloc would land first. Since that's not going to happen, it's best to move forward with this, so that the CI builds can switch to using GCC 16 (and the current Git for Windows SDK) on Windows.

The patches that remove the vendored sources have a slightly unusual shape: the Git mailing list rejects messages over 100kB and compat/nedmalloc/malloc.c.h alone is ~196kB of source, so the deletion of that file is split at section boundaries into three commits, each comfortably under the cap.

Changes since v1:
 * Also remove nedmalloc from the CMake and Meson configurations in the
   first patch.
 * Add follow-up patches that drop the nedmalloc build-system plumbing and
   source files.
Johannes Schindelin (6):
  mingw: stop using nedmalloc
  mingw: drop the build-system plumbing for nedmalloc
  mingw: drop the small nedmalloc auxiliary files
  mingw: drop the first chunk of compat/nedmalloc/malloc.c.h
  mingw: drop the second chunk of compat/nedmalloc/malloc.c.h
  mingw: drop the rest of compat/nedmalloc/malloc.c.h
 Makefile                            |   17 -
 compat/nedmalloc/License.txt        |   23 -
 compat/nedmalloc/Readme.txt         |  136 -
 compat/nedmalloc/malloc.c.h         | 5761 ---------------------------
 compat/nedmalloc/nedmalloc.c        |  954 -----
 compat/nedmalloc/nedmalloc.h        |  180 -
 config.mak.uname                    |    4 -
 contrib/buildsystems/CMakeLists.txt |    3 +-
 contrib/vscode/init.sh              |    1 -
 meson.build                         |    2 -
 10 files changed, 1 insertion(+), 7080 deletions(-)
 delete mode 100644 compat/nedmalloc/License.txt
 delete mode 100644 compat/nedmalloc/Readme.txt
 delete mode 100644 compat/nedmalloc/malloc.c.h
 delete mode 100644 compat/nedmalloc/nedmalloc.c
 delete mode 100644 compat/nedmalloc/nedmalloc.h
base-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2104%2Fdscho%2Fstop-using-nedmalloc-with-mingw-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2104/dscho/stop-using-nedmalloc-with-mingw-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2104
Range-diff vs v1:
 1:  b5d1ae93e4 ! 1:  d547877ae3 mingw: stop using nedmalloc
     @@ Commit message
          https://github.com/git-for-windows/git-sdk-64/actions/runs/25244795074.
      
          Rather than patch the unmaintained vendored sources to silence the
     -    warning, stop opting into nedmalloc altogether on MINGW. The platform
     -    allocator is what every non-MINGW build already uses, and a fresh
     -    build of git.git's master against a minimal Git for Windows SDK
     -    upgraded to GCC 16, with `USE_NED_ALLOCATOR` removed from the MINGW
     -    section, completes successfully.
     +    warning, stop opting into nedmalloc altogether on Windows. The
     +    platform allocator is what every non-MINGW build already uses, and a
     +    fresh build of git.git's master against a minimal Git for Windows SDK
     +    upgraded to GCC 16 completes successfully.
      
     -    The compat/nedmalloc/ subtree itself is left in place to keep this
     -    change minimal; nothing in the build links against it any longer, so
     -    it can be removed in a follow-up if desired.
     +    The compat/nedmalloc/ subtree itself is removed by subsequent commits
     +    in this series.
      
     -    Assisted-by: Claude Opus 4.7
     +    Assisted-by: Opus 4.7
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## config.mak.uname ##
     @@ config.mak.uname: ifeq ($(uname_S),MINGW)
               ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))
       		# Move system config into top-level /etc/
       		ETC_GITCONFIG = ../etc/gitconfig
     +
     + ## contrib/buildsystems/CMakeLists.txt ##
     +@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
     + 	add_compile_definitions(HAVE_ALLOCA_H NO_POSIX_GOODIES NATIVE_CRLF NO_UNIX_SOCKETS WIN32
     + 				_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe"  NO_SYMLINK_HEAD UNRELIABLE_FSTAT
     + 				NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
     +-				USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
     ++				OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
     + 				HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
     + 	list(APPEND compat_SOURCES
     + 		compat/mingw.c
     +@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
     + 		compat/win32/syslog.c
     + 		compat/win32/trace2_win32_process_info.c
     + 		compat/win32/dirent.c
     +-		compat/nedmalloc/nedmalloc.c
     + 		compat/strdup.c)
     + 	set(NO_UNIX_SOCKETS 1)
     + 
     +
     + ## meson.build ##
     +@@ meson.build: elif host_machine.system() == 'windows'
     +     'compat/win32/pthread.c',
     +     'compat/win32/syslog.c',
     +     'compat/win32mmap.c',
     +-    'compat/nedmalloc/nedmalloc.c',
     +   ]
     + 
     +   libgit_c_args += [
 -:  ---------- > 2:  7b5daae659 mingw: drop the build-system plumbing for nedmalloc
 -:  ---------- > 3:  a5ccd4dae3 mingw: drop the small nedmalloc auxiliary files
 -:  ---------- > 4:  95682cc2c6 mingw: drop the first chunk of compat/nedmalloc/malloc.c.h
 -:  ---------- > 5:  a605b58586 mingw: drop the second chunk of compat/nedmalloc/malloc.c.h
 -:  ---------- > 6:  90d4137018 mingw: drop the rest of compat/nedmalloc/malloc.c.h
-- 
gitgitgadget
Previous: Patrick SteinhardtNext: Johannes Schindelin via GitGitGadget
Message 3 of 20 in “mingw: stop using nedmalloc”
  1. mingw: stop using nedmallocJohannes Schindelin via GitGitGadget, May 3, 2026
  2. Patrick SteinhardtMay 5, 2026
  3. 0/6 mingw: stop using nedmallocJohannes Schindelin via GitGitGadget, May 7, 2026
  4. 1/6 mingw: stop using nedmallocJohannes Schindelin via GitGitGadget, May 7, 2026
  5. 2/6 mingw: drop the build-system plumbing for nedmallocJohannes Schindelin via GitGitGadget, May 7, 2026
  6. 3/6 mingw: drop the small nedmalloc auxiliary filesJohannes Schindelin via GitGitGadget, May 7, 2026
  7. 4/6 mingw: drop the first chunk of compat/nedmalloc/malloc.c.hJohannes Schindelin via GitGitGadget, May 7, 2026
  8. 5/6 mingw: drop the second chunk of compat/nedmalloc/malloc.c.hJohannes Schindelin via GitGitGadget, May 7, 2026
  9. 6/6 mingw: drop the rest of compat/nedmalloc/malloc.c.hJohannes Schindelin via GitGitGadget, May 7, 2026
  10. Junio C HamanoMay 8, 2026
  11. Jeff KingMay 8, 2026
  12. 0/6 mingw: stop using nedmallocJohannes Schindelin via GitGitGadget, May 8, 2026
  13. 1/6 mingw: stop using nedmallocJohannes Schindelin via GitGitGadget, May 8, 2026
  14. 2/6 mingw: drop the build-system plumbing for nedmallocJohannes Schindelin via GitGitGadget, May 8, 2026
  15. 3/6 mingw: remove the vendored compat/nedmalloc/ subtreeJohannes Schindelin via GitGitGadget, May 8, 2026
  16. 5/6 to be squashed into 3/6 (chunk 2 of 3)Johannes Schindelin via GitGitGadget, May 8, 2026
  17. 4/6 to be squashed into 3/6 (chunk 1 of 3)Johannes Schindelin via GitGitGadget, May 8, 2026
  18. 6/6 to be squashed into 3/6 (chunk 3 of 3)Johannes Schindelin via GitGitGadget, May 8, 2026
  19. Patrick SteinhardtMay 8, 2026
  20. Junio C HamanoMay 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.