Previously empty buffers would raise alignment errors This is because when Python makes an empty buffer, apparently the pointer field is allowed to contain random garbage, which in particular won't be aligned.
(selenium)
| 380 | |
| 381 | @run_in_pyodide |
| 382 | def test_get_empty_buffer(selenium): |
| 383 | """Previously empty buffers would raise alignment errors |
| 384 | |
| 385 | This is because when Python makes an empty buffer, apparently the pointer |
| 386 | field is allowed to contain random garbage, which in particular won't be aligned. |
| 387 | """ |
| 388 | from array import array |
| 389 | |
| 390 | from pyodide.code import run_js |
| 391 | |
| 392 | a = array("Q") |
| 393 | run_js( |
| 394 | """ |
| 395 | (a) => { |
| 396 | let b = a.getBuffer(); |
| 397 | b.release(); |
| 398 | } |
| 399 | """ |
| 400 | )(a) |
| 401 | |
| 402 | |
| 403 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…