Git development
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH v2 1/6] mingw: stop using nedmalloc
Date: Thu, 07 May 2026 16:00:08 +0000	[thread overview]
Message-ID: <d547877ae3efe0fc27af44819e19da863559540f.1778169613.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2104.v2.git.1778169613.gitgitgadget@gmail.com>

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The vendored nedmalloc allocator under compat/nedmalloc/ has been
unmaintained upstream for a very long time: the original repository at
https://github.com/ned14/nedmalloc received its last commit on July 5,
2014, and was archived (made read-only) by its owner on March 15, 2019.
Our copy has been carried forward unchanged ever since.

The Git for Windows commit that introduced mimalloc as a replacement
on Windows ("mingw: use mimalloc", 2019-06-24, present in the Git for
Windows branch thicket but not upstream) already observed at that time
that nedmalloc had ceased to see any updates for several years.

This came to a head when the Git for Windows SDK upgraded to GCC 16:
the `add_segment()` function in `compat/nedmalloc/malloc.c.h` declares
`int nfences = 0` and only references it inside an `assert()`, which
GCC 16 now flags as `-Wunused-but-set-variable`. Combined with the
`-Werror` enabled by `DEVELOPER=1`, this turns into a hard build
failure:

	compat/nedmalloc/malloc.c.h: In function 'add_segment':
	compat/nedmalloc/malloc.c.h:3897:7: error: variable 'nfences' set but not used [-Werror=unused-but-set-variable=]
	 3897 |   int nfences = 0;
	      |       ^~~~~~~
	cc1.exe: all warnings being treated as errors

The same source built without complaint under GCC 15.2.0; the
regression was bisected to the SDK package update at
https://github.com/git-for-windows/git-sdk-64/commit/188d93dd455
(`mingw-w64-x86_64-gcc 15.2.0-14 -> 16.1.0-1`), with the failing CI
run captured at
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 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 removed by subsequent commits
in this series.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 config.mak.uname                    | 3 ---
 contrib/buildsystems/CMakeLists.txt | 3 +--
 meson.build                         | 1 -
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 5feb582558..3636b98238 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -758,9 +758,6 @@ ifeq ($(uname_S),MINGW)
 	HAVE_LIBCHARSET_H = YesPlease
 	USE_GETTEXT_SCHEME = fallthrough
 	USE_LIBPCRE = YesPlease
-        ifneq (CLANGARM64,$(MSYSTEM))
-		USE_NED_ALLOCATOR = YesPlease
-        endif
         ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))
 		# Move system config into top-level /etc/
 		ETC_GITCONFIG = ../etc/gitconfig
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 81b4306e72..9d6b98ecb6 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -255,7 +255,7 @@ 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
@@ -267,7 +267,6 @@ 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)
 
diff --git a/meson.build b/meson.build
index 11488623bf..e896bc15a1 100644
--- a/meson.build
+++ b/meson.build
@@ -1285,7 +1285,6 @@ elif host_machine.system() == 'windows'
     'compat/win32/pthread.c',
     'compat/win32/syslog.c',
     'compat/win32mmap.c',
-    'compat/nedmalloc/nedmalloc.c',
   ]
 
   libgit_c_args += [
-- 
gitgitgadget


  reply	other threads:[~2026-05-07 16:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 12:29 [PATCH] mingw: stop using nedmalloc Johannes Schindelin via GitGitGadget
2026-05-05  6:09 ` Patrick Steinhardt
2026-05-07 16:00 ` [PATCH v2 0/6] " Johannes Schindelin via GitGitGadget
2026-05-07 16:00   ` Johannes Schindelin via GitGitGadget [this message]
2026-05-07 16:00   ` [PATCH v2 2/6] mingw: drop the build-system plumbing for nedmalloc Johannes Schindelin via GitGitGadget
2026-05-07 16:00   ` [PATCH v2 3/6] mingw: drop the small nedmalloc auxiliary files Johannes Schindelin via GitGitGadget
2026-05-07 16:00   ` [PATCH v2 4/6] mingw: drop the first chunk of compat/nedmalloc/malloc.c.h Johannes Schindelin via GitGitGadget
2026-05-07 16:00   ` [PATCH v2 5/6] mingw: drop the second " Johannes Schindelin via GitGitGadget
2026-05-07 16:00   ` [PATCH v2 6/6] mingw: drop the rest " Johannes Schindelin via GitGitGadget
2026-05-08  2:56   ` [PATCH v2 0/6] mingw: stop using nedmalloc Junio C Hamano
2026-05-08 14:15     ` Jeff King
2026-05-08 12:50   ` [PATCH v3 " Johannes Schindelin via GitGitGadget
2026-05-08 12:50     ` [PATCH v3 1/6] " Johannes Schindelin via GitGitGadget
2026-05-08 12:50     ` [PATCH v3 2/6] mingw: drop the build-system plumbing for nedmalloc Johannes Schindelin via GitGitGadget
2026-05-08 12:50     ` [PATCH v3 3/6] mingw: remove the vendored compat/nedmalloc/ subtree Johannes Schindelin via GitGitGadget
2026-05-08 12:50     ` [PATCH v3 4/6] to be squashed into 3/6 (chunk 1 of 3) Johannes Schindelin via GitGitGadget
2026-05-08 12:51     ` [PATCH v3 5/6] to be squashed into 3/6 (chunk 2 " Johannes Schindelin via GitGitGadget
2026-05-08 12:51     ` [PATCH v3 6/6] to be squashed into 3/6 (chunk 3 " Johannes Schindelin via GitGitGadget
2026-05-08 13:17     ` [PATCH v3 0/6] mingw: stop using nedmalloc Patrick Steinhardt
2026-05-10  2:31     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d547877ae3efe0fc27af44819e19da863559540f.1778169613.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox