celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] pnoltes commented on a change in pull request #230: Update the wire protocol to use fixed size types
Date Sun, 17 May 2020 18:47:28 GMT

pnoltes commented on a change in pull request #230:
URL: https://github.com/apache/celix/pull/230#discussion_r426292148

File path: bundles/pubsub/pubsub_spi/include/pubsub_protocol.h
@@ -32,27 +33,29 @@ typedef struct pubsub_protocol_header pubsub_protocol_header_t;
  * The protocol header structure, contains the information about the message payload and
 struct pubsub_protocol_header {
-  /** message payload identification attributes */
-    unsigned int msgId;
-    unsigned short msgMajorVersion;
-    unsigned short msgMinorVersion;
+    /** message payload identification attributes */
+    uint32_t msgId;
+    uint16_t msgMajorVersion;
+    uint16_t msgMinorVersion;
     /** Payload and metadata sizes attributes */
-    unsigned int payloadSize;
-    unsigned int metadataSize;
+    uint32_t payloadSize;
+    uint32_t metadataSize;
     /** Optional message segmentation attributes, these attributes are only used/written
by the protocol admin.
      *  When message segmentation is supported by the protocol admin */
-    unsigned int seqNr;
-    unsigned int payloadPartSize;
-    unsigned int payloadOffset;
+    uint32_t seqNr;
+    uint32_t payloadPartSize;
+    uint32_t payloadOffset;
+    uint32_t padding; //to arrange alignment on 64 bit

Review comment:
       So that when addressing the payload in memory (if they are read at the same time) the
alignment is 64 bit. 
   If I am correct this is not needed, but can help in performance. 
   @rbulter: Do you know if this is really needed of an overdone performance feature/complexity?

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message