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

📄 utl_algmem.c

📁 使用CCS信息DSP编程,适用于6713B的启动程序。
💻 C
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) ReferenceFrameworks 2.20.00.08 07-18-03 (swat-f02)" */
/*
 *  ======== utl_algmem.c ========
 *
 *  Implementation of the UTL_showAlgmem() function.
 */
#include <std.h>
#include <log.h>

#include <ialg.h>

#include <algrf.h>
#include <utl.h>

/*
 *  ======== UTL_showAlgMem ==========
 *
 *  For the given XDAIS algorithm handle, shows all algorithm's memTab[] 
 *  allocation information on standard log output; if boolVerbose is nonzero,
 *  it also prints addresses
 */
Void UTL_showAlgMemFunc( Ptr algHandlePtr, String algName, Int boolVerbose )
{
    IALG_MemRec memTab[ ALGRF_MAXMEMRECS ];
    Int totalSizeInt = 0;
    Int totalSizeExt = 0;
    Int numRecs, i;
    IALG_Handle algHandle = (IALG_Handle)algHandlePtr;
    
    if (UTL_logDebugHandle == NULL) {
        return;
    }
    
    /* query the algorithm about its allocated memory segments */
    numRecs = algHandle->fxns->algFree( algHandle, memTab );
    memTab[0].base = algHandle;

    /* If pointer is NULL, treat the string as a null character */
    if (algName == NULL) {
        LOG_printf( UTL_logDebugHandle, "Alg  mem. alloc:" );
    }
    else {
        LOG_printf( UTL_logDebugHandle, "Alg %s mem. alloc:", algName );
    }
    for (i = 0; i < numRecs; ++i) {
        if (ALGRF_memSpace( memTab[i].space) == ALGRF->INTHEAP ) {
            LOG_printf( UTL_logDebugHandle, 
                "  memTab[%d]: size = %d (internal)", i, memTab[i].size );
            totalSizeInt += memTab[i].size;
        } else {
            LOG_printf( UTL_logDebugHandle, 
                "  memTab[%d]: size = %d (external)", i, memTab[i].size );
            totalSizeExt += memTab[i].size;
        }
        if (boolVerbose) {
            LOG_printf( UTL_logDebugHandle, 
                "    addr = 0x%x (segID = %d)", memTab[i].base,  memTab[i].space );
        }
    }
    LOG_printf( UTL_logDebugHandle, 
        "  total size: int. = %d, ext. = %d", totalSizeInt, totalSizeExt );
}


⌨️ 快捷键说明

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