Commit Graph

5 Commits

Author SHA1 Message Date
anth64 22c7da4336 build: add -s flag to release builds
- Add symbol stripping (-s) to release builds
2026-01-31 21:55:40 +01:00
anth64 f331970ae2 refactor: optimize file watching and fix cross-platform reliability issues
Refactor memory allocation patterns:
- Replace realloc-in-loop with count-then-allocate pattern across all platforms
- Eliminate arbitrary buffer sizes (e.g., malloc(8 * ...)) in favor of exact counts
- Reduce allocation overhead by pre-counting items before malloc

Fix Windows file watching:
- Replace unreliable FindFirstChangeNotification with directory handle approach
- Add is_file_ready() to prevent events while compiler is still writing files
- Preserve timestamps when file is locked to retry on next poll
- Fix do-while loop in platform_directory_init_scan (was skipping first file)

Fix Linux inotify event handling:
- Consolidate DELETE+CREATE pairs into single RELOAD event
- Prevents duplicate events when compiler uses temp-file-and-rename pattern

Fix BSD/macOS kqueue implementation:
- Remove realloc loops from update_watches() and watch initialization
- Pre-count files before allocating file descriptor arrays

All platforms now correctly handle:
- Compiler overwrites (temp file operations)
- Manual copy/move operations
- Explicit file deletions

Tested on Linux, Windows 10, and FreeBSD.
2026-01-23 23:39:24 +01:00
anth64 93657d71e3 gmake file should now use native os commands for file management now 2026-01-23 07:37:52 +01:00
anth64 b4fbfebc85 build: remove -ldl from Windows target 2026-01-20 22:05:53 +01:00
anth64 bf5863fcb1 build: implement platform-agnostic build system
- Split Makefile into gmake.mk (Linux/Windows) and bmake.mk (BSD/macOS)
- Added config.mk for shared variables.
- Added build.sh and build.bat dispatchers.
- Retains old build behavior with dependency tracking.
2026-01-11 17:55:47 +01:00