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


C++ freeMemory函数代码示例

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


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


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