XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
memslice.h
浏览该文件的文档.
1
13#ifndef __xwos_mm_memslice_h__
14#define __xwos_mm_memslice_h__
15
16#include <xwos/standard.h>
17#include <xwos/lib/bclst.h>
18#include <xwos/lib/lfq.h>
19#include <xwos/mm/common.h>
20
45 struct xwmm_zone zone;
46 const char * name;
59};
60
79 xwptr_t origin, xwsz_t total_size,
80 xwsz_t card_size, const char * name,
81 ctor_f ctor, dtor_f dtor);
82
95xwer_t xwmm_memslice_alloc(struct xwmm_memslice * msa, void ** membuf);
96
107xwer_t xwmm_memslice_free(struct xwmm_memslice * msa, void * mem);
108
113#endif /* xwos/mm/memslice.h */
XWOS通用库:双循环链表
xwer_t xwmm_memslice_free(struct xwmm_memslice *msa, void *mem)
XWMM API:释放内存切片
Definition memslice.c:107
xwer_t xwmm_memslice_init(struct xwmm_memslice *msa, xwptr_t origin, xwsz_t total_size, xwsz_t card_size, const char *name, ctor_f ctor, dtor_f dtor)
XWMM API:静态方式初始化内存切片分配器
Definition memslice.c:21
xwer_t xwmm_memslice_alloc(struct xwmm_memslice *msa, void **membuf)
XWMM API:申请内存切片
Definition memslice.c:83
signed long xwer_t
Definition type.h:554
__xwcc_atomic xwlfq_t atomic_xwlfq_t
Definition type.h:594
unsigned long xwsz_t
Definition type.h:339
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通用库:无锁队列
内存切片分配器
Definition memslice.h:44
dtor_f dtor
Definition memslice.h:58
xwsz_t card_size
Definition memslice.h:47
atomic_xwsz_t num_free
Definition memslice.h:48
ctor_f ctor
Definition memslice.h:57
atomic_xwsz_t num_max
Definition memslice.h:49
const char * name
Definition memslice.h:46
struct xwmm_zone zone
Definition memslice.h:45
atomic_xwlfq_t free_list
Definition memslice.h:50
xwptr_t backup
Definition memslice.h:51
XWOS内存区域
Definition common.h:40
xwptr_t origin
Definition common.h:41
XWOS内存管理:通用定义
XWOS的标准头文件