Merge pull request #6521 from adityamandaleeka/remove_internal_free
authorAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>
Fri, 29 Jul 2016 21:13:05 +0000 (14:13 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2016 21:13:05 +0000 (14:13 -0700)
Remove CorUnix::InternalFree from PAL

1  2 
src/pal/src/debug/debug.cpp
src/pal/src/exception/machexception.cpp
src/pal/src/thread/thread.cpp

@@@ -25,14 -25,12 +25,14 @@@ Revision History
  #undef _FILE_OFFSET_BITS
  #endif
  
 +#include "pal/dbgmsg.h"
 +SET_DEFAULT_DEBUG_CHANNEL(DEBUG); // some headers have code with asserts, so do this first
 +
  #include "pal/thread.hpp"
  #include "pal/procobj.hpp"
  #include "pal/file.hpp"
  
  #include "pal/palinternal.h"
 -#include "pal/dbgmsg.h"
  #include "pal/process.h"
  #include "pal/context.h"
  #include "pal/debug.h"
@@@ -68,6 -66,8 +68,6 @@@
  
  using namespace CorUnix;
  
 -SET_DEFAULT_DEBUG_CHANNEL(DEBUG);
 -
  extern "C" void DBG_DebugBreak_End();
  
  #if HAVE_PROCFS_CTL
@@@ -236,12 -236,12 +236,12 @@@ OutputDebugStringW
      {
          ASSERT("failed to convert wide chars to multibytes\n");
          SetLastError(ERROR_INTERNAL_ERROR);
-         InternalFree(lpOutputStringA);
+         free(lpOutputStringA);
          goto EXIT;
      }
      
      OutputDebugStringA(lpOutputStringA);
-     InternalFree(lpOutputStringA);
+     free(lpOutputStringA);
  
  EXIT:
      LOGEXIT("OutputDebugStringW returns\n");
@@@ -388,7 -388,7 +388,7 @@@ DebugBreakCommand(
              goto FAILED;
          }
  
-         InternalFree(command_string);
+         free(command_string);
          return 1;
      }
  
  FAILED:
      if (command_string)
      {
-         InternalFree(command_string);
+         free(command_string);
      }
  
      fprintf (stderr, "Failed to execute command: '%s'\n", command_string);
@@@ -1519,7 -1519,7 +1519,7 @@@ PROCFSCLEANUP
  CLEANUP2:
      if (lpTmpBuffer) 
      {
-         InternalFree(lpTmpBuffer);
+         free(lpTmpBuffer);
      }
  #endif  // !HAVE_TTRACE
  
@@@ -1816,7 -1816,7 +1816,7 @@@ PROCFSCLEANUP
  CLEANUP2:
      if (lpTmpBuffer) 
      {
-         InternalFree(lpTmpBuffer);
+         free(lpTmpBuffer);
      }
  #endif  // !HAVE_TTRACE
  
@@@ -14,14 -14,12 +14,14 @@@ Abstract
  
  --*/
  
 +#include "pal/dbgmsg.h"
 +SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do this first
 +
  #include "pal/thread.hpp"
  #include "pal/seh.hpp"
  #include "pal/palinternal.h"
  #if HAVE_MACH_EXCEPTIONS
  #include "machexception.h"
 -#include "pal/dbgmsg.h"
  #include "pal/critsect.h"
  #include "pal/debug.h"
  #include "pal/init.h"
@@@ -44,6 -42,8 +44,6 @@@
  
  using namespace CorUnix;
  
 -SET_DEFAULT_DEBUG_CHANNEL(EXCEPT);
 -
  // The port we use to handle exceptions and to set the thread context
  mach_port_t s_ExceptionPort;
  
@@@ -177,7 -177,7 +177,7 @@@ GetExceptionMask(
          if (exceptionSettings)
          {
              exMode = (MachExceptionMode)atoi(exceptionSettings);
-             InternalFree(exceptionSettings);
+             free(exceptionSettings);
          }
          else
          {
@@@ -18,9 -18,6 +18,9 @@@ Abstract
  
  --*/
  
 +#include "pal/dbgmsg.h"
 +SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do this first
 +
  #include "pal/corunix.hpp"
  #include "pal/context.h"
  #include "pal/thread.hpp"
@@@ -32,6 -29,7 +32,6 @@@
  #include "procprivate.hpp"
  #include "pal/process.h"
  #include "pal/module.h"
 -#include "pal/dbgmsg.h"
  #include "pal/environ.h"
  #include "pal/init.h"
  
@@@ -76,6 -74,7 +76,6 @@@ using namespace CorUnix
  
  
  /* ------------------- Definitions ------------------------------*/
 -SET_DEFAULT_DEBUG_CHANNEL(THREAD);
  
  // The default stack size of a newly created thread (currently 256KB)
  // when the dwStackSize parameter of PAL_CreateThread()
@@@ -1781,7 -1780,7 +1781,7 @@@ CorUnix::InitializeGlobalThreadData
              CPalThread::s_dwDefaultThreadStackSize = dw;
          }
  
-         InternalFree(pszStackSize);
+         free(pszStackSize);
      }
  
      return palError;