test whole program

This commit is contained in:
2025-08-11 13:48:55 +01:00
parent 213f7ae15b
commit 8934878f94
3 changed files with 197 additions and 16 deletions

View File

@@ -142,7 +142,7 @@ int MallocCounter;
size_t sizeUsed;
static void INITAlloc(void) {
INITAlloc(void) {
size_t sz;
// Pre Allocate 600 MB
@@ -181,7 +181,7 @@ static void INITAlloc(void) {
}
// Quick malloc implementation with mmap
void* malloc(size_t sz)
void* MALLOCCHERI(size_t sz)
{
sz = __builtin_align_up(sz, _Alignof(max_align_t));
@@ -201,17 +201,17 @@ void* malloc(size_t sz)
}
// Quick cheri free implementation
// void free(void *ptr) {
void FREECHERI(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);
}
static int
pagesizes(size_t ps[MAXPAGESIZES])
@@ -230,8 +230,7 @@ pagesizes(size_t ps[MAXPAGESIZES])
return (pscnt);
}
__attribute__((constuctor))
static INITREGULARALLOC(void) {
INITREGULARALLOC(void) {
size_t sz;
// Hard-coded for 1GB huge page
sz = 1073741824;