Commit cb57760
feat: add Windows platform support
Add Windows port of the Mesh allocator with the following features:
- Platform abstraction layer (src/platform/) for cross-platform memory operations
- VirtualAlloc2/MapViewOfFile3 for page-granular meshing on Windows 10 1803+
- MSVC compiler compatibility (intrinsics, attributes, types)
- Windows threading (TLS via TlsAlloc, background mesh thread)
- Vectored Exception Handler for mesh write barriers
- CMake build support for Windows (mesh.dll, mesh_static.lib)
- Windows-specific memory stats (GetProcessMemoryInfo)
- Malloc-free debug printf using vendored printf library
New files:
- src/platform/vmem_windows.cc - Modern Windows memory APIs
- src/platform/exception_handler_windows.cc - VEH for meshing
- src/runtime_windows.cc - Windows-specific runtime
- src/memory_stats_windows.cc - RSS measurement
- src/testing/fragmenter_windows.cc - Windows test
- src/debug_printf.h, printf.c, putchar.c - Malloc-free debug output
Build: cmake -B build-win && cmake --build build-win --config Release
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 757d0f9 commit cb57760
File tree
35 files changed
+3911
-101
lines changed- src
- platform
- testing
35 files changed
+3911
-101
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
333 | 334 | | |
334 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
335 | 427 | | |
336 | 428 | | |
337 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
22 | 40 | | |
23 | 41 | | |
| 42 | + | |
24 | 43 | | |
25 | 44 | | |
| 45 | + | |
26 | 46 | | |
27 | 47 | | |
28 | 48 | | |
| 49 | + | |
29 | 50 | | |
| 51 | + | |
30 | 52 | | |
31 | | - | |
32 | | - | |
33 | 53 | | |
34 | 54 | | |
35 | 55 | | |
| |||
60 | 80 | | |
61 | 81 | | |
62 | 82 | | |
63 | | - | |
| 83 | + | |
64 | 84 | | |
65 | 85 | | |
66 | | - | |
| 86 | + | |
67 | 87 | | |
68 | 88 | | |
69 | 89 | | |
| |||
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
84 | | - | |
| 104 | + | |
85 | 105 | | |
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
90 | | - | |
| 110 | + | |
91 | 111 | | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
96 | | - | |
| 116 | + | |
97 | 117 | | |
98 | 118 | | |
99 | 119 | | |
| |||
106 | 126 | | |
107 | 127 | | |
108 | 128 | | |
109 | | - | |
| 129 | + | |
110 | 130 | | |
111 | 131 | | |
112 | 132 | | |
| |||
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
119 | | - | |
| 139 | + | |
120 | 140 | | |
121 | 141 | | |
122 | 142 | | |
| |||
130 | 150 | | |
131 | 151 | | |
132 | 152 | | |
133 | | - | |
134 | | - | |
| 153 | + | |
| 154 | + | |
135 | 155 | | |
136 | 156 | | |
137 | 157 | | |
138 | | - | |
| 158 | + | |
139 | 159 | | |
140 | 160 | | |
141 | 161 | | |
| |||
0 commit comments