MemArena/LazyMemoryRegion: Add EnsureMemoryPagesWritable function to ensure a region of bytes is writable without the caller needing to be aware of the windows-only BLOCK_SIZE value.

This commit is contained in:
Jordan Woyak
2025-11-23 05:17:22 -06:00
parent be0c852cd6
commit fbb864a0b5
+8
View File
@@ -187,6 +187,14 @@ public:
#endif
}
void EnsureMemoryPagesWritable(size_t offset, size_t size)
{
#ifdef _WIN32
for (const auto end_offset = offset + size; offset < end_offset; offset += BLOCK_SIZE)
EnsureMemoryPageWritable(offset);
#endif
}
private:
void* m_memory = nullptr;
size_t m_size = 0;