Historically, the majority of tests have been dependent on the
alloc_pages utility function. This has been troublesome due to it not
being able to generate adjacent pages with specific page permissions.
Therefore protect was used, rendering the utility function
self-reliant on the crate itself, therefore not isolating the test
fixture from the implementation.
This commit introduces an implementation of alloc_pages that is not
dependent on the library itself. This is achieved by identifying a
region with enough memory available, and allocating one page at a time
with the expected properties.
Historically, the majority of tests have been dependent on the
alloc_pages
utility function. This has been troublesome due to it not being able to generate adjacent pages with specific page permissions. Thereforeprotect
was used, rendering the utility function self-reliant on the crate itself, therefore not isolating the test fixture from the implementation.This commit introduces an implementation of
alloc_pages
that is not dependent on the library itself. This is achieved by identifying a region with enough memory available, and allocating one page at a time with the expected properties.