• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ clHeapFree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: clFaultRecordPack

/*
 * This Api is used for packaging the fault structure
 * on query from the debug prompt
 */
ClRcT 
clFaultRecordPack(ClFaultRecordPtr hRec,ClCharT** retStr){

	ClUint32T categoryStringIndex=0,severityStringIndex=0,probableCauseStringIndex=0;
	
    if(hRec->seqNum==0)
    {
        clFaultCliStrPrint(retStr, "no record found");
    }
    else
    {
        ClCharT *str1 = NULL;
        ClCharT *tmp = NULL;


        str1 = clHeapAllocate(2000);/* The allocation size is a close indication
                                       of the number of bytes used to store the
                                       fault record structure */	   
        if(!str1)
            return CL_FAULT_RC(CL_ERR_NO_MEMORY);

        tmp = clHeapAllocate(2000);/* The allocatino size is a close measure of
                                      the number of bytes used to store each 
                                      attribute of a fault record structure 
                                      attached with a meaningful message
                                      preceeding it */
        if(!tmp)
            return CL_FAULT_RC(CL_ERR_NO_MEMORY);

        sprintf (tmp,"existing record found\n");
        strcat(str1,tmp);

        categoryStringIndex = clFaultInternal2CategoryTranslate((hRec->event).category);
        sprintf (tmp," Category........... %s\n",clFaultCategoryString[categoryStringIndex]);
        strcat(str1,tmp);

        sprintf (tmp," SpecificProblem.... %d\n",(hRec->event).specificProblem);
        strcat(str1,tmp);

        severityStringIndex = clFaultInternal2SeverityTranslate((hRec->event).severity);
        sprintf (tmp," Severity........... %s\n",clFaultSeverityString[severityStringIndex]);
        strcat(str1,tmp);

        if((hRec->event).cause >= CL_ALARM_PROB_CAUSE_LOSS_OF_SIGNAL &&
               (hRec->event).cause <= CL_ALARM_PROB_CAUSE_ENCLOSURE_DOOR_OPEN)
            probableCauseStringIndex = (hRec->event).cause;
        sprintf (tmp," cause.............. %s\n",clFaultProbableCauseString[probableCauseStringIndex]);
        strcat(str1,tmp);

        sprintf (tmp," SequenceNumber..... %d\n",(hRec->seqNum)-1);
        strcat(str1,tmp);
        clFaultCliStrPrint(retStr, str1);
        clHeapFree(str1);
        clHeapFree(tmp);
    }
	return CL_OK;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:61,代码来源:clFaultDebug.c


示例17: differenceVectorDelete

static void differenceVectorDelete(ClDifferenceBlockT *block)
{
    hashDel(&block->hash);
    if(block->data) clHeapFree(block->data);
    clDifferenceVectorKeyFree(&block->key);
    if(block->md5List)
        clHeapFree(block->md5List);
    clHeapFree(block);
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:9,代码来源:clDifferenceVector.c


示例18: clOmClassFinalize

/**
 * Release resources for allocated class
 *  
 * This routine undoes the operation that was performed in the
 * clOmClassInitialize () Object Manager Library interface. This is called to
 * release the resources that was allocated to facilitate a clean
 * unload of the Object Manager Library.
 *                                                                       
 * @param pClassTab - Class control block.
 * @param classId - Class Id of the class
 * 
 * @returns CL_OK if all the clean up operations are successful
 */
ClRcT 
clOmClassFinalize(ClOmClassControlBlockT *pClassTab, ClOmClassTypeT classId)
{
	ClUint32T   maxEntries;
	ClUint32T   instCount;
	ClUint32T **tmpInstance;

	CL_ASSERT(pClassTab);
    CL_FUNC_ENTER();

	/* TODO: Delete this module from the debug agents module list */

	/* Validate the input arguments */
	if (omClassTypeValidate(classId) != CL_OK)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid input arguments")); 
		return (CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS));
	}

	/*
	 * OPEN_ISSUE: Check if the instance table for the specified 
	 * class is already released. If released take either of two 
	 * actions.
	 * 1. Silently discard the request and return.
	 * 2. Return an ERROR indicating a duplicate free.
	 */
	if (!pClassTab->pInstTab)
	{
		CL_DEBUG_PRINT(CL_DEBUG_TRACE, 
                   ("Duplicate free of Instance Table for this class"));
		return (CL_OM_SET_RC(CL_OM_ERR_INSTANCE_TAB_DUPFREE));
	}

	/*
	 * Now, run through the instance table and free all the memory 
	 * allocated in OM context. Use the reserved bits encoded within
	 * the address to determine this.
	 */
        maxEntries = pClassTab->maxObjInst;	
	tmpInstance = pClassTab->pInstTab;	
	for (instCount = 0; instCount < maxEntries; instCount++)
	{
		if (tmpInstance[instCount] && mALLOC_BY_OM(tmpInstance[instCount]))
			clHeapFree((ClPtrT)mGET_REAL_ADDR(tmpInstance[instCount]));
	}

	/* Now, free the Instance table	for this class */
	clHeapFree((void *)tmpInstance);

	/* Now setup the Peer class table */
	pClassTab->pInstTab    = (ClUint32T **)NULL;
	pClassTab->curObjCount = 0;


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


示例19: clGetTable

ClUint32T clGetTable ( ClSnmpReqInfoT* reqInfo,
        void* data, 
        ClInt32T* pErrCode)
{
    ClMedOpT        opInfo;
    ClMedVarBindT   *tempVarInfo = NULL;
    ClInt32T        errorCode = CL_OK;
    ClInt32T        retVal = 0;
    ClCharT         oid[CL_SNMP_DISPLAY_STRING_SIZE];

    opInfo.varCount = 1;
    tempVarInfo =
        (ClMedVarBindT *) clHeapCalloc(1,opInfo.varCount * sizeof (ClMedVarBindT));   
    if (tempVarInfo == NULL)
    {
        clLogError("SNM","OPE", "Failed while allocating the varbind.");
        return (CL_RC(CL_CID_SNMP, CL_ERR_NO_MEMORY));
    }
    retVal = 0;
    strcpy(oid, reqInfo->oid);
    /*oid received till this point is that of the table. Add .1.1 to 
      get oid of the first entry in the table
     */
    strcat(oid,".1.1");

    opInfo.varInfo = tempVarInfo;
    opInfo.varInfo[0].pVal = data;
    opInfo.varInfo[0].errId = 0;
    opInfo.varInfo[0].pInst = reqInfo;
    opInfo.opCode = reqInfo->opCode;
    opInfo.varInfo[0].attrId.id = (ClUint8T*)oid;
    opInfo.varInfo[0].attrId.len = (ClUint32T)strlen(oid) + 1;
    opInfo.varInfo[0].len = reqInfo->dataLen;

    errorCode = clMedOperationExecute (gSubAgentInfo.medHdl, &opInfo);

    if ((opInfo.varInfo[0].errId == 0) && (errorCode == 0))
    {
        clHeapFree (tempVarInfo);
        return (CL_OK);
    }
    else
    {
        if (errorCode != CL_OK)
            *pErrCode = errorCode;
        else
            *pErrCode = opInfo.varInfo[0].errId;

        clLogError(CL_LOG_AREA_UNSPECIFIED,CL_LOG_CONTEXT_UNSPECIFIED,
                   "clMedOperationExecute returned error. error code = %x, error id = %d",
                   errorCode, opInfo.varInfo[0].errId);
    }
    clHeapFree (tempVarInfo);
    return (errorCode);
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:55,代码来源:clSnmpOp.c


示例20: clGmsClusterTrackCallbackHandler

/*----------------------------------------------------------------------------
 *  Cluster Track Callback Handler
 *---------------------------------------------------------------------------*/
ClRcT clGmsClusterTrackCallbackHandler(
    CL_IN   ClGmsClusterTrackCallbackDataT* const res)
{
    ClRcT rc = CL_OK;
    struct gms_instance *gms_instance_ptr = NULL;
    ClGmsHandleT gmsHandle = CL_GMS_INVALID_HANDLE;

    CL_ASSERT(res != NULL);
    clLog(INFO,NA,NA,"received cluster track callback");

    gmsHandle = res->gmsHandle;
    rc = clHandleCheckout(gmsHandleDb, gmsHandle, (void**)&gms_instance_ptr);
    if (rc != CL_OK)
    {
        goto error_free_res;
    }

    if (gms_instance_ptr == NULL)
    {
        rc = CL_GMS_RC(CL_ERR_NULL_POINTER);
        goto error_free_res;
    }

    if (gms_instance_ptr->callbacks.clGmsClusterTrackCallback == NULL)
    {
        rc = CL_GMS_RC(CL_ERR_NO_CALLBACK);
        goto error_checkin_free_res;
    }

    /*
     * Calling the user's callback function with the data.  The user cannot
     * free the data we provide.  If it needs to reatin it, it has to copy
     * it out from what we provide here.
     */
            (*gms_instance_ptr->callbacks.clGmsClusterTrackCallback)
            (gmsHandle, &res->buffer, res->numberOfMembers, res->rc);
  

error_checkin_free_res:
    if (clHandleCheckin(gmsHandleDb, gmsHandle) != CL_OK)
    {
        clLogError(CLM,NA,
                   "\nclHandleCheckin failed");
    }

error_free_res:
    /* Need to free data (res) if are not able to call the actual callback */
    if (res->buffer.notification != NULL)
    {
        clHeapFree((void*)res->buffer.notification);
    }
    clHeapFree((void*)res);
    return rc;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:57,代码来源:clGmsApi.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ clOsalMutexLock函数代码示例发布时间:2022-05-30
下一篇:
C++ clHeapAllocate函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap