mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[11283] Drop the no longer used Visual Leak Detector (VLD)
For leak detection you can also use tools like Valgrind. If you really want to use VLD you can revert this commit and remove the comments in MemoryLeaks.cpp and MemoryLeaks.h. The VLD version which has been shipped with MaNGOS is *heavily* outdated and I thus suggest you to use a newer version of it, if you really plan to use it. You can find the newest version on github in its official repository: https://github.com/dmoulding/vld
This commit is contained in:
parent
0bc4bc1d75
commit
d9374d936f
13 changed files with 1 additions and 226 deletions
|
|
@ -369,10 +369,6 @@ if(WIN32)
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
)
|
)
|
||||||
if(PLATFORM MATCHES X86)
|
if(PLATFORM MATCHES X86)
|
||||||
# Special thing for debug and 32-bit
|
|
||||||
set(WIN_DEBUGLIBS
|
|
||||||
${CMAKE_SOURCE_DIR}/dep/lib/win32_debug/vld.lib
|
|
||||||
)
|
|
||||||
# Copy dll's Windows needs
|
# Copy dll's Windows needs
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
|
|
@ -382,7 +378,6 @@ if(WIN32)
|
||||||
)
|
)
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
${CMAKE_SOURCE_DIR}/dep/lib/win32_debug/vld.dll
|
|
||||||
${CMAKE_SOURCE_DIR}/dep/lib/win32_debug/dbghelp.dll
|
${CMAKE_SOURCE_DIR}/dep/lib/win32_debug/dbghelp.dll
|
||||||
DESTINATION ${LIBS_DIR}
|
DESTINATION ${LIBS_DIR}
|
||||||
CONFIGURATIONS Debug
|
CONFIGURATIONS Debug
|
||||||
|
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// $Id: vld.h,v 1.27 2006/11/12 18:09:20 dmouldin Exp $
|
|
||||||
//
|
|
||||||
// Visual Leak Detector (Version 1.9d) - Import Library Header
|
|
||||||
// Copyright (c) 2006 Dan Moulding
|
|
||||||
//
|
|
||||||
// This library is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
|
||||||
// License as published by the Free Software Foundation; either
|
|
||||||
// version 2.1 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This library is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
// Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
|
||||||
// License along with this library; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
//
|
|
||||||
// See COPYING.txt for the full terms of the GNU Lesser General Public License.
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
//#pragma once
|
|
||||||
#ifndef _VLD_H_
|
|
||||||
#define _VLD_H_
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
|
|
||||||
#pragma comment(lib, "vld.lib")
|
|
||||||
|
|
||||||
// Force a symbolic reference to the global VisualLeakDetector class object from
|
|
||||||
// the DLL. This enusres that the DLL is loaded and linked with the program,
|
|
||||||
// even if no code otherwise imports any of the DLL's exports.
|
|
||||||
#pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A")
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Visual Leak Detector APIs
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
// VLDDisable - Disables Visual Leak Detector's memory leak detection at
|
|
||||||
// runtime. If memory leak detection is already disabled, then calling this
|
|
||||||
// function has no effect.
|
|
||||||
//
|
|
||||||
// Note: In multithreaded programs, this function operates on a per-thread
|
|
||||||
// basis. In other words, if you call this function from one thread, then
|
|
||||||
// memory leak detection is only disabled for that thread. If memory leak
|
|
||||||
// detection is enabled for other threads, then it will remain enabled for
|
|
||||||
// those other threads. It was designed to work this way to insulate you,
|
|
||||||
// the programmer, from having to ensure thread synchronization when calling
|
|
||||||
// VLDEnable() and VLDDisable(). Without this, calling these two functions
|
|
||||||
// unsychronized could result in unpredictable and unintended behavior.
|
|
||||||
// But this also means that if you want to disable memory leak detection
|
|
||||||
// process-wide, then you need to call this function from every thread in
|
|
||||||
// the process.
|
|
||||||
//
|
|
||||||
// Return Value:
|
|
||||||
//
|
|
||||||
// None.
|
|
||||||
//
|
|
||||||
|
|
||||||
__declspec(dllimport) void VLDDisable ();
|
|
||||||
|
|
||||||
// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime.
|
|
||||||
// If memory leak detection is already enabled, which it is by default, then
|
|
||||||
// calling this function has no effect.
|
|
||||||
//
|
|
||||||
// Note: In multithreaded programs, this function operates on a per-thread
|
|
||||||
// basis. In other words, if you call this function from one thread, then
|
|
||||||
// memory leak detection is only enabled for that thread. If memory leak
|
|
||||||
// detection is disabled for other threads, then it will remain disabled for
|
|
||||||
// those other threads. It was designed to work this way to insulate you,
|
|
||||||
// the programmer, from having to ensure thread synchronization when calling
|
|
||||||
// VLDEnable() and VLDDisable(). Without this, calling these two functions
|
|
||||||
// unsychronized could result in unpredictable and unintended behavior.
|
|
||||||
// But this also means that if you want to enable memory leak detection
|
|
||||||
// process-wide, then you need to call this function from every thread in
|
|
||||||
// the process.
|
|
||||||
//
|
|
||||||
// Return Value:
|
|
||||||
//
|
|
||||||
// None.
|
|
||||||
//
|
|
||||||
|
|
||||||
__declspec(dllimport) void VLDEnable ();
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
#else // !_DEBUG
|
|
||||||
|
|
||||||
#define VLDEnable()
|
|
||||||
#define VLDDisable()
|
|
||||||
|
|
||||||
#endif // _DEBUG
|
|
||||||
|
|
||||||
#endif // _VLD_H_
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -72,11 +72,6 @@ void usage(const char *prog)
|
||||||
/// Launch the mangos server
|
/// Launch the mangos server
|
||||||
extern int main(int argc, char **argv)
|
extern int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// - Construct Memory Manager Instance
|
|
||||||
MaNGOS::Singleton<MemoryManager>::Instance();
|
|
||||||
|
|
||||||
//char *leak = new char[1000]; // test leak detection
|
|
||||||
|
|
||||||
///- Command line parsing
|
///- Command line parsing
|
||||||
char const* cfg_file = _MANGOSD_CONFIG;
|
char const* cfg_file = _MANGOSD_CONFIG;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,6 @@
|
||||||
#endif // __SHOW_STUPID_WARNINGS__
|
#endif // __SHOW_STUPID_WARNINGS__
|
||||||
#endif // __GNUC__
|
#endif // __GNUC__
|
||||||
|
|
||||||
// must be the first thing to include for it to work
|
|
||||||
#include "MemoryLeaks.h"
|
|
||||||
|
|
||||||
#include "Utilities/UnorderedMapSet.h"
|
#include "Utilities/UnorderedMapSet.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -109,11 +106,7 @@ typedef off_t ACE_OFF_T;
|
||||||
# define FD_SETSIZE 4096
|
# define FD_SETSIZE 4096
|
||||||
# endif
|
# endif
|
||||||
# include <ace/config-all.h>
|
# include <ace/config-all.h>
|
||||||
// XP winver - needed to compile with standard leak check in MemoryLeaks.h
|
|
||||||
// uncomment later if needed
|
|
||||||
//#define _WIN32_WINNT 0x0501
|
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
//#undef WIN32_WINNT
|
|
||||||
#else
|
#else
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MemoryLeaks.h"
|
|
||||||
#include "Policies/SingletonImp.h"
|
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1( MemoryManager ) ;
|
|
||||||
|
|
||||||
MemoryManager::MemoryManager( )
|
|
||||||
{
|
|
||||||
#if COMPILER == MICROSOFT
|
|
||||||
// standard leak check initialization
|
|
||||||
//_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
|
||||||
// uncomment to disable Visual Leak Detector from code
|
|
||||||
//VLDDisable();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MANGOSSERVER_MEMORY_H
|
|
||||||
#define MANGOSSERVER_MEMORY_H
|
|
||||||
|
|
||||||
#include "Platform/CompilerDefs.h"
|
|
||||||
|
|
||||||
#if COMPILER == COMPILER_MICROSOFT
|
|
||||||
|
|
||||||
#ifndef _WIN64
|
|
||||||
// Visual Leak Detector support enabled
|
|
||||||
//#include <vld/vld.h>
|
|
||||||
// standard Visual Studio leak check disabled,
|
|
||||||
//# define _CRTDBG_MAP_ALLOC
|
|
||||||
//# include <stdlib.h>
|
|
||||||
//# include <crtdbg.h>
|
|
||||||
#else
|
|
||||||
//# define _CRTDBG_MAP_ALLOC
|
|
||||||
//# include <stdlib.h>
|
|
||||||
//# include <crtdbg.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include "Policies/Singleton.h"
|
|
||||||
|
|
||||||
struct MemoryManager : public MaNGOS::Singleton < MemoryManager >
|
|
||||||
{
|
|
||||||
MemoryManager();
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11282"
|
#define REVISION_NR "11283"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,6 @@
|
||||||
<ClCompile Include="..\..\src\shared\Database\SqlOperations.cpp" />
|
<ClCompile Include="..\..\src\shared\Database\SqlOperations.cpp" />
|
||||||
<ClCompile Include="..\..\src\shared\Database\SQLStorage.cpp" />
|
<ClCompile Include="..\..\src\shared\Database\SQLStorage.cpp" />
|
||||||
<ClCompile Include="..\..\src\shared\Log.cpp" />
|
<ClCompile Include="..\..\src\shared\Log.cpp" />
|
||||||
<ClCompile Include="..\..\src\shared\MemoryLeaks.cpp" />
|
|
||||||
<ClCompile Include="..\..\src\shared\ProgressBar.cpp" />
|
<ClCompile Include="..\..\src\shared\ProgressBar.cpp" />
|
||||||
<ClCompile Include="..\..\src\shared\ServiceWin32.cpp" />
|
<ClCompile Include="..\..\src\shared\ServiceWin32.cpp" />
|
||||||
<ClCompile Include="..\..\src\shared\Threading.cpp" />
|
<ClCompile Include="..\..\src\shared\Threading.cpp" />
|
||||||
|
|
@ -477,7 +476,6 @@
|
||||||
<ClInclude Include="..\..\src\shared\Errors.h" />
|
<ClInclude Include="..\..\src\shared\Errors.h" />
|
||||||
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
|
<ClInclude Include="..\..\src\shared\LockedQueue.h" />
|
||||||
<ClInclude Include="..\..\src\shared\Log.h" />
|
<ClInclude Include="..\..\src\shared\Log.h" />
|
||||||
<ClInclude Include="..\..\src\shared\MemoryLeaks.h" />
|
|
||||||
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
|
<ClInclude Include="..\..\src\shared\ProgressBar.h" />
|
||||||
<ClInclude Include="..\..\src\shared\revision_nr.h" />
|
<ClInclude Include="..\..\src\shared\revision_nr.h" />
|
||||||
<ClInclude Include="..\..\src\shared\revision_sql.h" />
|
<ClInclude Include="..\..\src\shared\revision_sql.h" />
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,6 @@
|
||||||
<ClCompile Include="..\..\src\shared\Log.cpp">
|
<ClCompile Include="..\..\src\shared\Log.cpp">
|
||||||
<Filter>Log</Filter>
|
<Filter>Log</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\shared\MemoryLeaks.cpp">
|
|
||||||
<Filter>Util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\src\shared\ProgressBar.cpp">
|
<ClCompile Include="..\..\src\shared\ProgressBar.cpp">
|
||||||
<Filter>Util</Filter>
|
<Filter>Util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -131,9 +128,6 @@
|
||||||
<ClInclude Include="..\..\src\shared\Errors.h">
|
<ClInclude Include="..\..\src\shared\Errors.h">
|
||||||
<Filter>Util</Filter>
|
<Filter>Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\shared\MemoryLeaks.h">
|
|
||||||
<Filter>Util</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\dep\include\mersennetwister\MersenneTwister.h">
|
<ClInclude Include="..\..\dep\include\mersennetwister\MersenneTwister.h">
|
||||||
<Filter>Util</Filter>
|
<Filter>Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
||||||
|
|
@ -624,14 +624,6 @@
|
||||||
RelativePath="..\..\src\shared\Errors.h"
|
RelativePath="..\..\src\shared\Errors.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\shared\MemoryLeaks.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\shared\MemoryLeaks.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\dep\include\mersennetwister\MersenneTwister.h"
|
RelativePath="..\..\dep\include\mersennetwister\MersenneTwister.h"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -627,14 +627,6 @@
|
||||||
RelativePath="..\..\src\shared\Errors.h"
|
RelativePath="..\..\src\shared\Errors.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\shared\MemoryLeaks.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\shared\MemoryLeaks.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\dep\include\mersennetwister\MersenneTwister.h"
|
RelativePath="..\..\dep\include\mersennetwister\MersenneTwister.h"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue