]> gcc.gnu.org Git - gcc.git/commit
libgomp: Don't define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC for _aligned_malloc [PR105745]
authorJakub Jelinek <jakub@redhat.com>
Sat, 28 May 2022 06:30:47 +0000 (08:30 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 30 May 2022 03:36:32 +0000 (05:36 +0200)
commit93e60642891abc85af7a2efb2b7095062e10719f
treeef574c2a892c2c47657f6283054689c557236444
parent2f3ccb79ca859332915cb29a1c965a0f7be2408c
libgomp: Don't define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC for _aligned_malloc [PR105745]

since apparently _aligned_malloc requires freeing with _aligned_free and:
 /* Defined if gomp_aligned_alloc doesn't use fallback version
    and free can be used instead of gomp_aligned_free.  */
 #define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC 1
so the second condition isn't satisfied.  For uses inside of the OpenMP
allocators we can still use _aligned_malloc but we need to call _aligned_free
in gomp_aligned_free.

2022-05-28  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/105745
* libgomp.h (GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC): Don't define for
defined(HAVE__ALIGNED_MALLOC) case.
* alloc.c (gomp_aligned_alloc): Move defined(HAVE__ALIGNED_MALLOC)
handling as last option before fallback instead of first.
(gomp_aligned_free): For defined(HAVE__ALIGNED_MALLOC) call
_aligned_free.

(cherry picked from commit 42fd2cd932384288914174f4af7974a060972bff)
libgomp/alloc.c
libgomp/libgomp.h
This page took 0.058801 seconds and 5 git commands to generate.