Commit 1e45758
Remove Linux-only restriction from map_region on MultiUseSandbox (#1330)
* Remove Linux-only restriction from map_region on MultiUseSandbox
The map_region method and its tests were gated behind
#[cfg(target_os = "linux")] but the underlying VM trait
(VirtualMachine::map_memory) has implementations for KVM, MSHV, and
WHP (Windows). The method itself contains no platform-specific code.
- Remove #[cfg(target_os = "linux")] from map_region, its imports
(log_then_return, MemoryRegionFlags), and all related tests/helpers
- Fix region_for_memory helper to use platform-correct host base
type (HostRegionBase on Windows, usize on Linux)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
* Add cross-platform host_region_base/end helpers to SharedMemory
Replace platform-conditional #[cfg] blocks and verbose turbofish
calls with host_region_base() and host_region_end() on SharedMemory.
This simplifies mapping_at() and the test region_for_memory helper.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
---------
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent de7f940 commit 1e45758
2 files changed
Lines changed: 27 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | 724 | | |
730 | 725 | | |
731 | | - | |
| 726 | + | |
732 | 727 | | |
733 | 728 | | |
734 | 729 | | |
| |||
779 | 774 | | |
780 | 775 | | |
781 | 776 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
790 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
791 | 801 | | |
792 | 802 | | |
793 | 803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 38 | + | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
| |||
525 | 521 | | |
526 | 522 | | |
527 | 523 | | |
528 | | - | |
529 | 524 | | |
530 | 525 | | |
531 | 526 | | |
| |||
914 | 909 | | |
915 | 910 | | |
916 | 911 | | |
917 | | - | |
918 | 912 | | |
919 | | - | |
920 | 913 | | |
921 | 914 | | |
922 | 915 | | |
| |||
955 | 948 | | |
956 | 949 | | |
957 | 950 | | |
958 | | - | |
959 | 951 | | |
960 | 952 | | |
961 | 953 | | |
| |||
965 | 957 | | |
966 | 958 | | |
967 | 959 | | |
968 | | - | |
969 | 960 | | |
970 | 961 | | |
971 | 962 | | |
| |||
1227 | 1218 | | |
1228 | 1219 | | |
1229 | 1220 | | |
1230 | | - | |
1231 | 1221 | | |
1232 | 1222 | | |
1233 | 1223 | | |
| |||
1263 | 1253 | | |
1264 | 1254 | | |
1265 | 1255 | | |
1266 | | - | |
1267 | 1256 | | |
1268 | 1257 | | |
1269 | 1258 | | |
| |||
1312 | 1301 | | |
1313 | 1302 | | |
1314 | 1303 | | |
1315 | | - | |
1316 | 1304 | | |
1317 | 1305 | | |
1318 | 1306 | | |
| |||
1326 | 1314 | | |
1327 | 1315 | | |
1328 | 1316 | | |
1329 | | - | |
1330 | 1317 | | |
1331 | 1318 | | |
1332 | 1319 | | |
1333 | 1320 | | |
1334 | 1321 | | |
1335 | | - | |
1336 | 1322 | | |
1337 | 1323 | | |
1338 | | - | |
| 1324 | + | |
1339 | 1325 | | |
1340 | 1326 | | |
1341 | 1327 | | |
1342 | 1328 | | |
1343 | 1329 | | |
1344 | 1330 | | |
1345 | | - | |
1346 | 1331 | | |
1347 | 1332 | | |
1348 | 1333 | | |
1349 | 1334 | | |
1350 | 1335 | | |
1351 | | - | |
1352 | 1336 | | |
1353 | 1337 | | |
1354 | 1338 | | |
| |||
0 commit comments