Enable a seconary allocator support (e.g. GWP-Asan) (#737)
This commit is contained in:
committed by
GitHub
parent
32495fd42d
commit
16b96245f6
@@ -23,7 +23,8 @@ namespace snmalloc
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef SNMALLOC_PASS_THROUGH
|
||||
#if defined(SNMALLOC_PASS_THROUGH) || \
|
||||
defined(SNMALLOC_ENABLE_GWP_ASAN_INTEGRATION)
|
||||
// This test does not make sense in pass-through
|
||||
return 0;
|
||||
#else
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "snmalloc/mem/secondary.h"
|
||||
#include "test/setup.h"
|
||||
|
||||
#include <iostream>
|
||||
@@ -38,18 +39,26 @@ int main()
|
||||
while (true)
|
||||
{
|
||||
auto r1 = a.alloc(object_size);
|
||||
|
||||
count += object_size;
|
||||
i++;
|
||||
|
||||
// Run until we exhaust the fixed region.
|
||||
// This should return null.
|
||||
if (r1 == nullptr)
|
||||
break;
|
||||
|
||||
if (!a.is_snmalloc_owned(r1))
|
||||
{
|
||||
a.dealloc(r1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i == 1024)
|
||||
{
|
||||
i = 0;
|
||||
std::cout << ".";
|
||||
}
|
||||
// Run until we exhaust the fixed region.
|
||||
// This should return null.
|
||||
if (r1 == nullptr)
|
||||
break;
|
||||
|
||||
if (oe_base > r1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user