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

C++ freeMemory函数代码示例

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

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



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

示例1: trimMemory

extern void *
trimMemory(void *mem)
{
    int len;
    void *res;
    
    len = strlen((char *) mem);
    res = allocMemory(len + 1, sizeof (u1));
    if (!res)
        return (void *) 0;
    memcpy(res, mem, len);
    freeMemory(mem);
    
    return res;
}
开发者ID:donizyo,项目名称:Cruiser,代码行数:15,代码来源:memory.c


示例2: loop

void loop()
{
      USB.println("\ndevice enters loop\n");
      USB.println(RTC.getTime());
      USB.println(freeMemory());
      
      
/*
      USB.print("\nTimeRTC: ");
      USB.println(RTC.getTime());


      //xbeeZB.printSensorMask(xbeeZB.activeSensorMask);

      xbeeZB.createAndSaveNewTime2SleepArray(sortedTimes);
      USB.print("FreeMem"); USB.println(freeMemory());
      
      er = SensUtils.measureSensors(xbeeZB.activeSensorMask);
      if( er!= 0)
      {
         USB.print("ERROR SensUtils.measureSensors(uint16_t *) returns: ");
         USB.println(er);
      }
      
      USB.print("\nEndMeasuring, start check association\n");    
      er = COMM.checkNodeAssociation(LOOP);
      if( er!= 0)
      {
         USB.print("ERROR COMM.checkNodeAssociation(LOOP) returns: ");
         USB.println(er);
      }     
      
      USB.print("\nEndassociation\n");
      er = PackUtils.sendMeasuredSensors(dest, xbeeZB.activeSensorMask);
      if( er!= 0)
      {
           USB.print("ERROR PAQ.sendMeasuredSensors(uint16_t *) returns: ");
           USB.println(er); 
      }
      
      USB.print("\ntime at hibernate"); USB.println(RTC.getTime());
*/

      ////////////////////////////////////////////////
      // 6. Entering hibernate mode
      ////////////////////////////////////////////////
      xbeeZB.enterLowPowerMode(HIBERNATE);
}
开发者ID:bderaeve,项目名称:Sketches,代码行数:48,代码来源:_35_VariableSleepTimesV2_Hibernate.cpp


示例3: freeMemory

void ompl::geometric::RRTstar::clear()
{
    Planner::clear();
    sampler_.reset();
    freeMemory();
    if (nn_)
        nn_->clear();

    lastGoalMotion_ = NULL;
    goalMotions_.clear();

    iterations_ = 0;
    collisionChecks_ = 0;
    bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());

}
开发者ID:arjungm,项目名称:ompl,代码行数:16,代码来源:RRTstar.cpp


示例4: freeMemory

Matrix<elType>& Matrix<elType>::set(const Matrix &m)
{
	freeMemory();
	if (m.getWidth()!=0 && m.getWidth() !=0)
	{
		create(m.getWidth(),m.getHeight());
		memcpy(pData,m.get(),m.getWidth()*m.getHeight()*sizeof(elType));
	} 
	else
	{
		pData = NULL;
		width = m.getWidth();
		height = m.getHeight();
	}
	return *this;
}
开发者ID:smajida,项目名称:human_action_recognition,代码行数:16,代码来源:matrix_for_read.cpp


示例5: freeMemory

void ompl::geometric::TRRT::clear()
{
    Planner::clear();
    sampler_.reset();
    freeMemory();
    if (nearestNeighbors_)
        nearestNeighbors_->clear();
    lastGoalMotion_ = nullptr;

    // Clear TRRT specific variables ---------------------------------------------------------
    temp_ = initTemperature_;
    nonfrontierCount_ = 1;
    frontierCount_ = 1;  // init to 1 to prevent division by zero error
    if (opt_)
        bestCost_ = worstCost_ = opt_->identityCost();
}
开发者ID:jvgomez,项目名称:ompl,代码行数:16,代码来源:TRRT.cpp


示例6: freeMemory

void ompl::geometric::RRTXstatic::clear()
{
    setup_ = false;
    Planner::clear();
    sampler_.reset();
    infSampler_.reset();
    freeMemory();
    if (nn_)
        nn_->clear();

    lastGoalMotion_ = nullptr;
    goalMotions_.clear();

    iterations_ = 0;
    bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());
}
开发者ID:ompl,项目名称:ompl,代码行数:16,代码来源:RRTXstatic.cpp


示例7: freeMemory

void ompl::geometric::SBL::clear()
{
    Planner::clear();

    sampler_.reset();

    freeMemory();

    tStart_.grid.clear();
    tStart_.size = 0;
    tStart_.pdf.clear();

    tGoal_.grid.clear();
    tGoal_.size = 0;
    tGoal_.pdf.clear();
    connectionPoint_ = std::make_pair<base::State *, base::State *>(nullptr, nullptr);
}
开发者ID:ompl,项目名称:ompl,代码行数:17,代码来源:SBL.cpp


示例8: freeMemory

void ompl::geometric::BiTRRT::clear()
{
    Planner::clear();
    freeMemory();
    if (tStart_)
        tStart_->clear();
    if (tGoal_)
        tGoal_->clear();
    connectionPoint_ = std::make_pair<Motion*, Motion*>(NULL, NULL);

    // TRRT specific variables
    temp_ = initTemperature_;
    nonfrontierCount_ = 1;
    frontierCount_ = 1; // init to 1 to prevent division by zero error
    if (opt_)
        bestCost_ = worstCost_ = opt_->identityCost();
}
开发者ID:HRZaheri,项目名称:batch-informed-trees,代码行数:17,代码来源:BiTRRT.cpp


示例9: main

int main(int argc, char **argv) {
	MAP* map = newMap();
	char *strFrank = "frank";
	char *strJef = "jef";
	char *strDirk = "dirk";
	put(map, strFrank, "0486/11.33.23");
	put(map, strJef, "0486/10.20.30");
	put(map, strDirk, "0475/11.39.12");
	printMap(map);
	printf("Nummer van frank: %s\n",get(map, strFrank));
	printf("Jef verwijderen...\n");
	removePair(map, strJef);
	removePair(map, "bla");
	printMap(map);
	freeMemory(map);
	return 0;
}
开发者ID:kdg,项目名称:Datastructuren-en-Algoritmen,代码行数:17,代码来源:array.c


示例10: main

int 
main(int argc, char ** argv) 
{

	printf ("c Pseudoflow algorithm for parametric min cut (version 1.0)\n");
	readDimacsFileCreateList ();

#ifdef PROGRESS
	printf ("c Finished reading file.\n"); fflush (stdout);
#endif

	simpleInitialization ();

#ifdef PROGRESS
	printf ("c Finished initialization.\n"); fflush (stdout);
#endif

	pseudoflowPhase1 ();

#ifdef PROGRESS
	printf ("c Finished phase 1.\n"); fflush (stdout);
#endif

#ifdef RECOVER_FLOW
	recoverFlow();
	checkOptimality ();
#endif

	printf ("c Number of nodes     : %d\n", numNodes);
	printf ("c Number of arcs      : %d\n", numArcs);
#ifdef STATS
	printf ("c Number of arc scans : %lld\n", numArcScans);
	printf ("c Number of mergers   : %d\n", numMergers);
	printf ("c Number of pushes    : %lld\n", numPushes);
	printf ("c Number of relabels  : %d\n", numRelabels);
	printf ("c Number of gaps      : %d\n", numGaps);
#endif

#ifdef BREAKPOINTS
	displayBreakpoints ();
#endif

	freeMemory ();

	return 0;
}
开发者ID:ChenglongWang,项目名称:divmbest,代码行数:46,代码来源:pseudopar.c


示例11: setup

void setup()
{
      USB.begin();
      USB.print("usb started, ");  USB.print(FM);   USB.println(freeMemory());
      
      xbeeZB.printStoredErrors();
  
      if( COMM.setupXBee(panID, ROUTER, gateway, NONE, "NodeD", 6, HIGHPERFORMANCE) ) 
          USB.println("\nERROR SETTING UP XBEE MODULE\n");        //ALSO_SAVED_IN_EEPROM
          
      ///////////////////////////////////////////////////////////////////////////////////////
      // FOR TESTING PURPOSES ONLY:  Overrides the inNetwork boolean!          
      xbeeZB.setActiveSensorMaskWithTimes(6, TEMPERATURE, 6, HUMIDITY, 12, BATTERY, 18);   
      xbeeZB.posInArray = 0;
      xbeeZB.setAlarmForRouter(); 
      ///////////////////////////////////////////////////////////////////////////////////////        
}
开发者ID:bderaeve,项目名称:Sketches,代码行数:17,代码来源:_46_FullProgramRoutersV2.cpp


示例12: main

int main(int argc, char *argv[]){

	if(argc != 2){
		printf("%s", "ERR \"numero de parametros incorreto\"\n"
				"<< Deve-se usar: nomedoPrograma nomeArquivoCodigofonte\n");
	}else{

		if( lAnalyzer(argv[1]) )
			sAnalyzer();

		freeMemory();

	}

	//TODO verifying how the operational system empty memory after exit program or before
	return 0;
}
开发者ID:heronsanches,项目名称:compiler,代码行数:17,代码来源:main.c


示例13: heartbeatDebug

bool heartbeatDebug (Debuf *de)
{
    bool action = false ;

    if (clock_time() > de->next_)
    {
		printf ("-------------------------------------------------------------------") ;
		printf ("%s free mem = ",B_BLUE ("loop ")) ;
		DBG1 (freeMemory ()) ;
		printf("\n");

		de->next_ += de->interv_ ;
		action = true ;
    }

    return action ;
}
开发者ID:kyanhNG,项目名称:casan-contiki,代码行数:17,代码来源:debug.c


示例14: ASSERT

HRESULT CMfxEvent::SetSysxData( BYTE* pbData, DWORD dwLen )
{
	ASSERT( GetType() == Sysx );

	// Free the old buffer
	freeMemory();

	// Allocate the new buffer
	CHECK( theBufferFactory.Create( dwLen, &m_hBuffer ) );

	// Copy in the data
	void*	pv;
	DWORD	cb;
	CHECK( theBufferFactory.GetPointer( m_hBuffer, &pv, &cb ) );
	ASSERT( cb == dwLen );
	memcpy( pv, pbData, dwLen );
	return S_OK;
}
开发者ID:agangzz,项目名称:foo_midi,代码行数:18,代码来源:MfxEvent.cpp


示例15: main

int main(void)
{
    
    unsigned short  *stageLights, *overLayPattern;
    int             *startBit, *numBits;
    
    stageLights    = (unsigned short*)Malloc(sizeof(unsigned short));
    overLayPattern = (unsigned short*)Malloc(sizeof(unsigned short));
    startBit       = (int *)Malloc(sizeof(int));
    numBits        = (int *)Malloc(sizeof(int));
    
    printMenu();
    getUserOption(&stageLights, &overLayPattern, startBit, numBits);
    freeMemory(stageLights, overLayPattern, startBit, numBits);
    
    
    return 0;
}
开发者ID:samiracoliva,项目名称:Bit-Manipulation,代码行数:18,代码来源:bitManipulation.c


示例16: main

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int main(int argc, char **argv)
{

  if (argc != 2)
  {
    std::cout << "Nees 1 argument which is an output filename." << std::endl;
  }

  std::string outputFile(argv[1]);
  size_t width = Detail::TRI_WIDTH;
  size_t height = Detail::TRI_HEIGHT;

  unsigned char* image = createTriangle(width, height);
  int err = writeOutputAsTiff(image, width, height, outputFile, std::string("Crystal Orientation Color Legend"));
  freeMemory(image);

  return err;
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:21,代码来源:TSLTriangle.cpp


示例17: MovingPeak

void MovingPeak::changeNumPeaks(){

	MovingPeak* mpb=new MovingPeak(Global::msm_pro["DYN_CONT_MovingPeak"],m_numDim,m_numPeaksTemp,m_changePeakRatio,m_flagDimensionChange
		,m_flagNumPeaksChange,m_numPeaksChangeMode,m_noiseFlag,m_timeLinkageFlag);

	mpb->parameterSetting(this);
	mpb->calculateGlobalOptima();

	freeMemory();
	DynamicContinuous::freeMemory();

	allocateMemory(m_numDim,m_numPeaksTemp);
    DynamicContinuous::allocateMemory(m_numDim,m_numPeaksTemp);
    m_numPeaks=m_numPeaksTemp;
	*this=*mpb;
	delete mpb;
	mpb=0;
}
开发者ID:Changhe160,项目名称:OFEC,代码行数:18,代码来源:MovingPeak.cpp


示例18:

void AP_Autopilot::callback2(void * data) {
    AP_Autopilot * apo = (AP_Autopilot *) data;
    //apo->getBoard()->debug->println_P(PSTR("callback 2"));

    /*
     * send telemetry
     */
    if (apo->getBoard()->gcs) {
        // send messages
        //apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_GPS_RAW_INT);
        //apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_LOCAL_POSITION);
        apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_SCALED);
        apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_RAW);
        apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_SCALED_IMU);
    }

    /*
     * update battery monitor
     */
    if (apo->getBoard()->batteryMonitor) apo->getBoard()->batteryMonitor->update();

    /*
     * send heartbeat
     */
    apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_HEARTBEAT);

    /*
     * load/loop rate/ram debug
     */
    apo->getBoard()->load = apo->load();
    apo->getBoard()->debug->printf_P(PSTR("callback calls: %d\n"),apo->callbackCalls);
    apo->callbackCalls = 0;
    apo->getBoard()->debug->printf_P(PSTR("load: %d%%\trate: %f Hz\tfree ram: %d bytes\n"),
                                   apo->load(),1.0/apo->dt(),freeMemory());
    apo->getBoard()->gcs->sendMessage(MAVLINK_MSG_ID_SYS_STATUS);

    /*
     * adc debug
     */
    //apo->getDebug().printf_P(PSTR("adc: %d %d %d %d %d %d %d %d\n"),
    //apo->adc()->Ch(0), apo->adc()->Ch(1), apo->adc()->Ch(2),
    //apo->adc()->Ch(3), apo->adc()->Ch(4), apo->adc()->Ch(5),
    //apo->adc()->Ch(6), apo->adc()->Ch(7), apo->adc()->Ch(8));
}
开发者ID:Artoko,项目名称:ardupilotdev,代码行数:44,代码来源:AP_Autopilot.cpp


示例19: freeMemory

	//-----------------------------------------------------------------------------
	Image& Image::loadDynamicImage( uchar* pData, size_t uWidth, size_t uHeight, 
		size_t depth,
		PixelFormat eFormat, bool autoDelete, 
		size_t numFaces, size_t numMipMaps)
	{

		freeMemory();
		// Set image metadata
		m_uWidth = uWidth;
		m_uHeight = uHeight;
		m_uDepth = depth;
		m_eFormat = eFormat;
		m_ucPixelSize = static_cast<uchar>(PixelUtil::getNumElemBytes( m_eFormat ));
		m_uNumMipmaps = numMipMaps;
		m_uFlags = 0;
		// Set flags
		if (PixelUtil::isCompressed(eFormat))
			m_uFlags |= IF_COMPRESSED;
		if (m_uDepth != 1)
			m_uFlags |= IF_3D_TEXTURE;
		if(numFaces == 6)
			m_uFlags |= IF_CUBEMAP;
		if(numFaces != 6 && numFaces != 1)
			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
			"Number of faces currently must be 6 or 1.", 
			"Image::loadDynamicImage");

		m_uSize = calculateSize(numMipMaps, numFaces, uWidth, uHeight, depth, eFormat);

        if (pData)
        {
            m_pBuffer = pData;
            m_bAutoDelete = autoDelete;
        }
        else
        {
            m_bAutoDelete = true;
            m_pBuffer = OGRE_ALLOC_T(Ogre::uchar, m_uSize, Ogre::MEMCATEGORY_RESOURCE);
        }


		return *this;

	}
开发者ID:gitrider,项目名称:wxsj2,代码行数:45,代码来源:OgreImage.cpp


示例20: freeMemory

/// \param filename Specifies the name of the file.
/// \param returnErrMsg Must point to a valid character buffer to be filled
///     with an error message in the event of failure.
/// \return true iff successful, else false.
/// \warning This function is currently unsafe, as there is no guarantee that
///     the given error message buffer will be large enough to accomodate the
///     error message.  Recommend changing to use string instead.
bool	Bitmap::load(const char *filename, char *returnErrMsg,size_t errMsgSize) {

	// Free up anything already allocated

	freeMemory();

	// Fetch extension.  I wish I could use the _splitpath function,
	// but it's not cross-platform.  I'll parse the thing myself.

	const char *ext = strchr(filename, '.');
	if (ext == NULL) {
		//SECURITY-UPDATE:2/4/07
		//strcpy(returnErrMsg, "Filename has no extension");
		strcpy_s(returnErrMsg,errMsgSize, "Filename has no extension");
		return false;
	}
	for (;;) {
		const char *dot = strchr(ext+1, '.');
		if (dot == NULL) {
			break;
		}
		ext = dot;
	}

	// Check for known extensions

	if (_stricmp(ext, ".tga") == 0) {
		//SECURITY-UPDATE:2/4/07
		//return loadTGA(filename, returnErrMsg);
		return loadTGA(filename, returnErrMsg,errMsgSize);
	}
	if (_stricmp(ext, ".bmp") == 0) {
		//SECURITY-UPDATE:2/4/07
		//return loadBMP(filename, returnErrMsg);
		return loadBMP(filename, returnErrMsg,errMsgSize);
	}

	// Unknown extension
	//SECURITY-UPDATE:2/4/07
	//sprintf(returnErrMsg, "Unknown/unsupported file extension '%s'", ext);
	sprintf_s(returnErrMsg,errMsgSize, "Unknown/unsupported file extension '%s'", ext);
	return false;
}
开发者ID:carussell,项目名称:nvvg,代码行数:50,代码来源:Bitmap.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ freeNode函数代码示例发布时间:2022-05-30
下一篇:
C++ freeMem函数代码示例发布时间: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