예제 #1
0
 void cleanup()
 {
   if (m_memblock) {
     memory_block_decref(m_memblock);
     m_memblock = NULL;
   }
 }
예제 #2
0
 /** Move assignment */
 memory_block_ptr &operator=(memory_block_ptr &&rhs)
 {
   if (m_memblock != 0) {
     memory_block_decref(m_memblock);
   }
   m_memblock = rhs.m_memblock;
   rhs.m_memblock = 0;
   return *this;
 }
예제 #3
0
 /** Assignment from raw memory_block pointer */
 memory_block_ptr &operator=(memory_block_data *rhs)
 {
   if (m_memblock != 0) {
     memory_block_decref(m_memblock);
   }
   m_memblock = rhs;
   if (rhs != 0) {
     memory_block_incref(rhs);
   }
   return *this;
 }
예제 #4
0
 /** Assignment */
 memory_block_ptr &operator=(const memory_block_ptr &rhs)
 {
   if (m_memblock != 0) {
     memory_block_decref(m_memblock);
   }
   if (rhs.m_memblock != 0) {
     m_memblock = rhs.m_memblock;
     memory_block_incref(m_memblock);
   } else {
     m_memblock = 0;
   }
   return *this;
 }
예제 #5
0
 /** Destructor */
 ~memory_block_ptr()
 {
   if (m_memblock != 0) {
     memory_block_decref(m_memblock);
   }
 }