From fdfd54c4246246f57387637bf042da02cc2e825e Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Thu, 30 May 2024 10:43:12 +0300 Subject: [PATCH] switch back to unconditional shared-memory API compilation --- Cargo.toml | 2 +- Cargo.toml.in | 2 +- build-resources/opaque-types/Cargo.toml | 2 +- include/zenoh_commons.h | 263 ++++++++++++++++-------- include/zenoh_macros.h | 90 +++++++- 5 files changed, 274 insertions(+), 85 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5b8393b06..cf8bfaad5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ build = "build.rs" logger-autoinit = [] shared-memory = ["zenoh/shared-memory", "zenoh-ext/shared-memory", "zenoh-protocol/shared-memory",] unstable = [] -default = ["zenoh/default"] +default = ["zenoh/default", "unstable", "shared-memory"] [badges] maintenance = { status = "actively-developed" } diff --git a/Cargo.toml.in b/Cargo.toml.in index 2d8f4078b..e193d19a1 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -34,7 +34,7 @@ build = "@CARGO_PROJECT_DIR@build.rs" logger-autoinit = [] shared-memory = ["zenoh/shared-memory", "zenoh-ext/shared-memory", "zenoh-protocol/shared-memory",] unstable = [] -default = ["zenoh/default"] +default = ["zenoh/default", "unstable", "shared-memory"] [badges] maintenance = { status = "actively-developed" } diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml index 0fa9d7d05..e5696e0c2 100644 --- a/build-resources/opaque-types/Cargo.toml +++ b/build-resources/opaque-types/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [features] shared-memory = ["zenoh/shared-memory", "zenoh-ext/shared-memory"] unstable = [] -default = ["zenoh/default"] +default = ["zenoh/default", "unstable", "shared-memory"] [dependencies] # shared-memory enabled for zenoh even if zenoh-c "shared-memory" feature is disabled. This is to make "std::mem::transmute" work for `ZSLice` diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index feb7d888f..42f48c861 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -197,6 +197,12 @@ typedef enum zcu_reply_keyexpr_t { */ ZCU_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zcu_reply_keyexpr_t; +/** + * An owned BufAllocResult + */ +typedef struct ALIGN(8) z_owned_buf_alloc_result_t { + uint8_t _0[88]; +} z_owned_buf_alloc_result_t; /** * A loaned SharedMemoryProvider's AllocLayout */ @@ -277,6 +283,18 @@ typedef struct zc_threadsafe_context_t { struct zc_threadsafe_context_data_t context; void (*delete_fn)(void*); } zc_threadsafe_context_t; +/** + * A loaned BufAllocResult + */ +typedef struct ALIGN(8) z_loaned_buf_alloc_result_t { + uint8_t _0[80]; +} z_loaned_buf_alloc_result_t; +/** + * An owned ZShmMut slice + */ +typedef struct ALIGN(8) z_owned_shm_mut_t { + uint8_t _0[80]; +} z_owned_shm_mut_t; /** * A serialized Zenoh data. * @@ -291,6 +309,18 @@ typedef struct ALIGN(8) z_owned_bytes_t { typedef struct ALIGN(8) z_loaned_bytes_t { uint8_t _0[40]; } z_loaned_bytes_t; +/** + * A loaned ZShm slice + */ +typedef struct ALIGN(8) z_loaned_shm_t { + uint8_t _0[80]; +} z_loaned_shm_t; +/** + * An owned ZShm slice + */ +typedef struct ALIGN(8) z_owned_shm_t { + uint8_t _0[80]; +} z_owned_shm_t; /** * A contiguous owned sequence of bytes allocated by Zenoh. */ @@ -341,6 +371,18 @@ typedef struct ALIGN(8) z_owned_bytes_writer_t { typedef struct ALIGN(8) z_loaned_bytes_writer_t { uint8_t _0[16]; } z_loaned_bytes_writer_t; +/** + * An owned ChunkAllocResult + */ +typedef struct ALIGN(8) z_owned_chunk_alloc_result_t { + uint8_t _0[32]; +} z_owned_chunk_alloc_result_t; +/** + * A loaned ChunkAllocResult + */ +typedef struct ALIGN(8) z_loaned_chunk_alloc_result_t { + uint8_t _0[32]; +} z_loaned_chunk_alloc_result_t; /** * Unique segment identifier */ @@ -774,12 +816,36 @@ typedef struct ALIGN(8) z_owned_str_array_t { typedef struct ALIGN(8) z_view_str_t { uint8_t _0[16]; } z_view_str_t; +/** + * An owned MemoryLayout + */ +typedef struct ALIGN(8) z_owned_memory_layout_t { + uint8_t _0[24]; +} z_owned_memory_layout_t; +/** + * A loaned MemoryLayout + */ +typedef struct ALIGN(8) z_loaned_memory_layout_t { + uint8_t _0[16]; +} z_loaned_memory_layout_t; /** * An owned mutex. */ typedef struct ALIGN(8) z_owned_mutex_t { uint8_t _0[24]; } z_owned_mutex_t; +/** + * A loaned SHM Client Storage + */ +typedef struct ALIGN(8) z_loaned_shared_memory_client_storage_t { + uint8_t _0[8]; +} z_loaned_shared_memory_client_storage_t; +/** + * An owned SHM Client + */ +typedef struct ALIGN(8) z_owned_shared_memory_client_t { + uint8_t _0[16]; +} z_owned_shared_memory_client_t; /** * An owned SharedMemoryProvider specialization * @@ -934,6 +1000,12 @@ typedef struct ALIGN(8) z_loaned_value_t { typedef struct ALIGN(8) z_loaned_queryable_t { uint8_t _0[32]; } z_loaned_queryable_t; +/** + * An owned SHM Client Storage + */ +typedef struct ALIGN(8) z_owned_shared_memory_client_storage_t { + uint8_t _0[8]; +} z_owned_shared_memory_client_storage_t; /** * An owned reply from a Queryable to a `z_get()`. */ @@ -1032,6 +1104,12 @@ typedef struct z_shared_memory_segment_t { typedef struct zc_shared_memory_client_callbacks_t { bool (*attach_fn)(void*, z_segment_id_t, struct z_shared_memory_segment_t*); } zc_shared_memory_client_callbacks_t; +/** + * A loaned list of SHM Clients + */ +typedef struct ALIGN(8) zc_loaned_shared_memory_client_list_t { + uint8_t _0[24]; +} zc_loaned_shared_memory_client_list_t; /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible SharedMemoryClient @@ -1066,12 +1144,20 @@ typedef struct zc_context_t { * A callbacks for SharedMemoryProviderBackend */ typedef struct zc_shared_memory_provider_backend_callbacks_t { - void (*alloc_fn)(void*, const z_loaned_memory_layout_t*, z_owned_chunk_alloc_result_t*); + void (*alloc_fn)(void*, + const struct z_loaned_memory_layout_t*, + struct z_owned_chunk_alloc_result_t*); void (*free_fn)(void*, const struct z_chunk_descriptor_t*); size_t (*defragment_fn)(void*); size_t (*available_fn)(void*); - void (*layout_for_fn)(void*, z_owned_memory_layout_t*); + void (*layout_for_fn)(void*, struct z_owned_memory_layout_t*); } zc_shared_memory_provider_backend_callbacks_t; +/** + * A loaned ZShmMut slice + */ +typedef struct ALIGN(8) z_loaned_shm_mut_t { + uint8_t _0[80]; +} z_loaned_shm_mut_t; /** * A loaned sequence of bytes. */ @@ -1151,6 +1237,12 @@ typedef struct ALIGN(8) zc_owned_liveliness_token_t { typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; +/** + * An owned list of SHM Clients + */ +typedef struct ALIGN(8) zc_owned_shared_memory_client_list_t { + uint8_t _0[24]; +} zc_owned_shared_memory_client_list_t; /** * Loaned closure. */ @@ -1275,19 +1367,19 @@ ZENOHC_API extern const char *Z_CONFIG_SCOUTING_DELAY_KEY; ZENOHC_API extern const char *Z_CONFIG_ADD_TIMESTAMP_KEY; ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; ZENOHC_API -void z_alloc_layout_alloc(z_owned_buf_alloc_result_t *out_result, +void z_alloc_layout_alloc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout); ZENOHC_API -void z_alloc_layout_alloc_gc(z_owned_buf_alloc_result_t *out_result, +void z_alloc_layout_alloc_gc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout); ZENOHC_API -void z_alloc_layout_alloc_gc_defrag(z_owned_buf_alloc_result_t *out_result, +void z_alloc_layout_alloc_gc_defrag(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout); ZENOHC_API -void z_alloc_layout_alloc_gc_defrag_blocking(z_owned_buf_alloc_result_t *out_result, +void z_alloc_layout_alloc_gc_defrag_blocking(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout); ZENOHC_API -void z_alloc_layout_alloc_gc_defrag_dealloc(z_owned_buf_alloc_result_t *out_result, +void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout); /** * Returns ``true`` if `this` is valid. @@ -1315,31 +1407,31 @@ z_error_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, */ ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); ZENOHC_API -z_error_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(z_owned_buf_alloc_result_t *out_result, +z_error_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, - z_owned_buf_alloc_result_t*)); + struct z_owned_buf_alloc_result_t*)); /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_buf_alloc_result_check(const z_owned_buf_alloc_result_t *this_); +ZENOHC_API bool z_buf_alloc_result_check(const struct z_owned_buf_alloc_result_t *this_); /** * Deletes Buf Alloc Result */ -ZENOHC_API void z_buf_alloc_result_drop(z_owned_buf_alloc_result_t *this_); +ZENOHC_API void z_buf_alloc_result_drop(struct z_owned_buf_alloc_result_t *this_); /** * Borrows Buf Alloc Result */ ZENOHC_API -const z_loaned_buf_alloc_result_t *z_buf_alloc_result_loan(const z_owned_buf_alloc_result_t *this_); +const struct z_loaned_buf_alloc_result_t *z_buf_alloc_result_loan(const struct z_owned_buf_alloc_result_t *this_); /** * Constructs Buf Alloc Result in its gravestone value. */ -ZENOHC_API void z_buf_alloc_result_null(z_owned_buf_alloc_result_t *this_); +ZENOHC_API void z_buf_alloc_result_null(struct z_owned_buf_alloc_result_t *this_); ZENOHC_API -z_error_t z_buf_alloc_result_unwrap(z_owned_buf_alloc_result_t *alloc_result, - z_owned_shm_mut_t *out_buf, +z_error_t z_buf_alloc_result_unwrap(struct z_owned_buf_alloc_result_t *alloc_result, + struct z_owned_shm_mut_t *out_buf, enum z_alloc_error_t *out_error); /** * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -1357,7 +1449,7 @@ ZENOHC_API void z_bytes_clone(const struct z_loaned_bytes_t *this_, struct z_own */ ZENOHC_API z_error_t z_bytes_decode_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const z_loaned_shm_t **dst); + const struct z_loaned_shm_t **dst); /** * Decodes data into an owned SHM buffer by copying it's shared reference * @@ -1366,7 +1458,7 @@ z_error_t z_bytes_decode_into_loaned_shm(const struct z_loaned_bytes_t *this_, */ ZENOHC_API z_error_t z_bytes_decode_into_owned_shm(const struct z_loaned_bytes_t *this_, - z_owned_shm_t *dst); + struct z_owned_shm_t *dst); /** * Decodes into a pair of `z_owned_bytes` objects. * @return 0 in case of success, negative error code otherwise. @@ -1433,19 +1525,21 @@ z_error_t z_bytes_encode_from_pair(struct z_owned_bytes_t *this_, /** * Encodes from an immutable SHM buffer consuming it */ -ZENOHC_API z_error_t z_bytes_encode_from_shm(struct z_owned_bytes_t *this_, z_owned_shm_t *shm); +ZENOHC_API +z_error_t z_bytes_encode_from_shm(struct z_owned_bytes_t *this_, + struct z_owned_shm_t *shm); /** * Encodes from an immutable SHM buffer copying it */ ZENOHC_API void z_bytes_encode_from_shm_copy(struct z_owned_bytes_t *this_, - const z_loaned_shm_t *shm); + const struct z_loaned_shm_t *shm); /** * Encodes from a mutable SHM buffer consuming it */ ZENOHC_API z_error_t z_bytes_encode_from_shm_mut(struct z_owned_bytes_t *this_, - z_owned_shm_mut_t *shm); + struct z_owned_shm_mut_t *shm); /** * Encodes a slice by aliasing. */ @@ -1594,32 +1688,32 @@ z_error_t z_bytes_writer_write(struct z_loaned_bytes_writer_t *this_, /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); /** * Deletes Chunk Alloc Result */ -ZENOHC_API void z_chunk_alloc_result_drop(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_drop(struct z_owned_chunk_alloc_result_t *this_); /** * Borrows Chunk Alloc Result */ ZENOHC_API -const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); +const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); /** * Creates a new Chunk Alloc Result with Error value */ ZENOHC_API -void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); /** * Creates a new Chunk Alloc Result with Ok value */ ZENOHC_API -void z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); /** * Constructs Chunk Alloc Result in its gravestone value. */ -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); /** * Get number of milliseconds passed since creation of `time`. */ @@ -2209,34 +2303,34 @@ void z_keyexpr_to_string(const struct z_loaned_keyexpr_t *this_, /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); /** * Deletes Memory Layout */ -ZENOHC_API void z_memory_layout_drop(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_drop(struct z_owned_memory_layout_t *this_); /** * Deletes Memory Layout */ ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const z_loaned_memory_layout_t *this_); + const struct z_loaned_memory_layout_t *this_); /** * Borrows Memory Layout */ ZENOHC_API -const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); +const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); /** * Creates a new Memory Layout */ ZENOHC_API -z_error_t z_memory_layout_new(z_owned_memory_layout_t *this_, +z_error_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); /** * Constructs Memory Layout in its gravestone value. */ -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); /** * Returns ``true`` if mutex is valid, ``false`` otherwise. */ @@ -2290,17 +2384,17 @@ z_error_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_error_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_owned_config_t *config, - const z_loaned_shared_memory_client_storage_t *shm_clients); + const struct z_loaned_shared_memory_client_storage_t *shm_clients); /** * Creates a new POSIX SHM Client */ -ZENOHC_API z_error_t z_posix_shared_memory_client_new(z_owned_shared_memory_client_t *this_); +ZENOHC_API z_error_t z_posix_shared_memory_client_new(struct z_owned_shared_memory_client_t *this_); /** * Creates a new threadsafe SHM Provider */ ZENOHC_API z_error_t z_posix_shared_memory_provider_new(struct z_owned_shared_memory_provider_t *this_, - const z_loaned_memory_layout_t *layout); + const struct z_loaned_memory_layout_t *layout); /** * Returns ``true`` if publisher is valid, ``false`` otherwise. */ @@ -2583,7 +2677,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); ZENOHC_API -z_error_t z_ref_shared_memory_client_storage_global(z_owned_shared_memory_client_storage_t *this_); +z_error_t z_ref_shared_memory_client_storage_global(struct z_owned_shared_memory_client_storage_t *this_); /** * Returns ``true`` if channel is valid, ``false`` if it is in gravestone state. */ @@ -2759,77 +2853,79 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_shared_memory_client_check(const z_owned_shared_memory_client_t *this_); +ZENOHC_API bool z_shared_memory_client_check(const struct z_owned_shared_memory_client_t *this_); /** * Deletes SHM Client */ -ZENOHC_API void z_shared_memory_client_drop(z_owned_shared_memory_client_t *this_); +ZENOHC_API void z_shared_memory_client_drop(struct z_owned_shared_memory_client_t *this_); /** * Creates a new SHM Client */ ZENOHC_API -z_error_t z_shared_memory_client_new(z_owned_shared_memory_client_t *this_, +z_error_t z_shared_memory_client_new(struct z_owned_shared_memory_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shared_memory_client_callbacks_t callbacks); /** * Constructs SHM client in its gravestone value. */ -ZENOHC_API void z_shared_memory_client_null(z_owned_shared_memory_client_t *this_); +ZENOHC_API void z_shared_memory_client_null(struct z_owned_shared_memory_client_t *this_); /** * Returns ``true`` if `this` is valid. */ ZENOHC_API -bool z_shared_memory_client_storage_check(const z_owned_shared_memory_client_storage_t *this_); +bool z_shared_memory_client_storage_check(const struct z_owned_shared_memory_client_storage_t *this_); /** * Derefs SHM Client Storage */ -ZENOHC_API void z_shared_memory_client_storage_drop(z_owned_shared_memory_client_storage_t *this_); +ZENOHC_API +void z_shared_memory_client_storage_drop(struct z_owned_shared_memory_client_storage_t *this_); /** * Borrows SHM Client Storage */ ZENOHC_API -const z_loaned_shared_memory_client_storage_t *z_shared_memory_client_storage_loan(const z_owned_shared_memory_client_storage_t *this_); +const struct z_loaned_shared_memory_client_storage_t *z_shared_memory_client_storage_loan(const struct z_owned_shared_memory_client_storage_t *this_); ZENOHC_API -z_error_t z_shared_memory_client_storage_new(z_owned_shared_memory_client_storage_t *this_, - const zc_loaned_shared_memory_client_list_t *clients, +z_error_t z_shared_memory_client_storage_new(struct z_owned_shared_memory_client_storage_t *this_, + const struct zc_loaned_shared_memory_client_list_t *clients, bool add_default_client_set); ZENOHC_API -z_error_t z_shared_memory_client_storage_new_default(z_owned_shared_memory_client_storage_t *this_); +z_error_t z_shared_memory_client_storage_new_default(struct z_owned_shared_memory_client_storage_t *this_); /** * Constructs SHM Client Storage in its gravestone value. */ -ZENOHC_API void z_shared_memory_client_storage_null(z_owned_shared_memory_client_storage_t *this_); ZENOHC_API -z_error_t z_shared_memory_provider_alloc(z_owned_buf_alloc_result_t *out_result, +void z_shared_memory_client_storage_null(struct z_owned_shared_memory_client_storage_t *this_); +ZENOHC_API +z_error_t z_shared_memory_provider_alloc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); ZENOHC_API -z_error_t z_shared_memory_provider_alloc_gc(z_owned_buf_alloc_result_t *out_result, +z_error_t z_shared_memory_provider_alloc_gc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); ZENOHC_API -z_error_t z_shared_memory_provider_alloc_gc_defrag(z_owned_buf_alloc_result_t *out_result, +z_error_t z_shared_memory_provider_alloc_gc_defrag(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); ZENOHC_API -z_error_t z_shared_memory_provider_alloc_gc_defrag_async(z_owned_buf_alloc_result_t *out_result, +z_error_t z_shared_memory_provider_alloc_gc_defrag_async(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, z_error_t, - z_owned_buf_alloc_result_t*)); + struct z_owned_buf_alloc_result_t*)); ZENOHC_API -z_error_t z_shared_memory_provider_alloc_gc_defrag_blocking(z_owned_buf_alloc_result_t *out_result, +z_error_t z_shared_memory_provider_alloc_gc_defrag_blocking(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); ZENOHC_API -z_error_t z_shared_memory_provider_alloc_gc_defrag_dealloc(z_owned_buf_alloc_result_t *out_result, +z_error_t z_shared_memory_provider_alloc_gc_defrag_dealloc(struct z_owned_buf_alloc_result_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); @@ -2854,7 +2950,7 @@ void z_shared_memory_provider_garbage_collect(const struct z_loaned_shared_memor ZENOHC_API const struct z_loaned_shared_memory_provider_t *z_shared_memory_provider_loan(const struct z_owned_shared_memory_provider_t *this_); ZENOHC_API -void z_shared_memory_provider_map(z_owned_shm_mut_t *out_result, +void z_shared_memory_provider_map(struct z_owned_shm_mut_t *out_result, const struct z_loaned_shared_memory_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); @@ -2881,75 +2977,77 @@ void z_shared_memory_provider_threadsafe_new(struct z_owned_shared_memory_provid /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); /** * Converts borrowed ZShm slice as owned ZShm slice by performing shared memory handle copy */ -ZENOHC_API void z_shm_copy(z_owned_shm_t *this_, const z_loaned_shm_t *loaned); +ZENOHC_API void z_shm_copy(struct z_owned_shm_t *this_, const struct z_loaned_shm_t *loaned); /** * @return the pointer of the ZShm slice */ -ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); /** * Deletes ZShm slice */ -ZENOHC_API void z_shm_drop(z_owned_shm_t *this_); +ZENOHC_API void z_shm_drop(struct z_owned_shm_t *this_); /** * Constructs ZShm slice from ZShmMut slice */ -ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_owned_shm_mut_t *that); +ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_owned_shm_mut_t *that); /** * @return the length of the ZShm slice */ -ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); /** * Borrows ZShm slice */ -ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); +ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); /** * Mutably borrows ZShm slice */ -ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); /** * Returns ``true`` if `this` is valid. */ -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); /** * @return the mutable pointer of the ZShmMut slice */ -ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); /** * Deletes ZShmMut slice */ -ZENOHC_API void z_shm_mut_drop(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_drop(struct z_owned_shm_mut_t *this_); /** * @return the length of the ZShmMut slice */ -ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); /** * Borrows ZShmMut slice */ -ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); /** * Constructs ZShmMut slice in its gravestone value. */ -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); /** * Tries to construct ZShmMut slice from ZShm slice */ -ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_owned_shm_t *that); +ZENOHC_API +void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, + struct z_owned_shm_t *that); /** * Constructs ZShm slice in its gravestone value. */ -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); /** * Mutably borrows ZShm slice as borrowed ZShmMut slice */ -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); /** * Puts current thread to sleep for specified amount of milliseconds. */ @@ -3704,35 +3802,38 @@ void zc_session_clone(const struct z_loaned_session_t *this_, struct z_owned_session_t *dst); ZENOHC_API z_error_t zc_shared_memory_client_list_add_client(z_protocol_id_t id, - z_owned_shared_memory_client_t *client, - zc_loaned_shared_memory_client_list_t *list); + struct z_owned_shared_memory_client_t *client, + struct zc_loaned_shared_memory_client_list_t *list); /** * Returns ``true`` if `this` is valid. */ ZENOHC_API -bool zc_shared_memory_client_list_check(const zc_owned_shared_memory_client_list_t *this_); +bool zc_shared_memory_client_list_check(const struct zc_owned_shared_memory_client_list_t *this_); /** * Deletes list of SHM Clients */ -ZENOHC_API void zc_shared_memory_client_list_drop(zc_owned_shared_memory_client_list_t *this_); +ZENOHC_API +void zc_shared_memory_client_list_drop(struct zc_owned_shared_memory_client_list_t *this_); /** * Borrows list of SHM Clients */ ZENOHC_API -const zc_loaned_shared_memory_client_list_t *zc_shared_memory_client_list_loan(const zc_owned_shared_memory_client_list_t *this_); +const struct zc_loaned_shared_memory_client_list_t *zc_shared_memory_client_list_loan(const struct zc_owned_shared_memory_client_list_t *this_); /** * Mutably borrows list of SHM Clients */ ZENOHC_API -zc_loaned_shared_memory_client_list_t *zc_shared_memory_client_list_loan_mut(zc_owned_shared_memory_client_list_t *this_); +struct zc_loaned_shared_memory_client_list_t *zc_shared_memory_client_list_loan_mut(struct zc_owned_shared_memory_client_list_t *this_); /** * Creates a new empty list of SHM Clients */ -ZENOHC_API z_error_t zc_shared_memory_client_list_new(zc_owned_shared_memory_client_list_t *this_); +ZENOHC_API +z_error_t zc_shared_memory_client_list_new(struct zc_owned_shared_memory_client_list_t *this_); /** * Constructs SHM client list in its gravestone value. */ -ZENOHC_API void zc_shared_memory_client_list_null(zc_owned_shared_memory_client_list_t *this_); +ZENOHC_API +void zc_shared_memory_client_list_null(struct zc_owned_shared_memory_client_list_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index dee53a577..affbf7cc0 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -7,8 +7,10 @@ #define z_loan(x) \ _Generic((x), \ z_owned_alloc_layout_t : z_alloc_layout_loan, \ + z_owned_buf_alloc_result_t : z_buf_alloc_result_loan, \ z_owned_bytes_t : z_bytes_loan, \ z_owned_bytes_writer_t : z_bytes_writer_loan, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_owned_query_t : z_closure_owned_query_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ @@ -20,6 +22,7 @@ z_owned_encoding_t : z_encoding_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ + z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_channel_closure_t : z_query_channel_closure_loan, \ z_owned_query_t : z_query_loan, \ @@ -28,7 +31,9 @@ z_owned_reply_t : z_reply_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ + z_owned_shared_memory_client_storage_t : z_shared_memory_client_storage_loan, \ z_owned_shared_memory_provider_t : z_shared_memory_provider_loan, \ + z_owned_shm_t : z_shm_loan, \ z_owned_slice_t : z_slice_loan, \ z_owned_slice_map_t : z_slice_map_loan, \ z_owned_str_array_t : z_str_array_loan, \ @@ -38,6 +43,7 @@ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_str_t : z_view_str_loan, \ + zc_owned_shared_memory_client_list_t : zc_shared_memory_client_list_loan, \ zcu_owned_closure_matching_status_t : zcu_closure_matching_status_loan, \ ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ )(&x) @@ -49,15 +55,20 @@ z_owned_condvar_t : z_condvar_loan_mut, \ z_owned_config_t : z_config_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ + z_owned_shm_t : z_shm_loan_mut, \ + z_owned_shm_mut_t : z_shm_mut_loan_mut, \ z_owned_slice_map_t : z_slice_map_loan_mut, \ - z_owned_str_array_t : z_str_array_loan_mut \ + z_owned_str_array_t : z_str_array_loan_mut, \ + zc_owned_shared_memory_client_list_t : zc_shared_memory_client_list_loan_mut \ )(&x) #define z_drop(x) \ _Generic((x), \ z_owned_alloc_layout_t* : z_alloc_layout_drop, \ + z_owned_buf_alloc_result_t* : z_buf_alloc_result_drop, \ z_owned_bytes_t* : z_bytes_drop, \ z_owned_bytes_writer_t* : z_bytes_writer_drop, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_drop, \ z_owned_closure_hello_t* : z_closure_hello_drop, \ z_owned_closure_owned_query_t* : z_closure_owned_query_drop, \ z_owned_closure_query_t* : z_closure_query_drop, \ @@ -69,6 +80,7 @@ z_owned_encoding_t* : z_encoding_drop, \ z_owned_hello_t* : z_hello_drop, \ z_owned_keyexpr_t* : z_keyexpr_drop, \ + z_owned_memory_layout_t* : z_memory_layout_drop, \ z_owned_mutex_t* : z_mutex_drop, \ z_owned_publisher_t* : z_publisher_drop, \ z_owned_query_channel_closure_t* : z_query_channel_closure_drop, \ @@ -80,7 +92,11 @@ z_owned_reply_t* : z_reply_drop, \ z_owned_sample_t* : z_sample_drop, \ z_owned_session_t* : z_session_drop, \ + z_owned_shared_memory_client_t* : z_shared_memory_client_drop, \ + z_owned_shared_memory_client_storage_t* : z_shared_memory_client_storage_drop, \ z_owned_shared_memory_provider_t* : z_shared_memory_provider_drop, \ + z_owned_shm_t* : z_shm_drop, \ + z_owned_shm_mut_t* : z_shm_mut_drop, \ z_owned_slice_t* : z_slice_drop, \ z_owned_slice_map_t* : z_slice_map_drop, \ z_owned_str_array_t* : z_str_array_drop, \ @@ -88,6 +104,7 @@ z_owned_subscriber_t* : z_subscriber_drop, \ z_owned_value_t* : z_value_drop, \ zc_owned_liveliness_token_t* : zc_liveliness_token_drop, \ + zc_owned_shared_memory_client_list_t* : zc_shared_memory_client_list_drop, \ zcu_owned_closure_matching_status_t* : zcu_closure_matching_status_drop, \ ze_owned_publication_cache_t* : ze_publication_cache_drop, \ ze_owned_querying_subscriber_t* : ze_querying_subscriber_drop \ @@ -98,8 +115,10 @@ #define z_null(x) \ _Generic((x), \ z_owned_alloc_layout_t* : z_alloc_layout_null, \ + z_owned_buf_alloc_result_t* : z_buf_alloc_result_null, \ z_owned_bytes_t* : z_bytes_null, \ z_owned_bytes_writer_t* : z_bytes_writer_null, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ @@ -110,6 +129,7 @@ z_owned_encoding_t* : z_encoding_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ + z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_channel_closure_t* : z_query_channel_closure_null, \ @@ -120,7 +140,11 @@ z_owned_reply_t* : z_reply_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ + z_owned_shared_memory_client_t* : z_shared_memory_client_null, \ + z_owned_shared_memory_client_storage_t* : z_shared_memory_client_storage_null, \ z_owned_shared_memory_provider_t* : z_shared_memory_provider_null, \ + z_owned_shm_mut_t* : z_shm_mut_null, \ + z_owned_shm_t* : z_shm_null, \ z_owned_slice_map_t* : z_slice_map_null, \ z_owned_slice_t* : z_slice_null, \ z_owned_str_array_t* : z_str_array_null, \ @@ -132,6 +156,7 @@ z_view_slice_t* : z_view_slice_null, \ z_view_str_t* : z_view_str_null, \ zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ + zc_owned_shared_memory_client_list_t* : zc_shared_memory_client_list_null, \ zcu_owned_closure_matching_status_t* : zcu_closure_matching_status_null, \ ze_owned_publication_cache_t* : ze_publication_cache_null, \ ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ @@ -140,8 +165,10 @@ #define z_check(x) \ _Generic((x), \ z_owned_alloc_layout_t : z_alloc_layout_check, \ + z_owned_buf_alloc_result_t : z_buf_alloc_result_check, \ z_owned_bytes_t : z_bytes_check, \ z_owned_bytes_writer_t : z_bytes_writer_check, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ @@ -152,6 +179,7 @@ z_owned_encoding_t : z_encoding_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ + z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_channel_t : z_query_channel_check, \ @@ -163,7 +191,11 @@ z_owned_reply_t : z_reply_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ + z_owned_shared_memory_client_t : z_shared_memory_client_check, \ + z_owned_shared_memory_client_storage_t : z_shared_memory_client_storage_check, \ z_owned_shared_memory_provider_t : z_shared_memory_provider_check, \ + z_owned_shm_t : z_shm_check, \ + z_owned_shm_mut_t : z_shm_mut_check, \ z_owned_slice_t : z_slice_check, \ z_owned_slice_map_t : z_slice_map_check, \ z_owned_str_array_t : z_str_array_check, \ @@ -175,6 +207,7 @@ z_view_slice_t : z_view_slice_check, \ z_view_str_t : z_view_str_check, \ zc_owned_liveliness_token_t : zc_liveliness_token_check, \ + zc_owned_shared_memory_client_list_t : zc_shared_memory_client_list_check, \ zcu_owned_closure_matching_status_t : zcu_closure_matching_status_check, \ ze_owned_publication_cache_t : ze_publication_cache_check, \ ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ @@ -200,8 +233,10 @@ inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; +inline const z_loaned_buf_alloc_result_t* z_loan(const z_owned_buf_alloc_result_t& this_) { return z_buf_alloc_result_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; inline const z_loaned_bytes_writer_t* z_loan(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan(&this_); }; +inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_owned_query_t* z_loan(const z_owned_closure_owned_query_t& closure) { return z_closure_owned_query_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; @@ -213,6 +248,7 @@ inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; +inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_channel_closure_t* z_loan(const z_owned_query_channel_closure_t& closure) { return z_query_channel_closure_loan(&closure); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; @@ -221,7 +257,9 @@ inline const z_loaned_reply_channel_closure_t* z_loan(const z_owned_reply_channe inline const z_loaned_reply_t* z_loan(const z_owned_reply_t& this_) { return z_reply_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; +inline const z_loaned_shared_memory_client_storage_t* z_loan(const z_owned_shared_memory_client_storage_t& this_) { return z_shared_memory_client_storage_loan(&this_); }; inline const z_loaned_shared_memory_provider_t* z_loan(const z_owned_shared_memory_provider_t& this_) { return z_shared_memory_provider_loan(&this_); }; +inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; inline const z_loaned_slice_map_t* z_loan(const z_owned_slice_map_t& this_) { return z_slice_map_loan(&this_); }; inline const z_loaned_str_array_t* z_loan(const z_owned_str_array_t& this_) { return z_str_array_loan(&this_); }; @@ -231,6 +269,7 @@ inline const z_loaned_value_t* z_loan(const z_owned_value_t& this_) { return z_v inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return z_view_keyexpr_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_str_t* z_loan(const z_view_str_t& this_) { return z_view_str_loan(&this_); }; +inline const zc_loaned_shared_memory_client_list_t* z_loan(const zc_owned_shared_memory_client_list_t& this_) { return zc_shared_memory_client_list_loan(&this_); }; inline const zcu_loaned_closure_matching_status_t* z_loan(const zcu_owned_closure_matching_status_t& closure) { return zcu_closure_matching_status_loan(&closure); }; inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; @@ -240,13 +279,18 @@ inline z_loaned_bytes_writer_t* z_loan_mut(z_owned_bytes_writer_t& this_) { retu inline z_loaned_condvar_t* z_loan_mut(z_owned_condvar_t& this_) { return z_condvar_loan_mut(&this_); }; inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; +inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; +inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_slice_map_t* z_loan_mut(z_owned_slice_map_t& this_) { return z_slice_map_loan_mut(&this_); }; inline z_loaned_str_array_t* z_loan_mut(z_owned_str_array_t& this_) { return z_str_array_loan_mut(&this_); }; +inline zc_loaned_shared_memory_client_list_t* z_loan_mut(zc_owned_shared_memory_client_list_t& this_) { return zc_shared_memory_client_list_loan_mut(&this_); }; inline void z_drop(z_owned_alloc_layout_t* this_) { return z_alloc_layout_drop(this_); }; +inline void z_drop(z_owned_buf_alloc_result_t* this_) { return z_buf_alloc_result_drop(this_); }; inline void z_drop(z_owned_bytes_t* this_) { return z_bytes_drop(this_); }; inline void z_drop(z_owned_bytes_writer_t* this_) { return z_bytes_writer_drop(this_); }; +inline void z_drop(z_owned_chunk_alloc_result_t* this_) { return z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_owned_closure_hello_t* closure) { return z_closure_hello_drop(closure); }; inline void z_drop(z_owned_closure_owned_query_t* closure) { return z_closure_owned_query_drop(closure); }; inline void z_drop(z_owned_closure_query_t* closure) { return z_closure_query_drop(closure); }; @@ -258,6 +302,7 @@ inline void z_drop(z_owned_config_t* this_) { return z_config_drop(this_); }; inline void z_drop(z_owned_encoding_t* this_) { return z_encoding_drop(this_); }; inline void z_drop(z_owned_hello_t* this_) { return z_hello_drop(this_); }; inline void z_drop(z_owned_keyexpr_t* this_) { return z_keyexpr_drop(this_); }; +inline void z_drop(z_owned_memory_layout_t* this_) { return z_memory_layout_drop(this_); }; inline void z_drop(z_owned_mutex_t* this_) { return z_mutex_drop(this_); }; inline void z_drop(z_owned_publisher_t* this_) { return z_publisher_drop(this_); }; inline void z_drop(z_owned_query_channel_closure_t* closure) { return z_query_channel_closure_drop(closure); }; @@ -269,7 +314,11 @@ inline void z_drop(z_owned_reply_channel_t* channel) { return z_reply_channel_dr inline void z_drop(z_owned_reply_t* this_) { return z_reply_drop(this_); }; inline void z_drop(z_owned_sample_t* this_) { return z_sample_drop(this_); }; inline void z_drop(z_owned_session_t* this_) { return z_session_drop(this_); }; +inline void z_drop(z_owned_shared_memory_client_t* this_) { return z_shared_memory_client_drop(this_); }; +inline void z_drop(z_owned_shared_memory_client_storage_t* this_) { return z_shared_memory_client_storage_drop(this_); }; inline void z_drop(z_owned_shared_memory_provider_t* this_) { return z_shared_memory_provider_drop(this_); }; +inline void z_drop(z_owned_shm_t* this_) { return z_shm_drop(this_); }; +inline void z_drop(z_owned_shm_mut_t* this_) { return z_shm_mut_drop(this_); }; inline void z_drop(z_owned_slice_t* this_) { return z_slice_drop(this_); }; inline void z_drop(z_owned_slice_map_t* this_) { return z_slice_map_drop(this_); }; inline void z_drop(z_owned_str_array_t* this_) { return z_str_array_drop(this_); }; @@ -277,14 +326,17 @@ inline void z_drop(z_owned_str_t* this_) { return z_str_drop(this_); }; inline void z_drop(z_owned_subscriber_t* this_) { return z_subscriber_drop(this_); }; inline void z_drop(z_owned_value_t* this_) { return z_value_drop(this_); }; inline void z_drop(zc_owned_liveliness_token_t* this_) { return zc_liveliness_token_drop(this_); }; +inline void z_drop(zc_owned_shared_memory_client_list_t* this_) { return zc_shared_memory_client_list_drop(this_); }; inline void z_drop(zcu_owned_closure_matching_status_t* closure) { return zcu_closure_matching_status_drop(closure); }; inline void z_drop(ze_owned_publication_cache_t* this_) { return ze_publication_cache_drop(this_); }; inline void z_drop(ze_owned_querying_subscriber_t* this_) { return ze_querying_subscriber_drop(this_); }; inline z_owned_alloc_layout_t* z_move(z_owned_alloc_layout_t& this_) { return (&this_); }; +inline z_owned_buf_alloc_result_t* z_move(z_owned_buf_alloc_result_t& this_) { return (&this_); }; inline z_owned_bytes_t* z_move(z_owned_bytes_t& this_) { return (&this_); }; inline z_owned_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return (&this_); }; +inline z_owned_chunk_alloc_result_t* z_move(z_owned_chunk_alloc_result_t& this_) { return (&this_); }; inline z_owned_closure_hello_t* z_move(z_owned_closure_hello_t& closure) { return (&closure); }; inline z_owned_closure_owned_query_t* z_move(z_owned_closure_owned_query_t& closure) { return (&closure); }; inline z_owned_closure_query_t* z_move(z_owned_closure_query_t& closure) { return (&closure); }; @@ -296,6 +348,7 @@ inline z_owned_config_t* z_move(z_owned_config_t& this_) { return (&this_); }; inline z_owned_encoding_t* z_move(z_owned_encoding_t& this_) { return (&this_); }; inline z_owned_hello_t* z_move(z_owned_hello_t& this_) { return (&this_); }; inline z_owned_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return (&this_); }; +inline z_owned_memory_layout_t* z_move(z_owned_memory_layout_t& this_) { return (&this_); }; inline z_owned_mutex_t* z_move(z_owned_mutex_t& this_) { return (&this_); }; inline z_owned_publisher_t* z_move(z_owned_publisher_t& this_) { return (&this_); }; inline z_owned_query_channel_closure_t* z_move(z_owned_query_channel_closure_t& closure) { return (&closure); }; @@ -307,7 +360,11 @@ inline z_owned_reply_channel_t* z_move(z_owned_reply_channel_t& channel) { retur inline z_owned_reply_t* z_move(z_owned_reply_t& this_) { return (&this_); }; inline z_owned_sample_t* z_move(z_owned_sample_t& this_) { return (&this_); }; inline z_owned_session_t* z_move(z_owned_session_t& this_) { return (&this_); }; +inline z_owned_shared_memory_client_t* z_move(z_owned_shared_memory_client_t& this_) { return (&this_); }; +inline z_owned_shared_memory_client_storage_t* z_move(z_owned_shared_memory_client_storage_t& this_) { return (&this_); }; inline z_owned_shared_memory_provider_t* z_move(z_owned_shared_memory_provider_t& this_) { return (&this_); }; +inline z_owned_shm_t* z_move(z_owned_shm_t& this_) { return (&this_); }; +inline z_owned_shm_mut_t* z_move(z_owned_shm_mut_t& this_) { return (&this_); }; inline z_owned_slice_t* z_move(z_owned_slice_t& this_) { return (&this_); }; inline z_owned_slice_map_t* z_move(z_owned_slice_map_t& this_) { return (&this_); }; inline z_owned_str_array_t* z_move(z_owned_str_array_t& this_) { return (&this_); }; @@ -315,14 +372,17 @@ inline z_owned_str_t* z_move(z_owned_str_t& this_) { return (&this_); }; inline z_owned_subscriber_t* z_move(z_owned_subscriber_t& this_) { return (&this_); }; inline z_owned_value_t* z_move(z_owned_value_t& this_) { return (&this_); }; inline zc_owned_liveliness_token_t* z_move(zc_owned_liveliness_token_t& this_) { return (&this_); }; +inline zc_owned_shared_memory_client_list_t* z_move(zc_owned_shared_memory_client_list_t& this_) { return (&this_); }; inline zcu_owned_closure_matching_status_t* z_move(zcu_owned_closure_matching_status_t& closure) { return (&closure); }; inline ze_owned_publication_cache_t* z_move(ze_owned_publication_cache_t& this_) { return (&this_); }; inline ze_owned_querying_subscriber_t* z_move(ze_owned_querying_subscriber_t& this_) { return (&this_); }; inline void z_null(z_owned_alloc_layout_t* this_) { return z_alloc_layout_null(this_); }; +inline void z_null(z_owned_buf_alloc_result_t* this_) { return z_buf_alloc_result_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { return z_bytes_null(this_); }; inline void z_null(z_owned_bytes_writer_t* this_) { return z_bytes_writer_null(this_); }; +inline void z_null(z_owned_chunk_alloc_result_t* this_) { return z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { return z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { return z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { return z_closure_reply_null(this_); }; @@ -333,6 +393,7 @@ inline void z_null(z_owned_config_t* this_) { return z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { return z_encoding_null(this_); }; inline void z_null(z_owned_hello_t* this_) { return z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { return z_keyexpr_null(this_); }; +inline void z_null(z_owned_memory_layout_t* this_) { return z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { return z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { return z_publisher_null(this_); }; inline void z_null(z_owned_query_channel_closure_t* this_) { return z_query_channel_closure_null(this_); }; @@ -343,7 +404,11 @@ inline void z_null(z_owned_reply_channel_t* this_) { return z_reply_channel_null inline void z_null(z_owned_reply_t* this_) { return z_reply_null(this_); }; inline void z_null(z_owned_sample_t* this_) { return z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { return z_session_null(this_); }; +inline void z_null(z_owned_shared_memory_client_t* this_) { return z_shared_memory_client_null(this_); }; +inline void z_null(z_owned_shared_memory_client_storage_t* this_) { return z_shared_memory_client_storage_null(this_); }; inline void z_null(z_owned_shared_memory_provider_t* this_) { return z_shared_memory_provider_null(this_); }; +inline void z_null(z_owned_shm_mut_t* this_) { return z_shm_mut_null(this_); }; +inline void z_null(z_owned_shm_t* this_) { return z_shm_null(this_); }; inline void z_null(z_owned_slice_map_t* this_) { return z_slice_map_null(this_); }; inline void z_null(z_owned_slice_t* this_) { return z_slice_null(this_); }; inline void z_null(z_owned_str_array_t* this_) { return z_str_array_null(this_); }; @@ -355,14 +420,17 @@ inline void z_null(z_view_keyexpr_t* this_) { return z_view_keyexpr_null(this_); inline void z_null(z_view_slice_t* this_) { return z_view_slice_null(this_); }; inline void z_null(z_view_str_t* this_) { return z_view_str_null(this_); }; inline void z_null(zc_owned_liveliness_token_t* this_) { return zc_liveliness_token_null(this_); }; +inline void z_null(zc_owned_shared_memory_client_list_t* this_) { return zc_shared_memory_client_list_null(this_); }; inline void z_null(zcu_owned_closure_matching_status_t* this_) { return zcu_closure_matching_status_null(this_); }; inline void z_null(ze_owned_publication_cache_t* this_) { return ze_publication_cache_null(this_); }; inline void z_null(ze_owned_querying_subscriber_t* this_) { return ze_querying_subscriber_null(this_); }; inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; +inline bool z_check(const z_owned_buf_alloc_result_t& this_) { return z_buf_alloc_result_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; inline bool z_check(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_check(&this_); }; +inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; @@ -373,6 +441,7 @@ inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; +inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_channel_t& this_) { return z_query_channel_check(&this_); }; @@ -384,7 +453,11 @@ inline bool z_check(const z_owned_reply_channel_closure_t& this_) { return z_rep inline bool z_check(const z_owned_reply_t& this_) { return z_reply_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; +inline bool z_check(const z_owned_shared_memory_client_t& this_) { return z_shared_memory_client_check(&this_); }; +inline bool z_check(const z_owned_shared_memory_client_storage_t& this_) { return z_shared_memory_client_storage_check(&this_); }; inline bool z_check(const z_owned_shared_memory_provider_t& this_) { return z_shared_memory_provider_check(&this_); }; +inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; +inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; inline bool z_check(const z_owned_slice_map_t& map) { return z_slice_map_check(&map); }; inline bool z_check(const z_owned_str_array_t& this_) { return z_str_array_check(&this_); }; @@ -396,6 +469,7 @@ inline bool z_check(const z_view_keyexpr_t& this_) { return z_view_keyexpr_check inline bool z_check(const z_view_slice_t& this_) { return z_view_slice_check(&this_); }; inline bool z_check(const z_view_str_t& this_) { return z_view_str_check(&this_); }; inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; +inline bool z_check(const zc_owned_shared_memory_client_list_t& this_) { return zc_shared_memory_client_list_check(&this_); }; inline bool z_check(const zcu_owned_closure_matching_status_t& this_) { return zcu_closure_matching_status_check(&this_); }; inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; @@ -516,10 +590,14 @@ template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_buf_alloc_result_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_buf_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_writer_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_writer_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_owned_query_t type; }; @@ -542,6 +620,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_channel_closure_t type; }; @@ -558,8 +638,12 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shared_memory_client_storage_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shared_memory_client_storage_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_shared_memory_provider_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shared_memory_provider_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_map_t type; }; @@ -572,10 +656,14 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_value_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_value_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shared_memory_client_list_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shared_memory_client_list_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zcu_owned_closure_matching_status_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zcu_loaned_closure_matching_status_t type; }; template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; #endif // #ifndef __cplusplus \ No newline at end of file