| ... | ... | @@ -1066,10 +1066,11 @@ pub fn protectMemory( |
| 1066 | 1066 | return error.UnsupportedOperation; |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | var test_page: [std.heap.page_size_max]u8 align(std.heap.page_size_max) = undefined; |
| 1070 | |
| 1069 | 1071 | test lockMemory { |
| 1070 | | var page: [std.heap.page_size_min]u8 align(std.heap.page_size_min) = undefined; |
| 1071 | | lockMemory(&page, .{}) catch return error.SkipZigTest; |
| 1072 | | unlockMemory(&page) catch return error.SkipZigTest; |
| 1072 | lockMemory(&test_page, .{}) catch return error.SkipZigTest; |
| 1073 | unlockMemory(&test_page) catch return error.SkipZigTest; |
| 1073 | 1074 | } |
| 1074 | 1075 | |
| 1075 | 1076 | test lockMemoryAll { |
| ... | ... | @@ -1078,8 +1079,6 @@ test lockMemoryAll { |
| 1078 | 1079 | } |
| 1079 | 1080 | |
| 1080 | 1081 | test protectMemory { |
| 1081 | | if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; // TODO |
| 1082 | | var page: [std.heap.page_size_min]u8 align(std.heap.page_size_min) = undefined; |
| 1083 | | protectMemory(&page, .{}) catch return error.SkipZigTest; |
| 1084 | | protectMemory(&page, .{ .read = true, .write = true }) catch return error.SkipZigTest; |
| 1082 | protectMemory(&test_page, .{}) catch return error.SkipZigTest; |
| 1083 | protectMemory(&test_page, .{ .read = true, .write = true }) catch return error.SkipZigTest; |
| 1085 | 1084 | } |