diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-07-14 09:14:37 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-07-14 09:19:57 +0200 |
commit | 407d68daed00e040a7d9545b2a18aa27bf93a106 (patch) | |
tree | e86cfe93dc497656ef28bcdb7f4c952b6825f029 | |
parent | ad0518d97cfc857183e524fabc104ebeec9e8ccd (diff) | |
download | gcc-407d68daed00e040a7d9545b2a18aa27bf93a106.zip gcc-407d68daed00e040a7d9545b2a18aa27bf93a106.tar.gz gcc-407d68daed00e040a7d9545b2a18aa27bf93a106.tar.bz2 |
libgomp: Fix allocator handling for Linux when libnuma is not available
Follow up to r14-2462-g450b05ce54d3f0. The case that libnuma was not
available at runtime was not properly handled; now it falls back to
the normal malloc.
libgomp/
* allocator.c (omp_init_allocator): Check whether symbol from
dlopened libnuma is available before using libnuma for
allocations.
-rw-r--r-- | libgomp/allocator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgomp/allocator.c b/libgomp/allocator.c index b3187ab..90f2dcb 100644 --- a/libgomp/allocator.c +++ b/libgomp/allocator.c @@ -377,8 +377,9 @@ omp_init_allocator (omp_memspace_handle_t memspace, int ntraits, #ifdef LIBGOMP_USE_LIBNUMA if (data.memkind == GOMP_MEMKIND_NONE && data.partition == omp_atv_nearest) { - data.memkind = GOMP_MEMKIND_LIBNUMA; libnuma_data = gomp_get_libnuma (); + if (libnuma_data->numa_alloc_local != NULL) + data.memkind = GOMP_MEMKIND_LIBNUMA; } #endif |