Skip to content

Commit 18142e5

Browse files
authored
This improves the runtime dispatching. (#43)
* This improves the runtime dispatching. * Upgrading VS * Updating.
1 parent 0fa291b commit 18142e5

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

.github/workflows/vs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: VS16-CI
1+
name: VS17-CI
22

33
on:
44
push:
@@ -13,16 +13,16 @@ jobs:
1313
if: >-
1414
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
1515
! contains(toJSON(github.event.commits.*.message), '[skip github]')
16-
name: windows-vs16
16+
name: windows-vs17
1717
runs-on: windows-latest
1818
strategy:
1919
fail-fast: false
2020
matrix:
2121
include:
22-
- {gen: Visual Studio 16 2019, arch: Win32, static: ON}
23-
- {gen: Visual Studio 16 2019, arch: Win32, static: OFF}
24-
- {gen: Visual Studio 16 2019, arch: x64, static: ON}
25-
- {gen: Visual Studio 16 2019, arch: x64, static: OFF}
22+
- {gen: Visual Studio 17 2022, arch: Win32, static: ON}
23+
- {gen: Visual Studio 17 2022, arch: Win32, static: OFF}
24+
- {gen: Visual Studio 17 2022, arch: x64, static: ON}
25+
- {gen: Visual Studio 17 2022, arch: x64, static: OFF}
2626
steps:
2727
- name: checkout
2828
uses: actions/checkout@v2

CMakeLists.txt

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
cmake_minimum_required(VERSION 3.3)
22
set(CMAKE_MACOSX_RPATH OFF)
3-
if (NOT CMAKE_BUILD_TYPE)
4-
message(STATUS "No build type selected, default to Release")
5-
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
6-
endif()
7-
83
project(STREAMVBYTE VERSION "1.0.0")
94

105
set(STREAMVBYTE_LIB_VERSION "1.0.0" CACHE STRING "streamvbyte library version")
116
set(STREAMVBYTE_LIB_SOVERSION "1" CACHE STRING "streamvbyte library soversion")
127

138
set(CMAKE_C_STANDARD 99)
149
set(CMAKE_C_STANDARD_REQUIRED ON)
10+
option(STREAMVBYTE_SANITIZE "Sanitize addresses" OFF)
11+
if (NOT CMAKE_BUILD_TYPE)
12+
message(STATUS "No build type selected")
13+
if(STREAMVBYTE_SANITIZE)
14+
message(STATUS "Default to Debug")
15+
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
16+
else()
17+
message(STATUS "Default to Release")
18+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
19+
endif()
20+
endif()
21+
22+
if(STREAMVBYTE_SANITIZE)
23+
message(STATUS "Enabling memory sanitizer.")
24+
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
25+
add_compile_definitions(ASAN_OPTIONS=detect_leaks=1)
26+
endif()
27+
1528
if (MSVC)
1629
add_definitions(
1730
"-D__restrict__=__restrict"
@@ -70,6 +83,7 @@ install(
7083
TARGETS streamvbyte streamvbyte_static
7184
DESTINATION lib)
7285

86+
7387
option(STREAMVBYTE_SANITIZE_UNDEFINED "Sanitize undefined behavior" OFF)
7488
if(STREAMVBYTE_SANITIZE_UNDEFINED)
7589
add_compile_options(-fsanitize=undefined -fno-sanitize-recover=all)

src/streamvbyte_isadetection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static inline bool streamvbyte_ssse3() {
230230
}
231231
#else
232232
static inline bool streamvbyte_ssse3() {
233-
return (dynamic_streamvbyte_detect_supported_architectures() & streamvbyte_SSSE3) == streamvbyte_SSSE3;
233+
return (streamvbyte_detect_supported_architectures() & streamvbyte_SSSE3) == streamvbyte_SSSE3;
234234
}
235235
#endif
236236

0 commit comments

Comments
 (0)