Update for latest zig

This commit is contained in:
Sam Tebbs 2020-07-06 14:17:59 +01:00
parent 7204c422e0
commit d60164bec6
2 changed files with 21 additions and 5 deletions

View file

@ -314,7 +314,7 @@ pub fn VirtualMemoryManager(comptime Payload: type) type {
if (try self.bmp.isSet(entry)) {
// There will be an allocation associated with this virtual address
const allocation = self.allocations.get(vaddr) orelse unreachable;
const physical = allocation.value.physical;
const physical = allocation.physical;
defer physical.deinit();
const num_physical_allocations = physical.items.len;
for (physical.items) |block, i| {
@ -439,7 +439,7 @@ test "alloc and free" {
for (virtual_allocations.items) |alloc| {
const alloc_group = vmm.allocations.get(alloc);
std.testing.expect(alloc_group != null);
const physical = alloc_group.?.value.physical;
const physical = alloc_group.?.physical;
// We need to create a copy of the physical allocations since the free call deinits them
var physical_copy = std.ArrayList(usize).init(std.testing.allocator);
defer physical_copy.deinit();