You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

96 lines
2.7 KiB

Index: src/buffer.c
--- src/buffer.c.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/buffer.c 2019-06-19 20:27:40.885224000 +0200
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include "buffer.h"
#include "rmalloc.h"
#include <assert.h>
Index: src/buffer.h
--- src/buffer.h.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/buffer.h 2019-06-19 20:27:40.885338000 +0200
@@ -6,6 +6,8 @@
#include <string.h>
#include <stdint.h>
#include <arpa/inet.h>
+#include <sys/types.h>
+#include <inttypes.h>
#define BUFFER_READ 0
#define BUFFER_WRITE 1
Index: src/concurrent_ctx.c
--- src/concurrent_ctx.c.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/concurrent_ctx.c 2019-06-19 20:27:40.885467000 +0200
@@ -137,7 +137,11 @@
/** Check the elapsed timer, and release the lock if enough time has passed */
int ConcurrentSearch_CheckTimer(ConcurrentSearchCtx *ctx) {
static struct timespec now;
+#ifdef CLOCK_MONOTONIC_RAW
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
+#else
+ clock_gettime(CLOCK_MONOTONIC, &now);
+#endif
long long durationNS = (long long)1000000000 * (now.tv_sec - ctx->lastTime.tv_sec) +
(now.tv_nsec - ctx->lastTime.tv_nsec);
@@ -159,7 +163,11 @@
}
void ConcurrentSearchCtx_ResetClock(ConcurrentSearchCtx *ctx) {
+#ifdef CLOCK_MONOTONIC_RAW
clock_gettime(CLOCK_MONOTONIC_RAW, &ctx->lastTime);
+#else
+ clock_gettime(CLOCK_MONOTONIC, &ctx->lastTime);
+#endif
ctx->ticker = 0;
}
Index: src/cursor.c
--- src/cursor.c.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/cursor.c 2019-06-19 20:27:40.885589000 +0200
@@ -8,7 +8,11 @@
static uint64_t curTimeNs() {
struct timespec tv;
+#ifdef CLOCK_MONOTONIC_RAW
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tv);
+#else
clock_gettime(CLOCK_MONOTONIC, &tv);
+#endif
return tv.tv_nsec + (tv.tv_sec * 1000000000);
}
Index: src/rmutil/sdsalloc.h
--- src/rmutil/sdsalloc.h.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/rmutil/sdsalloc.h 2019-06-19 20:27:41.836229000 +0200
@@ -37,12 +37,7 @@
* the include of your alternate allocator if needed (not needed in order
* to use the default libc allocator). */
-#if defined(__MACH__) || defined(__FreeBSD__)
#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-//#include "zmalloc.h"
#define s_malloc malloc
#define s_realloc realloc
#define s_free free
Index: src/tests/test_quantile.c
--- src/tests/test_quantile.c.orig 2019-06-19 12:38:46.000000000 +0200
+++ src/tests/test_quantile.c 2019-06-19 20:27:41.836343000 +0200
@@ -5,6 +5,7 @@
#include <stdint.h>
#include <assert.h>
#include <stdio.h>
+#include <inttypes.h>
static FILE *fp;
static Buffer buf;
@@ -48,4 +49,4 @@
TESTFUNC(testBasic);
Buffer_Free(&buf);
-})
\ No newline at end of file
+})