Start culling of llmemtype (for now just #ifdef'd to nothingness.

This commit is contained in:
Shyotl
2013-02-12 15:00:50 -06:00
parent 0742610674
commit b901e57c55
4 changed files with 15 additions and 40 deletions

View File

@@ -35,28 +35,6 @@
DECLARE_bool(heap_profile_use_stack_trace); DECLARE_bool(heap_profile_use_stack_trace);
//DECLARE_double(tcmalloc_release_rate); //DECLARE_double(tcmalloc_release_rate);
// static
void LLAllocator::pushMemType(S32 type)
{
if(isProfiling())
{
PushMemType(type);
}
}
// static
S32 LLAllocator::popMemType()
{
if (isProfiling())
{
return PopMemType();
}
else
{
return -1;
}
}
void LLAllocator::setProfilingEnabled(bool should_enable) void LLAllocator::setProfilingEnabled(bool should_enable)
{ {
// NULL disables dumping to disk // NULL disables dumping to disk
@@ -94,17 +72,6 @@ std::string LLAllocator::getRawProfile()
// stub implementations for when tcmalloc is disabled // stub implementations for when tcmalloc is disabled
// //
// static
void LLAllocator::pushMemType(S32 type)
{
}
// static
S32 LLAllocator::popMemType()
{
return -1;
}
void LLAllocator::setProfilingEnabled(bool should_enable) void LLAllocator::setProfilingEnabled(bool should_enable)
{ {
} }

View File

@@ -29,16 +29,10 @@
#include <string> #include <string>
#include "llmemtype.h"
#include "llallocator_heap_profile.h" #include "llallocator_heap_profile.h"
class LL_COMMON_API LLAllocator { class LL_COMMON_API LLAllocator {
friend class LLMemoryView; friend class LLMemoryView;
friend class LLMemType;
private:
static void pushMemType(S32 type);
static S32 popMemType();
public: public:
void setProfilingEnabled(bool should_enable); void setProfilingEnabled(bool should_enable);

View File

@@ -27,7 +27,9 @@
#include "llmemtype.h" #include "llmemtype.h"
#include "llallocator.h" #include "llallocator.h"
#if MEM_TRACK_TYPE
std::vector<char const *> LLMemType::DeclareMemType::mNameList; std::vector<char const *> LLMemType::DeclareMemType::mNameList;
#endif
LLMemType::DeclareMemType LLMemType::MTYPE_INIT("Init"); LLMemType::DeclareMemType LLMemType::MTYPE_INIT("Init");
LLMemType::DeclareMemType LLMemType::MTYPE_STARTUP("Startup"); LLMemType::DeclareMemType LLMemType::MTYPE_STARTUP("Startup");
@@ -194,7 +196,7 @@ LLMemType::DeclareMemType LLMemType::MTYPE_TEMP9("Temp9");
LLMemType::DeclareMemType LLMemType::MTYPE_OTHER("Other"); LLMemType::DeclareMemType LLMemType::MTYPE_OTHER("Other");
#if MEM_TRACK_TYPE
LLMemType::DeclareMemType::DeclareMemType(char const * st) LLMemType::DeclareMemType::DeclareMemType(char const * st)
{ {
mID = (S32)mNameList.size(); mID = (S32)mNameList.size();
@@ -229,3 +231,4 @@ char const * LLMemType::getNameFromID(S32 id)
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
#endif //MEM_TRACK_TYPE

View File

@@ -52,6 +52,10 @@ public:
class LL_COMMON_API DeclareMemType class LL_COMMON_API DeclareMemType
{ {
public: public:
#if !MEM_TRACK_TYPE
DeclareMemType(char const * st) {}; //Do nothing
#else
DeclareMemType(char const * st); DeclareMemType(char const * st);
~DeclareMemType(); ~DeclareMemType();
@@ -60,12 +64,17 @@ public:
// array so we can map an index ID to Name // array so we can map an index ID to Name
static std::vector<char const *> mNameList; static std::vector<char const *> mNameList;
#endif
}; };
#if !MEM_TRACK_TYPE
LLMemType(DeclareMemType& dt){} //Do nothing
#else
LLMemType(DeclareMemType& dt); LLMemType(DeclareMemType& dt);
~LLMemType(); ~LLMemType();
static char const * getNameFromID(S32 id); static char const * getNameFromID(S32 id);
#endif
static DeclareMemType MTYPE_INIT; static DeclareMemType MTYPE_INIT;
static DeclareMemType MTYPE_STARTUP; static DeclareMemType MTYPE_STARTUP;
@@ -232,7 +241,9 @@ public:
static DeclareMemType MTYPE_OTHER; // Special; used by display code static DeclareMemType MTYPE_OTHER; // Special; used by display code
#if MEM_TRACK_TYPE
S32 mTypeIndex; S32 mTypeIndex;
#endif
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------