PageRenderTime 65ms CodeModel.GetById 16ms app.highlight 44ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llmemtype.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 242 lines | 165 code | 41 blank | 36 comment | 1 complexity | 088a691951df8da2427258152fbb4bb0 MD5 | raw file
  1/** 
  2 * @file llmemtype.h
  3 * @brief Runtime memory usage debugging utilities.
  4 *
  5 * $LicenseInfo:firstyear=2005&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_MEMTYPE_H
 28#define LL_MEMTYPE_H
 29
 30//----------------------------------------------------------------------------
 31//----------------------------------------------------------------------------
 32
 33//----------------------------------------------------------------------------
 34
 35#include "linden_common.h"
 36//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 37// WARNING: Never commit with MEM_TRACK_MEM == 1
 38//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 39#define MEM_TRACK_MEM (0 && LL_WINDOWS)
 40
 41#include <vector>
 42
 43#define MEM_TYPE_NEW(T)
 44
 45class LL_COMMON_API LLMemType
 46{
 47public:
 48
 49	// class we'll initialize all instances of as
 50	// static members of MemType.  Then use
 51	// to construct any new mem type.
 52	class LL_COMMON_API DeclareMemType
 53	{
 54	public:
 55		DeclareMemType(char const * st);
 56		~DeclareMemType();
 57	
 58		S32 mID;
 59		char const * mName;
 60		
 61		// array so we can map an index ID to Name
 62		static std::vector<char const *> mNameList;
 63	};
 64
 65	LLMemType(DeclareMemType& dt);
 66	~LLMemType();
 67
 68	static char const * getNameFromID(S32 id);
 69
 70	static DeclareMemType MTYPE_INIT;
 71	static DeclareMemType MTYPE_STARTUP;
 72	static DeclareMemType MTYPE_MAIN;
 73	static DeclareMemType MTYPE_FRAME;
 74
 75	static DeclareMemType MTYPE_GATHER_INPUT;
 76	static DeclareMemType MTYPE_JOY_KEY;
 77
 78	static DeclareMemType MTYPE_IDLE;
 79	static DeclareMemType MTYPE_IDLE_PUMP;
 80	static DeclareMemType MTYPE_IDLE_NETWORK;
 81	static DeclareMemType MTYPE_IDLE_UPDATE_REGIONS;
 82	static DeclareMemType MTYPE_IDLE_UPDATE_VIEWER_REGION;
 83	static DeclareMemType MTYPE_IDLE_UPDATE_SURFACE;
 84	static DeclareMemType MTYPE_IDLE_UPDATE_PARCEL_OVERLAY;
 85	static DeclareMemType MTYPE_IDLE_AUDIO;
 86
 87	static DeclareMemType MTYPE_CACHE_PROCESS_PENDING;
 88	static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_ASKS;
 89	static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_REPLIES;
 90
 91	static DeclareMemType MTYPE_MESSAGE_CHECK_ALL;
 92	static DeclareMemType MTYPE_MESSAGE_PROCESS_ACKS;
 93
 94	static DeclareMemType MTYPE_RENDER;
 95	static DeclareMemType MTYPE_SLEEP;
 96
 97	static DeclareMemType MTYPE_NETWORK;
 98	static DeclareMemType MTYPE_PHYSICS;
 99	static DeclareMemType MTYPE_INTERESTLIST;
100
101	static DeclareMemType MTYPE_IMAGEBASE;
102	static DeclareMemType MTYPE_IMAGERAW;
103	static DeclareMemType MTYPE_IMAGEFORMATTED;
104	
105	static DeclareMemType MTYPE_APPFMTIMAGE;
106	static DeclareMemType MTYPE_APPRAWIMAGE;
107	static DeclareMemType MTYPE_APPAUXRAWIMAGE;
108	
109	static DeclareMemType MTYPE_DRAWABLE;
110	
111	static DeclareMemType MTYPE_OBJECT;
112	static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE;
113	static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE_CORE;
114
115	static DeclareMemType MTYPE_DISPLAY;
116	static DeclareMemType MTYPE_DISPLAY_UPDATE;
117	static DeclareMemType MTYPE_DISPLAY_UPDATE_CAMERA;
118	static DeclareMemType MTYPE_DISPLAY_UPDATE_GEOM;
119	static DeclareMemType MTYPE_DISPLAY_SWAP;
120	static DeclareMemType MTYPE_DISPLAY_UPDATE_HUD;
121	static DeclareMemType MTYPE_DISPLAY_GEN_REFLECTION;
122	static DeclareMemType MTYPE_DISPLAY_IMAGE_UPDATE;
123	static DeclareMemType MTYPE_DISPLAY_STATE_SORT;
124	static DeclareMemType MTYPE_DISPLAY_SKY;
125	static DeclareMemType MTYPE_DISPLAY_RENDER_GEOM;
126	static DeclareMemType MTYPE_DISPLAY_RENDER_FLUSH;
127	static DeclareMemType MTYPE_DISPLAY_RENDER_UI;
128	static DeclareMemType MTYPE_DISPLAY_RENDER_ATTACHMENTS;
129
130	static DeclareMemType MTYPE_VERTEX_DATA;
131	static DeclareMemType MTYPE_VERTEX_CONSTRUCTOR;
132	static DeclareMemType MTYPE_VERTEX_DESTRUCTOR;
133	static DeclareMemType MTYPE_VERTEX_CREATE_VERTICES;
134	static DeclareMemType MTYPE_VERTEX_CREATE_INDICES;
135	static DeclareMemType MTYPE_VERTEX_DESTROY_BUFFER;	
136	static DeclareMemType MTYPE_VERTEX_DESTROY_INDICES;
137	static DeclareMemType MTYPE_VERTEX_UPDATE_VERTS;
138	static DeclareMemType MTYPE_VERTEX_UPDATE_INDICES;
139	static DeclareMemType MTYPE_VERTEX_ALLOCATE_BUFFER;
140	static DeclareMemType MTYPE_VERTEX_RESIZE_BUFFER;
141	static DeclareMemType MTYPE_VERTEX_MAP_BUFFER;
142	static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_VERTICES;
143	static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_INDICES;
144	static DeclareMemType MTYPE_VERTEX_UNMAP_BUFFER;
145	static DeclareMemType MTYPE_VERTEX_SET_STRIDE;
146	static DeclareMemType MTYPE_VERTEX_SET_BUFFER;
147	static DeclareMemType MTYPE_VERTEX_SETUP_VERTEX_BUFFER;
148	static DeclareMemType MTYPE_VERTEX_CLEANUP_CLASS;
149
150	static DeclareMemType MTYPE_SPACE_PARTITION;
151
152	static DeclareMemType MTYPE_PIPELINE;
153	static DeclareMemType MTYPE_PIPELINE_INIT;
154	static DeclareMemType MTYPE_PIPELINE_CREATE_BUFFERS;
155	static DeclareMemType MTYPE_PIPELINE_RESTORE_GL;
156	static DeclareMemType MTYPE_PIPELINE_UNLOAD_SHADERS;
157	static DeclareMemType MTYPE_PIPELINE_LIGHTING_DETAIL;
158	static DeclareMemType MTYPE_PIPELINE_GET_POOL_TYPE;
159	static DeclareMemType MTYPE_PIPELINE_ADD_POOL;
160	static DeclareMemType MTYPE_PIPELINE_ALLOCATE_DRAWABLE;
161	static DeclareMemType MTYPE_PIPELINE_ADD_OBJECT;
162	static DeclareMemType MTYPE_PIPELINE_CREATE_OBJECTS;
163	static DeclareMemType MTYPE_PIPELINE_UPDATE_MOVE;
164	static DeclareMemType MTYPE_PIPELINE_UPDATE_GEOM;
165	static DeclareMemType MTYPE_PIPELINE_MARK_VISIBLE;
166	static DeclareMemType MTYPE_PIPELINE_MARK_MOVED;
167	static DeclareMemType MTYPE_PIPELINE_MARK_SHIFT;
168	static DeclareMemType MTYPE_PIPELINE_SHIFT_OBJECTS;
169	static DeclareMemType MTYPE_PIPELINE_MARK_TEXTURED;
170	static DeclareMemType MTYPE_PIPELINE_MARK_REBUILD;
171	static DeclareMemType MTYPE_PIPELINE_UPDATE_CULL;
172	static DeclareMemType MTYPE_PIPELINE_STATE_SORT;
173	static DeclareMemType MTYPE_PIPELINE_POST_SORT;
174	
175	static DeclareMemType MTYPE_PIPELINE_RENDER_HUD_ELS;
176	static DeclareMemType MTYPE_PIPELINE_RENDER_HL;
177	static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM;
178	static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED;
179	static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_POST_DEF;
180	static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_SHADOW;
181	static DeclareMemType MTYPE_PIPELINE_RENDER_SELECT;
182	static DeclareMemType MTYPE_PIPELINE_REBUILD_POOLS;
183	static DeclareMemType MTYPE_PIPELINE_QUICK_LOOKUP;
184	static DeclareMemType MTYPE_PIPELINE_RENDER_OBJECTS;
185	static DeclareMemType MTYPE_PIPELINE_GENERATE_IMPOSTOR;
186	static DeclareMemType MTYPE_PIPELINE_RENDER_BLOOM;
187
188	static DeclareMemType MTYPE_UPKEEP_POOLS;
189
190	static DeclareMemType MTYPE_AVATAR;
191	static DeclareMemType MTYPE_AVATAR_MESH;
192	static DeclareMemType MTYPE_PARTICLES;
193	static DeclareMemType MTYPE_REGIONS;
194
195	static DeclareMemType MTYPE_INVENTORY;
196	static DeclareMemType MTYPE_INVENTORY_DRAW;
197	static DeclareMemType MTYPE_INVENTORY_BUILD_NEW_VIEWS;
198	static DeclareMemType MTYPE_INVENTORY_DO_FOLDER;
199	static DeclareMemType MTYPE_INVENTORY_POST_BUILD;
200	static DeclareMemType MTYPE_INVENTORY_FROM_XML;
201	static DeclareMemType MTYPE_INVENTORY_CREATE_NEW_ITEM;
202	static DeclareMemType MTYPE_INVENTORY_VIEW_INIT;
203	static DeclareMemType MTYPE_INVENTORY_VIEW_SHOW;
204	static DeclareMemType MTYPE_INVENTORY_VIEW_TOGGLE;
205
206	static DeclareMemType MTYPE_ANIMATION;
207	static DeclareMemType MTYPE_VOLUME;
208	static DeclareMemType MTYPE_PRIMITIVE;
209	
210	static DeclareMemType MTYPE_SCRIPT;
211	static DeclareMemType MTYPE_SCRIPT_RUN;
212	static DeclareMemType MTYPE_SCRIPT_BYTECODE;
213	
214	static DeclareMemType MTYPE_IO_PUMP;
215	static DeclareMemType MTYPE_IO_TCP;
216	static DeclareMemType MTYPE_IO_BUFFER;
217	static DeclareMemType MTYPE_IO_HTTP_SERVER;
218	static DeclareMemType MTYPE_IO_SD_SERVER;
219	static DeclareMemType MTYPE_IO_SD_CLIENT;
220	static DeclareMemType MTYPE_IO_URL_REQUEST;
221
222	static DeclareMemType MTYPE_DIRECTX_INIT;
223
224	static DeclareMemType MTYPE_TEMP1;
225	static DeclareMemType MTYPE_TEMP2;
226	static DeclareMemType MTYPE_TEMP3;
227	static DeclareMemType MTYPE_TEMP4;
228	static DeclareMemType MTYPE_TEMP5;
229	static DeclareMemType MTYPE_TEMP6;
230	static DeclareMemType MTYPE_TEMP7;
231	static DeclareMemType MTYPE_TEMP8;
232	static DeclareMemType MTYPE_TEMP9;
233
234	static DeclareMemType MTYPE_OTHER; // Special; used by display code
235
236	S32 mTypeIndex;
237};
238
239//----------------------------------------------------------------------------
240
241#endif
242