13#ifndef __xwos_lib_object_h__
14#define __xwos_lib_object_h__
33#define xwos_cast(type, obj) ((type)(obj))
35#define XWOS_OBJ_MAGIC 0x58574F53U
71#define XWOBJ_NILD ((xwobj_d){NULL, 0,})
__xwcc_atomic xwsq_t atomic_xwsq_t
void xwos_object_setgc(struct xwos_object *obj, xwobj_gc_f gcfunc)
设置XWOS对象的垃圾回收函数
xwer_t xwos_object_rawput(struct xwos_object *obj)
减少对象的引用计数,不触发垃圾回收函数
xwer_t(* xwobj_gc_f)(struct xwos_object *)
垃圾回收函数指针类型
xwer_t xwos_object_grab(struct xwos_object *obj)
增加对象的引用计数
xwer_t xwos_object_activate(struct xwos_object *obj, xwobj_gc_f gcfunc)
激活一个XWOS对象(将其引用计数初始化位1)
void xwos_object_construct(struct xwos_object *obj)
XWOS对象的构造函数
xwsq_t xwos_object_get_refcnt(struct xwos_object *obj)
获取XWOS对象的引用计数
void xwos_object_destruct(struct xwos_object *obj)
XWOS对象的析构函数
xwer_t xwos_object_release(struct xwos_object *obj, xwsq_t tik)
检查对象的标签并减少引用计数
void xwos_objtik_init(void)
初始化对象标签分配器
xwer_t xwos_object_acquire(struct xwos_object *obj, xwsq_t tik)
检查对象的标签并增加引用计数
xwer_t xwos_object_put(struct xwos_object *obj)
减少对象的引用计数