Skip to content

Conversation

@Pawel82S
Copy link

Without this changes it doesn't compile with developement version of Zig-0.15

@hazeycode hazeycode requested a review from Copilot July 20, 2025 16:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the zstbi Zig library to be compatible with the development version of Zig 0.15, which introduced breaking changes to the Allocator interface. The changes specifically address the new alignment handling in Zig's memory allocation system.

  • Updates memory alignment constant from integer literal to the new std.mem.Alignment type
  • Modifies alignment usage in memory operations to use the new .toByteUnits() method
  • Updates minimum Zig version requirement and project version metadata

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/zstbi.zig Updates memory alignment constant and alignment usage in allocator functions
build.zig.zon Updates minimum Zig version requirement to 0.15.0-dev
.zigversion Updates project Zig version from 0.14.0 to 0.15.0-dev

var mem_allocations: ?std.AutoHashMap(usize, usize) = null;
var mem_mutex: std.Thread.Mutex = .{};
const mem_alignment = 16;
const mem_alignment = std.mem.Alignment.@"16";
Copy link

Copilot AI Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The quoted identifier syntax @"16" is unnecessary here. Use the cleaner syntax: std.mem.Alignment.from(16) or std.mem.Alignment.of(16) if available in Zig 0.15.

Copilot uses AI. Check for mistakes.
@hazeycode
Copy link
Member

Resolved by #6

@hazeycode hazeycode closed this Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants