20 using namespace shogun;
33 m_refcount = orig.m_refcount;
43 #ifdef USE_REFERENCE_COUNTING
44 int32_t SGRefObject::ref()
46 int32_t count = m_refcount->
ref();
48 return m_refcount->ref_count();
55 return m_refcount->ref_count();
60 int32_t count = m_refcount->
unref();
63 SG_SGCDEBUG(
"unref() refcount %ld, obj %s (%p) destroying\n", count, this->
get_name(),
this)
70 return m_refcount->ref_count();
73 #endif //USE_REFERENCE_COUNTING
75 #ifdef TRACE_MEMORY_ALLOCS
80 void SGRefObject::init()
82 #ifdef TRACE_MEMORY_ALLOCS
85 int32_t idx=sg_mallocs->
index_of(
this);
88 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 ...
int32_t index_of(const K &key)