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
915f6a59
Commit
915f6a59
authored
Jul 08, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlccore: Make sure vlc_gc_* function correctly assert() on common errors, and de-inline them.
parent
9c750dec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
26 deletions
+42
-26
include/vlc_common.h
include/vlc_common.h
+4
-26
src/libvlc.c
src/libvlc.c
+35
-0
src/libvlccore.sym
src/libvlccore.sym
+3
-0
No files found.
include/vlc_common.h
View file @
915f6a59
...
...
@@ -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 )
...
...
src/libvlc.c
View file @
915f6a59
...
...
@@ -105,6 +105,41 @@ static unsigned i_instances = 0;
static
bool
b_daemon
=
false
;
/*****************************************************************************
* vlc_gc_*.
*****************************************************************************/
void
__vlc_gc_incref
(
gc_object_t
*
p_gc
)
{
assert
(
p_gc
->
i_gc_refcount
>
0
);
/* FIXME: atomic version needed! */
p_gc
->
i_gc_refcount
++
;
}
void
__vlc_gc_decref
(
gc_object_t
*
p_gc
)
{
assert
(
p_gc
);
assert
(
p_gc
->
i_gc_refcount
>
0
);
/* FIXME: atomic version needed! */
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 ! */
}
}
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
;
}
/*****************************************************************************
* Local prototypes
*****************************************************************************/
...
...
src/libvlccore.sym
View file @
915f6a59
...
...
@@ -414,6 +414,9 @@ __vlc_execve
vlc_fastmem_register
vlc_freeaddrinfo
vlc_gai_strerror
__vlc_gc_incref
__vlc_gc_init
__vlc_gc_decref
vlc_getaddrinfo
vlc_getnameinfo
vlc_gettext
...
...
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