3 ms·
My guess is that it just uses the existing finalizers and ensures the memory is overwritten. https://pkg.go.dev/runtime#SetFinalizer https://pkg.go.dev/runtime
by _cenw 10mo ago
My guess is that it just uses the existing finalizers and ensures the memory is overwritten.
https://pkg.go.dev/runtime#SetFinalizer https://pkg.go.dev/runtime#SetFinalizer
- tapirl 10mo agoSetFinalizer is deprecated by AddCleanup: https://pkg.go.dev/runtime#AddCleanup https://pkg.go.dev/runtime#AddCleanup AddCleanup might be too heavy, it is cheaper to just set a bit in the header/info zone of memory blocks.
- tracker1 10mo agoSame here, though I think that the GC will do a full run for all "secure" data that is clear regardless of GC timing.