Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The C Programming Language: Myths and Reality (1). Parent comment
struct public_stuff { ... } struct private_stuff { struct public_stuff public; ... } struct public_stuff *make_public(/* ... */) { struct private *prv = malloc(sizeof *prv); /* ... */ return &prv->public; }
The public struct doesn't even have to be at the start if one make appropriate use of offsetof and ensuring valid alignment.
Nothing new under the sun...
There are no comments on this comment yet.
The public struct doesn't even have to be at the start if one make appropriate use of offsetof and ensuring valid alignment.
Nothing new under the sun...