Hi Konstantin,

On Sun, 2021-12-19 at 23:13 -0800, Konstantin Smola via Xenomai wrote:
> +#ifndef PAGE_SIZE
> +#define PAGE_SIZE 4096
> +#endif
> +
> +typedef struct {             /* memory to share */
> +     int data[PAGE_SIZE * 100];
> +     double dval;
> +} shm_test_layout_t;

Hm...

First of all, there is no guarantee for 4k pages. I would prefer using
sysconf(_SC_PAGESIZE) for fetching the page size.

Second, PAGE_SIZE * 100 makes 100 pages, but as array size of int it
will be sizeof(int)*PAGE_SIZE*100, not sure if that is what you want
for an example.

At first glance it looks like data should be void* and pre-fixed with a
new member named "size" of type size_t. I did not review the remaining
parts in detail, so I might miss something.

Reply via email to