Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e245cb85
Commit
e245cb85
authored
May 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer used vlc_gc_*()
parent
da623e25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
71 deletions
+0
-71
include/vlc_common.h
include/vlc_common.h
+0
-20
src/libvlc.c
src/libvlc.c
+0
-51
No files found.
include/vlc_common.h
View file @
e245cb85
...
...
@@ -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
*****************************************************************************/
...
...
src/libvlc.c
View file @
e245cb85
...
...
@@ -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
*****************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment