diff --git a/benchmarks/allocator/allocator_shared_object_file.c b/benchmarks/allocator/allocator_shared_object_file.c index d1b6836..49bb96f 100644 --- a/benchmarks/allocator/allocator_shared_object_file.c +++ b/benchmarks/allocator/allocator_shared_object_file.c @@ -256,42 +256,42 @@ static void INITREGULARALLOC(void) { int notrun = 0; // Quick malloc implementation with mmap -void *malloc(size_t sz) -{ - // If malloc is called for the first time then allocate huge page -// if (notrun == 0) { -// INITREGULARALLOC(); -// notrun = 1; -// } - sz = __builtin_align_up(sz, _Alignof(max_align_t)); +// void *malloc(size_t sz) +// { +// // If malloc is called for the first time then allocate huge page +// // if (notrun == 0) { +// // INITREGULARALLOC(); +// // notrun = 1; +// // } +// sz = __builtin_align_up(sz, _Alignof(max_align_t)); - // printf("%d \n", sz); - printf("%d Malloc counter\n", MallocCounter); +// // printf("%d \n", sz); +// // printf("%d Malloc counter\n", MallocCounter); - MallocCounter -= sz; - void *ptrLink = &ptr[MallocCounter]; - ptrLink = cheri_setbounds(ptrLink, sz); +// MallocCounter -= sz; +// void *ptrLink = &ptr[MallocCounter]; +// ptrLink = cheri_setbounds(ptrLink, sz); - return ptrLink; +// return ptrLink; -// if (heap + sz > heap_start + HEAP_SIZE) return NULL; -// heap += sz; -// return heap - sz; +// // if (heap + sz > heap_start + HEAP_SIZE) return NULL; +// // heap += sz; +// // return heap - sz; -} +// } -// Quick cheri free implementation -void free(void *ptr) { +// // Quick cheri free implementation +// void free(void *ptr) { - // printf("free called \n"); +// // printf("free called \n"); - // get bounds from - int len = cheri_getlen(ptr); +// // get bounds from +// int len = cheri_getlen(ptr); - // printf("free len %d \n", len); +// // printf("free len %d \n", len); - munmap(ptr, len); -} +// munmap(ptr, len); +// } // Standard Alloc // void* MALLOCREGULAR(size_t sz) {