Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can we have tests for ptr = NULL, size=0? Probably just replace alloc and free by these cases and check returned address after each call?
openmp/runtime/src/kmp_alloc.cpp | ||
---|---|---|
1585 | Shouldn't this be after handling size==0? |
Nice suggestion, agree with it.
openmp/runtime/src/kmp_alloc.cpp | ||
---|---|---|
1585 | Actually, the assertion does not make sense at all, because size_t is unsigned. |
Please also change the openmp/runtime/tools/generate-def.pl file in order to not break Windows build.
See https://reviews.llvm.org/D91478 as an example of the change made for omp_calloc function.
The tests have the same format type issue as in D90967. Feel free to include the fixes for the calloc tests in this review.
PS: this summary does not show the inline code suggestions. They are only inline below :(
openmp/runtime/test/api/omp_realloc_def_fb.c | ||
---|---|---|
20–21 | ||
openmp/runtime/test/api/omp_realloc_null_ptr.c | ||
20–21 ↗ | (On Diff #305540) | |
openmp/runtime/test/api/omp_realloc_size_0.c | ||
20–21 ↗ | (On Diff #305540) |
clang-tidy: warning: invalid case style for function '__kmpc_realloc' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'gtid' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'ptr' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'sz' [readability-identifier-naming]
not useful