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