28#define PRINT_REFS(OBJ, DELTA) \
30 if ( (1 << (OBJ->type)) & ARAX_REF_DEBUG_MASK) \
31 printf("%s:%s(%p,ABA:%d ,%d=>%d)\n", \
32 __func__, type2str[OBJ->type], \
33 OBJ, ((OBJ->ref_count & 0xffff0000) >> 16), \
34 (OBJ->ref_count & 0xffff), \
35 ((OBJ->ref_count & 0xffff) DELTA) & 0xffff); \
38#define PRINT_REFS(OBJ, DELTA)
81 fprintf(stderr,
"%lu %*s still registered!\n",
83 (
int) ( strlen(
type2str[r]) - (len == 1) ),
110 strcpy(obj->
name, name);
134 size_t new_size = vsnprintf(&tmp, 1, fmt, args);
135 size_t old_size = strlen(obj->
name);
137 if (old_size < new_size) {
141 vsprintf(obj->
name, fmt, args);
150 #ifdef ARAX_REF_DEBUG
153 __sync_add_and_fetch(&(obj->
ref_count), 0x10001);
157 __sync_add_and_fetch(&(obj->
ref_count), 1);
169 #ifdef ARAX_REF_DEBUG
179 #ifdef ARAX_REF_DEBUG
180 int refs = __sync_add_and_fetch(&(obj->
ref_count), 0xffff) & 0xffff;
182 int refs = __sync_add_and_fetch(&(obj->
ref_count), -1);
185 #ifdef ARAX_REF_DEBUG
213 #ifdef ARAX_REF_DEBUG
214 int refs = __sync_add_and_fetch(&(obj->
ref_count), 0xffff) & 0xffff;
216 int refs = __sync_add_and_fetch(&(obj->
ref_count), -1);
239 #ifdef ARAX_REF_DEBUG
struct arax_pipe arax_pipe_s
#define arch_alloc_free(ALLOC, MEM)
void * arch_alloc_allocate(arch_alloc_s *alloc, size_t size)
#define arax_assert(EXPR)
enum arax_object_type arax_object_type_e
#define ARAX_OBJ_DTOR_USE(TYPE)
#define ARAX_OBJ_DTOR_DECL(TYPE)
struct arax_task_msg arax_task_msg_s
int arax_object_ref_dec_pre_locked(arax_object_s *obj)
static const arax_object_dtor dtor_table[ARAX_TYPE_COUNT]
int arax_object_repo_exit(arax_object_repo_s *repo)
arax_object_s * arax_object_register(arax_object_repo_s *repo, arax_object_type_e type, const char *name, size_t size, const int ref_count)
const char * arax_object_type_to_str(arax_object_type_e type)
void arax_object_rename(arax_object_s *obj, const char *fmt,...)
int arax_object_refs(arax_object_s *obj)
static const char * type2str[ARAX_TYPE_COUNT]
void arax_object_repo_init(arax_object_repo_s *repo, arax_pipe_s *pipe)
void arax_object_ref_inc(arax_object_s *obj)
utils_list_s * arax_object_list_lock(arax_object_repo_s *repo, arax_object_type_e type)
void arax_object_list_unlock(arax_object_repo_s *repo, arax_object_type_e type)
void(* arax_object_dtor)(arax_pipe_s *pipe, arax_object_s *obj)
int arax_object_ref_dec(arax_object_s *obj)
#define PRINT_REFS(OBJ, DELTA)
void ARAX_PIPE_THOTTLE_DEBUG_FUNC arax_pipe_size_dec(arax_pipe_s *pipe, size_t sz ARAX_PIPE_THOTTLE_DEBUG_PARAMS)
void ARAX_PIPE_THOTTLE_DEBUG_FUNC arax_pipe_size_inc(arax_pipe_s *pipe, size_t sz ARAX_PIPE_THOTTLE_DEBUG_PARAMS)
utils_list_node_s * utils_list_del(utils_list_s *list, utils_list_node_s *node)
void utils_list_node_init(utils_list_node_s *node, void *owner)
utils_list_s * utils_list_init(void *mem)
void utils_list_add(utils_list_s *list, utils_list_node_s *node)
#define utils_spinlock_lock(V)
#define utils_spinlock_init(V)
#define utils_spinlock_unlock(V)
struct arax_object_repo_s::@001144062210171162324314250161237076324015155136 repo[ARAX_TYPE_COUNT]
arax_object_repo_s * repo