[vlc-commits] Remove no longer used vlc_gc_*()

Rémi Denis-Courmont git at videolan.org
Sun May 13 19:28:06 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 13 20:03:56 2012 +0300| [e245cb8556fb176de49d5e06e00264a55411d451] | committer: Rémi Denis-Courmont

Remove no longer used vlc_gc_*()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e245cb8556fb176de49d5e06e00264a55411d451
---

 include/vlc_common.h |   20 -------------------
 src/libvlc.c         |   51 --------------------------------------------------
 2 files changed, 0 insertions(+), 71 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 9469c18..8ed6883 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -497,26 +497,6 @@ typedef union
 # define VLC_OBJECT( x ) ((vlc_object_t *)(x))
 #endif
 
-typedef struct gc_object_t
-{
-    vlc_atomic_t    refs;
-    void          (*pf_destructor) (struct gc_object_t *);
-} gc_object_t;
-
-/**
- * These members are common to all objects that wish to be garbage-collected.
- */
-#define VLC_GC_MEMBERS gc_object_t vlc_gc_data;
-
-VLC_API void * vlc_gc_init(gc_object_t *, void (*)(gc_object_t *));
-VLC_API void * vlc_hold(gc_object_t *);
-VLC_API void vlc_release(gc_object_t *);
-
-#define vlc_gc_init( a,b ) vlc_gc_init( &(a)->vlc_gc_data, (b) )
-#define vlc_gc_incref( a ) vlc_hold( &(a)->vlc_gc_data )
-#define vlc_gc_decref( a ) vlc_release( &(a)->vlc_gc_data )
-#define vlc_priv( gc, t ) ((t *)(((char *)(gc)) - offsetof(t, vlc_gc_data)))
-
 /*****************************************************************************
  * Macros and inline functions
  *****************************************************************************/
diff --git a/src/libvlc.c b/src/libvlc.c
index 2c9a49c..49220ab 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -70,7 +70,6 @@
 #include <vlc_fs.h>
 #include <vlc_cpu.h>
 #include <vlc_url.h>
-#include <vlc_atomic.h>
 #include <vlc_modules.h>
 
 #include "libvlc.h"
@@ -93,56 +92,6 @@
 static bool b_daemon = false;
 #endif
 
-#undef vlc_gc_init
-#undef vlc_hold
-#undef vlc_release
-
-/**
- * Atomically set the reference count to 1.
- * @param p_gc reference counted object
- * @param pf_destruct destruction calback
- * @return p_gc.
- */
-void *vlc_gc_init (gc_object_t *p_gc, void (*pf_destruct) (gc_object_t *))
-{
-    /* There is no point in using the GC if there is no destructor... */
-    assert (pf_destruct);
-    p_gc->pf_destructor = pf_destruct;
-
-    vlc_atomic_set (&p_gc->refs, 1);
-    return p_gc;
-}
-
-/**
- * Atomically increment the reference count.
- * @param p_gc reference counted object
- * @return p_gc.
- */
-void *vlc_hold (gc_object_t * p_gc)
-{
-    uintptr_t refs;
-
-    assert( p_gc );
-    refs = vlc_atomic_inc (&p_gc->refs);
-    assert (refs != 1); /* there had to be a reference already */
-    return p_gc;
-}
-
-/**
- * Atomically decrement the reference count and, if it reaches zero, destroy.
- * @param p_gc reference counted object.
- */
-void vlc_release (gc_object_t *p_gc)
-{
-    uintptr_t refs;
-
-    assert( p_gc );
-    refs = vlc_atomic_dec (&p_gc->refs);
-    assert (refs != (uintptr_t)(-1)); /* reference underflow?! */
-    if (refs == 0)
-        p_gc->pf_destructor (p_gc);
-}
-
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/



More information about the vlc-commits mailing list