Repository navigation
Commit 622ca48
committed
BUG: Make mmap handling safer in frombuffer
`frombuffer` always used the old buffer protocol, but this is not
safe in some cases when combined with the "new" one.
The main/only use-case that was ever found for this is that enabling
the new buffer protocol (by going through a memoryview) protects
users from accidentally closing memorymaps while they are still used.
Closes numpygh-95371 parent aed6c57 commit 622ca48
3 files changed
Lines changed: 54 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1560 | 1564 | | |
1561 | 1565 | | |
1562 | 1566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3683 | 3683 | | |
3684 | 3684 | | |
3685 | 3685 | | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
3686 | 3705 | | |
3687 | 3706 | | |
3688 | 3707 | | |
3689 | 3708 | | |
| 3709 | + | |
3690 | 3710 | | |
3691 | 3711 | | |
3692 | 3712 | | |
3693 | 3713 | | |
3694 | 3714 | | |
3695 | 3715 | | |
3696 | | - | |
3697 | | - | |
3698 | | - | |
3699 | | - | |
3700 | | - | |
3701 | | - | |
| 3716 | + | |
3702 | 3717 | | |
3703 | 3718 | | |
3704 | 3719 | | |
3705 | 3720 | | |
3706 | 3721 | | |
3707 | 3722 | | |
| 3723 | + | |
3708 | 3724 | | |
3709 | 3725 | | |
3710 | 3726 | | |
| |||
3717 | 3733 | | |
3718 | 3734 | | |
3719 | 3735 | | |
| 3736 | + | |
3720 | 3737 | | |
3721 | 3738 | | |
3722 | 3739 | | |
3723 | 3740 | | |
3724 | 3741 | | |
3725 | 3742 | | |
3726 | 3743 | | |
| 3744 | + | |
3727 | 3745 | | |
3728 | 3746 | | |
3729 | 3747 | | |
| |||
3734 | 3752 | | |
3735 | 3753 | | |
3736 | 3754 | | |
| 3755 | + | |
3737 | 3756 | | |
3738 | 3757 | | |
3739 | 3758 | | |
| |||
3743 | 3762 | | |
3744 | 3763 | | |
3745 | 3764 | | |
| 3765 | + | |
3746 | 3766 | | |
3747 | 3767 | | |
3748 | 3768 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
5475 | 5476 | | |
5476 | 5477 | | |
5477 | 5478 | | |
| 5479 | + | |
| 5480 | + | |
| 5481 | + | |
| 5482 | + | |
| 5483 | + | |
| 5484 | + | |
| 5485 | + | |
5478 | 5486 | | |
5479 | 5487 | | |
5480 | 5488 | | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
5481 | 5505 | | |
5482 | 5506 | | |
5483 | 5507 | | |
| |||
0 commit comments