]> Cypherpunks repositories - gostls13.git/commit
regexp: Regexp shouldn't keep references to inputs
authorOleg Bulatov <oleg@bulatov.me>
Fri, 23 Feb 2018 15:55:19 +0000 (16:55 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 23 Feb 2018 16:58:48 +0000 (16:58 +0000)
commit7263540146c75de8037501b3d6fb64f59a0d1956
treec5cd5671c437e6bd17b3634d378ffda098905740
parent37a038a3dcbba7148b841e31522b33476ee6ad44
regexp: Regexp shouldn't keep references to inputs

If you try to find something in a slice of bytes using a Regexp object,
the byte array will not be released by GC until you use the Regexp object
on another slice of bytes. It happens because the Regexp object keep
references to the input data in its cache.

Change-Id: I873107f15c1900aa53ccae5d29dbc885b9562808
Reviewed-on: https://go-review.googlesource.com/96715
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/regexp/regexp.go