Re: RFC: BSD Socket (like) API

Marcus Shawcroft <marcus.shawcroft@...>

On 27 March 2017 at 12:16, Paul Sokolovsky <paul.sokolovsky@...> wrote:

2- FDs just waste memory, add locking and make things harder to
debug, use socket structures.
Agree. That was one of the 1st question I got at the minisummit, and my
answer was: "well, we could waste some memory by adding the FD table to
map small integers to underlying structures, but why?". Indeed, by just
casting pointers to integers, we can go a long, long way of using this
API and porting existing apps.
Casting pointers to and from integers is legal, but implementation
defined (c99 p5 p6). We should avoid implementation defined
behaviour in the language where possible, especially in public APIs.


Join to automatically receive all group messages.