1
0
mirror of https://github.com/golang/go synced 2024-11-11 21:20:21 -07:00
go/api/next
Alan Donovan a45bbeae33 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>
2022-08-16 16:27:35 +00:00
..
41773.txt net/http: add Server.DisableOptionsHandler for custom handling of OPTIONS * 2022-08-15 18:57:35 +00:00
45038.txt bytes: add Clone function 2022-08-15 19:17:20 +00:00
51668.txt fmt: add a function to recover the original format string given a State 2022-08-06 09:19:31 +00:00
52221.txt crypto/ecdh: new package 2022-08-12 00:03:39 +00:00
52746.txt time: add DateTime, DateOnly, and TimeOnly 2022-08-09 14:33:24 +00:00
53200.txt go/token: add (*FileSet).RemoveFile(*File) method 2022-08-16 16:27:35 +00:00
54222.txt debug/elf: add new-style LoongArch reloc types 2022-08-11 19:32:40 +00:00
54251.txt debug/pe: add IMAGE_FILE_MACHINE_RISCV{32,64,128} 2022-08-09 01:21:43 +00:00