Open
Conversation
c64bc95 to
591577f
Compare
Add experimental Windows support for the Mesh memory allocator: Platform abstraction: - Add Windows implementations for virtual memory operations (VirtualAlloc2, MapViewOfFile3) - Add vectored exception handler for meshing fault handling - Add Windows memory stats via GetProcessMemoryInfo - Abstract file handle type for cross-platform memfd/pagefile support Compiler compatibility (MSVC): - Replace GCC builtins with MSVC intrinsics (__popcnt64, _BitScanForward64, etc.) - Add Windows type definitions (ssize_t, pid_t) - Handle attribute syntax differences between compilers - Add pthread compatibility layer using Windows TLS API Build system: - Add Windows targets to Bazel BUILD file (mesh.dll, mesh_static_windows) - Add Windows configuration to CMakeLists.txt - Link against kernel32, psapi, advapi32 Debug infrastructure: - Add malloc-free debug printf using vendored printf library - Guard all debug instrumentation with MESH_DEBUG_VERBOSE Meshing on Windows requires Windows 10 version 1803+ for page-granular file mapping. Older versions fall back to allocation-only mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
dbba7a7 to
942901b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Windows platform support to the Mesh allocator. The port includes:
src/platform/) for cross-platform memory operationsNew Files
src/platform/vmem_windows.cc- Modern Windows memory APIs with fallback for older Windowssrc/platform/exception_handler_windows.cc- VEH for meshing page faultssrc/runtime_windows.cc- Windows-specific runtime initializationsrc/memory_stats_windows.cc- RSS measurement via PSAPIsrc/testing/fragmenter_windows.cc- Windows fragmentation testsrc/debug_printf.h,printf.c,putchar.c- Malloc-free debug outputBuild Instructions
Requirements
Test plan
🤖 Generated with Claude Code