fix regressions on Windows from previous commit

master
Andrew Kelley 2019-03-15 18:57:07 -04:00
parent 9c13e9b7ed
commit 01fb421031
2 changed files with 3 additions and 2 deletions

View File

@ -143,8 +143,9 @@ pub const DirectAllocator = struct {
return result;
},
Os.windows => {
const self = @fieldParentPtr(DirectAllocator, "allocator", allocator);
if (old_mem.len == 0) return alloc(allocator, new_size, new_align);
const self = @fieldParentPtr(DirectAllocator, "allocator", allocator);
const old_adjusted_addr = @ptrToInt(old_mem.ptr);
const old_record_addr = old_adjusted_addr + old_mem.len;
const root_addr = @intToPtr(*align(1) usize, old_record_addr).*;

View File

@ -197,7 +197,7 @@ pub fn createWindowsEnvBlock(allocator: *mem.Allocator, env_map: *const BufMap)
i += 1;
result[i] = 0;
i += 1;
return allocator.shrink(u16, result, i);
return allocator.shrink(result, i);
}
pub fn windowsFindFirstFile(