rockorager / libvaxis

a modern tui library written in zig
https://rockorager.github.io/libvaxis/
MIT License
463 stars 32 forks source link

fix: use u64 for render_dur so that *Vaxis becomes align(8) #59

Closed robbielyman closed 4 months ago

robbielyman commented 4 months ago

on macOS, @alignOf(std.c.max_align_t) is 8, while @alignOf(i128) is 16. since we moved to using std.time.Timer, render duration should always be an unsigned quantity.

this change is motivated by my seamstress project, which wants to use a Vaxis struct (well, something with a Vaxis struct as a field) as a Lua userdata. it turns out that Lua won't allocate at an alignment greater than @alignOf(std.c.max_align_t) even if you ask it to.