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

📄 xmemaspc2.ah

📁 Extended C/C++ Dynamic Memory Control And Debug Library
💻 AH
字号:
/*****************************************************************************/
/*
    XMEMASPC2.AH - Extended C/C++ Dynamic Memory Control And Debug Library

    Copyright (C) Juergen Mueller (J.M.) 2005-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       : XMEMASPC2.AH
    REVISION   : 01-Jan-2008
                 11:21:57
 */
/*****************************************************************************/

/* XMEM example with AspectC++ */
/* version with C++ aspects for preprocessed code for XMEM */

/*****************************************************************************/
/* XMEM aspects */
/*****************************************************************************/
aspect XMEM_debug
{
  pointcut XMEM_API() =    "% xmem_malloc(...)"
                        || "% xmem_calloc(...)"
                        || "% xmem_realloc(...)"
                        || "% xmem_free(...)"
                        || "% xmem_strdup(...)";
  advice call (XMEM_API()) : around()
  {
    printf("\nXMEM aspect: before call to %s", JoinPoint::signature());
    tjp->proceed();         /****  do the real call the replecing XMEM memory debugging function ****/
    printf("\nXMEM aspect: after return from %s", JoinPoint::signature());
  }
};

⌨️ 快捷键说明

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