diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2006-07-12 19:05:51 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2006-07-12 19:05:51 +0000 |
commit | 369741f3dd46c8aa33703923539245d93866cfc1 (patch) | |
tree | b78135cb991781615e7c7f5fc71b15b516f29d0f /misc/win32 | |
parent | 25c1764ccf1245fc91aba995e6dd0b5c79b85420 (diff) | |
download | libapr-369741f3dd46c8aa33703923539245d93866cfc1.tar.gz |
Protect usage of MS VC++ crtdbg.h functionality.
Originally titled: [patch 14/17] crtdbg.h
Submitted by: John Mark Vandenberg
Reviewed by: Justin Erenkrantz
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@421373 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc/win32')
-rw-r--r-- | misc/win32/apr_app.c | 5 | ||||
-rw-r--r-- | misc/win32/internal.c | 13 | ||||
-rw-r--r-- | misc/win32/misc.c | 1 | ||||
-rw-r--r-- | misc/win32/start.c | 17 |
4 files changed, 16 insertions, 20 deletions
diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index eb76df35a..712ac793e 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -35,7 +35,6 @@ #include "apr_general.h" #include "ShellAPI.h" -#include "crtdbg.h" #include "wchar.h" #include "apr_arch_file_io.h" #include "assert.h" @@ -57,8 +56,8 @@ int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) dupenv = apr_wastrtoastr(&env, wenv, -1); - _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); + _environ = apr_malloc_dbg((dupenv + 1) * sizeof (char *), + __FILE__, __LINE__ ); memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); /* MSVCRT will attempt to maintain the wide environment calls diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 239011264..9d73d917c 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -18,7 +18,6 @@ #include "apr_arch_misc.h" #include "apr_arch_file_io.h" -#include <crtdbg.h> #include <assert.h> /* This module is the source of -static- helper functions that are @@ -52,8 +51,8 @@ int apr_wastrtoastr(char const * const * *retarr, ; } - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); + newarr = apr_malloc_dbg((args + 1) * sizeof(char *), + __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); @@ -66,8 +65,8 @@ int apr_wastrtoastr(char const * const * *retarr, * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ elesize = elesize * 3 + 1; - ele = elements = _malloc_dbg(elesize * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); + ele = elements = apr_malloc_dbg(elesize * sizeof(char), + __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { apr_size_t len = (apr_size_t)newarr[arg]; @@ -87,8 +86,8 @@ int apr_wastrtoastr(char const * const * *retarr, /* Return to the free store if the heap realloc is the least bit optimized */ - ele = _realloc_dbg(elements, ele - elements, - _CRT_BLOCK, __FILE__, __LINE__); + ele = apr_realloc_dbg(elements, ele - elements, + __FILE__, __LINE__); if (ele != elements) { apr_size_t diff = ele - elements; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index eaf896a28..815a67d03 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -16,7 +16,6 @@ #include "apr_private.h" #include "apr_arch_misc.h" -#include "crtdbg.h" #include "apr_arch_file_io.h" #include "assert.h" #include "apr_lib.h" diff --git a/misc/win32/start.c b/misc/win32/start.c index be43f54e3..01da85817 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -23,7 +23,6 @@ #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" #include "apr_arch_file_io.h" -#include "crtdbg.h" #include "assert.h" /* This symbol is _private_, although it must be exported. @@ -54,8 +53,8 @@ static int warrsztoastr(const char * const * *retarr, } wsize = 1 + wch - arrsz; - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); + newarr = apr_malloc_dbg((args + 1) * sizeof(char *), + __FILE__, __LINE__); /* This is a safe max allocation, we will realloc after * processing and return the excess to the free store. @@ -63,8 +62,8 @@ static int warrsztoastr(const char * const * *retarr, * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ newlen = totlen = wsize * 3 + 1; - newarr[0] = _malloc_dbg(newlen * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); + newarr[0] = apr_malloc_dbg(newlen * sizeof(char), + __FILE__, __LINE__); (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, newarr[0], &newlen); @@ -72,8 +71,8 @@ static int warrsztoastr(const char * const * *retarr, assert(newlen && !wsize); /* Return to the free store if the heap realloc is the least bit optimized */ - newarr[0] = _realloc_dbg(newarr[0], totlen - newlen, - _CRT_BLOCK, __FILE__, __LINE__); + newarr[0] = apr_realloc_dbg(newarr[0], totlen - newlen, + __FILE__, __LINE__); for (arg = 1; arg < args; ++arg) { newarr[arg] = newarr[arg - 1] + 2; @@ -128,8 +127,8 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, dupenv = warrsztoastr(&_environ, sysstr, -1); if (env) { - *env = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); + *env = apr_malloc_dbg((dupenv + 1) * sizeof (char *), + __FILE__, __LINE__ ); memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *)); } else { |