Skip to content

test and fix UMF simplest build #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,33 @@ jobs:
- os: windows-latest
disjoint: 'OFF'
build_tests: 'ON'
simple_cmake: 'OFF'
# pure C build (Windows)
- os: windows-latest
disjoint: 'OFF'
# Tests' building is off for a pure C build
build_tests: 'OFF'
simple_cmake: 'OFF'
- os: ubuntu-latest
disjoint: 'ON'
build_tests: 'ON'
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
simple_cmake: 'OFF'
# pure C build (Linux)
- os: ubuntu-latest
disjoint: 'OFF'
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
# Tests' building is off for a pure C build
build_tests: 'OFF'
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON'
simple_cmake: 'OFF'
# simplest CMake
- os: ubuntu-latest
disjoint: 'OFF'
build_tests: 'ON'
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
simple_cmake: 'ON'
runs-on: ${{matrix.os}}

steps:
Expand Down Expand Up @@ -68,6 +78,7 @@ jobs:
run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"

- name: Configure CMake
if: matrix.simple_cmake == 'OFF'
run: >
cmake
-B ${{github.workspace}}/build
Expand All @@ -83,6 +94,16 @@ jobs:
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{matrix.extra_build_options}}

- name: Configure CMake (simple)
if: matrix.simple_cmake == 'ON'
run: >
cmake
-B ${{github.workspace}}/build
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{matrix.extra_build_options}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release -j

Expand Down
12 changes: 6 additions & 6 deletions include/umf/proxy_lib_new_delete.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ static inline void *internal_aligned_alloc(size_t alignment, size_t size) {
#define decl_new_nothrow(n) [[nodiscard]]
#endif // defined(_MSC_VER) && defined(_Ret_notnull_) && defined(_Post_writable_byte_size_)

void operator delete(void *p) noexcept { free(p); };
void operator delete[](void *p) noexcept { free(p); };
void operator delete(void *p) noexcept { free(p); }
void operator delete[](void *p) noexcept { free(p); }

void operator delete(void *p, const std::nothrow_t &) noexcept { free(p); }
void operator delete[](void *p, const std::nothrow_t &) noexcept { free(p); }
Expand All @@ -96,11 +96,11 @@ decl_new_nothrow(n) void *operator new[](std::size_t n,
void operator delete(void *p, std::size_t n) noexcept {
(void)(n);
free(p);
};
}
void operator delete[](void *p, std::size_t n) noexcept {
(void)(n);
free(p);
};
}
#endif // (__cplusplus >= 201402L || _MSC_VER >= 1916)

#if (__cplusplus > 201402L || defined(__cpp_aligned_new))
Expand All @@ -116,12 +116,12 @@ void operator delete(void *p, std::size_t n, std::align_val_t al) noexcept {
(void)(n);
(void)(al);
free(p);
};
}
void operator delete[](void *p, std::size_t n, std::align_val_t al) noexcept {
(void)(n);
(void)(al);
free(p);
};
}
void operator delete(void *p, std::align_val_t al,
const std::nothrow_t &) noexcept {
(void)(al);
Expand Down
4 changes: 3 additions & 1 deletion src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ endif()
if(LINUX OR MACOSX)
set(UMF_UTILS_SOURCES ${UMF_UTILS_SOURCES_COMMON}
${UMF_UTILS_SOURCES_POSIX})
set(UMF_UTILS_LIBS dl)
elseif(WINDOWS)
set(UMF_UTILS_SOURCES ${UMF_UTILS_SOURCES_COMMON}
${UMF_UTILS_SOURCES_WINDOWS})
Expand All @@ -41,7 +42,8 @@ add_library(umf_utils INTERFACE)
add_library(${PROJECT_NAME}::utils ALIAS umf_utils)

target_sources(umf_utils INTERFACE ${UMF_UTILS_SOURCES})
target_link_libraries(umf_utils INTERFACE ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(umf_utils INTERFACE ${CMAKE_THREAD_LIBS_INIT}
${UMF_UTILS_LIBS})

target_include_directories(
umf_utils
Expand Down