本文整理汇总了C++中Memory_free函数的典型用法代码示例。如果您正苦于以下问题:C++ Memory_free函数的具体用法?C++ Memory_free怎么用?C++ Memory_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Memory_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ti_sdo_ipc_Notify_Instance_finalize
/*
* ======== ti_sdo_ipc_Notify_Instance_finalize ========
*/
Void ti_sdo_ipc_Notify_Instance_finalize(ti_sdo_ipc_Notify_Object *obj,
Int status)
{
UInt i;
UInt16 clusterId = ti_sdo_utils_MultiProc_getClusterId(obj->remoteProcId);
switch (status) {
case 0:
/* Unregister the notify instance from the Notify module */
Notify_module->notifyHandles[clusterId][obj->lineId] = NULL;
/* Destruct the event lists */
for (i = 0; i < ti_sdo_ipc_Notify_numEvents; i++) {
List_destruct(List_struct(List_Object_get(obj->eventList, i)));
}
/* Free memory used for the List.Objects */
Memory_free(ti_sdo_ipc_Notify_Object_heap(), obj->eventList,
sizeof(List_Struct) * ti_sdo_ipc_Notify_numEvents);
/* OK to fall through */
case 1:
/* Free memory used for callbacks array */
Memory_free(ti_sdo_ipc_Notify_Object_heap(), obj->callbacks,
sizeof(ti_sdo_ipc_Notify_EventCallback) *
ti_sdo_ipc_Notify_numEvents);
}
}
示例2: Darray_destroy
NORET Darray_destroy(Darray dyn_ary)
{
Darray_rep *temp = dlower(dyn_ary);
Memory_free((VOIDP)temp->storage);
Memory_free((VOIDP)temp);
}
示例3: appTaskFxn
Void appTaskFxn(UArg arg0, UArg arg1)
{
char* args[8];
//arg[0] is 2 chars for dev type
args[0] = Memory_alloc(NULL, 2 * sizeof(char), 0, NULL);
//arg[1] is 3 chars for channel num
args[1] = Memory_alloc(NULL, 3 * sizeof(char), 0, NULL);
//init the RPC queue
rpcInitMq();
//init the application thread to register the callbacks
appInit();
consolePrint(
"Enter device type c: Coordinator, r: Router, e: End Device:\n");
consoleGetLine(args[0], 8);
consolePrint("Enter channel 11-26:\n");
consoleGetLine(args[1], 8);
while (1)
{
appProcess(args);
Task_sleep(10);
}
Memory_free(NULL, args[0], 2 * sizeof(char));
Memory_free(NULL, args[1], 3 * sizeof(char));
}
示例4: LoggerBuf_Instance_finalize
/*
* ======== LoggerBuf_Instance_finalize ========
*/
Void LoggerBuf_Instance_finalize(LoggerBuf_Object *obj, Int status)
{
if (obj->entryArr != NULL) {
Memory_free(obj->bufHeap, obj->entryArr,
obj->numEntries * sizeof (LoggerBuf_Entry));
}
}
示例5: do_memoryAlloc
static int do_memoryAlloc(CodecEngine* _ce, size_t _srcBufferSize, size_t _dstBufferSize)
{
memset(&_ce->m_allocParams, 0, sizeof(_ce->m_allocParams));
_ce->m_allocParams.type = Memory_CONTIGPOOL;
_ce->m_allocParams.flags = Memory_CACHED;
_ce->m_allocParams.align = BUFALIGN;
_ce->m_allocParams.seg = 0;
_ce->m_srcBufferSize = ALIGN_UP(_srcBufferSize, BUFALIGN);
if ((_ce->m_srcBuffer = Memory_alloc(_ce->m_srcBufferSize, &_ce->m_allocParams)) == NULL)
{
fprintf(stderr, "Memory_alloc(src, %zu) failed\n", _ce->m_srcBufferSize);
_ce->m_srcBufferSize = 0;
return ENOMEM;
}
_ce->m_dstBufferSize = ALIGN_UP(_dstBufferSize, BUFALIGN);
if ((_ce->m_dstBuffer = Memory_alloc(_ce->m_dstBufferSize, &_ce->m_allocParams)) == NULL)
{
fprintf(stderr, "Memory_alloc(dst, %zu) failed\n", _ce->m_dstBufferSize);
_ce->m_dstBufferSize = 0;
Memory_free(_ce->m_srcBuffer, _ce->m_srcBufferSize, &_ce->m_allocParams);
_ce->m_srcBuffer = NULL;
_ce->m_srcBufferSize = 0;
return ENOMEM;
}
return 0;
}
示例6: MessageQ_free
/*
* ======== MessageQ_free ========
*/
Int MessageQ_free(MessageQ_Msg msg)
{
IHeap_Handle heap;
/* make sure msg is not NULL */
Assert_isTrue((msg != NULL), ti_sdo_ipc_MessageQ_A_invalidMsg);
/* Cannot free a message that was initialized via MessageQ_staticMsgInit */
Assert_isTrue((msg->heapId != ti_sdo_ipc_MessageQ_STATICMSG),
ti_sdo_ipc_MessageQ_A_cannotFreeStaticMsg);
Assert_isTrue((msg->heapId < MessageQ_module->numHeaps),
ti_sdo_ipc_MessageQ_A_heapIdInvalid);
Assert_isTrue((MessageQ_module->heaps[msg->heapId] != NULL),
ti_sdo_ipc_MessageQ_A_heapIdInvalid);
if ((ti_sdo_ipc_MessageQ_traceFlag == TRUE) ||
(msg->flags & ti_sdo_ipc_MessageQ_TRACEMASK) != 0) {
Log_write3(ti_sdo_ipc_MessageQ_LM_free, (UArg)(msg),
(UArg)(msg->seqNum), (UArg)(msg->srcProc));
}
heap = MessageQ_module->heaps[msg->heapId];
if (heap != NULL) {
Memory_free(heap, msg, msg->msgSize);
}
else {
return (MessageQ_E_FAIL);
}
return (MessageQ_S_SUCCESS);
}
示例7: Power_unregisterConstraint
/*
* ======== Power_unregisterConstraint ========
* Unregister for a power notification.
*
*/
Power_Status Power_unregisterConstraint(Power_ConstraintHandle handle)
{
Power_Status status = Power_SOK;
Power_Constraint type;
UInt key;
/* check for NULL constraintHandle */
if (handle == NULL) {
status = Power_EINVALIDHANDLE;
}
/* else, remove and delete constraint object, update aggregate constraint */
else {
key = Hwi_disable();
Queue_remove((Queue_Elem *)handle);
Hwi_restore(key);
/* recompute aggregate constraint w/absence of removed constraint */
type = ((Power_ConstraintObj *) handle)->type;
Power_rebuildConstraint(type);
/* free the constraint object */
Memory_free(Power_Object_heap(), handle, sizeof(Power_ConstraintObj));
}
return (status);
}
示例8: Algorithm_delete
/*
* ======== Algorithm_delete ========
*/
Void Algorithm_delete(Algorithm_Handle alg)
{
Algorithm_Obj *pObject = (Algorithm_Obj *)alg;
IRES_Status status;
Log_print1(Diags_ENTRY, "[+E] Algorithm_delete> Enter(alg=0x%x)",
(IArg)alg);
if (pObject != NULL) {
if (pObject->iresFxns) {
/* Call RMAN fuction to free resources */
status = RMAN_freeResources(pObject->alg, pObject->iresFxns,
pObject->groupId);
if (status != IRES_OK) {
Log_print1(Diags_USER7, "[+7] Algorithm_delete> Freeing "
"of alg resources through RMAN FAILED (0x%x)",
(IArg)status);
}
}
if (pObject->alg) {
DSKT2_freeAlg(pObject->groupId, pObject->alg);
}
Memory_free(pObject, sizeof (*pObject), NULL);
}
Log_print0(Diags_EXIT, "[+X] Algorithm_delete> Exit");
}
示例9: Algorithm_delete
/*
* ======== Algorithm_delete ========
*/
Void Algorithm_delete(Algorithm_Handle alg)
{
Algorithm_Obj *pObject = (Algorithm_Obj *)alg;
IRES_Status status;
Log_print1(Diags_ENTRY, "[+E] Algorithm_delete> Enter(alg=0x%x)",
(IArg)alg);
if (pObject != NULL) {
if (pObject->iresFxns) {
/* Call RMAN fuction to free resources */
status = RMAN_freeResources(pObject->alg, pObject->iresFxns,
pObject->groupId);
if (status != IRES_OK) {
Log_print1(Diags_USER7, "[+7] Algorithm_delete> Freeing "
"of alg resources through RMAN FAILED (0x%x)",
(IArg)status);
}
}
if (pObject->idma3Fxns) {
Log_print0(Diags_USER4, "[+4] Algorithm_delete> releasing "
"DMA resources");
DMAN3_releaseDmaChannels(&(pObject->alg), &(pObject->idma3Fxns),1);
}
if (pObject->alg) {
ALG_delete(pObject->groupId, pObject->alg, pObject->useCachedMem);
}
Memory_free(pObject, sizeof (*pObject), NULL);
}
Log_print0(Diags_EXIT, "[+X] Algorithm_delete> Exit");
}
示例10: _XdmServer_freeXdaisAlgMemory
void _XdmServer_freeXdaisAlgMemory(IALG_MemRec memTab[], Int numRecs)
{
Int idx;
uint8_t *handle;
uint8_t *RPE_dspIramHeapHandle = globaL2heap;
for (idx = 0; idx < numRecs; idx++)
{
if (memTab[idx].base != NULL)
{
if ( memTab[idx].space > IALG_SARAM2 )
{
handle = RPE_dspAlgHeapHandle;
}
else
{
handle = RPE_dspIramHeapHandle;
}
/* Freeing a buffer of size 0 is not possible, so we allocate */
/* 8 bytes during creation. This is taken care during deletion */
if (memTab[idx].size == 0)
{
memTab[idx].size = 8;
}
Memory_free ((IHeap_Handle) handle, memTab[idx].base, memTab[idx].size);
}
}
return;
}
示例11: MEM_increaseTableSize
/*
* ======== MEM_increaseTableSize ========
*/
Int MEM_increaseTableSize(Uns numEntries)
{
IArg key;
IHeap_Handle *tmpTable;
Error_Block eb;
Error_init(&eb);
/* Use HeapMem's gate for thread-safety */
key = HeapMem_enter();
tmpTable = Memory_calloc(MEM_table[0],
(MEM_tabSize + numEntries) * sizeof(IHeap_Handle), 0, NULL);
if (tmpTable == NULL) {
HeapMem_leave(key);
return (SYS_EALLOC);
}
memcpy(tmpTable, MEM_table, MEM_tabSize * sizeof(IHeap_Handle));
if ((MEM_tabSize != 0) && (staticTable != TRUE)) {
Memory_free(MEM_table[0], MEM_table, MEM_tabSize * sizeof(IHeap_Handle));
}
staticTable = FALSE;
MEM_table = tmpTable;
MEM_tabSize += numEntries;
HeapMem_leave(key);
return (SYS_OK);
}
示例12: Buffer_copy
/******************************************************************************
* Buffer_copy
******************************************************************************/
Int Buffer_copy(Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
{
assert(hSrcBuf);
assert(hDstBuf);
assert(hSrcBuf->type == Buffer_Type_BASIC ||
hSrcBuf->type == Buffer_Type_GRAPHICS);
if(hSrcBuf->type != hDstBuf->type) {
Dmai_err1("Cannot copy to Buffer type (%d)\n", hDstBuf->type);
return Dmai_EFAIL;
}
if (!hDstBuf->reference && hDstBuf->userPtr) {
Dmai_dbg3("Free Buffer of size %u at 0x%x (0x%x phys)\n",
(Uns) hDstBuf->origState.numBytes,
(Uns) hDstBuf->userPtr,
(Uns) hDstBuf->physPtr);
if (!Memory_free(hDstBuf->userPtr, hDstBuf->origState.numBytes,
&hDstBuf->memParams)) {
return Dmai_EFAIL;
}
}
if(hSrcBuf->type == Buffer_Type_GRAPHICS) {
*(_BufferGfx_Object *) hDstBuf = *(_BufferGfx_Object *) hSrcBuf;
} else {
*(_Buffer_Object *) hDstBuf = *(_Buffer_Object *) hSrcBuf;
}
hDstBuf->reference = TRUE;
return Dmai_EOK;
}
示例13: NODE_delete
/*
* ======== NODE_delete ========
*/
Int NODE_delete(NODE_Handle node)
{
Void *handle;
/* Should be a DBC_requires */
Assert_isTrue(node != NULL, (Assert_Id)NULL);
Assert_isTrue(node->skelFxns != NULL, (Assert_Id)NULL);
Assert_isTrue(node->skelFxns->apiDestroy != NULL, (Assert_Id)NULL);
/* delete thread *before* destroying node to ensure thread has no access
* to node as we are freeing it
*/
if (node->self) {
Log_print1(Diags_ENTRY, "[+E] NODE_delete(0x%x)", (IArg)node);
Thread_delete(&(node->self));
}
handle = NODE_getEnv(node);
if (handle) {
node->skelFxns->apiDestroy(handle);
}
if (node->recv != Comm_INVALIDHANDLE) {
Comm_delete(node->recv);
}
Memory_free(NULL, node, sizeof(NODE_Obj));
return (NODE_EOK);
}
示例14: SystemCfg_deleteResources
Int SystemCfg_deleteResources(SystemCfg_Object *obj)
{
IHeap_Handle heapH;
Int status = 0;
Log_print1(Diags_ENTRY | Diags_INFO, "--> "FXNN": (obj=0x%x)",(IArg)obj);
/* delete opencl buffer heap */
// HeapBufMP_delete(&obj->openclHeapH);
/* unregister rcm message heap with MessageQ */
MessageQ_unregisterHeap(SystemCfg_RcmMsgHeapId_CompDev);
/* delete rcm message heap instance */
HeapBuf_delete(&obj->rcmHeapH);
/* free the rcm message heap storage */
heapH = (IHeap_Handle)SharedRegion_getHeap(0);
Memory_free(heapH, obj->rcmHeapBufBase, obj->rcmHeapBufSize);
obj->rcmHeapBufBase = NULL;
obj->rcmHeapBufSize = 0;
Log_print1(Diags_EXIT, "<-- "FXNN": %d", (IArg)status);
return(status);
}
示例15: OMAPL1XX_halExit
/*!
* @brief Function to finalize the HAL object
*
* @param halObj Pointer to the HAL object
*
* @sa OMAPL1XX_halInit
* OMAPL1XX_phyShmemExit
*/
Int
OMAPL1XX_halExit (Ptr halObj)
{
Int status = PROCESSOR_SUCCESS;
OMAPL1XX_HalObject * halObject = NULL;
GT_1trace (curTrace, GT_ENTER, "OMAPL1XX_halExit", halObj);
GT_assert (curTrace, (halObj != NULL));
halObject = (OMAPL1XX_HalObject *) halObj ;
status = OMAPL1XX_phyShmemExit (halObj);
#if !defined(SYSLINK_BUILD_OPTIMIZE)
if (status < 0) {
GT_setFailureReason (curTrace,
GT_4CLASS,
"OMAPL1XX_halExit",
status,
"OMAPL1XX_phyShmemExit failed!");
}
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
if (halObj != NULL) {
/* Free the memory for the HAL object. */
Memory_free (NULL, halObj, sizeof (OMAPL1XX_HalObject));
}
GT_1trace (curTrace, GT_LEAVE, "OMAPL1XX_halExit", status);
/*! @retval PROCESSOR_SUCCESS Operation successful */
return status;
}