aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2022-06-02 09:54:12 -0400
committerGopher Robot <gobot@golang.org>2022-08-16 16:27:35 +0000
commita45bbeae339cd51b60fc59f13da02111f3fc8851 (patch)
tree5358957472430059b41276bf9254554f63e1bb1e /api
parent98f3eb2d3edc00ac3c39f23db157b42d14fe6726 (diff)
downloadgo-a45bbeae339cd51b60fc59f13da02111f3fc8851.tar.xz
go/token: add (*FileSet).RemoveFile(*File) method
The design of FileSet encourages it to be used as a global variable. Each call to AddFile consumes about 3KB, that is never returned, even after an application no longer cares about the File. This change adds a RemoveFile method that a long-running application can use to release a File that is no longer needed, saving memory. Fixes golang/go#53200 Change-Id: Ifd34d650fe0d18b1395f922a4cd02a535afbe560 Reviewed-on: https://go-review.googlesource.com/c/go/+/410114 Auto-Submit: Alan Donovan <adonovan@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'api')
-rw-r--r--api/next/53200.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/api/next/53200.txt b/api/next/53200.txt
new file mode 100644
index 0000000000..f1ecb17a21
--- /dev/null
+++ b/api/next/53200.txt
@@ -0,0 +1 @@
+pkg go/token, method (*FileSet) RemoveFile(*File) #53200