openmp: Add basic library allocator support

Jakub Jelinek jakub@redhat.com
Tue Jun 2 09:58:05 GMT 2020


On Tue, Jun 02, 2020 at 11:26:37AM +0200, Sebastian Huber wrote:
> with this patch I get the following error for target arm-rtems6:
> 
> ../../../gnu-mirror-gcc-86b14bb/libgomp/allocator.c: In function 'omp_free':
> ../../../gnu-mirror-gcc-86b14bb/libgomp/allocator.c:351:42: error: 'struct
> omp_mem_header' has no member named 'new_size'
>   351 |    allocator_data->used_pool_size -= data->new_size;
>       |                                          ^~

Oops, sorry, fixed thusly, tested also with #undef HAVE_SYNC_BUILTINS early
in the file, committed to trunk.

2020-06-02  Jakub Jelinek  <jakub@redhat.com>

	* allocator.c (omp_free): Fix up build if HAVE_SYNC_BUILTINS is not
	defined.

--- libgomp/allocator.c
+++ libgomp/allocator.c
@@ -348,7 +348,7 @@ omp_free (void *ptr, omp_allocator_handle_t allocator)
 			      MEMMODEL_RELAXED);
 #else
 	  gomp_mutex_lock (&allocator_data->lock);
-	  allocator_data->used_pool_size -= data->new_size;
+	  allocator_data->used_pool_size -= data->size;
 	  gomp_mutex_unlock (&allocator_data->lock);
 #endif
 	}


	Jakub



More information about the Gcc-patches mailing list