summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraas <andras.horvath@gmail.com>2022-04-26 13:26:25 +0200
committerGitHub <noreply@github.com>2022-04-26 13:26:25 +0200
commit482b2f57ad6f0a6176c10d41623b4dbe27a29138 (patch)
tree47efcecc060324877a7f2f73e589d8af8a40fa33
parent2a15026ff65160127204881263464b1740a57198 (diff)
parentbf1dabe29f0a2de8d613b94bde87ed624ce03865 (diff)
Merge pull request #12 from Willian-Zhang/master
prepare for homebrew release
-rw-r--r--.gitignore34
-rw-r--r--CMakeLists.txt6
-rw-r--r--README4
-rw-r--r--mbw.c4
4 files changed, 45 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d924fe3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,34 @@
+build/
+
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app \ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f739d7d
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.10)
+
+project(mbw VERSION 1.4.1)
+
+add_executable(mbw mbw.c)
+install(TARGETS mbw DESTINATION bin)
diff --git a/README b/README
index 218fd8b..e8f466e 100644
--- a/README
+++ b/README
@@ -2,10 +2,12 @@ MBW determines the "copy" memory bandwidth available to userspace programs. Its
2006, 2012 Andras.Horvath atnospam gmail.com
2013 j.m.slocum atnospam gmail.com
+2022 Willian.Zhang
http://github.com/raas/mbw
+https://github.com/Willian-Zhang/mbw
+'mbw 1000' to run copy memory test on all methods with 1 GiB memory.
'mbw -h' for help
watch out for swap usage (or turn off swap)
-
diff --git a/mbw.c b/mbw.c
index acfbcff..884fd60 100644
--- a/mbw.c
+++ b/mbw.c
@@ -120,10 +120,10 @@ double worker(unsigned long long asize, long *a, long *b, int type, unsigned lon
char* bb = (char*)b;
gettimeofday(&starttime, NULL);
for (t=array_bytes; t >= block_size; t-=block_size, aa+=block_size){
- bb=mempcpy(bb, aa, block_size);
+ bb=(char *) memcpy(bb, aa, block_size) + block_size;
}
if(t) {
- bb=mempcpy(bb, aa, t);
+ bb=(char *) memcpy(bb, aa, t) + t;
}
gettimeofday(&endtime, NULL);
} else if(type==TEST_DUMB) { /* dumb test */