Browse Source

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.
tags/v0.2.15^2
powderluv 10 years ago
parent
commit
ebb9eba987
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      driver/others/memory.c

+ 7
- 6
driver/others/memory.c View File

@@ -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
alloc_hugetlb,
#endif
/* Hugetlb implicitly assumes ALLOC_SHM */
#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…
Cancel
Save