1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
13 static void *dummy
= NULL
;
15 void *operator new(size_t size
) throw ()
20 void *operator new[](size_t size
) throw ()
22 if (size
== 0) return &dummy
;
23 else return Malloc(size
);
26 void operator delete(void *ptr
) throw()
31 void operator delete[](void *ptr
) throw()
33 if (ptr
!= (void*)&dummy
) Free(ptr
);
36 /**************************************************************************/
40 // overloads for memory debug
41 void* operator new(size_t size
, const char* file
, int line
)
43 return Malloc_dbg(file
, line
, size
);
46 void* operator new[](size_t size
, const char* file
, int line
)
48 if (size
== 0) return &dummy
;
49 else return Malloc_dbg(file
, line
, size
);
52 int debug_new_counter_t::count
= 0; // initial value
54 #if defined(__CYGWIN__) || defined(INTERIX)
60 const char * __argv
[] __attribute__((weak
)) =
67 const char * debug_new_counter_t::progname
= __argv
[0];
69 debug_new_counter_t::debug_new_counter_t()
74 debug_new_counter_t::~debug_new_counter_t()
77 check_mem_leak(progname
);
81 void debug_new_counter_t::set_program_name(const char * pgn
)
86 #endif // MEMORY_DEBUG
This page took 0.041652 seconds and 5 git commands to generate.