File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 49
49
-DUMF_BUILD_BENCHMARKS=OFF
50
50
-DUMF_BUILD_TESTS=ON
51
51
-DUMF_FORMAT_CODE_STYLE=OFF
52
- -DUMF_DEVELOPER_MODE=OFF
52
+ -DUMF_DEVELOPER_MODE=ON
53
53
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
54
54
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
55
55
-DUMF_TESTS_FAIL_ON_SKIP=ON
Original file line number Diff line number Diff line change @@ -111,6 +111,16 @@ else()
111
111
message (FATAL_ERROR "Unknown OS type" )
112
112
endif ()
113
113
114
+ if ((DEFINED ENV{CI} ) AND (DEFINED ENV{GITHUB_ACTION} ))
115
+ set (UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
116
+ UMF_CI_GITHUB_ACTION=1 )
117
+ endif ()
118
+
119
+ if (UMF_DEVELOPER_MODE )
120
+ set (UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
121
+ UMF_DEVELOPER_MODE=1 )
122
+ endif ()
123
+
114
124
if (NOT UMF_BUILD_LIBUMF_POOL_JEMALLOC )
115
125
set (UMF_POOL_JEMALLOC_ENABLED FALSE )
116
126
set (JEMALLOC_FOUND FALSE )
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ set(UMF_CUDA_INCLUDE_DIR
14
14
# Compile definitions for UMF library.
15
15
#
16
16
# TODO: Cleanup the compile definitions across all the CMake files
17
- set (UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION} )
17
+ set (UMF_COMMON_COMPILE_DEFINITIONS ${UMF_COMMON_COMPILE_DEFINITIONS}
18
+ UMF_VERSION=${UMF_VERSION} )
18
19
19
20
set (BA_SOURCES
20
21
${CMAKE_CURRENT_SOURCE_DIR} /base_alloc/base_alloc.c
Original file line number Diff line number Diff line change @@ -303,7 +303,18 @@ void umf_ba_destroy(umf_ba_pool_t *pool) {
303
303
#ifndef NDEBUG
304
304
ba_debug_checks (pool );
305
305
if (pool -> metadata .n_allocs ) {
306
- LOG_ERR ("pool->metadata.n_allocs = %zu" , pool -> metadata .n_allocs );
306
+ LOG_ERR ("number of base allocator memory leaks: %zu" ,
307
+ pool -> metadata .n_allocs );
308
+
309
+ #ifdef UMF_DEVELOPER_MODE
310
+ assert (pool -> metadata .n_allocs == 0 &&
311
+ "memory leaks in base allocator occurred" );
312
+ #endif
313
+
314
+ // UMF_DEVELOPER_MODE should be turned on in CI
315
+ #if defined(UMF_CI_GITHUB_ACTION ) && !defined(UMF_DEVELOPER_MODE )
316
+ #error UMF_DEVELOPER_MODE is not defined!
317
+ #endif
307
318
}
308
319
#endif /* NDEBUG */
309
320
You can’t perform that action at this time.
0 commit comments