tests: Make leak check work again by setting default visibility for malloc/free

We compile the test cases with -fvisibility=hidden which makes
our malloc/free wrappers fail to override system malloc/free.
This commit is contained in:
Kristian Høgsberg 2012-04-13 10:13:49 -04:00
parent d8b66a00f4
commit b68b5e9e0c

View file

@ -38,13 +38,15 @@ static void (*sys_free)(void*);
extern const struct test __start_test_section, __stop_test_section;
void* malloc(size_t size)
__attribute__ ((visibility("default"))) void *
malloc(size_t size)
{
num_alloc++;
return sys_malloc(size);
}
void free(void* mem)
__attribute__ ((visibility("default"))) void
free(void* mem)
{
if (mem != NULL)
num_alloc--;