diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 6aa535c5e..9b9d15988 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -222,7 +222,7 @@ jobs: ./runtest-sentinel && ./runtest-cluster - test-alpine: + test-alpine-jemalloc: runs-on: ubuntu-latest container: alpine:latest steps: @@ -241,3 +241,23 @@ jobs: run: ./runtest-sentinel - name: cluster tests run: ./runtest-cluster + + test-alpine-libc-malloc: + runs-on: ubuntu-latest + container: alpine:latest + steps: + - uses: actions/checkout@v2 + - name: make + run: | + apk add build-base + make REDIS_CFLAGS='-Werror' USE_JEMALLOC=no + - name: test + run: | + apk add tcl procps + ./runtest --accurate --verbose --dump-logs + - name: module api test + run: ./runtest-moduleapi --verbose + - name: sentinel tests + run: ./runtest-sentinel + - name: cluster tests + run: ./runtest-cluster diff --git a/src/zmalloc.c b/src/zmalloc.c index c8d6c825f..fbac09616 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -32,6 +32,7 @@ #include #include #include +#include /* This function provide us access to the original libc free(). This is useful * for instance to free results obtained by backtrace_symbols(). We need @@ -49,18 +50,14 @@ void zlibc_free(void *ptr) { #ifdef HAVE_MALLOC_SIZE #define PREFIX_SIZE (0) +#define ASSERT_NO_SIZE_OVERFLOW(sz) #else #if defined(__sun) || defined(__sparc) || defined(__sparc__) #define PREFIX_SIZE (sizeof(long long)) #else #define PREFIX_SIZE (sizeof(size_t)) #endif -#endif - -#if PREFIX_SIZE > 0 #define ASSERT_NO_SIZE_OVERFLOW(sz) assert((sz) + PREFIX_SIZE > (sz)) -#else -#define ASSERT_NO_SIZE_OVERFLOW(sz) #endif /* Explicitly override malloc/free etc when using tcmalloc. */