36 num_max = total_size / card_size;
37 if ((
xwsz_t)0 == num_max) {
55 for (n = 0; n < num_max; n++) {
69 for (n = 0; n < nm; n++) {
115 if (((
xwptr_t)mem < msa->zone.origin) ||
xwer_t xwmm_memslice_free(struct xwmm_memslice *msa, void *mem)
XWMM API:释放内存切片
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:静态方式初始化内存切片分配器
xwer_t xwmm_memslice_alloc(struct xwmm_memslice *msa, void **membuf)
XWMM API:申请内存切片
#define EFAULT
Bad address
#define ENOMEM
Not enough space
#define EOWNER
Owner error
static void xwlib_lfq_push(atomic_xwlfq_t *h, atomic_xwlfq_t *n)
将一个节点推入无锁队列(栈式队列)
static void xwlib_lfq_init(atomic_xwlfq_t *n)
初始化无锁队列节点
static xwlfq_t * xwlib_lfq_pop(atomic_xwlfq_t *h)
弹出无锁队列中的第一个节点(栈式队列)
__xwcc_atomic xwlfq_t atomic_xwlfq_t
#define xwaop_add(type, a, v, nv, ov)
对原子变量进行原子操作:读取-相加-回写
#define xwaop_sub(type, a, v, nv, ov)
对原子变量进行原子操作:读取-相减-回写
#define XWBOP_ALIGN(x, n)
#define XWOS_VALIDATE(exp, errstr,...)
检查函数参数是否有效