File: test7.3.1.cc

package info (click to toggle)
libcwd 1.0.4-1.1
  • links: PTS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 8,136 kB
  • ctags: 10,313
  • sloc: cpp: 23,354; sh: 9,798; ansic: 1,172; makefile: 852; exp: 234; awk: 11
file content (24 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "sys.h"
#include "debug.h"

using namespace libcwd;

int main(void)
{
  Debug( libcw_do.on() );
  Debug( dc::malloc.on() );

  char* memory_leak = new char [300];
  AllocTag(memory_leak, "memory_leak");

  // Debug( make_invisible(memory_leak) );

#ifdef CWDEBUG
  if (mem_blocks() > 0)
    Dout(dc::warning, "There are still " << mem_size() << " bytes allocated!");
  else
    Dout(dc::malloc, "No memory leaks.");
#endif

  return 0;
}