[vlc-devel] commit: Use the new registration mechanism for memcpy/memset ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat May 3 16:25:24 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sat May 3 15:42:06 2008 +0300| [e29b2a0e671308993deab46394f6de15f10033e5]
Use the new registration mechanism for memcpy/memset
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e29b2a0e671308993deab46394f6de15f10033e5
---
include/vlc_common.h | 6 ++----
modules/misc/memcpy/memcpy.c | 8 ++------
modules/misc/memcpy/memcpyaltivec.c | 2 +-
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/include/vlc_common.h b/include/vlc_common.h
index 707e932..c10df66 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -883,15 +883,13 @@ VLC_EXPORT( int, __vlc_execve, ( vlc_object_t *p_object, int i_argc, char *const
#define CPU_CAPABILITY_ALTIVEC (1<<16)
#define CPU_CAPABILITY_FPU (1<<31)
VLC_EXPORT( unsigned, vlc_CPU, ( void ) );
-VLC_EXPORT( void *, vlc_memcpy, ( void *, const void *, size_t ) );
-VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
typedef void *(*vlc_memset_t) (void *tgt, int c, size_t n);
VLC_EXPORT( void, vlc_fastmem_register, (vlc_memcpy_t cpy, vlc_memset_t set) );
-VLC_EXPORT( void *, vlc_memcpy, ( vlc_object_t *, void *, const void *, size_t ) );
-VLC_EXPORT( void *, vlc_memset, ( vlc_object_t *, void *, int, size_t ) );
+VLC_EXPORT( void *, vlc_memcpy, ( void *, const void *, size_t ) );
+VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
/*****************************************************************************
* I18n stuff
diff --git a/modules/misc/memcpy/memcpy.c b/modules/misc/memcpy/memcpy.c
index 829073a..15d64ce 100644
--- a/modules/misc/memcpy/memcpy.c
+++ b/modules/misc/memcpy/memcpy.c
@@ -64,12 +64,8 @@
*****************************************************************************/
static int Activate ( vlc_object_t *p_this )
{
-#ifdef MODULE_NAME_IS_memcpy
- p_this->p_libvlc->pf_memcpy = memcpy;
- p_this->p_libvlc->pf_memset = memset;
-#else
- p_this->p_libvlc->pf_memcpy = fast_memcpy;
- p_this->p_libvlc->pf_memset = NULL;
+#ifndef MODULE_NAME_IS_memcpy
+ vlc_fastmem_register( fast_memcpy, NULL );
#endif
return VLC_SUCCESS;
diff --git a/modules/misc/memcpy/memcpyaltivec.c b/modules/misc/memcpy/memcpyaltivec.c
index 85cdcd5..aead1f7 100644
--- a/modules/misc/memcpy/memcpyaltivec.c
+++ b/modules/misc/memcpy/memcpyaltivec.c
@@ -47,7 +47,7 @@ static void * fast_memcpy ( void * to, const void * from, size_t len );
*****************************************************************************/
static int Activate ( vlc_object_t *p_this )
{
- p_this->p_libvlc->pf_memcpy = fast_memcpy;
+ vlc_fastmem_register( fast_memcpy, NULL );
return VLC_SUCCESS;
}
More information about the vlc-devel
mailing list