gochatai/pachi_py/pachi/distributed/protocol.c
/* Allocate buffers for a slave thread. The state should have been
 * initialized already as a copy of the default slave state.
 * slave_lock is not held on either entry or exit of this function. */
Allocate buffers for a slave thread. The state should have been
initialized already as a copy of the default slave state.
slave_lock is not held on either entry or exit of this function.
Allocate buffers for a slave thread . The state should have been initialized already as a copy of the default slave state . slave_lock is not held on either entry or exit of this function .
static void
slave_state_alloc(struct slave_state *sstate)
{
	for (int n = 0; n < BUFFERS_PER_SLAVE; n++) {
		sstate->b[n].buf = malloc2(sstate->max_buf_size);
		sstate->b[n].owner = sstate->thread_id;
	}
	if (sstate->alloc_hook) sstate->alloc_hook(sstate);
}
static void slave_state_alloc ( struct slave_state * sstate ) { for ( int n = 0 ; n < BUFFERS_PER_SLAVE ; n ++ ) { sstate -> b [ n ] . buf = malloc2 ( sstate -> max_buf_size ) ; sstate -> b [ n ] . owner = sstate -> thread_id ; } if ( sstate -> alloc_hook ) sstate -> alloc_hook ( sstate ) ; }
Allocate buffers for a slave thread.
Allocate buffers for a slave thread .