Commit 6a45dac7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Alias vlc_memset() to memset()

This saves two function calls per memset() since there are no optimized
implementations of memset() at all.
parent a90229de
......@@ -839,7 +839,7 @@ VLC_API void vlc_tdestroy( void *, void (*)(void *) );
/* Fast large memory copy and memory set */
VLC_API void * vlc_memcpy( void *, const void *, size_t );
VLC_API void * vlc_memset( void *, int, size_t );
#define vlc_memset memset
/*****************************************************************************
* I18n stuff
......
......@@ -86,9 +86,8 @@ VLC_API unsigned vlc_GetCPUCount( void );
# endif
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_API void vlc_fastmem_register(vlc_memcpy_t cpy, vlc_memset_t set);
VLC_API void vlc_fastmem_register(vlc_memcpy_t cpy);
#endif /* !VLC_CPU_H */
......@@ -38,7 +38,7 @@ static int Activate( vlc_object_t *p_this )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy, NULL );
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
......
......@@ -53,7 +53,7 @@ static int Activate ( vlc_object_t *p_this )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy, NULL );
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
......
......@@ -38,7 +38,7 @@ static int Activate( vlc_object_t *p_this )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy, NULL );
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
......
......@@ -38,7 +38,7 @@ static int Activate( vlc_object_t *p_this )
return VLC_EGENERIC;
VLC_UNUSED(p_this);
vlc_fastmem_register( fast_memcpy, NULL );
vlc_fastmem_register( fast_memcpy );
return VLC_SUCCESS;
}
......
......@@ -557,7 +557,6 @@ vlc_join
vlc_list_children
vlc_list_release
vlc_memcpy
vlc_memset
vlc_memalign
vlc_meta_AddExtra
vlc_meta_CopyExtraNames
......
......@@ -385,14 +385,11 @@ unsigned vlc_GetCPUCount(void)
}
static vlc_memcpy_t pf_vlc_memcpy = memcpy;
static vlc_memset_t pf_vlc_memset = memset;
void vlc_fastmem_register (vlc_memcpy_t cpy, vlc_memset_t set)
void vlc_fastmem_register (vlc_memcpy_t cpy)
{
if (cpy)
pf_vlc_memcpy = cpy;
if (set)
pf_vlc_memset = set;
assert (cpy != NULL);
pf_vlc_memcpy = cpy;
}
/**
......@@ -403,14 +400,6 @@ void *vlc_memcpy (void *tgt, const void *src, size_t n)
return pf_vlc_memcpy (tgt, src, n);
}
/**
* vlc_memset: fast CPU-dependent memset
*/
void *vlc_memset (void *tgt, int c, size_t n)
{
return pf_vlc_memset (tgt, c, n);
}
/**
* Returned an aligned pointer on newly allocated memory.
* \param alignment must be a power of 2 and a multiple of sizeof(void*)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment