]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
libvlccore: Make sure vlc_gc_* function correctly assert() on common errors, and...
[vlc] / include / vlc_common.h
index 451a008926ba35707d652a98a9ddf57a32da7948..cf504c62633d7815171268922c1fb6fc400447e6 100644 (file)
@@ -550,32 +550,10 @@ struct gc_object_t
     VLC_GC_MEMBERS
 };
 
-static inline void __vlc_gc_incref( gc_object_t * p_gc )
-{
-    p_gc->i_gc_refcount ++;
-};
-
-static inline void __vlc_gc_decref( gc_object_t *p_gc )
-{
-    if( !p_gc ) return;
-
-    p_gc->i_gc_refcount -- ;
-
-    if( p_gc->i_gc_refcount == 0 )
-    {
-        p_gc->pf_destructor( p_gc );
-        /* Do not use the p_gc pointer from now on ! */
-    }
-}
-
-static inline void
-__vlc_gc_init( gc_object_t * p_gc, void (*pf_destructor)( gc_object_t * ),
-               void * arg)
-{
-    p_gc->i_gc_refcount = 1;
-    p_gc->pf_destructor = pf_destructor;
-    p_gc->p_destructor_arg = arg;
-}
+VLC_EXPORT(void, __vlc_gc_incref, ( gc_object_t * p_gc ));
+VLC_EXPORT(void, __vlc_gc_decref, ( gc_object_t * p_gc ));
+VLC_EXPORT(void, __vlc_gc_init, ( gc_object_t * p_gc,
+    void (*pf_destructor)( gc_object_t * ), void * arg));
 
 #define vlc_gc_incref( a ) __vlc_gc_incref( (gc_object_t *)a )
 #define vlc_gc_decref( a ) __vlc_gc_decref( (gc_object_t *)a )