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

📄 xmemtst2.c

📁 Extended C/C++ Dynamic Memory Control And Debug Library
💻 C
字号:
/*****************************************************************************/
/*
    XMEMTST2.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       : XMEMTST2.C
    REVISION   : 01-Jan-2008
                 18:54:26
 */
/*****************************************************************************/

/* no XMEM inclusion! */

#ifdef __cplusplus
#error this file must be compiled as C code!
#endif

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

#if _MSC_VER >= 1400
#define strdup      _strdup
#endif

static void *p;
static void *q;

void xmem_tst3_function1(void)
{
  p = malloc(321);
  q = strdup("strdup");
}

void xmem_tst4_function1(void)
{
  free(p);
#if CLEAN
  free(q);
#endif
}
/*****************************************************************************/

⌨️ 快捷键说明

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