summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl/lib/memdebug.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-09 11:45:25 -0500
committerBrad King <brad.king@kitware.com>2020-12-09 11:45:25 -0500
commit54931fdff020f72bbd157fd1640a0fef52e4f183 (patch)
tree31e7f9ea89fb8ab0e17fe17efd881ea947962a4a /Utilities/cmcurl/lib/memdebug.c
parent4cd65e5d882333e48155cf8b5bb52d088aa63cdf (diff)
parent5aacc593a961fe9ee1427c03d18fba8947a9e33d (diff)
downloadcmake-54931fdff020f72bbd157fd1640a0fef52e4f183.tar.gz
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2020-12-09 (e0528597)
Diffstat (limited to 'Utilities/cmcurl/lib/memdebug.c')
-rw-r--r--Utilities/cmcurl/lib/memdebug.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/Utilities/cmcurl/lib/memdebug.c b/Utilities/cmcurl/lib/memdebug.c
index da75c9f5db..881ee85c32 100644
--- a/Utilities/cmcurl/lib/memdebug.c
+++ b/Utilities/cmcurl/lib/memdebug.c
@@ -9,7 +9,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -35,52 +35,6 @@
#include "curl_memory.h"
#include "memdebug.h"
-/*
- * Until 2011-08-17 libcurl's Memory Tracking feature also performed
- * automatic malloc and free filling operations using 0xA5 and 0x13
- * values. Our own preinitialization of dynamically allocated memory
- * might be useful when not using third party memory debuggers, but
- * on the other hand this would fool memory debuggers into thinking
- * that all dynamically allocated memory is properly initialized.
- *
- * As a default setting, libcurl's Memory Tracking feature no longer
- * performs preinitialization of dynamically allocated memory on its
- * own. If you know what you are doing, and really want to retain old
- * behavior, you can achieve this compiling with preprocessor symbols
- * CURL_MT_MALLOC_FILL and CURL_MT_FREE_FILL defined with appropriate
- * values.
- */
-
-#ifdef CURL_MT_MALLOC_FILL
-# if (CURL_MT_MALLOC_FILL < 0) || (CURL_MT_MALLOC_FILL > 0xff)
-# error "invalid CURL_MT_MALLOC_FILL or out of range"
-# endif
-#endif
-
-#ifdef CURL_MT_FREE_FILL
-# if (CURL_MT_FREE_FILL < 0) || (CURL_MT_FREE_FILL > 0xff)
-# error "invalid CURL_MT_FREE_FILL or out of range"
-# endif
-#endif
-
-#if defined(CURL_MT_MALLOC_FILL) && defined(CURL_MT_FREE_FILL)
-# if (CURL_MT_MALLOC_FILL == CURL_MT_FREE_FILL)
-# error "CURL_MT_MALLOC_FILL same as CURL_MT_FREE_FILL"
-# endif
-#endif
-
-#ifdef CURL_MT_MALLOC_FILL
-# define mt_malloc_fill(buf,len) memset((buf), CURL_MT_MALLOC_FILL, (len))
-#else
-# define mt_malloc_fill(buf,len) Curl_nop_stmt
-#endif
-
-#ifdef CURL_MT_FREE_FILL
-# define mt_free_fill(buf,len) memset((buf), CURL_MT_FREE_FILL, (len))
-#else
-# define mt_free_fill(buf,len) Curl_nop_stmt
-#endif
-
struct memdebug {
size_t size;
union {
@@ -173,8 +127,6 @@ void *curl_dbg_malloc(size_t wantedsize, int line, const char *source)
mem = (Curl_cmalloc)(size);
if(mem) {
- /* fill memory with junk */
- mt_malloc_fill(mem->mem, wantedsize);
mem->size = wantedsize;
}
@@ -321,9 +273,6 @@ void curl_dbg_free(void *ptr, int line, const char *source)
# pragma warning(pop)
#endif
- /* destroy */
- mt_free_fill(mem->mem, mem->size);
-
/* free for real */
(Curl_cfree)(mem);
}