mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 03:48:42 +03:00
Added cleanup to test
This commit is contained in:
parent
39f9fb1fbd
commit
99ea9e6c60
2 changed files with 7 additions and 1 deletions
|
@ -63,6 +63,11 @@ static void* atomic_exchange_ptr(volatile void** p, void* newval);
|
|||
|
||||
typedef uintptr_t* random_t;
|
||||
|
||||
void memory_cleanup(void* user_data, void* ptr, size_t size) {
|
||||
(void)user_data;
|
||||
memset(ptr, 0, size);
|
||||
}
|
||||
|
||||
static uintptr_t pick(random_t r) {
|
||||
uintptr_t x = *r;
|
||||
#if (UINTPTR_MAX > UINT32_MAX)
|
||||
|
@ -218,6 +223,7 @@ static void test_leak(void) {
|
|||
#endif
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
mi_register_user_cleanup(memory_cleanup, NULL);
|
||||
// > mimalloc-test-stress [THREADS] [SCALE] [ITER]
|
||||
if (argc >= 2) {
|
||||
char* end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue