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

C++ dfree函数代码示例

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

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



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

示例1: omapi_protocol_destroy

isc_result_t omapi_protocol_destroy (omapi_object_t *h,
				     const char *file, int line)
{
	omapi_protocol_object_t *p;
	if (h -> type != omapi_type_protocol)
		return ISC_R_INVALIDARG;
	p = (omapi_protocol_object_t *)h;
	if (p -> message)
		omapi_message_dereference (&p -> message, file, line);

	/* This will happen if: 1) A default authenticator is supplied to
	   omapi_protocol_connect(), and 2) something goes wrong before
	   the authenticator can be opened. */
	if (p -> default_auth && !p -> remote_auth_list)
		dfree (p -> default_auth, file, line);

	while (p -> remote_auth_list) {
		omapi_remote_auth_t *r = p -> remote_auth_list -> next;
		p -> remote_auth_list = r;
		if (r) {
			omapi_object_dereference (&r -> a, file, line);
			dfree (r, file, line);
		}
	}
	return ISC_R_SUCCESS;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:26,代码来源:protocol.c


示例2: trace_free_all

void trace_free_all ()
{
	trace_type_t *tp;
	int i;
	tp = new_trace_types;
	while (tp) {
		new_trace_types = tp -> next;
		if (tp -> name) {
			dfree (tp -> name, MDL);
			tp -> name = (char *)0;
		}
		dfree (tp, MDL);
		tp = new_trace_types;
	}
	for (i = 0; i < trace_type_count; i++) {
		if (trace_types [i]) {
			if (trace_types [i] -> name)
				dfree (trace_types [i] -> name, MDL);
			dfree (trace_types [i], MDL);
		}
	}
	dfree (trace_types, MDL);
	trace_types = (trace_type_t **)0;
	trace_type_count = trace_type_max = 0;

	omapi_array_free (&trace_listeners, MDL);
	omapi_array_free (&omapi_connections, MDL);
}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:28,代码来源:trace.c


示例3: dtfree

void dtfree(datrie *pvdt) {
    datrie_t *pdt = (datrie_t *)pvdt;
    if (pdt->pwarry_) {
        dfree(pdt->pwarry_);
        pdt->pwarry_ = NULL;
    }
    if (pdt->pextra_) {
        dfree(pdt->pextra_);
        pdt->pextra_ = NULL;
    }
    if (pdt->peidxs_) {
        dfree(pdt->peidxs_);
        pdt->peidxs_ = NULL;
    }
    if (pdt->code_maps_) {
        free(pdt->code_maps_);
        pdt->code_maps_ = NULL;
    }
    if (pdt->ord_tree_) {
        dfree(pdt->ord_tree_);
        pdt->ord_tree_ = NULL;
    }
    if (pdt->da_trie_) {
        free(pdt->da_trie_);
        pdt->da_trie_ = NULL;
    }
    free(pdt);
}
开发者ID:jnjcc,项目名称:yaseek,代码行数:28,代码来源:datrie.c


示例4: spr_Destroy

void spr_Destroy(Sprite *pSprite)
{
	uint32 i;

    if(pSprite->m_pFileIdent)
	{
		pSprite->m_pFileIdent->m_pData = LTNULL;
	}
			
	// Remove ourselves from the m_Sprites lists
	dl_Remove(&pSprite->m_Link); 
	dl_TieOff(&pSprite->m_Link);

	if(pSprite->m_Anims)
	{
		for(i=0; i < pSprite->m_nAnims; i++)
		{
			if(pSprite->m_Anims[i].m_Frames)
            {
				dfree(pSprite->m_Anims[i].m_Frames);
            }
		}

		dfree(pSprite->m_Anims);
	}

	dfree(pSprite);
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:28,代码来源:sprite.cpp


示例5: button_destroy

kucode_t button_destroy( gui_obj_t *obj )
{
	gui_button_t *const widget = (gui_button_t*)obj->widget;
	pstart();
	
	KU_WITHOUT_ERROR_START();
	if ( obj->status > GUI_NOTLOADED )
		button_uload(obj);
	
	if ( widget->back_nor_name )
		dfree(widget->back_nor_name);
	
	if ( widget->back_mon_name )
		dfree(widget->back_mon_name);
	
	if ( widget->back_mdn_name )
		dfree(widget->back_mdn_name);
	
	if ( widget->font_name )
		dfree(widget->font_name);
	
	if ( widget->caption )
		dfree(widget->caption);
	KU_WITHOUT_ERROR_STOP();
	
	KU_ERRQ_BLOCKED();
}
开发者ID:BackupTheBerlios,项目名称:ku2-svn,代码行数:27,代码来源:button.c


示例6: free_aster

/**
   Free the ASTER_S array.
 */
void free_aster(ASTER_S *aster, int naster, const PARMS_S *parms){
    (void) parms;
    for(int iaster=0; iaster<naster; iaster++){
	int ndtrat=parms->skyc.ndtrat;
	if(aster[iaster].kalman){
	    if(parms->skyc.multirate){
		kalman_free(aster[iaster].kalman[0]);
		dcellfreearr(aster[iaster].neam, 1);
	    }else{
		for(int i=0; i<ndtrat; i++){
		    kalman_free(aster[iaster].kalman[i]);
		}
		dcellfreearr(aster[iaster].neam, ndtrat);
	    }
	    free(aster[iaster].kalman);
	    aster[iaster].kalman=0;
	}
	dcellfree(aster[iaster].gain);
	dcellfree(aster[iaster].pgm);
	dcellfree(aster[iaster].sigman);
	dfree(aster[iaster].res_ws);
	dfree(aster[iaster].res_ngs);

	free(aster[iaster].wfs);
	dcellfree(aster[iaster].g);
	dfree(aster[iaster].gm);
	dfree(aster[iaster].dtrats);
	dfree(aster[iaster].idtrats);
	free(aster[iaster].ngs);
    }
    free(aster);
}
开发者ID:bitursa,项目名称:maos,代码行数:35,代码来源:setup_aster.c


示例7: tkey_free

void tkey_free (ns_tsig_key **key)
{
	if ((*key) -> data)
		dfree ((*key) -> data, MDL);
	dfree ((*key), MDL);
	*key = (ns_tsig_key *)0;
}
开发者ID:tcdog001,项目名称:apv5sdk-v15,代码行数:7,代码来源:dns.c


示例8: trace_mr_statp_setup

void trace_mr_statp_setup (res_state statp)
{
	unsigned buflen = 0;
	char *buf = (char *)0;
	isc_result_t status;
	int i;

	if (trace_playback ()) {
		int nscount;
		status = trace_get_packet (&trace_mr_statp, &buflen, &buf);
		if (status != ISC_R_SUCCESS) {
			log_error ("trace_mr_statp: no statp packet found.");
			return;
		}
		nscount = buflen / sizeof (struct in_addr);
		if (nscount * (sizeof (struct in_addr)) != buflen ||
		    nscount < 1) {
			log_error ("trace_mr_statp: bogus length: %d",
				   buflen);
			return;
		}
		if (nscount > MAXNS)
			nscount = MAXNS;
		for (i = 0; i < nscount; i++) {
#if defined (HAVE_SA_LEN)
			statp -> nsaddr_list [i].sin_len =
				sizeof (struct sockaddr_in);
#endif
			memset (&statp -> nsaddr_list [i].sin_zero, 0,
				sizeof statp -> nsaddr_list [i].sin_zero);
			statp -> nsaddr_list [i].sin_port = htons (53); /*XXX*/
			statp -> nsaddr_list [i].sin_family = AF_INET;
			memcpy (&statp -> nsaddr_list [i].sin_addr,
				(buf + i * (sizeof (struct in_addr))),
				sizeof (struct in_addr));
		}
		statp -> nscount = nscount;
		dfree (buf, MDL);
		buf = (char *)0;
	}
	if (trace_record ()) {
		trace_iov_t *iov;
		iov = dmalloc ((statp -> nscount *
				sizeof (trace_iov_t)), MDL);
		if (!iov) {
			trace_stop ();
			log_error ("No memory for statp iov.");
			return;
		}
		for (i = 0; i < statp -> nscount; i++) {
			iov [i].buf =
				(char *)&statp -> nsaddr_list [i].sin_addr;
			iov [i].len = sizeof (struct in_addr);
		}
		trace_write_packet_iov (trace_mr_statp, i, iov, MDL);
		dfree (iov, MDL);
	}
}
开发者ID:arroway,项目名称:dhcp-http-json,代码行数:58,代码来源:mrtrace.c


示例9: servo_calc_free

static void servo_calc_free(SERVO_CALC_T *st){
    cfree(st->s);
    cfree(st->Hol);
    cfree(st->Hint);
    cfree(st->Hsys);
    cfree(st->Hwfs);
    dfree(st->nu);
    dfree(st->psd);
}
开发者ID:bitursa,项目名称:maos,代码行数:9,代码来源:servo.c


示例10: dsdict_remove

void dsdict_remove(dsdict* dict, const char* key) {
	dsdict_node* node = dsdict_iter(dict, key);

	if (node) {
		dfree(node->key);
		dfree(node->value);
		list_erase(dict, node);
		free(node);
	}
}
开发者ID:atheros,项目名称:cutils,代码行数:10,代码来源:dstrutils.c


示例11: testdfull

void testdfull (void)
//*************************************************************************
//
//*************************************************************************
{
  if (   (dfree(".", 0) < HOMEDISKFULL)
      || (dfree(m.userpath, 0) < USERDISKFULL)
      || (dfree(m.infopath, 0) < INFODISKFULL))
    putf("***************** HDD is full ******************\n");
}
开发者ID:donzelot,项目名称:openBCM,代码行数:10,代码来源:sysop.cpp


示例12: servo_free

/**
   Free SERVO_T struct
*/
void servo_free(SERVO_T *st){
    if(!st) return;
    dcellfree(st->mlead);
    dcellfree(st->merrlast);
    dcellfree(st->mpreint);
    cellfree(st->merrhist);
    cellfree(st->mint);
    dfree(st->ap);
    dfree(st->ep);
    free(st);
}
开发者ID:bitursa,项目名称:maos,代码行数:14,代码来源:servo.c


示例13: dsdict_free

void dsdict_free(dsdict* dict) {
	dsdict_node* n = dict->front;
	while (dict->front) {
		n = dict->front;
		dfree(n->key);
		dfree(n->value);
		dict->front = n->next;
		free(n);
	}

	free(dict);
}
开发者ID:atheros,项目名称:cutils,代码行数:12,代码来源:dstrutils.c


示例14: isc_heap_destroy

void
isc_heap_destroy(isc_heap_t **heapp) {
	isc_heap_t *heap;

	REQUIRE(heapp != NULL);
	heap = *heapp;

	if (heap->array != NULL)
		dfree(heap->array, MDL);
	dfree(heap, MDL);

	*heapp = NULL;
}
开发者ID:arroway,项目名称:dhcp-http-json,代码行数:13,代码来源:heap.c


示例15: trace_get_file

isc_result_t trace_get_file (trace_type_t *ttype,
			     const char *filename, unsigned *len, char **buf)
{
	fpos_t curpos;
	unsigned max = 0;
	tracepacket_t *tpkt;
	int status;
	isc_result_t result;

	/* Disallow some obvious bogosities. */
	if (!buf || !len || *buf)
		return DHCP_R_INVALIDARG;

	/* Save file position in case of filename mismatch. */
	status = fgetpos (traceinfile, &curpos);
	if (status < 0)
		log_error ("Can't save tracefile position: %m");

	tpkt = dmalloc ((unsigned)tracefile_header.phlen, MDL);
	if (!tpkt) {
		log_error ("can't allocate trace packet header.");
		return ISC_R_NOMEMORY;
	}

	result = trace_get_next_packet (&ttype, tpkt, buf, len, &max);
	/* done with tpkt, free it */
	dfree (tpkt, MDL);
	if (result != ISC_R_SUCCESS) {
		if (*buf) {
			dfree (*buf, MDL);
			*buf = NULL;
		}
		return result;
	}

	/* Make sure the filename is right. */
	if (strcmp (filename, *buf)) {
		log_error ("Read file %s when expecting %s", *buf, filename);
		dfree (*buf, MDL);
		*buf = NULL;

		status = fsetpos (traceinfile, &curpos);
		if (status < 0) {
			log_error ("fsetpos in tracefile failed: %m");
			return DHCP_R_PROTOCOLERROR;
		}
		return ISC_R_UNEXPECTEDTOKEN;
	}

	return ISC_R_SUCCESS;
}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:51,代码来源:trace.c


示例16: dochngd

/*ARGSUSED*/
void
dochngd(Char **v, struct command *c)
{
    Char *cp;
    struct directory *dp;
    int dflag = skipargs(&v, "plvn", "[-|<dir>]");

    USE(c);
    printd = 0;
    cp = (dflag & DIR_OLD) ? varval(STRowd) : *v;

    if (cp == NULL) {
	if (!cdtohome)
	    stderror(ERR_NAME | ERR_TOOFEW);
	else if ((cp = varval(STRhome)) == STRNULL || *cp == 0)
	    stderror(ERR_NAME | ERR_NOHOMEDIR);
	if (chdir(short2str(cp)) < 0)
	    stderror(ERR_NAME | ERR_CANTCHANGE);
	cp = Strsave(cp);
    }
    else if ((dflag & DIR_OLD) == 0 && v[1] != NULL) {
	stderror(ERR_NAME | ERR_TOOMANY);
	/* NOTREACHED */
	return;
    }
    else if ((dp = dfind(cp)) != 0) {
	char   *tmp;

	printd = 1;
	if (chdir(tmp = short2str(dp->di_name)) < 0)
	    stderror(ERR_SYSTEM, tmp, strerror(errno));
	dcwd->di_prev->di_next = dcwd->di_next;
	dcwd->di_next->di_prev = dcwd->di_prev;
	dfree(dcwd);
	dnewcwd(dp, dflag);
	return;
    }
    else
	if ((cp = dfollow(cp, dflag & DIR_OLD)) == NULL)
	    return;
    dp = xcalloc(sizeof(struct directory), 1);
    dp->di_name = cp;
    dp->di_count = 0;
    dp->di_next = dcwd->di_next;
    dp->di_prev = dcwd->di_prev;
    dp->di_prev->di_next = dp;
    dp->di_next->di_prev = dp;
    dfree(dcwd);
    dnewcwd(dp, dflag);
}
开发者ID:lukem,项目名称:tcsh,代码行数:51,代码来源:sh.dir.c


示例17: servo_test

/**
   test type I/II filter with ideal measurement to make sure it is implemented correctly.
*/
dmat* servo_test(dmat *input, double dt, int dtrat, dmat *sigma2n, dmat *gain){
    if(input->ny==1){/*single mode. each column is for a mode.*/
	input->ny=input->nx;
	input->nx=1;
    }
    int nmod=input->nx;
    PDMAT(input,pinput);
    dmat *merr=dnew(nmod,1);
    dcell *mreal=cellnew(1,1);
    dmat *mres=dnew(nmod,input->ny);
    dmat *sigman=NULL;
    if(dnorm(sigma2n)>0){
	sigman=dchol(sigma2n);
    }
    dcell *meas=cellnew(1,1);
    dmat *noise=dnew(nmod, 1);
    SERVO_T *st2t=servo_new(NULL, NULL, 0, dt*dtrat, gain);
    rand_t rstat;
    seed_rand(&rstat, 1);
    PDMAT(mres,pmres);
    /*two step delay is ensured with the order of using, copy, acc*/
    for(int istep=0; istep<input->ny; istep++){
	memcpy(merr->p, pinput[istep], nmod*sizeof(double));
	dadd(&merr, 1, mreal->p[0], -1);
	memcpy(pmres[istep],merr->p,sizeof(double)*nmod);
	if(istep % dtrat == 0){
	    dzero(meas->p[0]);
	}
	dadd(&meas->p[0], 1, merr, 1);/*average the error. */
	dcellcp(&mreal, st2t->mint->p[0]);
	if((istep+1) % dtrat == 0){
	    if(dtrat!=1) dscale(meas->p[0], 1./dtrat);
	    if(sigman){
		drandn(noise, 1, &rstat);
		if(sigman->nx>0){
		    dmm(&meas->p[0], 1, sigman, noise, "nn", 1);
		}else{
		    dadd(&meas->p[0], 1, noise, sigman->p[0]);
		}
	    }
	    servo_filter(st2t, meas);
	}
    }
    dfree(sigman);
    dfree(merr);
    dcellfree(mreal);
    dcellfree(meas);
    servo_free(st2t);
    return mres;
}
开发者ID:bitursa,项目名称:maos,代码行数:53,代码来源:servo.c


示例18: dlistRelease

/* Free the whole list.
 *
 * This function can't fail. */
void dlistRelease(dlist *list)
{
    unsigned long len;
    dlistNode *current, *next;

    current = list->head;
    len = list->len;
    while(len--) {
        next = current->next;
        if (list->free) list->free(current->value);
        dfree(current);
        current = next;
    }
    dfree(list);
}
开发者ID:vipshop,项目名称:vire,代码行数:18,代码来源:dlist.c


示例19: trace

/**
  Estimate wavefront error propagated from measurement error. pgm is the reconstructor. ineam is the
  error inverse.
  trace(Mcc*(pgm*neam*pgm'))
*/
static dmat *calc_recon_error(const dmat *pgm,   /**<[in] the reconstructor*/
			      const dmat *neam,/**<[in] the inverse of error covariance matrix*/
			      const dmat *mcc   /**<[in] NGS mode covariance matrix.*/
			      ){
    dmat *psp=NULL;
    dmat *tmp=NULL;
    dcp(&tmp, pgm);
    dmuldiag(tmp, neam);
    dmm(&psp, 0, tmp, pgm, "nt", 1);
    PDMAT(psp,ppsp); 
    PDMAT(mcc,pmcc);
    /*It is right for both ix, iy to stop at ib.*/
    double all[mcc->nx];
    for(int ib=0; ib<mcc->ny; ib++){
	all[ib]=0;
	for(int iy=0; iy<=ib; iy++){
	    for(int ix=0; ix<=ib; ix++){
		all[ib]+=ppsp[iy][ix]*pmcc[iy][ix];
	    }
	}
    }
    dfree(psp);
    dmat *res=dnew(3,1);
    res->p[0]=all[5];//total error
    res->p[1]=all[1];//total TT error
    if(mcc->nx>5){
	res->p[2]=all[5]-all[4];//focus alone
	if(res->p[2]<0){
	    res->p[2]=0;//due to coupling, this may be negative.
	}
    }
    return res;
}
开发者ID:bitursa,项目名称:maos,代码行数:38,代码来源:setup_aster.c


示例20: freeZsetObject

void freeZsetObject(robj *o) {
    zset *zs;
    switch (o->encoding) {
    case OBJ_ENCODING_SKIPLIST:
        zs = o->ptr;
        dictRelease(zs->dict);
        zslFree(zs->zsl);
        dfree(zs);
        break;
    case OBJ_ENCODING_ZIPLIST:
        dfree(o->ptr);
        break;
    default:
        serverPanic("Unknown sorted set encoding");
    }
}
开发者ID:vipshop,项目名称:vire,代码行数:16,代码来源:vr_object.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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