Skip to content
Snippets Groups Projects
Commit 99d85bb4 authored by Alexandr's avatar Alexandr
Browse files

added multithread qsort_arg_mt

parent 957f3ed6
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ macro(libmisc_build)
set(misc_src
${PROJECT_SOURCE_DIR}/third_party/crc32.c
${PROJECT_SOURCE_DIR}/third_party/proctitle.c
${PROJECT_SOURCE_DIR}/third_party/qsort_arg.c
${PROJECT_SOURCE_DIR}/third_party/PMurHash.c
${PROJECT_SOURCE_DIR}/third_party/base64.c
)
......
......@@ -39,6 +39,18 @@ if((NOT HAVE_STD_C11 AND NOT HAVE_STD_GNU99) OR
"Please consider upgrade to gcc 4.5+ or clang 3.2+.")
endif()
#
# Check for an omp support
#
set(CMAKE_REQUIRED_FLAGS "-fopenmp")
check_cxx_source_compiles("int main(void) { return 0; }" HAVE_OPENMP)
set(CMAKE_REQUIRED_FLAGS "")
if (HAVE_OPENMP)
message (STATUS "OpenMP support found")
else ()
message (WARNING "OpenMP support not found")
endif ()
#
# Perform build type specific configuration.
#
......@@ -114,6 +126,10 @@ macro(enable_tnt_compile_flags)
)
endif()
if (HAVE_OPENMP)
add_compile_flags("C;CXX" "-fopenmp")
endif()
add_definitions("-D__STDC_FORMAT_MACROS=1")
add_definitions("-D__STDC_LIMIT_MACROS=1")
add_definitions("-D__STDC_CONSTANT_MACROS=1")
......
......@@ -73,6 +73,7 @@ set (common_sources
crc32.c
rope.c
ipc.cc
qsort_arg_mt.cc
lua/fiber.cc
lua/admin.cc
lua/info.cc
......
......@@ -31,12 +31,13 @@
#include "index.h"
#include <qsort_arg_mt.h>
#include <third_party/sptree.h>
/**
* Instantiate sptree definitions
*/
SPTREE_DEF(index, realloc);
SPTREE_DEF(index, realloc, qsort_arg_mt);
class TreeIndex: public Index {
public:
......
......@@ -32,8 +32,6 @@
#include <stdlib.h>
#include <math.h>
#include <third_party/qsort_arg.h>
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
......@@ -99,7 +97,7 @@ typedef struct sptree_node_pointers {
* void* sptree_NAME_iterator_reverse_next(sptree_NAME_iterator *i)
*/
#define SPTREE_DEF(name, realloc) \
#define SPTREE_DEF(name, realloc, qsort_arg) \
typedef int (*sptree_##name##_compare)(const void *, const void *, void *); \
\
typedef struct sptree_##name { \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment