Skip to content

This is fix for Zig developement branch that changed Allocator interface #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 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

@@ -380,7 +380,7 @@ pub fn setFlipVerticallyOnWrite(should_flip: bool) void {
var mem_allocator: ?std.mem.Allocator = null;
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
Preview

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.

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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy