Commit 29de60e
committed
Relax over-strict alignment test on small arrays
This alignment test was introduced in gh-140557 with the intention of
preventing empty-allocation optimisations from introducing odd-aligned
pointers (as had previously been observed in such an optimisation for
the empty `bytearray`, used in the Pickle v5 protocol). The test was
over-specified, however, and compared to the maximum platform alignment,
even though the requirements on allocators in general is only that the
allocation is aligned for all data types that would in the requested
allocation.
This test could fail on 32-bit platforms using `mimalloc` for
single-byte array elements (e.g. 'B'), as the tiny allocation region
only enforced 4-byte alignment, not the 8-byte maximum platform
alignment of the `double` type.1 parent 4141f0a commit 29de60e
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4465 | 4465 | | |
4466 | 4466 | | |
4467 | 4467 | | |
4468 | | - | |
4469 | | - | |
4470 | | - | |
| 4468 | + | |
| 4469 | + | |
| 4470 | + | |
4471 | 4471 | | |
4472 | 4472 | | |
4473 | 4473 | | |
| |||
4476 | 4476 | | |
4477 | 4477 | | |
4478 | 4478 | | |
4479 | | - | |
| 4479 | + | |
| 4480 | + | |
4480 | 4481 | | |
4481 | | - | |
| 4482 | + | |
| 4483 | + | |
4482 | 4484 | | |
4483 | 4485 | | |
4484 | 4486 | | |
| |||
0 commit comments