Zambyte 6 days ago

> That's exactly the same as my intrusive structure, no?

It's not, for the reason they put in parentheses:

> note: no pointers in user_data_t

An allocation of user_data_t also allocates space for payload_t, rather than just allocating space for a pointer to payload_t. Your structure requires an additional allocation to point the payload_t* at something. The fact that they hid the next node_t* in a struct doesn't matter though.

1
lelanthran 6 days ago

> It's not, for the reason they put in parentheses:

>> note: no pointers in user_data_t

I feel like I am taking crazy pills: where, in my intrusive example, are pointers in the `user_data_t`?

My intrusive code sample had no pointers for the user_data_t. It's exactly the same as GP's intrusive example.

Zambyte 5 days ago

It is not you that is crazy, I have been exhausted. My bad.