mirror of
https://github.com/storytold/craft-libs.git
synced 2026-12-01 02:36:54 +01:00
`zeroed` and `refill_zeroed` filled each image buffer with `par_extend(repeat_n(0u8, len))`, which has no minimum piece length. When workers stole from each other, rayon kept splitting the buffer, and on a pool with 128 or more workers the nested splits overflowed a worker's 2 MiB stack. The fax page test `a_blank_fax_page_wider_than_4096_px_passes_the_bomb_guard` aborted this way on a 192-core host. Both functions now call `extend_zeros`, which sets `with_min_len` to 1 MiB. A unit test zeroes 64 MiB on a pool of 256 workers with 256 KiB stacks; without the change it aborts with a stack overflow.