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-01 17:26:20 -05:00
parent be0c852cd6
commit fbb864a0b5

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;