当前位置: 首页>>代码示例>>C++>>正文


C++ clHeapFree函数代码示例

本文整理汇总了C++中clHeapFree函数的典型用法代码示例。如果您正苦于以下问题:C++ clHeapFree函数的具体用法?C++ clHeapFree怎么用?C++ clHeapFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了clHeapFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: clLogCompEntryUnpackNAdd

ClRcT
clLogCompEntryUnpackNAdd(ClBufferHandleT        msg,
                         ClLogStreamOwnerDataT  *pStreamOwnerData)
{
    ClRcT             rc        = CL_OK;
    ClLogCompKeyT     compKey   = {0};
    ClLogCompKeyT     *pCompKey = NULL;
    ClLogSOCompDataT  compData  = {0};
    ClLogSOCompDataT  *pData    = NULL;

    CL_LOG_DEBUG_TRACE(("Enter"));

    rc = VDECL_VER(clXdrUnmarshallClLogCompKeyT, 4, 0, 0)(msg, &compKey);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("VDECL_VER(clXdrUnmarshallClLogCompKeyT, 4, 0, 0)(): rc[0x %x]", rc));
        return rc;
    }
    rc = VDECL_VER(clXdrUnmarshallClLogSOCompDataT, 4, 0, 0)(msg, &compData);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("VDECL_VER(clXdrUnmarshallClLogSOCompDataT, 4, 0, 0)(): rc[0x %x]", rc));    
        return rc;
    }

    pCompKey = (ClLogCompKeyT*)clHeapCalloc(1, sizeof(ClLogCompKeyT));
    if( NULL == pCompKey )
    {
        CL_LOG_DEBUG_ERROR(( "clHeapCalloc()"));
        return CL_LOG_RC(CL_ERR_NO_MEMORY);
    }    
    *pCompKey = compKey;
    CL_LOG_DEBUG_VERBOSE(("compKey.nodeAddress: %u", compKey.nodeAddr));
    CL_LOG_DEBUG_VERBOSE(("compKey.compId     : %u", compKey.compId));

    pData = (ClLogSOCompDataT*)clHeapCalloc(1, sizeof(ClLogSOCompDataT));
    if( NULL == pData )
    {
        CL_LOG_DEBUG_ERROR(( "clHeapCalloc()"));
        clHeapFree(pCompKey);
        return CL_LOG_RC(CL_ERR_NO_MEMORY);
    }    
    *pData = compData;
    CL_LOG_DEBUG_VERBOSE(("compData.refCount    : %u", pData->refCount));
    CL_LOG_DEBUG_VERBOSE(("compData.ackerCnt    : %u", pData->ackerCnt));
    CL_LOG_DEBUG_VERBOSE(("compData.nonAckerCnt : %u", pData->nonAckerCnt));

    rc = clCntNodeAdd(pStreamOwnerData->hCompTable, 
                      (ClCntKeyHandleT) pCompKey,
                      (ClCntDataHandleT) pData, NULL);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(( "clCntNodeAdd(): rc[0x %x]", rc));
        clHeapFree(pData);
        clHeapFree(pCompKey);
    }

    CL_LOG_DEBUG_TRACE(("Exit"));
    return CL_OK;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:60,代码来源:clLogStreamOwnerCkpt.c

示例2: clLogBitmapPack

ClRcT
clLogBitmapPack(ClBitmapHandleT  hBitmap,
                ClBufferHandleT  msg)
{
    ClRcT                   rc        = CL_OK;
    ClUint32T  nBytes   = 0;
    ClUint8T   *pBitMap = NULL;

    CL_LOG_DEBUG_TRACE(("Enter"));

    rc = clBitmap2BufferGet(hBitmap, &nBytes, &pBitMap);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("clBitmap2PositionListGet(): rc[0x %x]", rc));
        return rc;
    }    
    rc = clXdrMarshallClUint32T(&nBytes, msg, 0);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("clXdrMarshallClUint32T(): rc[0x %x]", rc));
        clHeapFree(pBitMap);
        return rc;
    }
    rc = clXdrMarshallArrayClUint8T(pBitMap, nBytes, msg, 0);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("clXdrMarshallArrayClUint8T(): rc[0x %x]", rc));
    }
    clHeapFree(pBitMap);
    
    CL_LOG_DEBUG_TRACE(("Exit"));
        return rc;
    }    
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:33,代码来源:clLogStreamOwnerCkpt.c

示例3: clBackingStorageDelete

ClRcT clBackingStorageDelete(ClBackingStorageHandleT *pHandle)
{
    ClRcT rc = CL_BACKING_STORAGE_RC(CL_ERR_INVALID_PARAMETER);
    ClBackingStorageT *pStorage = NULL;

    if(!pHandle)
    {
        clLogError(CL_LOG_AREA_BACKING_STORAGE, CL_LOG_CONTEXT_EXIT, "NULL handle");
        goto out;
    }

    if(*pHandle)
    {
        pStorage = (ClBackingStorageT*)*pHandle;
        if(pStorage->pPrivateData)
        {
            clHeapFree(pStorage->pPrivateData);
        }
        clHeapFree(pStorage);
        *pHandle = 0;
    }
    rc = CL_OK;

    out:
    return rc;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,代码来源:clBackingStorage.c

示例4: clBitmapDestroy

ClRcT
clBitmapDestroy(ClBitmapHandleT  hBitmap)
{
    ClRcT          rc           = CL_OK;
    ClBitmapInfoT  *pBitmapInfo = hBitmap;

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Enter"));

    if( CL_BM_INVALID_BITMAP_HANDLE == hBitmap )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid Handle"));
        return CL_BITMAP_RC(CL_ERR_INVALID_HANDLE);
    }

    do
    {
        rc = clOsalMutexDelete(pBitmapInfo->bitmapLock);
    }while( CL_OSAL_ERR_MUTEX_EBUSY == rc );

    clHeapFree(pBitmapInfo->pBitmap);
    clHeapFree(pBitmapInfo);

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:25,代码来源:clBitmap.c

示例5: fileEntryRecoverBaseVersion

static ClRcT fileEntryRecoverBaseVersion(ClLogMasterEoDataT *pMasterEoEntry,
        ClBufferHandleT hFileEntryBuf)
{
    ClRcT rc = CL_OK;
    ClLogFileKeyT        fileKey       = {{0}};
    ClLogFileKeyT        *pFileKey     = NULL;
    ClLogFileDataT       *pFileData    = NULL;

    rc = clLogMasterFileKeyUnpack(&fileKey, hFileEntryBuf);
    if( CL_OK != rc )
    {
        return rc;
    }
    clLogInfo(CL_LOG_AREA_MASTER, CL_LOG_CTX_CKPT_READ,
              "Recreating files fileName: %.*s fileLocation: %.*s",
              fileKey.fileName.length, fileKey.fileName.pValue,
              fileKey.fileLocation.length, fileKey.fileLocation.pValue);

    rc = clLogFileKeyCreate(&fileKey.fileName, &fileKey.fileLocation,
                            pMasterEoEntry->maxFiles, &pFileKey);
    if( CL_OK != rc )
    {
        clHeapFree(fileKey.fileName.pValue);
        clHeapFree(fileKey.fileLocation.pValue);
        return rc;
    }
    clHeapFree(fileKey.fileName.pValue);
    clHeapFree(fileKey.fileLocation.pValue);

    /* find out the filelocation is available */
    pFileData = (ClLogFileDataT*) clHeapCalloc(1, sizeof(ClLogFileDataT));
    if( NULL == pFileData )
    {
        CL_LOG_DEBUG_ERROR(("clHeapCalloc()"));
        clLogFileKeyDestroy(pFileKey);
        return rc;
    }

    pFileData->nActiveStreams = 0;
    rc = clLogMasterFileDataRecreate(pFileData, hFileEntryBuf);
    if( CL_OK != rc )
    {
        clLogFileKeyDestroy(pFileKey);
        return rc;
    }

    rc = clCntNodeAdd(pMasterEoEntry->hMasterFileTable,
                      (ClCntKeyHandleT) pFileKey,
                      (ClCntDataHandleT) pFileData, NULL);
    if( CL_OK != rc )
    {
        CL_LOG_DEBUG_ERROR(("clCntNodeAdd()"));
        CL_LOG_CLEANUP(clCntDelete(pFileData->hStreamTable), CL_OK); //FIXME
        clHeapFree(pFileData);
        clLogFileKeyDestroy(pFileKey);
        return rc;
    }

    return rc;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:60,代码来源:clLogMasterCkpt.c

示例6: clEoClientCallbackDbFinalize

ClRcT clEoClientCallbackDbFinalize(void)
{
    ClRcT rc;
    ClUint32T i;
    
    rc = clOsalMutexLock(&gpCallbackDb.lock);
    if(rc != CL_OK)
    {
        /* Print a message here */
        return rc;
    }

    for(i = 0 ; i < gpCallbackDb.numRecs; i++)
    {
        if(gpCallbackDb.pDb[i] != NULL)
            clHeapFree(gpCallbackDb.pDb[i]);
    }

    clHeapFree(gpCallbackDb.pDb);

    gpCallbackDb.numRecs = 0;

    clOsalMutexUnlock(&gpCallbackDb.lock);

    return CL_OK;
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,代码来源:clEoLibs.c

示例7: timeStamp

void timeStamp(ClCharT timeStr [], ClUint32T    len)
{
    time_t  timer ;
    struct  tm *t = NULL;
    ClCharT * pBuff =NULL;

   struct tm *localtimebuf = clHeapAllocate(sizeof(struct tm));;
   if(localtimebuf == NULL)
   {
      CL_DEBUG_PRINT(CL_DEBUG_ERROR,( "\nMemory Allocation failed\n"));
      return ;
   }
   ClCharT *asctimebuf   = clHeapAllocate(BUFFER_LENGTH*sizeof(ClCharT));
   if(asctimebuf == NULL)
   {
      CL_DEBUG_PRINT(CL_DEBUG_ERROR,( "\nMemory Allocation failed\n"));
      return ;
   }

   memset(&timer,0,sizeof(time_t));
    time(&timer);
    t = localtime_r(&timer,localtimebuf);
    pBuff=asctime_r(t,asctimebuf);
    strncpy(timeStr,pBuff,len-1);
    timeStr[strlen(timeStr) - 1] ='\0';
	clHeapFree(localtimebuf);
	clHeapFree(asctimebuf);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:28,代码来源:clFaultHistory.c

示例8: clCorNodeNameTableMoIdDestroyCallBack

static void clCorNodeNameTableMoIdDestroyCallBack(ClCntKeyHandleT userKey, 
				ClCntDataHandleT userData)
{
	/* The key is MOId and data is node name. Just deallocate it. */
	clHeapFree((void *) userKey);
	clHeapFree((void *) userData);
}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:7,代码来源:clCorMoIdToNodeNameTable.c

示例9: clLogSvrSOFGResponse

void
clLogSvrSOFGResponse(ClIdlHandleT  hLogIdl,
                     SaNameT       *pStreamName,
                     SaNameT       *pStreamScopeNode,
                     ClLogFilterT  *pStreamFilter,
                     ClRcT         retCode,
                     ClPtrT        pCookie)
{
    ClRcT  rc = CL_OK;

    CL_LOG_DEBUG_TRACE(("Enter"));

    CL_ASSERT( NULL != pCookie );
    if( CL_OK != retCode )
    {
        CL_LOG_DEBUG_ERROR(("clLogSvrSOFGResponse(): rc[0x %x]", retCode));
        return ;
    }
    rc = clLogSvrSOFGResponseProcess(pStreamFilter, pCookie);

    clHeapFree(pStreamFilter->pMsgIdSet);
    clHeapFree(pStreamFilter->pCompIdSet);

    CL_LOG_DEBUG_TRACE(("Exit"));
    (void)rc;
    return ;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:27,代码来源:clLogSvrCkpt.c

示例10: dispatchQDestroyCallback

static void  dispatchQDestroyCallback (ClUint32T callbackType,
                                       void*     callbackData)
{
	if (callbackData == NULL)
	{
		return;
	}

    switch (callbackType)
    {
        case CL_GMS_CLIENT_CLUSTER_TRACK_CALLBACK:
            if (((SaClmClusterTrackDataT*)callbackData)->notificationBuffer != NULL)
            {
                if (((SaClmClusterTrackDataT*)callbackData)->notificationBuffer->notification != 
                        NULL)
                {
                    clHeapFree(((SaClmClusterTrackDataT*)callbackData)->notificationBuffer->notification);
                }
                clHeapFree(((SaClmClusterTrackDataT*)callbackData)->notificationBuffer);
            }
            break;
        case CL_GMS_CLIENT_CLUSTER_MEMBER_GET_CALLBACK:
            if (((SaClmClusterNodeGetDataT*)callbackData)->clusterNode != NULL)
            {
                clHeapFree(((SaClmClusterNodeGetDataT*)callbackData)->clusterNode);
            }
            break;
    }
    clHeapFree(callbackData);
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:30,代码来源:clSafGmsWrapper.c

示例11: clTestSectionCreate

ClRcT
clTestSectionCreate(ClCkptHdlT  ckptHdl, 
                    ClUint32T   sectionIdx)
{
    ClRcT                             rc            = CL_OK;
    ClCkptSectionCreationAttributesT  secCreateAttr = {0};

    secCreateAttr.sectionId = clHeapCalloc(1, sizeof(ClCkptSectionIdT));
    if( NULL == secCreateAttr.sectionId ) 
    {
        return CL_OK;
    }
    secCreateAttr.expirationTime = CL_TIME_END;
    secCreateAttr.sectionId->id = clHeapCalloc(1, 15);
    if( NULL == secCreateAttr.sectionId->id ) 
    {
        clHeapFree(secCreateAttr.sectionId);
        return CL_OK;
    }
    snprintf((ClCharT *) secCreateAttr.sectionId->id,15, "section%d", sectionIdx);
    secCreateAttr.sectionId->idLen = strlen((ClCharT *) secCreateAttr.sectionId->id) + 1; 
    rc = clCkptSectionCreate(ckptHdl, &secCreateAttr, NULL, 0);
    if( CL_OK != rc )
    {
        return rc;
    }
    clHeapFree(secCreateAttr.sectionId->id);
    clHeapFree(secCreateAttr.sectionId);
    return CL_OK;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:30,代码来源:clTcCkptApi.c

示例12: clTxnAppJobDelete

/**
 * Delete/free transaction-job definition
 */
ClRcT clTxnAppJobDelete(
        CL_IN   ClTxnAppJobDefnT *pTxnAppJob)
{
    CL_FUNC_ENTER();

    if (NULL == pTxnAppJob)
    {
        CL_FUNC_EXIT();
        clDbgCodeError(CL_ERR_NULL_POINTER, ("Null pointer on the job list"));
        return CL_ERR_NULL_POINTER;
    }

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Deleting txn-job %p", (ClPtrT) pTxnAppJob));

    if(pTxnAppJob->compList)
    {
        //clCntAllNodesDelete(pTxnAppJob->compList);
        clCntDelete(pTxnAppJob->compList);
    }

    if (pTxnAppJob->appJobDefn)
        clHeapFree( (ClPtrT) pTxnAppJob->appJobDefn);
    
    memset(pTxnAppJob, 0, sizeof(ClTxnAppJobDefnT));  /* to crash uses after delete */
    clHeapFree(pTxnAppJob);

    return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:31,代码来源:clTxnDb.c

示例13: clAmsEntityLocate

static ClRcT clAmsEntityLocate(ClAmsEntityT *pEntity)
{
    ClRcT rc = CL_OK;
    register ClInt32T i;

    for(i = CL_AMS_ENTITY_TYPE_ENTITY + 1;  i < CL_AMS_ENTITY_TYPE_MAX + 1; ++i)
    {
        ClAmsEntityConfigT *pEntityConfig = NULL;
        pEntity->type = (ClAmsEntityTypeT) i;
        rc = clAmsMgmtEntityGetConfig(gClAmsEntityTriggerMgmtHandle,
                                      pEntity,
                                      &pEntityConfig);
        if(rc != CL_OK)
        {
            if(pEntityConfig)
                clHeapFree(pEntityConfig);

            continue;
        }
        memcpy(pEntity, pEntityConfig, sizeof(*pEntity));
        clHeapFree(pEntityConfig);
        return CL_OK;
    }
    return CL_AMS_RC(CL_ERR_NOT_EXIST);

}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,代码来源:clAmsEntityTrigger.c

示例14: clAlarmPayloadCntEntryDeleteCallback

/*
 * The cnt delete callback
 */
void clAlarmPayloadCntEntryDeleteCallback(ClCntKeyHandleT key, ClCntDataHandleT userData)
{
    CL_DEBUG_PRINT(CL_DEBUG_TRACE,("clCntNodeAdd deleting \n"));
    clHeapFree((ClAlarmPayloadCntT *)userData);
	clHeapFree((ClAlarmPayloadCntKeyT *)key);
	return;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:10,代码来源:clAlarmPayloadCont.c

示例15: clCorNodeNameTableNodeNameDestroyCallBack

static void clCorNodeNameTableNodeNameDestroyCallBack(ClCntKeyHandleT userKey, 
				ClCntDataHandleT userData)
{
	/* The data is moid and key is node Name. freeing it. */
    clHeapFree(((ClCorNodeDataPtrT)userData)->pMoId);
    clHeapFree((void *)userKey);
	clHeapFree((void *) userData);
}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:8,代码来源:clCorMoIdToNodeNameTable.c


注:本文中的clHeapFree函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。