[vlc-commits] objects: inline vlc_object_release()

Rémi Denis-Courmont git at videolan.org
Sun Mar 17 02:39:15 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 17 03:23:42 2019 +0200| [f4ef2f2d39af16e1b88fc854225cce707c5d4bc5] | committer: Rémi Denis-Courmont

objects: inline vlc_object_release()

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

 include/vlc_objects.h | 11 +----------
 src/libvlccore.sym    |  1 -
 src/misc/objects.c    |  7 +------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 6fe6696114..3478291b78 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -94,14 +94,6 @@ VLC_API void *vlc_object_create( vlc_object_t *, size_t ) VLC_MALLOC VLC_USED;
 VLC_API vlc_object_t *vlc_object_find_name( vlc_object_t *, const char * ) VLC_USED VLC_DEPRECATED;
 
 /**
- * Removes a weak reference to an object.
- *
- * This atomically decrements the reference count.
- * If the count reaches zero, the object is destroyed.
- */
-VLC_API void vlc_object_release(vlc_object_t *obj);
-
-/**
  * Drops the strong reference to an object.
  *
  * This removes the initial strong reference to a given object. This must be
@@ -196,7 +188,7 @@ VLC_DEPRECATED static inline void *vlc_object_hold(vlc_object_t *o)
     return o;
 }
 
-static inline void vlc_object_release_dyn(vlc_object_t *o)
+static inline void vlc_object_release(vlc_object_t *o)
 {
     const char *tn = vlc_object_typename(o);
 
@@ -207,7 +199,6 @@ static inline void vlc_object_release_dyn(vlc_object_t *o)
     if (!strcmp(tn, "video output"))
         vout_Release((vout_thread_t *)o);
 }
-#define vlc_object_release(a) vlc_object_release_dyn(a)
 
 /**
  * @defgroup objres Object resources
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 8bfc3b861d..839390654e 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -677,7 +677,6 @@ vlc_global_mutex
 vlc_object_create
 vlc_object_delete
 vlc_object_find_name
-vlc_object_release
 vlc_object_typename
 vlc_object_parent
 vlc_object_Log
diff --git a/src/misc/objects.c b/src/misc/objects.c
index eec2c95900..7db15b6b6d 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -241,11 +241,6 @@ vlc_object_t *(vlc_object_parent)(vlc_object_t *obj)
     return vlc_internals(obj)->parent;
 }
 
-void (vlc_object_delete)(vlc_object_t *obj)
-{
-    (vlc_object_release)(obj);
-}
-
 /**
  * Destroys a VLC object once it has no more references.
  */
@@ -297,7 +292,7 @@ vlc_object_t *vlc_object_find_name( vlc_object_t *p_this, const char *psz_name )
     return NULL;
 }
 
-void (vlc_object_release)(vlc_object_t *obj)
+void (vlc_object_delete)(vlc_object_t *obj)
 {
     vlc_object_internals_t *priv = vlc_internals(obj);
     unsigned refs = atomic_load_explicit(&priv->refs, memory_order_relaxed);



More information about the vlc-commits mailing list