Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build/Test

on:
workflow_call:
workflow_dispatch:
inputs:
part:
required: false
default: ''

jobs:
build:
name: Build the library and run tests
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and install library
run: |
./configure --enable-static --enable-shared --enable-debug
make
sudo make install

- name: Run tests
run: |
make check
8 changes: 8 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: PR

on:
pull_request:

jobs:
build:
uses: ./.github/workflows/build-and-test.yaml
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.*
.git
*.o
*.lo
*.out
Expand Down
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ Revision history for XRCU

0.1 19/03/2019
- First public version

0.2 15/10/2025
- Allow custom allocators for all containers
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,26 @@ endif
STATIC_LIBS = libxrcu.$(STATIC_EXT)
SHARED_LIBS = libxrcu.$(DYNAMIC_EXT)

HEADERS = xrcu.hpp stack.hpp hash_table.hpp skip_list.hpp \
xatomic.hpp lwlock.hpp optional.hpp queue.hpp
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

I = $(ROOT_DIR)
S = $(ROOT_DIR)src

HEADERS = $(I)xrcu/xrcu.hpp \
$(I)xrcu/stack.hpp \
$(I)xrcu/hash_table.hpp \
$(I)xrcu/skip_list.hpp \
$(I)xrcu/xatomic.hpp \
$(I)xrcu/lwlock.hpp \
$(I)xrcu/queue.hpp

OBJS = $(S)/xrcu.o \
$(S)/hash_table.o \
$(S)/queue.o \
$(S)/stack.o \
$(S)/lwlock.o \
$(S)/utils.o

OBJS = xrcu.o hash_table.o stack.o lwlock.o skip_list.o queue.o utils.o
LOBJS = $(OBJS:.o=.lo)

TEST_OBJS = $(LOBJS)
Expand All @@ -25,7 +41,7 @@ ALL_LIBS = $(STATIC_LIBS) $(SHARED_LIBS)

AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
CXXFLAGS += $(CXXFLAGS_AUTO)
CXXFLAGS += $(CXXFLAGS_AUTO) -I$(I) -D_DEFAULT_SOURCE

all: $(ALL_LIBS)

Expand Down Expand Up @@ -53,5 +69,5 @@ install: $(ALL_LIBS)
cp $(HEADERS) $(includedir)/xrcu

clean:
rm -rf *.o *.lo libxrcu.* tst
rm -rf $(S)/*.o $(S)/*.lo libxrcu.* tst

2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ tryflag CXXFLAGS_TRY -Werror=ignored-optimization-argument
tryflag CXXFLAGS_EXTRA -Wa,--noexecstack

# See if the compiler accepts explicit standard versioning
tryflag CXXFLAGS -std=c++11
tryflag CXXFLAGS -std=c++17

# Enable optimizations
tryflag CXXFLAGS -O2
Expand Down
Loading