test whole program

This commit is contained in:
2025-08-11 13:34:51 +01:00
parent a6151b8e15
commit 032056ab47

View File

@@ -256,31 +256,31 @@ 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
// Quick cheri free implementation
// void free(void *ptr) {
// // printf("free called \n");