PageRenderTime 31ms CodeModel.GetById 16ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLFLOATERMEMLEAK_H
  27. #define LL_LLFLOATERMEMLEAK_H
  28. #include "llfloater.h"
  29. class LLFloaterMemLeak : public LLFloater
  30. {
  31. friend class LLFloaterReg;
  32. public:
  33. /// initialize all the callbacks for the menu
  34. virtual BOOL postBuild() ;
  35. virtual void draw() ;
  36. void onChangeLeakingSpeed();
  37. void onChangeMaxMemLeaking();
  38. void onClickStart();
  39. void onClickStop();
  40. void onClickRelease();
  41. void onClickClose();
  42. public:
  43. void idle() ;
  44. void stop() ;
  45. private:
  46. LLFloaterMemLeak(const LLSD& key);
  47. virtual ~LLFloaterMemLeak();
  48. void release() ;
  49. private:
  50. enum
  51. {
  52. RELEASE = -1 ,
  53. STOP,
  54. START
  55. } ;
  56. static U32 sMemLeakingSpeed ; //bytes leaked per frame
  57. static U32 sMaxLeakedMem ; //maximum allowed leaked memory
  58. static U32 sTotalLeaked ;
  59. static S32 sStatus ; //0: stop ; >0: start ; <0: release
  60. static BOOL sbAllocationFailed ;
  61. std::vector<char*> mLeakedMem ;
  62. };
  63. #endif // LL_LLFLOATERMEMLEAK_H