BUILDFIX: reverted changes that attempted to automate mem track

stat definition as they don't work on gcc/clang
meow-7.2.2
Richard Linden 2013-07-01 18:50:51 -07:00
parent 04bdc8ba83
commit 8208a40412
17 changed files with 35 additions and 14 deletions

View File

@ -336,7 +336,7 @@ public:
void* operator new(size_t size)
{
MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size);
@ -348,7 +348,7 @@ public:
void operator delete(void* ptr, size_t size)
{
MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size);
@ -360,7 +360,7 @@ public:
void *operator new [](size_t size)
{
MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size);
@ -372,7 +372,7 @@ public:
void operator delete[](void* ptr, size_t size)
{
MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size);
@ -438,15 +438,13 @@ public:
private:
size_t mMemFootprint;
static MemStatHandle sMemStat;
template<typename TRACKED, typename TRACKED_IS_TRACKER = void>
struct TrackMemImpl
{
static void claim(mem_trackable_t& tracker, const TRACKED& tracked)
{
MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
size_t footprint = MemFootprint<TRACKED>::measure(tracked);
@ -457,7 +455,7 @@ private:
static void disclaim(mem_trackable_t& tracker, const TRACKED& tracked)
{
MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
size_t footprint = MemFootprint<TRACKED>::measure(tracked);
@ -472,7 +470,7 @@ private:
{
static void claim(mem_trackable_t& tracker, TRACKED& tracked)
{
MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() + (F64)MemFootprint<TRACKED>::measure(tracked));
@ -481,7 +479,7 @@ private:
static void disclaim(mem_trackable_t& tracker, TRACKED& tracked)
{
MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator();
MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator();
if (accumulator)
{
accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() - (F64)MemFootprint<TRACKED>::measure(tracked));
@ -490,9 +488,5 @@ private:
};
};
template<typename DERIVED, size_t ALIGNMENT>
MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(typeid(DERIVED).name());
}
#endif // LL_LLTRACE_H

View File

@ -50,6 +50,7 @@ LLMutex* LLImage::sMutex = NULL;
bool LLImage::sUseNewByteRange = false;
S32 LLImage::sMinimalReverseByteRangePercent = 75;
LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ;
LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage");
//static
void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent)

View File

@ -165,6 +165,8 @@ public:
static void destroyPrivatePool() ;
static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;}
static LLTrace::MemStatHandle sMemStat;
private:
U8 *mData;
S32 mDataSize;

View File

@ -44,6 +44,9 @@
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage");
LLImageBase::LLImageBase()
: mData(NULL),
mDataSize(0),

View File

@ -44,6 +44,8 @@
// End Stubbing
// -------------------------------------------------------------------------------------------
// Stub the LL Image Classes
LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage");
LLImageRaw::LLImageRaw() { }
LLImageRaw::~LLImageRaw() { }
U8* LLImageRaw::allocateData(S32 ) { return NULL; }

View File

@ -48,6 +48,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds
const S32 CURSOR_THICKNESS = 2;
const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click.
LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment");
LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num)
: mDocIndexStart(index_start),
mDocIndexEnd(index_end),

View File

@ -100,6 +100,8 @@ public:
S32 getEnd() const { return mEnd; }
void setEnd( S32 end ) { mEnd = end; }
static LLTrace::MemStatHandle sMemStat;
protected:
S32 mStart;
S32 mEnd;

View File

@ -69,6 +69,7 @@ LLView* LLView::sPreviewClickedElement = NULL;
BOOL LLView::sDrawPreviewHighlights = FALSE;
S32 LLView::sLastLeftXML = S32_MIN;
S32 LLView::sLastBottomXML = S32_MIN;
LLTrace::MemStatHandle LLView::sMemStat("LLView");
std::vector<LLViewDrawContext*> LLViewDrawContext::sDrawContextStack;
LLView::DrilldownFunc LLView::sDrilldown =

View File

@ -675,6 +675,7 @@ public:
static S32 sLastLeftXML;
static S32 sLastBottomXML;
static BOOL sForceReshape;
static LLTrace::MemStatHandle sMemStat;
};
namespace LLInitParam

View File

@ -35,6 +35,8 @@
// external library headers
// other Linden headers
LLTrace::MemStatHandle LLViewModel::sMemStat("LLViewModel");
///
LLViewModel::LLViewModel()
: mDirty(false)

View File

@ -83,6 +83,8 @@ public:
//
void setDirty() { mDirty = true; }
static LLTrace::MemStatHandle sMemStat;
protected:
LLSD mValue;
bool mDirty;

View File

@ -59,6 +59,7 @@ const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
extern bool gShiftFrame;
LLTrace::MemStatHandle LLDrawable::sMemStat("LLDrawable");
////////////////////////

View File

@ -293,6 +293,7 @@ public:
F32 mDistanceWRTCamera;
static F32 sCurPixelAngle; //current pixels per radian
static LLTrace::MemStatHandle sMemStat;
private:
typedef std::vector<LLFace*> face_list_t;

View File

@ -114,6 +114,8 @@ BOOL LLViewerObject::sMapDebug = TRUE;
LLColor4 LLViewerObject::sEditSelectColor( 1.0f, 1.f, 0.f, 0.3f); // Edit OK
LLColor4 LLViewerObject::sNoEditSelectColor( 1.0f, 0.f, 0.f, 0.3f); // Can't edit
S32 LLViewerObject::sAxisArrowLength(50);
LLTrace::MemStatHandle LLViewerObject::sMemStat("LLViewerObject");
BOOL LLViewerObject::sPulseEnabled(FALSE);
BOOL LLViewerObject::sUseSharedDrawables(FALSE); // TRUE

View File

@ -661,6 +661,7 @@ public:
LLPointer<class LLHUDIcon> mIcon;
static BOOL sUseSharedDrawables;
static LLTrace::MemStatHandle sMemStat;
protected:
// delete an item in the inventory, but don't tell the

View File

@ -34,6 +34,8 @@
#include "llviewerregion.h"
#include "pipeline.h"
LLTrace::MemStatHandle LLVOCachePartition::sMemStat("LLVOCachePartition");
BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes)
{
return apr_file->read(src, n_bytes) == n_bytes ;

View File

@ -157,6 +157,8 @@ public:
/*virtual*/ S32 cull(LLCamera &camera);
void addOccluders(LLviewerOctreeGroup* gp);
static LLTrace::MemStatHandle sMemStat;
private:
void processOccluders(LLCamera* camera, const LLVector3* region_agent);