Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace session pointer with refcount #322

Merged
merged 36 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0f36124
Fix c99 compilation (#317)
jean-roland Jan 12, 2024
b399310
Merge branch 'eclipse-zenoh:main' into main
jean-roland Jan 17, 2024
c1e7388
Merge branch 'eclipse-zenoh:main' into main
jean-roland Jan 18, 2024
59a40a0
fix: set correct session pointer type
jean-roland Jan 12, 2024
ecbc147
refactor: rename sptr to rc
jean-roland Jan 12, 2024
e1de7d4
feat: add compiler based definition
jean-roland Jan 12, 2024
790d666
fix: allocate int instead of int pointer
jean-roland Jan 12, 2024
42f8136
fix: align implementation counter size
jean-roland Jan 12, 2024
3281c90
fix: require single thread config to use single thread implem
jean-roland Jan 12, 2024
0d84724
feat: add c99 gcc rc implementation
jean-roland Jan 12, 2024
fa0bcfb
refactor: rename derived sptr types to rc
jean-roland Jan 12, 2024
5320e0a
feat: name anon struct for forward declaration
jean-roland Jan 12, 2024
06a0846
feat: add _z_session refcounter type
jean-roland Jan 12, 2024
4dc768b
chore: clang-format
jean-roland Jan 12, 2024
76e17c4
chore: update gitignore
jean-roland Jan 15, 2024
5f5c228
build: add compiler id log
jean-roland Jan 15, 2024
104fff5
build: add compiler symbol on platformio builds
jean-roland Jan 15, 2024
dc67d97
feat: remove superfluous function
jean-roland Jan 15, 2024
f04c5a5
feat: go through indirect session pointer
jean-roland Jan 15, 2024
9161fce
fix: use correct type type for session pointers
jean-roland Jan 16, 2024
b119691
feat: use session ref counter in z_session
jean-roland Jan 16, 2024
9e293bd
fix: prevent segfault when clearing empty session
jean-roland Jan 16, 2024
253073e
fix: drop owned config all the time
jean-roland Jan 16, 2024
974c87e
feat: add new_from_val rc function
jean-roland Jan 17, 2024
0a834ff
feat: switch publisher sesssion ptr to rc
jean-roland Jan 17, 2024
50c5e79
feat: switch subscriber session ptr to rc
jean-roland Jan 17, 2024
1a37eec
fix: remove unnecessary dependency
jean-roland Jan 17, 2024
fe05e71
fix: add necessary dependency
jean-roland Jan 17, 2024
de19579
feat: switch queryable session ptr to rc
jean-roland Jan 17, 2024
f72df5b
refactor: flatten queryable primitives
jean-roland Jan 17, 2024
8232fc2
refactor: flatten subscriber primitives
jean-roland Jan 17, 2024
34378c1
refactor: flatten publisher primitives
jean-roland Jan 17, 2024
6b6f20e
feat: change rc to use a single inner pointer
jean-roland Jan 18, 2024
a48cdd3
feat: mutualize rc code between implems
jean-roland Jan 18, 2024
d4fb72b
chore: clang-format
jean-roland Jan 18, 2024
7e9441a
fix: compilation issues
jean-roland Jan 18, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/arduino_esp32.yaml
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ jobs:

mkdir -p $ARDUINO_BASE
cd $ARDUINO_BASE
platformio init -b esp32thing_plus --project-option="build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3"
platformio init -b esp32thing_plus --project-option="build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC"

cd $ARDUINO_BASE/lib
ln -s $ZENOH_PICO_BASE
2 changes: 1 addition & 1 deletion .github/workflows/mbed.yaml
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ jobs:

mkdir -p $MBED_BASE
cd $MBED_BASE
pio init -b nucleo_f767zi --project-option="framework=mbed" --project-option="build_flags=-DZ_FEATURE_LINK_SERIAL=1 -DZENOH_DEBUG=3"
pio init -b nucleo_f767zi --project-option="framework=mbed" --project-option="build_flags=-DZ_FEATURE_LINK_SERIAL=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC"

cd $MBED_BASE/lib
ln -s $ZENOH_PICO_BASE
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CMake
build
crossbuilds

# vscode
.vscode
@@ -52,6 +53,7 @@ cmake-build-release
*.su
*.idb
*.pdb
*.sarif

# Kernel Module Compile Results
*.mod*
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)

set(CHECK_THREADS "ON")

# System definition
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definition(ZENOH_LINUX)
elseif(POSIX_COMPATIBLE)
@@ -101,6 +102,20 @@ else()
return()
endif()

# Compiler definition
message("Compilers in use: ${CMAKE_C_COMPILER_ID}, ${CMAKE_CXX_COMPILER_ID}")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_definition(ZENOH_COMPILER_CLANG)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_definition(ZENOH_COMPILER_GCC)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_C_COMPILER_ID STREQUAL "Intel")
add_definition(ZENOH_COMPILER_INTEL)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_COMPILER_ID STREQUAL "MSVC")
add_definition(ZENOH_COMPILER_MSVC)
else()
add_definition(ZENOH_COMPILER_OTHER)
endif()

add_definition(ZENOH_DEBUG=${ZENOH_DEBUG})

if(FRAG_MAX_SIZE)
7 changes: 5 additions & 2 deletions include/zenoh-pico/api/types.h
Original file line number Diff line number Diff line change
@@ -129,9 +129,12 @@ _OWNED_TYPE_PTR(_z_scouting_config_t, scouting_config)
* Represents a Zenoh session.
*/
typedef struct {
_z_session_t *_val;
_z_session_rc_t _val;
} z_session_t;
_OWNED_TYPE_PTR(_z_session_t, session)

typedef struct {
_z_session_rc_t _value;
} z_owned_session_t;

/**
* Represents a Zenoh (push) Subscriber entity.
155 changes: 0 additions & 155 deletions include/zenoh-pico/collections/pointer.h

This file was deleted.

Loading
Loading