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


C++ DELETE函数代码示例

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


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

示例1: DELETE

void asCVariableScope::Reset()
{
	isBreakScope = false;
	isContinueScope = false;

	for( asUINT n = 0; n < variables.GetLength(); n++ )
		if( variables[n] ) 
		{
			DELETE(variables[n],sVariable);
		}
	variables.SetLength(0);
}
开发者ID:gookeryoung,项目名称:GKGE,代码行数:12,代码来源:as_variablescope.cpp

示例2: DELETE

ADMVideoMPD3Dlow::~ADMVideoMPD3Dlow()
{

 	DELETE(_param);
	delete  _uncompressed;
	delete  _stored;
	delete [] Line;
	Line=NULL;
	_param=NULL;
	_uncompressed=NULL;
	_stored=NULL;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:12,代码来源:ADM_vidMPLD3Dlow.cpp

示例3: deleteItem

void QGVector::clear()				// clear vector
{
    if ( vec ) {
	for ( uint i=0; i<len; i++ ) {		// delete each item
	    if ( vec[i] )
		deleteItem( vec[i] );
	}
	DELETE(vec);
	vec = 0;
	len = numItems = 0;
    }
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:12,代码来源:qgvector.cpp

示例4: DELETE

 void RedisReply::Clear()
 {
     type = 0;
     integer = 0;
     double_value = 0;
     str.clear();
     DELETE(elements);
     if (self_pool && NULL != pool)
     {
         pool->Clear();
     }
 }
开发者ID:yinqiwen,项目名称:comms,代码行数:12,代码来源:redis_reply.cpp

示例5: memset

/**
 * postSort() runs after sorting has been performed. For ZendArray, postSort()
 * handles rewiring the linked list according to the results of the sort. Also,
 * if resetKeys is true, postSort() will renumber the keys 0 thru n-1.
 */
void ZendArray::postSort(Bucket** buffer, bool resetKeys) {
  uint last = m_size-1;
  m_pListHead = buffer[0];
  m_pListTail = buffer[last];
  m_pos = (ssize_t)m_pListHead;
  Bucket* b = buffer[0];
  b->pListLast = NULL;
  if (resetKeys) {
    memset(m_arBuckets, 0, tableSize() * sizeof(Bucket*));
    for (uint i = 0; i < last; ++i) {
      Bucket* bNext = buffer[i+1];
      b->pListNext = bNext;
      bNext->pListLast = b;
      if (b->hasStrKey() && b->skey->decRefCount() == 0) {
        DELETE(StringData)(b->skey);
      }
      b->setIntKey(i);
      uint nIndex = (i & m_nTableMask);
      CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);
      SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);
      b = bNext;
    }
    if (b->hasStrKey() && b->skey->decRefCount() == 0) {
      DELETE(StringData)(b->skey);
    }
    b->setIntKey(last);
    uint nIndex = (last & m_nTableMask);
    CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);
    SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);
    m_nNextFreeElement = m_size;
  } else {
    for (uint i = 0; i < last; ++i) {
      Bucket* bNext = buffer[i+1];
      b->pListNext = bNext;
      bNext->pListLast = b;
      b = bNext;
    }
  }
  b->pListNext = NULL;
}
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:45,代码来源:zend_array_sort.cpp

示例6: JCLSetGlobalOptions

JILError JCLSetGlobalOptions(JILState* pVM, const JILChar* pOptionString)
{
	JILError err = JIL_No_Exception;
	JCLString* pStr;
	JCLString* pToken;
	JCLOption* pOptions;
	JCLState* _this;

	if( (_this = pVM->vmpCompiler) == NULL )
		return JIL_ERR_No_Compiler;

	pStr = NEW(JCLString);
	pToken = NEW(JCLString);
	JCLSetString(pToken, pOptionString);
	pOptions = GetGlobalOptions(_this);
	while( !JCLAtEnd(pToken) )
	{
		// copy up to separator into pStr
		JCLSpanExcluding(pToken, ",;", pStr);
		// trim any spaces
		JCLTrim(pStr);
		// something left?
		if( JCLGetLength(pStr) )
		{
			// have option object parse it
			err = pOptions->ParseOption(pOptions, pStr, JILHandleRuntimeOptions, pVM);
			// handle warnings and errors
			if( err )
				goto exit;
		}
		// skip the separator(s)
		JCLSpanIncluding(pToken, ",;", pStr);
	}

exit:
	DELETE(pStr);
	DELETE(pToken);
	return err;
}
开发者ID:jewe-1969,项目名称:jilruntime,代码行数:39,代码来源:jilcompiler.c

示例7: rbtree_delete

/* =============================================================================
 * rbtree_delete
 * -- Returns TRUE if key exists
 * =============================================================================
 */
bool_t
rbtree_delete (rbtree_t* r, void* key)
{
    node_t* node = NULL;
    node = LOOKUP(r, key);
    if (node != NULL) {
        node = DELETE(r, node);
    }
    if (node != NULL) {
        releaseNode(node);
    }
    return ((node != NULL) ? TRUE : FALSE);
}
开发者ID:amohtasham,项目名称:rstm,代码行数:18,代码来源:rbtree.c

示例8: DELETE

 RedisDumpFile* Slave::GetNewRedisDumpFile()
 {
     DELETE(m_rdb);
     std::string dump_file_path = m_serv->m_cfg.home + "/repl";
     char tmp[dump_file_path.size() + 100];
     uint32 now = time(NULL);
     sprintf(tmp, "%s/temp-%u-%u.rdb", dump_file_path.c_str(), getpid(), now);
     NEW(m_rdb, RedisDumpFile);
     m_rdb->Init(m_serv->m_db);
     m_rdb->OpenWriteFile(tmp);
     INFO_LOG("[Slave]Create redis dump file:%s", tmp);
     return m_rdb;
 }
开发者ID:yuanshankongmeng,项目名称:ardb,代码行数:13,代码来源:slave.cpp

示例9: sp_devices_length

int sp_devices_length() {
    int length = 0;
    sp_db *th = NEW(sp_db);
    if (th && th->m_DB &&
        SQLITE_OK != sqlite3_exec(th->m_DB,
                                  "SELECT COUNT(id) as length FROM devices",
                                  &sp_devices_length_callback,
                                  (void *)&length, 0)) {
        length = 0;
    }
    DELETE(th);
    return length;
}
开发者ID:sergeygaychuk,项目名称:Dispatcher,代码行数:13,代码来源:sqliteprotocol.c

示例10: LoadOperMOTD

	void LoadOperMOTD()
	{
		ConfigReader* conf = new ConfigReader(ServerInstance);
		std::string filename;
		filename = conf->ReadValue("opermotd","file",0);
		if (opermotd)
		{
			delete opermotd;
			opermotd = NULL;
		}
		opermotd = new FileReader(ServerInstance, filename);
		DELETE(conf);
	}
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:13,代码来源:m_opermotd.cpp

示例11: DELETE

void ZendArray::onSetEvalScalar() {
  for (Bucket *p = m_pListHead; p; p = p->pListNext) {
    StringData *key = p->skey;
    if (p->hasStrKey() && !key->isStatic()) {
      StringData *skey= StringData::GetStaticString(key);
      if (key && key->decRefCount() == 0) {
        DELETE(StringData)(key);
      }
      p->skey = skey;
    }
    p->data.setEvalScalar();
  }
}
开发者ID:DenisBazhan,项目名称:hiphop-php,代码行数:13,代码来源:zend_array.cpp

示例12: ReadConfig

	void ReadConfig()
	{
		ConfigReader* MyConf = new ConfigReader(ServerInstance);
		allowchans.clear();
		for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)
		{
			std::string txt;
			txt = MyConf->ReadValue("allowchannel", "name", i);
			irc::string channel = txt.c_str();
			allowchans[channel] = 1;
		}
		DELETE(MyConf);
	}
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:13,代码来源:m_restrictchans.cpp

示例13: ASSERT

HOT_FUNC_HPHP
void ZendArray::erase(Bucket ** prev, bool updateNext /* = false */) {
  if (prev == NULL)
    return;
  Bucket * p = *prev;
  bool nextElementUnsetInsideForeachByReference = false;
  if (p) {
    *prev = p->pNext;
    if (p->pListLast) {
      p->pListLast->pListNext = p->pListNext;
    } else {
      /* Deleting the head of the list */
      ASSERT(m_pListHead == p);
      m_pListHead = p->pListNext;
    }
    if (p->pListNext) {
      p->pListNext->pListLast = p->pListLast;
    } else {
      ASSERT(m_pListTail == p);
      m_pListTail = p->pListLast;
    }
    if (m_pos == (ssize_t)p) {
      m_pos = (ssize_t)p->pListNext;
    }
    int sz = m_strongIterators.size();
    for (int i = 0; i < sz; ++i) {
      if (m_strongIterators.get(i)->pos == (ssize_t)p) {
        nextElementUnsetInsideForeachByReference = true;
        m_strongIterators.get(i)->pos = (ssize_t)p->pListNext;
        if (!(m_strongIterators.get(i)->pos)) {
          // Record that there is a strong iterator out there
          // that is past the end
          m_flag |= StrongIteratorPastEnd;
        }
      }
    }
    m_size--;
    // Match PHP 5.3.1 semantics
    if ((uint64)p->ikey == (uint64)(m_nNextFreeElement - 1) &&
        (p->ikey == 0x7fffffffffffffffLL || updateNext)) {
      --m_nNextFreeElement;
    }
    DELETE(Bucket)(p);
  }
  if (nextElementUnsetInsideForeachByReference) {
    if (RuntimeOption::EnableHipHopErrors) {
      raise_warning("The next element was unset inside foreach by reference. "
                    "This may lead to unexpeced results.");
    }
  }
}
开发者ID:DenisBazhan,项目名称:hiphop-php,代码行数:51,代码来源:zend_array.cpp

示例14: main

int32 main()
{    
    CTest *p1, *p2, *p3;
    char* pch1;
	CMemMgr* pclMemMgr = TSingleton<CMemMgr>::Instance();
    TSingleton<CMutexMgr>::Instance()->Init();    

    pclMemMgr.Init();
	pclMemMgr.Dump(NULL);
    NEW(p1, CTest, 1, 1);    
    NEW(p2, CTest, 2, 2);
    NEW(p3, CTest, 3, 3);
    p1->print();
    p2->print();
    p3->print();
	pclMemMgr.Dump(NULL);
    
    DELETE(p1);    
    MALLOC(pch1, char, 10);
    p2->print();
    p3->print();
	pclMemMgr.Dump(NULL);

    FREE(pch1);
    DELETE(p2);    
    DELETE(p3);
	pclMemMgr.Dump(NULL);
    
	pthread_t m_resumeThreadId;
    pthread_create(&m_resumeThreadId, 0, ResumeMemTask, 0);
    
	pthread_t m_monitorThreadId;
    pthread_create(&m_monitorThreadId, 0, MonitorMemTask, 0);
	
    while(1) sleep(10);

	return 0;
}
开发者ID:scanerdong,项目名称:test,代码行数:38,代码来源:MemMgr.cpp

示例15: CheckPointOperation

 int LMDBEngine::DiscardBatchWrite()
 {
     LMDBContext& holder = m_ctx_local.GetValue();
     holder.batch_write--;
     if (holder.batch_write == 0)
     {
         CheckPointOperation* ck = new CheckPointOperation(holder.cond);
         m_write_queue.Push(ck);
         NotifyBackgroundThread();
         ck->Wait();
         DELETE(ck);
     }
     return 0;
 }
开发者ID:mrkeng,项目名称:ardb,代码行数:14,代码来源:lmdb_engine.cpp


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