[Openmp-commits] [PATCH] D90967: [OpenMP] Add OpenMP 5.1 omp_calloc function implementation

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 9 06:54:44 PST 2020


AndreyChurbanov added inline comments.


================
Comment at: openmp/runtime/src/kmp_alloc.cpp:1448
   KMP_DEBUG_ASSERT(__kmp_init_serial);
+  KMP_DEBUG_ASSERT(size > 0);
+  if (size == 0)
----------------
This assertion is wrong, as the size is allowed to be 0.  Please remove it.


================
Comment at: openmp/runtime/src/kmp_alloc.cpp:1586
+  KMP_DEBUG_ASSERT(__kmp_init_serial);
+  KMP_DEBUG_ASSERT(nmemb > 0);
+  KMP_DEBUG_ASSERT(size > 0);
----------------
Both nmemb and size can be 0 and their type is unsigned. Please remove the assertions with them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90967/new/

https://reviews.llvm.org/D90967



More information about the Openmp-commits mailing list