utils: add debugable spa_memcpy

This commit is contained in:
Wim Taymans 2019-03-20 19:27:46 +01:00
parent c2cb74a146
commit 74cf412f47
5 changed files with 25 additions and 14 deletions

View file

@ -239,6 +239,17 @@ struct spa_param_info {
strerror(_err); \
})
#ifdef SPA_DEBUG_MEMCPY
#define spa_memcpy(d,s,n) \
({ \
fprintf(stderr, "%s:%u %s() memcpy(%p, %p, %zd)\n", \
__FILE__, __LINE__, __func__, (d), (s), (size_t)(n)); \
memcpy(d,s,n); \
})
#else
#define spa_memcpy(d,s,n) memcpy(d,s,n)
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif