⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmemgc.c

📁 Extended C/C++ Dynamic Memory Control And Debug Library
💻 C
字号:
/*****************************************************************************/
/*
    XMEMGC.C - Tests for extended C/C++ Dynamic Memory Control And Debug Library

    Copyright (C) Juergen Mueller (J.M.) 1987-2008
    All rights reserved.

    You are expressly prohibited from selling this software in any form
    or removing this notice.

    THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
    EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE
    IMPLIED WARRANTIES OF MERCHANTIBILITY, FITNESS FOR A PARTICULAR
    PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR
    ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. THE ENTIRE RISK
    AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM AND DOCUMENTATION
    IS WITH YOU.

    Permission to modify the code and to distribute modified code is granted,
    provided the above notices are retained, and a notice that the code was
    modified is included with the above copyright notice.

    written by: Juergen Mueller, D-70806 Kornwestheim, GERMANY

    FILE       : XMEMGC.C
    REVISION   : 01-Jan-2008
                 18:08:01
 */
/*****************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>

#include "xmem.h"

/*****************************************************************************/
/* XMEM main test function */
/*****************************************************************************/
int main(int argc, char *argv[])
{
  int i;
  argc = argc;
  argv = argv;

/******** prolog: initializations ********/
#if XMEM
  xmem_set_memtrace(1);
#endif

  for (i = 1; i <= 3; ++i)
  {
    malloc(i * 10);
#if __cplusplus
    new int [i * 1000];
#endif
  }

/******** epilog: clean-up ********/
#if XMEM
  xmem_check_free();
#endif

  return(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -