Reduce dependence on C++ runtime

If the external thread statics are used, then
we don't need to include some C++ runtime
concepts. This refactoring moves some global initialization under
conditional compilation.
This commit is contained in:
Matthew Parkinson
2020-02-26 17:55:29 +00:00
parent 3775a625a4
commit 9f53ec0ef8
10 changed files with 114 additions and 36 deletions

View File

@@ -19,6 +19,8 @@ extern "C" const void* __oe_get_heap_end()
extern "C" void* oe_memset(void* p, int c, size_t size)
{
std::cout << "Memset " << p << " - " << size << std::endl;
return memset(p, c, size);
}
@@ -30,7 +32,7 @@ extern "C" void oe_abort()
using namespace snmalloc;
int main()
{
MemoryProviderStateMixin<DefaultPal> mp;
auto& mp = *MemoryProviderStateMixin<DefaultPal>::make();
// 28 is large enough to produce a nested allocator.
// It is also large enough for the example to run in.