Merge branch 'development' into cmake/linux_fix_warn_unused
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Editor/Objects/TrackGizmo.cpp
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <md5.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CXmlNode_PoolAlloc* g_pCXmlNode_PoolAlloc = 0;
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
SXmlNodeStats* g_pCXmlNode_Stats = 0;
|
||||
#endif
|
||||
@@ -35,11 +34,9 @@ extern bool g_bEnableBinaryXmlLoading;
|
||||
CXmlUtils::CXmlUtils(ISystem* pSystem)
|
||||
{
|
||||
m_pSystem = pSystem;
|
||||
m_pSystem->GetISystemEventDispatcher()->RegisterListener(this);
|
||||
|
||||
// create IReadWriteXMLSink object
|
||||
m_pReadWriteXMLSink = new CReadWriteXMLSink();
|
||||
g_pCXmlNode_PoolAlloc = new CXmlNode_PoolAlloc;
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
g_pCXmlNode_Stats = new SXmlNodeStats();
|
||||
#endif
|
||||
@@ -53,8 +50,6 @@ CXmlUtils::CXmlUtils(ISystem* pSystem)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CXmlUtils::~CXmlUtils()
|
||||
{
|
||||
m_pSystem->GetISystemEventDispatcher()->RemoveListener(this);
|
||||
delete g_pCXmlNode_PoolAlloc;
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
delete g_pCXmlNode_Stats;
|
||||
#endif
|
||||
@@ -200,13 +195,8 @@ IXmlSerializer* CXmlUtils::CreateXmlSerializer()
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CXmlUtils::GetMemoryUsage(ICrySizer* pSizer)
|
||||
void CXmlUtils::GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer)
|
||||
{
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "Nodes");
|
||||
g_pCXmlNode_PoolAlloc->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
// yes, slow
|
||||
std::vector<const CXmlNode*> rootNodes;
|
||||
@@ -260,18 +250,6 @@ void CXmlUtils::GetMemoryUsage(ICrySizer* pSizer)
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CXmlUtils::OnSystemEvent(ESystemEvent event, [[maybe_unused]] UINT_PTR wparam, [[maybe_unused]] UINT_PTR lparam)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case ESYSTEM_EVENT_LEVEL_POST_UNLOAD:
|
||||
case ESYSTEM_EVENT_LEVEL_LOAD_END:
|
||||
g_pCXmlNode_PoolAlloc->FreeMemoryIfEmpty();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CXmlBinaryDataWriterFile
|
||||
: public XMLBinary::IDataWriter
|
||||
|
||||
@@ -27,7 +27,6 @@ class CXMLPatcher;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CXmlUtils
|
||||
: public IXmlUtils
|
||||
, public ISystemEventListener
|
||||
{
|
||||
public:
|
||||
CXmlUtils(ISystem* pSystem);
|
||||
@@ -62,12 +61,6 @@ public:
|
||||
virtual IXmlTableReader* CreateXmlTableReader();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ISystemEventListener
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer);
|
||||
|
||||
|
||||
@@ -6,14 +6,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYSYSTEM_XML_XML_H
|
||||
#define CRYINCLUDE_CRYSYSTEM_XML_XML_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <PoolAllocator.h>
|
||||
#include <stack>
|
||||
|
||||
#include "IXml.h"
|
||||
@@ -344,9 +340,6 @@ private:
|
||||
friend class XmlParserImp;
|
||||
};
|
||||
|
||||
typedef stl::PoolAllocatorNoMT<sizeof(CXmlNode)> CXmlNode_PoolAlloc;
|
||||
extern CXmlNode_PoolAlloc* g_pCXmlNode_PoolAlloc;
|
||||
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
typedef std::set<CXmlNode*> TXmlNodeSet; // yes, slow, but really only for one-shot debugging
|
||||
struct SXmlNodeStats
|
||||
@@ -361,35 +354,6 @@ struct SXmlNodeStats
|
||||
extern SXmlNodeStats* g_pCXmlNode_Stats;
|
||||
#endif
|
||||
|
||||
/*
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void* CXmlNode::operator new( size_t nSize )
|
||||
{
|
||||
void *ptr = g_pCXmlNode_PoolAlloc->Allocate();
|
||||
if (ptr)
|
||||
{
|
||||
memset( ptr,0,nSize ); // Clear objects memory.
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
g_pCXmlNode_Stats->nodeSet.insert(reinterpret_cast<CXmlNode*> (ptr));
|
||||
++g_pCXmlNode_Stats->nAllocs;
|
||||
#endif
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void CXmlNode::operator delete( void *ptr )
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
g_pCXmlNode_PoolAlloc->Deallocate(ptr);
|
||||
#ifdef CRY_COLLECT_XML_NODE_STATS
|
||||
g_pCXmlNode_Stats->nodeSet.erase(reinterpret_cast<CXmlNode*> (ptr));
|
||||
++g_pCXmlNode_Stats->nFrees;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -434,6 +398,3 @@ private:
|
||||
unsigned int m_nAllocated;
|
||||
std::stack<CXmlNodeReuse*> m_pNodePool;
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYSYSTEM_XML_XML_H
|
||||
|
||||
Reference in New Issue
Block a user