您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uma_zfree函数代码示例

51自学网 2021-06-03 09:09:02
  C++
这篇教程C++ uma_zfree函数代码示例写得很实用,希望能帮到您。

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

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

示例1: tcp_twclose

voidtcp_twclose(struct tcptw *tw, int reuse){    struct socket *so;    struct inpcb *inp;    /*     * At this point, we are in one of two situations:     *     * (1) We have no socket, just an inpcb<->twtcp pair.  We can free     *     all state.     *     * (2) We have a socket -- if we own a reference, release it and     *     notify the socket layer.     */    inp = tw->tw_inpcb;//ScenSim-Port//    KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait"));//ScenSim-Port//    KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw"));//ScenSim-Port//    INP_INFO_WLOCK_ASSERT(&V_tcbinfo);  /* tcp_tw_2msl_stop(). *///ScenSim-Port//    INP_WLOCK_ASSERT(inp);    tw->tw_inpcb = NULL;    tcp_tw_2msl_stop(tw);    inp->inp_ppcb = NULL;    in_pcbdrop(inp);    so = inp->inp_socket;    if (so != NULL) {        /*         * If there's a socket, handle two cases: first, we own a         * strong reference, which we will now release, or we don't         * in which case another reference exists (XXXRW: think         * about this more), and we don't need to take action.         */        if (inp->inp_flags & INP_SOCKREF) {            inp->inp_flags &= ~INP_SOCKREF;//ScenSim-Port//            INP_WUNLOCK(inp);//ScenSim-Port//            ACCEPT_LOCK();//ScenSim-Port//            SOCK_LOCK(so);//ScenSim-Port//            KASSERT(so->so_state & SS_PROTOREF,//ScenSim-Port//                ("tcp_twclose: INP_SOCKREF && !SS_PROTOREF"));            so->so_state &= ~SS_PROTOREF;            sofree(so);        } else {            /*             * If we don't own the only reference, the socket and             * inpcb need to be left around to be handled by             * tcp_usr_detach() later.             *///ScenSim-Port//            INP_WUNLOCK(inp);        }    } else        in_pcbfree(inp);    TCPSTAT_INC(tcps_closed);//ScenSim-Port//    crfree(tw->tw_cred);//ScenSim-Port//    tw->tw_cred = NULL;    if (reuse)        return;    uma_zfree(V_tcptw_zone, tw);}
开发者ID:koja123,项目名称:simulator,代码行数:60,


示例2: dtsec_rm_fi_free

static voiddtsec_rm_fi_free(struct dtsec_softc *sc, struct dtsec_rm_frame_info *fi){	XX_UntrackAddress(fi);	uma_zfree(sc->sc_fi_zone, fi);}
开发者ID:2asoft,项目名称:freebsd,代码行数:7,


示例3: m_get2

/* * m_get2() allocates minimum mbuf that would fit "size" argument. */struct mbuf *m_get2(int size, int how, short type, int flags){	struct mb_args args;	struct mbuf *m, *n;	args.flags = flags;	args.type = type;	if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0))		return (uma_zalloc_arg(zone_mbuf, &args, how));	if (size <= MCLBYTES)		return (uma_zalloc_arg(zone_pack, &args, how));	if (size > MJUMPAGESIZE)		return (NULL);	m = uma_zalloc_arg(zone_mbuf, &args, how);	if (m == NULL)		return (NULL);	n = uma_zalloc_arg(zone_jumbop, m, how);	if (n == NULL) {		uma_zfree(zone_mbuf, m);		return (NULL);	}	return (m);}
开发者ID:HundenOdin,项目名称:freebsd,代码行数:32,


示例4: m_getjcl

/* * m_getjcl() returns an mbuf with a cluster of the specified size attached. * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. */struct mbuf *m_getjcl(int how, short type, int flags, int size){	struct mb_args args;	struct mbuf *m, *n;	uma_zone_t zone;	if (size == MCLBYTES)		return m_getcl(how, type, flags);	args.flags = flags;	args.type = type;	m = uma_zalloc_arg(zone_mbuf, &args, how);	if (m == NULL)		return (NULL);	zone = m_getzone(size);	n = uma_zalloc_arg(zone, m, how);	if (n == NULL) {		uma_zfree(zone_mbuf, m);		return (NULL);	}	return (m);}
开发者ID:HundenOdin,项目名称:freebsd,代码行数:29,


示例5: ncl_reclaim

/* * Reclaim an nfsnode so that it can be used for other purposes. */intncl_reclaim(struct vop_reclaim_args *ap){	struct vnode *vp = ap->a_vp;	struct nfsnode *np = VTONFS(vp);	struct nfsdmap *dp, *dp2;	/*	 * If the NLM is running, give it a chance to abort pending	 * locks.	 */	if (nfs_reclaim_p != NULL)		nfs_reclaim_p(ap);	/*	 * Destroy the vm object and flush associated pages.	 */	vnode_destroy_vobject(vp);	if (NFS_ISV4(vp) && vp->v_type == VREG)		/*		 * We can now safely close any remaining NFSv4 Opens for		 * this file. Most opens will have already been closed by		 * ncl_inactive(), but there are cases where it is not		 * called, so we need to do it again here.		 */		(void) nfsrpc_close(vp, 1, ap->a_td);	vfs_hash_remove(vp);	/*	 * Call nfscl_reclaimnode() to save attributes in the delegation,	 * as required.	 */	if (vp->v_type == VREG)		nfscl_reclaimnode(vp);	/*	 * Free up any directory cookie structures and	 * large file handle structures that might be associated with	 * this nfs node.	 */	if (vp->v_type == VDIR) {		dp = LIST_FIRST(&np->n_cookies);		while (dp) {			dp2 = dp;			dp = LIST_NEXT(dp, ndm_list);			FREE((caddr_t)dp2, M_NFSDIROFF);		}	}	if (np->n_writecred != NULL)		crfree(np->n_writecred);	FREE((caddr_t)np->n_fhp, M_NFSFH);	if (np->n_v4 != NULL)		FREE((caddr_t)np->n_v4, M_NFSV4NODE);	mtx_destroy(&np->n_mtx);	uma_zfree(newnfsnode_zone, vp->v_data);	vp->v_data = NULL;	return (0);}
开发者ID:coyizumi,项目名称:cs111,代码行数:63,


示例6: ncl_reclaim

/* * Reclaim an nfsnode so that it can be used for other purposes. */intncl_reclaim(struct vop_reclaim_args *ap){	struct vnode *vp = ap->a_vp;	struct nfsnode *np = VTONFS(vp);	struct nfsdmap *dp, *dp2;	if (NFS_ISV4(vp) && vp->v_type == VREG)		/*		 * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4		 * Close operations are delayed until ncl_inactive().		 * However, since VOP_INACTIVE() is not guaranteed to be		 * called, we need to do it again here.		 */		(void) nfsrpc_close(vp, 1, ap->a_td);	/*	 * If the NLM is running, give it a chance to abort pending	 * locks.	 */	if (nfs_reclaim_p != NULL)		nfs_reclaim_p(ap);	/*	 * Destroy the vm object and flush associated pages.	 */	vnode_destroy_vobject(vp);	vfs_hash_remove(vp);	/*	 * Call nfscl_reclaimnode() to save attributes in the delegation,	 * as required.	 */	if (vp->v_type == VREG)		nfscl_reclaimnode(vp);	/*	 * Free up any directory cookie structures and	 * large file handle structures that might be associated with	 * this nfs node.	 */	if (vp->v_type == VDIR) {		dp = LIST_FIRST(&np->n_cookies);		while (dp) {			dp2 = dp;			dp = LIST_NEXT(dp, ndm_list);			FREE((caddr_t)dp2, M_NFSDIROFF);		}	}	if (np->n_writecred != NULL)		crfree(np->n_writecred);	FREE((caddr_t)np->n_fhp, M_NFSFH);	if (np->n_v4 != NULL)		FREE((caddr_t)np->n_v4, M_NFSV4NODE);	mtx_destroy(&np->n_mtx);	uma_zfree(newnfsnode_zone, vp->v_data);	vp->v_data = NULL;	return (0);}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:63,


示例7: syncache_free

static voidsyncache_free(struct syncache *sc){	if (sc->sc_ipopts)		(void) m_free(sc->sc_ipopts);	uma_zfree(tcp_syncache.zone, sc);}
开发者ID:MarginC,项目名称:kame,代码行数:8,


示例8: cache_free

static voidcache_free(struct namecache *ncp){	int ts;	if (ncp == NULL)		return;	ts = ncp->nc_flag & NCF_TS;	if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) {		if (ts)			uma_zfree(cache_zone_small_ts, ncp);		else			uma_zfree(cache_zone_small, ncp);	} else if (ts)		uma_zfree(cache_zone_large_ts, ncp);	else		uma_zfree(cache_zone_large, ncp);}
开发者ID:runsisi,项目名称:ufreebsdtcp,代码行数:18,


示例9: dtsec_rm_pool_rx_put_buffer

/** * @group dTSEC buffer pools routines. * @{ */static t_Errordtsec_rm_pool_rx_put_buffer(t_Handle h_BufferPool, uint8_t *buffer,    t_Handle context){	struct dtsec_softc *sc;	sc = h_BufferPool;	uma_zfree(sc->sc_rx_zone, buffer);	return (E_OK);}
开发者ID:2asoft,项目名称:freebsd,代码行数:15,


示例10: icl_soft_conn_pdu_free

static voidicl_soft_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip){	m_freem(ip->ip_bhs_mbuf);	m_freem(ip->ip_ahs_mbuf);	m_freem(ip->ip_data_mbuf);	uma_zfree(icl_pdu_zone, ip);#ifdef DIAGNOSTIC	refcount_release(&ic->ic_outstanding_pdus);#endif}
开发者ID:mulichao,项目名称:freebsd,代码行数:12,


示例11: tcp_sackhole_free

/* * Free struct sackhole. */static voidtcp_sackhole_free(struct tcpcb *tp, struct sackhole *hole){    uma_zfree(V_sack_hole_zone, hole);    tp->snd_numholes--;    atomic_subtract_int(&V_tcp_sack_globalholes, 1);//ScenSim-Port//    KASSERT(tp->snd_numholes >= 0, ("tp->snd_numholes >= 0"));//ScenSim-Port//    KASSERT(V_tcp_sack_globalholes >= 0, ("tcp_sack_globalholes >= 0"));}
开发者ID:koja123,项目名称:simulator,代码行数:15,


示例12: netmap_default_mbuf_destructor

static voidnetmap_default_mbuf_destructor(struct mbuf *m){	/* restore original mbuf */	m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1;	m->m_ext.ext_arg1 = NULL;	m->m_ext.ext_type = EXT_PACKET;	m->m_ext.ext_free = NULL;	if (MBUF_REFCNT(m) == 0)		SET_MBUF_REFCNT(m, 1);	uma_zfree(zone_pack, m);}
开发者ID:JaseFace,项目名称:netmap,代码行数:12,


示例13: ertt_uma_dtor

//ScenSim-Port//static void//ScenSim-Port//ertt_uma_dtor(void *mem, int size, void *arg)void ertt_uma_dtor(struct ertt *e_t)                            //ScenSim-Port//{//ScenSim-Port//    struct ertt *e_t;    struct txseginfo *n_txsi, *txsi;//ScenSim-Port//    e_t = mem;    txsi = TAILQ_FIRST(&e_t->txsegi_q);    while (txsi != NULL) {        n_txsi = TAILQ_NEXT(txsi, txsegi_lnk);        uma_zfree(txseginfo_zone, txsi);        txsi = n_txsi;    }}
开发者ID:koja123,项目名称:simulator,代码行数:15,


示例14: icl_pdu_free

voidicl_pdu_free(struct icl_pdu *ip){	struct icl_conn *ic;	ic = ip->ip_conn;	m_freem(ip->ip_bhs_mbuf);	m_freem(ip->ip_ahs_mbuf);	m_freem(ip->ip_data_mbuf);	uma_zfree(icl_pdu_zone, ip);	refcount_release(&ic->ic_outstanding_pdus);}
开发者ID:amir-partovi,项目名称:Taha,代码行数:13,


示例15: ertt_uma_dtor

static voidertt_uma_dtor(void *mem, int size, void *arg){	struct ertt *e_t;	struct txseginfo *n_txsi, *txsi;	e_t = mem;	txsi = TAILQ_FIRST(&e_t->txsegi_q);	while (txsi != NULL) {		n_txsi = TAILQ_NEXT(txsi, txsegi_lnk);		uma_zfree(txseginfo_zone, txsi);		txsi = n_txsi;	}}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:14,


示例16: patm_vcc_closed

/* * VCC has been finally closed. */voidpatm_vcc_closed(struct patm_softc *sc, struct patm_vcc *vcc){	/* inform management about non-NG and NG-PVCs */	if (!(vcc->vcc.flags & ATMIO_FLAG_NG) ||	    (vcc->vcc.flags & ATMIO_FLAG_PVC))		ATMEV_SEND_VCC_CHANGED(IFP2IFATM(sc->ifp), vcc->vcc.vpi,		    vcc->vcc.vci, 0);	sc->vccs_open--;	sc->vccs[vcc->cid] = NULL;	uma_zfree(sc->vcc_zone, vcc);}
开发者ID:RichardsonAlex,项目名称:cheribsd,代码行数:17,


示例17: void_mbuf_dtor

static intvoid_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2){	/* restore original mbuf */	m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1;	m->m_ext.ext_arg1 = NULL;	m->m_ext.ext_type = EXT_PACKET;	m->m_ext.ext_free = NULL;	if (MBUF_REFCNT(m) == 0)		SET_MBUF_REFCNT(m, 1);	uma_zfree(zone_pack, m);	return 0;}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:14,


示例18: hatm_vcc_closed

/* * VCC has been finally closed. */voidhatm_vcc_closed(struct hatm_softc *sc, u_int cid){	struct hevcc *vcc = sc->vccs[cid];	/* inform management about non-NG and NG-PVCs */	if (!(vcc->param.flags & ATMIO_FLAG_NG) ||	    (vcc->param.flags & ATMIO_FLAG_PVC))		ATMEV_SEND_VCC_CHANGED(IFP2IFATM(sc->ifp), HE_VPI(cid), HE_VCI(cid), 0);	sc->open_vccs--;	uma_zfree(sc->vcc_zone, vcc);	sc->vccs[cid] = NULL;}
开发者ID:JabirTech,项目名称:Source,代码行数:17,


示例19: dircache_entry_free

static voiddircache_entry_free(struct pefs_dircache_entry *pde){	MPASS(pde != NULL);	PEFSDEBUG("dircache_entry_free: %s -> %s/n",	    pde->pde_name, pde->pde_encname);	pefs_key_release(pde->pde_tkey.ptk_key);	LIST_REMOVE(pde, pde_dir_entry);	mtx_lock(&dircache_mtx);	LIST_REMOVE(pde, pde_hash_entry);	LIST_REMOVE(pde, pde_enchash_entry);	dircache_entries--;	mtx_unlock(&dircache_mtx);	uma_zfree(dircache_entry_zone, pde);}
开发者ID:TetragrammatonHermit,项目名称:pefs,代码行数:16,


示例20: uma_zfree

static struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc){	struct mb_args args;	struct mbuf *m;	/* Allocate mbuf structure */	args.flags = M_PKTHDR;	args.type = MT_DATA;	m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT);	/* Allocate (and attach) packet buffer */	if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) {		uma_zfree(zone_mbuf, m);		m = NULL;	}	return (m);}
开发者ID:coyizumi,项目名称:cs111,代码行数:18,


示例21: nfs_reclaim

/* * Reclaim an nfsnode so that it can be used for other purposes. */intnfs_reclaim(struct vop_reclaim_args *ap){	struct vnode *vp = ap->a_vp;	struct nfsnode *np = VTONFS(vp);	struct nfsdmap *dp, *dp2;	/*	 * If the NLM is running, give it a chance to abort pending	 * locks.	 */	if (nfs_reclaim_p)		nfs_reclaim_p(ap);	/*	 * Destroy the vm object and flush associated pages.	 */	vnode_destroy_vobject(vp);	vfs_hash_remove(vp);	/*	 * Free up any directory cookie structures and	 * large file handle structures that might be associated with	 * this nfs node.	 */	if (vp->v_type == VDIR) {		dp = LIST_FIRST(&np->n_cookies);		while (dp) {			dp2 = dp;			dp = LIST_NEXT(dp, ndm_list);			free((caddr_t)dp2, M_NFSDIROFF);		}	}	if (np->n_writecred != NULL)		crfree(np->n_writecred);	if (np->n_fhsize > NFS_SMALLFH) {		free((caddr_t)np->n_fhp, M_NFSBIGFH);	}	mtx_destroy(&np->n_mtx);	uma_zfree(nfsnode_zone, vp->v_data);	vp->v_data = NULL;	return (0);}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:47,


示例22: pefs_dircache_free

voidpefs_dircache_free(struct pefs_dircache *pd){	struct pefs_dircache_entry *pde;	if (pd == NULL)		return;	while (!LIST_EMPTY(DIRCACHE_STALEHEAD(pd))) {		pde = LIST_FIRST(DIRCACHE_STALEHEAD(pd));		dircache_entry_free(pde);	}	while (!LIST_EMPTY(DIRCACHE_ACTIVEHEAD(pd))) {		pde = LIST_FIRST(DIRCACHE_ACTIVEHEAD(pd));		dircache_entry_free(pde);	}	sx_destroy(&pd->pd_lock);	uma_zfree(dircache_zone, pd);}
开发者ID:TetragrammatonHermit,项目名称:pefs,代码行数:19,



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


C++ umalloc函数代码示例
C++ uma_zalloc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。