Skip to content

build: bump zwanzig to v0.8.0 and add config file#195

Merged
forketyfork merged 1 commit intomainfrom
bump-zwanzig-v0.7.0
Feb 4, 2026
Merged

build: bump zwanzig to v0.8.0 and add config file#195
forketyfork merged 1 commit intomainfrom
bump-zwanzig-v0.7.0

Conversation

@forketyfork
Copy link
Owner

@forketyfork forketyfork commented Feb 3, 2026

Summary

  • Bump zwanzig linter from v0.6.0 to v0.8.0
  • Add .zwanzig.json config file to the repository with resource models for SDL, TTF, and CoreFoundation APIs
  • Fix sentinel allocation bug in copySelectionToClipboard caught by the new sentinel-alloc checker

Changes

Zwanzig v0.8.0 Features

  • free_owned resource model kind for deinit methods
  • Sentinel-aware typing that catches allocation size mismatches

Bug Fix

The new sentinel-alloc checker caught a real bug: allocSentinel(u8, len, 0) allocates len+1 bytes but allocator.free(clipboard_text) only freed len bytes (the sentinel byte was leaked). Fixed by using regular alloc with manual null terminator.

Config File

The .zwanzig.json file defines resource models for:

  • SDL3: windows, renderers, textures, surfaces, cursors, IO streams
  • SDL3_ttf: font handles
  • CoreFoundation: CFRetain/CFRelease pairs

Test plan

  • zig build passes
  • zig build test passes
  • zig build lint passes (0 issues)

- Update zwanzig from v0.6.0 to v0.8.0
- Add .zwanzig.json config file with resource models for SDL, TTF, and
  CoreFoundation APIs
- Fix sentinel allocation bug in copySelectionToClipboard caught by new
  sentinel-alloc checker: allocSentinel allocates len+1 bytes but
  freeing the returned slice only frees len bytes
@forketyfork forketyfork changed the title build: bump zwanzig to v0.7.0 and add config file build: bump zwanzig to v0.8.0 and add config file Feb 4, 2026
@forketyfork forketyfork merged commit 3712b3b into main Feb 4, 2026
4 checks passed
@forketyfork forketyfork deleted the bump-zwanzig-v0.7.0 branch February 4, 2026 06:15
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