2023-08-30 16:21:18 +08:00
|
|
|
/*
|
2024-09-03 11:16:08 +08:00
|
|
|
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
|
2023-08-30 16:21:18 +08:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
2024-09-03 11:16:08 +08:00
|
|
|
* Author: <qi.xu@artinchip.com>
|
|
|
|
|
* Desc: virtual memory allocator
|
2023-08-30 16:21:18 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef MPP_MEM_H
|
|
|
|
|
#define MPP_MEM_H
|
|
|
|
|
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-04-03 16:40:57 +08:00
|
|
|
void *_mpp_alloc_(size_t len,const char *file,int line);
|
|
|
|
|
|
|
|
|
|
void show_mem_info_debug();
|
|
|
|
|
|
2023-08-30 16:21:18 +08:00
|
|
|
void mpp_free(void *ptr);
|
|
|
|
|
|
2024-04-03 16:40:57 +08:00
|
|
|
#define mpp_alloc(len) _mpp_alloc_(len,__FILE__,__LINE__)
|
|
|
|
|
|
2024-09-03 11:16:08 +08:00
|
|
|
void *mpp_realloc(void *ptr,size_t size);
|
|
|
|
|
|
2023-08-30 16:21:18 +08:00
|
|
|
unsigned int mpp_phy_alloc(size_t size);
|
|
|
|
|
void mpp_phy_free(unsigned int addr);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* MEM_H */
|