示例#1
0
文件: frame.go 项目: chang290/server
func (fo *frameOpen) init(f *frame) {
	fo.frame = f
	fo.reads = sl.New(f.v.rng)
	fo.learntFutureReads = []*localAction{}
	fo.writes = sl.New(f.v.rng)
	fo.clientWrites = make(map[[common.ClientLen]byte]server.EmptyStruct)
}
示例#2
0
func NewResolver(rng *rand.Rand, hashCodes []common.RMId) *Resolver {
	indices := make([]uint8, len(hashCodes))
	for idx := range indices {
		indices[idx] = uint8(idx)
	}
	res := &Resolver{
		hashCodes:       make([]common.RMId, len(hashCodes)),
		removed:         sl.New(rng),
		straightIndices: indices,
	}
	copy(res.hashCodes, hashCodes)
	for idx, hc := range hashCodes {
		if hc == common.RMIdEmpty {
			res.removed.Insert(intKey(idx), true)
		}
	}
	return res
}
示例#3
0
文件: store.go 项目: dilgerma/scope
func newStore() *store {
	return &store{traces: skiplist.New(rand.New(rand.NewSource(0)))}
}