Implemented LOG. Closes #159

This commit is contained in:
obscuren
2014-10-27 11:44:16 +01:00
parent 6623500c6b
commit 272d58662c
15 changed files with 81 additions and 11 deletions

View File

@@ -139,6 +139,18 @@ func (m *Memory) Get(offset, size int64) []byte {
return nil
}
func (self *Memory) Geti(offset, size int64) (cpy []byte) {
if len(self.store) > int(offset) {
s := int64(math.Min(float64(len(self.store)), float64(offset+size)))
cpy = make([]byte, size)
copy(cpy, self.store[offset:offset+s])
return
}
return
}
func (m *Memory) Len() int {
return len(m.store)
}