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
44
struct
xwmm_memslice
{
45
struct
xwmm_zone
zone
;
46
const
char
*
name
;
47
xwsz_t
card_size
;
48
atomic_xwsz_t
num_free
;
49
atomic_xwsz_t
num_max
;
50
atomic_xwlfq_t
free_list
;
51
xwptr_t
backup
;
57
ctor_f
ctor
;
58
dtor_f
dtor
;
59
};
60
78
xwer_t
xwmm_memslice_init
(
struct
xwmm_memslice
* msa,
79
xwptr_t
origin
,
xwsz_t
total_size,
80
xwsz_t
card_size,
const
char
* name,
81
ctor_f
ctor,
dtor_f
dtor);
82
95
xwer_t
xwmm_memslice_alloc
(
struct
xwmm_memslice
* msa,
void
** membuf);
96
107
xwer_t
xwmm_memslice_free
(
struct
xwmm_memslice
* msa,
void
* mem);
108
113
#endif
/* xwos/mm/memslice.h */
bclst.h
XWOS通用库:双循环链表
xwmm_memslice_free
xwer_t xwmm_memslice_free(struct xwmm_memslice *msa, void *mem)
XWMM API:释放内存切片
Definition
memslice.c:107
xwmm_memslice_init
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
xwmm_memslice_alloc
xwer_t xwmm_memslice_alloc(struct xwmm_memslice *msa, void **membuf)
XWMM API:申请内存切片
Definition
memslice.c:83
xwer_t
signed long xwer_t
Definition
type.h:554
atomic_xwlfq_t
__xwcc_atomic xwlfq_t atomic_xwlfq_t
Definition
type.h:594
xwsz_t
unsigned long xwsz_t
Definition
type.h:339
xwptr_t
unsigned long xwptr_t
Definition
type.h:375
atomic_xwsz_t
__xwcc_atomic xwsz_t atomic_xwsz_t
Definition
type.h:342
ctor_f
void(* ctor_f)(void *)
Definition
type.h:604
dtor_f
void(* dtor_f)(void *)
Definition
type.h:605
lfq.h
XWOS通用库:无锁队列
xwmm_memslice
内存切片分配器
Definition
memslice.h:44
xwmm_memslice::dtor
dtor_f dtor
Definition
memslice.h:58
xwmm_memslice::card_size
xwsz_t card_size
Definition
memslice.h:47
xwmm_memslice::num_free
atomic_xwsz_t num_free
Definition
memslice.h:48
xwmm_memslice::ctor
ctor_f ctor
Definition
memslice.h:57
xwmm_memslice::num_max
atomic_xwsz_t num_max
Definition
memslice.h:49
xwmm_memslice::name
const char * name
Definition
memslice.h:46
xwmm_memslice::zone
struct xwmm_zone zone
Definition
memslice.h:45
xwmm_memslice::free_list
atomic_xwlfq_t free_list
Definition
memslice.h:50
xwmm_memslice::backup
xwptr_t backup
Definition
memslice.h:51
xwmm_zone
XWOS内存区域
Definition
common.h:40
xwmm_zone::origin
xwptr_t origin
Definition
common.h:41
common.h
XWOS内存管理:通用定义
standard.h
XWOS的标准头文件
xwos
mm
memslice.h
制作者
1.9.7