Re:Show HN: Chan – pure C implementation of Go channels
by millstone on Friday August 29, 2014 @07:31PM
(#8245006)
What eps means is that, currently you have a pointer to a mutex in your struct:
And initialize it like so:
eps's suggestion is to put the mutex directly in the struct:
and initialize it by passing its address to pthread_mutex_init:
that saves some mallocs and dereferences. If you are new to C, the notion of taking the address of fields in a struct may be unnerving, but you get used to it :)
[ Parent
| on HN ]
There are no comments on this comment yet.