mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
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:
parent
d8b66a00f4
commit
b68b5e9e0c
1 changed files with 4 additions and 2 deletions
|
|
@ -38,13 +38,15 @@ static void (*sys_free)(void*);
|
||||||
|
|
||||||
extern const struct test __start_test_section, __stop_test_section;
|
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++;
|
num_alloc++;
|
||||||
return sys_malloc(size);
|
return sys_malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free(void* mem)
|
__attribute__ ((visibility("default"))) void
|
||||||
|
free(void* mem)
|
||||||
{
|
{
|
||||||
if (mem != NULL)
|
if (mem != NULL)
|
||||||
num_alloc--;
|
num_alloc--;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue