2014-11-19 00:06:40 +08:00
|
|
|
|
#ifndef ACL_ALLOCATOR_INCLUDE_H
|
|
|
|
|
#define ACL_ALLOCATOR_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ACL_PREPARE_COMPILE
|
|
|
|
|
#include "acl_define.h"
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
ACL_MEM_TYPE_NONE,
|
|
|
|
|
ACL_MEM_TYPE_8_BUF,
|
|
|
|
|
ACL_MEM_TYPE_16_BUF,
|
|
|
|
|
ACL_MEM_TYPE_32_BUF,
|
|
|
|
|
ACL_MEM_TYPE_64_BUF,
|
|
|
|
|
ACL_MEM_TYPE_128_BUF,
|
|
|
|
|
ACL_MEM_TYPE_256_BUF,
|
|
|
|
|
ACL_MEM_TYPE_512_BUF,
|
|
|
|
|
ACL_MEM_TYPE_1K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_2K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_4K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_8K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_16K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_32K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_64K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_128K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_256K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_512K_BUF,
|
|
|
|
|
ACL_MEM_TYPE_1M_BUF,
|
|
|
|
|
ACL_MEM_TYPE_VSTRING,
|
|
|
|
|
ACL_MEM_TYPE_MAX
|
|
|
|
|
} acl_mem_type;
|
|
|
|
|
|
|
|
|
|
typedef struct ACL_MEM_POOL ACL_MEM_POOL;
|
|
|
|
|
typedef struct ACL_ALLOCATOR ACL_ALLOCATOR;
|
|
|
|
|
|
|
|
|
|
/* in acl_mpool.c */
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param mem_limit {size_t} <EFBFBD>ڴ<EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ棬<EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
* @return {ACL_ALLOCATOR *} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_ALLOCATOR *acl_allocator_create(size_t mem_limit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>һЩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD>ĵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|
|
|
|
* acl_allocator_ctl(ACL_ALLOCATOR_CTL_MIN_SIZE, 128,
|
|
|
|
|
* ACL_ALLOCATOR_CTL_MAX_SIZE, 1024,
|
|
|
|
|
* ACL_ALLOCATOR_CTL_END);
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_ctl(int name, ...);
|
|
|
|
|
|
|
|
|
|
#define ACL_ALLOCATOR_CTL_END 0 /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_ALLOCATOR_CTL_MIN_SIZE 1 /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> */
|
|
|
|
|
#define ACL_ALLOCATOR_CTL_MAX_SIZE 2 /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param mem_limit {size_t} <EFBFBD>ڴ<EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_config(ACL_ALLOCATOR *allocator, size_t mem_limit);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_free(ACL_ALLOCATOR *allocator);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param label {const char*} <EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
* @param obj_size {size_t} ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵Ĵ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param after_alloc_fn {void (*)(void*, void*)} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param before_free_fn {void (*)(void*, void*)} <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD>ǰ<EFBFBD>ص<EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param pool_ctx {void*} Ӧ<EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> after_alloc_fn <EFBFBD><EFBFBD> before_free_fn
|
|
|
|
|
* <EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>Ӵ<EFBFBD><EFBFBD>ݸ<EFBFBD>Ӧ<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_MEM_POOL*} <EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_MEM_POOL *acl_allocator_pool_add(ACL_ALLOCATOR *allocator,
|
|
|
|
|
const char *label,
|
|
|
|
|
size_t obj_size,
|
|
|
|
|
acl_mem_type type,
|
|
|
|
|
void (*after_alloc_fn)(void *obj, void *pool_ctx),
|
|
|
|
|
void (*before_free_fn)(void *obj, void *pool_ctx),
|
|
|
|
|
void *pool_ctx);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param pool {ACL_MEM_POOL*} <EFBFBD><EFBFBD> acl_allocatore_pool_add <EFBFBD><EFBFBD><EFBFBD>صĶ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_pool_remove(ACL_ALLOCATOR *allocator, ACL_MEM_POOL *pool);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ̽<EFBFBD><EFBFBD>ij<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int}, 0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>!= 0: <EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_allocator_pool_ifused(ACL_ALLOCATOR *allocator, acl_mem_type type);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ij<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD>ʹ<EFBFBD>õĸ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_allocator_pool_inuse_count(ACL_ALLOCATOR *allocator, acl_mem_type type);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ij<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>е<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} ij<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>е<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_allocator_pool_inuse_size(ACL_ALLOCATOR *allocator, acl_mem_type type);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>Ĵ<EFBFBD>С
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @return {int} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_allocator_pool_total_allocated(ACL_ALLOCATOR *allocator);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {void*} <EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void *acl_allocator_mem_alloc(ACL_ALLOCATOR *allocator, acl_mem_type type);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ͷ<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param type {acl_mem_type} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param obj {void*} <EFBFBD><EFBFBD><EFBFBD>ͷŵ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_mem_free(ACL_ALLOCATOR *allocator, acl_mem_type type, void *obj);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD> acl_mymalloc <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param filename {const char*} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param line {int} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD>к<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param size {size_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @return {void*} <EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void *acl_allocator_membuf_alloc(const char *filename, int line,
|
|
|
|
|
ACL_ALLOCATOR *allocator, size_t size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ䣬<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> acl_mymalloc <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param filename {const char*} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param line {int} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD>к<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param oldbuf {void*} ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
* @param size {size_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @return {void*} <EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void *acl_allocator_membuf_realloc(const char *filename, int line,
|
|
|
|
|
ACL_ALLOCATOR *allocator, void *oldbuf, size_t size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>ô<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>壬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* acl_myfree <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
|
|
|
|
* @param filename {const char*} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param line {int} <EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ǰ<EFBFBD>ļ<EFBFBD><EFBFBD>к<EFBFBD>
|
|
|
|
|
* @param allocator {ACL_ALLOCATOR*}
|
|
|
|
|
* @param buf {void*} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_allocator_membuf_free(const char *filename, int line,
|
|
|
|
|
ACL_ALLOCATOR *allocator, void *buf);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|