Enable a seconary allocator support (e.g. GWP-Asan) (#737)
This commit is contained in:
committed by
GitHub
parent
32495fd42d
commit
16b96245f6
@@ -76,12 +76,16 @@ namespace test
|
||||
size_t rand = (size_t)r.next();
|
||||
size_t oid = rand & (((size_t)1 << count_log) - 1);
|
||||
size_t* external_ptr = objects[oid];
|
||||
if (!alloc.is_snmalloc_owned(external_ptr))
|
||||
continue;
|
||||
size_t size = *external_ptr;
|
||||
size_t offset = (size >> 4) * (rand & 15);
|
||||
void* interior_ptr = pointer_offset(external_ptr, offset);
|
||||
void* calced_external = alloc.external_pointer(interior_ptr);
|
||||
if (calced_external != external_ptr)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user