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


C++ SDB_OSS_FREE函数代码示例

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


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

示例1: SDB_OSS_FREE

   void _pmdEDUCB::releaseBuff( CHAR *pBuff )
   {
      ALLOC_MAP_IT itAlloc = _allocMap.find( pBuff ) ;
      if ( itAlloc == _allocMap.end() )
      {
         SDB_OSS_FREE( pBuff ) ;
         return ;
      }
      INT32 buffLen = itAlloc->second ;
      _allocMap.erase( itAlloc ) ;

      if ( (UINT32)buffLen > EDU_MAX_CATCH_SIZE )
      {
         SDB_OSS_FREE( pBuff ) ;
         _totalMemSize -= buffLen ;
      }
      else
      {
         _catchMap.insert( std::make_pair( buffLen, pBuff ) ) ;
         _totalCatchSize += buffLen ;

         while ( _totalCatchSize > EDU_MAX_CATCH_SIZE )
         {
            CATCH_MAP_IT it = _catchMap.begin() ;
            SDB_OSS_FREE( it->second ) ;
            _totalMemSize -= it->first ;
            _totalCatchSize -= it->first ;
            _catchMap.erase( it ) ;
         }
      }
   }
开发者ID:jasonsungblog,项目名称:SequoiaDB,代码行数:31,代码来源:pmdEDU.cpp

示例2: while

   void _pmdEDUCB::clear()
   {
      pmdEDUEvent data ;
      while ( _queue.try_pop( data ) )
      {
         pmdEduEventRelase( data, this ) ;
      }
      _processEventCount = 0 ;
      _Name[0] = 0 ;
      _userName = "" ;
      _passWord = "" ;

#if defined ( SDB_ENGINE )
      clearTransInfo() ;
      releaseAlignedMemory() ;
      resetLsn() ;
#endif // SDB_ENGINE

      if ( _pCompressBuff )
      {
         releaseBuff( _pCompressBuff ) ;
         _pCompressBuff = NULL ;
      }
      _compressBuffLen = 0 ;
      if ( _pUncompressBuff )
      {
         releaseBuff( _pUncompressBuff ) ;
         _pUncompressBuff = NULL ;
      }
      _uncompressBuffLen = 0 ;

      CATCH_MAP_IT it = _catchMap.begin() ;
      while ( it != _catchMap.end() )
      {
         SDB_OSS_FREE( it->second ) ;
         _totalCatchSize -= it->first ;
         _totalMemSize -= it->first ;
         ++it ;
      }
      _catchMap.clear() ;

      ALLOC_MAP_IT itAlloc = _allocMap.begin() ;
      while ( itAlloc != _allocMap.end() )
      {
         SDB_OSS_FREE( itAlloc->first ) ;
         _totalMemSize -= itAlloc->second ;
         ++itAlloc ;
      }
      _allocMap.clear() ;

      SDB_ASSERT( _totalCatchSize == 0 , "Catch size is error" ) ;
      SDB_ASSERT( _totalMemSize == 0, "Memory size is error" ) ;
   }
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:53,代码来源:pmdEDU.cpp

示例3: SDB_ASSERT

   // PD_TRACE_DECLARE_FUNCTION ( SDB__CLSCATCLR_CALL, "_clsCatalogCaller::call" )
   INT32 _clsCatalogCaller::call( MsgHeader *header )
   {
      SDB_ASSERT( NULL != header, "header should not be NULL" ) ;
      INT32 rc = SDB_OK ;
      PD_TRACE_ENTRY ( SDB__CLSCATCLR_CALL );
      _clsCataCallerMeta &meta = _meta[MAKE_REPLY_TYPE(header->opCode)] ;
      if ( (SINT32)meta.bufLen < header->messageLength )
      {
         if ( NULL != meta.header )
         {
            SDB_OSS_FREE( meta.header ) ;
            meta.bufLen = 0 ;
         }
         meta.header = ( MsgHeader *)SDB_OSS_MALLOC( header->messageLength ) ;
         if ( NULL == meta.header )
         {
            PD_LOG ( PDERROR, "Failed to allocate memory for header" ) ;
            rc = SDB_OOM ;
            goto error ;
         }
         meta.bufLen = header->messageLength ;
      }

      ossMemcpy( meta.header, header, header->messageLength ) ;
      PD_LOG( PDEVENT, "send msg[%d] to catalog node.",
              meta.header->opCode ) ;
      pmdGetKRCB()->getClsCB()->sendToCatlog( meta.header ) ;
      meta.timeout = 0 ;

   done:
      PD_TRACE_EXITRC ( SDB__CLSCATCLR_CALL, rc );
      return rc ;
   error:
      goto done ;
   }
开发者ID:2015520,项目名称:SequoiaDB,代码行数:36,代码来源:clsCatalogCaller.cpp

示例4: freeRecord

   static inline void freeRecord(bson* obj)
   {
      SDB_ASSERT(NULL != obj, "obj can't be NULL");

      bson_destroy(obj);
      SDB_OSS_FREE(obj);
   }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:7,代码来源:impRecordQueue.hpp

示例5: pmdGetKRCB

   INT32 rtnCoord2PhaseCommit::doPhase2( CHAR * pReceiveBuffer, SINT32 packSize,
                                         CHAR * * ppResultBuffer, pmdEDUCB * cb,
                                         MsgOpReply & replyHeader )
   {
      INT32 rc = SDB_OK;
      pmdKRCB *pKrcb                   = pmdGetKRCB();
      CoordCB *pCoordcb                = pKrcb->getCoordCB();
      netMultiRouteAgent *pRouteAgent  = pCoordcb->getRouteAgent();
      CHAR *pMsgReq                    = NULL;
      MsgHeader *pMsgHead              = NULL;
      CoordGroupList groupLst;
      CoordGroupList sendGroupLst;

      rc = buildPhase2Msg( pReceiveBuffer, &pMsgReq );
      PD_RC_CHECK( rc, PDERROR,
                  "failed to build the message on phase1(rc=%d)",
                  rc );

      pMsgHead = (MsgHeader *)pMsgReq;
      pMsgHead->TID = cb->getTID();

      rc = executeOnDataGroup( pMsgReq, pRouteAgent, cb );
      PD_RC_CHECK( rc, PDERROR,
                  "failed to execute on data-group on phase1(rc=%d)",
                  rc );
   done:
      if ( pMsgReq )
      {
         SDB_OSS_FREE( pMsgReq );
         pMsgReq = NULL;
      }
      return rc;
   error:
      goto done;
   }
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:35,代码来源:rtnCoordTransaction.cpp

示例6: SDB_OSS_FREE

 _utilESBulkBuilder::~_utilESBulkBuilder()
 {
    if ( _buffer )
    {
       SDB_OSS_FREE( _buffer ) ;
    }
 }
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:7,代码来源:utilESBulkBuilder.cpp

示例7: assist

   _pmdEDUCB::~_pmdEDUCB ()
   {
      {
         ossScopedRWLock assist ( &_callInMutex, EXCLUSIVE ) ;
      }

      if ( _pErrorBuff )
      {
         SDB_OSS_FREE ( _pErrorBuff ) ;
         _pErrorBuff = NULL ;
      }
#if defined ( SDB_ENGINE )
      DpsTransCBLockList::iterator iterLst = _transLockLst.begin();
      while( iterLst != _transLockLst.end() )
      {
         if ( iterLst->second )
         {
            SDB_OSS_DEL iterLst->second ;
         }
         _transLockLst.erase( iterLst++ );
      }
      if ( _pTransNodeMap )
      {
         delete _pTransNodeMap;
         _pTransNodeMap = NULL;
      }
#endif // SDB_ENGINE

      clear() ;
   }
开发者ID:jasonsungblog,项目名称:SequoiaDB,代码行数:30,代码来源:pmdEDU.cpp

示例8: buildPhase1Msg

   INT32 rtnCoord2PhaseCommit::doPhase1( MsgHeader *pMsg,
                                         pmdEDUCB *cb,
                                         INT64 &contextID,
                                         rtnContextBuf *buf )
   {
      INT32 rc = SDB_OK;
      CHAR *pMsgReq                    = NULL;

      rc = buildPhase1Msg( (CHAR*)pMsg, &pMsgReq );
      PD_RC_CHECK( rc, PDERROR,
                   "Failed to build the message on phase1(rc=%d)",
                   rc );

      // execute on data nodes
      rc = executeOnDataGroup( (MsgHeader*)pMsgReq, cb, contextID, buf ) ;
      PD_RC_CHECK( rc, PDERROR,
                   "Failed to execute on data-group on phase1(rc=%d)",
                   rc ) ;

   done:
      if ( pMsgReq )
      {
         SDB_OSS_FREE( pMsgReq );
         pMsgReq = NULL;
      }
      return rc;
   error:
      goto done;
   }
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:29,代码来源:rtnCoordTransaction.cpp

示例9: ossWC2ANSI

INT32 ossWC2ANSI ( LPCWSTR lpcszWCString,
                   LPSTR   *plppszString,
                   DWORD   *plpdwString )
{
   INT32 rc           = SDB_OK ;
   INT32 strSize      = 0 ;
   INT32 requiredSize = 0 ;
   requiredSize       = WideCharToMultiByte ( CP_ACP, 0, lpcszWCString,
                                              -1, NULL, 0, NULL, NULL ) ;
   *plppszString = (LPSTR)SDB_OSS_MALLOC ( requiredSize ) ;
   if ( !plppszString )
   {
      rc = SDB_OOM ;
      goto error ;
   }
   strSize = WideCharToMultiByte ( CP_ACP, 0, lpcszWCString, -1,
                                   *plppszString, requiredSize,
                                   NULL, NULL ) ;
   if ( 0 == strSize )
   {
      SDB_OSS_FREE ( *plppszString ) ;
      rc = SDB_SYS ;
      *plppszString = NULL ;
      goto error ;
   }
   if ( plpdwString )
   {
      *plpdwString = (DWORD)strSize ;
   }
done :
   return rc ;
error :
   goto done ;
}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:34,代码来源:ossUtil.c

示例10: PD_TRACE_ENTRY

   // PD_TRACE_DECLARE_FUNCTION ( SDB__NETEVNHND__ALLOBUF, "_netEventHandler::_allocateBuf" )
   INT32 _netEventHandler::_allocateBuf( UINT32 len )
   {
      INT32 rc = SDB_OK ;
      PD_TRACE_ENTRY ( SDB__NETEVNHND__ALLOBUF );
      if ( _bufLen < len )
      {
         if ( NULL != _buf )
         {
            SDB_OSS_FREE( _buf ) ;
            _bufLen = 0 ;
         }
         _buf = (CHAR *)SDB_OSS_MALLOC( len ) ;
         if ( NULL == _buf )
         {
            PD_LOG( PDERROR, "mem allocate failed, len: %u", len ) ;
            rc = SDB_OOM ;
            goto error ;
         }
         _bufLen = len ;
      }

   done:
      PD_TRACE_EXITRC ( SDB__NETEVNHND__ALLOBUF, rc );
      return rc ;
   error:
      goto done ;
   }
开发者ID:2015520,项目名称:SequoiaDB,代码行数:28,代码来源:netEventHandler.cpp

示例11: ossANSI2WC

INT32 ossANSI2WC ( LPCSTR lpcszString,
                   LPWSTR *plppszWCString,
                   DWORD  *plpdwWCString )
{
   INT32 rc           = SDB_OK ;
   INT32 strSize      = 0 ;
   INT32 requiredSize = 0 ;
   requiredSize       = MultiByteToWideChar ( CP_ACP,
                                              0, lpcszString, -1, NULL, 0 ) ;
   *plppszWCString = (LPWSTR)SDB_OSS_MALLOC ( requiredSize * sizeof(WCHAR) ) ;
   if ( !plppszWCString )
   {
      rc = SDB_OOM ;
      goto error ;
   }
   strSize = MultiByteToWideChar ( CP_ACP, 0, lpcszString, -1,
                                   *plppszWCString, requiredSize ) ;
   if ( 0 == strSize )
   {
      SDB_OSS_FREE ( *plppszWCString ) ;
      rc = SDB_SYS ;
      *plppszWCString = NULL ;
      goto error ;
   }

   if ( plpdwWCString )
      *plpdwWCString = strSize ;
done :
   return rc ;
error :
   goto done ;
}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:32,代码来源:ossUtil.c

示例12: SDB_ASSERT

   void _rtnContextBuf::release()
   {
      if ( !_released )
      {
         SDB_ASSERT( *_pBuffCounter > 0, "Counter must > 0" ) ;
         --(*_pBuffCounter) ;
         if ( 0 == *_pBuffCounter  )
         {
            if ( *RTN_GET_CONTEXT_FLAG( _pOrgBuff ) == 0 )
            {
               SDB_OSS_FREE( RTN_BUFF_TO_REAL_PTR( _pOrgBuff ) ) ;
            }
            else
            {
               _pBuffLock->release_r() ;
            }
         }

         _pBuffCounter  = NULL ;
         _pBuffLock     = NULL ;
         _released      = TRUE ;
         _pOrgBuff      = NULL ;
      }

      _pBuff         = NULL ;
      _buffSize      = 0 ;
      _recordNum     = 0 ;
      _curOffset     = 0 ;
      _startFrom     = 0 ;
   }
开发者ID:247687009,项目名称:SequoiaDB,代码行数:30,代码来源:rtnContextBuff.cpp

示例13: PD_TRACE_ENTRY

   // PD_TRACE_DECLARE_FUNCTION ( SDB_RTNLOBDATAPOOL_ALLOCATE, "_rtnLobDataPool::allocate" )
   INT32 _rtnLobDataPool::allocate( UINT32 len, CHAR **buf )
   {
      INT32 rc = SDB_OK ;
      PD_TRACE_ENTRY( SDB_RTNLOBDATAPOOL_ALLOCATE ) ;
      SDB_ASSERT( NULL != buf, "can not be null" ) ;
      
      if ( len <= _bufSz )
      {
         *buf = _buf ;
         goto done ;
      }
      else if ( NULL != _buf )
      {
         SDB_OSS_FREE( _buf ) ;
         _bufSz = 0 ;
      }

      _buf = ( CHAR * )SDB_OSS_MALLOC( len ) ;
      if ( NULL == _buf )
      {
         PD_LOG( PDERROR, "failed to allocate mem." ) ; 
         rc = SDB_OOM ;
         goto error ;
      }
      _bufSz = len ;
      *buf = _buf ;
   done:
      PD_TRACE_EXITRC( SDB_RTNLOBDATAPOOL_ALLOCATE, rc ) ;
      return rc ;
   error:
      goto done ;
   }
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:33,代码来源:rtnLobDataPool.cpp

示例14: SDB_OSS_FREE

   INT32 _rtnQueryOptions::getOwned()
   {
      INT32 rc = SDB_OK ;
      if ( NULL != _fullNameBuf )
      {
         SDB_OSS_FREE( _fullNameBuf ) ;
         _fullNameBuf = NULL ;
      }

      if ( NULL != _fullName )
      {
         _fullNameBuf = ossStrdup( _fullName ) ;
         if ( NULL == _fullNameBuf )
         {
            rc = SDB_OOM ;
            goto error ;
         }
      }

      _fullName = _fullNameBuf ;
      _query = _query.getOwned() ;
      _selector = _selector.getOwned() ;
      _orderBy = _orderBy.getOwned() ;
      _hint = _hint.getOwned() ;
   done:
      return rc ;
   error:
      goto done ;
   }
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:29,代码来源:rtnQueryOptions.cpp

示例15: close

 _netEventHandler::~_netEventHandler()
 {
    close() ;
    if ( NULL != _buf )
    {
       SDB_OSS_FREE( _buf ) ;
    }
 }
开发者ID:2015520,项目名称:SequoiaDB,代码行数:8,代码来源:netEventHandler.cpp


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