Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2019 06:19:41 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352644 - stable/12/contrib/jemalloc/src
Message-ID:  <201909240619.x8O6JfI5015090@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep 24 06:19:41 2019
New Revision: 352644
URL: https://svnweb.freebsd.org/changeset/base/352644

Log:
  MFC r352456:
  realloc(x, 0) should not return NULL.
  
  PR:	240456

Modified:
  stable/12/contrib/jemalloc/src/jemalloc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/jemalloc/src/jemalloc.c
==============================================================================
--- stable/12/contrib/jemalloc/src/jemalloc.c	Tue Sep 24 06:18:48 2019	(r352643)
+++ stable/12/contrib/jemalloc/src/jemalloc.c	Tue Sep 24 06:19:41 2019	(r352644)
@@ -2299,21 +2299,6 @@ je_realloc(void *ptr, size_t size) {
 	LOG("core.realloc.entry", "ptr: %p, size: %zu\n", ptr, size);
 
 	if (unlikely(size == 0)) {
-		if (ptr != NULL) {
-			/* realloc(ptr, 0) is equivalent to free(ptr). */
-			UTRACE(ptr, 0, 0);
-			tcache_t *tcache;
-			tsd_t *tsd = tsd_fetch();
-			if (tsd_reentrancy_level_get(tsd) == 0) {
-				tcache = tcache_get(tsd);
-			} else {
-				tcache = NULL;
-			}
-			ifree(tsd, ptr, tcache, true);
-
-			LOG("core.realloc.exit", "result: %p", NULL);
-			return NULL;
-		}
 		size = 1;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909240619.x8O6JfI5015090>