test whole program

This commit is contained in:
2025-08-11 13:36:12 +01:00
parent 032056ab47
commit 772131d9a8

View File

@@ -180,6 +180,8 @@ static size_t sizeUsed;
// }
static int notrun = 0;
static int
pagesizes(size_t ps[MAXPAGESIZES])
{
@@ -252,17 +254,17 @@ static void INITREGULARALLOC(void) {
}
MallocCounter = (int)sz;
notrun = 1;
}
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;
// }
if (notrun == 0) {
INITREGULARALLOC();
}
sz = __builtin_align_up(sz, _Alignof(max_align_t));
// printf("%d \n", sz);
@@ -281,17 +283,17 @@ void* malloc(size_t sz)
}
// Quick cheri free implementation
// void free(void *ptr) {
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) {