diff options
author | José Fonseca <[email protected]> | 2010-02-02 14:42:17 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-02-02 14:42:17 +0000 |
commit | 28486880ca3ec39419ccee0cb1a3bedc9ef7117c (patch) | |
tree | e7d2e1612fdcdcd6d14976383e53a56314e75ec5 /src/gallium/include/pipe/p_refcnt.h | |
parent | 57839d11ff806d172506e4a5104c1ae3d286df1c (diff) |
gallium: pipe/p_inlines.h -> util/u_inlines.h
Diffstat (limited to 'src/gallium/include/pipe/p_refcnt.h')
-rw-r--r-- | src/gallium/include/pipe/p_refcnt.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h index 468e8d87f9e..6609f94510a 100644 --- a/src/gallium/include/pipe/p_refcnt.h +++ b/src/gallium/include/pipe/p_refcnt.h @@ -45,50 +45,6 @@ struct pipe_reference }; -static INLINE void -pipe_reference_init(struct pipe_reference *reference, unsigned count) -{ - p_atomic_set(&reference->count, count); -} - - -static INLINE boolean -pipe_is_referenced(struct pipe_reference *reference) -{ - return p_atomic_read(&reference->count) != 0; -} - - -/** - * Update reference counting. - * The old thing pointed to, if any, will be unreferenced. - * Both 'ptr' and 'reference' may be NULL. - * \return TRUE if the object's refcount hits zero and should be destroyed. - */ -static INLINE boolean -pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) -{ - boolean destroy = FALSE; - - if(ptr != reference) { - /* bump the reference.count first */ - if (reference) { - assert(pipe_is_referenced(reference)); - p_atomic_inc(&reference->count); - } - - if (ptr) { - assert(pipe_is_referenced(ptr)); - if (p_atomic_dec_zero(&ptr->count)) { - destroy = TRUE; - } - } - } - - return destroy; -} - - #ifdef __cplusplus } #endif |