Copyright (C) Kevin Larke 2009-2020

This file is part of libcm.

libcm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See the GNU General Public License distributed with the libcm package or look here: .


cmMain : Template 'main.c' for 'libcm' based program

#include "cmGlobal.h"
#include "cmRpt.h"
#include "cmMem.h"
#include "cmMallocDebug.h"
#include "cmLinkedHeap.h"

void print(void* cmRptUserPtr, const char* text)
{ printf(text); }


int main(int argc, char* argv[] )
{
  
  // initialize the heap check library
  bool       memDebugFl          = true;
  unsigned   memPadByteCnt       = memDebugFl ? 8 : 0;
  unsigned   memAlignByteCnt     = 16;
  unsigned   memFlags            = memDebugFl ? kTrackMmFl | kDeferFreeMmFl | kFillUninitMmFl : 0;
  
  cmRpt_t    rpt;
  cmRptSetup(&rpt,print,print,NULL);
  
  //cmMdTest(&amprpt);
  //return 0;  
  
  cmMdInitialize( memPadByteCnt, memAlignByteCnt, memFlags, &rpt );
  
  cmLHeapTest();
  
  cmMdReport();
  cmMdFinalize();
  return 0;
}