From 0f6a51f684e3bdaa9447e391c6c27c3ec8175708 Mon Sep 17 00:00:00 2001 From: Fan Wu <386534960@qq.com> Date: Mon, 23 Jul 2018 23:58:50 +0800 Subject: [PATCH 1/4] support ck 0.6.0, fix comile error with -Wno-varargs --- configure.ac | 4 ++-- include/phenom/hashtable.h | 2 ++ travis/deps.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index c33170a..15ab1db 100644 --- a/configure.ac +++ b/configure.ac @@ -140,7 +140,7 @@ esac # If you're bumping the CK max-version here, you must also bump it in # travis/deps.sh otherwise you will break the CI build -if ! $PKG_CONFIG --exists --atleast-version=0.5.0 --max-version=0.5.1 --print-errors ck ; then +if ! $PKG_CONFIG --exists --atleast-version=0.5.0 --max-version=0.6.0 --print-errors ck ; then AC_MSG_ERROR([ck is required]) fi CFLAGS="$CFLAGS `$PKG_CONFIG --cflags ck`" @@ -312,7 +312,7 @@ if test -n "$GCC" ; then -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wno-nested-externs -Winline -Wdisabled-optimization \ - -fstrict-aliasing -pipe -Wno-parentheses" + -fstrict-aliasing -pipe -Wno-parentheses -Wno-varargs" fi AC_SUBST(PC_CFLAGS) AC_SUBST(PC_LIBS) diff --git a/include/phenom/hashtable.h b/include/phenom/hashtable.h index 6b05fae..e7b3dd7 100644 --- a/include/phenom/hashtable.h +++ b/include/phenom/hashtable.h @@ -17,6 +17,8 @@ #ifndef PHENOM_HASHTABLE_H #define PHENOM_HASHTABLE_H +#include "phenom/defs.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/travis/deps.sh b/travis/deps.sh index 810c8eb..ba4715c 100755 --- a/travis/deps.sh +++ b/travis/deps.sh @@ -10,7 +10,7 @@ esac HERE=$PWD # There is no CK package available for ubuntu yet -CK_VER=0.5.1 +CK_VER=0.6.0 CK_RELEASE=https://github.com/concurrencykit/ck/archive/$CK_VER.tar.gz if test ! -f $CK_VER.tar.gz ; then wget $CK_RELEASE From 4955a7f58df2735cf09d828d15721223945b80ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=87=A1?= <> Date: Fri, 3 Aug 2018 19:00:35 +0800 Subject: [PATCH 2/4] fix ph_mem_realloc error if orig_size == size fix ph_mem_realloc error if orig_size == size --- corelib/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corelib/memory.c b/corelib/memory.c index 903d15a..22c49c9 100644 --- a/corelib/memory.c +++ b/corelib/memory.c @@ -440,7 +440,6 @@ void *ph_mem_realloc(ph_memtype_t mt, void *ptr, uint64_t size) hdr = ptr; hdr--; - ptr = hdr; if (hdr->mt != mt) { memory_panic("ph_mem_realloc: hdr->mt %d != caller provided mt %d %s", @@ -452,6 +451,7 @@ void *ph_mem_realloc(ph_memtype_t mt, void *ptr, uint64_t size) return ptr; } + ptr = hdr; hdr = realloc(ptr, size + HEADER_RESERVATION); if (!hdr) { ph_counter_scope_add(mem_type->scope, From 1e77d471ceac902998a09174205b5bd719264734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=87=A1?= <> Date: Fri, 3 Aug 2018 19:07:39 +0800 Subject: [PATCH 3/4] remove end whitespace remove end whitespace --- corelib/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corelib/memory.c b/corelib/memory.c index 22c49c9..c049622 100644 --- a/corelib/memory.c +++ b/corelib/memory.c @@ -451,7 +451,7 @@ void *ph_mem_realloc(ph_memtype_t mt, void *ptr, uint64_t size) return ptr; } - ptr = hdr; + ptr = hdr; hdr = realloc(ptr, size + HEADER_RESERVATION); if (!hdr) { ph_counter_scope_add(mem_type->scope, From a52548bfd9f56bd0ac183389f7fdd2aff6a85ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=87=A1?= <> Date: Wed, 8 Aug 2018 14:20:43 +0800 Subject: [PATCH 4/4] Fix ph_string_make_slice error, slice->onstack should be false --- corelib/string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/corelib/string.c b/corelib/string.c index 5df7dc4..af2c074 100644 --- a/corelib/string.c +++ b/corelib/string.c @@ -61,6 +61,7 @@ ph_string_t *ph_string_make_slice(ph_string_t *str, } ph_string_init_slice(slice, str, start, len); + slice->onstack = false; return slice; }