|
Last change
on this file since 0d111b was 90c4460, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added a small memory tracker to the programm.
|
-
Property mode
set to
100644
|
|
File size:
642 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * MemDebug.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Apr 28, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef MEMDEBUG_HPP_
|
|---|
| 9 | #define MEMDEBUG_HPP_
|
|---|
| 10 |
|
|---|
| 11 | namespace Memory {
|
|---|
| 12 | void getState();
|
|---|
| 13 |
|
|---|
| 14 | void _ignore(void*);
|
|---|
| 15 |
|
|---|
| 16 | template <typename T>
|
|---|
| 17 | T *ignore(T* ptr){
|
|---|
| 18 | _ignore((void*)ptr);
|
|---|
| 19 | return ptr;
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | void *operator new (size_t nbytes,const char* file, int line) throw(std::bad_alloc);
|
|---|
| 24 | void *operator new[] (size_t nbytes,const char* file, int line) throw(std::bad_alloc);
|
|---|
| 25 | void operator delete (void *ptr,const char*, int) throw();
|
|---|
| 26 | void operator delete[] (void *ptr,const char*, int) throw();
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | #define new new(__FILE__,__LINE__)
|
|---|
| 30 |
|
|---|
| 31 | #endif /* MEMDEBUG_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.