Fix build with ALLOC_SHM=0 (Android NDK)
Refactor such that you can build with ALLOC_SHM=0. HughTLB implicity depends on ALLOC_SHM=1. This patch allows building for Android NDK r10d.
This commit is contained in:
parent
8e5a1083bb
commit
ebb9eba987
|
@ -709,8 +709,6 @@ static void *alloc_shm(void *address){
|
||||||
return map_address;
|
return map_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
||||||
|
|
||||||
static void alloc_hugetlb_free(struct release_t *release){
|
static void alloc_hugetlb_free(struct release_t *release){
|
||||||
|
@ -817,6 +815,8 @@ static void *alloc_hugetlb(void *address){
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ALLOC_HUGETLBFILE
|
#ifdef ALLOC_HUGETLBFILE
|
||||||
|
|
||||||
static int hugetlb_pid = 0;
|
static int hugetlb_pid = 0;
|
||||||
|
@ -917,12 +917,13 @@ void *blas_memory_alloc(int procpos){
|
||||||
#ifdef ALLOC_DEVICEDRIVER
|
#ifdef ALLOC_DEVICEDRIVER
|
||||||
alloc_devicedirver,
|
alloc_devicedirver,
|
||||||
#endif
|
#endif
|
||||||
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
/* Hugetlb implicitly assumes ALLOC_SHM */
|
||||||
alloc_hugetlb,
|
|
||||||
#endif
|
|
||||||
#ifdef ALLOC_SHM
|
#ifdef ALLOC_SHM
|
||||||
alloc_shm,
|
alloc_shm,
|
||||||
#endif
|
#endif
|
||||||
|
#if ((defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS))
|
||||||
|
alloc_hugetlb,
|
||||||
|
#endif
|
||||||
#ifdef ALLOC_MMAP
|
#ifdef ALLOC_MMAP
|
||||||
alloc_mmap,
|
alloc_mmap,
|
||||||
#endif
|
#endif
|
||||||
|
@ -1062,7 +1063,7 @@ void *blas_memory_alloc(int procpos){
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS
|
#if (defined ALLOC_SHM) && (defined OS_LINUX || defined OS_AIX || defined __sun__ || defined OS_WINDOWS)
|
||||||
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
if ((*func == alloc_hugetlb) && (map_address != (void *)-1)) hugetlb_allocated = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue