TNB Library
TnbNewThrow.h
[詳解]
1#pragma once
23#ifndef _TnbDOXYGEN //Document作成用シンボル
24
25#ifdef _DEBUG
26
27//=== デバッグビルド時
28
29#include "TnbNewDebug.h"
30
31
32#else
33
34//=== リリースビルド時
35
36#include <new.h>
37#include <new>
38
39namespace TNB{
40namespace NEW
41{
42
43class CThrowNew
44{
46 static int HandleProgramMemoryDepletion(size_t)
47 {
48 throw std::bad_alloc();
49 }
50public:
51 CThrowNew(void)
52 {
53 ::_set_new_handler(HandleProgramMemoryDepletion);
54 ::_set_new_mode(1);
55 }
56};
57
58namespace
59{
60 CThrowNew s_cThrowNew;
61};
62
63}; //NEW
64}; //TNB
65
66
67#endif // _DEBUG
68
69#endif //_TnbDOXYGEN
開発用メモリ状態管理関係のヘッダ.
TNB Library
Definition: TnbDoxyTitle.txt:2