Browse Source

Merge pull request #2208 from martin-frbg/munmap-debug

Provide more information on mmap/munmap failure
tags/v0.3.7
Martin Kroeker GitHub 6 years ago
parent
commit
bf1430f7d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      driver/others/memory.c

+ 11
- 1
driver/others/memory.c View File

@@ -2041,8 +2041,12 @@ static BLASULONG alloc_lock = 0UL;

static void alloc_mmap_free(struct release_t *release){

if (!release->address) return;

if (munmap(release -> address, BUFFER_SIZE)) {
printf("OpenBLAS : munmap failed\n");
int errsv=errno;
perror("OpenBLAS : munmap failed:");
printf("error code=%d,\trelease->address=%lx\n",errsv,release->address);
}
}

@@ -2073,6 +2077,12 @@ static void *alloc_mmap(void *address){
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif
} else {
#ifdef DEBUG
int errsv=errno;
perror("OpenBLAS : mmap failed:");
printf("error code=%d,\tmap_address=%lx\n",errsv,map_address);
#endif
}

#ifdef OS_LINUX


Loading…
Cancel
Save