mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-14 18:38:55 +00:00
V1.0.6
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2023, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* author: <qi.xu@artinchip.com>
|
||||
* Desc: log module
|
||||
* Author: <qi.xu@artinchip.com>
|
||||
* Desc: log module
|
||||
*/
|
||||
|
||||
#ifndef MPP_LOG_H
|
||||
@@ -61,6 +61,11 @@ enum log_level {
|
||||
#define logd(fmt, arg...) mpp_log(MPP_LOGL_DEBUG, TAG_DEBUG, fmt, ##arg)
|
||||
#define logv(fmt, arg...) mpp_log(MPP_LOGL_VERBOSE, TAG_VERBOSE, fmt, ##arg)
|
||||
|
||||
#define mpp_assert(cond) do { \
|
||||
if (!(cond)) { \
|
||||
loge("Assertion failed!"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define time_start(tag) unsigned int time_##tag##_start = aic_get_time_us()
|
||||
#define time_end(tag) unsigned int time_##tag##_end = aic_get_time_us();\
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2023, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* author: <qi.xu@artinchip.com>
|
||||
* Desc: virtual memory allocator
|
||||
* Author: <qi.xu@artinchip.com>
|
||||
* Desc: virtual memory allocator
|
||||
*/
|
||||
|
||||
#ifndef MPP_MEM_H
|
||||
@@ -26,6 +26,8 @@ void mpp_free(void *ptr);
|
||||
|
||||
#define mpp_alloc(len) _mpp_alloc_(len,__FILE__,__LINE__)
|
||||
|
||||
void *mpp_realloc(void *ptr,size_t size);
|
||||
|
||||
unsigned int mpp_phy_alloc(size_t size);
|
||||
void mpp_phy_free(unsigned int addr);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2022-2023, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* author: qi.xu@artinchip.com
|
||||
* Desc: virtual memory allocator
|
||||
* Author: qi.xu@artinchip.com
|
||||
* Desc: virtual memory allocator
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -40,7 +40,7 @@ void *_mpp_alloc_(size_t len,const char *file,int line)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
ptr = aicos_malloc(MEM_DEFAULT, len);
|
||||
ptr = malloc(len);
|
||||
|
||||
#if DEBUG_MEM
|
||||
int i;
|
||||
@@ -78,7 +78,7 @@ void mpp_free(void *ptr)
|
||||
if(ptr == NULL)
|
||||
return;
|
||||
|
||||
aicos_free(MEM_DEFAULT, ptr);
|
||||
free(ptr);
|
||||
|
||||
#if DEBUG_MEM
|
||||
int i;
|
||||
@@ -103,6 +103,11 @@ void mpp_free(void *ptr)
|
||||
#endif
|
||||
}
|
||||
|
||||
void *mpp_realloc(void *ptr,size_t size)
|
||||
{
|
||||
return realloc(ptr,size);
|
||||
}
|
||||
|
||||
void show_mem_info_debug()
|
||||
{
|
||||
#if DEBUG_MEM
|
||||
|
||||
Reference in New Issue
Block a user