PageRenderTime 14ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/llfloatermemleak.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 75 lines | 37 code | 12 blank | 26 comment | 0 complexity | b3b0ce8934a718bb33aefadf4971f61c MD5 | raw file
 1/** 
 2 * @file llfloatermemleak.h
 3 * @brief memory leaking simulation window, debug use only
 4 *
 5 * $LicenseInfo:firstyear=2004&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLFLOATERMEMLEAK_H
28#define LL_LLFLOATERMEMLEAK_H
29
30#include "llfloater.h"
31
32class LLFloaterMemLeak : public LLFloater
33{
34	friend class LLFloaterReg;
35public:
36	/// initialize all the callbacks for the menu
37
38	virtual BOOL postBuild() ;
39	virtual void draw() ;
40	
41	void onChangeLeakingSpeed();
42	void onChangeMaxMemLeaking();
43	void onClickStart();
44	void onClickStop();
45	void onClickRelease();
46	void onClickClose();
47
48public:
49	void idle() ;
50	void stop() ;
51
52private:
53	
54	LLFloaterMemLeak(const LLSD& key);
55	virtual ~LLFloaterMemLeak();
56	void release() ;
57
58private:
59	enum 
60	{
61		RELEASE = -1 ,
62		STOP,
63		START
64	} ;
65
66	static U32 sMemLeakingSpeed ; //bytes leaked per frame
67	static U32 sMaxLeakedMem ; //maximum allowed leaked memory
68	static U32 sTotalLeaked ;
69	static S32 sStatus ; //0: stop ; >0: start ; <0: release
70	static BOOL sbAllocationFailed ;
71
72	std::vector<char*> mLeakedMem ;	
73};
74
75#endif // LL_LLFLOATERMEMLEAK_H