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

Reduce GID storage to 16 bytes. #345

Merged
merged 1 commit into from
Jan 23, 2023
Merged
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
12 changes: 7 additions & 5 deletions rmw/include/rmw/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ extern "C"
#include "rmw/time.h"
#include "rmw/visibility_control.h"

// 24 bytes is the most memory needed to represent the GID by any current
// implementation. It may need to be increased in the future.
#define RMW_GID_STORAGE_SIZE 24u
// We define the GID as 16 bytes (128 bits). This should be enough to ensure
// uniqueness amongst all entities in the system. It is up to the individual
// RMW implementations to fill that in, either from the underlying middleware
// or from the RMW layer itself.
#define RMW_GID_STORAGE_SIZE 16u

/// Structure which encapsulates an rmw node
typedef struct RMW_PUBLIC_TYPE rmw_node_s
Expand Down Expand Up @@ -356,7 +358,7 @@ typedef struct RMW_PUBLIC_TYPE rmw_wait_set_s
typedef struct RMW_PUBLIC_TYPE rmw_request_id_s
{
/// The guid of the writer associated with this request
int8_t writer_guid[16];
int8_t writer_guid[RMW_GID_STORAGE_SIZE];

/// Sequence number of this service
int64_t sequence_number;
Expand Down Expand Up @@ -622,7 +624,7 @@ typedef struct RMW_PUBLIC_TYPE rmw_gid_s
/// Name of the rmw implementation
const char * implementation_identifier;

/// Bype data Gid value
/// Byte data Gid value
uint8_t data[RMW_GID_STORAGE_SIZE];
} rmw_gid_t;

Expand Down