Problem
codedb does not compile or run on Windows. The build system, stack allocation, and heap allocation strategies are Linux/macOS-only:
- Default Windows stack is 1MB vs Linux 8MB — LLVM merges all command branch frames into one ~128MB frame, causing
STATUS_STACK_OVERFLOW
EventQueue stores 4096 × ~1KB FsEvent inline (~4MB on stack) — exceeds Windows stack
- Frequency table working buffers (
[256][256]u64 = 512KB + [256][256]u16 = 128KB) are stack-allocated
std.fs.max_path_bytes is 32KB on Windows vs 4KB on POSIX — path buffers blow the stack when multiplied across structs
Expected Behavior
zig build -Dtarget=x86_64-windows cross-compiles successfully. On Windows, codedb <root> tree runs without stack overflow.
Scope
build.zig: set exe.stack_size = 8MB for Windows targets
src/compat.zig: add path_buf_size constant (1024 on Windows, max_path_bytes elsewhere)
src/main.zig: noinline trampoline to prevent LLVM frame merging; fix double scan_thread.join() (UB on all platforms)
src/watcher.zig: heap-allocate EventQueue events array via page_allocator; use path_buf_size for FsEvent.path_buf
src/index.zig: heap-allocate frequency table counts and out buffers
src/tests.zig: update 3 EventQueue tests to use init()/deinit() API
Problem
codedb does not compile or run on Windows. The build system, stack allocation, and heap allocation strategies are Linux/macOS-only:
STATUS_STACK_OVERFLOWEventQueuestores 4096 × ~1KBFsEventinline (~4MB on stack) — exceeds Windows stack[256][256]u64= 512KB +[256][256]u16= 128KB) are stack-allocatedstd.fs.max_path_bytesis 32KB on Windows vs 4KB on POSIX — path buffers blow the stack when multiplied across structsExpected Behavior
zig build -Dtarget=x86_64-windowscross-compiles successfully. On Windows,codedb <root> treeruns without stack overflow.Scope
build.zig: setexe.stack_size = 8MBfor Windows targetssrc/compat.zig: addpath_buf_sizeconstant (1024 on Windows,max_path_byteselsewhere)src/main.zig:noinlinetrampoline to prevent LLVM frame merging; fix doublescan_thread.join()(UB on all platforms)src/watcher.zig: heap-allocateEventQueueevents array viapage_allocator; usepath_buf_sizeforFsEvent.path_bufsrc/index.zig: heap-allocate frequency tablecountsandoutbufferssrc/tests.zig: update 3EventQueuetests to useinit()/deinit()API