Closed goldpasser closed 1 year ago
是的
On Sun, Jun 25, 2023, 15:28 goldpasser @.***> wrote:
golang/go#54650 https://github.com/golang/go/issues/54650 https://natan36.medium.com/gos-memory-leak-caused-by-slice-742d668bcfa6 如果Vector存放的是指针,删除有可能内存泄露。
— Reply to this email directly, view it on GitHub https://github.com/chen3feng/stl4go/issues/117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPH4SWZONR3JK3UIKTWBV3XM7SDTANCNFSM6AAAAAAZS7L4ZY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
有什么好的方案吗?
Pop和Remove确实会,我改为用零值填充
好像也只能这样了
https://github.com/golang/go/issues/54650 https://natan36.medium.com/gos-memory-leak-caused-by-slice-742d668bcfa6 如果Vector存放的是指针,删除有可能内存泄露。