… | |
… | |
174 | MTH void refcnt_inc () const { ++refcnt; } |
174 | MTH void refcnt_inc () const { ++refcnt; } |
175 | MTH void refcnt_dec () const { --refcnt; } |
175 | MTH void refcnt_dec () const { --refcnt; } |
176 | |
176 | |
177 | MTH int refcnt_cnt () const; |
177 | MTH int refcnt_cnt () const; |
178 | // check wether the object has died and destroy |
178 | // check wether the object has died and destroy |
179 | MTH void refcnt_chk () { if (refcnt <= 0) do_check (); } |
179 | MTH void refcnt_chk () { if (expect_false (refcnt <= 0)) do_check (); } |
180 | |
180 | |
181 | // destroy the object unless it was already destroyed |
181 | // destroy the object unless it was already destroyed |
182 | // this politely asks everybody interested the reduce |
182 | // this politely asks everybody interested the reduce |
183 | // the refcount to 0 as soon as possible. |
183 | // the refcount to 0 as soon as possible. |
184 | MTH void destroy (); |
184 | MTH void destroy (); |
… | |
… | |
348 | } |
348 | } |
349 | |
349 | |
350 | template<typename T> |
350 | template<typename T> |
351 | void put (keyword k, const T *v) |
351 | void put (keyword k, const T *v) |
352 | { |
352 | { |
353 | if (v) |
|
|
354 | put (k, v->name); |
|
|
355 | else |
|
|
356 | put (k, (const char *)0); |
353 | put (k, v ? &v->name : (const char *)0); |
357 | } |
354 | } |
358 | |
355 | |
359 | template<typename T> |
356 | template<typename T> |
360 | void put (keyword k, const refptr<T> &v) |
357 | void put (keyword k, const refptr<T> &v) |
361 | { |
358 | { |