projects
/
lightning.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df2c5ad
)
Move alloc/copy out of lock.
author
Tom Clegg <tom@tomclegg.ca>
Thu, 17 Jun 2021 15:13:13 +0000
(11:13 -0400)
committer
Tom Clegg <tom@tomclegg.ca>
Thu, 17 Jun 2021 15:13:13 +0000
(11:13 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
tilelib.go
patch
|
blob
|
history
diff --git
a/tilelib.go
b/tilelib.go
index 8960d0e86d8659bf94335ab0bb86b8b5c4aced11..cc4e5c2a60dabb32b0e4afac9f0231f8bf67bea5 100644
(file)
--- a/
tilelib.go
+++ b/
tilelib.go
@@
-713,11
+713,12
@@
func (tilelib *tileLibrary) getRef(tag tagID, seq []byte) tileLibRef {
vlock.Unlock()
if tilelib.retainTileSequences && !dropSeq {
+ seqCopy := append([]byte(nil), seq...)
tilelib.mtx.Lock()
if tilelib.seq == nil {
tilelib.seq = map[[blake2b.Size256]byte][]byte{}
}
- tilelib.seq[seqhash] =
append([]byte(nil), seq...)
+ tilelib.seq[seqhash] =
seqCopy
tilelib.mtx.Unlock()
}