Closed zakarumych closed 3 years ago
Did you enable "freelist"
feature?
My bad, no more avoidable allocations here, good job !!
However, I get panicked at 'attempt to subtract with overflow', gpu-alloc/src/freelist.rs:177:21
when I close my window.
Right. I've copied a piece of code where return statements prevented block size to be added to total
field. Should be fixed now
I still get the panic (at line 175).
Great job !! Sounds good here !!
This is needed to fix gfx-rs/wgpu#1242. Will you release a new version soon ?
Thanks for providing test case.
It's scary to see how much this PR was changing in flight. This crate needs more tests, fuzzying, and other means of ensuring correctness.
@kvark I totally agree with you. There's few simple tests, but they are clearly not enough.
The code is self-checking with debug assertions everywhere, but this particular field I was struggling with is used as a hint and it's hard to check its value for validity (except counting all free blocks in array).
But better tests are nice to have. It would be great if you could provide some input on how they could be made.
I still get a second memory allocation that should not happen, even with the just pushed commit.