mirror of
https://gitee.com/apaki/unicstl.git
synced 2026-05-29 07:04:20 +08:00
- 新增 mempool 模块用于统计内存分配次数并检测泄漏 - 启用 UNICSTL_MALLOC_CUSTOM 宏以接管标准库内存函数 - 修复 segarray 销毁时未释放 _mapfree 导致的内存泄漏 - 修复 darray 迭代器 next 方法中错误的对象访问方式 - 调整 segarray 不支持外部缓存 - 修复测试用例中未释放 arraylist 导致的误报
27 lines
522 B
C
27 lines
522 B
C
/**
|
|
* @file mempool.h
|
|
* @author wenjf (Orig5826@163.com)
|
|
* @brief
|
|
* @version 0.1
|
|
* @date 2026-05-17
|
|
*
|
|
* @copyright Copyright (c) 2026
|
|
*
|
|
*/
|
|
#ifndef _MEMPOOL_H_
|
|
#define _MEMPOOL_H_
|
|
|
|
#include "unicstl_internal.h"
|
|
|
|
#ifdef UNICSTL_MALLOC_CUSTOM
|
|
extern void *unicstl_malloc(size_t size);
|
|
extern void *unicstl_calloc(size_t num, size_t size);
|
|
extern void *unicstl_realloc(void *ptr, size_t size);
|
|
extern void unicstl_free(void *ptr);
|
|
#endif
|
|
|
|
void mempool_init(void);
|
|
void mempool_deinit(void);
|
|
|
|
#endif // _MEMPOOL_H_
|