Commit 3bd261ca authored by Robert Haas's avatar Robert Haas

Improve shm_mq portability around MAXIMUM_ALIGNOF and sizeof(Size).

Revise the original decision to expose a uint64-based interface and
use Size everywhere possible.  Avoid assuming that MAXIMUM_ALIGNOF is
8, or making any assumption about the relationship between that value
and sizeof(Size).  If MAXIMUM_ALIGNOF is bigger, we'll now insert
padding after the length word; if it's smaller, we are now prepared
to read and write the length word in chunks.

Per discussion with Tom Lane.
parent 19f2d6cd
This diff is collapsed.
...@@ -57,9 +57,9 @@ extern void shm_mq_detach(shm_mq *); ...@@ -57,9 +57,9 @@ extern void shm_mq_detach(shm_mq *);
/* Send or receive messages. */ /* Send or receive messages. */
extern shm_mq_result shm_mq_send(shm_mq_handle *mqh, extern shm_mq_result shm_mq_send(shm_mq_handle *mqh,
uint64 nbytes, void *data, bool nowait); Size nbytes, void *data, bool nowait);
extern shm_mq_result shm_mq_receive(shm_mq_handle *mqh, extern shm_mq_result shm_mq_receive(shm_mq_handle *mqh,
uint64 *nbytesp, void **datap, bool nowait); Size *nbytesp, void **datap, bool nowait);
/* Wait for our counterparty to attach to the queue. */ /* Wait for our counterparty to attach to the queue. */
extern shm_mq_result shm_mq_wait_for_attach(shm_mq_handle *mqh); extern shm_mq_result shm_mq_wait_for_attach(shm_mq_handle *mqh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment