Commit Graph

4 Commits

Author SHA1 Message Date
Claude Bot
bd90052694 Use low alignment bits instead of truncating high pointer bits
Changed PackedNext implementation to preserve ARM TBI/PAC/MTE pointer metadata:
- Store full usize pointer with auto_delete flag in LOW alignment bit (not high bit)
- ConcurrentTask is 8-byte aligned (contains u64 Task), so low bit is guaranteed zero
- Use enum(usize) { zero = 0, _ } for type safety and clean initialization syntax
- All atomic operations use usize (instead of u64) with @intFromEnum/@enumFromInt
- Masks: AUTO_DELETE_MASK=0x1, POINTER_MASK=~0x1

Benefits:
- Preserves all high pointer metadata (ARM pointer authentication, tagging, etc.)
- Uses guaranteed-zero low alignment bits instead of truncating address space
- Type-safe enum wrapper prevents accidental misuse
- Clean .zero initialization syntax
2025-11-03 03:18:20 +00:00
Claude Bot
0c52688060 Reduce ConcurrentTask size from 24 to 16 bytes by packing auto_delete
Pack the auto_delete boolean into the lowest bit of the next pointer in
ConcurrentTask, reducing memory usage by 33% (from 24 to 16 bytes).

Implementation details:
- Created PackedNext struct that packs u63 pointer + bool into u64
- Extended UnboundedQueue to support packed pointer types via
  UnboundedQueuePacked function
- Added getter/setter helpers to abstract packed vs unpacked access
- All atomic operations properly handle packed pointer unpacking
- Added compile-time assertion to ensure ConcurrentTask is 16 bytes

The next pointer uses only 63 bits since pointers on 64-bit systems
don't use the full address space, leaving the LSB for the auto_delete flag.
2025-11-02 11:38:24 +00:00
taylor.fish
76c623817f Fix Bake WatcherAtomics (#21328) 2025-07-23 22:23:35 -07:00
Zack Radisic
71e2161591 Split DevServer.zig into multiple files (#21299)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-23 05:29:22 +00:00