gms: fix missing initialisation

This commit is contained in:
mappu 2017-05-16 19:47:50 +12:00
parent dc31787526
commit a9158c3a0c

View File

@ -18,6 +18,12 @@ type GoMemoryStore struct {
next int64 next int64
} }
func NewGoMemoryStore() *GoMemoryStore {
ret := GoMemoryStore{}
ret.items = make(map[int64]interface{})
return &ret
}
func (this *GoMemoryStore) Put(itm interface{}) ObjectReference { func (this *GoMemoryStore) Put(itm interface{}) ObjectReference {
this.mtx.Lock() this.mtx.Lock()
defer this.mtx.Unlock() defer this.mtx.Unlock()
@ -43,4 +49,4 @@ func (this *GoMemoryStore) Delete(i ObjectReference) {
delete(this.items, int64(i)) delete(this.items, int64(i))
} }
var gms GoMemoryStore var gms = NewGoMemoryStore()