Browse Source

Seems new memcpy is only good for ipepdvcompute2, make it optional and disabled by default

Suren A. Chilingaryan 11 years ago
parent
commit
83ebc0af67
3 changed files with 18 additions and 6 deletions
  1. 9 3
      CMakeLists.txt
  2. 2 1
      config.h.in
  3. 7 2
      fastwriter.c

+ 9 - 3
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}

+ 2 - 1
config.h.in

@@ -1,2 +1,3 @@
 #cmakedefine HAVE_LINUX_FALLOC_H
-#cmakedefine DISABLE_XFS_REALTIME
+#cmakedefine DISABLE_XFS_REALTIME
+#cmakedefine USE_CUSTOM_MEMCPY

+ 7 - 2
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;