Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Lamp::MemoryChecker Class Reference

メモリチェッカ More...

#include <MemoryChecker.h>

List of all members.

Static Public Member Functions

void initialize ()
 メモリ初期化

State getState ()
 メモリステートの取得

void dumpDetail ()
 詳細ダンプ

void dumpDetail (const State &oldState)
 詳細の差分ダンプ

void dumpStatistics ()
 統計のダンプ

void dumpStatistics (const State &oldState)
 統計の差分ダンプ

bool leakCheck (const State &oldState)
 メモリリークチェック


Detailed Description

メモリチェッカ

メモリリークを検出する為のクラスです。
システム初期化時に MemoryChecker::initialize()を呼んで下さい。

サンプルコード

// 初期化 MemoryChecker::initialize();

// メモリの詳細な情報をダンプ MemoryChecker::dumpDetail(); // メモリの統計情報をダンプ MemoryChecker::dumpStatistics();

// 現在のメモリステートを取得 MemoryChecker::State state = MemoryChecker::getState();

// メモリを使用する処理 allocateMemoryMethod();

// allocateMemoryMethod()で使用したメモリの詳細な情報をダンプ MemoryChecker::dumpDetail(state); // allocateMemoryMethod()で使用したメモリの統計情報をダンプ MemoryChecker::dumpStatistics(state);

// メモリを解放する処理 freeMemoryMethod();

// freeMemoryMethodでちゃんとメモリが解放されているかチェックする MemoryChecker::leakCheck(state);

Definition at line 77 of file MemoryChecker.h.


Member Function Documentation

void Lamp::MemoryChecker::dumpDetail const State oldState  )  [static]
 

詳細の差分ダンプ

メモリ差分の詳細な情報ををデバッグ出力にダンプします。

Parameters:
oldState 差分を取る以前のステート

Definition at line 63 of file MemoryChecker.cpp.

References Lamp::MemoryChecker::State::state.

void Lamp::MemoryChecker::dumpDetail  )  [static]
 

詳細ダンプ

メモリの詳細な情報ををデバッグ出力にダンプします。

Definition at line 58 of file MemoryChecker.cpp.

References NULL.

void Lamp::MemoryChecker::dumpStatistics const State oldState  )  [static]
 

統計の差分ダンプ

メモリ差分の統計情報をデバッグ出力にダンプします。

Parameters:
oldState 差分を取る以前のステート

Definition at line 75 of file MemoryChecker.cpp.

References Lamp::MemoryChecker::State::state.

void Lamp::MemoryChecker::dumpStatistics  )  [static]
 

統計のダンプ

メモリの統計情報をデバッグ出力にダンプします。

Definition at line 68 of file MemoryChecker.cpp.

References Lamp::MemoryChecker::State::state.

MemoryChecker::State Lamp::MemoryChecker::getState  )  [static]
 

メモリステートの取得

Returns:
メモリステート

Definition at line 51 of file MemoryChecker.cpp.

References Lamp::MemoryChecker::State::state.

void Lamp::MemoryChecker::initialize  )  [static]
 

メモリ初期化

システムの初期化時に一度だけ呼んで下さい。

Definition at line 39 of file MemoryChecker.cpp.

bool Lamp::MemoryChecker::leakCheck const State oldState  )  [static]
 

メモリリークチェック

メモリリークをチェックします。 メモリ使用量が同じ場合はリークを検出できません。 メモリ使用量が同じでリークを検出するにはdumpDetailを使用してください。

Parameters:
oldState 差分を取る以前のステート @
Returns:
trueならメモリリークが発生している。

Definition at line 83 of file MemoryChecker.cpp.

References DebugOut, DebugOutLine, DebugOutThickLine, and Lamp::MemoryChecker::State::state.


The documentation for this class was generated from the following files:
Generated on Wed Mar 16 10:29:48 2005 for Lamp by doxygen 1.3.2