Clean a bit the includes up

This marginally increases the portability of hardened_malloc,
eg. on OSX.
This commit is contained in:
jvoisin 2022-02-07 11:54:57 +01:00
parent 943704de7c
commit b72661ed51
14 changed files with 19 additions and 12 deletions

View file

@ -6,9 +6,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <threads.h>
#if CONFIG_STATS
#include <malloc.h>
#endif
#include <pthread.h>
#include <unistd.h>
@ -62,7 +63,7 @@ static_assert(N_ARENA <= 256, "maximum number of arenas is currently 256");
#if N_ARENA > 1
__attribute__((tls_model("initial-exec")))
static thread_local unsigned thread_arena = N_ARENA;
static _Thread_local unsigned thread_arena = N_ARENA;
static atomic_uint thread_arena_counter = 0;
#else
static const unsigned thread_arena = 0;

View file

@ -1,7 +1,10 @@
#include <errno.h>
#include <sys/mman.h>
#ifdef LABEL_MEMORY
#include <sys/prctl.h>
#endif
#ifndef PR_SET_VMA
#define PR_SET_VMA 0x53564d41

View file

@ -1,5 +1,4 @@
#include <malloc.h>
#include <stddef.h>
#include <stdlib.h>
#include "test_util.h"

View file

@ -1,4 +1,4 @@
#include <malloc.h>
#include <stdlib.h>
#include "test_util.h"

View file

@ -1,4 +1,4 @@
#include <malloc.h>
#include <stdlib.h>
#include "test_util.h"

View file

@ -1,6 +1,9 @@
#include <stdlib.h>
#include <stdio.h>
#if defined(__GLIBC__) || defined(__ANDROID__)
#include <malloc.h>
#endif
#include "test_util.h"

View file

@ -1,6 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#if defined(__GLIBC__)
#include <malloc.h>
#endif
#include "test_util.h"

View file

@ -1,7 +1,9 @@
#include <pthread.h>
#include <stdio.h>
#if defined(__GLIBC__) || defined(__ANDROID__)
#include <malloc.h>
#endif
#include "test_util.h"
#include "../util.h"

View file

@ -1,5 +1,5 @@
#include <stdbool.h>
#include <malloc.h>
#include <stdlib.h>
#include "test_util.h"

View file

@ -1,5 +1,5 @@
#include <stdbool.h>
#include <malloc.h>
#include <stdlib.h>
#include "test_util.h"

View file

@ -1,5 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include "test_util.h"

View file

@ -1,5 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include "test_util.h"

View file

@ -1,5 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include "test_util.h"
#include "../util.h"

View file

@ -1,5 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
#include "test_util.h"