diff options
Diffstat (limited to 'linden/indra/newview/llfloatermemleak.h')
-rw-r--r-- | linden/indra/newview/llfloatermemleak.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloatermemleak.h b/linden/indra/newview/llfloatermemleak.h new file mode 100644 index 0000000..6a7b157 --- /dev/null +++ b/linden/indra/newview/llfloatermemleak.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /** | ||
2 | * @file llfloatermemleak.h | ||
3 | * @brief memory leaking simulation window, debug use only | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2004&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2004-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LLFLOATERMEMLEAK_H | ||
33 | #define LL_LLFLOATERMEMLEAK_H | ||
34 | |||
35 | #include "llfloater.h" | ||
36 | |||
37 | class LLFloaterMemLeak : public LLFloater | ||
38 | { | ||
39 | public: | ||
40 | LLFloaterMemLeak(); | ||
41 | virtual ~LLFloaterMemLeak(); | ||
42 | |||
43 | /// initialize all the callbacks for the menu | ||
44 | //void initCallbacks(void); | ||
45 | virtual BOOL postBuild() ; | ||
46 | virtual void draw() ; | ||
47 | |||
48 | /// one and one instance only | ||
49 | static LLFloaterMemLeak* instance(); | ||
50 | |||
51 | static void onChangeLeakingSpeed(LLUICtrl* ctrl, void* userData); | ||
52 | static void onChangeMaxMemLeaking(LLUICtrl* ctrl, void* userData); | ||
53 | static void onClickStart(void* userData); | ||
54 | static void onClickStop(void* userData); | ||
55 | static void onClickRelease(void* userData); | ||
56 | static void onClickClose(void* userData); | ||
57 | |||
58 | /// show off our menu | ||
59 | static void show(void*); | ||
60 | |||
61 | public: | ||
62 | static LLFloaterMemLeak* getInstance() ; | ||
63 | void idle() ; | ||
64 | void stop() ; | ||
65 | |||
66 | private: | ||
67 | void release() ; | ||
68 | |||
69 | private: | ||
70 | enum | ||
71 | { | ||
72 | RELEASE = -1 , | ||
73 | STOP, | ||
74 | START | ||
75 | } ; | ||
76 | |||
77 | // one instance on the inside | ||
78 | static LLFloaterMemLeak* sInstance; | ||
79 | |||
80 | static U32 sMemLeakingSpeed ; //bytes leaked per frame | ||
81 | static U32 sMaxLeakedMem ; //maximum allowed leaked memory | ||
82 | static U32 sTotalLeaked ; | ||
83 | static S32 sStatus ; //0: stop ; >0: start ; <0: release | ||
84 | static BOOL sbAllocationFailed ; | ||
85 | |||
86 | std::vector<char*> mLeakedMem ; | ||
87 | }; | ||
88 | |||
89 | #endif // LL_LLFLOATERMEMLEAK_H | ||