本文整理汇总了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);
}
示例2: DELETE
ADMVideoMPD3Dlow::~ADMVideoMPD3Dlow()
{
DELETE(_param);
delete _uncompressed;
delete _stored;
delete [] Line;
Line=NULL;
_param=NULL;
_uncompressed=NULL;
_stored=NULL;
}
示例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;
}
}
示例4: DELETE
void RedisReply::Clear()
{
type = 0;
integer = 0;
double_value = 0;
str.clear();
DELETE(elements);
if (self_pool && NULL != pool)
{
pool->Clear();
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
}
示例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);
}
示例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.");
}
}
}
示例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;
}
示例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;
}