regexp: Regexp shouldn't keep references to inputs
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 <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
Run-TryBot: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

nawawi/go,nawawi/go,josharian/go,CAFxX/go,codestation/go,cloudflare/go,golang/go,codestation/go,CAFxX/go,codestation/go,CAFxX/go,Cofyc/go,nawawi/go,Cofyc/go,codestation/go,akutz/go,Cofyc/go,golang/go,nawawi/go,akutz/go,golang/go,CAFxX/go,CAFxX/go,golang/go,cloudflare/go,cloudflare/go,josharian/go,codestation/go,nawawi/go,akutz/go,cloudflare/go,codestation/go,golang/go,codestation/go,cloudflare/go,golang/go,akutz/go,josharian/go,josharian/go,akutz/go,CAFxX/go,josharian/go,CAFxX/go,nawawi/go,cloudflare/go,Cofyc/go,josharian/go,CAFxX/go,nawawi/go,golang/go,josharian/go,Cofyc/go,Cofyc/go,cloudflare/go,golang/go,codestation/go,akutz/go,Cofyc/go,nawawi/go,Cofyc/go,josharian/go,akutz/go,cloudflare/go,akutz/go