diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-04-03 15:50:18 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-04-03 15:50:18 +0200 |
| commit | daddb06f88dd7403e1b558c4ca8595806e8f3da0 (patch) | |
| tree | 78c0fcf112beca0278ec04c12363f3127d215245 | |
| parent | 8ca8dabf8b91715c77611276ae3bfe1da24f8dbb (diff) | |
| download | allocbench-daddb06f88dd7403e1b558c4ca8595806e8f3da0.tar.gz allocbench-daddb06f88dd7403e1b558c4ca8595806e8f3da0.zip | |
fix larson delete not matching new[]
Thanks to Matthew Parkinson
see: https://github.com/daanx/mimalloc-bench/pull/14
| -rw-r--r-- | src/benchmarks/larson/larson.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/benchmarks/larson/larson.cc b/src/benchmarks/larson/larson.cc index 3da7a12..09bd885 100644 --- a/src/benchmarks/larson/larson.cc +++ b/src/benchmarks/larson/larson.cc @@ -117,7 +117,7 @@ void * operator new( unsigned int cb ) return pRet; } -void operator delete(void *pUserData ) +void operator delete[](void *pUserData ) { theFastHeap.Delete (pUserData) ; } @@ -133,7 +133,7 @@ void * operator new( unsigned int cb ) return pRet; } -void operator delete(void *pUserData ) +void operator delete[](void *pUserData ) { hdfree(pUserData) ; } @@ -359,7 +359,7 @@ void runloops(long sleep_cnt, int num_chunks ) for( cblks=0; cblks<num_chunks; cblks++){ victim = lran2(&rgen)%num_chunks ; #ifdef CPP - delete blkp[victim] ; + delete[] blkp[victim] ; #else free(blkp[victim]) ; #endif @@ -567,7 +567,7 @@ static void * exercise_heap( void *pinput) for( cblks=0; cblks<pdea->NumBlocks; cblks++){ victim = lran2(&pdea->rgen)%pdea->asize ; #ifdef CPP - delete pdea->array[victim] ; + delete[] pdea->array[victim] ; #else free(pdea->array[victim]) ; #endif @@ -653,7 +653,7 @@ static void warmup(char **blkp, int num_chunks ) for( cblks=0; cblks<4*num_chunks; cblks++){ victim = lran2(&rgen)%num_chunks ; #ifdef CPP - delete blkp[victim] ; + delete[] blkp[victim] ; #else free(blkp[victim]) ; #endif |
