Plumb LocalState ptrs through to Pagemap accessors

David points out that we might not have a static way to get at the pagemap, so
it is potentially useful to pass pointers to state objects down from the
Allocators.
This commit is contained in:
Nathaniel Wesley Filardo
2021-08-24 16:34:30 +01:00
committed by Nathaniel Wesley Filardo
parent 3710e351fe
commit 3af9d35099
12 changed files with 141 additions and 75 deletions

View File

@@ -29,7 +29,7 @@ int main()
std::cout << "Allocated region " << oe_base << " - "
<< pointer_offset(oe_base, size) << std::endl;
CustomGlobals::init(oe_base, size);
CustomGlobals::init(nullptr, oe_base, size);
FixedAlloc a;
size_t object_size = 128;

View File

@@ -19,5 +19,6 @@ namespace snmalloc
extern "C" void oe_allocator_init(void* base, void* end)
{
snmalloc::CustomGlobals::init(base, address_cast(end) - address_cast(base));
snmalloc::CustomGlobals::init(
nullptr, base, address_cast(end) - address_cast(base));
}