1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: zero out internal map/array pointers on m.free(), to reduce the work for the GC mark phase for non escaping maps/arrays, used in hot loops (#18415)

This commit is contained in:
Delyan Angelov
2023-06-14 15:00:36 +03:00
committed by GitHub
parent 4ba4fe7c25
commit 6806086bf1
3 changed files with 30 additions and 6 deletions

View File

@ -1838,6 +1838,7 @@ pub fn (s &string) free() {
unsafe {
// C.printf(c's: %x %s\n', s.str, s.str)
free(s.str)
s.str = nil
}
s.is_lit = -98761234
}