5748: Use a buffer pool instead of calling runtime.GC() during each GET.
[arvados.git] / services / keepstore / volume_test.go
index 66e0810c972a86c59603f3ab40498e264081072a..261501992f8080110062cc7be7a1828052f24014 100644 (file)
@@ -65,7 +65,9 @@ func (v *MockVolume) Get(loc string) ([]byte, error) {
        if v.Bad {
                return nil, errors.New("Bad volume")
        } else if block, ok := v.Store[loc]; ok {
-               return block, nil
+               buf := bufs.Get(len(block))
+               copy(buf, block)
+               return buf, nil
        }
        return nil, os.ErrNotExist
 }