20 using namespace shogun;
44 #ifdef USE_REFERENCE_COUNTING
45 int32_t SGRefObject::ref()
47 int32_t count = m_refcount->
ref();
49 return m_refcount->ref_count();
56 return m_refcount->ref_count();
61 int32_t count = m_refcount->
unref();
64 SG_SGCDEBUG(
"unref() refcount %ld, obj %s (%p) destroying\n", count, this->
get_name(),
this)
71 return m_refcount->ref_count();
74 #endif //USE_REFERENCE_COUNTING
76 #ifdef TRACE_MEMORY_ALLOCS
80 void SGRefObject::list_memory_allocs()
82 shogun::list_memory_allocs();
86 void SGRefObject::init()
88 #ifdef TRACE_MEMORY_ALLOCS
91 int32_t idx=sg_mallocs->index_of(
this);
94 MemoryBlock* b=sg_mallocs->get_element_ptr(idx);
Class SGRefObject is a reference count based memory management class.
virtual const char * get_name() const =0
the class CMap, a map based on the hash-table. w: http://en.wikipedia.org/wiki/Hash_table ...