gms: fix missing initialisation

This commit is contained in:
mappu 2017-05-16 19:47:50 +12:00
parent dc31787526
commit a9158c3a0c
1 changed files with 7 additions and 1 deletions

View File

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