mirror of https://github.com/microsoft/mimalloc
Merge branch 'dev' into dev-exp
This commit is contained in:
commit
35b590de21
|
@ -163,7 +163,8 @@ target_include_directories(mimalloc-obj PUBLIC
|
|||
$<INSTALL_INTERFACE:${mi_install_dir}/include>
|
||||
)
|
||||
|
||||
install(TARGETS mimalloc-obj EXPORT mimalloc DESTINATION ${mi_install_dir})
|
||||
# seems to lead to cmake warnings/errors on some systems, disable for now :-(
|
||||
# install(TARGETS mimalloc-obj EXPORT mimalloc DESTINATION ${mi_install_dir})
|
||||
|
||||
install(FILES $<TARGET_OBJECTS:mimalloc-obj>
|
||||
DESTINATION ${mi_install_dir}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
|
||||
get_filename_component(MIMALLOC_TARGET_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH)
|
||||
|
|
|
@ -157,15 +157,15 @@ static inline uint32_t mi_atomic_subtract32(volatile uint32_t* p, uint32_t sub)
|
|||
}
|
||||
static inline bool mi_atomic_compare_exchange32(volatile uint32_t* p, uint32_t exchange, uint32_t compare) {
|
||||
MI_USING_STD
|
||||
return atomic_compare_exchange_weak_explicit((volatile _Atomic(uint32_t)*)p, &compare, exchange, memory_order_relaxed, memory_order_seq_cst);
|
||||
return atomic_compare_exchange_weak_explicit((volatile _Atomic(uint32_t)*)p, &compare, exchange, memory_order_release, memory_order_relaxed);
|
||||
}
|
||||
static inline bool mi_atomic_compare_exchange(volatile uintptr_t* p, uintptr_t exchange, uintptr_t compare) {
|
||||
MI_USING_STD
|
||||
return atomic_compare_exchange_weak_explicit((volatile atomic_uintptr_t*)p, &compare, exchange, memory_order_relaxed, memory_order_seq_cst);
|
||||
return atomic_compare_exchange_weak_explicit((volatile atomic_uintptr_t*)p, &compare, exchange, memory_order_release, memory_order_relaxed);
|
||||
}
|
||||
static inline uintptr_t mi_atomic_exchange(volatile uintptr_t* p, uintptr_t exchange) {
|
||||
MI_USING_STD
|
||||
return atomic_exchange_explicit((volatile atomic_uintptr_t*)p, exchange, memory_order_relaxed);
|
||||
return atomic_exchange_explicit((volatile atomic_uintptr_t*)p, exchange, memory_order_acquire);
|
||||
}
|
||||
static inline uintptr_t mi_atomic_read(volatile uintptr_t* p) {
|
||||
MI_USING_STD
|
||||
|
|
|
@ -31,7 +31,7 @@ target_link_libraries(static-override PUBLIC mimalloc-static)
|
|||
add_executable(static-override-cxx main-override.cpp)
|
||||
target_link_libraries(static-override-cxx PUBLIC mimalloc-static)
|
||||
|
||||
# and with a static object file; need to link with pthread explicitly :-(
|
||||
add_executable(static-override-obj main-override.c $<TARGET_OBJECTS:mimalloc-obj>)
|
||||
target_include_directories(static-override-obj PUBLIC $<TARGET_PROPERTY:mimalloc-obj,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
# and with a static object file
|
||||
add_executable(static-override-obj main-override.c ${MIMALLOC_TARGET_DIR}/mimalloc.o)
|
||||
target_include_directories(static-override-obj PUBLIC ${MIMALLOC_TARGET_DIR}/include)
|
||||
target_link_libraries(static-override-obj PUBLIC pthread)
|
||||
|
|
Loading…
Reference in New Issue