Explorar o código

add some sanity checks

Cédric Augonnet %!s(int64=16) %!d(string=hai) anos
pai
achega
09d33f8777
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/common/malloc.c

+ 4 - 0
src/common/malloc.c

@@ -44,6 +44,8 @@ static void malloc_pinned_codelet(struct data_interface_s *buffers __attribute__
 
 void starpu_malloc_pinned_if_possible(void **A, size_t dim)
 {
+	STARPU_ASSERT(A);
+
 	if (may_submit_cuda_task())
 	{
 #ifdef USE_CUDA
@@ -76,4 +78,6 @@ void starpu_malloc_pinned_if_possible(void **A, size_t dim)
 	else {
 		*A = malloc(dim);
 	}
+
+	STARPU_ASSERT(*A);
 }