Add alpine-dev container to test matrix

This commit is contained in:
Roman Gershman 2022-02-19 22:56:09 +02:00
parent b606613762
commit 29f5052c4d
5 changed files with 15 additions and 44 deletions

View File

@ -10,7 +10,6 @@ on:
env: env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug BUILD_TYPE: Debug
CXX: g++-9
jobs: jobs:
build: build:
# The CMake configure and build commands are platform agnostic and should work equally # The CMake configure and build commands are platform agnostic and should work equally
@ -18,9 +17,13 @@ jobs:
# cross-platform coverage. # cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 90 strategy:
matrix:
# Test of these containers
container: ["ubuntu-dev", "alpine-dev"]
timeout-minutes: 30
container: container:
image: ghcr.io/${{ github.actor }}/ubuntu-dev:latest image: ghcr.io/${{ github.actor }}/${{ matrix.container }}:latest
credentials: credentials:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,6 +1,7 @@
add_library(dfly_core compact_object.cc dragonfly_core.cc interpreter.cc add_library(dfly_core compact_object.cc dragonfly_core.cc interpreter.cc
tx_queue.cc) tx_queue.cc)
cxx_link(dfly_core base absl::flat_hash_map absl::str_format redis_lib TRDP::lua crypto) cxx_link(dfly_core base absl::flat_hash_map absl::str_format redis_lib TRDP::lua
Boost::fiber crypto)
cxx_test(dfly_core_test dfly_core LABELS DFLY) cxx_test(dfly_core_test dfly_core LABELS DFLY)
cxx_test(compact_object_test dfly_core LABELS DFLY) cxx_test(compact_object_test dfly_core LABELS DFLY)

View File

@ -85,7 +85,7 @@ void CompactBlob::MakeRoom(size_t current_cap, size_t desired, std::pmr::memory_
// here we break pmr model since we use non-pmr api of fetching usable size based on pointer. // here we break pmr model since we use non-pmr api of fetching usable size based on pointer.
size_t CompactBlob::capacity() const { size_t CompactBlob::capacity() const {
return malloc_usable_size(ptr_); return zmalloc_size(ptr_);
} }
size_t RobjWrapper::MallocUsed() const { size_t RobjWrapper::MallocUsed() const {
@ -174,6 +174,7 @@ uint64_t RobjWrapper::HashCode() const {
default: default:
LOG(FATAL) << "Unsupported type for hashcode " << type; LOG(FATAL) << "Unsupported type for hashcode " << type;
} }
return 0;
} }
bool RobjWrapper::Equal(const RobjWrapper& ow) const { bool RobjWrapper::Equal(const RobjWrapper& ow) const {

2
helio

@ -1 +1 @@
Subproject commit 84c1b2ca38d077eaae347098e56f451aad2caa2b Subproject commit ec055f6bb2476aaebda441cbf1fc3c738bf5a4c6

View File

@ -37,17 +37,7 @@
#define __xstr(s) __zm_str(s) #define __xstr(s) __zm_str(s)
#define __zm_str(s) #s #define __zm_str(s) #s
#if defined(USE_TCMALLOC) #if defined(USE_JEMALLOC)
#define ZMALLOC_LIB ("tcmalloc-" __xstr(TC_VERSION_MAJOR) "." __xstr(TC_VERSION_MINOR))
#include <google/tcmalloc.h>
#if (TC_VERSION_MAJOR == 1 && TC_VERSION_MINOR >= 6) || (TC_VERSION_MAJOR > 1)
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) tc_malloc_size(p)
#else
#error "Newer version of tcmalloc required"
#endif
#elif defined(USE_JEMALLOC)
#define ZMALLOC_LIB ("jemalloc-" __xstr(JEMALLOC_VERSION_MAJOR) "." __xstr(JEMALLOC_VERSION_MINOR) "." __xstr(JEMALLOC_VERSION_BUGFIX)) #define ZMALLOC_LIB ("jemalloc-" __xstr(JEMALLOC_VERSION_MAJOR) "." __xstr(JEMALLOC_VERSION_MINOR) "." __xstr(JEMALLOC_VERSION_BUGFIX))
#include <jemalloc/jemalloc.h> #include <jemalloc/jemalloc.h>
#if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2) #if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2)
@ -73,16 +63,8 @@
*/ */
#ifndef ZMALLOC_LIB #ifndef ZMALLOC_LIB
#define ZMALLOC_LIB "libc" #define ZMALLOC_LIB "libc"
#if !defined(NO_MALLOC_USABLE_SIZE) && \
(defined(__GLIBC__) || defined(__FreeBSD__) || \
defined(USE_MALLOC_USABLE_SIZE))
/* Includes for malloc_usable_size() */
#ifdef __FreeBSD__
#include <malloc_np.h>
#else
#include <malloc.h> #include <malloc.h>
#endif
#define HAVE_MALLOC_SIZE 1 #define HAVE_MALLOC_SIZE 1
#ifdef USE_ZMALLOC_MI #ifdef USE_ZMALLOC_MI
@ -90,8 +72,8 @@
#else #else
#define zmalloc_size(p) malloc_usable_size(p) #define zmalloc_size(p) malloc_usable_size(p)
#endif #endif
#endif
#endif #endif // ZMALLOC_LIB
/* We can enable the Redis defrag capabilities only if we are using Jemalloc /* We can enable the Redis defrag capabilities only if we are using Jemalloc
* and the version used is our special version modified for Redis having * and the version used is our special version modified for Redis having
@ -131,22 +113,6 @@ size_t zmalloc_usable_size(const void* p);
// roman: void zlibc_free(void *ptr); // roman: void zlibc_free(void *ptr);
#ifdef HAVE_DEFRAG
void zfree_no_tcache(void *ptr);
void *zmalloc_no_tcache(size_t size);
#endif
#ifndef HAVE_MALLOC_SIZE
size_t zmalloc_size(void *ptr);
size_t zmalloc_usable_size(void *ptr);
#else
// #define zmalloc_usable_size(p) zmalloc_size(p)
#endif
#ifdef REDIS_TEST
int zmalloc_test(int argc, char **argv, int accurate);
#endif
extern __thread ssize_t used_memory_tl; extern __thread ssize_t used_memory_tl;
void init_zmalloc_threadlocal(); void init_zmalloc_threadlocal();