| 1 | namespace kiwi { | ||
| 2 | /* Implement reference counting for kiwi::Variable */ | ||
| 3 | 5000 | int* get_refcount( kiwi::Variable* obj ) { | |
| 4 | 5000 | return &( obj->m_data->m_refcount ); | |
| 5 | } | ||
| 6 | |||
| 7 | 2500 | void refcnt_inc( kiwi::Variable* obj ) { | |
| 8 | 2500 | ++(* kiwi::get_refcount( obj ) ); | |
| 9 | 2500 | } | |
| 10 | 2500 | void refcnt_dec( kiwi::Variable* obj ) { | |
| 11 | 2500 | --(* kiwi::get_refcount( obj ) ); | |
| 12 | 2500 | } | |
| 13 | 0 | std::uint32_t refcnt_get( kiwi::Variable* obj ) { | |
| 14 | 0 | return * kiwi::get_refcount( obj ); | |
| 15 | } | ||
| 16 | } | ||
| 17 | |||
| 18 | namespace kiwi { | ||
| 19 | /* Implement reference counting for kiwi::Constraint */ | ||
| 20 | 7202 | int* get_refcount( kiwi::Constraint* obj ) { | |
| 21 | 7202 | return &( obj->m_data->m_refcount ); | |
| 22 | } | ||
| 23 | |||
| 24 | 3601 | void refcnt_inc( kiwi::Constraint* obj ) { | |
| 25 | 3601 | ++(* kiwi::get_refcount( obj ) ); | |
| 26 | 3601 | } | |
| 27 | 3601 | void refcnt_dec( kiwi::Constraint* obj ) { | |
| 28 | 3601 | --(* kiwi::get_refcount( obj ) ); | |
| 29 | 3601 | } | |
| 30 | 0 | std::uint32_t refcnt_get( kiwi::Constraint* obj ) { | |
| 31 | 0 | return * kiwi::get_refcount( obj ); | |
| 32 | } | ||
| 33 | } |