Commit 20e22d4
runtime (gc_blocks.go): clear full size of allocation
This fixes a bug where runtime.alloc would not clear the padding from rounding the allocation up to a multiple of the block size.
The GC still has to scan this, and this could result in permanent false positives (and therefore memory leaks).
It also handles overflow in the size calculation.1 parent 9118e91 commit 20e22d4
2 files changed
+18
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
314 | 321 | | |
| 322 | + | |
315 | 323 | | |
316 | 324 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
320 | 328 | | |
| 329 | + | |
| 330 | + | |
321 | 331 | | |
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
326 | | - | |
| 336 | + | |
| 337 | + | |
327 | 338 | | |
328 | | - | |
329 | | - | |
330 | 339 | | |
331 | 340 | | |
332 | 341 | | |
| |||
0 commit comments