Currently guarded regions on Windows are represented as a Region, where protection is equal to the guarded region's underlying protection, and guarded set to true.
This might be confusing, since library users may only check for protection & Protection::READ or is_readable(), and thereafter assume the memory region is accessible.
Is it more ergonomic to discard the underlying protection of guarded pages, and merely set protection to Protection::NONE whilst also retaining the guarded boolean flag?
This would mean that information is lost, but would most likely result in fewer surprises for the user.
Currently guarded regions on Windows are represented as a
Region
, whereprotection
is equal to the guarded region's underlying protection, andguarded
set totrue
.This might be confusing, since library users may only check for
protection & Protection::READ
oris_readable()
, and thereafter assume the memory region is accessible.Is it more ergonomic to discard the underlying protection of guarded pages, and merely set
protection
toProtection::NONE
whilst also retaining theguarded
boolean flag?This would mean that information is lost, but would most likely result in fewer surprises for the user.