summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--config.h.in3
-rw-r--r--fastwriter.c9
3 files changed, 18 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6d683e..66d5cbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ set(FASTWRITER_ABI_VERSION "0")
cmake_minimum_required(VERSION 2.8)
set(DISABLE_XFS_REALTIME FALSE CACHE BOOL "Disable support of RealTime XFS partition")
-
+set(USE_CUSTOM_MEMCPY FALSE CACHE BOOL "Use custom memcpy routine instead of stanadrd")
include(CheckIncludeFiles)
check_include_files("linux/falloc.h" HAVE_LINUX_FALLOC_H)
@@ -25,8 +25,14 @@ include_directories(
add_definitions("-fPIC --std=c99 -Wall -O2 -pthread")
-set(HEADERS fastwriter.h sysinfo.h default.h private.h)
-add_library(fastwriter SHARED fastwriter.c sysinfo.c default.c memcpy.c)
+if (USE_CUSTOM_MEMCPY)
+ set(HEADERS fastwriter.h sysinfo.h default.h private.h memcpy.h)
+ add_library(fastwriter SHARED fastwriter.c sysinfo.c default.c memcpy.c)
+else (USE_CUSTOM_MEMCPY)
+ set(HEADERS fastwriter.h sysinfo.h default.h private.h)
+ add_library(fastwriter SHARED fastwriter.c sysinfo.c default.c)
+endif (USE_CUSTOM_MEMCPY)
+
set_target_properties(fastwriter PROPERTIES
VERSION ${FASTWRITER_VERSION}
diff --git a/config.h.in b/config.h.in
index 3627160..475acc5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,2 +1,3 @@
#cmakedefine HAVE_LINUX_FALLOC_H
-#cmakedefine DISABLE_XFS_REALTIME \ No newline at end of file
+#cmakedefine DISABLE_XFS_REALTIME
+#cmakedefine USE_CUSTOM_MEMCPY
diff --git a/fastwriter.c b/fastwriter.c
index c5bf301..08722fa 100644
--- a/fastwriter.c
+++ b/fastwriter.c
@@ -15,11 +15,16 @@
#include <fcntl.h>
-
#include "private.h"
#include "default.h"
#include "sysinfo.h"
-#include "memcpy.h"
+
+#ifdef USE_CUSTOM_MEMCPY
+# include "memcpy.h"
+#else /* USE_CUSTOM_MEMCPY */
+# define fast_memcpy memcpy
+#endif /* USE_CUSTOM_MEMCPY */
+
fastwriter_t *fastwriter_init(const char *fs, fastwriter_flags_t flags) {
fastwriter_t *ctx;