Ignacio García Pérez wrote:
RT_PIPE_MSG *m = rt_pipe_alloc(sizeof(mystruct_t));
mystruct_t *p = (mystruct_t *)P_MSGPTR(m);
p->whatever1 = X;
p->whatever2 = X;
rt_pipe_send(&mypipe, m, sizeof(mystruct_t), P_NORMAL);

If this is correct, why do I have to specify the size of mystruct_t
*twice*. Can't it be initialized by rt_pipe_alloc ?.

It's initialized actually (*).


So, what's the sense of having to specify it again whet calling
rt_pipe_send ?


Because you may (pre-)allocate more than you really need to send afterwards.

--

Philippe.

Reply via email to