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

C++ A_FREE函数代码示例

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

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



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

示例1: ncvarget

int
ncvarget(
    int		ncid,
    int		varid,
    const long*	start,
    const long*	count, 
    void*	value
)
{
	NDIMS_DECL
	A_DECL(stp, size_t, ndims, start);
	A_DECL(cntp, size_t, ndims, count);
	A_INIT(stp, size_t, ndims, start);
	A_INIT(cntp, size_t, ndims, count);
	{
	const int status = nc_get_vara(ncid, varid, stp, cntp, value);
	A_FREE(cntp);
	A_FREE(stp);
	if(status != NC_NOERR)
	{
		nc_advise("ncvarget", status, "ncid %d; varid %d", ncid, varid);
		return -1;
	}
	}
	return 0;
}
开发者ID:stcorp,项目名称:harp,代码行数:26,代码来源:v2i.c


示例2: HTCCleanup

/* cleanup the HTC instance */
static void HTCCleanup(HTC_TARGET *target)
{
    A_INT32 i;

    DevCleanup(&target->Device);
    
    for (i = 0;i < NUM_CONTROL_BUFFERS;i++) {
        if (target->HTCControlBuffers[i].Buffer) {
            A_FREE(target->HTCControlBuffers[i].Buffer);
        }
    }
    
    if (A_IS_MUTEX_VALID(&target->HTCLock)) {
        A_MUTEX_DELETE(&target->HTCLock);
    }

    if (A_IS_MUTEX_VALID(&target->HTCRxLock)) {
        A_MUTEX_DELETE(&target->HTCRxLock);
    }

    if (A_IS_MUTEX_VALID(&target->HTCTxLock)) {
        A_MUTEX_DELETE(&target->HTCTxLock);
    }
        /* free our instance */
    A_FREE(target);
}
开发者ID:NemProjects,项目名称:WLAN,代码行数:27,代码来源:htc.c


示例3: BMIDone

A_STATUS
BMIDone(A_VOID *pCxt)
{
    A_STATUS status;
    A_UINT32 cid;

    if (bmiDone) {
        return A_OK;
    }

    bmiDone = TRUE;
    cid = A_CPU2LE32(BMI_DONE);

    status = bmiBufferSend(pCxt, (A_UCHAR *)&cid, sizeof(cid));
    if (status != A_OK) {
        return A_ERROR;
    }

    if (pBMICmdCredits) {
        A_FREE(pBMICmdCredits, MALLOC_ID_TEMPORARY);
        pBMICmdCredits = NULL;
    }

    if (pBMICmdBuf) {
        A_FREE(pBMICmdBuf, MALLOC_ID_TEMPORARY);
        pBMICmdBuf = NULL;
    }

    return A_OK;
}
开发者ID:BillyZhangZ,项目名称:wifi,代码行数:30,代码来源:bmi.c


示例4: CleanupHIFScatterResources

    /* clean up scatter support */
void CleanupHIFScatterResources(HIF_DEVICE *device)
{
    HIF_SCATTER_REQ_PRIV    *pReqPriv;
    HIF_SCATTER_REQ         *pReq;
    
        /* empty the free list */
        
    while (1) {
        
        pReq = AllocScatterReq(device);
                
        if (NULL == pReq) {
            break;    
        }   
        
        pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0];
        A_ASSERT(pReqPriv != NULL);
        
        if (pReqPriv->busrequest != NULL) {
            pReqPriv->busrequest->pScatterReq = NULL;
                /* free bus request */
            hifFreeBusRequest(device, pReqPriv->busrequest);
            pReqPriv->busrequest = NULL;
        }
        
        if (pReqPriv->pHifScatterReq != NULL) {
            A_FREE(pReqPriv->pHifScatterReq);   
            pReqPriv->pHifScatterReq = NULL; 
        }
                
        A_FREE(pReqPriv);       
    }
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:34,代码来源:hif_scatter.c


示例5: BMIDone

int
BMIDone(struct hif_device *device)
{
    int status;
    u32 cid;

    if (bmiDone) {
        AR_DEBUG_PRINTF (ATH_DEBUG_BMI, ("BMIDone skipped\n"));
        return 0;
    }

    AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Enter (device: 0x%p)\n", device));
    bmiDone = true;
    cid = BMI_DONE;

    status = bmiBufferSend(device, (u8 *)&cid, sizeof(cid));
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }

    if (pBMICmdCredits) {
        A_FREE(pBMICmdCredits);
        pBMICmdCredits = NULL;
    }

    if (pBMICmdBuf) {
        A_FREE(pBMICmdBuf);
        pBMICmdBuf = NULL;
    }

    AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Exit\n"));

    return 0;
}
开发者ID:ARMP,项目名称:android_kernel_lge_x3,代码行数:35,代码来源:bmi.c


示例6: ar6000_cleanup_hci

void  ar6000_cleanup_hci(AR_SOFTC_T *ar)
#endif
{
#ifdef EXPORT_HCI_BRIDGE_INTERFACE
    AR6K_HCI_BRIDGE_INFO *pHcidevInfo = g_pHcidevInfo;
#else
    AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)ar->hcidev_info;
#endif
    
    if (pHcidevInfo != NULL) {
        bt_cleanup_hci(pHcidevInfo);   
        
        if (pHcidevInfo->pHCIDev != NULL) {
            HCI_TransportStop(pHcidevInfo->pHCIDev);
            HCI_TransportDetach(pHcidevInfo->pHCIDev);
            pHcidevInfo->pHCIDev = NULL;
        } 
        
        if (pHcidevInfo->pHTCStructAlloc != NULL) {
            A_FREE(pHcidevInfo->pHTCStructAlloc);
            pHcidevInfo->pHTCStructAlloc = NULL;    
        }
        
        A_FREE(pHcidevInfo);
#ifndef EXPORT_HCI_BRIDGE_INTERFACE
        ar->hcidev_info = NULL;
        ar->exitCallback = NULL;
#endif
    }
    
    
}
开发者ID:dalingrin,项目名称:android_system_wlan_atheros,代码行数:32,代码来源:hci_bridge.c


示例7: ncvargets

int
ncvargets(
    int		ncid,
    int		varid,
    const long*	start,
    const long*	count,
    const long*	stride,
    void*	value
)
{
	if(stride == NULL)
		return ncvarget(ncid, varid, start, count, value);
	/* else */
	{
	NDIMS_DECL
	A_DECL(stp, size_t, ndims, start);
	A_DECL(cntp, size_t, ndims, count);
	A_DECL(strdp, ptrdiff_t, ndims, stride);
	A_INIT(stp, size_t, ndims, start);
	A_INIT(cntp, size_t, ndims, count);
	A_INIT(strdp, ptrdiff_t, ndims, stride);
	{
	const int status = nc_get_vars(ncid, varid, stp, cntp, strdp, value);
	A_FREE(strdp);
	A_FREE(cntp);
	A_FREE(stp);
	if(status != NC_NOERR)
	{
		nc_advise("ncvargets", status, "ncid %d", ncid);
		return -1;
	}
	}
	return 0;
	}
}
开发者ID:stcorp,项目名称:harp,代码行数:35,代码来源:v2i.c


示例8: wlan_node_free

void
wlan_node_free(bss_t *ni)
{
    if (ni->ni_buf != NULL) {
        A_FREE(ni->ni_buf);
    }
    A_FREE(ni);
}
开发者ID:ArthySundaram,项目名称:firstrepo,代码行数:8,代码来源:wlan_node.c


示例9: hif_usb_remove

static void hif_usb_remove(struct usb_interface *interface)
{
	HIF_DEVICE_USB *device = usb_get_intfdata(interface);
	struct hif_usb_softc *sc = device->sc;
	struct ol_softc *scn;

	/* Attach did not succeed, all resources have been
	 * freed in error handler
	 */
	if (!sc)
		return;
	/* wait __hdd_wlan_exit until finished and no more than 4 seconds*/
	while(usb_sc->hdd_removed_processing == 1 &&
			usb_sc->hdd_removed_wait_cnt < 20) {
		set_current_state(TASK_INTERRUPTIBLE);
		schedule_timeout(msecs_to_jiffies(DELAY_INT_FOR_HDD_REMOVE));
		set_current_state(TASK_RUNNING);
		usb_sc->hdd_removed_wait_cnt ++;
	}
	/* do cold reset */
	HIFDiagWriteCOLDRESET(sc->hif_device);
	/* wait for target jump to boot code and finish the initialization */
	set_current_state(TASK_INTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(DELAY_FOR_TARGET_READY));
	set_current_state(TASK_RUNNING);
	if (usb_sc->local_state.event != 0) {
		hif_usb_resume(usb_sc->interface);
		usb_sc->local_state.event = 0;
	}
	unregister_reboot_notifier(&sc->reboot_notifier);
	usb_put_dev(interface_to_usbdev(interface));
	if (atomic_read(&hif_usb_unload_state) ==
			HIF_USB_UNLOAD_STATE_DRV_DEREG)
		atomic_set(&hif_usb_unload_state,
			   HIF_USB_UNLOAD_STATE_TARGET_RESET);
	scn = sc->ol_sc;

	if (usb_sc->hdd_removed == 0) {
		usb_sc->hdd_removed_processing = 1;
#ifndef REMOVE_PKT_LOG
	if (vos_get_conparam() != VOS_FTM_MODE &&
		!WLAN_IS_EPPING_ENABLED(vos_get_conparam()))
		pktlogmod_exit(scn);
#endif
		__hdd_wlan_exit();
		usb_sc->hdd_removed_processing = 0;
		usb_sc->hdd_removed = 1;
	}
	hif_nointrs(sc);
	HIF_USBDeviceDetached(interface, 1);
	A_FREE(scn);
	A_FREE(sc);
	usb_sc = NULL;
	pr_info("hif_usb_remove!!!!!!\n");
}
开发者ID:benschhold,项目名称:android_kernel_oneplus_msm8994_custom,代码行数:55,代码来源:if_usb.c


示例10: BMICleanup

void
BMICleanup(void)
{
    if (pBMICmdCredits) {
        A_FREE(pBMICmdCredits);
        pBMICmdCredits = NULL;
    }

    if (pBMICmdBuf) {
        A_FREE(pBMICmdBuf);
        pBMICmdBuf = NULL;
    }
}
开发者ID:ARMP,项目名称:android_kernel_lge_x3,代码行数:13,代码来源:bmi.c


示例11: BMICleanup

void
BMICleanup(void)
{
    if (pBMICmdCredits) {
        A_FREE(pBMICmdCredits, MALLOC_ID_TEMPORARY);
        pBMICmdCredits = NULL;
    }

    if (pBMICmdBuf) {
        A_FREE(pBMICmdBuf, MALLOC_ID_TEMPORARY);
        pBMICmdBuf = NULL;
    }
}
开发者ID:BillyZhangZ,项目名称:wifi,代码行数:13,代码来源:bmi.c


示例12: BMICleanup

void
BMICleanup(void)
{
#if 0
    if (pBMICmdCredits) {
        A_FREE(pBMICmdCredits);
        pBMICmdCredits = NULL;
    }
#endif

    if (pBMICmdBuf) {
        A_FREE(pBMICmdBuf);
        pBMICmdBuf = NULL;
    }
}
开发者ID:fread-ink,项目名称:fread-kernel-k4,代码行数:15,代码来源:bmi.c


示例13: wlan_node_free

void
wlan_node_free(bss_t *ni)
{
    if (ni->ni_buf != NULL) {
        A_FREE(ni->ni_buf);
        ni->ni_buf = NULL;
    }
#ifdef P2P
    if (ni->p2p_dev) {
        p2p_device_free(ni->p2p_dev);
    }
#endif /* P2P */
    A_FREE(ni);
    ni = NULL;
}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:15,代码来源:wlan_node.c


示例14: cmp_model_reload

void cmp_model_reload(const char* filepath, reshandle_t hdl, int manual)
{
    reshandle_t nhdl;
    uint cnt;
    struct allocator* tmp_alloc = tsk_get_tmpalloc(0);
    cmp_t c = cmp_findtype(cmp_model_type);
    const struct cmp_instance_desc** insts = cmp_get_allinstances(c, &cnt, tmp_alloc);

    /* reload model and refresh all model component data */
    cmp_model_destroyinstances(hdl, insts, cnt);

    if (!manual)
        nhdl = rs_load_model(filepath, RS_LOAD_REFRESH);
    else
        nhdl = hdl;

    if (nhdl != INVALID_HANDLE) {
        if (rs_get_model(nhdl) != NULL)
            cmp_model_rebuildhinstances(eng_get_dataalloc(), tmp_alloc, hdl, insts, cnt);
        else
            cmp_model_clearinstances(hdl, insts, cnt, FALSE);
    }    else   {
        cmp_model_clearinstances(hdl, insts, cnt, TRUE);  /* this happens when model-reload fails
                                                             we have to invalidate handles */
    }

    A_FREE(tmp_alloc, insts);
}
开发者ID:septag,项目名称:darkhammer,代码行数:28,代码来源:cmp-model.c


示例15: A_MEMZERO

static HTC_PACKET *BuildHTCTxCtrlPacket(adf_os_device_t osdev)
{
    HTC_PACKET *pPacket = NULL;
    adf_nbuf_t netbuf;

    do {
        pPacket = (HTC_PACKET *)A_MALLOC(sizeof(HTC_PACKET));
        if (NULL == pPacket) {
            break;
        }
        A_MEMZERO(pPacket,sizeof(HTC_PACKET));
#ifdef ATH_USE_NCNB
        netbuf = adf_nbuf_alloc_ncnb(osdev, HTC_CONTROL_BUFFER_SIZE, 20, 4, TRUE);
#else
        netbuf = adf_nbuf_alloc(osdev, HTC_CONTROL_BUFFER_SIZE, 20, 4, TRUE);
#endif
        if (NULL == netbuf) {
            A_FREE(pPacket);
            pPacket = NULL;
	        adf_os_print("%s: nbuf alloc failed\n",__func__);
            break;
        }
        AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("alloc ctrl netbuf :0x%p \n", netbuf));
        SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf);
    } while (FALSE);

    return pPacket;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:28,代码来源:htc.c


示例16: write_bdaddr

A_STATUS write_bdaddr(AR3K_CONFIG_INFO *pConfig,A_UCHAR *bdaddr,int type)
{
	A_UCHAR bdaddr_cmd[] = { 0x0B, 0xFC, 0x0A, 0x01, 0x01, 
							0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

    A_UINT8 *event;
    A_UINT8 *bufferToFree = NULL;
    A_STATUS result = A_ERROR;
	int inc,outc;

	if (type == BDADDR_TYPE_STRING)
		str2ba(bdaddr,&bdaddr_cmd[7]);
	else {
		/* Bdaddr has to be sent as LAP first */
		for(inc = 5 ,outc = 7; inc >=0; inc--, outc++)
			bdaddr_cmd[outc] = bdaddr[inc];
	}

    if(A_OK == SendHCICommandWaitCommandComplete(pConfig,bdaddr_cmd,
												sizeof(bdaddr_cmd),
												&event,&bufferToFree)) {

        if(event[4] == 0xFC && event[5] == 0x00){
               if(event[3] == 0x0B){
                result = A_OK;
            }
        }

    }
    if(bufferToFree != NULL) {
        A_FREE(bufferToFree);
   }
    return result;

}
开发者ID:ArthySundaram,项目名称:firstrepo,代码行数:35,代码来源:ar3kpsconfig.c


示例17: write_bdaddr

A_STATUS write_bdaddr(AR3K_CONFIG_INFO *pConfig,A_UCHAR *bdaddr)
{
	A_UCHAR bdaddr_cmd[] = { 0x0B, 0xFC, 0x0A, 0x01, 0x01, 
							0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
    A_UINT8 *event;
    A_UINT8 *bufferToFree = NULL;
    A_STATUS result = A_ERROR;
	
	str2ba(bdaddr,&bdaddr_cmd[7]);

    if(A_OK == SendHCICommandWaitCommandComplete(pConfig,bdaddr_cmd,
												sizeof(bdaddr_cmd),
												&event,&bufferToFree)) {

        if(event[4] == 0xFC && event[5] == 0x00){
               if(event[3] == 0x0B){
                result = A_OK;
            }
        }

    }
    if(bufferToFree != NULL) {
        A_FREE(bufferToFree);
   }
    return result;

}
开发者ID:AvalueAES,项目名称:rev-sa01,代码行数:27,代码来源:ar3kpsconfig.c


示例18: wlan_node_buf_update

/* Update the buffer alone, not the entire node.
 * This involves,
 * 1) Freeing the buffer alone.
 * 2) Allocating a new buffer
 * 3) Update the node timestamp with the current time.
 */
A_STATUS
wlan_node_buf_update(struct ieee80211_node_table *nt, bss_t *ni, A_UINT32 len)
{
    IEEE80211_NODE_LOCK(nt);

    /* Free the ni_buf alone.
     */
    if (ni->ni_buf != NULL) {
        A_FREE(ni->ni_buf);
        ni->ni_buf = NULL;
    }

    /* Allocate ni_buf for the new length.
     */
    if (len) {
        ni->ni_buf = A_MALLOC_NOWAIT(len);
        if (ni->ni_buf == NULL) {
            IEEE80211_NODE_UNLOCK(nt);
            return A_ERROR;
        } else {
            A_MEMZERO(ni->ni_buf, len);
        }
    }

    /* Update the Node's timestamp.
     */
    wlan_node_update_timestamp(nt, ni);

    IEEE80211_NODE_UNLOCK(nt);

    return A_OK;
}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:38,代码来源:wlan_node.c


示例19: model_unloadocc

void model_unloadocc(struct gfx_model_occ* occ, struct allocator* alloc)
{
    if (occ->indexes != NULL)
        A_FREE(alloc, occ->indexes);
    if (occ->poss != NULL)
        A_ALIGNED_FREE(alloc, occ->poss);
}
开发者ID:septag,项目名称:darkhammer,代码行数:7,代码来源:gfx-model.c


示例20: Abf_WlanStackNotificationDeInit

void
Abf_WlanStackNotificationDeInit(ATH_BT_FILTER_INSTANCE *pInstance)
{
    ATHBT_FILTER_INFO *pInfo = (ATHBT_FILTER_INFO *)pInstance->pContext;
    ABF_WLAN_INFO *pAbfWlanInfo = pInfo->pWlanInfo;

    if (!pAbfWlanInfo) return;

    /* Terminate and wait for the WLAN Event Handler task to finish */
    A_MUTEX_LOCK(&pAbfWlanInfo->hWaitEventLock);
    if (pAbfWlanInfo->Loop) {
        pAbfWlanInfo->Loop = FALSE;
        A_COND_WAIT(&pAbfWlanInfo->hWaitEvent, &pAbfWlanInfo->hWaitEventLock, 
                    WAITFOREVER);
    }
    A_MUTEX_UNLOCK(&pAbfWlanInfo->hWaitEventLock);

    /* Flush all the BT actions from the filter core */
    HandleAdapterEvent(pInfo, ATH_ADAPTER_REMOVED);
    pInfo->pWlanInfo = NULL;
    A_MUTEX_DEINIT(&pAbfWlanInfo->hWaitEventLock);
    A_COND_DEINIT(&pAbfWlanInfo->hWaitEvent);
    A_MEMZERO(pAbfWlanInfo, sizeof(ABF_WLAN_INFO));
    A_FREE(pAbfWlanInfo);

    A_INFO("WLAN Stack Notification de-init complete\n");
}
开发者ID:Ar3kkusu,项目名称:AR6kSDK.3.1,代码行数:27,代码来源:abtfilt_wlan.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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