XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
objcache.h
浏览该文件的文档.
1
13#ifndef __xwos_mm_mempool_objcache_h__
14#define __xwos_mm_mempool_objcache_h__
15
16#include <xwos/standard.h>
17#include <xwos/lib/xwbop.h>
18#include <xwos/lib/bclst.h>
20#include <xwos/mm/common.h>
21
30
37 const char * name;
54 struct {
55 struct xwlib_bclst_head full;
56 struct xwlib_bclst_head available;
57 struct xwlib_bclst_head idle;
58 struct xwos_sqlk lock;
60};
61
78 const char * name,
79 xwsz_t objsize, xwsz_t alignment, xwsq_t pg_order,
80 ctor_f ctor, dtor_f dtor);
81
91
101
111 xwsz_t reserved);
112
121 xwsz_t * capacity);
122
127#endif /* xwos/mm/mempool/objcache.h */
XWOS通用库:双循环链表
xwer_t xwmm_mempool_objcache_init(struct xwmm_mempool_objcache *oc, struct xwmm_mempool_page_allocator *pa, const char *name, xwsz_t objsize, xwsz_t alignment, xwsq_t pg_order, ctor_f ctor, dtor_f dtor)
XWMM API:初始化对象缓存
Definition objcache.c:54
xwer_t xwmm_mempool_objcache_alloc(struct xwmm_mempool_objcache *oc, void **objbuf)
XWMM API:从对象缓存中申请一个对象
Definition objcache.c:263
xwer_t xwmm_mempool_objcache_reserve(struct xwmm_mempool_objcache *oc, xwsz_t reserved)
XWMM API:预留对象到对象缓存中
Definition objcache.c:344
xwer_t xwmm_mempool_objcache_get_capacity(struct xwmm_mempool_objcache *oc, xwsz_t *capacity)
XWMM API:获取对象缓存的容量
Definition objcache.c:383
xwer_t xwmm_mempool_objcache_free(struct xwmm_mempool_objcache *oc, void *obj)
XWMM API:释放对象到对象缓存中
Definition objcache.c:299
#define xwlib_bclst_head
双循环链表头
Definition bclst.h:35
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
unsigned long xwsq_t
Definition type.h:445
unsigned long xwptr_t
Definition type.h:375
__xwcc_atomic xwsz_t atomic_xwsz_t
Definition type.h:342
void(* ctor_f)(void *)
Definition type.h:604
void(* dtor_f)(void *)
Definition type.h:605
XWOS内存管理:内存池:分配器接口
操作系统抽象层:顺序锁
XWOS内存管理:内存池:页分配器
interface:分配器
Definition i_allocator.h:27
对象缓存
Definition objcache.h:34
struct xwmm_mempool_page_allocator * pa
Definition objcache.h:36
struct xwmm_mempool_i_allocator i_a
Definition objcache.h:35
atomic_xwsz_t reserved
Definition objcache.h:52
atomic_xwsz_t idleness
Definition objcache.h:51
const char * name
Definition objcache.h:37
struct xwmm_mempool_objcache::@0 page_list
atomic_xwsz_t capacity
Definition objcache.h:50
XWOS API:顺序锁
Definition seqlock.h:112
XWOS通用库:位操作
XWOS内存管理:通用定义
XWOS的标准头文件