mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user